@transferwise/components 46.119.5 → 46.120.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/alert/Alert.js +1 -1
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs +1 -1
- package/build/alert/Alert.mjs.map +1 -1
- package/build/checkbox/Checkbox.js +1 -1
- package/build/checkbox/Checkbox.js.map +1 -1
- package/build/checkbox/Checkbox.mjs +1 -1
- package/build/checkbox/Checkbox.mjs.map +1 -1
- package/build/common/initials.js +17 -7
- package/build/common/initials.js.map +1 -1
- package/build/common/initials.mjs +17 -7
- package/build/common/initials.mjs.map +1 -1
- package/build/field/Field.js +8 -4
- package/build/field/Field.js.map +1 -1
- package/build/field/Field.mjs +8 -4
- package/build/field/Field.mjs.map +1 -1
- package/build/inlineAlert/InlineAlert.js +1 -7
- package/build/inlineAlert/InlineAlert.js.map +1 -1
- package/build/inlineAlert/InlineAlert.mjs +1 -7
- package/build/inlineAlert/InlineAlert.mjs.map +1 -1
- package/build/main.css +20 -1
- package/build/prompt/InlinePrompt/InlinePrompt.js +2 -0
- package/build/prompt/InlinePrompt/InlinePrompt.js.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.mjs +2 -0
- package/build/prompt/InlinePrompt/InlinePrompt.mjs.map +1 -1
- package/build/radioGroup/RadioGroup.js +1 -0
- package/build/radioGroup/RadioGroup.js.map +1 -1
- package/build/radioGroup/RadioGroup.mjs +1 -0
- package/build/radioGroup/RadioGroup.mjs.map +1 -1
- package/build/styles/field/Field.css +10 -1
- package/build/styles/main.css +20 -1
- package/build/styles/prompt/InlinePrompt/InlinePrompt.css +3 -0
- package/build/styles/radioGroup/RadioGroup.css +3 -0
- package/build/styles/typeahead/Typeahead.css +4 -0
- package/build/typeahead/Typeahead.js +20 -7
- package/build/typeahead/Typeahead.js.map +1 -1
- package/build/typeahead/Typeahead.mjs +20 -7
- package/build/typeahead/Typeahead.mjs.map +1 -1
- package/build/types/alert/Alert.d.ts +1 -1
- package/build/types/alert/Alert.d.ts.map +1 -1
- package/build/types/common/initials.d.ts.map +1 -1
- package/build/types/field/Field.d.ts +8 -4
- package/build/types/field/Field.d.ts.map +1 -1
- package/build/types/inlineAlert/InlineAlert.d.ts +1 -7
- package/build/types/inlineAlert/InlineAlert.d.ts.map +1 -1
- package/build/types/listItem/_stories/variants/helpers.d.ts +7 -4
- package/build/types/listItem/_stories/variants/helpers.d.ts.map +1 -1
- package/build/types/prompt/InlinePrompt/InlinePrompt.d.ts +6 -1
- package/build/types/prompt/InlinePrompt/InlinePrompt.d.ts.map +1 -1
- package/build/types/radioGroup/RadioGroup.d.ts.map +1 -1
- package/build/types/test-utils/index.d.ts +0 -1
- package/build/types/test-utils/index.d.ts.map +1 -1
- package/build/types/typeahead/Typeahead.d.ts +8 -4
- package/build/types/typeahead/Typeahead.d.ts.map +1 -1
- package/build/types/upload/Upload.d.ts +1 -1
- package/build/types/upload/steps/uploadImageStep/uploadImageStep.d.ts.map +1 -1
- package/build/upload/Upload.js.map +1 -1
- package/build/upload/Upload.mjs.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.js +5 -4
- package/build/upload/steps/uploadImageStep/uploadImageStep.js.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs +5 -4
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs.map +1 -1
- package/package.json +9 -8
- package/src/DisabledComponents.story.tsx +1 -3
- package/src/actionButton/ActionButton.story.tsx +42 -45
- package/src/alert/Alert.spec.tsx +1 -1
- package/src/alert/Alert.tsx +2 -2
- package/src/avatar/Avatar.story.tsx +192 -188
- package/src/button/_stories/Button.tests.story.tsx +122 -119
- package/src/carousel/Carousel.story.tsx +4 -7
- package/src/checkbox/Checkbox.story.tsx +42 -21
- package/src/checkbox/Checkbox.tsx +1 -1
- package/src/checkbox/__snapshots__/Checkbox.spec.tsx.snap +1 -1
- package/src/circularButton/CircularButton.story.tsx +10 -2
- package/src/common/bottomSheet/BottomSheet.story.tsx +48 -14
- package/src/common/circle/Circle.story.tsx +62 -55
- package/src/common/initials.spec.tsx +31 -0
- package/src/common/initials.ts +19 -8
- package/src/criticalBanner/CriticalCommsBanner.story.tsx +30 -19
- package/src/dateInput/DateInput.tests.story.tsx +101 -74
- package/src/dateLookup/DateLookup.story.tsx +69 -59
- package/src/field/Field.css +10 -1
- package/src/field/Field.less +13 -2
- package/src/field/Field.spec.tsx +19 -3
- package/src/field/Field.story.tsx +18 -0
- package/src/field/Field.tsx +17 -5
- package/src/header/Header.story.tsx +5 -16
- package/src/header/Header.tests.story.tsx +95 -69
- package/src/info/Info.story.tsx +27 -11
- package/src/inlineAlert/InlineAlert.story.tsx +4 -0
- package/src/inlineAlert/InlineAlert.tsx +1 -7
- package/src/instructionsList/InstructionsList.story.tsx +0 -1
- package/src/listItem/_stories/ListItem.layout.test.story.tsx +1 -3
- package/src/listItem/_stories/variants/ListItem.brightGreen.test.story.tsx +77 -35
- package/src/listItem/_stories/variants/ListItem.dark.test.story.tsx +65 -29
- package/src/listItem/_stories/variants/ListItem.forestGreen.test.story.tsx +77 -35
- package/src/listItem/_stories/variants/ListItem.medium.test.story.tsx +38 -18
- package/src/listItem/_stories/variants/ListItem.neutral.test.story.tsx +0 -1
- package/src/listItem/_stories/variants/ListItem.personal.test.story.tsx +38 -18
- package/src/listItem/_stories/variants/ListItem.rtl.test.story.tsx +77 -29
- package/src/listItem/_stories/variants/ListItem.small.test.story.tsx +65 -18
- package/src/listItem/_stories/variants/helpers.tsx +136 -133
- package/src/main.css +20 -1
- package/src/main.less +1 -0
- package/src/modal/Modal.story.tsx +47 -8
- package/src/moneyInput/MoneyInput.story.tsx +2 -2
- package/src/primitives/PrimitiveAnchor/stories/PrimitiveAnchor.story.tsx +1 -0
- package/src/primitives/PrimitiveAnchor/stories/PrimitiveAnchor.tests.story.tsx +1 -0
- package/src/primitives/PrimitiveButton/stories/PrimitiveButton.story.tsx +1 -0
- package/src/primitives/PrimitiveButton/stories/PrimitiveButton.tests.story.tsx +1 -0
- package/src/prompt/InlinePrompt/InlinePrompt.css +3 -0
- package/src/prompt/InlinePrompt/InlinePrompt.less +5 -1
- package/src/prompt/InlinePrompt/InlinePrompt.spec.tsx +17 -0
- package/src/prompt/InlinePrompt/InlinePrompt.story.tsx +35 -0
- package/src/prompt/InlinePrompt/InlinePrompt.tsx +7 -0
- package/src/provider/theme/ThemeProvider.story.tsx +1 -0
- package/src/radioGroup/RadioGroup.css +3 -0
- package/src/radioGroup/RadioGroup.less +3 -0
- package/src/radioGroup/RadioGroup.story.tsx +2 -0
- package/src/radioGroup/RadioGroup.test.story.tsx +62 -0
- package/src/radioGroup/RadioGroup.tsx +6 -1
- package/src/segmentedControl/SegmentedControl.story.tsx +71 -67
- package/src/snackbar/Snackbar.tests.story.tsx +116 -114
- package/src/statusIcon/StatusIcon.story.tsx +41 -38
- package/src/test-utils/index.tsx +0 -2
- package/src/tokens/tokens.story.tsx +1 -1
- package/src/tooltip/Tooltip.story.tsx +10 -2
- package/src/typeahead/Typeahead.css +4 -0
- package/src/typeahead/Typeahead.less +5 -1
- package/src/typeahead/Typeahead.spec.tsx +1 -1
- package/src/typeahead/Typeahead.story.tsx +151 -3
- package/src/typeahead/Typeahead.tsx +33 -9
- package/src/upload/Upload.story.tsx +1 -1
- package/src/upload/Upload.tests.story.tsx +36 -1
- package/src/upload/Upload.tsx +1 -1
- package/src/upload/steps/uploadImageStep/uploadImageStep.tsx +7 -3
- package/src/withId/withId.story.tsx +1 -1
- package/build/types/test-utils/story-config.d.ts +0 -64
- package/build/types/test-utils/story-config.d.ts.map +0 -1
- package/src/test-utils/story-config.ts +0 -95
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Meta } from '@storybook/react-webpack5';
|
|
2
2
|
import { ListItem, type ListItemProps } from '../../ListItem';
|
|
3
|
-
import {
|
|
3
|
+
import { VariantStory } from './helpers';
|
|
4
4
|
import { withSizedContainer } from '../helpers';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
@@ -15,20 +15,40 @@ export default {
|
|
|
15
15
|
decorators: [withSizedContainer('medium')],
|
|
16
16
|
} satisfies Meta<ListItemProps>;
|
|
17
17
|
|
|
18
|
-
export const Button =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export const
|
|
23
|
-
export const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
export const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
export const
|
|
32
|
-
export const
|
|
33
|
-
export const
|
|
34
|
-
|
|
18
|
+
export const Button = {
|
|
19
|
+
...VariantStory,
|
|
20
|
+
args: { controlType: 'button' },
|
|
21
|
+
};
|
|
22
|
+
export const ButtonAsLink = { ...VariantStory, args: { controlType: 'buttonAsLink' } };
|
|
23
|
+
export const ButtonPartiallyInteractive = {
|
|
24
|
+
...VariantStory,
|
|
25
|
+
args: { controlType: 'partialButton' },
|
|
26
|
+
};
|
|
27
|
+
export const ButtonAsLinkPartiallyInteractive = {
|
|
28
|
+
...VariantStory,
|
|
29
|
+
args: { controlType: 'partialButtonAsLink' },
|
|
30
|
+
};
|
|
31
|
+
export const IconButton = { ...VariantStory, args: { controlType: 'iconButton' } };
|
|
32
|
+
export const IconButtonAsLink = { ...VariantStory, args: { controlType: 'iconButtonAsLink' } };
|
|
33
|
+
export const IconButtonWithLabel = {
|
|
34
|
+
...VariantStory,
|
|
35
|
+
args: { controlType: 'iconButtonWithLabel' },
|
|
36
|
+
};
|
|
37
|
+
export const IconButtonAsLinkWithLabel = {
|
|
38
|
+
...VariantStory,
|
|
39
|
+
args: { controlType: 'iconButtonAsLinkWithLabel' },
|
|
40
|
+
};
|
|
41
|
+
export const IconButtonPartiallyInteractive = {
|
|
42
|
+
...VariantStory,
|
|
43
|
+
args: { controlType: 'partialIconButton' },
|
|
44
|
+
};
|
|
45
|
+
export const IconButtonAsLinkPartiallyInteractive = {
|
|
46
|
+
...VariantStory,
|
|
47
|
+
args: { controlType: 'partialIconButtonAsLink' },
|
|
48
|
+
};
|
|
49
|
+
export const Navigation = { ...VariantStory, args: { controlType: 'navigation' } };
|
|
50
|
+
export const NavigationAsButton = { ...VariantStory, args: { controlType: 'navigationAsButton' } };
|
|
51
|
+
export const Checkbox = { ...VariantStory, args: { controlType: 'checkbox' } };
|
|
52
|
+
export const Radio = { ...VariantStory, args: { controlType: 'radio' } };
|
|
53
|
+
export const Switch = { ...VariantStory, args: { controlType: 'switch' } };
|
|
54
|
+
export const NonInteractive = { ...VariantStory, args: { controlType: 'non-interactive' } };
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
SB_LIST_ITEM_CONTROLS as CONTROLS,
|
|
7
7
|
SB_LIST_ITEM_PROMPTS as PROMPT,
|
|
8
8
|
} from '../subcomponents';
|
|
9
|
-
import {
|
|
9
|
+
import { VariantStory } from './helpers';
|
|
10
10
|
|
|
11
11
|
export default {
|
|
12
12
|
component: ListItem,
|
|
@@ -21,23 +21,43 @@ export default {
|
|
|
21
21
|
|
|
22
22
|
type Story = StoryObj<ListItemProps>;
|
|
23
23
|
|
|
24
|
-
export const Button =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
export const
|
|
29
|
-
export const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
export const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
export const
|
|
38
|
-
export const
|
|
39
|
-
export const
|
|
40
|
-
|
|
24
|
+
export const Button = {
|
|
25
|
+
...VariantStory,
|
|
26
|
+
args: { controlType: 'button' },
|
|
27
|
+
};
|
|
28
|
+
export const ButtonAsLink = { ...VariantStory, args: { controlType: 'buttonAsLink' } };
|
|
29
|
+
export const ButtonPartiallyInteractive = {
|
|
30
|
+
...VariantStory,
|
|
31
|
+
args: { controlType: 'partialButton' },
|
|
32
|
+
};
|
|
33
|
+
export const ButtonAsLinkPartiallyInteractive = {
|
|
34
|
+
...VariantStory,
|
|
35
|
+
args: { controlType: 'partialButtonAsLink' },
|
|
36
|
+
};
|
|
37
|
+
export const IconButton = { ...VariantStory, args: { controlType: 'iconButton' } };
|
|
38
|
+
export const IconButtonAsLink = { ...VariantStory, args: { controlType: 'iconButtonAsLink' } };
|
|
39
|
+
export const IconButtonWithLabel = {
|
|
40
|
+
...VariantStory,
|
|
41
|
+
args: { controlType: 'iconButtonWithLabel' },
|
|
42
|
+
};
|
|
43
|
+
export const IconButtonAsLinkWithLabel = {
|
|
44
|
+
...VariantStory,
|
|
45
|
+
args: { controlType: 'iconButtonAsLinkWithLabel' },
|
|
46
|
+
};
|
|
47
|
+
export const IconButtonPartiallyInteractive = {
|
|
48
|
+
...VariantStory,
|
|
49
|
+
args: { controlType: 'partialIconButton' },
|
|
50
|
+
};
|
|
51
|
+
export const IconButtonAsLinkPartiallyInteractive = {
|
|
52
|
+
...VariantStory,
|
|
53
|
+
args: { controlType: 'partialIconButtonAsLink' },
|
|
54
|
+
};
|
|
55
|
+
export const Navigation = { ...VariantStory, args: { controlType: 'navigation' } };
|
|
56
|
+
export const NavigationAsButton = { ...VariantStory, args: { controlType: 'navigationAsButton' } };
|
|
57
|
+
export const Checkbox = { ...VariantStory, args: { controlType: 'checkbox' } };
|
|
58
|
+
export const Radio = { ...VariantStory, args: { controlType: 'radio' } };
|
|
59
|
+
export const Switch = { ...VariantStory, args: { controlType: 'switch' } };
|
|
60
|
+
export const NonInteractive = { ...VariantStory, args: { controlType: 'non-interactive' } };
|
|
41
61
|
|
|
42
62
|
export const ButtonControlLabel: Story = {
|
|
43
63
|
render: () => (
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Meta } from '@storybook/react-webpack5';
|
|
2
2
|
import { ListItem, type ListItemProps } from '../../ListItem';
|
|
3
|
-
import {
|
|
3
|
+
import { VariantStory } from './helpers';
|
|
4
|
+
import { allModes } from '../../../../.storybook/modes';
|
|
4
5
|
|
|
5
6
|
export default {
|
|
6
7
|
component: ListItem,
|
|
@@ -13,31 +14,78 @@ export default {
|
|
|
13
14
|
},
|
|
14
15
|
} satisfies Meta<ListItemProps>;
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
export const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
export const
|
|
17
|
+
const Default = {
|
|
18
|
+
...VariantStory,
|
|
19
|
+
parameters: {
|
|
20
|
+
variants: ['rtl'],
|
|
21
|
+
chromatic: {
|
|
22
|
+
rtl: allModes.rtl,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
args: { variant: 'rtl' },
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const Button = {
|
|
29
|
+
...Default,
|
|
30
|
+
args: { ...Default.args, variant: 'button' },
|
|
31
|
+
};
|
|
32
|
+
export const ButtonAsLink = {
|
|
33
|
+
...Default,
|
|
34
|
+
args: { ...Default.args, controlType: 'buttonAsLink' },
|
|
35
|
+
};
|
|
36
|
+
export const ButtonPartiallyInteractive = {
|
|
37
|
+
...Default,
|
|
38
|
+
args: { ...Default.args, controlType: 'partialButton' },
|
|
39
|
+
};
|
|
40
|
+
export const ButtonAsLinkPartiallyInteractive = {
|
|
41
|
+
...Default,
|
|
42
|
+
args: { ...Default.args, controlType: 'partialButtonAsLink' },
|
|
43
|
+
};
|
|
44
|
+
export const IconButton = {
|
|
45
|
+
...Default,
|
|
46
|
+
args: { ...Default.args, controlType: 'iconButton' },
|
|
47
|
+
};
|
|
48
|
+
export const IconButtonAsLink = {
|
|
49
|
+
...Default,
|
|
50
|
+
args: { ...Default.args, controlType: 'iconButtonAsLink' },
|
|
51
|
+
};
|
|
52
|
+
export const IconButtonWithLabel = {
|
|
53
|
+
...Default,
|
|
54
|
+
args: { ...Default.args, controlType: 'iconButtonWithLabel' },
|
|
55
|
+
};
|
|
56
|
+
export const IconButtonAsLinkWithLabel = {
|
|
57
|
+
...Default,
|
|
58
|
+
args: { ...Default.args, controlType: 'iconButtonAsLinkWithLabel' },
|
|
59
|
+
};
|
|
60
|
+
export const IconButtonPartiallyInteractive = {
|
|
61
|
+
...Default,
|
|
62
|
+
args: { ...Default.args, controlType: 'partialIconButton' },
|
|
63
|
+
};
|
|
64
|
+
export const IconButtonAsLinkPartiallyInteractive = {
|
|
65
|
+
...Default,
|
|
66
|
+
args: { ...Default.args, controlType: 'partialIconButtonAsLink' },
|
|
67
|
+
};
|
|
68
|
+
export const Navigation = {
|
|
69
|
+
...Default,
|
|
70
|
+
args: { ...Default.args, controlType: 'navigation' },
|
|
71
|
+
};
|
|
72
|
+
export const NavigationAsButton = {
|
|
73
|
+
...Default,
|
|
74
|
+
args: { ...Default.args, controlType: 'navigationAsButton' },
|
|
75
|
+
};
|
|
76
|
+
export const Checkbox = {
|
|
77
|
+
...Default,
|
|
78
|
+
args: { ...Default.args, controlType: 'checkbox' },
|
|
79
|
+
};
|
|
80
|
+
export const Radio = {
|
|
81
|
+
...Default,
|
|
82
|
+
args: { ...Default.args, controlType: 'radio' },
|
|
83
|
+
};
|
|
84
|
+
export const Switch = {
|
|
85
|
+
...Default,
|
|
86
|
+
args: { ...Default.args, controlType: 'switch' },
|
|
87
|
+
};
|
|
88
|
+
export const NonInteractive = {
|
|
89
|
+
...Default,
|
|
90
|
+
args: { ...Default.args, controlType: 'non-interactive' },
|
|
91
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Meta } from '@storybook/react-webpack5';
|
|
2
2
|
import { ListItem, type ListItemProps } from '../../ListItem';
|
|
3
|
-
import {
|
|
3
|
+
import { VariantStory } from './helpers';
|
|
4
4
|
import { withSizedContainer } from '../helpers';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
@@ -15,20 +15,67 @@ export default {
|
|
|
15
15
|
decorators: [withSizedContainer('small')],
|
|
16
16
|
} satisfies Meta<ListItemProps>;
|
|
17
17
|
|
|
18
|
-
export const Button =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
export const
|
|
18
|
+
export const Button = {
|
|
19
|
+
...VariantStory,
|
|
20
|
+
args: { controlType: 'button' },
|
|
21
|
+
};
|
|
22
|
+
export const ButtonAsLink = {
|
|
23
|
+
...VariantStory,
|
|
24
|
+
args: { controlType: 'buttonAsLink' },
|
|
25
|
+
};
|
|
26
|
+
export const ButtonPartiallyInteractive = {
|
|
27
|
+
...VariantStory,
|
|
28
|
+
args: { controlType: 'partialButton' },
|
|
29
|
+
};
|
|
30
|
+
export const ButtonAsLinkPartiallyInteractive = {
|
|
31
|
+
...VariantStory,
|
|
32
|
+
args: { controlType: 'partialButtonAsLink' },
|
|
33
|
+
};
|
|
34
|
+
export const IconButton = {
|
|
35
|
+
...VariantStory,
|
|
36
|
+
args: { controlType: 'iconButton' },
|
|
37
|
+
};
|
|
38
|
+
export const IconButtonAsLink = {
|
|
39
|
+
...VariantStory,
|
|
40
|
+
args: { controlType: 'iconButtonAsLink' },
|
|
41
|
+
};
|
|
42
|
+
export const IconButtonWithLabel = {
|
|
43
|
+
...VariantStory,
|
|
44
|
+
args: { controlType: 'iconButtonWithLabel' },
|
|
45
|
+
};
|
|
46
|
+
export const IconButtonAsLinkWithLabel = {
|
|
47
|
+
...VariantStory,
|
|
48
|
+
args: { controlType: 'iconButtonAsLinkWithLabel' },
|
|
49
|
+
};
|
|
50
|
+
export const IconButtonPartiallyInteractive = {
|
|
51
|
+
...VariantStory,
|
|
52
|
+
args: { controlType: 'partialIconButton' },
|
|
53
|
+
};
|
|
54
|
+
export const IconButtonAsLinkPartiallyInteractive = {
|
|
55
|
+
...VariantStory,
|
|
56
|
+
args: { controlType: 'partialIconButtonAsLink' },
|
|
57
|
+
};
|
|
58
|
+
export const Navigation = {
|
|
59
|
+
...VariantStory,
|
|
60
|
+
args: { controlType: 'navigation' },
|
|
61
|
+
};
|
|
62
|
+
export const NavigationAsButton = {
|
|
63
|
+
...VariantStory,
|
|
64
|
+
args: { controlType: 'navigationAsButton' },
|
|
65
|
+
};
|
|
66
|
+
export const Checkbox = {
|
|
67
|
+
...VariantStory,
|
|
68
|
+
args: { controlType: 'checkbox' },
|
|
69
|
+
};
|
|
70
|
+
export const Radio = {
|
|
71
|
+
...VariantStory,
|
|
72
|
+
args: { controlType: 'radio' },
|
|
73
|
+
};
|
|
74
|
+
export const Switch = {
|
|
75
|
+
...VariantStory,
|
|
76
|
+
args: { controlType: 'switch' },
|
|
77
|
+
};
|
|
78
|
+
export const NonInteractive = {
|
|
79
|
+
...VariantStory,
|
|
80
|
+
args: { controlType: 'non-interactive' },
|
|
81
|
+
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react-webpack5';
|
|
2
|
-
import { StoryConfig, storyConfig } from '../../../test-utils';
|
|
3
2
|
import List from '../../../list';
|
|
4
3
|
import { ListItem, type ListItemProps } from '../../ListItem';
|
|
5
4
|
import {
|
|
@@ -11,144 +10,148 @@ import {
|
|
|
11
10
|
SB_ListItem_ControlType as ControlType,
|
|
12
11
|
} from '../subcomponents';
|
|
13
12
|
|
|
14
|
-
type Story = StoryObj<ListItemProps>;
|
|
15
13
|
type VariantPartial = { title: string } & Partial<ListItemProps>;
|
|
14
|
+
type Variant = 'default' | 'dark' | 'rtl' | 'forest-green' | 'bright-green' | 'mobile' | '400%';
|
|
16
15
|
|
|
17
16
|
const { title, subtitle, valueTitle, valueSubtitle, longTitle, longSubtitle, longValueTitle } =
|
|
18
17
|
TEXT;
|
|
19
18
|
const prompt = PROMPT.nonInteractive;
|
|
20
19
|
const media = MEDIA.avatarSingle;
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
controlType: ControlType
|
|
24
|
-
variant
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
title:
|
|
51
|
-
subtitle
|
|
52
|
-
valueTitle,
|
|
53
|
-
valueSubtitle,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
media,
|
|
79
|
-
title:
|
|
80
|
-
subtitle
|
|
81
|
-
valueTitle,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
additionalInfo,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
21
|
+
type VariantStoryProps = {
|
|
22
|
+
controlType: ControlType;
|
|
23
|
+
variant?: Variant;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
type VariantStory = StoryObj<VariantStoryProps>;
|
|
27
|
+
|
|
28
|
+
export const VariantStory: VariantStory = {
|
|
29
|
+
render: ({ controlType, variant = 'default' }) => {
|
|
30
|
+
const control = CONTROLS[controlType];
|
|
31
|
+
const isInteractive = [
|
|
32
|
+
'partialButton',
|
|
33
|
+
'partialButtonAsLink',
|
|
34
|
+
'partialIconButton',
|
|
35
|
+
'partialIconButtonAsLink',
|
|
36
|
+
].includes(controlType);
|
|
37
|
+
const additionalInfo = isInteractive ? INFO.interactive : INFO.nonInteractive;
|
|
38
|
+
const instances = [
|
|
39
|
+
{ title },
|
|
40
|
+
{ title: longTitle },
|
|
41
|
+
{ title, valueTitle },
|
|
42
|
+
{ title, valueTitle: longValueTitle },
|
|
43
|
+
{ title: longTitle, valueTitle },
|
|
44
|
+
{ title, subtitle },
|
|
45
|
+
{ title, subtitle: longSubtitle },
|
|
46
|
+
{ title, additionalInfo },
|
|
47
|
+
{ title, valueTitle, valueSubtitle },
|
|
48
|
+
{ title, valueTitle: longValueTitle, valueSubtitle },
|
|
49
|
+
{ title, subtitle, inverted: true },
|
|
50
|
+
{ title, subtitle, valueTitle },
|
|
51
|
+
{ title, subtitle, valueTitle, inverted: true },
|
|
52
|
+
{ title, subtitle, valueTitle, valueSubtitle },
|
|
53
|
+
{
|
|
54
|
+
title: longTitle,
|
|
55
|
+
subtitle: longSubtitle,
|
|
56
|
+
valueTitle,
|
|
57
|
+
valueSubtitle,
|
|
58
|
+
additionalInfo: INFO.nonInteractive,
|
|
59
|
+
},
|
|
60
|
+
{ title, subtitle, valueTitle, valueSubtitle, inverted: true },
|
|
61
|
+
{ media, title },
|
|
62
|
+
{ media, title: longTitle },
|
|
63
|
+
{ media, title, valueTitle },
|
|
64
|
+
{ media, title: longTitle, valueTitle },
|
|
65
|
+
{ media, title: longTitle, valueSubtitle },
|
|
66
|
+
{ media, title, valueTitle: longValueTitle },
|
|
67
|
+
{ media, title, valueTitle: longValueTitle, valueSubtitle },
|
|
68
|
+
{ media, title, subtitle },
|
|
69
|
+
{ media, title: longTitle, subtitle },
|
|
70
|
+
{ media, title, valueTitle, valueSubtitle },
|
|
71
|
+
{ media, title, valueTitle },
|
|
72
|
+
{ media, title, valueSubtitle },
|
|
73
|
+
{ media, title, subtitle },
|
|
74
|
+
{ media, title, additionalInfo },
|
|
75
|
+
{ media, title, subtitle, valueTitle },
|
|
76
|
+
{ media, title, subtitle, valueTitle, valueSubtitle },
|
|
77
|
+
{ media, title, subtitle, additionalInfo: INFO.nonInteractive },
|
|
78
|
+
isInteractive ? { media, title, subtitle, additionalInfo: INFO.interactive } : null,
|
|
79
|
+
{ media, title, subtitle, additionalInfo, valueTitle },
|
|
80
|
+
{ media, title, subtitle, additionalInfo, valueTitle, valueSubtitle },
|
|
81
|
+
{
|
|
82
|
+
media,
|
|
83
|
+
title: longTitle,
|
|
84
|
+
subtitle: longSubtitle,
|
|
85
|
+
valueTitle,
|
|
86
|
+
valueSubtitle,
|
|
87
|
+
additionalInfo: INFO.nonInteractive,
|
|
88
|
+
},
|
|
89
|
+
{ media, title, subtitle, additionalInfo, valueTitle, valueSubtitle, prompt },
|
|
90
|
+
{
|
|
91
|
+
media,
|
|
92
|
+
title,
|
|
93
|
+
subtitle,
|
|
94
|
+
additionalInfo,
|
|
95
|
+
valueTitle,
|
|
96
|
+
valueSubtitle,
|
|
97
|
+
prompt: PROMPT.interactive,
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
media,
|
|
101
|
+
title,
|
|
102
|
+
subtitle,
|
|
103
|
+
additionalInfo,
|
|
104
|
+
valueTitle,
|
|
105
|
+
valueSubtitle,
|
|
106
|
+
prompt: PROMPT.interactive,
|
|
107
|
+
inverted: true,
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
media,
|
|
111
|
+
title,
|
|
112
|
+
subtitle,
|
|
113
|
+
additionalInfo,
|
|
114
|
+
valueTitle,
|
|
115
|
+
valueSubtitle,
|
|
116
|
+
prompt: PROMPT.interactive,
|
|
117
|
+
spotlight: 'active',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
media,
|
|
121
|
+
title,
|
|
122
|
+
subtitle,
|
|
123
|
+
additionalInfo,
|
|
124
|
+
valueTitle,
|
|
125
|
+
valueSubtitle,
|
|
126
|
+
prompt: PROMPT.interactive,
|
|
127
|
+
spotlight: 'inactive',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
media,
|
|
131
|
+
title,
|
|
132
|
+
subtitle,
|
|
133
|
+
additionalInfo,
|
|
134
|
+
valueTitle,
|
|
135
|
+
valueSubtitle,
|
|
136
|
+
prompt: PROMPT.interactive,
|
|
137
|
+
spotlight: 'inactive',
|
|
138
|
+
disabled: true,
|
|
139
|
+
},
|
|
140
|
+
].filter(Boolean) as VariantPartial[];
|
|
137
141
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
);
|
|
142
|
+
return (
|
|
143
|
+
<List>
|
|
144
|
+
{instances.map((instance) => (
|
|
145
|
+
<ListItem
|
|
146
|
+
key={`${variant}-${controlType}-${JSON.stringify(instance)}`}
|
|
147
|
+
control={control}
|
|
148
|
+
{...instance}
|
|
149
|
+
/>
|
|
150
|
+
))}
|
|
151
|
+
</List>
|
|
152
|
+
);
|
|
153
|
+
},
|
|
154
|
+
parameters: {
|
|
155
|
+
variants: ['default'],
|
|
156
|
+
},
|
|
154
157
|
};
|