chore(deps): upgrade storybook 8 (#1811)

This commit is contained in:
Chaim Lev-Ari
2026-02-08 07:59:08 +00:00
committed by GitHub
parent ac7cb2ee19
commit d611087513
33 changed files with 749 additions and 4625 deletions

View File

@@ -155,3 +155,4 @@ overrides:
'@typescript-eslint/no-restricted-imports': off '@typescript-eslint/no-restricted-imports': off
no-restricted-imports: off no-restricted-imports: off
'react/jsx-props-no-spreading': off 'react/jsx-props-no-spreading': off
'storybook/no-renderer-packages': off

View File

@@ -9,20 +9,38 @@ const config: StorybookConfig = {
addons: [ addons: [
'@storybook/addon-links', '@storybook/addon-links',
'@storybook/addon-essentials', '@storybook/addon-essentials',
'@storybook/addon-webpack5-compiler-swc',
'@chromatic-com/storybook',
{ {
name: '@storybook/addon-styling', name: '@storybook/addon-styling-webpack',
options: { options: {
cssLoaderOptions: { rules: [
importLoaders: 1, {
modules: { test: /\.css$/,
localIdentName: '[path][name]__[local]', sideEffects: true,
auto: true, use: [
exportLocalsConvention: 'camelCaseOnly', require.resolve('style-loader'),
{
loader: require.resolve('css-loader'),
options: {
importLoaders: 1,
modules: {
localIdentName: '[path][name]__[local]',
auto: true,
exportLocalsConvention: 'camelCaseOnly',
},
},
},
{
loader: require.resolve('postcss-loader'),
options: {
implementation: postcss,
},
},
],
}, },
}, ],
postCss: {
implementation: postcss,
},
}, },
}, },
], ],

View File

@@ -1,9 +1,9 @@
import '../app/assets/css'; import '../app/assets/css';
import React from 'react';
import { pushStateLocationPlugin, UIRouter } from '@uirouter/react'; import { pushStateLocationPlugin, UIRouter } from '@uirouter/react';
import { initialize as initMSW, mswLoader } from 'msw-storybook-addon'; import { initialize as initMSW, mswLoader } from 'msw-storybook-addon';
import { handlers } from '../app/setup-tests/server-handlers'; import { handlers } from '../app/setup-tests/server-handlers';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { Preview } from '@storybook/react';
initMSW( initMSW(
{ {
@@ -21,31 +21,30 @@ initMSW(
handlers handlers
); );
export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
msw: {
handlers,
},
};
const testQueryClient = new QueryClient({ const testQueryClient = new QueryClient({
defaultOptions: { queries: { retry: false } }, defaultOptions: { queries: { retry: false } },
}); });
export const decorators = [ const preview: Preview = {
(Story) => ( decorators: (Story) => (
<QueryClientProvider client={testQueryClient}> <QueryClientProvider client={testQueryClient}>
<UIRouter plugins={[pushStateLocationPlugin]}> <UIRouter plugins={[pushStateLocationPlugin]}>
<Story /> <Story />
</UIRouter> </UIRouter>
</QueryClientProvider> </QueryClientProvider>
), ),
]; loaders: [mswLoader],
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
msw: {
handlers,
},
},
};
export const loaders = [mswLoader]; export default preview;

View File

@@ -1,4 +1,4 @@
import { Meta, Story } from '@storybook/react'; import { Meta, StoryFn } from '@storybook/react';
import { Alert } from './Alert'; import { Alert } from './Alert';
@@ -21,21 +21,21 @@ function Template({ text, color, title }: Args) {
); );
} }
export const Success: Story<Args> = Template.bind({}); export const Success: StoryFn<Args> = Template.bind({});
Success.args = { Success.args = {
color: 'success', color: 'success',
title: 'Success', title: 'Success',
text: 'This is a success alert. Very long text, Very long text,Very long text ,Very long text ,Very long text, Very long text', text: 'This is a success alert. Very long text, Very long text,Very long text ,Very long text ,Very long text, Very long text',
}; };
export const Error: Story<Args> = Template.bind({}); export const Error: StoryFn<Args> = Template.bind({});
Error.args = { Error.args = {
color: 'error', color: 'error',
title: 'Error', title: 'Error',
text: 'This is an error alert', text: 'This is an error alert',
}; };
export const Info: Story<Args> = Template.bind({}); export const Info: StoryFn<Args> = Template.bind({});
Info.args = { Info.args = {
color: 'info', color: 'info',
title: 'Info', title: 'Info',

View File

@@ -1,4 +1,4 @@
import { Meta, Story } from '@storybook/react'; import { Meta, StoryFn } from '@storybook/react';
import { PropsWithChildren } from 'react'; import { PropsWithChildren } from 'react';
import { Card, Props } from './Card'; import { Card, Props } from './Card';
@@ -14,5 +14,5 @@ function Template({
return <Card>{children}</Card>; return <Card>{children}</Card>;
} }
export const Primary: Story<PropsWithChildren<Props>> = Template.bind({}); export const Primary: StoryFn<PropsWithChildren<Props>> = Template.bind({});
Primary.args = {}; Primary.args = {};

View File

@@ -1,4 +1,4 @@
import { Meta, Story } from '@storybook/react'; import { Meta, StoryFn } from '@storybook/react';
import { Code } from './Code'; import { Code } from './Code';
@@ -16,18 +16,18 @@ function Template({ text, showCopyButton }: Args) {
return <Code showCopyButton={showCopyButton}>{text}</Code>; return <Code showCopyButton={showCopyButton}>{text}</Code>;
} }
export const Primary: Story<Args> = Template.bind({}); export const Primary: StoryFn<Args> = Template.bind({});
Primary.args = { Primary.args = {
text: 'curl -X GET http://ultra-sound-money.eth', text: 'curl -X GET http://ultra-sound-money.eth',
showCopyButton: true, showCopyButton: true,
}; };
export const MultiLine: Story<Args> = Template.bind({}); export const MultiLine: StoryFn<Args> = Template.bind({});
MultiLine.args = { MultiLine.args = {
text: 'curl -X\n GET http://example-with-children.crypto', text: 'curl -X\n GET http://example-with-children.crypto',
}; };
export const MultiLineWithIcon: Story<Args> = Template.bind({}); export const MultiLineWithIcon: StoryFn<Args> = Template.bind({});
MultiLineWithIcon.args = { MultiLineWithIcon.args = {
text: 'curl -X\n GET http://example-with-children.crypto', text: 'curl -X\n GET http://example-with-children.crypto',
showCopyButton: true, showCopyButton: true,

View File

@@ -1,4 +1,4 @@
import { Meta, Story } from '@storybook/react'; import { Meta, StoryFn } from '@storybook/react';
import { List } from 'lucide-react'; import { List } from 'lucide-react';
import { Link } from '@@/Link'; import { Link } from '@@/Link';
@@ -29,7 +29,7 @@ function Template({ value, icon, type }: StoryProps) {
); );
} }
export const Primary: Story<StoryProps> = Template.bind({}); export const Primary: StoryFn<StoryProps> = Template.bind({});
Primary.args = { Primary.args = {
value: 1, value: 1,
icon: List, icon: List,

View File

@@ -1,4 +1,4 @@
import { Meta, Story } from '@storybook/react'; import { Meta, StoryFn } from '@storybook/react';
import { DetailsTable } from './DetailsTable'; import { DetailsTable } from './DetailsTable';
import { DetailsRow } from './DetailsRow'; import { DetailsRow } from './DetailsRow';
@@ -24,7 +24,7 @@ function Template({ key1, val1, key2, val2 }: Args) {
); );
} }
export const Default: Story<Args> = Template.bind({}); export const Default: StoryFn<Args> = Template.bind({});
Default.args = { Default.args = {
key1: 'Name', key1: 'Name',
val1: 'My Cool App', val1: 'My Cool App',

View File

@@ -1,4 +1,4 @@
import { Story, Meta } from '@storybook/react'; import { StoryFn, Meta } from '@storybook/react';
import { PropsWithChildren } from 'react'; import { PropsWithChildren } from 'react';
import { InlineLoader, Props } from './InlineLoader'; import { InlineLoader, Props } from './InlineLoader';
@@ -12,7 +12,7 @@ function Template({ className, children }: PropsWithChildren<Props>) {
return <InlineLoader className={className}>{children}</InlineLoader>; return <InlineLoader className={className}>{children}</InlineLoader>;
} }
export const Primary: Story<PropsWithChildren<Props>> = Template.bind({}); export const Primary: StoryFn<PropsWithChildren<Props>> = Template.bind({});
Primary.args = { Primary.args = {
className: 'test-class', className: 'test-class',
children: 'Loading...', children: 'Loading...',

View File

@@ -1,4 +1,4 @@
import { Meta, Story } from '@storybook/react'; import { Meta, StoryFn } from '@storybook/react';
import { InsightsBox, Props } from './InsightsBox'; import { InsightsBox, Props } from './InsightsBox';
@@ -11,7 +11,7 @@ function Template({ header, content }: Props) {
return <InsightsBox header={header} content={content} />; return <InsightsBox header={header} content={content} />;
} }
export const Primary: Story<Props> = Template.bind({}); export const Primary: StoryFn<Props> = Template.bind({});
Primary.args = { Primary.args = {
header: 'Insights box header', header: 'Insights box header',
content: 'This is the content of the insights box', content: 'This is the content of the insights box',

View File

@@ -1,4 +1,4 @@
import { ComponentMeta, Story } from '@storybook/react'; import { Meta, StoryFn } from '@storybook/react';
import { useState } from 'react'; import { useState } from 'react';
import { NavTabs, type Option } from './NavTabs'; import { NavTabs, type Option } from './NavTabs';
@@ -6,7 +6,7 @@ import { NavTabs, type Option } from './NavTabs';
export default { export default {
title: 'Components/NavTabs', title: 'Components/NavTabs',
component: NavTabs, component: NavTabs,
} as ComponentMeta<typeof NavTabs>; } as Meta<typeof NavTabs>;
type Args = { type Args = {
options: Option[]; options: Option[];
@@ -26,7 +26,7 @@ function Template({ options = [] }: Args) {
); );
} }
export const Example: Story<Args> = Template.bind({}); export const Example: StoryFn<Args> = Template.bind({});
Example.args = { Example.args = {
options: [ options: [
{ children: 'Content 1', id: 'option1', label: 'Option 1' }, { children: 'Content 1', id: 'option1', label: 'Option 1' },

View File

@@ -1,4 +1,4 @@
import { Meta, Story } from '@storybook/react'; import { Meta, StoryFn } from '@storybook/react';
import { useMemo } from 'react'; import { useMemo } from 'react';
import { UserContext } from '@/react/hooks/useUser'; import { UserContext } from '@/react/hooks/useUser';
@@ -39,7 +39,7 @@ function Template({ title }: StoryProps) {
); );
} }
export const Primary: Story<StoryProps> = Template.bind({}); export const Primary: StoryFn<StoryProps> = Template.bind({});
Primary.args = { Primary.args = {
title: 'Container details', title: 'Container details',
}; };

View File

@@ -1,4 +1,4 @@
import { Meta, Story } from '@storybook/react'; import { Meta, StoryFn } from '@storybook/react';
import { useMemo } from 'react'; import { useMemo } from 'react';
import { UserContext } from '@/react/hooks/useUser'; import { UserContext } from '@/react/hooks/useUser';
@@ -37,7 +37,7 @@ function Template({ title }: StoryProps) {
); );
} }
export const Primary: Story<StoryProps> = Template.bind({}); export const Primary: StoryFn<StoryProps> = Template.bind({});
Primary.args = { Primary.args = {
title: 'Container details', title: 'Container details',
}; };

View File

@@ -1,4 +1,4 @@
import { Meta, Story } from '@storybook/react'; import { Meta, StoryFn } from '@storybook/react';
import { PropsWithChildren } from 'react'; import { PropsWithChildren } from 'react';
import { TextTip } from './TextTip'; import { TextTip } from './TextTip';
@@ -14,7 +14,7 @@ function Template({
return <TextTip>{children}</TextTip>; return <TextTip>{children}</TextTip>;
} }
export const Primary: Story<PropsWithChildren<unknown>> = Template.bind({}); export const Primary: StoryFn<PropsWithChildren<unknown>> = Template.bind({});
Primary.args = { Primary.args = {
children: 'This is a text tip with children', children: 'This is a text tip with children',
}; };

View File

@@ -1,4 +1,4 @@
import { Meta, Story } from '@storybook/react'; import { Meta, StoryFn } from '@storybook/react';
import { Tooltip, Props } from './Tooltip'; import { Tooltip, Props } from './Tooltip';
@@ -16,7 +16,7 @@ function Template({ message, position }: JSX.IntrinsicAttributes & Props) {
); );
} }
export const Primary: Story<Props> = Template.bind({}); export const Primary: StoryFn<Props> = Template.bind({});
Primary.args = { Primary.args = {
message: 'Tooltip example', message: 'Tooltip example',
position: 'bottom', position: 'bottom',

View File

@@ -1,4 +1,4 @@
import { Meta, Story } from '@storybook/react'; import { Meta, StoryFn } from '@storybook/react';
import { ViewLoading } from './ViewLoading'; import { ViewLoading } from './ViewLoading';
@@ -15,7 +15,7 @@ function Template({ message }: Args) {
return <ViewLoading message={message} />; return <ViewLoading message={message} />;
} }
export const Example: Story<Args> = Template.bind({}); export const Example: StoryFn<Args> = Template.bind({});
Example.args = { Example.args = {
message: 'Loading...', message: 'Loading...',
}; };

View File

@@ -1,4 +1,4 @@
import { Meta, Story } from '@storybook/react'; import { Meta, StoryFn } from '@storybook/react';
import { AddButton } from './AddButton'; import { AddButton } from './AddButton';
@@ -15,7 +15,7 @@ function Template({ label }: Args) {
return <AddButton data-cy="add-">{label}</AddButton>; return <AddButton data-cy="add-">{label}</AddButton>;
} }
export const Primary: Story<Args> = Template.bind({}); export const Primary: StoryFn<Args> = Template.bind({});
Primary.args = { Primary.args = {
label: 'Create new container', label: 'Create new container',
}; };

