@dxc-technology/halstack-react 0.0.0-1f7dada → 0.0.0-2151ae6
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/BackgroundColorContext.js +0 -1
- package/HalstackContext.d.ts +12 -0
- package/HalstackContext.js +295 -0
- package/accordion/Accordion.d.ts +1 -1
- package/accordion/Accordion.js +13 -45
- package/accordion/Accordion.stories.tsx +20 -13
- package/accordion/Accordion.test.js +72 -0
- package/accordion/types.d.ts +7 -7
- package/accordion-group/AccordionGroup.d.ts +1 -1
- package/accordion-group/AccordionGroup.js +14 -15
- package/accordion-group/AccordionGroup.stories.tsx +1 -1
- package/accordion-group/AccordionGroup.test.js +151 -0
- package/accordion-group/types.d.ts +7 -7
- package/alert/Alert.js +4 -1
- package/alert/Alert.test.js +92 -0
- package/badge/Badge.d.ts +4 -0
- package/badge/Badge.js +5 -3
- package/badge/types.d.ts +5 -0
- package/{radio → badge}/types.js +0 -0
- package/bleed/Bleed.d.ts +3 -0
- package/bleed/Bleed.js +51 -0
- package/bleed/Bleed.stories.tsx +341 -0
- package/bleed/types.d.ts +37 -0
- package/bleed/types.js +5 -0
- package/box/Box.js +22 -32
- package/box/Box.test.js +18 -0
- package/bulleted-list/BulletedList.d.ts +7 -0
- package/bulleted-list/BulletedList.js +123 -0
- package/bulleted-list/BulletedList.stories.tsx +200 -0
- package/bulleted-list/types.d.ts +11 -0
- package/bulleted-list/types.js +5 -0
- package/button/Button.d.ts +1 -1
- package/button/Button.js +19 -24
- package/button/Button.stories.tsx +6 -8
- package/button/Button.test.js +35 -0
- package/button/types.d.ts +3 -7
- package/card/Card.js +24 -27
- package/card/Card.stories.tsx +1 -1
- package/card/Card.test.js +50 -0
- package/checkbox/Checkbox.d.ts +1 -1
- package/checkbox/Checkbox.js +43 -39
- package/checkbox/Checkbox.stories.tsx +124 -128
- package/checkbox/Checkbox.test.js +78 -0
- package/checkbox/types.d.ts +8 -4
- package/chip/Chip.d.ts +1 -1
- package/chip/Chip.js +14 -52
- package/chip/Chip.stories.tsx +6 -8
- package/chip/Chip.test.js +56 -0
- package/chip/types.d.ts +5 -13
- package/common/variables.js +254 -333
- package/date-input/DateInput.js +59 -45
- package/date-input/DateInput.stories.tsx +7 -7
- package/date-input/DateInput.test.js +479 -0
- package/date-input/types.d.ts +16 -9
- package/dialog/Dialog.js +6 -33
- package/dialog/Dialog.test.js +40 -0
- package/dropdown/Dropdown.d.ts +1 -1
- package/dropdown/Dropdown.js +21 -47
- package/dropdown/Dropdown.stories.tsx +249 -0
- package/dropdown/Dropdown.test.js +189 -0
- package/dropdown/types.d.ts +5 -14
- package/file-input/FileInput.js +111 -39
- package/file-input/FileInput.stories.tsx +507 -0
- package/file-input/FileInput.test.js +457 -0
- package/file-input/FileItem.js +7 -5
- package/flex/Flex.d.ts +3 -0
- package/flex/Flex.js +74 -0
- package/flex/Flex.stories.tsx +103 -0
- package/flex/types.d.ts +21 -0
- package/flex/types.js +5 -0
- package/footer/Footer.js +24 -99
- package/footer/Footer.test.js +109 -0
- package/footer/Icons.js +1 -1
- package/header/Header.js +27 -48
- package/header/Header.stories.tsx +46 -36
- package/header/Header.test.js +79 -0
- package/heading/Heading.stories.tsx +3 -2
- package/heading/Heading.test.js +186 -0
- package/inset/Inset.d.ts +3 -0
- package/inset/Inset.js +51 -0
- package/inset/Inset.stories.tsx +229 -0
- package/inset/types.d.ts +37 -0
- package/inset/types.js +5 -0
- package/layout/ApplicationLayout.d.ts +4 -3
- package/layout/ApplicationLayout.js +69 -108
- package/layout/ApplicationLayout.stories.tsx +44 -85
- package/layout/Icons.d.ts +5 -0
- package/layout/Icons.js +13 -2
- package/layout/SidenavContext.d.ts +5 -0
- package/layout/SidenavContext.js +19 -0
- package/layout/types.d.ts +8 -21
- package/link/Link.d.ts +3 -2
- package/link/Link.js +60 -85
- package/link/Link.stories.tsx +92 -52
- package/link/Link.test.js +83 -0
- package/link/types.d.ts +9 -29
- package/main.d.ts +11 -10
- package/main.js +61 -47
- package/number-input/NumberInput.js +11 -18
- package/number-input/NumberInput.stories.tsx +5 -5
- package/number-input/NumberInput.test.js +506 -0
- package/number-input/types.d.ts +17 -10
- package/package.json +10 -6
- package/paginator/Paginator.js +17 -38
- package/paginator/Paginator.test.js +308 -0
- package/paragraph/Paragraph.d.ts +6 -0
- package/paragraph/Paragraph.js +38 -0
- package/paragraph/Paragraph.stories.tsx +44 -0
- package/password-input/PasswordInput.js +7 -4
- package/password-input/PasswordInput.stories.tsx +3 -3
- package/password-input/PasswordInput.test.js +180 -0
- package/password-input/types.d.ts +14 -11
- package/progress-bar/ProgressBar.js +3 -3
- package/progress-bar/ProgressBar.stories.jsx +11 -11
- package/progress-bar/ProgressBar.test.js +65 -0
- package/quick-nav/QuickNav.d.ts +4 -0
- package/quick-nav/QuickNav.js +118 -0
- package/quick-nav/QuickNav.stories.tsx +264 -0
- package/quick-nav/types.d.ts +21 -0
- package/quick-nav/types.js +5 -0
- package/radio-group/Radio.d.ts +4 -0
- package/radio-group/Radio.js +141 -0
- package/radio-group/RadioGroup.d.ts +4 -0
- package/radio-group/RadioGroup.js +283 -0
- package/radio-group/RadioGroup.stories.tsx +100 -0
- package/radio-group/RadioGroup.test.js +695 -0
- package/radio-group/types.d.ts +114 -0
- package/radio-group/types.js +5 -0
- package/resultsetTable/ResultsetTable.js +5 -2
- package/resultsetTable/ResultsetTable.stories.tsx +7 -8
- package/resultsetTable/ResultsetTable.test.js +348 -0
- package/row/Row.d.ts +3 -11
- package/row/Row.js +12 -9
- package/row/Row.stories.tsx +20 -6
- package/row/types.d.ts +28 -0
- package/row/types.js +5 -0
- package/select/Icons.d.ts +10 -0
- package/select/Icons.js +93 -0
- package/select/Listbox.d.ts +4 -0
- package/select/Listbox.js +175 -0
- package/select/Option.d.ts +4 -0
- package/select/Option.js +110 -0
- package/select/Select.d.ts +4 -0
- package/select/Select.js +149 -352
- package/select/Select.stories.tsx +230 -176
- package/select/Select.test.js +2162 -0
- package/select/types.d.ts +212 -0
- package/select/types.js +5 -0
- package/sidenav/Sidenav.d.ts +6 -5
- package/sidenav/Sidenav.js +172 -52
- package/sidenav/Sidenav.stories.tsx +154 -139
- package/sidenav/Sidenav.test.js +44 -0
- package/sidenav/types.d.ts +50 -27
- package/slider/Slider.d.ts +1 -1
- package/slider/Slider.js +2 -1
- package/slider/Slider.stories.tsx +8 -8
- package/slider/Slider.test.js +150 -0
- package/slider/types.d.ts +4 -0
- package/spinner/Spinner.js +1 -1
- package/spinner/Spinner.stories.jsx +1 -0
- package/spinner/Spinner.test.js +64 -0
- package/stack/Stack.d.ts +4 -10
- package/stack/Stack.js +29 -67
- package/stack/Stack.stories.tsx +198 -85
- package/stack/types.d.ts +32 -0
- package/stack/types.js +5 -0
- package/switch/Switch.d.ts +1 -1
- package/switch/Switch.js +35 -19
- package/switch/Switch.stories.tsx +15 -15
- package/switch/Switch.test.js +98 -0
- package/switch/types.d.ts +6 -2
- package/table/Table.stories.jsx +2 -1
- package/table/Table.test.js +26 -0
- package/tabs/Tabs.d.ts +1 -1
- package/tabs/Tabs.js +16 -18
- package/tabs/Tabs.stories.tsx +7 -16
- package/tabs/Tabs.test.js +140 -0
- package/tabs/types.d.ts +27 -15
- package/tabs-nav/NavTabs.d.ts +8 -0
- package/tabs-nav/NavTabs.js +125 -0
- package/tabs-nav/NavTabs.stories.tsx +170 -0
- package/tabs-nav/NavTabs.test.js +82 -0
- package/tabs-nav/Tab.d.ts +4 -0
- package/tabs-nav/Tab.js +132 -0
- package/tabs-nav/types.d.ts +53 -0
- package/tabs-nav/types.js +5 -0
- package/tag/Tag.d.ts +1 -1
- package/tag/Tag.js +17 -27
- package/tag/Tag.stories.tsx +26 -29
- package/tag/Tag.test.js +60 -0
- package/tag/types.d.ts +23 -14
- package/text-input/Suggestion.d.ts +4 -0
- package/text-input/Suggestion.js +55 -0
- package/text-input/TextInput.js +68 -84
- package/text-input/TextInput.stories.tsx +34 -16
- package/text-input/TextInput.test.js +1712 -0
- package/text-input/types.d.ts +32 -13
- package/textarea/Textarea.js +20 -27
- package/textarea/Textarea.stories.jsx +37 -15
- package/textarea/Textarea.test.js +437 -0
- package/textarea/types.d.ts +18 -11
- package/toggle-group/ToggleGroup.d.ts +1 -1
- package/toggle-group/ToggleGroup.js +12 -14
- package/toggle-group/ToggleGroup.stories.tsx +27 -32
- package/toggle-group/ToggleGroup.test.js +156 -0
- package/toggle-group/types.d.ts +46 -25
- package/typography/Typography.d.ts +4 -0
- package/typography/Typography.js +131 -0
- package/typography/Typography.stories.tsx +198 -0
- package/typography/types.d.ts +18 -0
- package/typography/types.js +5 -0
- package/useTheme.js +2 -2
- package/useTranslatedLabels.d.ts +2 -0
- package/useTranslatedLabels.js +20 -0
- package/wizard/Wizard.d.ts +1 -1
- package/wizard/Wizard.js +55 -44
- package/wizard/Wizard.stories.tsx +13 -23
- package/wizard/Wizard.test.js +141 -0
- package/wizard/types.d.ts +6 -2
- package/ThemeContext.d.ts +0 -15
- package/ThemeContext.js +0 -243
- package/V3Select/V3Select.js +0 -455
- package/V3Select/index.d.ts +0 -27
- package/V3Textarea/V3Textarea.js +0 -260
- package/V3Textarea/index.d.ts +0 -27
- package/date/Date.js +0 -373
- package/date/index.d.ts +0 -27
- package/input-text/Icons.js +0 -22
- package/input-text/InputText.js +0 -611
- package/input-text/index.d.ts +0 -36
- package/list/List.d.ts +0 -8
- package/list/List.js +0 -47
- package/list/List.stories.tsx +0 -85
- package/radio/Radio.d.ts +0 -4
- package/radio/Radio.js +0 -174
- package/radio/Radio.stories.tsx +0 -192
- package/radio/types.d.ts +0 -54
- package/select/index.d.ts +0 -131
- package/text/Text.d.ts +0 -7
- package/text/Text.js +0 -30
- package/text/Text.stories.tsx +0 -19
- package/toggle/Toggle.js +0 -186
- package/toggle/index.d.ts +0 -21
- package/upload/Upload.js +0 -201
- package/upload/buttons-upload/ButtonsUpload.js +0 -111
- package/upload/buttons-upload/Icons.js +0 -40
- package/upload/dragAndDropArea/DragAndDropArea.js +0 -225
- package/upload/dragAndDropArea/Icons.js +0 -39
- package/upload/file-upload/FileToUpload.js +0 -115
- package/upload/file-upload/Icons.js +0 -66
- package/upload/files-upload/FilesToUpload.js +0 -109
- package/upload/index.d.ts +0 -15
- package/upload/transaction/Icons.js +0 -160
- package/upload/transaction/Transaction.js +0 -104
- package/upload/transactions/Transactions.js +0 -94
package/stack/Stack.stories.tsx
CHANGED
|
@@ -13,138 +13,251 @@ export const Chromatic = () => (
|
|
|
13
13
|
<Title title="Default" theme="light" level={4} />
|
|
14
14
|
<Container>
|
|
15
15
|
<DxcStack>
|
|
16
|
-
<Placeholder
|
|
17
|
-
<Placeholder
|
|
18
|
-
<Placeholder
|
|
16
|
+
<Placeholder height="small" width="small" />
|
|
17
|
+
<Placeholder height="medium" width="medium" />
|
|
18
|
+
<Placeholder height="large" width="large" />
|
|
19
|
+
<Placeholder height="small" width="large" />
|
|
19
20
|
</DxcStack>
|
|
20
21
|
</Container>
|
|
21
|
-
<Title title="
|
|
22
|
+
<Title title="Default with divider" theme="light" level={4} />
|
|
22
23
|
<Container>
|
|
23
|
-
<DxcStack
|
|
24
|
-
<Placeholder
|
|
25
|
-
<Placeholder
|
|
26
|
-
<Placeholder
|
|
24
|
+
<DxcStack divider>
|
|
25
|
+
<Placeholder height="medium" width="medium" />
|
|
26
|
+
<Placeholder height="large" width="large" />
|
|
27
|
+
<Placeholder height="small" width="large" />
|
|
27
28
|
</DxcStack>
|
|
28
29
|
</Container>
|
|
29
|
-
<Title title="
|
|
30
|
+
<Title title="Alignment with divider" theme="light" level={4} />
|
|
30
31
|
<Container>
|
|
31
|
-
<DxcStack
|
|
32
|
-
<Placeholder
|
|
33
|
-
<Placeholder
|
|
34
|
-
<Placeholder
|
|
32
|
+
<DxcStack alignX="end" divider>
|
|
33
|
+
<Placeholder height="small" width="small" />
|
|
34
|
+
<Placeholder height="small" width="medium" />
|
|
35
|
+
<Placeholder height="medium" width="small" />
|
|
35
36
|
</DxcStack>
|
|
36
37
|
</Container>
|
|
37
|
-
<Title title="
|
|
38
|
+
<Title title="Default with one child" theme="light" level={4} />
|
|
38
39
|
<Container>
|
|
39
|
-
<DxcStack
|
|
40
|
-
<Placeholder
|
|
41
|
-
<Placeholder></Placeholder>
|
|
42
|
-
<Placeholder paddingLeft={60}></Placeholder>
|
|
40
|
+
<DxcStack divider>
|
|
41
|
+
<Placeholder height="large" width="xlarge" />
|
|
43
42
|
</DxcStack>
|
|
44
43
|
</Container>
|
|
45
|
-
<Title title="
|
|
44
|
+
<Title title="Wrap" theme="light" level={4} />
|
|
45
|
+
<FlexContainer customHeight>
|
|
46
|
+
<DxcStack wrap>
|
|
47
|
+
<Placeholder height="small" width="small" />
|
|
48
|
+
<Placeholder height="large" width="medium" />
|
|
49
|
+
<Placeholder height="medium" width="small" />
|
|
50
|
+
<Placeholder height="large" width="medium" />
|
|
51
|
+
</DxcStack>
|
|
52
|
+
</FlexContainer>
|
|
53
|
+
<Title title="No wrap in a flex container" theme="light" level={4} />
|
|
54
|
+
<FlexContainer customHeight>
|
|
55
|
+
<DxcStack>
|
|
56
|
+
<Placeholder height="small" width="small" />
|
|
57
|
+
<Placeholder height="medium" width="small" />
|
|
58
|
+
<Placeholder height="small" width="medium" />
|
|
59
|
+
</DxcStack>
|
|
60
|
+
</FlexContainer>
|
|
61
|
+
<Title title="No wrap (default)" theme="light" level={4} />
|
|
62
|
+
<Container customHeight>
|
|
63
|
+
<DxcStack>
|
|
64
|
+
<Placeholder height="small" width="medium" />
|
|
65
|
+
<Placeholder height="small" width="small" />
|
|
66
|
+
</DxcStack>
|
|
67
|
+
</Container>
|
|
68
|
+
<Title title="AlignX = start" theme="light" level={4} />
|
|
69
|
+
<Container>
|
|
70
|
+
<DxcStack alignX="start">
|
|
71
|
+
<Placeholder height="small" width="small" />
|
|
72
|
+
<Placeholder height="large" width="medium" />
|
|
73
|
+
<Placeholder height="medium" width="small" />
|
|
74
|
+
<Placeholder height="large" width="medium" />
|
|
75
|
+
</DxcStack>
|
|
76
|
+
</Container>
|
|
77
|
+
<Title title="AlignX = end" theme="light" level={4} />
|
|
78
|
+
<Container>
|
|
79
|
+
<DxcStack alignX="end">
|
|
80
|
+
<Placeholder height="small" width="small" />
|
|
81
|
+
<Placeholder height="large" width="medium" />
|
|
82
|
+
<Placeholder height="medium" width="small" />
|
|
83
|
+
</DxcStack>
|
|
84
|
+
</Container>
|
|
85
|
+
<Title title="AlignX = center" theme="light" level={4} />
|
|
86
|
+
<Container>
|
|
87
|
+
<DxcStack alignX="center">
|
|
88
|
+
<Placeholder height="small" width="small" />
|
|
89
|
+
<Placeholder height="large" width="medium" />
|
|
90
|
+
<Placeholder height="medium" width="small" />
|
|
91
|
+
<Placeholder height="large" width="medium" />
|
|
92
|
+
</DxcStack>
|
|
93
|
+
</Container>
|
|
94
|
+
<Title title="AlignX = baseline" theme="light" level={4} />
|
|
95
|
+
<Container>
|
|
96
|
+
<DxcStack alignX="baseline">
|
|
97
|
+
<Placeholder height="small" width="small" />
|
|
98
|
+
<Placeholder height="large" width="medium" />
|
|
99
|
+
<Placeholder height="medium" width="small" />
|
|
100
|
+
</DxcStack>
|
|
101
|
+
</Container>
|
|
102
|
+
<Title title="AlignX with wrapped items" theme="light" level={4} />
|
|
103
|
+
<Container customHeight>
|
|
104
|
+
<DxcStack alignX="center" wrap>
|
|
105
|
+
<Placeholder height="small" width="medium" />
|
|
106
|
+
<Placeholder height="small" width="small" />
|
|
107
|
+
</DxcStack>
|
|
108
|
+
</Container>
|
|
109
|
+
<Title title="Gutter = 0rem" theme="light" level={4} />
|
|
110
|
+
<Container>
|
|
111
|
+
<DxcStack gutter="0rem">
|
|
112
|
+
<Placeholder height="small" width="medium" />
|
|
113
|
+
<Placeholder height="large" width="small" />
|
|
114
|
+
<Placeholder height="medium" width="medium" />
|
|
115
|
+
<Placeholder height="large" width="small" />
|
|
116
|
+
<Placeholder height="small" width="medium" />
|
|
117
|
+
</DxcStack>
|
|
118
|
+
</Container>
|
|
119
|
+
<Title title="Gutter = 0.125rem" theme="light" level={4} />
|
|
46
120
|
<Container>
|
|
47
|
-
<DxcStack
|
|
48
|
-
<Placeholder
|
|
49
|
-
<Placeholder
|
|
50
|
-
<Placeholder
|
|
121
|
+
<DxcStack gutter="0.125rem">
|
|
122
|
+
<Placeholder height="small" width="small" />
|
|
123
|
+
<Placeholder height="large" width="medium" />
|
|
124
|
+
<Placeholder height="medium" width="small" />
|
|
51
125
|
</DxcStack>
|
|
52
126
|
</Container>
|
|
53
|
-
<Title title="
|
|
127
|
+
<Title title="Gutter = 0.25rem" theme="light" level={4} />
|
|
54
128
|
<Container>
|
|
55
|
-
<DxcStack
|
|
56
|
-
<Placeholder
|
|
57
|
-
<Placeholder
|
|
58
|
-
<Placeholder
|
|
129
|
+
<DxcStack gutter="0.25rem">
|
|
130
|
+
<Placeholder height="small" width="medium" />
|
|
131
|
+
<Placeholder height="large" width="small" />
|
|
132
|
+
<Placeholder height="medium" width="medium" />
|
|
133
|
+
<Placeholder height="large" width="small" />
|
|
134
|
+
<Placeholder height="small" width="medium" />
|
|
59
135
|
</DxcStack>
|
|
60
136
|
</Container>
|
|
61
|
-
<Title title="
|
|
137
|
+
<Title title="Gutter = 0.5rem" theme="light" level={4} />
|
|
62
138
|
<Container>
|
|
63
|
-
<DxcStack gutter="
|
|
64
|
-
<Placeholder
|
|
65
|
-
<Placeholder
|
|
66
|
-
<Placeholder
|
|
139
|
+
<DxcStack gutter="0.5rem">
|
|
140
|
+
<Placeholder height="small" width="small" />
|
|
141
|
+
<Placeholder height="large" width="medium" />
|
|
142
|
+
<Placeholder height="medium" width="small" />
|
|
67
143
|
</DxcStack>
|
|
68
144
|
</Container>
|
|
69
|
-
<Title title="
|
|
145
|
+
<Title title="Gutter = 0.75rem" theme="light" level={4} />
|
|
70
146
|
<Container>
|
|
71
|
-
<DxcStack gutter="
|
|
72
|
-
<Placeholder
|
|
73
|
-
<Placeholder
|
|
74
|
-
<Placeholder
|
|
147
|
+
<DxcStack gutter="0.75rem">
|
|
148
|
+
<Placeholder height="small" width="medium" />
|
|
149
|
+
<Placeholder height="large" width="small" />
|
|
150
|
+
<Placeholder height="medium" width="medium" />
|
|
151
|
+
<Placeholder height="large" width="small" />
|
|
152
|
+
<Placeholder height="small" width="medium" />
|
|
75
153
|
</DxcStack>
|
|
76
154
|
</Container>
|
|
77
|
-
<Title title="
|
|
155
|
+
<Title title="Gutter = 1rem" theme="light" level={4} />
|
|
78
156
|
<Container>
|
|
79
|
-
<DxcStack gutter="
|
|
80
|
-
<Placeholder
|
|
81
|
-
<Placeholder
|
|
82
|
-
<Placeholder
|
|
157
|
+
<DxcStack gutter="1rem">
|
|
158
|
+
<Placeholder height="small" width="small" />
|
|
159
|
+
<Placeholder height="large" width="medium" />
|
|
160
|
+
<Placeholder height="medium" width="small" />
|
|
83
161
|
</DxcStack>
|
|
84
162
|
</Container>
|
|
85
|
-
<Title title="
|
|
163
|
+
<Title title="Gutter = 1.5rem" theme="light" level={4} />
|
|
86
164
|
<Container>
|
|
87
|
-
<DxcStack gutter="
|
|
88
|
-
<Placeholder
|
|
89
|
-
<Placeholder
|
|
90
|
-
<Placeholder
|
|
165
|
+
<DxcStack gutter="1.5rem">
|
|
166
|
+
<Placeholder height="small" width="medium" />
|
|
167
|
+
<Placeholder height="large" width="small" />
|
|
168
|
+
<Placeholder height="medium" width="medium" />
|
|
169
|
+
<Placeholder height="large" width="small" />
|
|
170
|
+
<Placeholder height="small" width="medium" />
|
|
91
171
|
</DxcStack>
|
|
92
172
|
</Container>
|
|
93
|
-
<Title title="
|
|
173
|
+
<Title title="Gutter = 2rem & divider" theme="light" level={4} />
|
|
94
174
|
<Container>
|
|
95
|
-
<DxcStack gutter="
|
|
96
|
-
<Placeholder
|
|
97
|
-
<Placeholder
|
|
98
|
-
<Placeholder
|
|
175
|
+
<DxcStack gutter="2rem" divider>
|
|
176
|
+
<Placeholder height="small" width="small" />
|
|
177
|
+
<Placeholder height="large" width="medium" />
|
|
178
|
+
<Placeholder height="medium" width="small" />
|
|
99
179
|
</DxcStack>
|
|
100
180
|
</Container>
|
|
101
|
-
<Title title="
|
|
181
|
+
<Title title="Gutter = 3rem" theme="light" level={4} />
|
|
102
182
|
<Container>
|
|
103
|
-
<DxcStack gutter="
|
|
104
|
-
<Placeholder
|
|
105
|
-
<Placeholder
|
|
106
|
-
<Placeholder
|
|
183
|
+
<DxcStack gutter="3rem">
|
|
184
|
+
<Placeholder height="small" width="small" />
|
|
185
|
+
<Placeholder height="large" width="medium" />
|
|
186
|
+
<Placeholder height="medium" width="small" />
|
|
107
187
|
</DxcStack>
|
|
108
188
|
</Container>
|
|
109
|
-
<Title title="
|
|
189
|
+
<Title title="Gutter = 4rem" theme="light" level={4} />
|
|
110
190
|
<Container>
|
|
111
|
-
<DxcStack gutter="
|
|
112
|
-
<Placeholder
|
|
113
|
-
<Placeholder
|
|
114
|
-
<Placeholder></Placeholder>
|
|
191
|
+
<DxcStack gutter="4rem">
|
|
192
|
+
<Placeholder height="large" width="medium" />
|
|
193
|
+
<Placeholder height="medium" width="small" />
|
|
115
194
|
</DxcStack>
|
|
116
195
|
</Container>
|
|
117
|
-
<Title title="
|
|
196
|
+
<Title title="Gutter = 5rem" theme="light" level={4} />
|
|
118
197
|
<Container>
|
|
119
|
-
<DxcStack gutter="
|
|
120
|
-
<Placeholder
|
|
121
|
-
<Placeholder
|
|
122
|
-
<Placeholder></Placeholder>
|
|
198
|
+
<DxcStack gutter="5rem">
|
|
199
|
+
<Placeholder height="small" width="small" />
|
|
200
|
+
<Placeholder height="medium" width="small" />
|
|
123
201
|
</DxcStack>
|
|
124
202
|
</Container>
|
|
125
|
-
<Title title="
|
|
203
|
+
<Title title="Reverse" theme="light" level={4} />
|
|
126
204
|
<Container>
|
|
127
|
-
<DxcStack
|
|
128
|
-
<Placeholder
|
|
129
|
-
|
|
130
|
-
|
|
205
|
+
<DxcStack reverse>
|
|
206
|
+
<Placeholder height="small" width="medium">
|
|
207
|
+
1
|
|
208
|
+
</Placeholder>
|
|
209
|
+
<Placeholder height="large" width="small">
|
|
210
|
+
2
|
|
211
|
+
</Placeholder>
|
|
212
|
+
<Placeholder height="medium" width="medium">
|
|
213
|
+
3
|
|
214
|
+
</Placeholder>
|
|
215
|
+
<Placeholder height="large" width="small">
|
|
216
|
+
4
|
|
217
|
+
</Placeholder>
|
|
131
218
|
</DxcStack>
|
|
132
219
|
</Container>
|
|
220
|
+
<Title title="Wrapped and reversed children" theme="light" level={4} />
|
|
221
|
+
<FlexContainer customHeight>
|
|
222
|
+
<DxcStack reverse wrap>
|
|
223
|
+
<Placeholder height="small" width="medium">
|
|
224
|
+
1
|
|
225
|
+
</Placeholder>
|
|
226
|
+
<Placeholder height="large" width="small">
|
|
227
|
+
2
|
|
228
|
+
</Placeholder>
|
|
229
|
+
<Placeholder height="medium" width="medium">
|
|
230
|
+
3
|
|
231
|
+
</Placeholder>
|
|
232
|
+
<Placeholder height="large" width="small">
|
|
233
|
+
4
|
|
234
|
+
</Placeholder>
|
|
235
|
+
</DxcStack>
|
|
236
|
+
</FlexContainer>
|
|
133
237
|
</>
|
|
134
238
|
);
|
|
135
239
|
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
240
|
+
const FlexContainer = styled.div<{ customHeight?: boolean }>`
|
|
241
|
+
display: flex;
|
|
242
|
+
${({ customHeight }) => customHeight && `height: 100px;`};
|
|
243
|
+
background: #f2eafa;
|
|
140
244
|
`;
|
|
141
245
|
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
246
|
+
const Container = styled.div<{ customHeight?: boolean }>`
|
|
247
|
+
background: #f2eafa;
|
|
248
|
+
${({ customHeight }) => customHeight && `height: 100px;`};
|
|
249
|
+
`;
|
|
250
|
+
|
|
251
|
+
type PlaceholderProps = {
|
|
252
|
+
width?: "xlarge" | "large" | "medium" | "small" | "auto";
|
|
253
|
+
height?: "large" | "medium" | "small" | "auto";
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
const Placeholder = styled.div<PlaceholderProps>`
|
|
257
|
+
${({ width }) =>
|
|
258
|
+
width &&
|
|
259
|
+
`width: ${width === "xlarge" ? "350px" : width === "large" ? "150px" : width === "medium" ? "100px" : "50px"};`};
|
|
260
|
+
${({ height }) => height && `height: ${height === "large" ? "100px" : height === "medium" ? "80px" : "50px"};`};
|
|
261
|
+
border: 1px solid #a46ede;
|
|
262
|
+
background-color: #e5d5f6;
|
|
150
263
|
`;
|
package/stack/types.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type Props = {
|
|
3
|
+
/**
|
|
4
|
+
* Alignment applied to children in the main axis.
|
|
5
|
+
*/
|
|
6
|
+
alignX?: "start" | "end" | "center" | "baseline" | "stretch";
|
|
7
|
+
/**
|
|
8
|
+
* Specifies the HTML tag or component that is rendered as the wrapper element.
|
|
9
|
+
*/
|
|
10
|
+
as?: React.ElementType;
|
|
11
|
+
/**
|
|
12
|
+
* If true, a divider is shown between children.
|
|
13
|
+
*/
|
|
14
|
+
divider?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Space applied between each child.
|
|
17
|
+
*/
|
|
18
|
+
gutter?: "0rem" | "0.125rem" | "0.25rem" | "0.5rem" | "0.75rem" | "1rem" | "1.5rem" | "2rem" | "3rem" | "4rem" | "5rem";
|
|
19
|
+
/**
|
|
20
|
+
* Change the direction of the stack to reverse.
|
|
21
|
+
*/
|
|
22
|
+
reverse?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Sets whether the children are forced onto one column or can wrap onto multiple columns.
|
|
25
|
+
*/
|
|
26
|
+
wrap?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Custom content inside the stack.
|
|
29
|
+
*/
|
|
30
|
+
children: React.ReactNode[] | React.ReactNode;
|
|
31
|
+
};
|
|
32
|
+
export default Props;
|
package/stack/types.js
ADDED
package/switch/Switch.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import SwitchPropsType from "./types";
|
|
3
|
-
declare const DxcSwitch: ({ checked, value, label, labelPosition, name, disabled,
|
|
3
|
+
declare const DxcSwitch: ({ defaultChecked, checked, value, label, labelPosition, name, disabled, optional, onChange, margin, size, tabIndex, }: SwitchPropsType) => JSX.Element;
|
|
4
4
|
export default DxcSwitch;
|
package/switch/Switch.js
CHANGED
|
@@ -21,7 +21,7 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
|
21
21
|
|
|
22
22
|
var _core = require("@material-ui/core");
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _uuid = require("uuid");
|
|
25
25
|
|
|
26
26
|
var _variables = require("../common/variables.js");
|
|
27
27
|
|
|
@@ -29,6 +29,8 @@ var _utils = require("../common/utils.js");
|
|
|
29
29
|
|
|
30
30
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
31
31
|
|
|
32
|
+
var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
|
|
33
|
+
|
|
32
34
|
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
33
35
|
|
|
34
36
|
var _templateObject, _templateObject2;
|
|
@@ -38,7 +40,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
38
40
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
39
41
|
|
|
40
42
|
var DxcSwitch = function DxcSwitch(_ref) {
|
|
41
|
-
var
|
|
43
|
+
var defaultChecked = _ref.defaultChecked,
|
|
44
|
+
checked = _ref.checked,
|
|
42
45
|
value = _ref.value,
|
|
43
46
|
_ref$label = _ref.label,
|
|
44
47
|
label = _ref$label === void 0 ? "" : _ref$label,
|
|
@@ -48,21 +51,28 @@ var DxcSwitch = function DxcSwitch(_ref) {
|
|
|
48
51
|
name = _ref$name === void 0 ? "" : _ref$name,
|
|
49
52
|
_ref$disabled = _ref.disabled,
|
|
50
53
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
54
|
+
_ref$optional = _ref.optional,
|
|
55
|
+
optional = _ref$optional === void 0 ? false : _ref$optional,
|
|
51
56
|
onChange = _ref.onChange,
|
|
52
|
-
_ref$required = _ref.required,
|
|
53
|
-
required = _ref$required === void 0 ? false : _ref$required,
|
|
54
57
|
margin = _ref.margin,
|
|
55
58
|
_ref$size = _ref.size,
|
|
56
59
|
size = _ref$size === void 0 ? "fitContent" : _ref$size,
|
|
57
60
|
_ref$tabIndex = _ref.tabIndex,
|
|
58
61
|
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
59
62
|
|
|
60
|
-
var _useState = (0, _react.useState)(
|
|
61
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState,
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
var _useState = (0, _react.useState)("switch-".concat((0, _uuid.v4)())),
|
|
64
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 1),
|
|
65
|
+
switchId = _useState2[0];
|
|
66
|
+
|
|
67
|
+
var labelId = "label-".concat(switchId);
|
|
68
|
+
|
|
69
|
+
var _useState3 = (0, _react.useState)(defaultChecked !== null && defaultChecked !== void 0 ? defaultChecked : false),
|
|
70
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
71
|
+
innerChecked = _useState4[0],
|
|
72
|
+
setInnerChecked = _useState4[1];
|
|
64
73
|
|
|
65
74
|
var colorsTheme = (0, _useTheme["default"])();
|
|
75
|
+
var translatedLabels = (0, _useTranslatedLabels["default"])();
|
|
66
76
|
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
67
77
|
|
|
68
78
|
var handlerSwitchChange = function handlerSwitchChange(event) {
|
|
@@ -75,6 +85,14 @@ var DxcSwitch = function DxcSwitch(_ref) {
|
|
|
75
85
|
} else onChange === null || onChange === void 0 ? void 0 : onChange(!checked);
|
|
76
86
|
};
|
|
77
87
|
|
|
88
|
+
var labelComponent = /*#__PURE__*/_react["default"].createElement(LabelContainer, {
|
|
89
|
+
id: labelId,
|
|
90
|
+
labelPosition: labelPosition,
|
|
91
|
+
onClick: !disabled && handlerSwitchChange,
|
|
92
|
+
disabled: disabled,
|
|
93
|
+
backgroundType: backgroundType
|
|
94
|
+
}, labelPosition === "before" ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, label, " ", optional && /*#__PURE__*/_react["default"].createElement("span", null, translatedLabels.formFields.optionalLabel)) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, optional && /*#__PURE__*/_react["default"].createElement("span", null, translatedLabels.formFields.optionalLabel), " ", label));
|
|
95
|
+
|
|
78
96
|
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
79
97
|
theme: colorsTheme["switch"]
|
|
80
98
|
}, /*#__PURE__*/_react["default"].createElement(SwitchContainer, {
|
|
@@ -83,22 +101,20 @@ var DxcSwitch = function DxcSwitch(_ref) {
|
|
|
83
101
|
labelPosition: labelPosition,
|
|
84
102
|
size: size,
|
|
85
103
|
backgroundType: backgroundType
|
|
86
|
-
}, /*#__PURE__*/_react["default"].createElement(_core.Switch, {
|
|
104
|
+
}, labelPosition === "before" && labelComponent, /*#__PURE__*/_react["default"].createElement(_core.Switch, {
|
|
87
105
|
checked: checked !== null && checked !== void 0 ? checked : innerChecked,
|
|
88
106
|
inputProps: {
|
|
89
107
|
name: name,
|
|
108
|
+
"aria-labelledby": labelId,
|
|
109
|
+
role: "switch",
|
|
110
|
+
"aria-checked": checked !== null && checked !== void 0 ? checked : innerChecked,
|
|
90
111
|
tabIndex: tabIndex
|
|
91
112
|
},
|
|
92
113
|
onChange: handlerSwitchChange,
|
|
93
114
|
value: value,
|
|
94
115
|
disabled: disabled,
|
|
95
116
|
disableRipple: true
|
|
96
|
-
}),
|
|
97
|
-
labelPosition: labelPosition,
|
|
98
|
-
onClick: !disabled && handlerSwitchChange,
|
|
99
|
-
disabled: disabled,
|
|
100
|
-
backgroundType: backgroundType
|
|
101
|
-
}, required && /*#__PURE__*/_react["default"].createElement(_RequiredComponent["default"], null), label)));
|
|
117
|
+
}), labelPosition === "after" && labelComponent));
|
|
102
118
|
};
|
|
103
119
|
|
|
104
120
|
var sizes = {
|
|
@@ -113,10 +129,8 @@ var calculateWidth = function calculateWidth(margin, size) {
|
|
|
113
129
|
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
114
130
|
};
|
|
115
131
|
|
|
116
|
-
var SwitchContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n display: inline-flex;\n align-items: center;\n
|
|
132
|
+
var SwitchContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n display: inline-flex;\n align-items: center;\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n cursor: ", ";\n\n .MuiSwitch-root {\n align-items: center;\n width: ", ";\n height: 45px;\n margin: 3px;\n\n .Mui-focusVisible {\n outline: ", ";\n outline-offset: -3px;\n }\n\n .MuiSwitch-track {\n /*Enabled and unchecked bar*/\n background-color: ", ";\n height: ", ";\n }\n\n .MuiSwitch-switchBase + .MuiSwitch-track {\n opacity: 1;\n }\n\n .MuiIconButton-root {\n /*Enabled and unchecked*/\n top: unset;\n .MuiSwitch-thumb {\n /*Only for thumb in all states*/\n width: ", ";\n height: ", ";\n }\n color: ", ";\n &:hover {\n background-color: transparent;\n }\n &.Mui-disabled {\n /*Disabled and unchecked*/\n color: ", ";\n + .MuiSwitch-track {\n /*Disabled and unchecked bar*/\n background-color: ", ";\n }\n }\n &.Mui-disabled.Mui-checked {\n /*Disabled and checked*/\n color: ", ";\n + .MuiSwitch-track {\n /*Disabled and checked bar*/\n background-color: ", ";\n }\n }\n &.Mui-checked {\n /*Enabled and checked*/\n color: ", ";\n transform: translateX(", ");\n &:hover {\n background-color: transparent;\n }\n + .MuiSwitch-track {\n /*Enabled and checked bar*/\n background-color: ", ";\n }\n }\n }\n }\n"])), function (props) {
|
|
117
133
|
return calculateWidth(props.margin, props.size);
|
|
118
|
-
}, function (props) {
|
|
119
|
-
return props.labelPosition === "after" ? "row" : "row-reverse";
|
|
120
134
|
}, function (props) {
|
|
121
135
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
122
136
|
}, function (props) {
|
|
@@ -159,7 +173,7 @@ var SwitchContainer = _styledComponents["default"].div(_templateObject || (_temp
|
|
|
159
173
|
return props.backgroundType === "dark" ? props.theme.checkedTrackBackgroundColorOnDark : props.theme.checkedTrackBackgroundColor;
|
|
160
174
|
});
|
|
161
175
|
|
|
162
|
-
var LabelContainer = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: ", ";\n opacity: 1;\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n cursor: ", ";\n ", "\n"])), function (props) {
|
|
176
|
+
var LabelContainer = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: ", ";\n opacity: 1;\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n cursor: ", ";\n ", "\n\n ", "\n"])), function (props) {
|
|
163
177
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledLabelFontColorOnDark : props.theme.disabledLabelFontColor : props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
164
178
|
}, function (props) {
|
|
165
179
|
return props.theme.labelFontFamily;
|
|
@@ -173,6 +187,8 @@ var LabelContainer = _styledComponents["default"].span(_templateObject2 || (_tem
|
|
|
173
187
|
return props.disabled === true ? "not-allowed" : "pointer";
|
|
174
188
|
}, function (props) {
|
|
175
189
|
return props.labelPosition === "after" ? "margin-left: ".concat(props.theme.spaceBetweenLabelSwitch, ";") : "margin-right: ".concat(props.theme.spaceBetweenLabelSwitch, ";");
|
|
190
|
+
}, function (props) {
|
|
191
|
+
return props.labelPosition === "before" && "order: -1";
|
|
176
192
|
});
|
|
177
193
|
|
|
178
194
|
var _default = DxcSwitch;
|
|
@@ -23,23 +23,23 @@ export const Chromatic = () => (
|
|
|
23
23
|
</ExampleContainer>
|
|
24
24
|
<ExampleContainer>
|
|
25
25
|
<Title title="Checked" theme="light" level={4} />
|
|
26
|
-
<DxcSwitch label="Switch"
|
|
26
|
+
<DxcSwitch label="Switch" defaultChecked />
|
|
27
27
|
</ExampleContainer>
|
|
28
28
|
<ExampleContainer>
|
|
29
|
-
<Title title="
|
|
30
|
-
<DxcSwitch label="Switch"
|
|
29
|
+
<Title title="Optional" theme="light" level={4} />
|
|
30
|
+
<DxcSwitch label="Switch" optional />
|
|
31
31
|
</ExampleContainer>
|
|
32
32
|
<ExampleContainer>
|
|
33
33
|
<Title title="Disabled" theme="light" level={4} />
|
|
34
34
|
<DxcSwitch label="Switch" disabled />
|
|
35
35
|
</ExampleContainer>
|
|
36
36
|
<ExampleContainer>
|
|
37
|
-
<Title title="Disabled
|
|
38
|
-
<DxcSwitch label="Switch" disabled
|
|
37
|
+
<Title title="Disabled optional" theme="light" level={4} />
|
|
38
|
+
<DxcSwitch label="Switch" disabled optional labelPosition="after" />
|
|
39
39
|
</ExampleContainer>
|
|
40
40
|
<ExampleContainer>
|
|
41
41
|
<Title title="Disabled checked" theme="light" level={4} />
|
|
42
|
-
<DxcSwitch label="Switch" disabled
|
|
42
|
+
<DxcSwitch label="Switch" disabled defaultChecked labelPosition="after" />
|
|
43
43
|
</ExampleContainer>
|
|
44
44
|
<BackgroundColorProvider color="#333333">
|
|
45
45
|
<DarkContainer>
|
|
@@ -49,30 +49,30 @@ export const Chromatic = () => (
|
|
|
49
49
|
</ExampleContainer>
|
|
50
50
|
<ExampleContainer>
|
|
51
51
|
<Title title="Checked" theme="dark" level={4} />
|
|
52
|
-
<DxcSwitch label="Switch"
|
|
52
|
+
<DxcSwitch label="Switch" defaultChecked />
|
|
53
53
|
</ExampleContainer>
|
|
54
54
|
<ExampleContainer>
|
|
55
|
-
<Title title="
|
|
56
|
-
<DxcSwitch label="Switch"
|
|
55
|
+
<Title title="Optional" theme="dark" level={4} />
|
|
56
|
+
<DxcSwitch label="Switch" optional />
|
|
57
57
|
</ExampleContainer>
|
|
58
58
|
<ExampleContainer>
|
|
59
59
|
<Title title="Disabled" theme="dark" level={4} />
|
|
60
60
|
<DxcSwitch label="Switch" disabled />
|
|
61
61
|
</ExampleContainer>
|
|
62
62
|
<ExampleContainer>
|
|
63
|
-
<Title title="Disabled
|
|
64
|
-
<DxcSwitch label="Switch" disabled
|
|
63
|
+
<Title title="Disabled optional" theme="dark" level={4} />
|
|
64
|
+
<DxcSwitch label="Switch" disabled optional labelPosition="after" />
|
|
65
65
|
</ExampleContainer>
|
|
66
66
|
<ExampleContainer>
|
|
67
67
|
<Title title="Disabled checked" theme="dark" level={4} />
|
|
68
|
-
<DxcSwitch label="Switch" disabled
|
|
68
|
+
<DxcSwitch label="Switch" disabled defaultChecked labelPosition="after" />
|
|
69
69
|
</ExampleContainer>
|
|
70
70
|
</DarkContainer>
|
|
71
71
|
</BackgroundColorProvider>
|
|
72
72
|
<Title title="Margins" theme="light" level={2} />
|
|
73
73
|
<ExampleContainer>
|
|
74
74
|
<Title title="Xxsmall margin" theme="light" level={4} />
|
|
75
|
-
<DxcSwitch label="
|
|
75
|
+
<DxcSwitch label="Xxsmall" margin="xxsmall" />
|
|
76
76
|
</ExampleContainer>
|
|
77
77
|
<ExampleContainer>
|
|
78
78
|
<Title title="Xsmall margin" theme="light" level={4} />
|
|
@@ -139,7 +139,7 @@ const Switch = () => (
|
|
|
139
139
|
export const FocusedSwitch = Switch.bind({});
|
|
140
140
|
FocusedSwitch.play = async ({ canvasElement }) => {
|
|
141
141
|
const canvas = within(canvasElement);
|
|
142
|
-
canvas.getByRole("
|
|
142
|
+
canvas.getByRole("switch").focus();
|
|
143
143
|
};
|
|
144
144
|
|
|
145
145
|
const DarkSwitch = () => (
|
|
@@ -156,5 +156,5 @@ const DarkSwitch = () => (
|
|
|
156
156
|
export const FocusedSwitchOnDark = DarkSwitch.bind({});
|
|
157
157
|
FocusedSwitchOnDark.play = async ({ canvasElement }) => {
|
|
158
158
|
const canvas = within(canvasElement);
|
|
159
|
-
canvas.getByRole("
|
|
159
|
+
canvas.getByRole("switch").focus();
|
|
160
160
|
};
|