Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(APP-3310): Upgrade Storybook to v8 #215

Merged
merged 10 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .babelrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
}
],
"@babel/preset-typescript",
"@babel/preset-react"
[
"@babel/preset-react",
{
"runtime": "automatic"
}
]
thekidnamedkd marked this conversation as resolved.
Show resolved Hide resolved
],
"plugins": []
}
5 changes: 5 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,21 @@ import type { RuleSetRule } from 'webpack';

const config: StorybookConfig = {
stories: ['../docs/**/*.@(md|mdx)', '../src/**/*.stories.@(js|jsx|ts|tsx)', '../src/**/*.@(md|mdx)'],

addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
{ name: '@storybook/addon-styling', options: { postCss: true } },
'@storybook/addon-designs',
'@storybook/addon-mdx-gfm',
'@storybook/addon-webpack5-compiler-babel',
],

framework: {
name: '@storybook/react-webpack5',
options: {},
},

webpackFinal: (webpackConfig) => {
// Remove any svg loader already set and use @svgr/webpack to load svgs on Storybook
const svgWebpackRule = webpackConfig.module?.rules?.find((rule) => {
Expand Down
4 changes: 3 additions & 1 deletion .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import './style.css';

const preview: Preview = {
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
Expand Down Expand Up @@ -45,6 +44,7 @@ const preview: Preview = {
],
},
},

decorators: [
(Story) => (
<OdsModulesProvider>
Expand All @@ -54,6 +54,8 @@ const preview: Preview = {
</OdsModulesProvider>
),
],

tags: ['autodocs'],
thekidnamedkd marked this conversation as resolved.
Show resolved Hide resolved
};

export default preview;
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Update `yarn` version to `4.3.0`
- Update unit tests to use userEvent instead of fireEvent
- Move all form items under a `forms` folder
- Upgrade storybook to v8
rcaragon marked this conversation as resolved.
Show resolved Hide resolved

## [1.0.33] - 2024-06-06

Expand Down
16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,15 @@
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.6",
"@storybook/addon-designs": "^7.0.9",
"@storybook/addon-essentials": "^7.6.17",
"@storybook/addon-links": "^7.6.17",
"@storybook/addon-designs": "^8.0.2",
"@storybook/addon-essentials": "^8.1.10",
"@storybook/addon-links": "^8.1.10",
"@storybook/addon-mdx-gfm": "^8.1.10",
"@storybook/addon-styling": "^1.3.7",
"@storybook/blocks": "^7.6.17",
"@storybook/react": "^7.6.17",
"@storybook/react-webpack5": "^7.6.17",
"@storybook/addon-webpack5-compiler-babel": "^3.0.3",
"@storybook/blocks": "^8.1.10",
"@storybook/react": "^8.1.10",
"@storybook/react-webpack5": "^8.1.10",
"@storybook/storybook-deployer": "^2.8.16",
"@svgr/rollup": "^8.1.0",
"@svgr/webpack": "^8.1.0",
Expand Down Expand Up @@ -133,7 +135,7 @@
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-visualizer": "^5.12.0",
"storybook": "^7.6.17",
"storybook": "^8.1.10",
"tailwindcss": "^3.4.4",
"ts-jest": "^29.1.5",
"typescript": "^5.4.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { Accordion, type IAccordionContainerProps } from '..';
const meta: Meta<typeof Accordion.Container> = {
title: 'Core/Components/Accordion/Accordion.Container',
component: Accordion.Container,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
1 change: 0 additions & 1 deletion src/core/components/alerts/alertCard/alertCard.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { AlertCard } from './alertCard';
const meta: Meta<typeof AlertCard> = {
title: 'Core/Components/Alerts/AlertCard',
component: AlertCard,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { AlertInline } from './alertInline';
const meta: Meta<typeof AlertInline> = {
title: 'Core/Components/Alerts/AlertInline',
component: AlertInline,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
1 change: 0 additions & 1 deletion src/core/components/avatars/avatar/avatar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Avatar } from './avatar';
const meta: Meta<typeof Avatar> = {
title: 'Core/Components/Avatars/Avatar',
component: Avatar,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { AvatarBase } from './avatarBase';
const meta: Meta<typeof AvatarBase> = {
title: 'Core/Components/Avatars/AvatarBase',
component: AvatarBase,
tags: ['autodocs'],
};

type Story = StoryObj<typeof AvatarBase>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { AvatarIcon } from './avatarIcon';
const meta: Meta<typeof AvatarIcon> = {
title: 'Core/Components/Avatars/AvatarIcon',
component: AvatarIcon,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
1 change: 0 additions & 1 deletion src/core/components/breadcrumbs/breadcrumbs.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Breadcrumbs } from './breadcrumbs';
const meta: Meta<typeof Breadcrumbs> = {
title: 'Core/Components/Breadcrumbs',
component: Breadcrumbs,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
1 change: 0 additions & 1 deletion src/core/components/button/button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Button } from './button';
const meta: Meta<typeof Button> = {
title: 'Core/Components/Button',
component: Button,
tags: ['autodocs'],
argTypes: {
href: { control: 'text' },
},
Expand Down
1 change: 0 additions & 1 deletion src/core/components/cards/card/card.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Card } from './card';
const meta: Meta<typeof Card> = {
title: 'Core/Components/Cards/Card',
component: Card,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { CardCollapsible } from './cardCollapsible';
const meta: Meta<typeof CardCollapsible> = {
title: 'Core/Components/Cards/CardCollapsible',
component: CardCollapsible,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { CardEmptyState } from '.';
const meta: Meta<typeof CardEmptyState> = {
title: 'Core/Components/Cards/CardEmptyState',
component: CardEmptyState,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { CardSummary } from './cardSummary';
const meta: Meta<typeof CardSummary> = {
title: 'Core/Components/Cards/CardSummary',
component: CardSummary,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
1 change: 0 additions & 1 deletion src/core/components/collapsible/collapsible.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { Collapsible } from './collapsible';
const meta: Meta<typeof Collapsible> = {
title: 'Core/Components/Collapsible',
component: Collapsible,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { DataList } from '..';
const meta: Meta<typeof DataList.Container> = {
title: 'Core/Components/DataList/DataList.Container',
component: DataList.Container,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { DataList } from '../index';
const meta: Meta<typeof DataList.Filter> = {
title: 'Core/Components/DataList/DataList.Filter',
component: DataList.Filter,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { DataList } from '../index';
const meta: Meta<typeof DataList.Item> = {
title: 'Core/Components/DataList/DataList.Item',
component: DataList.Item,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { DataList } from '../index';
const meta: Meta<typeof DataList.Pagination> = {
title: 'Core/Components/DataList/DataList.Pagination',
component: DataList.Pagination,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import type { DataListState } from './dataListRoot';
const meta: Meta<typeof DataList.Root> = {
title: 'Core/Components/DataList/DataList.Root',
component: DataList.Root,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { DefinitionList, type IDefinitionListContainerProps } from '../index';
const meta: Meta<typeof DefinitionList.Container> = {
title: 'Core/Components/DefinitionList/DefinitionList.Container',
component: DefinitionList.Container,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { DefinitionList, type IDefinitionListItemProps } from '../index';
const meta: Meta<typeof DefinitionList.Item> = {
title: 'Core/Components/DefinitionList/DefinitionList.Item',
component: DefinitionList.Item,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { type IDialogContentProps } from './dialogContent';
const meta: Meta<typeof Dialog.Content> = {
title: 'Core/Components/Dialogs/Dialog/Dialog.Content',
component: Dialog.Content,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { IconType } from '../../../icon';
const meta: Meta<typeof Dialog.Footer> = {
title: 'Core/Components/Dialogs/Dialog/Dialog.Footer',
component: Dialog.Footer,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { type IDialogHeaderProps } from './dialogHeader';
const meta: Meta<typeof Dialog.Header> = {
title: 'Core/Components/Dialogs/Dialog/Dialog.Header',
component: Dialog.Header,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Button } from '../../../button';
const meta: Meta<typeof Dialog.Root> = {
title: 'Core/Components/Dialogs/Dialog/Dialog.Root',
component: Dialog.Root,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Button } from '../../../button';
const meta: Meta<typeof DialogAlert.Content> = {
title: 'Core/Components/Dialogs/DialogAlert/DialogAlert.Content',
component: DialogAlert.Content,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { IconType } from '../../../icon';
const meta: Meta<typeof DialogAlert.Footer> = {
title: 'Core/Components/Dialogs/DialogAlert/DialogAlert.Footer',
component: DialogAlert.Footer,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Button } from '../../../button';
const meta: Meta<typeof DialogAlert.Header> = {
title: 'Core/Components/Dialogs/DialogAlert/DialogAlert.Header',
component: DialogAlert.Header,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Button } from '../../../button';
const meta: Meta<typeof DialogAlert.Root> = {
title: 'Core/Components/Dialogs/DialogAlert/DialogAlert.Root',
component: DialogAlert.Root,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { DocumentParser } from './documentParser';
const meta: Meta<typeof DocumentParser> = {
title: 'Core/Components/DocumentParser',
component: DocumentParser,
tags: ['autodocs'],
};

type Story = StoryObj<typeof DocumentParser>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Dropdown, type IDropdownContainerProps } from '../index';
const meta: Meta<typeof Dropdown.Container> = {
title: 'Core/Components/Dropdown/Dropdown.Container',
component: Dropdown.Container,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Dropdown, type IDropdownItemProps } from '../index';
const meta: Meta<typeof Dropdown.Item> = {
title: 'Core/Components/Dropdown/Dropdown.Item',
component: Dropdown.Item,
tags: ['autodocs'],
argTypes: {
disabled: { control: 'boolean' },
},
Expand Down
1 change: 0 additions & 1 deletion src/core/components/forms/checkbox/checkbox.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Checkbox, type CheckboxState, type ICheckboxProps } from './checkbox';
const meta: Meta<typeof Checkbox> = {
title: 'Core/Components/Checkbox/Checkbox',
component: Checkbox,
tags: ['autodocs'],
argTypes: {
disabled: { type: 'boolean' },
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { CheckboxCard } from './checkboxCard';
const meta: Meta<typeof CheckboxCard> = {
title: 'Core/Components/Checkbox/CheckboxCard',
component: CheckboxCard,
tags: ['autodocs'],
argTypes: {
disabled: { control: 'boolean' },
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { CheckboxGroup } from './checkboxGroup';
const meta: Meta<typeof CheckboxGroup> = {
title: 'Core/Components/Checkbox/CheckboxGroup',
component: CheckboxGroup,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { InputContainer } from './inputContainer';
const meta: Meta<typeof InputContainer> = {
title: 'Core/Components/Forms/InputContainer',
component: InputContainer,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
1 change: 0 additions & 1 deletion src/core/components/forms/inputDate/inputDate.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { InputDate } from './inputDate';
const meta: Meta<typeof InputDate> = {
title: 'Core/Components/Forms/InputDate',
component: InputDate,
tags: ['autodocs'],
parameters: {
design: {
type: 'figma',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { InputFileAvatar } from './inputFileAvatar';
const meta: Meta<typeof InputFileAvatar> = {
title: 'Core/Components/Forms/InputFileAvatar',
component: InputFileAvatar,
tags: ['autodocs'],

parameters: {
design: {
Expand Down
Loading