View File

@@ -1,4 +1,4 @@
import { Meta, Story } from '@storybook/react'; import { Meta, StoryFn } from '@storybook/react';
import { PropsWithChildren } from 'react'; import { PropsWithChildren } from 'react';
import { Download } from 'lucide-react'; import { Download } from 'lucide-react';
@@ -85,7 +85,7 @@ function Template({
); );
} }
export const Primary: Story<PropsWithChildren<Props>> = Template.bind({}); export const Primary: StoryFn<PropsWithChildren<Props>> = Template.bind({});
Primary.args = { Primary.args = {
color: 'primary', color: 'primary',
size: 'small', size: 'small',

View File

@@ -1,4 +1,4 @@
import { Meta, Story } from '@storybook/react'; import { Meta, StoryFn } from '@storybook/react';
import { PropsWithChildren } from 'react'; import { PropsWithChildren } from 'react';
import { Play, RefreshCw, Square, Trash2 } from 'lucide-react'; import { Play, RefreshCw, Square, Trash2 } from 'lucide-react';
@@ -45,7 +45,7 @@ function Template({
); );
} }
export const Primary: Story<PropsWithChildren<Props>> = Template.bind({}); export const Primary: StoryFn<PropsWithChildren<Props>> = Template.bind({});
Primary.args = { Primary.args = {
size: 'small', size: 'small',
}; };

