@dxc-technology/halstack-react 0.0.0-da90bf9 → 0.0.0-da9270d
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 -0
- package/BackgroundColorContext.js +8 -24
- package/HalstackContext.d.ts +1235 -0
- package/HalstackContext.js +310 -0
- package/README.md +47 -0
- package/accordion/Accordion.d.ts +4 -0
- package/accordion/Accordion.js +120 -291
- package/accordion/Accordion.stories.tsx +283 -0
- package/accordion/Accordion.test.js +56 -0
- package/accordion/types.d.ts +57 -0
- package/accordion/types.js +5 -0
- package/accordion-group/AccordionGroup.d.ts +8 -0
- package/accordion-group/AccordionGroup.js +57 -142
- package/accordion-group/AccordionGroup.stories.tsx +252 -0
- package/accordion-group/AccordionGroup.test.js +98 -0
- package/accordion-group/AccordionGroupAccordion.d.ts +4 -0
- package/accordion-group/AccordionGroupAccordion.js +31 -0
- package/accordion-group/types.d.ts +67 -0
- package/accordion-group/types.js +5 -0
- package/alert/Alert.d.ts +4 -0
- package/alert/Alert.js +55 -204
- package/alert/Alert.stories.tsx +198 -0
- package/alert/Alert.test.js +75 -0
- package/alert/types.d.ts +49 -0
- package/alert/types.js +5 -0
- package/badge/Badge.d.ts +4 -0
- package/badge/Badge.js +15 -30
- package/badge/types.d.ts +5 -0
- package/badge/types.js +5 -0
- package/bleed/Bleed.d.ts +3 -0
- package/bleed/Bleed.js +43 -0
- package/bleed/Bleed.stories.tsx +342 -0
- package/bleed/types.d.ts +37 -0
- package/bleed/types.js +5 -0
- package/box/Box.d.ts +4 -0
- package/box/Box.js +35 -116
- package/box/Box.stories.tsx +119 -0
- package/box/Box.test.js +13 -0
- package/box/types.d.ts +32 -0
- package/box/types.js +5 -0
- package/bulleted-list/BulletedList.d.ts +7 -0
- package/bulleted-list/BulletedList.js +89 -0
- package/bulleted-list/BulletedList.stories.tsx +115 -0
- package/bulleted-list/types.d.ts +38 -0
- package/bulleted-list/types.js +5 -0
- package/button/Button.d.ts +4 -0
- package/button/Button.js +67 -185
- package/button/Button.stories.tsx +344 -0
- package/button/Button.test.js +36 -0
- package/button/types.d.ts +57 -0
- package/button/types.js +5 -0
- package/card/Card.d.ts +4 -0
- package/card/Card.js +60 -194
- package/card/Card.stories.tsx +171 -0
- package/card/Card.test.js +39 -0
- package/card/types.d.ts +62 -0
- package/card/types.js +5 -0
- package/checkbox/Checkbox.d.ts +4 -0
- package/checkbox/Checkbox.js +147 -231
- package/checkbox/Checkbox.stories.tsx +222 -0
- package/checkbox/Checkbox.test.js +199 -0
- package/checkbox/types.d.ts +72 -0
- package/checkbox/types.js +5 -0
- package/chip/Chip.d.ts +4 -0
- package/chip/Chip.js +50 -194
- package/chip/Chip.stories.tsx +214 -0
- package/chip/Chip.test.js +41 -0
- package/chip/types.d.ts +45 -0
- package/chip/types.js +5 -0
- package/common/OpenSans.css +68 -80
- package/common/coreTokens.d.ts +237 -0
- package/common/coreTokens.js +184 -0
- package/common/utils.d.ts +1 -0
- package/common/utils.js +6 -12
- package/common/variables.d.ts +1381 -0
- package/common/variables.js +1006 -1319
- 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/date-input/Calendar.d.ts +4 -0
- package/date-input/Calendar.js +214 -0
- package/date-input/DateInput.d.ts +4 -0
- package/date-input/DateInput.js +179 -356
- package/date-input/DateInput.stories.tsx +285 -0
- package/date-input/DateInput.test.js +808 -0
- package/date-input/DatePicker.d.ts +4 -0
- package/date-input/DatePicker.js +115 -0
- package/date-input/Icons.d.ts +6 -0
- package/date-input/Icons.js +58 -0
- package/date-input/YearPicker.d.ts +4 -0
- package/date-input/YearPicker.js +100 -0
- package/date-input/types.d.ts +164 -0
- package/date-input/types.js +5 -0
- package/dialog/Dialog.d.ts +4 -0
- package/dialog/Dialog.js +70 -184
- package/dialog/Dialog.stories.tsx +365 -0
- package/dialog/Dialog.test.js +307 -0
- package/dialog/types.d.ts +36 -0
- package/dialog/types.js +5 -0
- package/dropdown/Dropdown.d.ts +4 -0
- package/dropdown/Dropdown.js +247 -457
- package/dropdown/Dropdown.stories.tsx +438 -0
- package/dropdown/Dropdown.test.js +599 -0
- package/dropdown/DropdownMenu.d.ts +4 -0
- package/dropdown/DropdownMenu.js +63 -0
- package/dropdown/DropdownMenuItem.d.ts +4 -0
- package/dropdown/DropdownMenuItem.js +67 -0
- package/dropdown/types.d.ts +98 -0
- package/dropdown/types.js +5 -0
- package/file-input/FileInput.d.ts +4 -0
- package/file-input/FileInput.js +297 -462
- package/file-input/FileInput.stories.tsx +618 -0
- package/file-input/FileInput.test.js +459 -0
- package/file-input/FileItem.d.ts +4 -0
- package/file-input/FileItem.js +61 -213
- package/file-input/types.d.ts +129 -0
- package/file-input/types.js +5 -0
- package/flex/Flex.d.ts +4 -0
- package/flex/Flex.js +57 -0
- package/flex/Flex.stories.tsx +112 -0
- package/flex/types.d.ts +97 -0
- package/flex/types.js +5 -0
- package/footer/Footer.d.ts +4 -0
- package/footer/Footer.js +64 -360
- package/footer/Footer.stories.tsx +152 -0
- package/footer/Footer.test.js +85 -0
- package/footer/Icons.d.ts +2 -0
- package/footer/Icons.js +16 -21
- package/footer/types.d.ts +58 -0
- package/footer/types.js +5 -0
- package/grid/Grid.d.ts +7 -0
- package/grid/Grid.js +76 -0
- package/grid/Grid.stories.tsx +219 -0
- package/grid/types.d.ts +115 -0
- package/grid/types.js +5 -0
- package/header/Header.d.ts +8 -0
- package/header/Header.js +122 -372
- package/header/Header.stories.tsx +251 -0
- package/header/Header.test.js +66 -0
- package/header/Icons.d.ts +2 -0
- package/header/Icons.js +9 -39
- package/header/types.d.ts +33 -0
- package/header/types.js +5 -0
- package/heading/Heading.d.ts +4 -0
- package/heading/Heading.js +31 -124
- package/heading/Heading.stories.tsx +54 -0
- package/heading/Heading.test.js +169 -0
- package/heading/types.d.ts +33 -0
- package/heading/types.js +5 -0
- package/image/Image.d.ts +4 -0
- package/image/Image.js +70 -0
- package/image/Image.stories.tsx +127 -0
- package/image/types.d.ts +72 -0
- package/image/types.js +5 -0
- package/inset/Inset.d.ts +3 -0
- package/inset/Inset.js +43 -0
- package/inset/Inset.stories.tsx +230 -0
- package/inset/types.d.ts +37 -0
- package/inset/types.js +5 -0
- package/layout/ApplicationLayout.d.ts +20 -0
- package/layout/ApplicationLayout.js +85 -278
- package/layout/ApplicationLayout.stories.tsx +162 -0
- package/layout/Icons.d.ts +8 -0
- package/layout/Icons.js +51 -48
- package/layout/SidenavContext.d.ts +5 -0
- package/layout/SidenavContext.js +13 -0
- package/layout/types.d.ts +41 -0
- package/layout/types.js +5 -0
- package/link/Link.d.ts +4 -0
- package/link/Link.js +67 -189
- package/link/Link.stories.tsx +253 -0
- package/link/Link.test.js +63 -0
- package/link/types.d.ts +54 -0
- package/link/types.js +5 -0
- package/main.d.ts +46 -40
- package/main.js +117 -140
- package/nav-tabs/NavTabs.d.ts +8 -0
- package/nav-tabs/NavTabs.js +90 -0
- package/nav-tabs/NavTabs.stories.tsx +274 -0
- package/nav-tabs/NavTabs.test.js +75 -0
- package/nav-tabs/Tab.d.ts +4 -0
- package/nav-tabs/Tab.js +117 -0
- package/nav-tabs/types.d.ts +52 -0
- package/nav-tabs/types.js +5 -0
- package/number-input/NumberInput.d.ts +11 -0
- package/number-input/NumberInput.js +32 -101
- package/number-input/NumberInput.stories.tsx +131 -0
- package/number-input/NumberInput.test.js +830 -0
- package/number-input/types.d.ts +130 -0
- package/number-input/types.js +5 -0
- package/package.json +53 -49
- package/paginator/Icons.d.ts +5 -0
- package/paginator/Icons.js +26 -52
- package/paginator/Paginator.d.ts +4 -0
- package/paginator/Paginator.js +41 -211
- package/paginator/Paginator.stories.tsx +87 -0
- package/paginator/Paginator.test.js +335 -0
- package/paginator/types.d.ts +38 -0
- package/paginator/types.js +5 -0
- package/paragraph/Paragraph.d.ts +5 -0
- package/paragraph/Paragraph.js +22 -0
- package/paragraph/Paragraph.stories.tsx +27 -0
- package/password-input/Icons.d.ts +6 -0
- package/password-input/Icons.js +35 -0
- package/password-input/PasswordInput.d.ts +4 -0
- package/password-input/PasswordInput.js +66 -172
- package/password-input/PasswordInput.stories.tsx +99 -0
- package/password-input/PasswordInput.test.js +198 -0
- package/password-input/types.d.ts +111 -0
- package/password-input/types.js +5 -0
- package/progress-bar/ProgressBar.d.ts +4 -0
- package/progress-bar/ProgressBar.js +76 -174
- package/progress-bar/ProgressBar.stories.tsx +93 -0
- package/progress-bar/ProgressBar.test.js +93 -0
- package/progress-bar/types.d.ts +37 -0
- package/progress-bar/types.js +5 -0
- package/quick-nav/QuickNav.d.ts +4 -0
- package/quick-nav/QuickNav.js +94 -0
- package/quick-nav/QuickNav.stories.tsx +356 -0
- package/quick-nav/types.d.ts +21 -0
- package/quick-nav/types.js +5 -0
- package/radio-group/Radio.d.ts +4 -0
- package/radio-group/Radio.js +124 -0
- package/radio-group/RadioGroup.d.ts +4 -0
- package/radio-group/RadioGroup.js +235 -0
- package/radio-group/RadioGroup.stories.tsx +214 -0
- package/radio-group/RadioGroup.test.js +756 -0
- package/radio-group/types.d.ts +114 -0
- package/radio-group/types.js +5 -0
- package/resultset-table/Icons.d.ts +7 -0
- package/resultset-table/Icons.js +47 -0
- package/resultset-table/ResultsetTable.d.ts +4 -0
- package/resultset-table/ResultsetTable.js +159 -0
- package/resultset-table/ResultsetTable.stories.tsx +300 -0
- package/resultset-table/ResultsetTable.test.js +305 -0
- package/resultset-table/types.d.ts +67 -0
- package/resultset-table/types.js +5 -0
- package/select/Icons.d.ts +10 -0
- package/select/Icons.js +89 -0
- package/select/Listbox.d.ts +4 -0
- package/select/Listbox.js +143 -0
- package/select/Option.d.ts +4 -0
- package/select/Option.js +80 -0
- package/select/Select.d.ts +4 -0
- package/select/Select.js +294 -849
- package/select/Select.stories.tsx +971 -0
- package/select/Select.test.js +2370 -0
- package/select/types.d.ts +209 -0
- package/select/types.js +5 -0
- package/sidenav/Icons.d.ts +7 -0
- package/sidenav/Icons.js +47 -0
- package/sidenav/Sidenav.d.ts +10 -0
- package/sidenav/Sidenav.js +134 -117
- package/sidenav/Sidenav.stories.tsx +282 -0
- package/sidenav/Sidenav.test.js +37 -0
- package/sidenav/types.d.ts +76 -0
- package/sidenav/types.js +5 -0
- package/slider/Slider.d.ts +4 -0
- package/slider/Slider.js +172 -291
- package/slider/Slider.test.js +254 -0
- package/slider/types.d.ts +86 -0
- package/slider/types.js +5 -0
- package/spinner/Spinner.d.ts +4 -0
- package/spinner/Spinner.js +66 -241
- package/spinner/Spinner.stories.tsx +129 -0
- package/spinner/Spinner.test.js +55 -0
- package/spinner/types.d.ts +32 -0
- package/spinner/types.js +5 -0
- package/switch/Switch.d.ts +4 -0
- package/switch/Switch.js +153 -161
- package/switch/Switch.stories.tsx +137 -0
- package/switch/Switch.test.js +180 -0
- package/switch/types.d.ts +66 -0
- package/switch/types.js +5 -0
- package/table/Table.d.ts +4 -0
- package/table/Table.js +14 -50
- package/table/Table.stories.tsx +356 -0
- package/table/Table.test.js +21 -0
- package/table/types.d.ts +21 -0
- package/table/types.js +5 -0
- package/tabs/Tab.d.ts +4 -0
- package/tabs/Tab.js +113 -0
- package/tabs/Tabs.d.ts +4 -0
- package/tabs/Tabs.js +322 -281
- package/tabs/Tabs.stories.tsx +226 -0
- package/tabs/Tabs.test.js +294 -0
- package/tabs/types.d.ts +92 -0
- package/tabs/types.js +5 -0
- package/tag/Tag.d.ts +4 -0
- package/tag/Tag.js +61 -192
- package/tag/Tag.stories.tsx +155 -0
- package/tag/Tag.test.js +49 -0
- package/tag/types.d.ts +69 -0
- package/tag/types.js +5 -0
- package/text-input/Icons.d.ts +8 -0
- package/text-input/Icons.js +56 -0
- package/text-input/Suggestion.d.ts +4 -0
- package/text-input/Suggestion.js +67 -0
- package/text-input/Suggestions.d.ts +4 -0
- package/text-input/Suggestions.js +84 -0
- package/text-input/TextInput.d.ts +4 -0
- package/text-input/TextInput.js +360 -757
- package/text-input/TextInput.stories.tsx +465 -0
- package/text-input/TextInput.test.js +1739 -0
- package/text-input/types.d.ts +205 -0
- package/text-input/types.js +5 -0
- package/textarea/Textarea.d.ts +4 -0
- package/textarea/Textarea.js +105 -240
- package/textarea/Textarea.stories.tsx +174 -0
- package/textarea/Textarea.test.js +406 -0
- package/textarea/types.d.ts +141 -0
- package/textarea/types.js +5 -0
- package/toggle-group/ToggleGroup.d.ts +4 -0
- package/toggle-group/ToggleGroup.js +107 -233
- package/toggle-group/ToggleGroup.stories.tsx +218 -0
- package/toggle-group/ToggleGroup.test.js +137 -0
- package/toggle-group/types.d.ts +114 -0
- package/toggle-group/types.js +5 -0
- package/typography/Typography.d.ts +4 -0
- package/typography/Typography.js +23 -0
- package/typography/Typography.stories.tsx +198 -0
- package/typography/types.d.ts +18 -0
- package/typography/types.js +5 -0
- package/useTheme.d.ts +1134 -0
- package/useTheme.js +4 -11
- package/useTranslatedLabels.d.ts +85 -0
- package/useTranslatedLabels.js +14 -0
- package/utils/BaseTypography.d.ts +21 -0
- package/utils/BaseTypography.js +94 -0
- package/utils/FocusLock.d.ts +13 -0
- package/utils/FocusLock.js +121 -0
- package/wizard/Wizard.d.ts +4 -0
- package/wizard/Wizard.js +138 -293
- package/wizard/Wizard.stories.tsx +253 -0
- package/wizard/Wizard.test.js +114 -0
- package/wizard/types.d.ts +64 -0
- package/wizard/types.js +5 -0
- package/ThemeContext.js +0 -250
- package/V3Select/V3Select.js +0 -549
- package/V3Select/index.d.ts +0 -27
- package/V3Textarea/V3Textarea.js +0 -264
- package/V3Textarea/index.d.ts +0 -27
- package/accordion/index.d.ts +0 -28
- package/accordion-group/index.d.ts +0 -16
- package/alert/index.d.ts +0 -51
- package/box/index.d.ts +0 -25
- package/button/Button.stories.js +0 -27
- package/button/index.d.ts +0 -24
- package/card/index.d.ts +0 -22
- package/checkbox/index.d.ts +0 -24
- package/chip/index.d.ts +0 -22
- package/common/RequiredComponent.js +0 -40
- package/date/Date.js +0 -379
- package/date/index.d.ts +0 -27
- package/date-input/index.d.ts +0 -95
- package/dialog/index.d.ts +0 -18
- package/dropdown/index.d.ts +0 -26
- package/file-input/index.d.ts +0 -81
- package/footer/index.d.ts +0 -25
- package/header/index.d.ts +0 -25
- package/heading/index.d.ts +0 -17
- package/input-text/Icons.js +0 -22
- package/input-text/InputText.js +0 -705
- package/input-text/index.d.ts +0 -36
- package/link/index.d.ts +0 -23
- package/number-input/NumberInputContext.js +0 -16
- package/number-input/index.d.ts +0 -113
- package/paginator/index.d.ts +0 -20
- package/password-input/index.d.ts +0 -94
- package/progress-bar/index.d.ts +0 -18
- package/radio/Radio.js +0 -209
- package/radio/index.d.ts +0 -23
- package/resultsetTable/ResultsetTable.js +0 -358
- package/resultsetTable/index.d.ts +0 -19
- package/select/index.d.ts +0 -131
- package/sidenav/index.d.ts +0 -13
- package/slider/index.d.ts +0 -29
- package/spinner/index.d.ts +0 -17
- package/switch/index.d.ts +0 -24
- package/table/index.d.ts +0 -13
- package/tabs/index.d.ts +0 -19
- package/tag/index.d.ts +0 -24
- package/text-input/index.d.ts +0 -135
- package/textarea/index.d.ts +0 -117
- package/toggle/Toggle.js +0 -220
- package/toggle/index.d.ts +0 -21
- package/toggle-group/index.d.ts +0 -21
- package/upload/Upload.js +0 -205
- package/upload/buttons-upload/ButtonsUpload.js +0 -135
- package/upload/buttons-upload/Icons.js +0 -40
- package/upload/dragAndDropArea/DragAndDropArea.js +0 -329
- package/upload/dragAndDropArea/Icons.js +0 -39
- package/upload/file-upload/FileToUpload.js +0 -189
- package/upload/file-upload/Icons.js +0 -66
- package/upload/files-upload/FilesToUpload.js +0 -123
- package/upload/index.d.ts +0 -15
- package/upload/transaction/Icons.js +0 -160
- package/upload/transaction/Transaction.js +0 -148
- package/upload/transactions/Transactions.js +0 -138
- package/wizard/Icons.js +0 -65
- package/wizard/index.d.ts +0 -18
|
@@ -1,85 +1,56 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
-
|
|
7
|
+
exports["default"] = exports.NumberInputContext = void 0;
|
|
12
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
|
-
|
|
14
9
|
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
|
|
16
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
-
|
|
18
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
19
|
-
|
|
20
11
|
var _TextInput = _interopRequireDefault(require("../text-input/TextInput"));
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
48
|
-
_ref$optional = _ref.optional,
|
|
49
|
-
optional = _ref$optional === void 0 ? false : _ref$optional,
|
|
50
|
-
_ref$prefix = _ref.prefix,
|
|
51
|
-
prefix = _ref$prefix === void 0 ? "" : _ref$prefix,
|
|
52
|
-
_ref$suffix = _ref.suffix,
|
|
53
|
-
suffix = _ref$suffix === void 0 ? "" : _ref$suffix,
|
|
54
|
-
min = _ref.min,
|
|
55
|
-
max = _ref.max,
|
|
56
|
-
step = _ref.step,
|
|
57
|
-
onChange = _ref.onChange,
|
|
58
|
-
onBlur = _ref.onBlur,
|
|
59
|
-
_ref$error = _ref.error,
|
|
60
|
-
error = _ref$error === void 0 ? "" : _ref$error,
|
|
61
|
-
_ref$autocomplete = _ref.autocomplete,
|
|
62
|
-
autocomplete = _ref$autocomplete === void 0 ? "off" : _ref$autocomplete,
|
|
63
|
-
margin = _ref.margin,
|
|
64
|
-
_ref$size = _ref.size,
|
|
65
|
-
size = _ref$size === void 0 ? "medium" : _ref$size,
|
|
66
|
-
_ref$tabIndex = _ref.tabIndex,
|
|
67
|
-
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
68
|
-
return _react["default"].createElement(_NumberInputContext["default"].Provider, {
|
|
12
|
+
var _templateObject;
|
|
13
|
+
var NumberInputContext = exports.NumberInputContext = /*#__PURE__*/_react["default"].createContext(null);
|
|
14
|
+
var DxcNumberInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
15
|
+
var label = _ref.label,
|
|
16
|
+
name = _ref.name,
|
|
17
|
+
defaultValue = _ref.defaultValue,
|
|
18
|
+
value = _ref.value,
|
|
19
|
+
helperText = _ref.helperText,
|
|
20
|
+
placeholder = _ref.placeholder,
|
|
21
|
+
disabled = _ref.disabled,
|
|
22
|
+
optional = _ref.optional,
|
|
23
|
+
readOnly = _ref.readOnly,
|
|
24
|
+
prefix = _ref.prefix,
|
|
25
|
+
suffix = _ref.suffix,
|
|
26
|
+
min = _ref.min,
|
|
27
|
+
max = _ref.max,
|
|
28
|
+
_ref$step = _ref.step,
|
|
29
|
+
step = _ref$step === void 0 ? 1 : _ref$step,
|
|
30
|
+
onChange = _ref.onChange,
|
|
31
|
+
onBlur = _ref.onBlur,
|
|
32
|
+
error = _ref.error,
|
|
33
|
+
autocomplete = _ref.autocomplete,
|
|
34
|
+
margin = _ref.margin,
|
|
35
|
+
size = _ref.size,
|
|
36
|
+
tabIndex = _ref.tabIndex;
|
|
37
|
+
return /*#__PURE__*/_react["default"].createElement(NumberInputContext.Provider, {
|
|
69
38
|
value: {
|
|
70
39
|
typeNumber: "number",
|
|
71
40
|
minNumber: min,
|
|
72
41
|
maxNumber: max,
|
|
73
42
|
stepNumber: step
|
|
74
43
|
}
|
|
75
|
-
}, _react["default"].createElement(NumberInputContainer, null, _react["default"].createElement(_TextInput["default"], {
|
|
44
|
+
}, /*#__PURE__*/_react["default"].createElement(NumberInputContainer, null, /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
76
45
|
label: label,
|
|
77
46
|
name: name,
|
|
47
|
+
defaultValue: defaultValue,
|
|
78
48
|
value: value,
|
|
79
49
|
helperText: helperText,
|
|
80
50
|
placeholder: placeholder,
|
|
81
51
|
disabled: disabled,
|
|
82
52
|
optional: optional,
|
|
53
|
+
readOnly: readOnly,
|
|
83
54
|
prefix: prefix,
|
|
84
55
|
suffix: suffix,
|
|
85
56
|
error: error,
|
|
@@ -92,45 +63,5 @@ var DxcNumberInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
92
63
|
ref: ref
|
|
93
64
|
})));
|
|
94
65
|
});
|
|
95
|
-
|
|
96
|
-
var
|
|
97
|
-
small: "240px",
|
|
98
|
-
medium: "360px",
|
|
99
|
-
large: "480px",
|
|
100
|
-
fillParent: "100%"
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
var NumberInputContainer = _styledComponents["default"].div(_templateObject());
|
|
104
|
-
|
|
105
|
-
DxcNumberInput.propTypes = {
|
|
106
|
-
label: _propTypes["default"].string,
|
|
107
|
-
name: _propTypes["default"].string,
|
|
108
|
-
value: _propTypes["default"].string,
|
|
109
|
-
helperText: _propTypes["default"].string,
|
|
110
|
-
placeholder: _propTypes["default"].string,
|
|
111
|
-
error: _propTypes["default"].string,
|
|
112
|
-
disabled: _propTypes["default"].bool,
|
|
113
|
-
optional: _propTypes["default"].bool,
|
|
114
|
-
prefix: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].shape({
|
|
115
|
-
type: _propTypes["default"].oneOf(["svg"])
|
|
116
|
-
})]),
|
|
117
|
-
suffix: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].shape({
|
|
118
|
-
type: _propTypes["default"].oneOf(["svg"])
|
|
119
|
-
})]),
|
|
120
|
-
min: _propTypes["default"].number,
|
|
121
|
-
max: _propTypes["default"].number,
|
|
122
|
-
step: _propTypes["default"].number,
|
|
123
|
-
onChange: _propTypes["default"].func,
|
|
124
|
-
onBlur: _propTypes["default"].func,
|
|
125
|
-
autocomplete: _propTypes["default"].string,
|
|
126
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
127
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
128
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
129
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
130
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
131
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
132
|
-
size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
|
|
133
|
-
tabIndex: _propTypes["default"].number
|
|
134
|
-
};
|
|
135
|
-
var _default = DxcNumberInput;
|
|
136
|
-
exports["default"] = _default;
|
|
66
|
+
var NumberInputContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n // Chrome, Safari, Edge, Opera\n input::-webkit-outer-spin-button,\n input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n // Firefox\n input[type=\"number\"] {\n -moz-appearance: textfield;\n }\n"])));
|
|
67
|
+
var _default = exports["default"] = DxcNumberInput;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Title from "../../.storybook/components/Title";
|
|
3
|
+
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
4
|
+
import DxcNumberInput from "./NumberInput";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Number Input",
|
|
8
|
+
component: DxcNumberInput,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Chromatic = () => (
|
|
12
|
+
<>
|
|
13
|
+
<ExampleContainer>
|
|
14
|
+
<Title title="Without label" theme="light" level={4} />
|
|
15
|
+
<DxcNumberInput />
|
|
16
|
+
</ExampleContainer>
|
|
17
|
+
<ExampleContainer>
|
|
18
|
+
<Title title="With label and placeholder" theme="light" level={4} />
|
|
19
|
+
<DxcNumberInput label="Number input" placeholder="Placeholder" />
|
|
20
|
+
</ExampleContainer>
|
|
21
|
+
<ExampleContainer>
|
|
22
|
+
<Title title="Helper text, optional and value" theme="light" level={4} />
|
|
23
|
+
<DxcNumberInput label="Number input" defaultValue="12" helperText="Help message" optional />
|
|
24
|
+
</ExampleContainer>
|
|
25
|
+
<ExampleContainer>
|
|
26
|
+
<Title title="Disabled and placeholder" theme="light" level={4} />
|
|
27
|
+
<DxcNumberInput label="Disabled number input" disabled placeholder="Placeholder" />
|
|
28
|
+
</ExampleContainer>
|
|
29
|
+
<ExampleContainer>
|
|
30
|
+
<Title title="Disabled, helper text, optional and value" theme="light" level={4} />
|
|
31
|
+
<DxcNumberInput label="Disabled number input" helperText="Help message" disabled optional defaultValue="10" />
|
|
32
|
+
</ExampleContainer>
|
|
33
|
+
<ExampleContainer>
|
|
34
|
+
<Title title="Read only" theme="light" level={4} />
|
|
35
|
+
<DxcNumberInput
|
|
36
|
+
label="Example label"
|
|
37
|
+
helperText="Help message"
|
|
38
|
+
readOnly
|
|
39
|
+
optional
|
|
40
|
+
prefix="€"
|
|
41
|
+
defaultValue="33"
|
|
42
|
+
/>
|
|
43
|
+
</ExampleContainer>
|
|
44
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
45
|
+
<Title title="Hovered read only" theme="light" level={4} />
|
|
46
|
+
<DxcNumberInput
|
|
47
|
+
label="Example label"
|
|
48
|
+
helperText="Help message"
|
|
49
|
+
readOnly
|
|
50
|
+
optional
|
|
51
|
+
prefix="€"
|
|
52
|
+
defaultValue="1"
|
|
53
|
+
/>
|
|
54
|
+
</ExampleContainer>
|
|
55
|
+
<ExampleContainer pseudoState="pseudo-active">
|
|
56
|
+
<Title title="Active read only" theme="light" level={4} />
|
|
57
|
+
<DxcNumberInput
|
|
58
|
+
label="Example label"
|
|
59
|
+
helperText="Help message"
|
|
60
|
+
readOnly
|
|
61
|
+
optional
|
|
62
|
+
prefix="€"
|
|
63
|
+
placeholder="Placeholder"
|
|
64
|
+
/>
|
|
65
|
+
</ExampleContainer>
|
|
66
|
+
<ExampleContainer>
|
|
67
|
+
<Title title="Prefix" theme="light" level={4} />
|
|
68
|
+
<DxcNumberInput label="With prefix" prefix="+34" />
|
|
69
|
+
</ExampleContainer>
|
|
70
|
+
<ExampleContainer>
|
|
71
|
+
<Title title="Suffix" theme="light" level={4} />
|
|
72
|
+
<DxcNumberInput label="With suffix" suffix="USD" />
|
|
73
|
+
</ExampleContainer>
|
|
74
|
+
<ExampleContainer>
|
|
75
|
+
<Title title="Invalid" theme="light" level={4} />
|
|
76
|
+
<DxcNumberInput
|
|
77
|
+
label="Error number input"
|
|
78
|
+
helperText="Help message"
|
|
79
|
+
error="Error message."
|
|
80
|
+
defaultValue="23"
|
|
81
|
+
optional
|
|
82
|
+
/>
|
|
83
|
+
</ExampleContainer>
|
|
84
|
+
<Title title="Margins" theme="light" level={2} />
|
|
85
|
+
<ExampleContainer>
|
|
86
|
+
<Title title="Xxsmall margin" theme="light" level={4} />
|
|
87
|
+
<DxcNumberInput label="Xxsmall" margin="xxsmall" />
|
|
88
|
+
</ExampleContainer>
|
|
89
|
+
<ExampleContainer>
|
|
90
|
+
<Title title="Xsmall margin" theme="light" level={4} />
|
|
91
|
+
<DxcNumberInput label="Xsmall" margin="xsmall" />
|
|
92
|
+
</ExampleContainer>
|
|
93
|
+
<ExampleContainer>
|
|
94
|
+
<Title title="Small margin" theme="light" level={4} />
|
|
95
|
+
<DxcNumberInput label="Small" margin="small" />
|
|
96
|
+
</ExampleContainer>
|
|
97
|
+
<ExampleContainer>
|
|
98
|
+
<Title title="Medium margin" theme="light" level={4} />
|
|
99
|
+
<DxcNumberInput label="Medium" margin="medium" />
|
|
100
|
+
</ExampleContainer>
|
|
101
|
+
<ExampleContainer>
|
|
102
|
+
<Title title="Large margin" theme="light" level={4} />
|
|
103
|
+
<DxcNumberInput label="Large" margin="large" />
|
|
104
|
+
</ExampleContainer>
|
|
105
|
+
<ExampleContainer>
|
|
106
|
+
<Title title="Xlarge margin" theme="light" level={4} />
|
|
107
|
+
<DxcNumberInput label="Xlarge" margin="xlarge" />
|
|
108
|
+
</ExampleContainer>
|
|
109
|
+
<ExampleContainer>
|
|
110
|
+
<Title title="Xxlarge margin" theme="light" level={4} />
|
|
111
|
+
<DxcNumberInput label="Xxlarge" margin="xxlarge" />
|
|
112
|
+
</ExampleContainer>
|
|
113
|
+
<Title title="Sizes" theme="light" level={2} />
|
|
114
|
+
<ExampleContainer>
|
|
115
|
+
<Title title="Small size" theme="light" level={4} />
|
|
116
|
+
<DxcNumberInput label="Small" size="small" />
|
|
117
|
+
</ExampleContainer>
|
|
118
|
+
<ExampleContainer>
|
|
119
|
+
<Title title="Medium size" theme="light" level={4} />
|
|
120
|
+
<DxcNumberInput label="Medium" size="medium" />
|
|
121
|
+
</ExampleContainer>
|
|
122
|
+
<ExampleContainer>
|
|
123
|
+
<Title title="Large size" theme="light" level={4} />
|
|
124
|
+
<DxcNumberInput label="Large" size="large" />
|
|
125
|
+
</ExampleContainer>
|
|
126
|
+
<ExampleContainer>
|
|
127
|
+
<Title title="FillParent size" theme="light" level={4} />
|
|
128
|
+
<DxcNumberInput label="FillParent" size="fillParent" />
|
|
129
|
+
</ExampleContainer>
|
|
130
|
+
</>
|
|
131
|
+
);
|