@dxc-technology/halstack-react 0.0.0-5a1e592 → 0.0.0-5a7a613
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 +74 -144
- package/HalstackContext.js +35 -50
- package/accordion/Accordion.accessibility.test.d.ts +1 -0
- package/accordion/Accordion.accessibility.test.js +71 -0
- package/accordion/Accordion.js +33 -87
- package/accordion/Accordion.stories.tsx +8 -64
- package/accordion/Accordion.test.d.ts +1 -0
- package/accordion/Accordion.test.js +19 -34
- package/accordion/types.d.ts +6 -6
- package/accordion-group/AccordionGroup.accessibility.test.d.ts +1 -0
- package/accordion-group/AccordionGroup.accessibility.test.js +82 -0
- package/accordion-group/AccordionGroup.d.ts +2 -3
- package/accordion-group/AccordionGroup.js +17 -44
- package/accordion-group/AccordionGroup.stories.tsx +24 -24
- package/accordion-group/AccordionGroup.test.d.ts +1 -0
- package/accordion-group/AccordionGroup.test.js +41 -63
- 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.d.ts +1 -0
- 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.d.ts +1 -0
- package/action-icon/ActionIcon.test.js +64 -0
- package/action-icon/types.d.ts +26 -0
- package/alert/Alert.accessibility.test.d.ts +1 -0
- package/alert/Alert.accessibility.test.js +95 -0
- package/alert/Alert.js +34 -120
- package/alert/Alert.test.d.ts +1 -0
- package/alert/Alert.test.js +29 -46
- package/alert/types.d.ts +5 -5
- package/badge/Badge.accessibility.test.d.ts +1 -0
- 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.d.ts +1 -0
- package/badge/Badge.test.js +30 -0
- package/badge/types.d.ts +52 -3
- package/bar-chart/BarChart.d.ts +4 -0
- package/bar-chart/BarChart.js +157 -0
- package/bar-chart/BarChart.stories.tsx +281 -0
- package/bar-chart/BarChart.test.d.ts +1 -0
- package/bar-chart/BarChart.test.js +194 -0
- package/bar-chart/theme.d.ts +3 -0
- package/bar-chart/theme.js +31 -0
- package/bar-chart/types.d.ts +137 -0
- package/bar-chart/types.js +5 -0
- package/bleed/Bleed.js +13 -21
- package/bleed/Bleed.stories.tsx +0 -1
- package/bleed/types.d.ts +2 -2
- package/box/Box.accessibility.test.d.ts +1 -0
- package/box/Box.accessibility.test.js +33 -0
- package/box/Box.js +11 -33
- package/box/Box.test.d.ts +1 -0
- package/box/Box.test.js +2 -7
- package/box/types.d.ts +3 -3
- package/breadcrumbs/Breadcrumbs.accessibility.test.d.ts +1 -0
- package/breadcrumbs/Breadcrumbs.accessibility.test.js +96 -0
- package/breadcrumbs/Breadcrumbs.d.ts +4 -0
- package/breadcrumbs/Breadcrumbs.js +79 -0
- package/breadcrumbs/Breadcrumbs.stories.tsx +194 -0
- package/breadcrumbs/Breadcrumbs.test.d.ts +1 -0
- package/breadcrumbs/Breadcrumbs.test.js +168 -0
- package/breadcrumbs/Item.d.ts +4 -0
- package/breadcrumbs/Item.js +52 -0
- package/breadcrumbs/dropdownTheme.d.ts +53 -0
- package/breadcrumbs/dropdownTheme.js +62 -0
- package/breadcrumbs/types.d.ts +40 -0
- package/breadcrumbs/types.js +5 -0
- package/bulleted-list/BulletedList.accessibility.test.d.ts +1 -0
- package/bulleted-list/BulletedList.accessibility.test.js +119 -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.d.ts +1 -0
- package/button/Button.accessibility.test.js +127 -0
- package/button/Button.js +36 -59
- package/button/Button.stories.tsx +35 -135
- package/button/Button.test.d.ts +1 -0
- package/button/Button.test.js +14 -22
- package/button/types.d.ts +5 -5
- package/card/Card.accessibility.test.d.ts +1 -0
- package/card/Card.accessibility.test.js +36 -0
- package/card/Card.js +23 -45
- package/card/Card.stories.tsx +1 -1
- package/card/Card.test.d.ts +1 -0
- package/card/Card.test.js +11 -22
- package/card/types.d.ts +5 -5
- package/checkbox/Checkbox.accessibility.test.d.ts +1 -0
- package/checkbox/Checkbox.accessibility.test.js +87 -0
- package/checkbox/Checkbox.js +59 -116
- package/checkbox/Checkbox.stories.tsx +0 -54
- package/checkbox/Checkbox.test.d.ts +1 -0
- package/checkbox/Checkbox.test.js +80 -109
- package/checkbox/types.d.ts +4 -4
- package/chip/Chip.accessibility.test.d.ts +1 -0
- package/chip/Chip.accessibility.test.js +67 -0
- package/chip/Chip.js +22 -36
- package/chip/Chip.stories.tsx +6 -25
- package/chip/Chip.test.d.ts +1 -0
- package/chip/Chip.test.js +18 -31
- package/chip/types.d.ts +4 -4
- package/common/coreTokens.d.ts +105 -15
- package/common/coreTokens.js +40 -24
- package/common/utils.js +2 -8
- package/common/variables.d.ts +80 -141
- package/common/variables.js +150 -224
- package/container/Container.d.ts +4 -0
- package/container/Container.js +194 -0
- package/container/Container.stories.tsx +215 -0
- package/container/types.d.ts +176 -0
- package/container/types.js +5 -0
- package/contextual-menu/ContextualMenu.accessibility.test.d.ts +1 -0
- package/contextual-menu/ContextualMenu.accessibility.test.js +98 -0
- package/contextual-menu/ContextualMenu.d.ts +5 -0
- package/contextual-menu/ContextualMenu.js +136 -0
- package/contextual-menu/ContextualMenu.stories.tsx +231 -0
- package/contextual-menu/ContextualMenu.test.d.ts +1 -0
- package/contextual-menu/ContextualMenu.test.js +247 -0
- package/contextual-menu/GroupItem.d.ts +4 -0
- package/contextual-menu/GroupItem.js +67 -0
- package/contextual-menu/ItemAction.d.ts +4 -0
- package/contextual-menu/ItemAction.js +88 -0
- package/contextual-menu/MenuItem.d.ts +4 -0
- package/contextual-menu/MenuItem.js +29 -0
- package/contextual-menu/SingleItem.d.ts +4 -0
- package/contextual-menu/SingleItem.js +38 -0
- package/contextual-menu/types.d.ts +65 -0
- package/contextual-menu/types.js +5 -0
- package/date-input/Calendar.js +59 -87
- package/date-input/DateInput.accessibility.test.d.ts +1 -0
- package/date-input/DateInput.accessibility.test.js +229 -0
- package/date-input/DateInput.js +170 -130
- package/date-input/DateInput.stories.tsx +32 -50
- package/date-input/DateInput.test.d.ts +1 -0
- package/date-input/DateInput.test.js +668 -709
- package/date-input/DatePicker.js +26 -51
- package/date-input/YearPicker.js +17 -38
- package/date-input/types.d.ts +28 -26
- package/dialog/Dialog.accessibility.test.d.ts +1 -0
- package/dialog/Dialog.accessibility.test.js +69 -0
- package/dialog/Dialog.js +21 -59
- package/dialog/Dialog.stories.tsx +174 -0
- package/dialog/Dialog.test.d.ts +1 -0
- package/dialog/Dialog.test.js +216 -215
- package/dialog/types.d.ts +18 -13
- package/divider/Divider.accessibility.test.d.ts +1 -0
- 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 +224 -0
- package/divider/Divider.test.d.ts +1 -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.d.ts +1 -0
- package/dropdown/Dropdown.accessibility.test.js +183 -0
- package/dropdown/Dropdown.js +66 -153
- package/dropdown/Dropdown.stories.tsx +16 -27
- package/dropdown/Dropdown.test.d.ts +1 -0
- package/dropdown/Dropdown.test.js +434 -392
- package/dropdown/DropdownMenu.js +12 -23
- package/dropdown/DropdownMenuItem.js +13 -21
- package/dropdown/types.d.ts +20 -24
- package/file-input/FileInput.accessibility.test.d.ts +1 -0
- package/file-input/FileInput.accessibility.test.js +167 -0
- package/file-input/FileInput.js +177 -286
- package/file-input/FileInput.stories.tsx +1 -1
- package/file-input/FileInput.test.d.ts +1 -0
- package/file-input/FileInput.test.js +303 -356
- package/file-input/FileItem.js +29 -66
- package/file-input/types.d.ts +9 -13
- package/flex/Flex.js +25 -39
- package/flex/types.d.ts +6 -6
- package/footer/Footer.accessibility.test.d.ts +1 -0
- package/footer/Footer.accessibility.test.js +125 -0
- package/footer/Footer.d.ts +1 -1
- package/footer/Footer.js +43 -68
- package/footer/Footer.stories.tsx +58 -2
- package/footer/Footer.test.d.ts +1 -0
- package/footer/Footer.test.js +19 -33
- package/footer/Icons.d.ts +3 -2
- package/footer/Icons.js +53 -22
- package/footer/types.d.ts +17 -17
- package/grid/Grid.js +1 -16
- package/grid/Grid.stories.tsx +3 -1
- package/grid/types.d.ts +10 -10
- package/header/Header.accessibility.test.d.ts +1 -0
- package/header/Header.accessibility.test.js +94 -0
- package/header/Header.d.ts +1 -1
- package/header/Header.js +38 -104
- package/header/Header.stories.tsx +17 -1
- package/header/Header.test.d.ts +1 -0
- package/header/Header.test.js +13 -26
- package/header/Icons.d.ts +2 -2
- package/header/Icons.js +3 -13
- package/header/types.d.ts +7 -8
- package/heading/Heading.accessibility.test.d.ts +1 -0
- package/heading/Heading.accessibility.test.js +33 -0
- package/heading/Heading.js +9 -31
- package/heading/Heading.test.d.ts +1 -0
- package/heading/Heading.test.js +65 -95
- package/heading/types.d.ts +7 -7
- package/icon/Icon.accessibility.test.d.ts +1 -0
- 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.d.ts +1 -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 +23 -60
- package/layout/Icons.d.ts +4 -5
- package/layout/Icons.js +2 -16
- package/layout/types.d.ts +3 -3
- package/link/Link.accessibility.test.d.ts +1 -0
- package/link/Link.accessibility.test.js +108 -0
- package/link/Link.js +28 -47
- package/link/Link.stories.tsx +4 -4
- package/link/Link.test.d.ts +1 -0
- package/link/Link.test.js +24 -42
- package/link/types.d.ts +14 -14
- package/main.d.ts +10 -4
- package/main.js +53 -60
- package/nav-tabs/NavTabs.accessibility.test.d.ts +1 -0
- package/nav-tabs/NavTabs.accessibility.test.js +44 -0
- package/nav-tabs/NavTabs.d.ts +1 -2
- package/nav-tabs/NavTabs.js +34 -48
- package/nav-tabs/NavTabs.stories.tsx +45 -25
- package/nav-tabs/NavTabs.test.d.ts +1 -0
- package/nav-tabs/NavTabs.test.js +46 -51
- package/nav-tabs/NavTabsContext.d.ts +3 -0
- package/nav-tabs/NavTabsContext.js +8 -0
- package/nav-tabs/Tab.js +38 -67
- package/nav-tabs/types.d.ts +10 -10
- package/number-input/NumberInput.accessibility.test.d.ts +1 -0
- package/number-input/NumberInput.accessibility.test.js +227 -0
- package/number-input/NumberInput.d.ts +0 -7
- package/number-input/NumberInput.js +51 -40
- package/number-input/NumberInput.stories.tsx +37 -26
- package/number-input/NumberInput.test.d.ts +1 -0
- package/number-input/NumberInput.test.js +839 -576
- 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 +49 -41
- package/paginator/Paginator.accessibility.test.d.ts +1 -0
- package/paginator/Paginator.accessibility.test.js +78 -0
- package/paginator/Paginator.js +27 -52
- package/paginator/Paginator.test.d.ts +1 -0
- package/paginator/Paginator.test.js +226 -210
- package/paginator/types.d.ts +3 -3
- package/paragraph/Paragraph.accessibility.test.d.ts +1 -0
- 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.d.ts +1 -0
- package/password-input/PasswordInput.accessibility.test.js +152 -0
- package/password-input/PasswordInput.js +36 -55
- package/password-input/PasswordInput.stories.tsx +11 -35
- package/password-input/PasswordInput.test.d.ts +1 -0
- package/password-input/PasswordInput.test.js +153 -130
- package/password-input/types.d.ts +8 -7
- package/progress-bar/ProgressBar.accessibility.test.d.ts +1 -0
- package/progress-bar/ProgressBar.accessibility.test.js +35 -0
- package/progress-bar/ProgressBar.js +26 -56
- package/progress-bar/{ProgressBar.stories.jsx → ProgressBar.stories.tsx} +1 -1
- package/progress-bar/ProgressBar.test.d.ts +1 -0
- package/progress-bar/ProgressBar.test.js +36 -53
- package/progress-bar/types.d.ts +3 -3
- package/quick-nav/QuickNav.accessibility.test.d.ts +1 -0
- 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 -50
- package/radio-group/RadioGroup.accessibility.test.d.ts +1 -0
- package/radio-group/RadioGroup.accessibility.test.js +97 -0
- package/radio-group/RadioGroup.js +37 -85
- package/radio-group/RadioGroup.test.d.ts +1 -0
- package/radio-group/RadioGroup.test.js +505 -500
- 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.d.ts +1 -0
- package/resultset-table/ResultsetTable.accessibility.test.js +284 -0
- package/resultset-table/ResultsetTable.d.ts +7 -0
- package/{resultsetTable → resultset-table}/ResultsetTable.js +79 -76
- package/{resultsetTable → resultset-table}/ResultsetTable.stories.tsx +119 -6
- package/resultset-table/ResultsetTable.test.d.ts +1 -0
- package/resultset-table/ResultsetTable.test.js +450 -0
- package/{resultsetTable → resultset-table}/types.d.ts +47 -13
- package/resultset-table/types.js +5 -0
- package/select/Listbox.d.ts +3 -3
- package/select/Listbox.js +44 -66
- package/select/Option.d.ts +3 -3
- package/select/Option.js +36 -40
- package/select/Select.accessibility.test.d.ts +1 -0
- package/select/Select.accessibility.test.js +227 -0
- package/select/Select.js +127 -310
- package/select/Select.stories.tsx +74 -117
- package/select/Select.test.d.ts +1 -0
- package/select/Select.test.js +1913 -1973
- package/select/selectUtils.d.ts +41 -0
- package/select/selectUtils.js +129 -0
- package/select/types.d.ts +15 -16
- package/sidenav/Sidenav.accessibility.test.d.ts +1 -0
- package/sidenav/Sidenav.accessibility.test.js +59 -0
- package/sidenav/Sidenav.js +44 -81
- package/sidenav/Sidenav.stories.tsx +5 -10
- package/sidenav/Sidenav.test.d.ts +1 -0
- package/sidenav/Sidenav.test.js +4 -11
- 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.d.ts +1 -0
- package/slider/Slider.accessibility.test.js +103 -0
- package/slider/Slider.js +66 -125
- package/slider/Slider.stories.tsx +0 -60
- package/slider/Slider.test.d.ts +1 -0
- package/slider/Slider.test.js +118 -112
- package/slider/types.d.ts +4 -4
- package/spinner/Spinner.accessibility.test.d.ts +1 -0
- package/spinner/Spinner.accessibility.test.js +96 -0
- package/spinner/Spinner.d.ts +1 -1
- package/spinner/Spinner.js +43 -96
- package/spinner/Spinner.test.d.ts +1 -0
- package/spinner/Spinner.test.js +26 -35
- package/spinner/types.d.ts +3 -3
- package/status-light/StatusLight.accessibility.test.d.ts +1 -0
- 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.d.ts +1 -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.d.ts +1 -0
- package/switch/Switch.accessibility.test.js +98 -0
- package/switch/Switch.js +49 -100
- package/switch/Switch.stories.tsx +12 -34
- package/switch/Switch.test.d.ts +1 -0
- package/switch/Switch.test.js +52 -97
- package/switch/types.d.ts +4 -4
- package/table/DropdownTheme.js +62 -0
- package/table/Table.accessibility.test.d.ts +1 -0
- package/table/Table.accessibility.test.js +92 -0
- package/table/Table.d.ts +6 -2
- package/table/Table.js +76 -33
- package/table/{Table.stories.jsx → Table.stories.tsx} +309 -2
- package/table/Table.test.d.ts +1 -0
- package/table/Table.test.js +92 -7
- package/table/types.d.ts +34 -6
- package/tabs/Tab.js +22 -37
- package/tabs/Tabs.accessibility.test.d.ts +1 -0
- package/tabs/Tabs.accessibility.test.js +56 -0
- package/tabs/Tabs.js +59 -147
- package/tabs/Tabs.stories.tsx +8 -4
- package/tabs/Tabs.test.d.ts +1 -0
- package/tabs/Tabs.test.js +58 -132
- package/tabs/types.d.ts +21 -21
- package/tag/Tag.accessibility.test.d.ts +1 -0
- package/tag/Tag.accessibility.test.js +69 -0
- package/tag/Tag.js +27 -57
- package/tag/Tag.stories.tsx +5 -8
- package/tag/Tag.test.d.ts +1 -0
- package/tag/Tag.test.js +18 -37
- 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 +30 -70
- package/text-input/TextInput.accessibility.test.d.ts +1 -0
- package/text-input/TextInput.accessibility.test.js +320 -0
- package/text-input/TextInput.js +190 -301
- package/text-input/TextInput.stories.tsx +29 -160
- package/text-input/TextInput.test.d.ts +1 -0
- package/text-input/TextInput.test.js +1226 -1283
- package/text-input/types.d.ts +21 -17
- package/textarea/Textarea.accessibility.test.d.ts +1 -0
- package/textarea/Textarea.accessibility.test.js +155 -0
- package/textarea/Textarea.js +60 -103
- package/textarea/{Textarea.stories.jsx → Textarea.stories.tsx} +58 -108
- package/textarea/Textarea.test.d.ts +1 -0
- package/textarea/Textarea.test.js +136 -209
- package/textarea/types.d.ts +5 -5
- package/toggle-group/ToggleGroup.accessibility.test.d.ts +1 -0
- package/toggle-group/ToggleGroup.accessibility.test.js +107 -0
- package/toggle-group/ToggleGroup.js +25 -67
- package/toggle-group/ToggleGroup.stories.tsx +5 -5
- package/toggle-group/ToggleGroup.test.d.ts +1 -0
- package/toggle-group/ToggleGroup.test.js +49 -82
- package/toggle-group/types.d.ts +12 -12
- package/tooltip/Tooltip.accessibility.test.d.ts +1 -0
- package/tooltip/Tooltip.accessibility.test.js +144 -0
- package/tooltip/Tooltip.d.ts +4 -0
- package/tooltip/Tooltip.js +50 -0
- package/tooltip/Tooltip.stories.tsx +111 -0
- package/tooltip/Tooltip.test.d.ts +1 -0
- package/tooltip/Tooltip.test.js +112 -0
- package/tooltip/types.d.ts +16 -0
- package/tooltip/types.js +5 -0
- package/typography/Typography.accessibility.test.d.ts +1 -0
- package/typography/Typography.accessibility.test.js +339 -0
- package/typography/Typography.js +4 -13
- package/typography/Typography.stories.tsx +1 -3
- package/typography/Typography.test.js +23 -0
- package/typography/types.d.ts +1 -1
- package/useTheme.d.ts +60 -138
- package/useTheme.js +1 -8
- package/useTranslatedLabels.d.ts +11 -0
- package/useTranslatedLabels.js +1 -7
- package/utils/BaseTypography.d.ts +2 -2
- package/utils/BaseTypography.js +60 -70
- package/utils/FocusLock.js +26 -39
- package/utils/useWidth.d.ts +2 -0
- package/utils/useWidth.js +30 -0
- package/wizard/Wizard.accessibility.test.d.ts +1 -0
- package/wizard/Wizard.accessibility.test.js +55 -0
- package/wizard/Wizard.js +27 -73
- package/wizard/Wizard.stories.tsx +20 -1
- package/wizard/Wizard.test.d.ts +1 -0
- package/wizard/Wizard.test.js +54 -81
- 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/paginator/Icons.d.ts +0 -5
- package/paginator/Icons.js +0 -54
- 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/resultsetTable/ResultsetTable.test.js +0 -325
- 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/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
package/text-input/TextInput.js
CHANGED
|
@@ -1,68 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports["default"] = void 0;
|
|
11
|
-
|
|
12
9
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
|
-
|
|
14
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
|
-
|
|
16
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
|
-
|
|
18
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
-
|
|
20
13
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
21
|
-
|
|
22
14
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
23
|
-
|
|
24
15
|
var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
|
|
25
|
-
|
|
26
16
|
var _variables = require("../common/variables");
|
|
27
|
-
|
|
28
17
|
var _utils = require("../common/utils");
|
|
29
|
-
|
|
30
|
-
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
31
|
-
|
|
32
|
-
var _NumberInput = require("../number-input/NumberInput");
|
|
33
|
-
|
|
34
18
|
var _Suggestions = _interopRequireDefault(require("./Suggestions"));
|
|
35
|
-
|
|
36
19
|
var Popover = _interopRequireWildcard(require("@radix-ui/react-popover"));
|
|
37
|
-
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10
|
|
43
|
-
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
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; }
|
|
47
|
-
|
|
20
|
+
var _ActionIcon = _interopRequireDefault(require("../action-icon/ActionIcon"));
|
|
21
|
+
var _Flex = _interopRequireDefault(require("../flex/Flex"));
|
|
22
|
+
var _NumberInputContext = require("../number-input/NumberInputContext");
|
|
23
|
+
var _Icon = _interopRequireDefault(require("../icon/Icon"));
|
|
24
|
+
var _useWidth = _interopRequireDefault(require("../utils/useWidth"));
|
|
25
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
26
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
27
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
48
28
|
var sizes = {
|
|
49
29
|
small: "240px",
|
|
50
30
|
medium: "360px",
|
|
51
31
|
large: "480px",
|
|
52
32
|
fillParent: "100%"
|
|
53
33
|
};
|
|
54
|
-
|
|
55
34
|
var AutosuggestWrapper = function AutosuggestWrapper(_ref) {
|
|
56
35
|
var condition = _ref.condition,
|
|
57
|
-
|
|
58
|
-
|
|
36
|
+
wrapper = _ref.wrapper,
|
|
37
|
+
children = _ref.children;
|
|
59
38
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, condition ? wrapper(children) : children);
|
|
60
39
|
};
|
|
61
|
-
|
|
62
40
|
var calculateWidth = function calculateWidth(margin, size) {
|
|
63
41
|
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
64
42
|
};
|
|
65
|
-
|
|
66
43
|
var makeCancelable = function makeCancelable(promise) {
|
|
67
44
|
var hasCanceled_ = false;
|
|
68
45
|
var wrappedPromise = new Promise(function (resolve, reject) {
|
|
@@ -83,131 +60,104 @@ var makeCancelable = function makeCancelable(promise) {
|
|
|
83
60
|
}
|
|
84
61
|
};
|
|
85
62
|
};
|
|
86
|
-
|
|
87
63
|
var hasSuggestions = function hasSuggestions(suggestions) {
|
|
88
64
|
return typeof suggestions === "function" || (suggestions === null || suggestions === void 0 ? void 0 : suggestions.length) > 0;
|
|
89
65
|
};
|
|
90
|
-
|
|
91
66
|
var isRequired = function isRequired(value, optional) {
|
|
92
67
|
return value === "" && !optional;
|
|
93
68
|
};
|
|
94
|
-
|
|
95
69
|
var isLengthIncorrect = function isLengthIncorrect(value, minLength, maxLength) {
|
|
96
70
|
return value != null && (value.length < minLength || value.length > maxLength);
|
|
97
71
|
};
|
|
98
|
-
|
|
99
72
|
var isNumberIncorrect = function isNumberIncorrect(value, minNumber, maxNumber) {
|
|
100
73
|
return value < minNumber || value > maxNumber;
|
|
101
74
|
};
|
|
102
|
-
|
|
103
75
|
var patternMismatch = function patternMismatch(pattern, value) {
|
|
104
76
|
return pattern != null && !new RegExp(pattern).test(value);
|
|
105
77
|
};
|
|
106
|
-
|
|
107
78
|
var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, ref) {
|
|
108
79
|
var label = _ref2.label,
|
|
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
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
var _useState = (0, _react.useState)("input-".concat((0, _uuid.v4)())),
|
|
146
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState, 1),
|
|
147
|
-
inputId = _useState2[0];
|
|
148
|
-
|
|
80
|
+
_ref2$name = _ref2.name,
|
|
81
|
+
name = _ref2$name === void 0 ? "" : _ref2$name,
|
|
82
|
+
_ref2$defaultValue = _ref2.defaultValue,
|
|
83
|
+
defaultValue = _ref2$defaultValue === void 0 ? "" : _ref2$defaultValue,
|
|
84
|
+
value = _ref2.value,
|
|
85
|
+
helperText = _ref2.helperText,
|
|
86
|
+
_ref2$placeholder = _ref2.placeholder,
|
|
87
|
+
placeholder = _ref2$placeholder === void 0 ? "" : _ref2$placeholder,
|
|
88
|
+
action = _ref2.action,
|
|
89
|
+
_ref2$clearable = _ref2.clearable,
|
|
90
|
+
clearable = _ref2$clearable === void 0 ? false : _ref2$clearable,
|
|
91
|
+
_ref2$disabled = _ref2.disabled,
|
|
92
|
+
disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
|
|
93
|
+
_ref2$readOnly = _ref2.readOnly,
|
|
94
|
+
readOnly = _ref2$readOnly === void 0 ? false : _ref2$readOnly,
|
|
95
|
+
_ref2$optional = _ref2.optional,
|
|
96
|
+
optional = _ref2$optional === void 0 ? false : _ref2$optional,
|
|
97
|
+
_ref2$prefix = _ref2.prefix,
|
|
98
|
+
prefix = _ref2$prefix === void 0 ? "" : _ref2$prefix,
|
|
99
|
+
_ref2$suffix = _ref2.suffix,
|
|
100
|
+
suffix = _ref2$suffix === void 0 ? "" : _ref2$suffix,
|
|
101
|
+
onChange = _ref2.onChange,
|
|
102
|
+
onBlur = _ref2.onBlur,
|
|
103
|
+
error = _ref2.error,
|
|
104
|
+
suggestions = _ref2.suggestions,
|
|
105
|
+
pattern = _ref2.pattern,
|
|
106
|
+
minLength = _ref2.minLength,
|
|
107
|
+
maxLength = _ref2.maxLength,
|
|
108
|
+
_ref2$autocomplete = _ref2.autocomplete,
|
|
109
|
+
autocomplete = _ref2$autocomplete === void 0 ? "off" : _ref2$autocomplete,
|
|
110
|
+
margin = _ref2.margin,
|
|
111
|
+
_ref2$size = _ref2.size,
|
|
112
|
+
size = _ref2$size === void 0 ? "medium" : _ref2$size,
|
|
113
|
+
_ref2$tabIndex = _ref2.tabIndex,
|
|
114
|
+
tabIndex = _ref2$tabIndex === void 0 ? 0 : _ref2$tabIndex;
|
|
115
|
+
var inputId = "input-".concat((0, _react.useId)());
|
|
149
116
|
var autosuggestId = "suggestions-".concat(inputId);
|
|
150
117
|
var errorId = "error-".concat(inputId);
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
118
|
+
var _useState = (0, _react.useState)(defaultValue),
|
|
119
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
120
|
+
innerValue = _useState2[0],
|
|
121
|
+
setInnerValue = _useState2[1];
|
|
122
|
+
var _useState3 = (0, _react.useState)(false),
|
|
123
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
124
|
+
isOpen = _useState4[0],
|
|
125
|
+
changeIsOpen = _useState4[1];
|
|
157
126
|
var _useState5 = (0, _react.useState)(false),
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
127
|
+
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
|
128
|
+
isSearching = _useState6[0],
|
|
129
|
+
changeIsSearching = _useState6[1];
|
|
162
130
|
var _useState7 = (0, _react.useState)(false),
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
filteredSuggestions = _useState12[0],
|
|
175
|
-
changeFilteredSuggestions = _useState12[1];
|
|
176
|
-
|
|
177
|
-
var _useState13 = (0, _react.useState)(-1),
|
|
178
|
-
_useState14 = (0, _slicedToArray2["default"])(_useState13, 2),
|
|
179
|
-
visualFocusIndex = _useState14[0],
|
|
180
|
-
changeVisualFocusIndex = _useState14[1];
|
|
181
|
-
|
|
131
|
+
_useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
|
|
132
|
+
isAutosuggestError = _useState8[0],
|
|
133
|
+
changeIsAutosuggestError = _useState8[1];
|
|
134
|
+
var _useState9 = (0, _react.useState)([]),
|
|
135
|
+
_useState10 = (0, _slicedToArray2["default"])(_useState9, 2),
|
|
136
|
+
filteredSuggestions = _useState10[0],
|
|
137
|
+
changeFilteredSuggestions = _useState10[1];
|
|
138
|
+
var _useState11 = (0, _react.useState)(-1),
|
|
139
|
+
_useState12 = (0, _slicedToArray2["default"])(_useState11, 2),
|
|
140
|
+
visualFocusIndex = _useState12[0],
|
|
141
|
+
changeVisualFocusIndex = _useState12[1];
|
|
182
142
|
var inputRef = (0, _react.useRef)(null);
|
|
143
|
+
var inputContainerRef = (0, _react.useRef)(null);
|
|
183
144
|
var actionRef = (0, _react.useRef)(null);
|
|
145
|
+
var width = (0, _useWidth["default"])(inputContainerRef.current);
|
|
184
146
|
var colorsTheme = (0, _useTheme["default"])();
|
|
185
147
|
var translatedLabels = (0, _useTranslatedLabels["default"])();
|
|
186
|
-
var
|
|
187
|
-
var numberInputContext = (0, _react.useContext)(_NumberInput.NumberInputContext);
|
|
188
|
-
|
|
148
|
+
var numberInputContext = (0, _react.useContext)(_NumberInputContext.NumberInputContext);
|
|
189
149
|
var getNumberErrorMessage = function getNumberErrorMessage(value) {
|
|
190
150
|
if (value < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) return translatedLabels.numberInput.valueGreaterThanOrEqualToErrorMessage(numberInputContext.minNumber);else if (value > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) return translatedLabels.numberInput.valueLessThanOrEqualToErrorMessage(numberInputContext.maxNumber);
|
|
191
151
|
};
|
|
192
|
-
|
|
193
|
-
var getTextInputWidth = (0, _react.useCallback)(function () {
|
|
194
|
-
var _inputRef$current, _inputRef$current$par;
|
|
195
|
-
|
|
196
|
-
var rect = inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : (_inputRef$current$par = _inputRef$current.parentElement) === null || _inputRef$current$par === void 0 ? void 0 : _inputRef$current$par.getBoundingClientRect();
|
|
197
|
-
return rect === null || rect === void 0 ? void 0 : rect.width;
|
|
198
|
-
}, []);
|
|
199
|
-
|
|
200
152
|
var openSuggestions = function openSuggestions() {
|
|
201
153
|
hasSuggestions(suggestions) && changeIsOpen(true);
|
|
202
154
|
};
|
|
203
|
-
|
|
204
155
|
var closeSuggestions = function closeSuggestions() {
|
|
205
156
|
if (hasSuggestions(suggestions)) {
|
|
206
157
|
changeIsOpen(false);
|
|
207
158
|
changeVisualFocusIndex(-1);
|
|
208
159
|
}
|
|
209
160
|
};
|
|
210
|
-
|
|
211
161
|
var changeValue = function changeValue(newValue) {
|
|
212
162
|
var formattedValue = typeof newValue === "number" ? newValue.toString() : newValue;
|
|
213
163
|
value !== null && value !== void 0 ? value : setInnerValue(formattedValue);
|
|
@@ -227,21 +177,41 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
227
177
|
value: formattedValue
|
|
228
178
|
});
|
|
229
179
|
};
|
|
230
|
-
|
|
180
|
+
var decrementNumber = function decrementNumber() {
|
|
181
|
+
var currentValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : value !== null && value !== void 0 ? value : innerValue;
|
|
182
|
+
if (!disabled && !readOnly) {
|
|
183
|
+
var numberValue = Number(currentValue);
|
|
184
|
+
var steppedValue = Math.round((numberValue - (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) + Number.EPSILON) * 100) / 100;
|
|
185
|
+
if (currentValue !== "") {
|
|
186
|
+
if (numberValue < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) || steppedValue < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) changeValue(numberValue);else if (numberValue > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);else if (numberValue === (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);else changeValue(steppedValue);
|
|
187
|
+
} else {
|
|
188
|
+
if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) >= 0) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);else if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) < 0) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);else changeValue(-numberInputContext.stepNumber);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
var incrementNumber = function incrementNumber() {
|
|
193
|
+
var currentValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : value !== null && value !== void 0 ? value : innerValue;
|
|
194
|
+
if (!disabled && !readOnly) {
|
|
195
|
+
var numberValue = Number(currentValue);
|
|
196
|
+
var steppedValue = Math.round((numberValue + (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) + Number.EPSILON) * 100) / 100;
|
|
197
|
+
if (currentValue !== "") {
|
|
198
|
+
if (numberValue > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) || steppedValue > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) changeValue(numberValue);else if (numberValue < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);else if (numberValue === (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);else changeValue(steppedValue);
|
|
199
|
+
} else {
|
|
200
|
+
if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) > 0) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);else if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) <= 0) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);else changeValue(numberInputContext.stepNumber);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
};
|
|
231
204
|
var handleInputContainerOnClick = function handleInputContainerOnClick() {
|
|
232
205
|
document.activeElement !== actionRef.current && inputRef.current.focus();
|
|
233
206
|
};
|
|
234
|
-
|
|
235
207
|
var handleInputContainerOnMouseDown = function handleInputContainerOnMouseDown(event) {
|
|
236
208
|
// Avoid input to lose the focus when the container is pressed
|
|
237
209
|
document.activeElement === inputRef.current && event.preventDefault();
|
|
238
210
|
};
|
|
239
|
-
|
|
240
211
|
var handleInputOnChange = function handleInputOnChange(event) {
|
|
241
212
|
openSuggestions();
|
|
242
213
|
changeValue(event.target.value);
|
|
243
214
|
};
|
|
244
|
-
|
|
245
215
|
var handleInputOnBlur = function handleInputOnBlur(event) {
|
|
246
216
|
closeSuggestions();
|
|
247
217
|
if (isRequired(event.target.value, optional)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
|
|
@@ -260,116 +230,73 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
260
230
|
value: event.target.value
|
|
261
231
|
});
|
|
262
232
|
};
|
|
263
|
-
|
|
264
233
|
var handleInputOnKeyDown = function handleInputOnKeyDown(event) {
|
|
265
234
|
switch (event.key) {
|
|
266
235
|
case "Down":
|
|
267
236
|
case "ArrowDown":
|
|
268
237
|
event.preventDefault();
|
|
269
|
-
|
|
270
|
-
if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number") {
|
|
271
|
-
decrementNumber();
|
|
272
|
-
} else {
|
|
238
|
+
if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number") decrementNumber();else {
|
|
273
239
|
openSuggestions();
|
|
274
|
-
|
|
275
240
|
if (!isAutosuggestError && !isSearching && filteredSuggestions.length > 0) {
|
|
276
241
|
changeVisualFocusIndex(function (visualFocusedSuggIndex) {
|
|
277
242
|
if (visualFocusedSuggIndex < filteredSuggestions.length - 1) return visualFocusedSuggIndex + 1;else if (visualFocusedSuggIndex === filteredSuggestions.length - 1) return 0;
|
|
278
243
|
});
|
|
279
244
|
}
|
|
280
245
|
}
|
|
281
|
-
|
|
282
246
|
break;
|
|
283
|
-
|
|
284
247
|
case "Up":
|
|
285
248
|
case "ArrowUp":
|
|
286
249
|
event.preventDefault();
|
|
287
|
-
|
|
288
|
-
if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number") {
|
|
289
|
-
incrementNumber();
|
|
290
|
-
} else {
|
|
250
|
+
if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number") incrementNumber();else {
|
|
291
251
|
openSuggestions();
|
|
292
|
-
|
|
293
252
|
if (!isAutosuggestError && !isSearching && filteredSuggestions.length > 0) {
|
|
294
253
|
changeVisualFocusIndex(function (visualFocusedSuggIndex) {
|
|
295
254
|
if (visualFocusedSuggIndex === 0 || visualFocusedSuggIndex === -1) return filteredSuggestions.length > 0 ? filteredSuggestions.length - 1 : suggestions.length - 1;else return visualFocusedSuggIndex - 1;
|
|
296
255
|
});
|
|
297
256
|
}
|
|
298
257
|
}
|
|
299
|
-
|
|
300
258
|
break;
|
|
301
|
-
|
|
302
259
|
case "Esc":
|
|
303
260
|
case "Escape":
|
|
304
261
|
event.preventDefault();
|
|
305
|
-
|
|
262
|
+
isOpen && event.stopPropagation();
|
|
306
263
|
if (hasSuggestions(suggestions)) {
|
|
307
264
|
changeValue("");
|
|
308
265
|
isOpen && closeSuggestions();
|
|
309
266
|
}
|
|
310
|
-
|
|
311
267
|
break;
|
|
312
|
-
|
|
313
268
|
case "Enter":
|
|
314
269
|
if (hasSuggestions(suggestions) && !isSearching) {
|
|
315
270
|
var validFocusedSuggestion = filteredSuggestions.length > 0 && visualFocusIndex >= 0 && visualFocusIndex < filteredSuggestions.length;
|
|
316
271
|
validFocusedSuggestion && changeValue(filteredSuggestions[visualFocusIndex]);
|
|
317
272
|
isOpen && closeSuggestions();
|
|
318
273
|
}
|
|
319
|
-
|
|
320
274
|
break;
|
|
321
275
|
}
|
|
322
276
|
};
|
|
323
|
-
|
|
277
|
+
var handleNumberInputWheel = function handleNumberInputWheel(event) {
|
|
278
|
+
if (document.activeElement === inputRef.current) event.deltaY < 0 ? incrementNumber(inputRef.current.value) : decrementNumber(inputRef.current.value);
|
|
279
|
+
};
|
|
324
280
|
var handleClearActionOnClick = function handleClearActionOnClick() {
|
|
325
281
|
changeValue("");
|
|
326
282
|
inputRef.current.focus();
|
|
327
283
|
suggestions && closeSuggestions();
|
|
328
284
|
};
|
|
329
|
-
|
|
330
285
|
var handleDecrementActionOnClick = function handleDecrementActionOnClick() {
|
|
331
286
|
decrementNumber();
|
|
332
287
|
inputRef.current.focus();
|
|
333
288
|
};
|
|
334
|
-
|
|
335
289
|
var handleIncrementActionOnClick = function handleIncrementActionOnClick() {
|
|
336
290
|
incrementNumber();
|
|
337
291
|
inputRef.current.focus();
|
|
338
292
|
};
|
|
339
|
-
|
|
340
293
|
var setNumberProps = function setNumberProps(type, min, max, step) {
|
|
341
|
-
var _inputRef$
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : _inputRef$current4.setAttribute("
|
|
346
|
-
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current5 = inputRef.current) === null || _inputRef$current5 === void 0 ? void 0 : _inputRef$current5.setAttribute("type", type);
|
|
294
|
+
var _inputRef$current, _inputRef$current2, _inputRef$current3, _inputRef$current4;
|
|
295
|
+
min && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.setAttribute("min", min));
|
|
296
|
+
max && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.setAttribute("max", max));
|
|
297
|
+
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.setAttribute("step", step);
|
|
298
|
+
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : _inputRef$current4.setAttribute("type", type);
|
|
347
299
|
};
|
|
348
|
-
|
|
349
|
-
var decrementNumber = function decrementNumber() {
|
|
350
|
-
var currentValue = value !== null && value !== void 0 ? value : innerValue;
|
|
351
|
-
var numberValue = Number(currentValue);
|
|
352
|
-
var steppedValue = Math.round((numberValue - (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) + Number.EPSILON) * 100) / 100;
|
|
353
|
-
|
|
354
|
-
if (currentValue !== "") {
|
|
355
|
-
if (numberValue < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) || steppedValue < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) changeValue(numberValue);else if (numberValue > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);else if (numberValue === (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);else changeValue(steppedValue);
|
|
356
|
-
} else {
|
|
357
|
-
if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) >= 0) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);else if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) < 0) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);else changeValue(-numberInputContext.stepNumber);
|
|
358
|
-
}
|
|
359
|
-
};
|
|
360
|
-
|
|
361
|
-
var incrementNumber = function incrementNumber() {
|
|
362
|
-
var currentValue = value !== null && value !== void 0 ? value : innerValue;
|
|
363
|
-
var numberValue = Number(currentValue);
|
|
364
|
-
var steppedValue = Math.round((numberValue + (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) + Number.EPSILON) * 100) / 100;
|
|
365
|
-
|
|
366
|
-
if (currentValue !== "") {
|
|
367
|
-
if (numberValue > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) || steppedValue > (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) changeValue(numberValue);else if (numberValue < (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber)) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);else if (numberValue === (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber)) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);else changeValue(steppedValue);
|
|
368
|
-
} else {
|
|
369
|
-
if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber) > 0) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.minNumber);else if ((numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber) <= 0) changeValue(numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.maxNumber);else changeValue(numberInputContext.stepNumber);
|
|
370
|
-
}
|
|
371
|
-
};
|
|
372
|
-
|
|
373
300
|
(0, _react.useEffect)(function () {
|
|
374
301
|
if (typeof suggestions === "function") {
|
|
375
302
|
changeIsSearching(true);
|
|
@@ -395,7 +322,6 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
395
322
|
}));
|
|
396
323
|
changeVisualFocusIndex(-1);
|
|
397
324
|
}
|
|
398
|
-
|
|
399
325
|
numberInputContext != null && setNumberProps(numberInputContext.typeNumber, numberInputContext.minNumber, numberInputContext.maxNumber, numberInputContext.stepNumber);
|
|
400
326
|
}, [value, innerValue, suggestions, numberInputContext]);
|
|
401
327
|
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
@@ -407,31 +333,25 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
407
333
|
}, label && /*#__PURE__*/_react["default"].createElement(Label, {
|
|
408
334
|
htmlFor: inputId,
|
|
409
335
|
disabled: disabled,
|
|
410
|
-
backgroundType: backgroundType,
|
|
411
336
|
hasHelperText: helperText ? true : false
|
|
412
337
|
}, label, " ", optional && /*#__PURE__*/_react["default"].createElement(OptionalLabel, null, translatedLabels.formFields.optionalLabel)), helperText && /*#__PURE__*/_react["default"].createElement(HelperText, {
|
|
413
|
-
disabled: disabled
|
|
414
|
-
|
|
415
|
-
}, helperText), /*#__PURE__*/_react["default"].createElement(InputContainer, {
|
|
416
|
-
error: error ? true : false,
|
|
417
|
-
disabled: disabled,
|
|
418
|
-
readOnly: readOnly,
|
|
419
|
-
backgroundType: backgroundType,
|
|
420
|
-
onClick: handleInputContainerOnClick,
|
|
421
|
-
onMouseDown: handleInputContainerOnMouseDown
|
|
422
|
-
}, prefix && /*#__PURE__*/_react["default"].createElement(Prefix, {
|
|
423
|
-
disabled: disabled,
|
|
424
|
-
backgroundType: backgroundType
|
|
425
|
-
}, prefix), /*#__PURE__*/_react["default"].createElement(AutosuggestWrapper, {
|
|
338
|
+
disabled: disabled
|
|
339
|
+
}, helperText), /*#__PURE__*/_react["default"].createElement(AutosuggestWrapper, {
|
|
426
340
|
condition: hasSuggestions(suggestions),
|
|
427
341
|
wrapper: function wrapper(children) {
|
|
428
342
|
return /*#__PURE__*/_react["default"].createElement(Popover.Root, {
|
|
429
343
|
open: isOpen && (filteredSuggestions.length > 0 || isSearching || isAutosuggestError)
|
|
430
344
|
}, /*#__PURE__*/_react["default"].createElement(Popover.Trigger, {
|
|
431
345
|
asChild: true,
|
|
432
|
-
|
|
433
|
-
|
|
346
|
+
type: undefined,
|
|
347
|
+
"aria-controls": undefined,
|
|
348
|
+
"aria-haspopup": undefined,
|
|
349
|
+
"aria-expanded": undefined
|
|
350
|
+
}, children), /*#__PURE__*/_react["default"].createElement(Popover.Portal, null, /*#__PURE__*/_react["default"].createElement(Popover.Content, {
|
|
434
351
|
sideOffset: 5,
|
|
352
|
+
style: {
|
|
353
|
+
zIndex: "2147483647"
|
|
354
|
+
},
|
|
435
355
|
onOpenAutoFocus: function onOpenAutoFocus(event) {
|
|
436
356
|
// Avoid select to lose focus when the list is opened
|
|
437
357
|
event.preventDefault();
|
|
@@ -452,9 +372,24 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
452
372
|
changeValue(suggestion);
|
|
453
373
|
closeSuggestions();
|
|
454
374
|
},
|
|
455
|
-
|
|
456
|
-
|
|
375
|
+
styles: {
|
|
376
|
+
width: width
|
|
377
|
+
}
|
|
378
|
+
}))));
|
|
457
379
|
}
|
|
380
|
+
}, /*#__PURE__*/_react["default"].createElement(InputContainer, {
|
|
381
|
+
error: error ? true : false,
|
|
382
|
+
disabled: disabled,
|
|
383
|
+
readOnly: readOnly,
|
|
384
|
+
onClick: handleInputContainerOnClick,
|
|
385
|
+
onMouseDown: handleInputContainerOnMouseDown,
|
|
386
|
+
ref: inputContainerRef
|
|
387
|
+
}, prefix && /*#__PURE__*/_react["default"].createElement(Prefix, {
|
|
388
|
+
disabled: disabled
|
|
389
|
+
}, prefix), /*#__PURE__*/_react["default"].createElement(_Flex["default"], {
|
|
390
|
+
gap: "0.25rem",
|
|
391
|
+
alignItems: "center",
|
|
392
|
+
grow: 1
|
|
458
393
|
}, /*#__PURE__*/_react["default"].createElement(Input, {
|
|
459
394
|
id: inputId,
|
|
460
395
|
name: name,
|
|
@@ -462,15 +397,15 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
462
397
|
placeholder: placeholder,
|
|
463
398
|
onBlur: handleInputOnBlur,
|
|
464
399
|
onChange: handleInputOnChange,
|
|
465
|
-
onFocus: openSuggestions,
|
|
466
|
-
onKeyDown: handleInputOnKeyDown,
|
|
400
|
+
onFocus: !readOnly ? openSuggestions : undefined,
|
|
401
|
+
onKeyDown: !readOnly ? handleInputOnKeyDown : undefined,
|
|
467
402
|
onMouseDown: function onMouseDown(event) {
|
|
468
403
|
event.stopPropagation();
|
|
469
404
|
},
|
|
405
|
+
onWheel: (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number" ? handleNumberInputWheel : undefined,
|
|
470
406
|
disabled: disabled,
|
|
471
407
|
readOnly: readOnly,
|
|
472
408
|
ref: inputRef,
|
|
473
|
-
backgroundType: backgroundType,
|
|
474
409
|
pattern: pattern,
|
|
475
410
|
minLength: minLength,
|
|
476
411
|
maxLength: maxLength,
|
|
@@ -486,69 +421,48 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
486
421
|
"aria-invalid": error ? true : false,
|
|
487
422
|
"aria-errormessage": error ? errorId : undefined,
|
|
488
423
|
"aria-required": !disabled && !optional
|
|
489
|
-
})
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
424
|
+
}), !disabled && error && /*#__PURE__*/_react["default"].createElement(ErrorIcon, {
|
|
425
|
+
"aria-hidden": "true"
|
|
426
|
+
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
427
|
+
icon: "filled_error"
|
|
428
|
+
})), !disabled && !readOnly && clearable && (value !== null && value !== void 0 ? value : innerValue).length > 0 && /*#__PURE__*/_react["default"].createElement(_ActionIcon["default"], {
|
|
494
429
|
onClick: handleClearActionOnClick,
|
|
495
|
-
|
|
496
|
-
event.stopPropagation();
|
|
497
|
-
},
|
|
430
|
+
icon: "close",
|
|
498
431
|
tabIndex: tabIndex,
|
|
499
|
-
title: translatedLabels.textInput.clearFieldActionTitle
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
"aria-label": translatedLabels.numberInput.decrementValueTitle,
|
|
504
|
-
disabled: disabled,
|
|
505
|
-
onClick: handleDecrementActionOnClick,
|
|
506
|
-
onMouseDown: function onMouseDown(event) {
|
|
507
|
-
event.stopPropagation();
|
|
508
|
-
},
|
|
509
|
-
ref: actionRef,
|
|
432
|
+
title: translatedLabels.textInput.clearFieldActionTitle
|
|
433
|
+
}), (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number" && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_ActionIcon["default"], {
|
|
434
|
+
onClick: !readOnly ? handleDecrementActionOnClick : undefined,
|
|
435
|
+
icon: "remove",
|
|
510
436
|
tabIndex: tabIndex,
|
|
511
|
-
title: translatedLabels.numberInput.decrementValueTitle,
|
|
512
|
-
type: "button",
|
|
513
|
-
backgroundType: backgroundType
|
|
514
|
-
}, _Icons["default"].decrement), /*#__PURE__*/_react["default"].createElement(Action, {
|
|
515
|
-
"aria-label": translatedLabels.numberInput.incrementValueTitle,
|
|
516
|
-
disabled: disabled,
|
|
517
|
-
onClick: handleIncrementActionOnClick,
|
|
518
|
-
onMouseDown: function onMouseDown(event) {
|
|
519
|
-
event.stopPropagation();
|
|
520
|
-
},
|
|
521
437
|
ref: actionRef,
|
|
438
|
+
title: translatedLabels.numberInput.decrementValueTitle,
|
|
439
|
+
disabled: disabled
|
|
440
|
+
}), /*#__PURE__*/_react["default"].createElement(_ActionIcon["default"], {
|
|
441
|
+
onClick: !readOnly ? handleIncrementActionOnClick : undefined,
|
|
442
|
+
icon: "add",
|
|
522
443
|
tabIndex: tabIndex,
|
|
444
|
+
ref: actionRef,
|
|
523
445
|
title: translatedLabels.numberInput.incrementValueTitle,
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
}, _Icons["default"].increment)), action && /*#__PURE__*/_react["default"].createElement(Action, {
|
|
527
|
-
"aria-label": action.title,
|
|
528
|
-
disabled: disabled,
|
|
446
|
+
disabled: disabled
|
|
447
|
+
})), action && /*#__PURE__*/_react["default"].createElement(_ActionIcon["default"], {
|
|
529
448
|
onClick: !readOnly ? action.onClick : undefined,
|
|
530
|
-
|
|
531
|
-
event.stopPropagation();
|
|
532
|
-
},
|
|
533
|
-
ref: actionRef,
|
|
449
|
+
icon: action.icon,
|
|
534
450
|
tabIndex: tabIndex,
|
|
451
|
+
ref: actionRef,
|
|
535
452
|
title: action.title,
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
}) : action.icon), suffix && /*#__PURE__*/_react["default"].createElement(Suffix, {
|
|
541
|
-
disabled: disabled,
|
|
542
|
-
backgroundType: backgroundType
|
|
543
|
-
}, suffix)), !disabled && typeof error === "string" && /*#__PURE__*/_react["default"].createElement(Error, {
|
|
453
|
+
disabled: disabled
|
|
454
|
+
})), suffix && /*#__PURE__*/_react["default"].createElement(Suffix, {
|
|
455
|
+
disabled: disabled
|
|
456
|
+
}, suffix))), !disabled && typeof error === "string" && /*#__PURE__*/_react["default"].createElement(Error, {
|
|
544
457
|
id: errorId,
|
|
545
|
-
|
|
458
|
+
role: "alert",
|
|
546
459
|
"aria-live": error ? "assertive" : "off"
|
|
547
460
|
}, error)));
|
|
548
461
|
});
|
|
549
|
-
|
|
550
|
-
var TextInputContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
|
|
462
|
+
var TextInputContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n width: ", ";\n ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n font-family: ", ";\n"])), function (props) {
|
|
551
463
|
return calculateWidth(props.margin, props.size);
|
|
464
|
+
}, function (props) {
|
|
465
|
+
return props.size !== "fillParent" && "min-width:" + calculateWidth(props.margin, props.size);
|
|
552
466
|
}, function (props) {
|
|
553
467
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
554
468
|
}, function (props) {
|
|
@@ -559,12 +473,11 @@ var TextInputContainer = _styledComponents["default"].div(_templateObject || (_t
|
|
|
559
473
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
560
474
|
}, function (props) {
|
|
561
475
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
562
|
-
});
|
|
563
|
-
|
|
564
|
-
var Label = _styledComponents["default"].label(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n ", "\n"])), function (props) {
|
|
565
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledLabelFontColorOnDark : props.theme.disabledLabelFontColor : props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
566
476
|
}, function (props) {
|
|
567
477
|
return props.theme.fontFamily;
|
|
478
|
+
});
|
|
479
|
+
var Label = _styledComponents["default"].label(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n ", "\n"])), function (props) {
|
|
480
|
+
return props.disabled ? props.theme.disabledLabelFontColor : props.theme.labelFontColor;
|
|
568
481
|
}, function (props) {
|
|
569
482
|
return props.theme.labelFontSize;
|
|
570
483
|
}, function (props) {
|
|
@@ -576,15 +489,11 @@ var Label = _styledComponents["default"].label(_templateObject2 || (_templateObj
|
|
|
576
489
|
}, function (props) {
|
|
577
490
|
return !props.hasHelperText && "margin-bottom: 0.25rem";
|
|
578
491
|
});
|
|
579
|
-
|
|
580
492
|
var OptionalLabel = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n font-weight: ", ";\n"])), function (props) {
|
|
581
493
|
return props.theme.optionalLabelFontWeight;
|
|
582
494
|
});
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledHelperTextFontColorOnDark : props.theme.disabledHelperTextFontColor : props.backgroundType === "dark" ? props.theme.helperTextFontColorOnDark : props.theme.helperTextFontColor;
|
|
586
|
-
}, function (props) {
|
|
587
|
-
return props.theme.fontFamily;
|
|
495
|
+
var HelperText = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-bottom: 0.25rem;\n"])), function (props) {
|
|
496
|
+
return props.disabled ? props.theme.disabledHelperTextFontColor : props.theme.helperTextFontColor;
|
|
588
497
|
}, function (props) {
|
|
589
498
|
return props.theme.helperTextFontSize;
|
|
590
499
|
}, function (props) {
|
|
@@ -594,19 +503,17 @@ var HelperText = _styledComponents["default"].span(_templateObject4 || (_templat
|
|
|
594
503
|
}, function (props) {
|
|
595
504
|
return props.theme.helperTextLineHeight;
|
|
596
505
|
});
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
if (props.disabled) return props.backgroundType === "dark" ? "background-color: ".concat(props.theme.disabledContainerFillColorOnDark, ";") : "background-color: ".concat(props.theme.disabledContainerFillColor, ";");
|
|
506
|
+
var InputContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n display: flex;\n align-items: center;\n height: calc(2.5rem - 2px);\n padding: 0 0.5rem;\n ", "\n box-shadow: 0 0 0 2px transparent;\n border-radius: 4px;\n border: 1px solid\n ", ";\n ", "\n ", ";\n"])), function (props) {
|
|
507
|
+
if (props.disabled) return "background-color: ".concat(props.theme.disabledContainerFillColor, ";");
|
|
600
508
|
}, function (props) {
|
|
601
|
-
if (props.disabled) return props.
|
|
509
|
+
if (props.disabled) return props.theme.disabledBorderColor;else if (props.readOnly) return props.theme.readOnlyBorderColor;else return props.theme.enabledBorderColor;
|
|
602
510
|
}, function (props) {
|
|
603
|
-
return props.error && !props.disabled && "border-color: transparent;\n box-shadow: 0 0 0 2px ".concat(props.
|
|
511
|
+
return props.error && !props.disabled && "border-color: transparent;\n box-shadow: 0 0 0 2px ".concat(props.theme.errorBorderColor, ";\n ");
|
|
604
512
|
}, function (props) {
|
|
605
|
-
return !props.disabled ? "\n &:hover {\n border-color: ".concat(props.error ? "transparent" : props.readOnly ? props.theme.hoverReadOnlyBorderColor : props.
|
|
513
|
+
return !props.disabled ? "\n &:hover {\n border-color: ".concat(props.error ? "transparent" : props.readOnly ? props.theme.hoverReadOnlyBorderColor : props.theme.hoverBorderColor, ";\n ").concat(props.error ? "box-shadow: 0 0 0 2px ".concat(props.theme.hoverErrorBorderColor, ";") : "", "\n }\n &:focus-within {\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(props.theme.focusBorderColor, ";\n }\n ") : "cursor: not-allowed;";
|
|
606
514
|
});
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledValueFontColorOnDark : props.theme.disabledValueFontColor : props.backgroundType === "dark" ? props.theme.valueFontColorOnDark : props.theme.valueFontColor;
|
|
515
|
+
var Input = _styledComponents["default"].input(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n height: calc(2.5rem - 2px);\n width: 100%;\n background: none;\n border: none;\n outline: none;\n padding: 0 0.5rem;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: 1.5em;\n ", "\n\n ::placeholder {\n color: ", ";\n }\n"])), function (props) {
|
|
516
|
+
return props.disabled ? props.theme.disabledValueFontColor : props.theme.valueFontColor;
|
|
610
517
|
}, function (props) {
|
|
611
518
|
return props.theme.fontFamily;
|
|
612
519
|
}, function (props) {
|
|
@@ -618,42 +525,24 @@ var Input = _styledComponents["default"].input(_templateObject6 || (_templateObj
|
|
|
618
525
|
}, function (props) {
|
|
619
526
|
return props.disabled && "cursor: not-allowed;";
|
|
620
527
|
}, function (props) {
|
|
621
|
-
return props.disabled ? props.
|
|
622
|
-
});
|
|
623
|
-
|
|
624
|
-
var Action = _styledComponents["default"].button(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n border: 1px solid transparent;\n border-radius: 2px;\n width: 24px;\n height: 24px;\n padding: 3px;\n margin-left: 0.25rem;\n ", "\n\n box-shadow: 0 0 0 2px transparent;\n background-color: ", ";\n\n color: ", ";\n\n ", "\n\n img, svg {\n width: 16px;\n height: 16px;\n }\n"])), function (props) {
|
|
625
|
-
return props.disabled ? "cursor: not-allowed;" : "cursor: pointer;";
|
|
626
|
-
}, function (props) {
|
|
627
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledActionBackgroundColorOnDark : props.theme.disabledActionBackgroundColor : props.backgroundType === "dark" ? props.theme.actionBackgroundColorOnDark : props.theme.actionBackgroundColor;
|
|
628
|
-
}, function (props) {
|
|
629
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledActionIconColorOnDark : props.theme.disabledActionIconColor : props.backgroundType === "dark" ? props.theme.actionIconColorOnDark : props.theme.actionIconColor;
|
|
630
|
-
}, function (props) {
|
|
631
|
-
return !props.disabled && "\n &:focus, \n &:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px ".concat(props.backgroundType === "dark" ? props.theme.focusActionBorderColorOnDark : props.theme.focusActionBorderColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.focusActionIconColorOnDark : props.theme.focusActionIconColor, ";\n }\n &:hover {\n background-color: ").concat(props.backgroundType === "dark" ? props.theme.hoverActionBackgroundColorOnDark : props.theme.hoverActionBackgroundColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.hoverActionIconColorOnDark : props.theme.hoverActionIconColor, ";\n }\n &:active {\n background-color: ").concat(props.backgroundType === "dark" ? props.theme.activeActionBackgroundColorOnDark : props.theme.activeActionBackgroundColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.activeActionIconColorOnDark : props.theme.activeActionIconColor, ";\n }\n ");
|
|
528
|
+
return props.disabled ? props.theme.disabledPlaceholderFontColor : props.theme.placeholderFontColor;
|
|
632
529
|
});
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
var color = props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPrefixColorOnDark : props.theme.disabledPrefixColor : props.backgroundType === "dark" ? props.theme.prefixColorOnDark : props.theme.prefixColor;
|
|
636
|
-
return "color: ".concat(color, "; border-right: 1px solid ").concat(color, ";");
|
|
530
|
+
var Prefix = _styledComponents["default"].span(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n height: 1.5rem;\n margin-left: 0.25rem;\n padding-right: ", ";\n ", ";\n font-size: 1rem;\n line-height: 1.5rem;\n pointer-events: none;\n"])), function (props) {
|
|
531
|
+
return props.theme.prefixDividerPaddingRight;
|
|
637
532
|
}, function (props) {
|
|
638
|
-
|
|
533
|
+
var color = props.disabled ? props.theme.disabledPrefixColor : props.theme.prefixColor;
|
|
534
|
+
return "color: ".concat(color, "; border-right: ").concat(props.theme.prefixDividerBorderWidth, " ").concat(props.theme.prefixDividerBorderStyle, " ").concat(color, ";");
|
|
639
535
|
});
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
var color = props.disabled ? props.backgroundType === "dark" ? props.theme.disabledSuffixColorOnDark : props.theme.disabledSuffixColor : props.backgroundType === "dark" ? props.theme.suffixColorOnDark : props.theme.suffixColor;
|
|
643
|
-
return "color: ".concat(color, "; border-left: 1px solid ").concat(color, ";");
|
|
536
|
+
var Suffix = _styledComponents["default"].span(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n height: 1.5rem;\n margin: 0 0.25rem;\n padding-left: ", ";\n ", ";\n font-size: 1rem;\n line-height: 1.5rem;\n pointer-events: none;\n"])), function (props) {
|
|
537
|
+
return props.theme.suffixDividerPaddingLeft;
|
|
644
538
|
}, function (props) {
|
|
645
|
-
|
|
539
|
+
var color = props.disabled ? props.theme.disabledSuffixColor : props.theme.suffixColor;
|
|
540
|
+
return "color: ".concat(color, "; border-left: ").concat(props.theme.suffixDividerBorderWidth, " ").concat(props.theme.suffixDividerBorderStyle, " ").concat(color, ";");
|
|
646
541
|
});
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
return props.backgroundType === "dark" ? props.theme.errorIconColorOnDark : props.theme.errorIconColor;
|
|
542
|
+
var ErrorIcon = _styledComponents["default"].span(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n padding: 3px;\n height: 18px;\n width: 18px;\n font-size: 18px;\n color: ", ";\n"])), function (props) {
|
|
543
|
+
return props.theme.errorIconColor;
|
|
650
544
|
});
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
return props.backgroundType === "dark" ? props.theme.errorMessageColorOnDark : props.theme.errorMessageColor;
|
|
654
|
-
}, function (props) {
|
|
655
|
-
return props.theme.fontFamily;
|
|
545
|
+
var Error = _styledComponents["default"].span(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n min-height: 1.5em;\n color: ", ";\n font-size: 0.75rem;\n font-weight: 400;\n line-height: 1.5em;\n margin-top: 0.25rem;\n"])), function (props) {
|
|
546
|
+
return props.theme.errorMessageColor;
|
|
656
547
|
});
|
|
657
|
-
|
|
658
|
-
var _default = DxcTextInput;
|
|
659
|
-
exports["default"] = _default;
|
|
548
|
+
var _default = exports["default"] = DxcTextInput;
|