|
1 |
| -import 'braid-design-system/reset'; |
2 | 1 | import 'loki/configure-react';
|
3 | 2 |
|
4 |
| -import React, { type ComponentProps } from 'react'; |
5 |
| - |
6 |
| -import { |
7 |
| - type BraidArgs, |
8 |
| - defaultArgTypes, |
9 |
| - defaultArgs, |
10 |
| -} from '../storybook/controls'; |
11 |
| -import { BraidStorybookProvider, withRouter } from '../storybook/decorators'; |
| 3 | +import type { Meta, StoryObj } from 'sku/@storybook/react'; |
12 | 4 |
|
13 | 5 | import { CopyableText as Component } from './CopyableText';
|
14 | 6 |
|
15 | 7 | export default {
|
16 |
| - args: { |
17 |
| - braidThemeName: defaultArgs.braidThemeName, |
18 |
| - children: 'copy me', |
19 |
| - copiedIcon: 'undefined', |
20 |
| - copiedLabel: 'undefined', |
21 |
| - copyIcon: 'undefined', |
22 |
| - copyLabel: 'undefined', |
23 |
| - size: 'standard', |
24 |
| - }, |
| 8 | + title: 'Standalone/CopyableText', |
| 9 | + component: Component, |
25 | 10 | argTypes: {
|
26 |
| - braidThemeName: defaultArgTypes.braidThemeName, |
27 | 11 | children: { control: { type: 'text' } },
|
28 | 12 | copiedIcon: {
|
29 | 13 | control: { type: 'radio' },
|
30 |
| - mapping: { undefined, false: false }, |
31 |
| - options: ['undefined', 'false'], |
| 14 | + options: [undefined, false], |
32 | 15 | },
|
33 | 16 | copiedLabel: {
|
34 | 17 | control: { type: 'radio' },
|
35 |
| - mapping: { undefined, custom: 'Custom copied label' }, |
36 |
| - options: ['undefined', 'custom'], |
| 18 | + options: [undefined, 'Custom copied label'], |
37 | 19 | },
|
38 | 20 | copyIcon: {
|
39 | 21 | control: { type: 'radio' },
|
40 |
| - mapping: { undefined, false: false }, |
41 |
| - options: ['undefined', 'false'], |
| 22 | + options: [undefined, false], |
42 | 23 | },
|
43 | 24 | copyLabel: {
|
44 | 25 | control: { type: 'radio' },
|
45 |
| - mapping: { undefined, custom: 'Custom copy label' }, |
46 |
| - options: ['undefined', 'custom'], |
| 26 | + options: [undefined, 'Custom copy label'], |
47 | 27 | },
|
48 | 28 | },
|
49 |
| - component: Component, |
50 |
| - decorators: [withRouter], |
51 |
| - title: 'Standalone/CopyableText', |
52 |
| -}; |
| 29 | +} satisfies Meta<typeof Component>; |
53 | 30 |
|
54 |
| -type Args = ComponentProps<typeof Component> & BraidArgs; |
| 31 | +type Story = StoryObj<typeof Component>; |
55 | 32 |
|
56 |
| -export const CopyableText = ({ braidThemeName, ...args }: Args) => ( |
57 |
| - <BraidStorybookProvider braidThemeName={braidThemeName}> |
58 |
| - <Component {...args} /> |
59 |
| - </BraidStorybookProvider> |
60 |
| -); |
61 |
| -CopyableText.storyName = 'CopyableText'; |
| 33 | +export const CopyableText: Story = { |
| 34 | + args: { |
| 35 | + children: 'copy me', |
| 36 | + copiedIcon: undefined, |
| 37 | + copiedLabel: undefined, |
| 38 | + copyIcon: undefined, |
| 39 | + copyLabel: undefined, |
| 40 | + size: 'standard', |
| 41 | + }, |
| 42 | +}; |
0 commit comments