View File

@@ -1,4 +1,4 @@
import { Meta, Story } from '@storybook/react'; import { Meta, StoryFn } from '@storybook/react';
import { PropsWithChildren } from 'react'; import { PropsWithChildren } from 'react';
import { CopyButton, Props } from './CopyButton'; import { CopyButton, Props } from './CopyButton';
@@ -24,13 +24,13 @@ function Template({
); );
} }
export const Primary: Story<PropsWithChildren<Props>> = Template.bind({}); export const Primary: StoryFn<PropsWithChildren<Props>> = Template.bind({});
Primary.args = { Primary.args = {
children: 'Copy', children: 'Copy',
copyText: 'this will be copied to clipboard', copyText: 'this will be copied to clipboard',
}; };
export const NoCopyText: Story<PropsWithChildren<Props>> = Template.bind({}); export const NoCopyText: StoryFn<PropsWithChildren<Props>> = Template.bind({});
NoCopyText.args = { NoCopyText.args = {
children: 'Copy without copied text', children: 'Copy without copied text',
copyText: 'clipboard override', copyText: 'clipboard override',

View File

@@ -1,4 +1,4 @@
import { Meta, Story } from '@storybook/react'; import { Meta, StoryFn } from '@storybook/react';
import { FormSection } from './FormSection'; import { FormSection } from './FormSection';
@@ -25,7 +25,7 @@ const exampleContent = `Content
Nullam nec nibh maximus, consequat quam sed, dapibus purus. Donec facilisis commodo mi, in commodo augue molestie sed. Nullam nec nibh maximus, consequat quam sed, dapibus purus. Donec facilisis commodo mi, in commodo augue molestie sed.
`; `;
export const Example: Story<Args> = Template.bind({}); export const Example: StoryFn<Args> = Template.bind({});
Example.args = { Example.args = {
title: 'title', title: 'title',
content: exampleContent, content: exampleContent,

View File

@@ -1,4 +1,4 @@
import { Meta, Story } from '@storybook/react'; import { Meta, StoryFn } from '@storybook/react';
import { PropsWithChildren } from 'react'; import { PropsWithChildren } from 'react';
import { FormSectionTitle } from './FormSectionTitle'; import { FormSectionTitle } from './FormSectionTitle';
@@ -14,7 +14,7 @@ function Template({
return <FormSectionTitle>{children}</FormSectionTitle>; return <FormSectionTitle>{children}</FormSectionTitle>;
} }
export const Example: Story<PropsWithChildren<unknown>> = Template.bind({}); export const Example: StoryFn<PropsWithChildren<unknown>> = Template.bind({});
Example.args = { Example.args = {
children: 'This is a title with children', children: 'This is a title with children',
}; };

View File

@@ -1,4 +1,4 @@
import { Meta, Story } from '@storybook/react'; import { Meta, StoryFn } from '@storybook/react';
import { useState } from 'react'; import { useState } from 'react';
import { Input } from './Input'; import { Input } from './Input';
@@ -27,7 +27,7 @@ export function TextField({ disabled }: Args) {
); );
} }
export const DisabledTextField: Story<Args> = TextField.bind({}); export const DisabledTextField: StoryFn<Args> = TextField.bind({});
DisabledTextField.args = { DisabledTextField.args = {
disabled: true, disabled: true,
}; };

View File

@@ -1,4 +1,4 @@
import { Meta, Story } from '@storybook/react'; import { Meta, StoryFn } from '@storybook/react';
import { useState } from 'react'; import { useState } from 'react';
import { Select } from './Select'; import { Select } from './Select';
@@ -31,7 +31,7 @@ export function Example({ disabled }: Args) {
); );
} }
export const DisabledSelect: Story<Args> = Example.bind({}); export const DisabledSelect: StoryFn<Args> = Example.bind({});
DisabledSelect.args = { DisabledSelect.args = {
disabled: true, disabled: true,
}; };

View File

@@ -1,4 +1,4 @@
import { Meta, Story } from '@storybook/react'; import { Meta, StoryFn } from '@storybook/react';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { Slider, Props } from './Slider'; import { Slider, Props } from './Slider';
@@ -41,7 +41,7 @@ function Template({
); );
} }
export const Primary: Story<Props> = Template.bind({}); export const Primary: StoryFn<Props> = Template.bind({});
Primary.args = { Primary.args = {
min: 0, min: 0,
max: 100, max: 100,

View File

@@ -1,4 +1,4 @@
import { Meta, Story } from '@storybook/react'; import { Meta, StoryFn } from '@storybook/react';
import { useState } from 'react'; import { useState } from 'react';
import { Switch } from './Switch'; import { Switch } from './Switch';
@@ -40,12 +40,12 @@ function Template({ checked }: Args) {
); );
} }
export const Checked: Story<Args> = Template.bind({}); export const Checked: StoryFn<Args> = Template.bind({});
Checked.args = { Checked.args = {
checked: true, checked: true,
}; };
export const Unchecked: Story<Args> = Template.bind({}); export const Unchecked: StoryFn<Args> = Template.bind({});
Unchecked.args = { Unchecked.args = {
checked: false, checked: false,
}; };

View File

@@ -1,4 +1,4 @@
import { Meta, Story } from '@storybook/react'; import { Meta, StoryFn } from '@storybook/react';
import { useState } from 'react'; import { useState } from 'react';
import { SwitchField } from './SwitchField'; import { SwitchField } from './SwitchField';
@@ -43,14 +43,14 @@ function Template({ checked, label, labelClass }: Args) {
); );
} }
export const Checked: Story<Args> = Template.bind({}); export const Checked: StoryFn<Args> = Template.bind({});
Checked.args = { Checked.args = {
checked: true, checked: true,
label: 'label', label: 'label',
labelClass: 'col-sm-6', labelClass: 'col-sm-6',
}; };
export const Unchecked: Story<Args> = Template.bind({}); export const Unchecked: StoryFn<Args> = Template.bind({});
Unchecked.args = { Unchecked.args = {
checked: false, checked: false,
label: 'label', label: 'label',

View File

@@ -1,4 +1,4 @@
import { Story } from '@storybook/react'; import { StoryFn } from '@storybook/react';
import { import {
Environment, Environment,
@@ -29,37 +29,37 @@ function Template({ environment }: Args) {
); );
} }
export const DockerEnvironment: Story<Args> = Template.bind({}); export const DockerEnvironment: StoryFn<Args> = Template.bind({});
DockerEnvironment.args = { DockerEnvironment.args = {
environment: mockEnvironment(EnvironmentType.Docker), environment: mockEnvironment(EnvironmentType.Docker),
}; };
export const DockerAgentEnvironment: Story<Args> = Template.bind({}); export const DockerAgentEnvironment: StoryFn<Args> = Template.bind({});
DockerAgentEnvironment.args = { DockerAgentEnvironment.args = {
environment: mockEnvironment(EnvironmentType.AgentOnDocker), environment: mockEnvironment(EnvironmentType.AgentOnDocker),
}; };
export const DockerEdgeEnvironment: Story<Args> = Template.bind({}); export const DockerEdgeEnvironment: StoryFn<Args> = Template.bind({});
DockerEdgeEnvironment.args = { DockerEdgeEnvironment.args = {
environment: mockEnvironment(EnvironmentType.EdgeAgentOnDocker), environment: mockEnvironment(EnvironmentType.EdgeAgentOnDocker),
}; };
export const AzureEnvironment: Story<Args> = Template.bind({}); export const AzureEnvironment: StoryFn<Args> = Template.bind({});
AzureEnvironment.args = { AzureEnvironment.args = {
environment: mockEnvironment(EnvironmentType.Azure), environment: mockEnvironment(EnvironmentType.Azure),
}; };
export const KubernetesLocalEnvironment: Story<Args> = Template.bind({}); export const KubernetesLocalEnvironment: StoryFn<Args> = Template.bind({});
KubernetesLocalEnvironment.args = { KubernetesLocalEnvironment.args = {
environment: mockEnvironment(EnvironmentType.KubernetesLocal), environment: mockEnvironment(EnvironmentType.KubernetesLocal),
}; };
export const KubernetesAgentEnvironment: Story<Args> = Template.bind({}); export const KubernetesAgentEnvironment: StoryFn<Args> = Template.bind({});
KubernetesAgentEnvironment.args = { KubernetesAgentEnvironment.args = {
environment: mockEnvironment(EnvironmentType.AgentOnKubernetes), environment: mockEnvironment(EnvironmentType.AgentOnKubernetes),
}; };
export const KubernetesEdgeEnvironment: Story<Args> = Template.bind({}); export const KubernetesEdgeEnvironment: StoryFn<Args> = Template.bind({});
KubernetesEdgeEnvironment.args = { KubernetesEdgeEnvironment.args = {
environment: mockEnvironment(EnvironmentType.EdgeAgentOnKubernetes), environment: mockEnvironment(EnvironmentType.EdgeAgentOnKubernetes),
}; };

View File

@@ -1,4 +1,4 @@
import { Meta, Story } from '@storybook/react'; import { Meta, StoryFn } from '@storybook/react';
import { useState } from 'react'; import { useState } from 'react';
import { UserViewModel } from '@/portainer/models/user'; import { UserViewModel } from '@/portainer/models/user';
@@ -39,12 +39,12 @@ function Template({ userRole }: Args) {
); );
} }
export const AdminAccessControl: Story<Args> = Template.bind({}); export const AdminAccessControl: StoryFn<Args> = Template.bind({});
AdminAccessControl.args = { AdminAccessControl.args = {
userRole: Role.Admin, userRole: Role.Admin,
}; };
export const NonAdminAccessControl: Story<Args> = Template.bind({}); export const NonAdminAccessControl: StoryFn<Args> = Template.bind({});
NonAdminAccessControl.args = { NonAdminAccessControl.args = {
userRole: Role.Standard, userRole: Role.Standard,
}; };

View File

@@ -1,4 +1,4 @@
import { ComponentMeta } from '@storybook/react'; import { Meta } from '@storybook/react';
import { useState } from 'react'; import { useState } from 'react';
import { import {
@@ -10,7 +10,7 @@ export default {
title: 'Custom Templates/Variables Definition Field', title: 'Custom Templates/Variables Definition Field',
component: CustomTemplatesVariablesDefinitionField, component: CustomTemplatesVariablesDefinitionField,
args: {}, args: {},
} as ComponentMeta<typeof CustomTemplatesVariablesDefinitionField>; } as Meta<typeof CustomTemplatesVariablesDefinitionField>;
function Template() { function Template() {
const [value, setValue] = useState<VariableDefinition[]>([ const [value, setValue] = useState<VariableDefinition[]>([

View File

@@ -1,4 +1,4 @@
import { Meta, Story } from '@storybook/react'; import { Meta, StoryFn } from '@storybook/react';
import { Clock, type LucideIcon } from 'lucide-react'; import { Clock, type LucideIcon } from 'lucide-react';
import { SidebarItem } from '.'; import { SidebarItem } from '.';
@@ -28,13 +28,13 @@ function Template({ icon, label }: StoryProps) {
); );
} }
export const Primary: Story<StoryProps> = Template.bind({}); export const Primary: StoryFn<StoryProps> = Template.bind({});
Primary.args = { Primary.args = {
icon: Clock, icon: Clock,
label: 'Item with icon', label: 'Item with icon',
}; };
export const WithoutIcon: Story<StoryProps> = Template.bind({}); export const WithoutIcon: StoryFn<StoryProps> = Template.bind({});
WithoutIcon.args = { WithoutIcon.args = {
label: 'Item without icon', label: 'Item without icon',
}; };

View File

@@ -146,13 +146,15 @@
"@babel/preset-env": "^7.22.20", "@babel/preset-env": "^7.22.20",
"@babel/preset-react": "^7.22.15", "@babel/preset-react": "^7.22.15",
"@babel/preset-typescript": "^7.23.0", "@babel/preset-typescript": "^7.23.0",
"@chromatic-com/storybook": "^3.2.7",
"@simbathesailor/use-what-changed": "^2.0.0", "@simbathesailor/use-what-changed": "^2.0.0",
"@storybook/addon-actions": "^7.0.18", "@storybook/addon-actions": "8.6.15",
"@storybook/addon-essentials": "^7.0.18", "@storybook/addon-essentials": "8.6.15",
"@storybook/addon-links": "^7.0.18", "@storybook/addon-links": "8.6.15",
"@storybook/addon-styling": "^1.0.8", "@storybook/addon-styling-webpack": "^3.0.0",
"@storybook/react": "^7.0.18", "@storybook/addon-webpack5-compiler-swc": "^3.0.0",
"@storybook/react-webpack5": "^7.0.18", "@storybook/react": "8.6.15",
"@storybook/react-webpack5": "8.6.15",
"@svgr/webpack": "^8.1.0", "@svgr/webpack": "^8.1.0",
"@testing-library/dom": "^9.3.4", "@testing-library/dom": "^9.3.4",
"@testing-library/react": "^12", "@testing-library/react": "^12",
@@ -201,7 +203,7 @@
"eslint-plugin-react": "^7.33.2", "eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-regex": "^1.10.0", "eslint-plugin-regex": "^1.10.0",
"eslint-plugin-storybook": "^0.6.14", "eslint-plugin-storybook": "^9",
"eslint-plugin-vitest": "^0.3.20", "eslint-plugin-vitest": "^0.3.20",
"html-loader": "^0.5.5", "html-loader": "^0.5.5",
"html-webpack-plugin": "^5.5.3", "html-webpack-plugin": "^5.5.3",
@@ -220,7 +222,7 @@
"react-docgen-typescript-plugin": "^1.0.5", "react-docgen-typescript-plugin": "^1.0.5",
"source-map-loader": "^4.0.1", "source-map-loader": "^4.0.1",
"speed-measure-webpack-plugin": "^1.5.0", "speed-measure-webpack-plugin": "^1.5.0",
"storybook": "^7.6.21", "storybook": "8.6.15",
"storybook-css-modules-preset": "^1.1.1", "storybook-css-modules-preset": "^1.1.1",
"style-loader": "^3.3.3", "style-loader": "^3.3.3",
"swagger2openapi": "^7.0.8", "swagger2openapi": "^7.0.8",

5136
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff