@dxc-technology/halstack-react 11.0.0 → 12.0.0
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 -142
- package/HalstackContext.js +2 -2
- package/accordion/Accordion.accessibility.test.js +71 -0
- package/accordion/Accordion.js +13 -27
- package/accordion/Accordion.stories.tsx +7 -49
- package/accordion/types.d.ts +1 -1
- package/accordion-group/AccordionGroup.accessibility.test.js +88 -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/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.js +63 -0
- package/action-icon/ActionIcon.d.ts +4 -0
- package/action-icon/ActionIcon.js +48 -0
- package/action-icon/ActionIcon.stories.tsx +41 -0
- package/action-icon/ActionIcon.test.js +64 -0
- package/action-icon/types.d.ts +26 -0
- package/action-icon/types.js +5 -0
- package/alert/Alert.accessibility.test.js +95 -0
- package/alert/Alert.js +21 -75
- 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.js +30 -0
- package/badge/types.d.ts +52 -3
- package/box/Box.accessibility.test.js +33 -0
- package/box/Box.js +2 -5
- 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.js +119 -0
- package/bulleted-list/BulletedList.js +16 -23
- package/bulleted-list/BulletedList.stories.tsx +1 -2
- 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.js +3 -1
- package/button/types.d.ts +1 -1
- package/card/Card.accessibility.test.js +36 -0
- package/card/Card.js +3 -2
- package/checkbox/Checkbox.accessibility.test.js +87 -0
- package/checkbox/Checkbox.js +31 -36
- package/chip/Chip.accessibility.test.js +67 -0
- package/chip/Chip.js +11 -6
- package/chip/Chip.stories.tsx +10 -25
- package/chip/Chip.test.js +4 -4
- package/common/coreTokens.d.ts +105 -14
- package/common/coreTokens.js +40 -22
- package/common/variables.d.ts +31 -138
- package/common/variables.js +103 -210
- package/container/Container.d.ts +4 -0
- package/container/Container.js +194 -0
- package/container/Container.stories.tsx +214 -0
- package/container/types.d.ts +74 -0
- package/container/types.js +5 -0
- package/contextual-menu/ContextualMenu.accessibility.test.js +97 -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.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.js +228 -0
- package/date-input/DateInput.js +4 -5
- package/date-input/DateInput.stories.tsx +15 -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.js +69 -0
- package/dialog/Dialog.js +11 -25
- package/dialog/Dialog.stories.tsx +176 -0
- package/dialog/Dialog.test.js +1 -1
- package/divider/Divider.accessibility.test.js +33 -0
- package/divider/Divider.d.ts +4 -0
- package/divider/Divider.js +36 -0
- package/divider/Divider.stories.tsx +223 -0
- package/divider/Divider.test.js +38 -0
- package/divider/types.d.ts +21 -0
- package/divider/types.js +5 -0
- package/dropdown/Dropdown.accessibility.test.js +180 -0
- package/dropdown/Dropdown.js +26 -39
- package/dropdown/Dropdown.stories.tsx +15 -26
- package/dropdown/Dropdown.test.js +18 -18
- 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.js +160 -0
- package/file-input/FileInput.js +126 -141
- package/file-input/FileInput.test.js +84 -110
- package/file-input/FileItem.js +18 -28
- package/file-input/types.d.ts +1 -1
- 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/Icons.d.ts +1 -0
- package/footer/Icons.js +52 -16
- package/footer/types.d.ts +8 -8
- package/header/Header.accessibility.test.js +93 -0
- package/header/Header.js +20 -41
- package/header/Header.stories.tsx +16 -0
- package/header/Icons.js +1 -6
- package/header/types.d.ts +4 -3
- package/heading/Heading.accessibility.test.js +33 -0
- package/heading/Heading.js +1 -1
- package/icon/Icon.accessibility.test.js +30 -0
- package/icon/Icon.d.ts +4 -0
- package/icon/Icon.js +33 -0
- package/icon/Icon.stories.tsx +28 -0
- package/icon/types.d.ts +4 -0
- package/icon/types.js +5 -0
- package/image/Image.accessibility.test.js +56 -0
- package/image/Image.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.js +108 -0
- package/link/Link.js +8 -6
- package/link/Link.stories.tsx +4 -4
- package/link/types.d.ts +1 -1
- package/main.d.ts +7 -3
- package/main.js +37 -9
- package/nav-tabs/NavTabs.accessibility.test.js +44 -0
- package/nav-tabs/NavTabs.d.ts +1 -2
- package/nav-tabs/NavTabs.js +10 -7
- package/nav-tabs/NavTabs.stories.tsx +29 -24
- package/nav-tabs/NavTabs.test.js +11 -9
- 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.js +228 -0
- package/number-input/NumberInput.d.ts +0 -7
- package/number-input/NumberInput.js +24 -5
- package/number-input/NumberInput.test.js +165 -6
- 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 +16 -14
- package/paginator/Paginator.accessibility.test.js +79 -0
- package/paginator/Paginator.js +14 -14
- package/paragraph/Paragraph.accessibility.test.js +28 -0
- package/paragraph/Paragraph.js +2 -7
- 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.js +4 -4
- package/progress-bar/ProgressBar.accessibility.test.js +35 -0
- package/progress-bar/ProgressBar.js +11 -15
- package/quick-nav/QuickNav.accessibility.test.js +57 -0
- package/quick-nav/QuickNav.js +1 -1
- package/radio-group/Radio.js +1 -1
- package/radio-group/RadioGroup.accessibility.test.js +97 -0
- package/radio-group/RadioGroup.js +3 -2
- 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.js +76 -0
- package/resultset-table/types.d.ts +40 -7
- package/select/Listbox.js +28 -16
- package/select/Option.js +19 -10
- package/select/Select.accessibility.test.js +228 -0
- package/select/Select.js +57 -37
- package/select/Select.stories.tsx +59 -111
- package/select/Select.test.js +387 -456
- package/select/types.d.ts +3 -3
- package/sidenav/Sidenav.accessibility.test.js +59 -0
- package/sidenav/Sidenav.js +21 -19
- package/sidenav/Sidenav.stories.tsx +4 -9
- package/sidenav/types.d.ts +2 -2
- package/slider/Slider.accessibility.test.js +104 -0
- package/slider/Slider.js +40 -48
- package/spinner/Spinner.accessibility.test.js +96 -0
- package/spinner/Spinner.js +12 -16
- package/status-light/StatusLight.accessibility.test.js +157 -0
- package/status-light/StatusLight.d.ts +4 -0
- package/status-light/StatusLight.js +51 -0
- package/status-light/StatusLight.stories.tsx +74 -0
- package/status-light/StatusLight.test.js +25 -0
- package/status-light/types.d.ts +17 -0
- package/status-light/types.js +5 -0
- package/switch/Switch.accessibility.test.js +98 -0
- package/switch/Switch.js +24 -29
- package/switch/Switch.stories.tsx +12 -0
- package/table/DropdownTheme.js +62 -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.js +92 -0
- package/table/types.d.ts +28 -0
- package/tabs/Tab.js +13 -9
- 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.js +19 -37
- package/tabs/types.d.ts +2 -2
- 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.js +4 -12
- 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.js +321 -0
- package/text-input/TextInput.js +84 -105
- package/text-input/TextInput.stories.tsx +17 -8
- package/text-input/TextInput.test.js +96 -79
- package/textarea/Textarea.accessibility.test.js +155 -0
- package/textarea/Textarea.js +12 -17
- package/textarea/Textarea.stories.tsx +0 -1
- package/toggle-group/ToggleGroup.accessibility.test.js +107 -0
- package/toggle-group/ToggleGroup.js +6 -8
- package/toggle-group/ToggleGroup.stories.tsx +3 -3
- package/toggle-group/types.d.ts +2 -2
- package/typography/Typography.accessibility.test.js +339 -0
- package/useTheme.d.ts +31 -138
- package/utils/BaseTypography.js +1 -1
- package/utils/FocusLock.js +16 -6
- package/wizard/Wizard.accessibility.test.js +55 -0
- package/wizard/Wizard.js +14 -25
- package/wizard/Wizard.stories.tsx +19 -0
- 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,16 @@ 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 _Icons = _interopRequireDefault(require("./Icons"));
|
|
23
20
|
var _uuid = require("uuid");
|
|
24
|
-
var
|
|
21
|
+
var _ActionIcon = _interopRequireDefault(require("../action-icon/ActionIcon"));
|
|
22
|
+
var _Flex = _interopRequireDefault(require("../flex/Flex"));
|
|
23
|
+
var _NumberInputContext = require("../number-input/NumberInputContext");
|
|
24
|
+
var _Icon = _interopRequireDefault(require("../icon/Icon"));
|
|
25
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
25
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); }
|
|
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 &&
|
|
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; }
|
|
27
28
|
var sizes = {
|
|
28
29
|
small: "240px",
|
|
29
30
|
medium: "360px",
|
|
@@ -166,8 +167,7 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
166
167
|
var width = useWidth(inputContainerRef.current);
|
|
167
168
|
var colorsTheme = (0, _useTheme["default"])();
|
|
168
169
|
var translatedLabels = (0, _useTranslatedLabels["default"])();
|
|
169
|
-
var
|
|
170
|
-
var numberInputContext = (0, _react.useContext)(_NumberInput.NumberInputContext);
|
|
170
|
+
var numberInputContext = (0, _react.useContext)(_NumberInputContext.NumberInputContext);
|
|
171
171
|
var getNumberErrorMessage = function getNumberErrorMessage(value) {
|
|
172
172
|
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
173
|
};
|
|
@@ -199,6 +199,30 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
199
199
|
value: formattedValue
|
|
200
200
|
});
|
|
201
201
|
};
|
|
202
|
+
var decrementNumber = function decrementNumber() {
|
|
203
|
+
var currentValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : value !== null && value !== void 0 ? value : innerValue;
|
|
204
|
+
if (!disabled && !readOnly) {
|
|
205
|
+
var numberValue = Number(currentValue);
|
|
206
|
+
var steppedValue = Math.round((numberValue - (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) + Number.EPSILON) * 100) / 100;
|
|
207
|
+
if (currentValue !== "") {
|
|
208
|
+
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);
|
|
209
|
+
} else {
|
|
210
|
+
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);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
var incrementNumber = function incrementNumber() {
|
|
215
|
+
var currentValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : value !== null && value !== void 0 ? value : innerValue;
|
|
216
|
+
if (!disabled && !readOnly) {
|
|
217
|
+
var numberValue = Number(currentValue);
|
|
218
|
+
var steppedValue = Math.round((numberValue + (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.stepNumber) + Number.EPSILON) * 100) / 100;
|
|
219
|
+
if (currentValue !== "") {
|
|
220
|
+
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);
|
|
221
|
+
} else {
|
|
222
|
+
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);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
};
|
|
202
226
|
var handleInputContainerOnClick = function handleInputContainerOnClick() {
|
|
203
227
|
document.activeElement !== actionRef.current && inputRef.current.focus();
|
|
204
228
|
};
|
|
@@ -271,6 +295,9 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
271
295
|
break;
|
|
272
296
|
}
|
|
273
297
|
};
|
|
298
|
+
var handleNumberInputWheel = function handleNumberInputWheel(event) {
|
|
299
|
+
if (document.activeElement === inputRef.current) event.deltaY < 0 ? incrementNumber(inputRef.current.value) : decrementNumber(inputRef.current.value);
|
|
300
|
+
};
|
|
274
301
|
var handleClearActionOnClick = function handleClearActionOnClick() {
|
|
275
302
|
changeValue("");
|
|
276
303
|
inputRef.current.focus();
|
|
@@ -291,26 +318,6 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
291
318
|
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.setAttribute("step", step);
|
|
292
319
|
inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : _inputRef$current4.setAttribute("type", type);
|
|
293
320
|
};
|
|
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
321
|
(0, _react.useEffect)(function () {
|
|
315
322
|
if (typeof suggestions === "function") {
|
|
316
323
|
changeIsSearching(true);
|
|
@@ -347,11 +354,9 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
347
354
|
}, label && /*#__PURE__*/_react["default"].createElement(Label, {
|
|
348
355
|
htmlFor: inputId,
|
|
349
356
|
disabled: disabled,
|
|
350
|
-
backgroundType: backgroundType,
|
|
351
357
|
hasHelperText: helperText ? true : false
|
|
352
358
|
}, label, " ", optional && /*#__PURE__*/_react["default"].createElement(OptionalLabel, null, translatedLabels.formFields.optionalLabel)), helperText && /*#__PURE__*/_react["default"].createElement(HelperText, {
|
|
353
|
-
disabled: disabled
|
|
354
|
-
backgroundType: backgroundType
|
|
359
|
+
disabled: disabled
|
|
355
360
|
}, helperText), /*#__PURE__*/_react["default"].createElement(AutosuggestWrapper, {
|
|
356
361
|
condition: hasSuggestions(suggestions),
|
|
357
362
|
wrapper: function wrapper(children) {
|
|
@@ -359,7 +364,10 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
359
364
|
open: isOpen && (filteredSuggestions.length > 0 || isSearching || isAutosuggestError)
|
|
360
365
|
}, /*#__PURE__*/_react["default"].createElement(Popover.Trigger, {
|
|
361
366
|
asChild: true,
|
|
362
|
-
|
|
367
|
+
type: undefined,
|
|
368
|
+
"aria-controls": undefined,
|
|
369
|
+
"aria-haspopup": undefined,
|
|
370
|
+
"aria-expanded": undefined
|
|
363
371
|
}, children), /*#__PURE__*/_react["default"].createElement(Popover.Portal, null, /*#__PURE__*/_react["default"].createElement(Popover.Content, {
|
|
364
372
|
sideOffset: 5,
|
|
365
373
|
style: {
|
|
@@ -394,14 +402,16 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
394
402
|
error: error ? true : false,
|
|
395
403
|
disabled: disabled,
|
|
396
404
|
readOnly: readOnly,
|
|
397
|
-
backgroundType: backgroundType,
|
|
398
405
|
onClick: handleInputContainerOnClick,
|
|
399
406
|
onMouseDown: handleInputContainerOnMouseDown,
|
|
400
407
|
ref: inputContainerRef
|
|
401
408
|
}, prefix && /*#__PURE__*/_react["default"].createElement(Prefix, {
|
|
402
|
-
disabled: disabled
|
|
403
|
-
|
|
404
|
-
|
|
409
|
+
disabled: disabled
|
|
410
|
+
}, prefix), /*#__PURE__*/_react["default"].createElement(_Flex["default"], {
|
|
411
|
+
gap: "0.25rem",
|
|
412
|
+
alignItems: "center",
|
|
413
|
+
grow: 1
|
|
414
|
+
}, /*#__PURE__*/_react["default"].createElement(Input, {
|
|
405
415
|
id: inputId,
|
|
406
416
|
name: name,
|
|
407
417
|
value: value !== null && value !== void 0 ? value : innerValue,
|
|
@@ -413,10 +423,10 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
413
423
|
onMouseDown: function onMouseDown(event) {
|
|
414
424
|
event.stopPropagation();
|
|
415
425
|
},
|
|
426
|
+
onWheel: (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number" ? handleNumberInputWheel : undefined,
|
|
416
427
|
disabled: disabled,
|
|
417
428
|
readOnly: readOnly,
|
|
418
429
|
ref: inputRef,
|
|
419
|
-
backgroundType: backgroundType,
|
|
420
430
|
pattern: pattern,
|
|
421
431
|
minLength: minLength,
|
|
422
432
|
maxLength: maxLength,
|
|
@@ -433,62 +443,40 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
433
443
|
"aria-errormessage": error ? errorId : undefined,
|
|
434
444
|
"aria-required": !disabled && !optional
|
|
435
445
|
}), !disabled && error && /*#__PURE__*/_react["default"].createElement(ErrorIcon, {
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
446
|
+
"aria-hidden": "true"
|
|
447
|
+
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
448
|
+
icon: "filled_error"
|
|
449
|
+
})), !disabled && !readOnly && clearable && (value !== null && value !== void 0 ? value : innerValue).length > 0 && /*#__PURE__*/_react["default"].createElement(_ActionIcon["default"], {
|
|
440
450
|
onClick: handleClearActionOnClick,
|
|
441
|
-
|
|
442
|
-
event.stopPropagation();
|
|
443
|
-
},
|
|
451
|
+
icon: "close",
|
|
444
452
|
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,
|
|
453
|
+
title: translatedLabels.textInput.clearFieldActionTitle
|
|
454
|
+
}), (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
455
|
onClick: !readOnly ? handleDecrementActionOnClick : undefined,
|
|
452
|
-
|
|
453
|
-
event.stopPropagation();
|
|
454
|
-
},
|
|
455
|
-
ref: actionRef,
|
|
456
|
+
icon: "remove",
|
|
456
457
|
tabIndex: tabIndex,
|
|
458
|
+
ref: actionRef,
|
|
457
459
|
title: translatedLabels.numberInput.decrementValueTitle,
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
}, _Icons["default"].decrement), /*#__PURE__*/_react["default"].createElement(Action, {
|
|
461
|
-
"aria-label": translatedLabels.numberInput.incrementValueTitle,
|
|
462
|
-
disabled: disabled,
|
|
460
|
+
disabled: disabled
|
|
461
|
+
}), /*#__PURE__*/_react["default"].createElement(_ActionIcon["default"], {
|
|
463
462
|
onClick: !readOnly ? handleIncrementActionOnClick : undefined,
|
|
464
|
-
|
|
465
|
-
event.stopPropagation();
|
|
466
|
-
},
|
|
467
|
-
ref: actionRef,
|
|
463
|
+
icon: "add",
|
|
468
464
|
tabIndex: tabIndex,
|
|
465
|
+
ref: actionRef,
|
|
469
466
|
title: translatedLabels.numberInput.incrementValueTitle,
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
}, _Icons["default"].increment)), action && /*#__PURE__*/_react["default"].createElement(Action, {
|
|
473
|
-
"aria-label": action.title,
|
|
474
|
-
disabled: disabled,
|
|
467
|
+
disabled: disabled
|
|
468
|
+
})), action && /*#__PURE__*/_react["default"].createElement(_ActionIcon["default"], {
|
|
475
469
|
onClick: !readOnly ? action.onClick : undefined,
|
|
476
|
-
|
|
477
|
-
event.stopPropagation();
|
|
478
|
-
},
|
|
479
|
-
ref: actionRef,
|
|
470
|
+
icon: action.icon,
|
|
480
471
|
tabIndex: tabIndex,
|
|
472
|
+
ref: actionRef,
|
|
481
473
|
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
|
|
474
|
+
disabled: disabled
|
|
475
|
+
})), suffix && /*#__PURE__*/_react["default"].createElement(Suffix, {
|
|
476
|
+
disabled: disabled
|
|
489
477
|
}, suffix))), !disabled && typeof error === "string" && /*#__PURE__*/_react["default"].createElement(Error, {
|
|
490
478
|
id: errorId,
|
|
491
|
-
|
|
479
|
+
role: "alert",
|
|
492
480
|
"aria-live": error ? "assertive" : "off"
|
|
493
481
|
}, error)));
|
|
494
482
|
});
|
|
@@ -506,7 +494,7 @@ var TextInputContainer = _styledComponents["default"].div(_templateObject || (_t
|
|
|
506
494
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
507
495
|
});
|
|
508
496
|
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.
|
|
497
|
+
return props.disabled ? props.theme.disabledLabelFontColor : props.theme.labelFontColor;
|
|
510
498
|
}, function (props) {
|
|
511
499
|
return props.theme.fontFamily;
|
|
512
500
|
}, function (props) {
|
|
@@ -523,8 +511,8 @@ var Label = _styledComponents["default"].label(_templateObject2 || (_templateObj
|
|
|
523
511
|
var OptionalLabel = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n font-weight: ", ";\n"])), function (props) {
|
|
524
512
|
return props.theme.optionalLabelFontWeight;
|
|
525
513
|
});
|
|
526
|
-
var HelperText = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n
|
|
527
|
-
return props.disabled ? props.
|
|
514
|
+
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) {
|
|
515
|
+
return props.disabled ? props.theme.disabledHelperTextFontColor : props.theme.helperTextFontColor;
|
|
528
516
|
}, function (props) {
|
|
529
517
|
return props.theme.fontFamily;
|
|
530
518
|
}, function (props) {
|
|
@@ -537,16 +525,16 @@ var HelperText = _styledComponents["default"].span(_templateObject4 || (_templat
|
|
|
537
525
|
return props.theme.helperTextLineHeight;
|
|
538
526
|
});
|
|
539
527
|
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
|
|
528
|
+
if (props.disabled) return "background-color: ".concat(props.theme.disabledContainerFillColor, ";");
|
|
541
529
|
}, function (props) {
|
|
542
|
-
if (props.disabled) return props.
|
|
530
|
+
if (props.disabled) return props.theme.disabledBorderColor;else if (props.readOnly) return props.theme.readOnlyBorderColor;else return props.theme.enabledBorderColor;
|
|
543
531
|
}, function (props) {
|
|
544
|
-
return props.error && !props.disabled && "border-color: transparent;\n box-shadow: 0 0 0 2px ".concat(props.
|
|
532
|
+
return props.error && !props.disabled && "border-color: transparent;\n box-shadow: 0 0 0 2px ".concat(props.theme.errorBorderColor, ";\n ");
|
|
545
533
|
}, function (props) {
|
|
546
|
-
return !props.disabled ? "\n &:hover {\n border-color: ".concat(props.error ? "transparent" : props.readOnly ? props.theme.hoverReadOnlyBorderColor : props.
|
|
534
|
+
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
535
|
});
|
|
548
536
|
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.
|
|
537
|
+
return props.disabled ? props.theme.disabledValueFontColor : props.theme.valueFontColor;
|
|
550
538
|
}, function (props) {
|
|
551
539
|
return props.theme.fontFamily;
|
|
552
540
|
}, function (props) {
|
|
@@ -558,34 +546,25 @@ var Input = _styledComponents["default"].input(_templateObject6 || (_templateObj
|
|
|
558
546
|
}, function (props) {
|
|
559
547
|
return props.disabled && "cursor: not-allowed;";
|
|
560
548
|
}, 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 ");
|
|
549
|
+
return props.disabled ? props.theme.disabledPlaceholderFontColor : props.theme.placeholderFontColor;
|
|
571
550
|
});
|
|
572
|
-
var Prefix = _styledComponents["default"].span(
|
|
573
|
-
var color = props.disabled ? props.
|
|
551
|
+
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) {
|
|
552
|
+
var color = props.disabled ? props.theme.disabledPrefixColor : props.theme.prefixColor;
|
|
574
553
|
return "color: ".concat(color, "; border-right: 1px solid ").concat(color, ";");
|
|
575
554
|
}, function (props) {
|
|
576
555
|
return props.theme.fontFamily;
|
|
577
556
|
});
|
|
578
|
-
var Suffix = _styledComponents["default"].span(
|
|
579
|
-
var color = props.disabled ? props.
|
|
557
|
+
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) {
|
|
558
|
+
var color = props.disabled ? props.theme.disabledSuffixColor : props.theme.suffixColor;
|
|
580
559
|
return "color: ".concat(color, "; border-left: 1px solid ").concat(color, ";");
|
|
581
560
|
}, function (props) {
|
|
582
561
|
return props.theme.fontFamily;
|
|
583
562
|
});
|
|
584
|
-
var ErrorIcon = _styledComponents["default"].span(
|
|
585
|
-
return props.
|
|
563
|
+
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) {
|
|
564
|
+
return props.theme.errorIconColor;
|
|
586
565
|
});
|
|
587
|
-
var Error = _styledComponents["default"].span(
|
|
588
|
-
return props.
|
|
566
|
+
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) {
|
|
567
|
+
return props.theme.errorMessageColor;
|
|
589
568
|
}, function (props) {
|
|
590
569
|
return props.theme.fontFamily;
|
|
591
570
|
});
|
|
@@ -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}
|