@dxc-technology/halstack-react 0.0.0-d30020b → 0.0.0-d3ac293
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 +2 -2
- package/BackgroundColorContext.js +1 -1
- package/HalstackContext.d.ts +1336 -0
- package/HalstackContext.js +335 -0
- package/accordion/Accordion.d.ts +1 -1
- package/accordion/Accordion.js +118 -126
- package/accordion/Accordion.stories.tsx +115 -27
- package/accordion/Accordion.test.js +71 -0
- package/accordion/types.d.ts +9 -4
- package/accordion-group/AccordionGroup.d.ts +1 -1
- package/accordion-group/AccordionGroup.js +17 -38
- package/accordion-group/AccordionGroup.stories.tsx +28 -2
- package/accordion-group/AccordionGroup.test.js +126 -0
- package/accordion-group/types.d.ts +14 -3
- package/alert/Alert.js +7 -4
- package/alert/Alert.stories.tsx +28 -0
- package/alert/Alert.test.js +92 -0
- package/badge/Badge.d.ts +4 -0
- package/badge/Badge.js +5 -3
- package/badge/types.d.ts +5 -0
- package/bleed/Bleed.js +1 -34
- package/bleed/Bleed.stories.tsx +94 -95
- package/bleed/types.d.ts +25 -1
- package/box/Box.js +25 -37
- package/box/Box.stories.tsx +15 -0
- package/box/Box.test.js +18 -0
- package/box/types.d.ts +1 -0
- package/bulleted-list/BulletedList.d.ts +7 -0
- package/bulleted-list/BulletedList.js +123 -0
- package/bulleted-list/BulletedList.stories.tsx +200 -0
- package/bulleted-list/types.d.ts +11 -0
- package/button/Button.js +52 -69
- package/button/Button.stories.tsx +159 -8
- package/button/Button.test.js +35 -0
- package/button/types.d.ts +7 -7
- package/card/Card.js +25 -28
- package/card/Card.test.js +50 -0
- package/card/types.d.ts +1 -0
- package/checkbox/Checkbox.d.ts +2 -2
- package/checkbox/Checkbox.js +107 -110
- package/checkbox/Checkbox.stories.tsx +198 -130
- package/checkbox/Checkbox.test.js +155 -0
- package/checkbox/types.d.ts +13 -5
- package/chip/Chip.js +18 -24
- package/chip/Chip.stories.tsx +96 -9
- package/chip/Chip.test.js +54 -0
- package/chip/types.d.ts +1 -1
- package/common/utils.d.ts +1 -0
- package/common/utils.js +4 -4
- package/common/variables.d.ts +1625 -0
- package/common/variables.js +476 -583
- package/date-input/Calendar.d.ts +4 -0
- package/date-input/Calendar.js +258 -0
- package/date-input/DateInput.js +169 -258
- package/date-input/DateInput.stories.tsx +199 -33
- package/date-input/DateInput.test.js +835 -0
- package/date-input/DatePicker.d.ts +4 -0
- package/date-input/DatePicker.js +146 -0
- package/date-input/Icons.d.ts +6 -0
- package/date-input/Icons.js +75 -0
- package/date-input/YearPicker.d.ts +4 -0
- package/date-input/YearPicker.js +126 -0
- package/date-input/types.d.ts +67 -9
- package/dialog/Dialog.js +76 -93
- package/dialog/Dialog.stories.tsx +230 -123
- package/dialog/Dialog.test.js +369 -0
- package/dialog/types.d.ts +3 -2
- package/dropdown/Dropdown.d.ts +1 -1
- package/dropdown/Dropdown.js +246 -253
- package/dropdown/Dropdown.stories.tsx +245 -56
- package/dropdown/Dropdown.test.js +586 -0
- package/dropdown/DropdownMenu.d.ts +4 -0
- package/dropdown/DropdownMenu.js +70 -0
- package/dropdown/DropdownMenuItem.d.ts +4 -0
- package/dropdown/DropdownMenuItem.js +81 -0
- package/dropdown/types.d.ts +25 -5
- package/file-input/FileInput.d.ts +2 -2
- package/file-input/FileInput.js +181 -223
- package/file-input/FileInput.stories.tsx +122 -11
- package/file-input/FileInput.test.js +457 -0
- package/file-input/FileItem.d.ts +4 -14
- package/file-input/FileItem.js +44 -66
- package/file-input/types.d.ts +17 -0
- package/flex/Flex.d.ts +4 -0
- package/flex/Flex.js +69 -0
- package/flex/Flex.stories.tsx +103 -0
- package/flex/types.d.ts +32 -0
- package/footer/Footer.js +16 -89
- package/footer/Footer.stories.tsx +99 -1
- package/footer/Footer.test.js +97 -0
- package/footer/Icons.js +1 -1
- package/footer/types.d.ts +2 -1
- package/header/Header.js +108 -129
- package/header/Header.stories.tsx +189 -36
- package/header/Header.test.js +79 -0
- package/header/Icons.js +2 -2
- package/header/types.d.ts +3 -2
- package/heading/Heading.js +1 -1
- package/heading/Heading.test.js +186 -0
- package/inset/Inset.js +1 -34
- package/inset/Inset.stories.tsx +36 -36
- package/inset/types.d.ts +25 -1
- package/layout/ApplicationLayout.d.ts +16 -6
- package/layout/ApplicationLayout.js +72 -132
- package/layout/ApplicationLayout.stories.tsx +84 -93
- package/layout/Icons.d.ts +5 -0
- package/layout/Icons.js +13 -2
- package/layout/SidenavContext.d.ts +5 -0
- package/layout/SidenavContext.js +19 -0
- package/layout/types.d.ts +18 -33
- package/link/Link.d.ts +3 -2
- package/link/Link.js +59 -76
- package/link/Link.stories.tsx +155 -53
- package/link/Link.test.js +81 -0
- package/link/types.d.ts +7 -23
- package/main.d.ts +10 -15
- package/main.js +48 -82
- package/nav-tabs/NavTabs.d.ts +8 -0
- package/nav-tabs/NavTabs.js +125 -0
- package/nav-tabs/NavTabs.stories.tsx +260 -0
- package/nav-tabs/NavTabs.test.js +82 -0
- package/nav-tabs/Tab.d.ts +4 -0
- package/nav-tabs/Tab.js +150 -0
- package/nav-tabs/types.d.ts +53 -0
- package/number-input/NumberInput.js +11 -18
- package/number-input/NumberInput.stories.tsx +5 -5
- package/number-input/NumberInput.test.js +542 -0
- package/number-input/types.d.ts +17 -10
- package/package.json +20 -23
- package/paginator/Icons.d.ts +5 -0
- package/paginator/Icons.js +16 -28
- package/paginator/Paginator.js +19 -46
- package/paginator/Paginator.stories.tsx +24 -0
- package/paginator/Paginator.test.js +305 -0
- package/paragraph/Paragraph.d.ts +6 -0
- package/paragraph/Paragraph.js +38 -0
- package/paragraph/Paragraph.stories.tsx +44 -0
- package/password-input/PasswordInput.js +7 -4
- package/password-input/PasswordInput.test.js +181 -0
- package/password-input/types.d.ts +14 -11
- package/progress-bar/ProgressBar.d.ts +2 -2
- package/progress-bar/ProgressBar.js +61 -55
- package/progress-bar/ProgressBar.stories.jsx +47 -12
- package/progress-bar/ProgressBar.test.js +110 -0
- package/progress-bar/types.d.ts +3 -4
- package/quick-nav/QuickNav.d.ts +4 -0
- package/quick-nav/QuickNav.js +117 -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 +1 -1
- package/radio-group/Radio.js +53 -37
- package/radio-group/RadioGroup.js +67 -57
- package/radio-group/RadioGroup.stories.tsx +171 -36
- package/radio-group/RadioGroup.test.js +563 -89
- package/radio-group/types.d.ts +82 -4
- package/resultsetTable/Icons.d.ts +7 -0
- package/resultsetTable/Icons.js +51 -0
- package/resultsetTable/ResultsetTable.js +49 -108
- package/resultsetTable/ResultsetTable.stories.tsx +50 -25
- package/resultsetTable/ResultsetTable.test.js +325 -0
- package/resultsetTable/types.d.ts +2 -2
- package/select/Icons.d.ts +10 -0
- package/select/Icons.js +93 -0
- package/select/Listbox.d.ts +4 -0
- package/select/Listbox.js +169 -0
- package/select/Option.d.ts +4 -0
- package/select/Option.js +97 -0
- package/select/Select.js +185 -384
- package/select/Select.stories.tsx +600 -201
- package/select/Select.test.js +2228 -0
- package/select/types.d.ts +53 -13
- package/sidenav/Sidenav.d.ts +6 -5
- package/sidenav/Sidenav.js +183 -53
- package/sidenav/Sidenav.stories.tsx +249 -149
- package/sidenav/Sidenav.test.js +44 -0
- package/sidenav/types.d.ts +50 -27
- package/slider/Slider.d.ts +2 -2
- package/slider/Slider.js +124 -98
- package/slider/Slider.stories.tsx +72 -9
- package/slider/Slider.test.js +250 -0
- package/slider/types.d.ts +10 -2
- package/spinner/Spinner.js +4 -4
- package/spinner/Spinner.stories.jsx +27 -1
- package/spinner/Spinner.test.js +64 -0
- package/switch/Switch.d.ts +2 -2
- package/switch/Switch.js +152 -69
- package/switch/Switch.stories.tsx +53 -42
- package/switch/Switch.test.js +225 -0
- package/switch/types.d.ts +12 -4
- package/table/Table.js +3 -3
- package/table/Table.stories.jsx +80 -1
- package/table/Table.test.js +26 -0
- package/tabs/Tab.d.ts +4 -0
- package/tabs/Tab.js +133 -0
- package/tabs/Tabs.d.ts +1 -1
- package/tabs/Tabs.js +363 -109
- package/tabs/Tabs.stories.tsx +119 -13
- package/tabs/Tabs.test.js +350 -0
- package/tabs/types.d.ts +19 -5
- package/tag/Tag.js +17 -22
- package/tag/Tag.stories.tsx +25 -8
- package/tag/Tag.test.js +60 -0
- package/tag/types.d.ts +1 -1
- package/text-input/Icons.d.ts +8 -0
- package/text-input/Icons.js +60 -0
- package/text-input/Suggestion.d.ts +4 -0
- package/text-input/Suggestion.js +84 -0
- package/text-input/Suggestions.d.ts +4 -0
- package/text-input/Suggestions.js +134 -0
- package/text-input/TextInput.js +224 -345
- package/text-input/TextInput.stories.tsx +310 -197
- package/text-input/TextInput.test.js +1723 -0
- package/text-input/types.d.ts +50 -12
- package/textarea/Textarea.js +22 -29
- package/textarea/Textarea.stories.jsx +93 -13
- package/textarea/Textarea.test.js +437 -0
- package/textarea/types.d.ts +18 -11
- package/toggle-group/ToggleGroup.d.ts +1 -1
- package/toggle-group/ToggleGroup.js +6 -5
- package/toggle-group/ToggleGroup.stories.tsx +46 -4
- package/toggle-group/ToggleGroup.test.js +156 -0
- package/toggle-group/types.d.ts +9 -1
- package/typography/Typography.d.ts +4 -0
- package/typography/Typography.js +32 -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 +1234 -1
- package/useTheme.js +3 -3
- package/useTranslatedLabels.d.ts +85 -0
- package/useTranslatedLabels.js +20 -0
- package/utils/BaseTypography.d.ts +21 -0
- package/utils/BaseTypography.js +108 -0
- package/utils/FocusLock.d.ts +13 -0
- package/utils/FocusLock.js +139 -0
- package/wizard/Wizard.d.ts +1 -1
- package/wizard/Wizard.js +59 -55
- package/wizard/Wizard.stories.tsx +48 -19
- package/wizard/Wizard.test.js +141 -0
- package/wizard/types.d.ts +10 -5
- package/ThemeContext.d.ts +0 -15
- package/ThemeContext.js +0 -243
- package/V3Select/V3Select.js +0 -455
- package/V3Select/index.d.ts +0 -27
- package/V3Textarea/V3Textarea.js +0 -260
- package/V3Textarea/index.d.ts +0 -27
- package/common/RequiredComponent.js +0 -32
- package/date/Date.js +0 -373
- package/date/index.d.ts +0 -27
- package/input-text/Icons.js +0 -22
- package/input-text/InputText.js +0 -611
- package/input-text/index.d.ts +0 -36
- package/list/List.d.ts +0 -4
- package/list/List.js +0 -47
- package/list/List.stories.tsx +0 -95
- package/list/types.d.ts +0 -7
- package/radio/Radio.d.ts +0 -4
- package/radio/Radio.js +0 -174
- package/radio/Radio.stories.tsx +0 -192
- package/radio/types.d.ts +0 -54
- package/row/Row.d.ts +0 -3
- package/row/Row.js +0 -127
- package/row/Row.stories.tsx +0 -237
- package/row/types.d.ts +0 -10
- package/stack/Stack.d.ts +0 -3
- package/stack/Stack.js +0 -97
- package/stack/Stack.stories.tsx +0 -164
- package/stack/types.d.ts +0 -9
- package/text/Text.d.ts +0 -7
- package/text/Text.js +0 -30
- package/text/Text.stories.tsx +0 -19
- package/toggle/Toggle.js +0 -186
- package/toggle/index.d.ts +0 -21
- package/upload/Upload.js +0 -201
- package/upload/buttons-upload/ButtonsUpload.js +0 -111
- package/upload/buttons-upload/Icons.js +0 -40
- package/upload/dragAndDropArea/DragAndDropArea.js +0 -225
- package/upload/dragAndDropArea/Icons.js +0 -39
- package/upload/file-upload/FileToUpload.js +0 -115
- package/upload/file-upload/Icons.js +0 -66
- package/upload/files-upload/FilesToUpload.js +0 -109
- package/upload/index.d.ts +0 -15
- package/upload/transaction/Icons.js +0 -160
- package/upload/transaction/Transaction.js +0 -104
- package/upload/transactions/Transactions.js +0 -94
- /package/{list → badge}/types.js +0 -0
- /package/{radio → bulleted-list}/types.js +0 -0
- /package/{row → flex}/types.js +0 -0
- /package/{stack → nav-tabs}/types.js +0 -0
package/select/Option.js
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
+
|
|
16
|
+
var _Checkbox = _interopRequireDefault(require("../checkbox/Checkbox"));
|
|
17
|
+
|
|
18
|
+
var _Icons = _interopRequireDefault(require("./Icons"));
|
|
19
|
+
|
|
20
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
21
|
+
|
|
22
|
+
var Option = function Option(_ref) {
|
|
23
|
+
var id = _ref.id,
|
|
24
|
+
option = _ref.option,
|
|
25
|
+
_onClick = _ref.onClick,
|
|
26
|
+
multiple = _ref.multiple,
|
|
27
|
+
visualFocused = _ref.visualFocused,
|
|
28
|
+
_ref$isGroupedOption = _ref.isGroupedOption,
|
|
29
|
+
isGroupedOption = _ref$isGroupedOption === void 0 ? false : _ref$isGroupedOption,
|
|
30
|
+
isLastOption = _ref.isLastOption,
|
|
31
|
+
isSelected = _ref.isSelected;
|
|
32
|
+
return /*#__PURE__*/_react["default"].createElement(OptionItem, {
|
|
33
|
+
id: id,
|
|
34
|
+
onClick: function onClick() {
|
|
35
|
+
_onClick(option);
|
|
36
|
+
},
|
|
37
|
+
visualFocused: visualFocused,
|
|
38
|
+
selected: isSelected,
|
|
39
|
+
role: "option",
|
|
40
|
+
"aria-selected": isSelected
|
|
41
|
+
}, /*#__PURE__*/_react["default"].createElement(StyledOption, {
|
|
42
|
+
visualFocused: visualFocused,
|
|
43
|
+
selected: isSelected,
|
|
44
|
+
last: isLastOption,
|
|
45
|
+
grouped: isGroupedOption,
|
|
46
|
+
multiple: multiple
|
|
47
|
+
}, multiple && /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
|
|
48
|
+
checked: isSelected,
|
|
49
|
+
tabIndex: -1
|
|
50
|
+
}), option.icon && /*#__PURE__*/_react["default"].createElement(OptionIcon, {
|
|
51
|
+
grouped: isGroupedOption,
|
|
52
|
+
multiple: multiple,
|
|
53
|
+
role: !(typeof option.icon === "string") ? "img" : undefined
|
|
54
|
+
}, typeof option.icon === "string" ? /*#__PURE__*/_react["default"].createElement("img", {
|
|
55
|
+
src: option.icon
|
|
56
|
+
}) : option.icon), /*#__PURE__*/_react["default"].createElement(OptionContent, {
|
|
57
|
+
grouped: isGroupedOption,
|
|
58
|
+
hasIcon: option.icon ? true : false,
|
|
59
|
+
multiple: multiple
|
|
60
|
+
}, /*#__PURE__*/_react["default"].createElement(OptionLabel, null, option.label), !multiple && isSelected && /*#__PURE__*/_react["default"].createElement(OptionSelectedIndicator, null, _Icons["default"].selected))));
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
var OptionItem = _styledComponents["default"].li(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n padding: 0 0.5rem;\n box-shadow: inset 0 0 0 2px transparent;\n ", "\n ", ";\n line-height: 1.715em;\n cursor: pointer;\n\n &:hover {\n ", ";\n }\n &:active {\n ", ";\n }\n"])), function (props) {
|
|
64
|
+
return props.visualFocused && "box-shadow: inset 0 0 0 2px ".concat(props.theme.focusListOptionBorderColor, ";");
|
|
65
|
+
}, function (props) {
|
|
66
|
+
return props.selected && "background-color: ".concat(props.theme.selectedListOptionBackgroundColor);
|
|
67
|
+
}, function (props) {
|
|
68
|
+
return props.selected ? "background-color: ".concat(props.theme.selectedHoverListOptionBackgroundColor, ";") : "background-color: ".concat(props.theme.unselectedHoverListOptionBackgroundColor, ";");
|
|
69
|
+
}, function (props) {
|
|
70
|
+
return props.selected ? "background-color: ".concat(props.theme.selectedActiveListOptionBackgroundColor, ";") : "background-color: ".concat(props.theme.unselectedActiveListOptionBackgroundColor, ";");
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
var StyledOption = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: 0.25rem 0.5rem 0.188rem 0;\n min-height: 24px;\n ", "\n ", ";\n"])), function (props) {
|
|
74
|
+
return props.grouped && props.multiple && "padding-left: 16px;";
|
|
75
|
+
}, function (props) {
|
|
76
|
+
return props.last || props.visualFocused || props.selected ? "border-bottom: 1px solid transparent" : "border-bottom: 1px solid ".concat(props.theme.listOptionDividerColor);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
var OptionIcon = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: 0.125rem;\n margin-left: ", ";\n color: ", ";\n\n svg,\n img {\n height: 20px;\n width: 20px;\n }\n"])), function (props) {
|
|
80
|
+
return props.grouped && !props.multiple ? "16px" : "8px";
|
|
81
|
+
}, function (props) {
|
|
82
|
+
return props.theme.listOptionIconColor;
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
var OptionContent = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: space-between;\n gap: 0.25rem;\n width: 100%;\n overflow: hidden;\n margin-left: ", ";\n"])), function (props) {
|
|
86
|
+
return props.grouped && !props.multiple && !props.hasIcon ? "16px" : "8px";
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
var OptionLabel = _styledComponents["default"].span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"])));
|
|
90
|
+
|
|
91
|
+
var OptionSelectedIndicator = _styledComponents["default"].span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n color: ", ";\n\n svg {\n width: 16px;\n height: 16px;\n }\n"])), function (props) {
|
|
92
|
+
return props.theme.selectedListOptionIconColor;
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
var _default = /*#__PURE__*/_react["default"].memo(Option);
|
|
96
|
+
|
|
97
|
+
exports["default"] = _default;
|