From e02177f5b696f82e71794a321ff5c9f6ad2330c1 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Corvo Date: Fri, 14 Oct 2022 16:18:47 +0200 Subject: [PATCH] Chore rose storybook deprecations (#1371) * Deprecate correct blobs in main.js, postcss usage, hierarchy separators in styleguide and scoped blocks import --- addons/rose/.storybook/main.js | 5 +- .../rose/anonymous/index.stories.mdx | 24 +- .../components/rose/badge/index.stories.mdx | 78 +++--- .../components/rose/button/index.stories.mdx | 122 +++++---- .../rose/card/link/index.stories.mdx | 45 ++-- .../components/rose/cards/index.stories.mdx | 35 +-- .../rose/code-editor/index.stories.mdx | 4 +- .../rose/dialog/cover/index.stories.mdx | 18 +- .../components/rose/dialog/index.stories.mdx | 64 ++--- .../rose/dropdown/index.stories.mdx | 161 +++++++----- .../components/rose/footer/index.stories.mdx | 20 +- .../rose/form/actions/index.stories.mdx | 11 +- .../form/checkbox/group/index.stories.mdx | 4 +- .../rose/form/checkbox/index.stories.mdx | 88 ++++--- .../rose/form/errors/index.stories.mdx | 14 +- .../form/errors/message/index.stories.mdx | 14 +- .../rose/form/fieldset/index.stories.mdx | 4 +- .../rose/form/helper-text/index.stories.mdx | 30 ++- .../components/rose/form/index.stories.mdx | 84 +++--- .../rose/form/input/index.stories.mdx | 146 +++++------ .../rose/form/label/index.stories.mdx | 22 +- .../rose/form/radio/card/index.stories.mdx | 104 ++++---- .../rose/form/radio/group/index.stories.mdx | 239 +++++++++--------- .../rose/form/radio/radio/index.stories.mdx | 125 ++++----- .../rose/form/select/index.stories.mdx | 112 ++++---- .../rose/form/textarea/index.stories.mdx | 70 ++--- .../components/rose/frame/index.stories.mdx | 20 +- .../components/rose/header/index.stories.mdx | 60 +++-- .../components/rose/icon/index.stories.mdx | 34 +-- .../rose/layout/centered/index.stories.mdx | 12 +- .../rose/layout/global/index.stories.mdx | 12 +- .../rose/layout/page/index.stories.mdx | 12 +- .../rose/layout/sidebar/index.stories.mdx | 12 +- .../rose/link-button/index.stories.mdx | 139 +++++----- .../rose/list/key-value/index.stories.mdx | 27 +- .../components/rose/message/index.stories.mdx | 77 +++--- .../rose/nav/breadcrumbs/index.stories.mdx | 12 +- .../rose/nav/link/index.stories.mdx | 4 +- .../rose/nav/sidebar/sidebar.stories.mdx | 28 +- .../rose/nav/tabs/index.stories.mdx | 20 +- .../rose/notification/index.stories.mdx | 42 +-- .../rose/separator/index.stories.mdx | 14 +- .../components/rose/table/index.stories.mdx | 76 +++--- .../components/rose/toolbar/index.stories.mdx | 14 +- .../rose/toolbar/info/index.stories.mdx | 12 +- addons/rose/stories/colors.stories.mdx | 4 +- addons/rose/stories/sizing.stories.mdx | 4 +- addons/rose/stories/typography.stories.mdx | 4 +- 48 files changed, 1225 insertions(+), 1057 deletions(-) diff --git a/addons/rose/.storybook/main.js b/addons/rose/.storybook/main.js index 07577d6cc..6238320b3 100644 --- a/addons/rose/.storybook/main.js +++ b/addons/rose/.storybook/main.js @@ -2,7 +2,7 @@ const namedBlockPolyfill = require('ember-named-blocks-polyfill/lib/named-blocks module.exports = { stories: [ - '../addon/components/**/*.stories.(js|mdx)', + '../addon/components/**/*.stories.@(js|mdx)', '../stories/**/*.stories.mdx', ], addons: [ @@ -14,4 +14,7 @@ module.exports = { emberOptions: { polyfills: [namedBlockPolyfill], }, + features: { + postcss: false, + }, }; diff --git a/addons/rose/addon/components/rose/anonymous/index.stories.mdx b/addons/rose/addon/components/rose/anonymous/index.stories.mdx index a80d4c233..dafcc180a 100644 --- a/addons/rose/addon/components/rose/anonymous/index.stories.mdx +++ b/addons/rose/addon/components/rose/anonymous/index.stories.mdx @@ -1,9 +1,9 @@ -import { Meta, Story, Preview } from '@storybook/addon-docs/blocks'; +import { Meta, Story, Preview } from '@storybook/addon-docs'; import { hbs } from 'ember-cli-htmlbars'; import { action } from '@storybook/addon-actions'; import { text, boolean, select } from '@storybook/addon-knobs'; - + # Anonymous @@ -15,11 +15,19 @@ For example, layout components may yield an anonymous component to configure various layout regions: ```htmlbars -
- {{yield (hash - header=(component "rose/anonymous" tagName="header" class="rose-layout-global-header") - sidebar=(component "rose/anonymous" tagName="aside" class="rose-layout-global-sidebar") - body=(component "rose/anonymous" tagName="main" class="rose-layout-global-body") - )}} +
+ {{yield + (hash + header=(component + 'rose/anonymous' tagName='header' class='rose-layout-global-header' + ) + sidebar=(component + 'rose/anonymous' tagName='aside' class='rose-layout-global-sidebar' + ) + body=(component + 'rose/anonymous' tagName='main' class='rose-layout-global-body' + ) + ) + }}
``` diff --git a/addons/rose/addon/components/rose/badge/index.stories.mdx b/addons/rose/addon/components/rose/badge/index.stories.mdx index 57ba187fd..e96f7a213 100644 --- a/addons/rose/addon/components/rose/badge/index.stories.mdx +++ b/addons/rose/addon/components/rose/badge/index.stories.mdx @@ -1,9 +1,9 @@ -import { Meta, Story, Preview } from '@storybook/addon-docs/blocks'; +import { Meta, Story, Preview } from '@storybook/addon-docs'; import { hbs } from 'ember-cli-htmlbars'; import { action } from '@storybook/addon-actions'; import { text, select } from '@storybook/addon-knobs'; - + # Badge @@ -13,47 +13,56 @@ When style definition isn't supplied, a default style will be supplied. Styles: outline, dark, informational, informational-outline, success, success-outline, error, error-outline, warning, warning-outline, alert, alert-outline ```html -Badge +Badge ``` - {{ - template: hbs` + {{ + template: hbs` {{text}} `, - context: { - text: text('text', 'Badge'), - style: select('style', { - 'none': 'none', - 'outline': 'outline', - 'dark': 'dark', - 'informational': 'informational', - 'informational-outline': 'informational-outline', - 'success': 'success', - 'success-outline': 'success-outline', - 'alert': 'alert', - 'alert-outline': 'alert-outline', - 'error': 'error', - 'error-outline': 'error-outline', - 'warning': 'warning', - 'warning-outline': 'warning-outline', - }, - 'none' - ), - icon: select('icon', { - 'flight-icons/svg/org-16': 'flight-icons/svg/org-16', - }, - 'flight-icons/svg/org-16' - ), - } - }} + context: { + text: text('text', 'Badge'), + style: select( + 'style', + { + none: 'none', + outline: 'outline', + dark: 'dark', + informational: 'informational', + 'informational-outline': 'informational-outline', + success: 'success', + 'success-outline': 'success-outline', + alert: 'alert', + 'alert-outline': 'alert-outline', + error: 'error', + 'error-outline': 'error-outline', + warning: 'warning', + 'warning-outline': 'warning-outline', + }, + 'none' + ), + icon: select( + 'icon', + { + 'flight-icons/svg/org-16': 'flight-icons/svg/org-16', + }, + 'flight-icons/svg/org-16' + ), + }, + }} + - {{ - template: hbs` + + {{ + template: hbs` default style outline default style with icon @@ -69,5 +78,6 @@ Styles: outline, dark, informational, informational-outline, success, success-ou warning warning-outline `, - }} + }} + diff --git a/addons/rose/addon/components/rose/button/index.stories.mdx b/addons/rose/addon/components/rose/button/index.stories.mdx index 5c3bd03bf..52dd04714 100644 --- a/addons/rose/addon/components/rose/button/index.stories.mdx +++ b/addons/rose/addon/components/rose/button/index.stories.mdx @@ -1,25 +1,26 @@ -import { Meta, Story, Preview } from '@storybook/addon-docs/blocks'; +import { Meta, Story, Preview } from '@storybook/addon-docs'; import { hbs } from 'ember-cli-htmlbars'; import { action } from '@storybook/addon-actions'; import { text, boolean, select } from '@storybook/addon-knobs'; - + # Button -A simple button component that renders an HTML `