@dxc-technology/halstack-react 0.0.0-5a1e592 → 0.0.0-5b15506
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.d.ts +1 -10
- package/BackgroundColorContext.js +4 -21
- package/HalstackContext.d.ts +32 -139
- package/HalstackContext.js +10 -35
- package/accordion/Accordion.accessibility.test.js +71 -0
- package/accordion/Accordion.js +33 -84
- package/accordion/Accordion.stories.tsx +5 -51
- package/accordion/Accordion.test.js +18 -33
- package/accordion/types.d.ts +6 -6
- package/accordion-group/AccordionGroup.accessibility.test.js +88 -0
- package/accordion-group/AccordionGroup.d.ts +2 -3
- package/accordion-group/AccordionGroup.js +17 -44
- package/accordion-group/AccordionGroup.stories.tsx +1 -1
- package/accordion-group/AccordionGroup.test.js +42 -60
- package/accordion-group/AccordionGroupAccordion.js +11 -23
- package/accordion-group/AccordionGroupContext.d.ts +3 -0
- package/accordion-group/AccordionGroupContext.js +8 -0
- package/accordion-group/types.d.ts +7 -7
- package/action-icon/ActionIcon.accessibility.test.js +63 -0
- package/action-icon/ActionIcon.d.ts +4 -0
- package/action-icon/ActionIcon.js +48 -0
- package/action-icon/ActionIcon.stories.tsx +41 -0
- package/action-icon/ActionIcon.test.js +64 -0
- package/action-icon/types.d.ts +26 -0
- package/alert/Alert.accessibility.test.js +95 -0
- package/alert/Alert.js +29 -118
- package/alert/Alert.test.js +28 -45
- package/alert/types.d.ts +5 -5
- package/badge/Badge.accessibility.test.js +129 -0
- package/badge/Badge.d.ts +1 -1
- package/badge/Badge.js +142 -42
- package/badge/Badge.stories.tsx +210 -0
- package/badge/Badge.test.js +30 -0
- package/badge/types.d.ts +52 -3
- package/bleed/Bleed.js +13 -21
- package/bleed/types.d.ts +2 -2
- package/box/Box.accessibility.test.js +33 -0
- package/box/Box.js +11 -33
- package/box/Box.test.js +1 -6
- package/box/types.d.ts +3 -3
- package/bulleted-list/BulletedList.accessibility.test.js +107 -0
- package/bulleted-list/BulletedList.js +22 -55
- package/bulleted-list/BulletedList.stories.tsx +2 -93
- package/bulleted-list/types.d.ts +5 -5
- package/button/Button.accessibility.test.js +127 -0
- package/button/Button.js +36 -59
- package/button/Button.stories.tsx +33 -133
- package/button/Button.test.js +13 -21
- package/button/types.d.ts +5 -5
- package/card/Card.accessibility.test.js +36 -0
- package/card/Card.js +21 -44
- package/card/Card.test.js +10 -21
- package/card/types.d.ts +5 -5
- package/checkbox/Checkbox.accessibility.test.js +87 -0
- package/checkbox/Checkbox.js +55 -109
- package/checkbox/Checkbox.stories.tsx +0 -54
- package/checkbox/Checkbox.test.js +79 -108
- package/checkbox/types.d.ts +4 -4
- package/chip/Chip.accessibility.test.js +67 -0
- package/chip/Chip.js +20 -36
- package/chip/Chip.stories.tsx +5 -24
- package/chip/Chip.test.js +17 -30
- package/chip/types.d.ts +4 -4
- package/common/coreTokens.d.ts +105 -14
- package/common/coreTokens.js +40 -23
- package/common/utils.js +2 -8
- package/common/variables.d.ts +32 -136
- package/common/variables.js +43 -154
- package/container/Container.d.ts +4 -0
- package/container/Container.js +194 -0
- package/container/Container.stories.tsx +214 -0
- package/container/types.d.ts +74 -0
- package/container/types.js +5 -0
- package/contextual-menu/ContextualMenu.accessibility.test.js +86 -0
- package/contextual-menu/ContextualMenu.d.ts +7 -0
- package/contextual-menu/ContextualMenu.js +71 -0
- package/contextual-menu/ContextualMenu.stories.tsx +182 -0
- package/contextual-menu/ContextualMenu.test.js +71 -0
- package/contextual-menu/MenuItemAction.d.ts +4 -0
- package/contextual-menu/MenuItemAction.js +46 -0
- package/contextual-menu/types.d.ts +22 -0
- package/contextual-menu/types.js +5 -0
- package/date-input/Calendar.js +13 -57
- package/date-input/DateInput.accessibility.test.js +216 -0
- package/date-input/DateInput.js +45 -94
- package/date-input/DateInput.stories.tsx +1 -30
- package/date-input/DateInput.test.js +667 -708
- package/date-input/DatePicker.js +23 -48
- package/date-input/YearPicker.js +8 -34
- package/date-input/types.d.ts +28 -26
- package/dialog/Dialog.accessibility.test.js +69 -0
- package/dialog/Dialog.js +13 -40
- package/dialog/Dialog.stories.tsx +170 -0
- package/dialog/Dialog.test.js +126 -188
- package/dialog/types.d.ts +18 -13
- package/divider/Divider.accessibility.test.js +33 -0
- package/divider/Divider.d.ts +4 -0
- package/divider/Divider.js +36 -0
- package/divider/Divider.stories.tsx +223 -0
- package/divider/Divider.test.js +38 -0
- package/divider/types.d.ts +21 -0
- package/divider/types.js +5 -0
- package/dropdown/Dropdown.accessibility.test.js +180 -0
- package/dropdown/Dropdown.js +59 -128
- package/dropdown/Dropdown.stories.tsx +5 -16
- package/dropdown/Dropdown.test.js +391 -378
- package/dropdown/DropdownMenu.js +8 -19
- package/dropdown/DropdownMenuItem.js +11 -20
- package/dropdown/types.d.ts +20 -24
- package/file-input/FileInput.accessibility.test.js +160 -0
- package/file-input/FileInput.js +180 -284
- package/file-input/FileInput.stories.tsx +1 -1
- package/file-input/FileInput.test.js +279 -354
- package/file-input/FileItem.js +25 -66
- package/file-input/types.d.ts +9 -9
- package/flex/Flex.js +25 -39
- package/flex/types.d.ts +6 -6
- package/footer/Footer.accessibility.test.js +117 -0
- package/footer/Footer.d.ts +1 -1
- package/footer/Footer.js +43 -68
- package/footer/Footer.stories.tsx +46 -2
- package/footer/Footer.test.js +18 -32
- package/footer/Icons.d.ts +3 -2
- package/footer/Icons.js +66 -7
- package/footer/types.d.ts +17 -17
- package/grid/Grid.js +1 -16
- package/grid/types.d.ts +10 -10
- package/header/Header.accessibility.test.js +84 -0
- package/header/Header.d.ts +1 -1
- package/header/Header.js +36 -103
- package/header/Header.test.js +12 -25
- package/header/Icons.d.ts +2 -2
- package/header/Icons.js +2 -7
- package/header/types.d.ts +7 -8
- package/heading/Heading.accessibility.test.js +33 -0
- package/heading/Heading.js +9 -31
- package/heading/Heading.test.js +70 -87
- package/heading/types.d.ts +7 -7
- package/icon/Icon.accessibility.test.js +30 -0
- package/icon/Icon.d.ts +4 -0
- package/icon/Icon.js +33 -0
- package/icon/Icon.stories.tsx +28 -0
- package/icon/types.d.ts +4 -0
- package/icon/types.js +5 -0
- package/image/Image.accessibility.test.js +56 -0
- package/image/Image.d.ts +2 -2
- package/image/Image.js +17 -32
- package/image/Image.stories.tsx +3 -1
- package/image/types.d.ts +2 -2
- package/inset/Inset.js +13 -21
- package/inset/types.d.ts +2 -2
- package/layout/ApplicationLayout.d.ts +2 -2
- package/layout/ApplicationLayout.js +15 -55
- package/layout/Icons.d.ts +5 -5
- package/layout/Icons.js +1 -7
- package/layout/types.d.ts +3 -3
- package/link/Link.accessibility.test.js +112 -0
- package/link/Link.js +28 -47
- package/link/Link.stories.tsx +2 -2
- package/link/Link.test.js +23 -41
- package/link/types.d.ts +14 -14
- package/main.d.ts +7 -4
- package/main.js +32 -60
- package/nav-tabs/NavTabs.accessibility.test.js +44 -0
- package/nav-tabs/NavTabs.d.ts +1 -2
- package/nav-tabs/NavTabs.js +19 -48
- package/nav-tabs/NavTabs.stories.tsx +30 -25
- package/nav-tabs/NavTabs.test.js +38 -45
- package/nav-tabs/NavTabsContext.d.ts +3 -0
- package/nav-tabs/NavTabsContext.js +8 -0
- package/nav-tabs/Tab.js +33 -62
- package/nav-tabs/types.d.ts +10 -10
- package/number-input/NumberInput.accessibility.test.js +228 -0
- package/number-input/NumberInput.d.ts +0 -7
- package/number-input/NumberInput.js +47 -39
- package/number-input/NumberInput.stories.tsx +42 -26
- package/number-input/NumberInput.test.js +839 -575
- package/number-input/NumberInputContext.d.ts +3 -0
- package/number-input/NumberInputContext.js +8 -0
- package/number-input/types.d.ts +17 -5
- package/package.json +39 -37
- package/paginator/Icons.d.ts +5 -5
- package/paginator/Icons.js +5 -19
- package/paginator/Paginator.accessibility.test.js +79 -0
- package/paginator/Paginator.js +15 -43
- package/paginator/Paginator.test.js +224 -207
- package/paginator/types.d.ts +3 -3
- package/paragraph/Paragraph.accessibility.test.js +28 -0
- package/paragraph/Paragraph.js +3 -19
- package/paragraph/Paragraph.stories.tsx +0 -17
- package/password-input/PasswordInput.accessibility.test.js +153 -0
- package/password-input/PasswordInput.js +27 -50
- package/password-input/PasswordInput.stories.tsx +1 -34
- package/password-input/PasswordInput.test.js +153 -129
- package/password-input/types.d.ts +8 -7
- package/progress-bar/ProgressBar.accessibility.test.js +35 -0
- package/progress-bar/ProgressBar.js +21 -53
- package/progress-bar/{ProgressBar.stories.jsx → ProgressBar.stories.tsx} +1 -1
- package/progress-bar/ProgressBar.test.js +35 -52
- package/progress-bar/types.d.ts +3 -3
- package/quick-nav/QuickNav.accessibility.test.js +57 -0
- package/quick-nav/QuickNav.js +4 -27
- package/quick-nav/QuickNav.stories.tsx +1 -1
- package/quick-nav/types.d.ts +10 -10
- package/radio-group/Radio.js +15 -47
- package/radio-group/RadioGroup.accessibility.test.js +97 -0
- package/radio-group/RadioGroup.js +34 -80
- package/radio-group/RadioGroup.test.js +504 -497
- package/radio-group/types.d.ts +5 -5
- package/resultset-table/Icons.d.ts +7 -0
- package/{resultsetTable → resultset-table}/Icons.js +1 -5
- package/resultset-table/ResultsetTable.accessibility.test.js +274 -0
- package/resultset-table/ResultsetTable.d.ts +7 -0
- package/{resultsetTable → resultset-table}/ResultsetTable.js +44 -69
- package/{resultsetTable → resultset-table}/ResultsetTable.stories.tsx +106 -5
- package/{resultsetTable → resultset-table}/ResultsetTable.test.js +148 -92
- package/{resultsetTable → resultset-table}/types.d.ts +44 -11
- package/resultset-table/types.js +5 -0
- package/select/Listbox.js +18 -42
- package/select/Option.js +26 -35
- package/select/Select.accessibility.test.js +217 -0
- package/select/Select.js +101 -169
- package/select/Select.stories.tsx +33 -97
- package/select/Select.test.js +1894 -1846
- package/select/types.d.ts +15 -16
- package/sidenav/Sidenav.accessibility.test.js +59 -0
- package/sidenav/Sidenav.js +44 -81
- package/sidenav/Sidenav.stories.tsx +4 -9
- package/sidenav/Sidenav.test.js +3 -10
- package/{layout → sidenav}/SidenavContext.d.ts +1 -1
- package/{layout → sidenav}/SidenavContext.js +3 -9
- package/sidenav/types.d.ts +20 -20
- package/slider/Slider.accessibility.test.js +104 -0
- package/slider/Slider.js +68 -125
- package/slider/Slider.test.js +107 -103
- package/slider/types.d.ts +4 -4
- package/spinner/Spinner.accessibility.test.js +96 -0
- package/spinner/Spinner.js +16 -54
- package/spinner/Spinner.test.js +25 -34
- package/spinner/types.d.ts +3 -3
- package/status-light/StatusLight.accessibility.test.js +157 -0
- package/status-light/StatusLight.d.ts +4 -0
- package/status-light/StatusLight.js +51 -0
- package/status-light/StatusLight.stories.tsx +74 -0
- package/status-light/StatusLight.test.js +25 -0
- package/status-light/types.d.ts +17 -0
- package/status-light/types.js +5 -0
- package/switch/Switch.accessibility.test.js +89 -0
- package/switch/Switch.js +49 -97
- package/switch/Switch.stories.tsx +0 -34
- package/switch/Switch.test.js +51 -96
- package/switch/types.d.ts +4 -4
- package/table/DropdownTheme.js +62 -0
- package/table/Table.accessibility.test.js +82 -0
- package/table/Table.d.ts +6 -2
- package/table/Table.js +76 -33
- package/table/{Table.stories.jsx → Table.stories.tsx} +297 -2
- package/table/Table.test.js +93 -6
- package/table/types.d.ts +34 -6
- package/tabs/Tab.js +22 -37
- package/tabs/Tabs.accessibility.test.js +56 -0
- package/tabs/Tabs.js +59 -147
- package/tabs/Tabs.stories.tsx +2 -4
- package/tabs/Tabs.test.js +57 -131
- package/tabs/types.d.ts +21 -21
- package/tag/Tag.accessibility.test.js +69 -0
- package/tag/Tag.js +27 -57
- package/tag/Tag.stories.tsx +4 -7
- package/tag/Tag.test.js +17 -36
- package/tag/types.d.ts +9 -9
- package/text-input/Suggestion.js +9 -26
- package/text-input/Suggestions.d.ts +1 -1
- package/text-input/Suggestions.js +19 -67
- package/text-input/TextInput.accessibility.test.js +321 -0
- package/text-input/TextInput.js +193 -285
- package/text-input/TextInput.stories.tsx +10 -153
- package/text-input/TextInput.test.js +1213 -1269
- package/text-input/types.d.ts +21 -17
- package/textarea/Textarea.accessibility.test.js +155 -0
- package/textarea/Textarea.js +49 -93
- package/textarea/{Textarea.stories.jsx → Textarea.stories.tsx} +58 -108
- package/textarea/Textarea.test.js +135 -208
- package/textarea/types.d.ts +5 -5
- package/toggle-group/ToggleGroup.accessibility.test.js +107 -0
- package/toggle-group/ToggleGroup.js +25 -64
- package/toggle-group/ToggleGroup.stories.tsx +4 -4
- package/toggle-group/ToggleGroup.test.js +48 -81
- package/toggle-group/types.d.ts +12 -12
- package/typography/Typography.accessibility.test.js +339 -0
- package/typography/Typography.js +4 -13
- package/typography/types.d.ts +1 -1
- package/useTheme.d.ts +29 -133
- package/useTheme.js +1 -8
- package/useTranslatedLabels.js +1 -7
- package/utils/BaseTypography.d.ts +2 -2
- package/utils/BaseTypography.js +16 -30
- package/utils/FocusLock.js +25 -39
- package/wizard/Wizard.accessibility.test.js +55 -0
- package/wizard/Wizard.js +27 -65
- package/wizard/Wizard.stories.tsx +19 -0
- package/wizard/Wizard.test.js +53 -80
- package/wizard/types.d.ts +8 -8
- package/common/OpenSans.css +0 -69
- package/common/fonts/OpenSans-Bold.ttf +0 -0
- package/common/fonts/OpenSans-BoldItalic.ttf +0 -0
- package/common/fonts/OpenSans-ExtraBold.ttf +0 -0
- package/common/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
- package/common/fonts/OpenSans-Italic.ttf +0 -0
- package/common/fonts/OpenSans-Light.ttf +0 -0
- package/common/fonts/OpenSans-LightItalic.ttf +0 -0
- package/common/fonts/OpenSans-Regular.ttf +0 -0
- package/common/fonts/OpenSans-SemiBold.ttf +0 -0
- package/common/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
- package/date-input/Icons.d.ts +0 -6
- package/date-input/Icons.js +0 -75
- package/password-input/Icons.d.ts +0 -6
- package/password-input/Icons.js +0 -39
- package/resultsetTable/Icons.d.ts +0 -7
- package/resultsetTable/ResultsetTable.d.ts +0 -4
- package/select/Icons.d.ts +0 -10
- package/select/Icons.js +0 -93
- package/sidenav/Icons.d.ts +0 -7
- package/sidenav/Icons.js +0 -51
- package/slider/Slider.stories.tsx +0 -240
- package/text-input/Icons.d.ts +0 -8
- package/text-input/Icons.js +0 -60
- /package/{resultsetTable → action-icon}/types.js +0 -0
- /package/spinner/{Spinner.stories.jsx → Spinner.stories.tsx} +0 -0
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { userEvent, within } from "@storybook/testing-library";
|
|
3
|
-
import { BackgroundColorProvider } from "../BackgroundColorContext";
|
|
4
3
|
import Title from "../../.storybook/components/Title";
|
|
5
4
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
6
|
-
import DarkContainer from "../../.storybook/components/DarkSection";
|
|
7
5
|
import DxcTextInput from "./TextInput";
|
|
8
|
-
import DxcButton from "../button/Button";
|
|
9
|
-
import DxcCheckbox from "../checkbox/Checkbox";
|
|
10
|
-
import DxcFlex from "../flex/Flex";
|
|
11
6
|
import Suggestions from "./Suggestions";
|
|
12
7
|
import { ThemeProvider } from "styled-components";
|
|
13
8
|
import useTheme from "../useTheme";
|
|
14
9
|
import { HalstackProvider } from "../HalstackContext";
|
|
15
10
|
|
|
16
11
|
export default {
|
|
17
|
-
title: "Text
|
|
12
|
+
title: "Text Input",
|
|
18
13
|
component: DxcTextInput,
|
|
19
14
|
};
|
|
20
15
|
|
|
@@ -40,7 +35,7 @@ const actionLargeIconSVG = {
|
|
|
40
35
|
|
|
41
36
|
const actionLargeIconURL = {
|
|
42
37
|
onClick: () => {},
|
|
43
|
-
icon: "
|
|
38
|
+
icon: "search",
|
|
44
39
|
};
|
|
45
40
|
|
|
46
41
|
const country = ["Afghanistan"];
|
|
@@ -48,9 +43,9 @@ const countries = [
|
|
|
48
43
|
"Afghanistan",
|
|
49
44
|
"Albania",
|
|
50
45
|
"Algeria",
|
|
51
|
-
"Andorra
|
|
46
|
+
"Andorra",
|
|
52
47
|
"Angola",
|
|
53
|
-
"Antigua and Barbuda
|
|
48
|
+
"Antigua and Barbuda",
|
|
54
49
|
"Bahamas",
|
|
55
50
|
"Bahrain",
|
|
56
51
|
"Bangladesh",
|
|
@@ -67,7 +62,6 @@ const countries = [
|
|
|
67
62
|
"Dominica",
|
|
68
63
|
"Denmark",
|
|
69
64
|
"Djibouti",
|
|
70
|
-
"*",
|
|
71
65
|
];
|
|
72
66
|
|
|
73
67
|
const opinionatedTheme = {
|
|
@@ -225,94 +219,6 @@ export const Chromatic = () => (
|
|
|
225
219
|
action={action}
|
|
226
220
|
/>
|
|
227
221
|
</ExampleContainer>
|
|
228
|
-
<BackgroundColorProvider color="#333333">
|
|
229
|
-
<DarkContainer>
|
|
230
|
-
<Title title="Dark theme" theme="dark" level={2} />
|
|
231
|
-
<ExampleContainer pseudoState="pseudo-hover">
|
|
232
|
-
<Title title="Hovered" theme="dark" level={4} />
|
|
233
|
-
<DxcTextInput label="Text input" />
|
|
234
|
-
</ExampleContainer>
|
|
235
|
-
<ExampleContainer pseudoState="pseudo-focus-within">
|
|
236
|
-
<Title title="Focused" theme="dark" level={4} />
|
|
237
|
-
<DxcTextInput label="Text input" />
|
|
238
|
-
</ExampleContainer>
|
|
239
|
-
<ExampleContainer pseudoState="pseudo-hover">
|
|
240
|
-
<Title title="Hovered action" theme="dark" level={4} />
|
|
241
|
-
<DxcTextInput label="Text input" defaultValue="Text" clearable />
|
|
242
|
-
</ExampleContainer>
|
|
243
|
-
<ExampleContainer pseudoState="pseudo-active">
|
|
244
|
-
<Title title="Actived action" theme="dark" level={4} />
|
|
245
|
-
<DxcTextInput label="Text input" action={action} clearable />
|
|
246
|
-
</ExampleContainer>
|
|
247
|
-
<ExampleContainer pseudoState="pseudo-focus">
|
|
248
|
-
<Title title="Focused action" theme="dark" level={4} />
|
|
249
|
-
<DxcTextInput label="Text input" action={action} clearable />
|
|
250
|
-
</ExampleContainer>
|
|
251
|
-
<ExampleContainer>
|
|
252
|
-
<Title title="Helper text, placeholder, optional and action" theme="dark" level={4} />
|
|
253
|
-
<DxcTextInput
|
|
254
|
-
label="Text input"
|
|
255
|
-
helperText="Help message"
|
|
256
|
-
placeholder="Placeholder"
|
|
257
|
-
clearable
|
|
258
|
-
optional
|
|
259
|
-
action={action}
|
|
260
|
-
/>
|
|
261
|
-
</ExampleContainer>
|
|
262
|
-
<ExampleContainer>
|
|
263
|
-
<Title title="Invalid" theme="dark" level={4} />
|
|
264
|
-
<DxcTextInput
|
|
265
|
-
label="Error text input"
|
|
266
|
-
helperText="Help message"
|
|
267
|
-
error="Error message."
|
|
268
|
-
defaultValue="Text"
|
|
269
|
-
clearable
|
|
270
|
-
action={action}
|
|
271
|
-
/>
|
|
272
|
-
</ExampleContainer>
|
|
273
|
-
<ExampleContainer pseudoState="pseudo-hover">
|
|
274
|
-
<Title title="Invalid and hovered" theme="dark" level={4} />
|
|
275
|
-
<DxcTextInput
|
|
276
|
-
label="Error text input"
|
|
277
|
-
helperText="Help message"
|
|
278
|
-
placeholder="Placeholder"
|
|
279
|
-
error="Error message."
|
|
280
|
-
/>
|
|
281
|
-
</ExampleContainer>
|
|
282
|
-
<ExampleContainer>
|
|
283
|
-
<Title title="Prefix and suffix" theme="dark" level={4} />
|
|
284
|
-
<DxcTextInput label="With prefix and suffix" prefix="+34" suffix="USD" />
|
|
285
|
-
</ExampleContainer>
|
|
286
|
-
<ExampleContainer>
|
|
287
|
-
<Title title="Disabled and placeholder" theme="dark" level={4} />
|
|
288
|
-
<DxcTextInput label="Disabled text input" disabled placeholder="Placeholder" />
|
|
289
|
-
</ExampleContainer>
|
|
290
|
-
<ExampleContainer>
|
|
291
|
-
<Title title="Disabled, helper text, optional, value and action" theme="dark" level={4} />
|
|
292
|
-
<DxcTextInput
|
|
293
|
-
label="Disabled text input"
|
|
294
|
-
helperText="Help message"
|
|
295
|
-
disabled
|
|
296
|
-
optional
|
|
297
|
-
defaultValue="Text"
|
|
298
|
-
action={action}
|
|
299
|
-
/>
|
|
300
|
-
</ExampleContainer>
|
|
301
|
-
<ExampleContainer>
|
|
302
|
-
<Title title="Disabled with prefix and suffix" theme="dark" level={4} />
|
|
303
|
-
<DxcTextInput
|
|
304
|
-
label="Disabled text input"
|
|
305
|
-
helperText="Help message"
|
|
306
|
-
disabled
|
|
307
|
-
optional
|
|
308
|
-
prefix="+34"
|
|
309
|
-
suffix="USD"
|
|
310
|
-
defaultValue="Text"
|
|
311
|
-
action={action}
|
|
312
|
-
/>
|
|
313
|
-
</ExampleContainer>
|
|
314
|
-
</DarkContainer>
|
|
315
|
-
</BackgroundColorProvider>
|
|
316
222
|
<Title title="Margins" theme="light" level={2} />
|
|
317
223
|
<ExampleContainer>
|
|
318
224
|
<Title title="Xxsmall margin" theme="light" level={4} />
|
|
@@ -473,7 +379,7 @@ const AutosuggestListbox = () => {
|
|
|
473
379
|
searchHasErrors={false}
|
|
474
380
|
isSearching={false}
|
|
475
381
|
suggestionOnClick={() => {}}
|
|
476
|
-
|
|
382
|
+
styles={{ width: 350 }}
|
|
477
383
|
/>
|
|
478
384
|
</ExampleContainer>
|
|
479
385
|
<ExampleContainer pseudoState="pseudo-active">
|
|
@@ -487,7 +393,7 @@ const AutosuggestListbox = () => {
|
|
|
487
393
|
searchHasErrors={false}
|
|
488
394
|
isSearching={false}
|
|
489
395
|
suggestionOnClick={(suggestion) => {}}
|
|
490
|
-
|
|
396
|
+
styles={{ width: 350 }}
|
|
491
397
|
/>
|
|
492
398
|
</ExampleContainer>
|
|
493
399
|
<ExampleContainer>
|
|
@@ -501,7 +407,7 @@ const AutosuggestListbox = () => {
|
|
|
501
407
|
searchHasErrors={false}
|
|
502
408
|
isSearching={false}
|
|
503
409
|
suggestionOnClick={(suggestion) => {}}
|
|
504
|
-
|
|
410
|
+
styles={{ width: 350 }}
|
|
505
411
|
/>
|
|
506
412
|
</ExampleContainer>
|
|
507
413
|
<ExampleContainer>
|
|
@@ -515,7 +421,7 @@ const AutosuggestListbox = () => {
|
|
|
515
421
|
searchHasErrors={false}
|
|
516
422
|
isSearching={false}
|
|
517
423
|
suggestionOnClick={(suggestion) => {}}
|
|
518
|
-
|
|
424
|
+
styles={{ width: 350 }}
|
|
519
425
|
/>
|
|
520
426
|
</ExampleContainer>
|
|
521
427
|
</ExampleContainer>
|
|
@@ -530,7 +436,7 @@ const AutosuggestListbox = () => {
|
|
|
530
436
|
searchHasErrors={true}
|
|
531
437
|
isSearching={false}
|
|
532
438
|
suggestionOnClick={(suggestion) => {}}
|
|
533
|
-
|
|
439
|
+
styles={{ width: 350 }}
|
|
534
440
|
/>
|
|
535
441
|
</ExampleContainer>
|
|
536
442
|
<ExampleContainer>
|
|
@@ -544,65 +450,16 @@ const AutosuggestListbox = () => {
|
|
|
544
450
|
searchHasErrors={false}
|
|
545
451
|
isSearching={true}
|
|
546
452
|
suggestionOnClick={(suggestion) => {}}
|
|
547
|
-
|
|
453
|
+
styles={{ width: 350 }}
|
|
548
454
|
/>
|
|
549
455
|
</ExampleContainer>
|
|
550
456
|
</ThemeProvider>
|
|
551
457
|
);
|
|
552
458
|
};
|
|
553
459
|
|
|
554
|
-
const DarkAutosuggestListbox = () => {
|
|
555
|
-
const colorsTheme: any = useTheme();
|
|
556
|
-
|
|
557
|
-
return (
|
|
558
|
-
<ThemeProvider theme={colorsTheme.textInput}>
|
|
559
|
-
<BackgroundColorProvider color="#333333">
|
|
560
|
-
<DarkContainer>
|
|
561
|
-
<Title title="Dark theme" theme="dark" level={2} />
|
|
562
|
-
<ExampleContainer>
|
|
563
|
-
<Title title="Default with opened suggestions" theme="dark" level={3} />
|
|
564
|
-
<DxcFlex direction="column" gap="5rem">
|
|
565
|
-
<DxcTextInput label="Label" suggestions={countries} optional placeholder="Choose an option" />
|
|
566
|
-
<DxcCheckbox
|
|
567
|
-
label="You understand the selection and give your consent"
|
|
568
|
-
onChange={() => {}}
|
|
569
|
-
labelPosition="after"
|
|
570
|
-
/>
|
|
571
|
-
<DxcButton label="Submit" onClick={() => {}} size="medium" margin={{ bottom: "xxlarge" }} />
|
|
572
|
-
</DxcFlex>
|
|
573
|
-
</ExampleContainer>
|
|
574
|
-
<ExampleContainer>
|
|
575
|
-
<Title title="Autosuggest Error" theme="dark" level={3} />
|
|
576
|
-
<div style={{ height: "100px" }}>
|
|
577
|
-
<Suggestions
|
|
578
|
-
id="x"
|
|
579
|
-
value=""
|
|
580
|
-
suggestions={country}
|
|
581
|
-
visualFocusIndex={-1}
|
|
582
|
-
highlightedSuggestions={false}
|
|
583
|
-
searchHasErrors={true}
|
|
584
|
-
isSearching={false}
|
|
585
|
-
suggestionOnClick={(suggestion) => {}}
|
|
586
|
-
getTextInputWidth={() => 350}
|
|
587
|
-
/>
|
|
588
|
-
</div>
|
|
589
|
-
</ExampleContainer>
|
|
590
|
-
</DarkContainer>
|
|
591
|
-
</BackgroundColorProvider>
|
|
592
|
-
</ThemeProvider>
|
|
593
|
-
);
|
|
594
|
-
};
|
|
595
|
-
|
|
596
460
|
export const AutosuggestListboxStates = AutosuggestListbox.bind({});
|
|
597
461
|
AutosuggestListboxStates.play = async ({ canvasElement }) => {
|
|
598
462
|
const canvas = within(canvasElement);
|
|
599
463
|
const select = canvas.getByRole("combobox");
|
|
600
464
|
await userEvent.click(select);
|
|
601
465
|
};
|
|
602
|
-
|
|
603
|
-
export const AutosuggestListboxOnDark = DarkAutosuggestListbox.bind({});
|
|
604
|
-
AutosuggestListboxOnDark.play = async ({ canvasElement }) => {
|
|
605
|
-
const canvas = within(canvasElement);
|
|
606
|
-
const select = canvas.getByRole("combobox");
|
|
607
|
-
await userEvent.click(select);
|
|
608
|
-
};
|