@dxc-technology/halstack-react 11.0.0 → 12.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BackgroundColorContext.d.ts +1 -10
- package/BackgroundColorContext.js +3 -8
- package/HalstackContext.d.ts +32 -145
- package/HalstackContext.js +3 -7
- package/accordion/Accordion.accessibility.test.d.ts +1 -0
- package/accordion/Accordion.accessibility.test.js +71 -0
- package/accordion/Accordion.js +18 -35
- package/accordion/Accordion.stories.tsx +7 -49
- package/accordion/Accordion.test.d.ts +1 -0
- package/accordion/Accordion.test.js +3 -3
- package/accordion/types.d.ts +1 -1
- 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 +4 -4
- package/accordion-group/AccordionGroup.stories.tsx +23 -23
- package/accordion-group/AccordionGroup.test.d.ts +1 -0
- package/accordion-group/AccordionGroup.test.js +5 -9
- package/accordion-group/AccordionGroupAccordion.js +3 -3
- package/accordion-group/AccordionGroupContext.d.ts +3 -0
- package/accordion-group/AccordionGroupContext.js +8 -0
- package/accordion-group/types.d.ts +1 -1
- 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/action-icon/types.js +5 -0
- package/alert/Alert.accessibility.test.d.ts +1 -0
- package/alert/Alert.accessibility.test.js +95 -0
- package/alert/Alert.js +21 -75
- package/alert/Alert.test.d.ts +1 -0
- package/alert/Alert.test.js +1 -1
- 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 +141 -28
- 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/box/Box.accessibility.test.d.ts +1 -0
- package/box/Box.accessibility.test.js +33 -0
- package/box/Box.js +2 -5
- package/box/Box.test.d.ts +1 -0
- package/box/Box.test.js +1 -1
- 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 +169 -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 +16 -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 +16 -23
- package/bulleted-list/BulletedList.stories.tsx +1 -2
- package/button/Button.accessibility.test.d.ts +1 -0
- package/button/Button.accessibility.test.js +127 -0
- package/button/Button.js +16 -16
- package/button/Button.stories.tsx +34 -53
- package/button/Button.test.d.ts +1 -0
- package/button/Button.test.js +4 -2
- package/button/types.d.ts +1 -1
- package/card/Card.accessibility.test.d.ts +1 -0
- package/card/Card.accessibility.test.js +36 -0
- package/card/Card.js +3 -2
- package/card/Card.test.d.ts +1 -0
- package/card/Card.test.js +1 -1
- package/checkbox/Checkbox.accessibility.test.d.ts +1 -0
- package/checkbox/Checkbox.accessibility.test.js +87 -0
- package/checkbox/Checkbox.js +36 -44
- package/checkbox/Checkbox.test.d.ts +1 -0
- package/checkbox/Checkbox.test.js +1 -1
- package/chip/Chip.accessibility.test.d.ts +1 -0
- package/chip/Chip.accessibility.test.js +69 -0
- package/chip/Chip.js +20 -26
- package/chip/Chip.stories.tsx +67 -50
- package/chip/Chip.test.d.ts +1 -0
- package/chip/Chip.test.js +5 -5
- package/chip/types.d.ts +35 -12
- package/common/coreTokens.d.ts +105 -14
- package/common/coreTokens.js +40 -22
- package/common/fonts.css +2 -0
- package/common/variables.d.ts +31 -141
- package/common/variables.js +104 -214
- 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.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 +88 -0
- package/contextual-menu/ContextualMenu.stories.tsx +232 -0
- package/contextual-menu/ContextualMenu.test.d.ts +1 -0
- package/contextual-menu/ContextualMenu.test.js +205 -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 +51 -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 +58 -0
- package/contextual-menu/types.js +5 -0
- package/date-input/Calendar.js +1 -1
- package/date-input/DateInput.accessibility.test.d.ts +1 -0
- package/date-input/DateInput.accessibility.test.js +230 -0
- package/date-input/DateInput.js +19 -20
- package/date-input/DateInput.stories.tsx +15 -8
- package/date-input/DateInput.test.d.ts +1 -0
- package/date-input/DateInput.test.js +9 -8
- package/date-input/DatePicker.js +13 -7
- package/date-input/YearPicker.js +1 -1
- package/date-input/types.d.ts +2 -2
- package/dialog/Dialog.accessibility.test.d.ts +1 -0
- package/dialog/Dialog.accessibility.test.js +69 -0
- package/dialog/Dialog.js +11 -25
- package/dialog/Dialog.stories.tsx +175 -0
- package/dialog/Dialog.test.d.ts +1 -0
- package/dialog/Dialog.test.js +113 -49
- 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 +223 -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 +184 -0
- package/dropdown/Dropdown.js +37 -51
- package/dropdown/Dropdown.stories.tsx +15 -26
- package/dropdown/Dropdown.test.d.ts +1 -0
- package/dropdown/Dropdown.test.js +100 -70
- package/dropdown/DropdownMenu.js +4 -4
- package/dropdown/DropdownMenuItem.js +8 -4
- package/dropdown/types.d.ts +3 -5
- package/file-input/FileInput.accessibility.test.d.ts +1 -0
- package/file-input/FileInput.accessibility.test.js +167 -0
- package/file-input/FileInput.js +127 -145
- package/file-input/FileInput.test.d.ts +1 -0
- package/file-input/FileInput.test.js +125 -129
- package/file-input/FileItem.js +18 -28
- package/file-input/types.d.ts +1 -1
- 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 +36 -31
- package/footer/Footer.stories.tsx +58 -2
- package/footer/Footer.test.d.ts +1 -0
- package/footer/Footer.test.js +1 -1
- package/footer/Icons.d.ts +1 -0
- package/footer/Icons.js +52 -16
- package/footer/types.d.ts +8 -8
- package/header/Header.accessibility.test.d.ts +1 -0
- package/header/Header.accessibility.test.js +94 -0
- package/header/Header.js +20 -41
- package/header/Header.stories.tsx +16 -0
- package/header/Header.test.d.ts +1 -0
- package/header/Header.test.js +1 -1
- package/header/Icons.js +1 -6
- package/header/types.d.ts +4 -3
- package/heading/Heading.accessibility.test.d.ts +1 -0
- package/heading/Heading.accessibility.test.js +33 -0
- package/heading/Heading.js +1 -1
- package/heading/Heading.test.d.ts +1 -0
- package/heading/Heading.test.js +1 -14
- 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.js +1 -1
- package/image/Image.stories.tsx +3 -1
- package/layout/ApplicationLayout.d.ts +1 -1
- package/layout/ApplicationLayout.js +10 -7
- package/layout/Icons.d.ts +0 -1
- package/layout/Icons.js +1 -11
- package/link/Link.accessibility.test.d.ts +1 -0
- package/link/Link.accessibility.test.js +108 -0
- package/link/Link.js +8 -6
- package/link/Link.stories.tsx +4 -4
- package/link/Link.test.d.ts +1 -0
- package/link/Link.test.js +1 -1
- package/link/types.d.ts +1 -1
- package/main.d.ts +8 -3
- package/main.js +38 -9
- 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 +25 -7
- package/nav-tabs/NavTabs.stories.tsx +44 -24
- package/nav-tabs/NavTabs.test.d.ts +1 -0
- package/nav-tabs/NavTabs.test.js +12 -10
- package/nav-tabs/NavTabsContext.d.ts +3 -0
- package/nav-tabs/NavTabsContext.js +8 -0
- package/nav-tabs/Tab.js +23 -23
- package/nav-tabs/types.d.ts +1 -1
- package/number-input/NumberInput.accessibility.test.d.ts +1 -0
- package/number-input/NumberInput.accessibility.test.js +228 -0
- package/number-input/NumberInput.d.ts +0 -7
- package/number-input/NumberInput.js +24 -5
- package/number-input/NumberInput.test.d.ts +1 -0
- package/number-input/NumberInput.test.js +166 -7
- package/number-input/NumberInputContext.d.ts +3 -0
- package/number-input/NumberInputContext.js +8 -0
- package/number-input/types.d.ts +6 -0
- package/package.json +20 -18
- package/paginator/Paginator.accessibility.test.d.ts +1 -0
- package/paginator/Paginator.accessibility.test.js +79 -0
- package/paginator/Paginator.js +14 -14
- package/paginator/Paginator.test.d.ts +1 -0
- package/paginator/Paginator.test.js +1 -1
- package/paragraph/Paragraph.accessibility.test.d.ts +1 -0
- package/paragraph/Paragraph.accessibility.test.js +28 -0
- package/paragraph/Paragraph.js +2 -7
- package/password-input/PasswordInput.accessibility.test.d.ts +1 -0
- package/password-input/PasswordInput.accessibility.test.js +153 -0
- package/password-input/PasswordInput.js +7 -7
- package/password-input/PasswordInput.stories.tsx +0 -1
- package/password-input/PasswordInput.test.d.ts +1 -0
- package/password-input/PasswordInput.test.js +5 -5
- package/progress-bar/ProgressBar.accessibility.test.d.ts +1 -0
- package/progress-bar/ProgressBar.accessibility.test.js +35 -0
- package/progress-bar/ProgressBar.js +11 -15
- package/progress-bar/ProgressBar.test.d.ts +1 -0
- package/progress-bar/ProgressBar.test.js +1 -1
- package/quick-nav/QuickNav.accessibility.test.d.ts +1 -0
- package/quick-nav/QuickNav.accessibility.test.js +57 -0
- package/quick-nav/QuickNav.js +1 -1
- package/radio-group/Radio.js +6 -9
- package/radio-group/RadioGroup.accessibility.test.d.ts +1 -0
- package/radio-group/RadioGroup.accessibility.test.js +97 -0
- package/radio-group/RadioGroup.js +15 -17
- package/radio-group/RadioGroup.test.d.ts +1 -0
- package/radio-group/RadioGroup.test.js +3 -5
- package/resultset-table/ResultsetTable.accessibility.test.d.ts +1 -0
- package/resultset-table/ResultsetTable.accessibility.test.js +285 -0
- package/resultset-table/ResultsetTable.d.ts +4 -1
- package/resultset-table/ResultsetTable.js +25 -13
- package/resultset-table/ResultsetTable.stories.tsx +118 -5
- package/resultset-table/ResultsetTable.test.d.ts +1 -0
- package/resultset-table/ResultsetTable.test.js +76 -1
- package/resultset-table/types.d.ts +40 -7
- package/select/Listbox.js +24 -16
- package/select/Option.js +19 -10
- package/select/Select.accessibility.test.d.ts +1 -0
- package/select/Select.accessibility.test.js +228 -0
- package/select/Select.js +72 -54
- package/select/Select.stories.tsx +59 -111
- package/select/Select.test.d.ts +1 -0
- package/select/Select.test.js +393 -459
- package/select/types.d.ts +3 -3
- package/sidenav/Sidenav.accessibility.test.d.ts +1 -0
- package/sidenav/Sidenav.accessibility.test.js +59 -0
- package/sidenav/Sidenav.js +21 -19
- package/sidenav/Sidenav.stories.tsx +4 -9
- package/sidenav/Sidenav.test.d.ts +1 -0
- package/sidenav/Sidenav.test.js +1 -1
- package/sidenav/types.d.ts +2 -2
- package/slider/Slider.accessibility.test.d.ts +1 -0
- package/slider/Slider.accessibility.test.js +104 -0
- package/slider/Slider.js +31 -42
- package/slider/Slider.stories.tsx +180 -0
- package/slider/Slider.test.d.ts +1 -0
- package/slider/Slider.test.js +12 -9
- package/spinner/Spinner.accessibility.test.d.ts +1 -0
- package/spinner/Spinner.accessibility.test.js +96 -0
- package/spinner/Spinner.js +12 -16
- package/spinner/Spinner.test.d.ts +1 -0
- package/spinner/Spinner.test.js +1 -1
- 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 +29 -37
- package/switch/Switch.stories.tsx +12 -0
- package/switch/Switch.test.d.ts +1 -0
- package/switch/Switch.test.js +1 -1
- package/table/DropdownTheme.js +62 -0
- package/table/Table.accessibility.test.d.ts +1 -0
- package/table/Table.accessibility.test.js +93 -0
- package/table/Table.d.ts +6 -2
- package/table/Table.js +74 -12
- package/table/Table.stories.tsx +309 -2
- package/table/Table.test.d.ts +1 -0
- package/table/Table.test.js +92 -1
- package/table/types.d.ts +28 -0
- package/tabs/Tab.js +13 -9
- package/tabs/Tabs.accessibility.test.d.ts +1 -0
- package/tabs/Tabs.accessibility.test.js +56 -0
- package/tabs/Tabs.js +12 -24
- package/tabs/Tabs.stories.tsx +8 -4
- package/tabs/Tabs.test.d.ts +1 -0
- package/tabs/Tabs.test.js +20 -38
- package/tabs/types.d.ts +2 -2
- package/tag/Tag.accessibility.test.d.ts +1 -0
- package/tag/Tag.accessibility.test.js +69 -0
- package/tag/Tag.js +7 -7
- package/tag/Tag.stories.tsx +4 -7
- package/tag/Tag.test.d.ts +1 -0
- package/tag/Tag.test.js +5 -13
- package/tag/types.d.ts +2 -2
- package/text-input/Suggestion.js +1 -1
- package/text-input/Suggestions.js +19 -14
- package/text-input/TextInput.accessibility.test.d.ts +1 -0
- package/text-input/TextInput.accessibility.test.js +321 -0
- package/text-input/TextInput.js +103 -126
- package/text-input/TextInput.stories.tsx +17 -8
- package/text-input/TextInput.test.d.ts +1 -0
- package/text-input/TextInput.test.js +97 -80
- package/textarea/Textarea.accessibility.test.d.ts +1 -0
- package/textarea/Textarea.accessibility.test.js +155 -0
- package/textarea/Textarea.js +13 -21
- package/textarea/Textarea.stories.tsx +0 -1
- package/textarea/Textarea.test.d.ts +1 -0
- package/textarea/Textarea.test.js +1 -1
- package/toggle-group/ToggleGroup.accessibility.test.d.ts +1 -0
- package/toggle-group/ToggleGroup.accessibility.test.js +107 -0
- package/toggle-group/ToggleGroup.js +11 -16
- package/toggle-group/ToggleGroup.stories.tsx +3 -3
- package/toggle-group/ToggleGroup.test.d.ts +1 -0
- package/toggle-group/ToggleGroup.test.js +1 -1
- package/toggle-group/types.d.ts +2 -2
- package/typography/Typography.accessibility.test.d.ts +1 -0
- package/typography/Typography.accessibility.test.js +339 -0
- package/useTheme.d.ts +31 -141
- package/utils/BaseTypography.js +1 -1
- package/utils/FocusLock.js +16 -6
- package/wizard/Wizard.accessibility.test.d.ts +1 -0
- package/wizard/Wizard.accessibility.test.js +55 -0
- package/wizard/Wizard.js +14 -25
- package/wizard/Wizard.stories.tsx +19 -0
- package/wizard/Wizard.test.d.ts +1 -0
- package/wizard/Wizard.test.js +1 -1
- package/wizard/types.d.ts +2 -2
- 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 -58
- package/paginator/Icons.d.ts +0 -5
- package/paginator/Icons.js +0 -40
- package/password-input/Icons.d.ts +0 -6
- package/password-input/Icons.js +0 -35
- package/select/Icons.d.ts +0 -10
- package/select/Icons.js +0 -89
- package/sidenav/Icons.d.ts +0 -7
- package/sidenav/Icons.js +0 -47
- package/text-input/Icons.d.ts +0 -8
- package/text-input/Icons.js +0 -56
- /package/{layout → sidenav}/SidenavContext.d.ts +0 -0
- /package/{layout → sidenav}/SidenavContext.js +0 -0
package/text-input/TextInput.js
CHANGED
|
@@ -15,15 +15,15 @@ var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
|
15
15
|
var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
|
|
16
16
|
var _variables = require("../common/variables");
|
|
17
17
|
var _utils = require("../common/utils");
|
|
18
|
-
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
19
|
-
var _NumberInput = require("../number-input/NumberInput");
|
|
20
18
|
var _Suggestions = _interopRequireDefault(require("./Suggestions"));
|
|
21
19
|
var Popover = _interopRequireWildcard(require("@radix-ui/react-popover"));
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
var
|
|
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 _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
25
25
|
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); }
|
|
26
|
-
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 &&
|
|
26
|
+
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; }
|
|
27
27
|
var sizes = {
|
|
28
28
|
small: "240px",
|
|
29
29
|
medium: "360px",
|
|
@@ -131,43 +131,40 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
131
131
|
size = _ref2$size === void 0 ? "medium" : _ref2$size,
|
|
132
132
|
_ref2$tabIndex = _ref2.tabIndex,
|
|
133
133
|
tabIndex = _ref2$tabIndex === void 0 ? 0 : _ref2$tabIndex;
|
|
134
|
-
var
|
|
135
|
-
_useState4 = (0, _slicedToArray2["default"])(_useState3, 1),
|
|
136
|
-
inputId = _useState4[0];
|
|
134
|
+
var inputId = "input-".concat((0, _react.useId)());
|
|
137
135
|
var autosuggestId = "suggestions-".concat(inputId);
|
|
138
136
|
var errorId = "error-".concat(inputId);
|
|
139
|
-
var
|
|
137
|
+
var _useState3 = (0, _react.useState)(defaultValue),
|
|
138
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
139
|
+
innerValue = _useState4[0],
|
|
140
|
+
setInnerValue = _useState4[1];
|
|
141
|
+
var _useState5 = (0, _react.useState)(false),
|
|
140
142
|
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
|
141
|
-
|
|
142
|
-
|
|
143
|
+
isOpen = _useState6[0],
|
|
144
|
+
changeIsOpen = _useState6[1];
|
|
143
145
|
var _useState7 = (0, _react.useState)(false),
|
|
144
146
|
_useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
|
|
145
|
-
|
|
146
|
-
|
|
147
|
+
isSearching = _useState8[0],
|
|
148
|
+
changeIsSearching = _useState8[1];
|
|
147
149
|
var _useState9 = (0, _react.useState)(false),
|
|
148
150
|
_useState10 = (0, _slicedToArray2["default"])(_useState9, 2),
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
var _useState11 = (0, _react.useState)(
|
|
151
|
+
isAutosuggestError = _useState10[0],
|
|
152
|
+
changeIsAutosuggestError = _useState10[1];
|
|
153
|
+
var _useState11 = (0, _react.useState)([]),
|
|
152
154
|
_useState12 = (0, _slicedToArray2["default"])(_useState11, 2),
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
var _useState13 = (0, _react.useState)(
|
|
155
|
+
filteredSuggestions = _useState12[0],
|
|
156
|
+
changeFilteredSuggestions = _useState12[1];
|
|
157
|
+
var _useState13 = (0, _react.useState)(-1),
|
|
156
158
|
_useState14 = (0, _slicedToArray2["default"])(_useState13, 2),
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
var _useState15 = (0, _react.useState)(-1),
|
|
160
|
-
_useState16 = (0, _slicedToArray2["default"])(_useState15, 2),
|
|
161
|
-
visualFocusIndex = _useState16[0],
|
|
162
|
-
changeVisualFocusIndex = _useState16[1];
|
|
159
|
+
visualFocusIndex = _useState14[0],
|
|
160
|
+
changeVisualFocusIndex = _useState14[1];
|
|
163
161
|
var inputRef = (0, _react.useRef)(null);
|
|
164
162
|
var inputContainerRef = (0, _react.useRef)(null);
|
|
165
163
|
var actionRef = (0, _react.useRef)(null);
|
|
166
164
|
var width = useWidth(inputContainerRef.current);
|
|
167
165
|
var colorsTheme = (0, _useTheme["default"])();
|
|
168
166
|
var translatedLabels = (0, _useTranslatedLabels["default"])();
|
|
169
|
-
var
|
|
170
|
-
var numberInputContext = (0, _react.useContext)(_NumberInput.NumberInputContext);
|
|
167
|
+
var numberInputContext = (0, _react.useContext)(_NumberInputContext.NumberInputContext);
|
|
171
168
|
var getNumberErrorMessage = function getNumberErrorMessage(value) {
|
|
172
169
|
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);
|
|
173
170
|
};
|
|
@@ -199,6 +196,30 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
199
196
|
value: formattedValue
|
|
200
197
|
});
|
|
201
198
|
};
|
|
199
|
+
var decrementNumber = function decrementNumber() {
|
|
200
|
+
var currentValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : value !== null && value !== void 0 ? value : innerValue;
|
|
201
|
+
if (!disabled && !readOnly) {
|
|
202
|
+
var numberValue = Number(currentValue);
|
|
203
|
+
var steppedValue = Math.round((numberValue - (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) + Number.EPSILON) * 100) / 100;
|
|
204
|
+
if (currentValue !== "") {
|
|
205
|
+
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);
|
|
206
|
+
} else {
|
|
207
|
+
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);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
var incrementNumber = function incrementNumber() {
|
|
212
|
+
var currentValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : value !== null && value !== void 0 ? value : innerValue;
|
|
213
|
+
if (!disabled && !readOnly) {
|
|
214
|
+
var numberValue = Number(currentValue);
|
|
215
|
+
var steppedValue = Math.round((numberValue + (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) + Number.EPSILON) * 100) / 100;
|
|
216
|
+
if (currentValue !== "") {
|
|
217
|
+
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);
|
|
218
|
+
} else {
|
|
219
|
+
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);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
};
|
|
202
223
|
var handleInputContainerOnClick = function handleInputContainerOnClick() {
|
|
203
224
|
document.activeElement !== actionRef.current && inputRef.current.focus();
|
|
204
225
|
};
|
|
@@ -257,6 +278,7 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
257
278
|
case "Esc":
|
|
258
279
|
case "Escape":
|
|
259
280
|
event.preventDefault();
|
|
281
|
+
isOpen && event.stopPropagation();
|
|
260
282
|
if (hasSuggestions(suggestions)) {
|
|
261
283
|
changeValue("");
|
|
262
284
|
isOpen && closeSuggestions();
|
|
@@ -271,6 +293,9 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
271
293
|
break;
|
|
272
294
|
}
|
|
273
295
|
};
|
|
296
|
+
var handleNumberInputWheel = function handleNumberInputWheel(event) {
|
|
297
|
+
if (document.activeElement === inputRef.current) event.deltaY < 0 ? incrementNumber(inputRef.current.value) : decrementNumber(inputRef.current.value);
|
|
298
|
+
};
|
|
274
299
|
var handleClearActionOnClick = function handleClearActionOnClick() {
|
|
275
300
|
changeValue("");
|
|
276
301
|
inputRef.current.focus();
|
|
@@ -291,26 +316,6 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
291
316
|
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.setAttribute("step", step);
|
|
292
317
|
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : _inputRef$current4.setAttribute("type", type);
|
|
293
318
|
};
|
|
294
|
-
var decrementNumber = function decrementNumber() {
|
|
295
|
-
var currentValue = value !== null && value !== void 0 ? value : innerValue;
|
|
296
|
-
var numberValue = Number(currentValue);
|
|
297
|
-
var steppedValue = Math.round((numberValue - (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) + Number.EPSILON) * 100) / 100;
|
|
298
|
-
if (currentValue !== "") {
|
|
299
|
-
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);
|
|
300
|
-
} else {
|
|
301
|
-
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);
|
|
302
|
-
}
|
|
303
|
-
};
|
|
304
|
-
var incrementNumber = function incrementNumber() {
|
|
305
|
-
var currentValue = value !== null && value !== void 0 ? value : innerValue;
|
|
306
|
-
var numberValue = Number(currentValue);
|
|
307
|
-
var steppedValue = Math.round((numberValue + (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) + Number.EPSILON) * 100) / 100;
|
|
308
|
-
if (currentValue !== "") {
|
|
309
|
-
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);
|
|
310
|
-
} else {
|
|
311
|
-
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);
|
|
312
|
-
}
|
|
313
|
-
};
|
|
314
319
|
(0, _react.useEffect)(function () {
|
|
315
320
|
if (typeof suggestions === "function") {
|
|
316
321
|
changeIsSearching(true);
|
|
@@ -347,11 +352,9 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
347
352
|
}, label && /*#__PURE__*/_react["default"].createElement(Label, {
|
|
348
353
|
htmlFor: inputId,
|
|
349
354
|
disabled: disabled,
|
|
350
|
-
backgroundType: backgroundType,
|
|
351
355
|
hasHelperText: helperText ? true : false
|
|
352
356
|
}, label, " ", optional && /*#__PURE__*/_react["default"].createElement(OptionalLabel, null, translatedLabels.formFields.optionalLabel)), helperText && /*#__PURE__*/_react["default"].createElement(HelperText, {
|
|
353
|
-
disabled: disabled
|
|
354
|
-
backgroundType: backgroundType
|
|
357
|
+
disabled: disabled
|
|
355
358
|
}, helperText), /*#__PURE__*/_react["default"].createElement(AutosuggestWrapper, {
|
|
356
359
|
condition: hasSuggestions(suggestions),
|
|
357
360
|
wrapper: function wrapper(children) {
|
|
@@ -359,7 +362,10 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
359
362
|
open: isOpen && (filteredSuggestions.length > 0 || isSearching || isAutosuggestError)
|
|
360
363
|
}, /*#__PURE__*/_react["default"].createElement(Popover.Trigger, {
|
|
361
364
|
asChild: true,
|
|
362
|
-
|
|
365
|
+
type: undefined,
|
|
366
|
+
"aria-controls": undefined,
|
|
367
|
+
"aria-haspopup": undefined,
|
|
368
|
+
"aria-expanded": undefined
|
|
363
369
|
}, children), /*#__PURE__*/_react["default"].createElement(Popover.Portal, null, /*#__PURE__*/_react["default"].createElement(Popover.Content, {
|
|
364
370
|
sideOffset: 5,
|
|
365
371
|
style: {
|
|
@@ -394,14 +400,16 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
394
400
|
error: error ? true : false,
|
|
395
401
|
disabled: disabled,
|
|
396
402
|
readOnly: readOnly,
|
|
397
|
-
backgroundType: backgroundType,
|
|
398
403
|
onClick: handleInputContainerOnClick,
|
|
399
404
|
onMouseDown: handleInputContainerOnMouseDown,
|
|
400
405
|
ref: inputContainerRef
|
|
401
406
|
}, prefix && /*#__PURE__*/_react["default"].createElement(Prefix, {
|
|
402
|
-
disabled: disabled
|
|
403
|
-
|
|
404
|
-
|
|
407
|
+
disabled: disabled
|
|
408
|
+
}, prefix), /*#__PURE__*/_react["default"].createElement(_Flex["default"], {
|
|
409
|
+
gap: "0.25rem",
|
|
410
|
+
alignItems: "center",
|
|
411
|
+
grow: 1
|
|
412
|
+
}, /*#__PURE__*/_react["default"].createElement(Input, {
|
|
405
413
|
id: inputId,
|
|
406
414
|
name: name,
|
|
407
415
|
value: value !== null && value !== void 0 ? value : innerValue,
|
|
@@ -413,10 +421,10 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
413
421
|
onMouseDown: function onMouseDown(event) {
|
|
414
422
|
event.stopPropagation();
|
|
415
423
|
},
|
|
424
|
+
onWheel: (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number" ? handleNumberInputWheel : undefined,
|
|
416
425
|
disabled: disabled,
|
|
417
426
|
readOnly: readOnly,
|
|
418
427
|
ref: inputRef,
|
|
419
|
-
backgroundType: backgroundType,
|
|
420
428
|
pattern: pattern,
|
|
421
429
|
minLength: minLength,
|
|
422
430
|
maxLength: maxLength,
|
|
@@ -433,62 +441,40 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
433
441
|
"aria-errormessage": error ? errorId : undefined,
|
|
434
442
|
"aria-required": !disabled && !optional
|
|
435
443
|
}), !disabled && error && /*#__PURE__*/_react["default"].createElement(ErrorIcon, {
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
444
|
+
"aria-hidden": "true"
|
|
445
|
+
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
446
|
+
icon: "filled_error"
|
|
447
|
+
})), !disabled && !readOnly && clearable && (value !== null && value !== void 0 ? value : innerValue).length > 0 && /*#__PURE__*/_react["default"].createElement(_ActionIcon["default"], {
|
|
440
448
|
onClick: handleClearActionOnClick,
|
|
441
|
-
|
|
442
|
-
event.stopPropagation();
|
|
443
|
-
},
|
|
449
|
+
icon: "close",
|
|
444
450
|
tabIndex: tabIndex,
|
|
445
|
-
title: translatedLabels.textInput.clearFieldActionTitle
|
|
446
|
-
|
|
447
|
-
backgroundType: backgroundType
|
|
448
|
-
}, _Icons["default"].clear), (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number" && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(Action, {
|
|
449
|
-
"aria-label": translatedLabels.numberInput.decrementValueTitle,
|
|
450
|
-
disabled: disabled,
|
|
451
|
+
title: translatedLabels.textInput.clearFieldActionTitle
|
|
452
|
+
}), (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number" && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_ActionIcon["default"], {
|
|
451
453
|
onClick: !readOnly ? handleDecrementActionOnClick : undefined,
|
|
452
|
-
|
|
453
|
-
event.stopPropagation();
|
|
454
|
-
},
|
|
455
|
-
ref: actionRef,
|
|
454
|
+
icon: "remove",
|
|
456
455
|
tabIndex: tabIndex,
|
|
456
|
+
ref: actionRef,
|
|
457
457
|
title: translatedLabels.numberInput.decrementValueTitle,
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
}, _Icons["default"].decrement), /*#__PURE__*/_react["default"].createElement(Action, {
|
|
461
|
-
"aria-label": translatedLabels.numberInput.incrementValueTitle,
|
|
462
|
-
disabled: disabled,
|
|
458
|
+
disabled: disabled
|
|
459
|
+
}), /*#__PURE__*/_react["default"].createElement(_ActionIcon["default"], {
|
|
463
460
|
onClick: !readOnly ? handleIncrementActionOnClick : undefined,
|
|
464
|
-
|
|
465
|
-
event.stopPropagation();
|
|
466
|
-
},
|
|
467
|
-
ref: actionRef,
|
|
461
|
+
icon: "add",
|
|
468
462
|
tabIndex: tabIndex,
|
|
463
|
+
ref: actionRef,
|
|
469
464
|
title: translatedLabels.numberInput.incrementValueTitle,
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
}, _Icons["default"].increment)), action && /*#__PURE__*/_react["default"].createElement(Action, {
|
|
473
|
-
"aria-label": action.title,
|
|
474
|
-
disabled: disabled,
|
|
465
|
+
disabled: disabled
|
|
466
|
+
})), action && /*#__PURE__*/_react["default"].createElement(_ActionIcon["default"], {
|
|
475
467
|
onClick: !readOnly ? action.onClick : undefined,
|
|
476
|
-
|
|
477
|
-
event.stopPropagation();
|
|
478
|
-
},
|
|
479
|
-
ref: actionRef,
|
|
468
|
+
icon: action.icon,
|
|
480
469
|
tabIndex: tabIndex,
|
|
470
|
+
ref: actionRef,
|
|
481
471
|
title: action.title,
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
src: action.icon
|
|
486
|
-
}) : action.icon), suffix && /*#__PURE__*/_react["default"].createElement(Suffix, {
|
|
487
|
-
disabled: disabled,
|
|
488
|
-
backgroundType: backgroundType
|
|
472
|
+
disabled: disabled
|
|
473
|
+
})), suffix && /*#__PURE__*/_react["default"].createElement(Suffix, {
|
|
474
|
+
disabled: disabled
|
|
489
475
|
}, suffix))), !disabled && typeof error === "string" && /*#__PURE__*/_react["default"].createElement(Error, {
|
|
490
476
|
id: errorId,
|
|
491
|
-
|
|
477
|
+
role: "alert",
|
|
492
478
|
"aria-live": error ? "assertive" : "off"
|
|
493
479
|
}, error)));
|
|
494
480
|
});
|
|
@@ -506,7 +492,7 @@ var TextInputContainer = _styledComponents["default"].div(_templateObject || (_t
|
|
|
506
492
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
507
493
|
});
|
|
508
494
|
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) {
|
|
509
|
-
return props.disabled ? props.
|
|
495
|
+
return props.disabled ? props.theme.disabledLabelFontColor : props.theme.labelFontColor;
|
|
510
496
|
}, function (props) {
|
|
511
497
|
return props.theme.fontFamily;
|
|
512
498
|
}, function (props) {
|
|
@@ -523,8 +509,8 @@ var Label = _styledComponents["default"].label(_templateObject2 || (_templateObj
|
|
|
523
509
|
var OptionalLabel = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n font-weight: ", ";\n"])), function (props) {
|
|
524
510
|
return props.theme.optionalLabelFontWeight;
|
|
525
511
|
});
|
|
526
|
-
var HelperText = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n
|
|
527
|
-
return props.disabled ? props.
|
|
512
|
+
var HelperText = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-bottom: 0.25rem;\n"])), function (props) {
|
|
513
|
+
return props.disabled ? props.theme.disabledHelperTextFontColor : props.theme.helperTextFontColor;
|
|
528
514
|
}, function (props) {
|
|
529
515
|
return props.theme.fontFamily;
|
|
530
516
|
}, function (props) {
|
|
@@ -537,16 +523,16 @@ var HelperText = _styledComponents["default"].span(_templateObject4 || (_templat
|
|
|
537
523
|
return props.theme.helperTextLineHeight;
|
|
538
524
|
});
|
|
539
525
|
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 ", "\n box-shadow: 0 0 0 2px transparent;\n border-radius: 4px;\n border: 1px solid\n ", ";\n ", "\n\n ", ";\n"])), function (props) {
|
|
540
|
-
if (props.disabled) return
|
|
526
|
+
if (props.disabled) return "background-color: ".concat(props.theme.disabledContainerFillColor, ";");
|
|
541
527
|
}, function (props) {
|
|
542
|
-
if (props.disabled) return props.
|
|
528
|
+
if (props.disabled) return props.theme.disabledBorderColor;else if (props.readOnly) return props.theme.readOnlyBorderColor;else return props.theme.enabledBorderColor;
|
|
543
529
|
}, function (props) {
|
|
544
|
-
return props.error && !props.disabled && "border-color: transparent;\n box-shadow: 0 0 0 2px ".concat(props.
|
|
530
|
+
return props.error && !props.disabled && "border-color: transparent;\n box-shadow: 0 0 0 2px ".concat(props.theme.errorBorderColor, ";\n ");
|
|
545
531
|
}, function (props) {
|
|
546
|
-
return !props.disabled ? "\n &:hover {\n border-color: ".concat(props.error ? "transparent" : props.readOnly ? props.theme.hoverReadOnlyBorderColor : props.
|
|
532
|
+
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;";
|
|
547
533
|
});
|
|
548
534
|
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\n color: ", ";\n\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) {
|
|
549
|
-
return props.disabled ? props.
|
|
535
|
+
return props.disabled ? props.theme.disabledValueFontColor : props.theme.valueFontColor;
|
|
550
536
|
}, function (props) {
|
|
551
537
|
return props.theme.fontFamily;
|
|
552
538
|
}, function (props) {
|
|
@@ -558,34 +544,25 @@ var Input = _styledComponents["default"].input(_templateObject6 || (_templateObj
|
|
|
558
544
|
}, function (props) {
|
|
559
545
|
return props.disabled && "cursor: not-allowed;";
|
|
560
546
|
}, function (props) {
|
|
561
|
-
return props.disabled ? props.
|
|
562
|
-
});
|
|
563
|
-
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) {
|
|
564
|
-
return props.disabled ? "cursor: not-allowed;" : "cursor: pointer;";
|
|
565
|
-
}, function (props) {
|
|
566
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledActionBackgroundColorOnDark : props.theme.disabledActionBackgroundColor : props.backgroundType === "dark" ? props.theme.actionBackgroundColorOnDark : props.theme.actionBackgroundColor;
|
|
567
|
-
}, function (props) {
|
|
568
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledActionIconColorOnDark : props.theme.disabledActionIconColor : props.backgroundType === "dark" ? props.theme.actionIconColorOnDark : props.theme.actionIconColor;
|
|
569
|
-
}, function (props) {
|
|
570
|
-
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 ");
|
|
547
|
+
return props.disabled ? props.theme.disabledPlaceholderFontColor : props.theme.placeholderFontColor;
|
|
571
548
|
});
|
|
572
|
-
var Prefix = _styledComponents["default"].span(
|
|
573
|
-
var color = props.disabled ? props.
|
|
549
|
+
var Prefix = _styledComponents["default"].span(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n height: 1.5rem;\n line-height: 1.5rem;\n margin-left: 0.25rem;\n padding: 0 0.5rem 0 0;\n ", ";\n font-family: ", ";\n font-size: 1rem;\n pointer-events: none;\n"])), function (props) {
|
|
550
|
+
var color = props.disabled ? props.theme.disabledPrefixColor : props.theme.prefixColor;
|
|
574
551
|
return "color: ".concat(color, "; border-right: 1px solid ").concat(color, ";");
|
|
575
552
|
}, function (props) {
|
|
576
553
|
return props.theme.fontFamily;
|
|
577
554
|
});
|
|
578
|
-
var Suffix = _styledComponents["default"].span(
|
|
579
|
-
var color = props.disabled ? props.
|
|
555
|
+
var Suffix = _styledComponents["default"].span(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n height: 1.5rem;\n line-height: 1.5rem;\n margin: 0 0.25rem;\n padding: 0 0 0 0.5rem;\n ", ";\n font-family: ", ";\n font-size: 1rem;\n pointer-events: none;\n"])), function (props) {
|
|
556
|
+
var color = props.disabled ? props.theme.disabledSuffixColor : props.theme.suffixColor;
|
|
580
557
|
return "color: ".concat(color, "; border-left: 1px solid ").concat(color, ";");
|
|
581
558
|
}, function (props) {
|
|
582
559
|
return props.theme.fontFamily;
|
|
583
560
|
});
|
|
584
|
-
var ErrorIcon = _styledComponents["default"].span(
|
|
585
|
-
return props.
|
|
561
|
+
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\n svg {\n line-height: 18px;\n font-size: 1.25rem;\n }\n"])), function (props) {
|
|
562
|
+
return props.theme.errorIconColor;
|
|
586
563
|
});
|
|
587
|
-
var Error = _styledComponents["default"].span(
|
|
588
|
-
return props.
|
|
564
|
+
var Error = _styledComponents["default"].span(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n min-height: 1.5em;\n color: ", ";\n font-family: ", ";\n font-size: 0.75rem;\n font-weight: 400;\n line-height: 1.5em;\n margin-top: 0.25rem;\n"])), function (props) {
|
|
565
|
+
return props.theme.errorMessageColor;
|
|
589
566
|
}, function (props) {
|
|
590
567
|
return props.theme.fontFamily;
|
|
591
568
|
});
|
|
@@ -21,21 +21,30 @@ const action = {
|
|
|
21
21
|
<path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z" />
|
|
22
22
|
</svg>
|
|
23
23
|
),
|
|
24
|
+
title: "Copy",
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
const actionLargeIconSVG = {
|
|
27
28
|
onClick: () => {},
|
|
28
29
|
icon: (
|
|
29
|
-
<svg
|
|
30
|
+
<svg
|
|
31
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
32
|
+
height="48px"
|
|
33
|
+
viewBox="0 0 24 24"
|
|
34
|
+
width="48px"
|
|
35
|
+
fill="currentColor"
|
|
36
|
+
>
|
|
30
37
|
<path d="M0 0h24v24H0V0z" fill="none" />
|
|
31
38
|
<path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z" />
|
|
32
39
|
</svg>
|
|
33
40
|
),
|
|
41
|
+
title: "Clock",
|
|
34
42
|
};
|
|
35
43
|
|
|
36
44
|
const actionLargeIconURL = {
|
|
37
45
|
onClick: () => {},
|
|
38
|
-
icon: "
|
|
46
|
+
icon: "search",
|
|
47
|
+
title: "Search",
|
|
39
48
|
};
|
|
40
49
|
|
|
41
50
|
const country = ["Afghanistan"];
|
|
@@ -371,7 +380,7 @@ const AutosuggestListbox = () => {
|
|
|
371
380
|
<ExampleContainer pseudoState="pseudo-hover">
|
|
372
381
|
<Title title="Hovered suggestion" theme="light" level={4} />
|
|
373
382
|
<Suggestions
|
|
374
|
-
id="
|
|
383
|
+
id="x1"
|
|
375
384
|
value=""
|
|
376
385
|
suggestions={country}
|
|
377
386
|
visualFocusIndex={-1}
|
|
@@ -385,7 +394,7 @@ const AutosuggestListbox = () => {
|
|
|
385
394
|
<ExampleContainer pseudoState="pseudo-active">
|
|
386
395
|
<Title title="Active suggestion" theme="light" level={4} />
|
|
387
396
|
<Suggestions
|
|
388
|
-
id="
|
|
397
|
+
id="x2"
|
|
389
398
|
value=""
|
|
390
399
|
suggestions={country}
|
|
391
400
|
visualFocusIndex={-1}
|
|
@@ -399,7 +408,7 @@ const AutosuggestListbox = () => {
|
|
|
399
408
|
<ExampleContainer>
|
|
400
409
|
<Title title="Focused suggestion" theme="light" level={4} />
|
|
401
410
|
<Suggestions
|
|
402
|
-
id="
|
|
411
|
+
id="x3"
|
|
403
412
|
value=""
|
|
404
413
|
suggestions={country}
|
|
405
414
|
visualFocusIndex={0}
|
|
@@ -413,7 +422,7 @@ const AutosuggestListbox = () => {
|
|
|
413
422
|
<ExampleContainer>
|
|
414
423
|
<Title title="Highlighted suggestion" theme="light" level={4} />
|
|
415
424
|
<Suggestions
|
|
416
|
-
id="
|
|
425
|
+
id="x4"
|
|
417
426
|
value="Afgh"
|
|
418
427
|
suggestions={country}
|
|
419
428
|
visualFocusIndex={-1}
|
|
@@ -428,7 +437,7 @@ const AutosuggestListbox = () => {
|
|
|
428
437
|
<ExampleContainer>
|
|
429
438
|
<Title title="Autosuggest Error" theme="light" level={3} />
|
|
430
439
|
<Suggestions
|
|
431
|
-
id="
|
|
440
|
+
id="x5"
|
|
432
441
|
value=""
|
|
433
442
|
suggestions={country}
|
|
434
443
|
visualFocusIndex={-1}
|
|
@@ -442,7 +451,7 @@ const AutosuggestListbox = () => {
|
|
|
442
451
|
<ExampleContainer>
|
|
443
452
|
<Title title="Autosuggest Searching message" theme="light" level={3} />
|
|
444
453
|
<Suggestions
|
|
445
|
-
id="
|
|
454
|
+
id="x6"
|
|
446
455
|
value=""
|
|
447
456
|
suggestions={country}
|
|
448
457
|
visualFocusIndex={-1}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|