@dxc-technology/halstack-react 0.0.0-9bd9511 → 0.0.0-9c20370
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 +3 -3
- package/BackgroundColorContext.js +12 -2
- package/HalstackContext.d.ts +1330 -7
- package/HalstackContext.js +84 -67
- package/accordion/Accordion.d.ts +1 -1
- package/accordion/Accordion.js +74 -55
- package/accordion/Accordion.stories.tsx +3 -101
- package/accordion/Accordion.test.js +34 -19
- package/accordion/types.d.ts +4 -16
- package/accordion-group/AccordionGroup.d.ts +4 -3
- package/accordion-group/AccordionGroup.js +49 -42
- package/accordion-group/AccordionGroup.stories.tsx +77 -76
- package/accordion-group/AccordionGroup.test.js +62 -54
- package/accordion-group/AccordionGroupAccordion.d.ts +4 -0
- package/accordion-group/AccordionGroupAccordion.js +43 -0
- package/accordion-group/types.d.ts +6 -18
- package/alert/Alert.js +47 -20
- package/alert/Alert.test.js +46 -29
- package/alert/types.d.ts +3 -3
- package/badge/Badge.js +14 -2
- package/badge/types.d.ts +1 -1
- package/bleed/Bleed.js +21 -13
- package/bleed/Bleed.stories.tsx +1 -0
- package/bleed/types.d.ts +2 -2
- package/box/Box.d.ts +1 -1
- package/box/Box.js +33 -33
- package/box/Box.stories.tsx +25 -53
- package/box/Box.test.js +7 -2
- package/box/types.d.ts +3 -15
- package/bulleted-list/BulletedList.js +36 -9
- package/bulleted-list/BulletedList.stories.tsx +7 -1
- package/bulleted-list/types.d.ts +32 -5
- package/button/Button.d.ts +1 -1
- package/button/Button.js +83 -71
- package/button/Button.stories.tsx +4 -4
- package/button/Button.test.js +28 -8
- package/button/types.d.ts +8 -4
- package/card/Card.d.ts +1 -1
- package/card/Card.js +67 -62
- package/card/Card.stories.tsx +12 -42
- package/card/Card.test.js +22 -11
- package/card/types.d.ts +4 -10
- package/checkbox/Checkbox.js +71 -27
- package/checkbox/Checkbox.test.js +60 -33
- package/checkbox/types.d.ts +4 -4
- package/chip/Chip.js +51 -48
- package/chip/Chip.stories.tsx +25 -17
- package/chip/Chip.test.js +29 -17
- package/chip/types.d.ts +4 -4
- package/common/OpenSans.css +68 -80
- package/common/coreTokens.d.ts +146 -0
- package/common/coreTokens.js +167 -0
- package/common/utils.d.ts +1 -0
- package/common/utils.js +8 -3
- package/common/variables.d.ts +226 -175
- package/common/variables.js +956 -1133
- package/date-input/Calendar.js +55 -12
- package/date-input/DateInput.js +82 -35
- package/date-input/DateInput.test.js +351 -164
- package/date-input/DatePicker.js +38 -8
- package/date-input/Icons.js +12 -0
- package/date-input/YearPicker.js +30 -5
- package/date-input/types.d.ts +7 -7
- package/dialog/Dialog.d.ts +1 -1
- package/dialog/Dialog.js +83 -86
- package/dialog/Dialog.stories.tsx +127 -221
- package/dialog/Dialog.test.js +331 -18
- package/dialog/types.d.ts +1 -14
- package/dropdown/Dropdown.js +86 -32
- package/dropdown/Dropdown.test.js +211 -104
- package/dropdown/DropdownMenu.js +22 -8
- package/dropdown/DropdownMenuItem.js +15 -6
- package/dropdown/types.d.ts +8 -8
- package/file-input/FileInput.js +218 -134
- package/file-input/FileInput.test.js +343 -331
- package/file-input/FileItem.js +39 -12
- package/file-input/types.d.ts +10 -10
- package/flex/Flex.js +39 -25
- package/flex/Flex.stories.tsx +35 -26
- package/flex/types.d.ts +74 -9
- package/footer/Footer.d.ts +1 -1
- package/footer/Footer.js +80 -68
- package/footer/Footer.stories.tsx +12 -89
- package/footer/Footer.test.js +47 -40
- package/footer/Icons.js +4 -0
- package/footer/types.d.ts +15 -17
- package/grid/Grid.d.ts +7 -0
- package/grid/Grid.js +91 -0
- package/grid/Grid.stories.tsx +219 -0
- package/grid/types.d.ts +115 -0
- package/header/Header.d.ts +4 -3
- package/header/Header.js +72 -55
- package/header/Header.stories.tsx +7 -71
- package/header/Header.test.js +26 -13
- package/header/Icons.js +4 -0
- package/header/types.d.ts +2 -16
- package/heading/Heading.js +28 -7
- package/heading/Heading.test.js +88 -71
- package/heading/types.d.ts +3 -3
- package/inset/Inset.js +21 -13
- package/inset/Inset.stories.tsx +2 -1
- package/inset/types.d.ts +2 -2
- package/layout/ApplicationLayout.d.ts +5 -5
- package/layout/ApplicationLayout.js +57 -15
- package/layout/Icons.js +10 -0
- package/layout/SidenavContext.d.ts +1 -1
- package/layout/SidenavContext.js +4 -0
- package/layout/types.d.ts +5 -6
- package/link/Link.js +41 -21
- package/link/Link.test.js +42 -26
- package/link/types.d.ts +4 -4
- package/main.d.ts +2 -1
- package/main.js +55 -0
- package/nav-tabs/NavTabs.d.ts +2 -2
- package/nav-tabs/NavTabs.js +43 -16
- package/nav-tabs/NavTabs.stories.tsx +14 -0
- package/nav-tabs/NavTabs.test.js +44 -37
- package/nav-tabs/Tab.js +71 -45
- package/nav-tabs/types.d.ts +10 -11
- package/number-input/NumberInput.js +30 -20
- package/number-input/NumberInput.test.js +249 -113
- package/number-input/NumberInputContext.js +5 -0
- package/number-input/numberInputContextTypes.d.ts +1 -1
- package/number-input/types.d.ts +4 -4
- package/package.json +7 -7
- package/paginator/Icons.js +10 -0
- package/paginator/Paginator.js +39 -17
- package/paginator/Paginator.test.js +156 -104
- package/paginator/types.d.ts +1 -1
- package/paragraph/Paragraph.d.ts +3 -4
- package/paragraph/Paragraph.js +18 -8
- package/password-input/PasswordInput.js +51 -22
- package/password-input/PasswordInput.test.js +94 -51
- package/password-input/types.d.ts +4 -4
- package/progress-bar/ProgressBar.d.ts +2 -2
- package/progress-bar/ProgressBar.js +39 -14
- package/progress-bar/ProgressBar.test.js +53 -36
- package/progress-bar/types.d.ts +4 -3
- package/quick-nav/QuickNav.js +24 -2
- package/quick-nav/types.d.ts +2 -2
- package/radio-group/Radio.js +53 -22
- package/radio-group/RadioGroup.js +84 -41
- package/radio-group/RadioGroup.test.js +288 -186
- package/radio-group/types.d.ts +4 -4
- package/resultsetTable/Icons.js +3 -0
- package/resultsetTable/ResultsetTable.js +56 -21
- package/resultsetTable/ResultsetTable.test.js +75 -42
- package/resultsetTable/types.d.ts +5 -5
- package/select/Icons.js +3 -0
- package/select/Listbox.js +35 -10
- package/select/Option.js +24 -8
- package/select/Select.js +143 -56
- package/select/Select.test.js +839 -456
- package/select/types.d.ts +12 -12
- package/sidenav/Icons.d.ts +7 -0
- package/sidenav/Icons.js +51 -0
- package/sidenav/Sidenav.d.ts +2 -2
- package/sidenav/Sidenav.js +116 -104
- package/sidenav/Sidenav.stories.tsx +60 -60
- package/sidenav/Sidenav.test.js +10 -3
- package/sidenav/types.d.ts +26 -23
- package/slider/Slider.js +84 -38
- package/slider/Slider.test.js +104 -76
- package/slider/types.d.ts +4 -4
- package/spinner/Spinner.js +51 -28
- package/spinner/Spinner.stories.jsx +28 -28
- package/spinner/Spinner.test.js +35 -26
- package/spinner/types.d.ts +3 -3
- package/switch/Switch.js +66 -24
- package/switch/Switch.test.js +97 -52
- package/switch/types.d.ts +4 -4
- package/table/Table.js +22 -4
- package/table/Table.test.js +7 -2
- package/table/types.d.ts +3 -3
- package/tabs/Tab.js +39 -22
- package/tabs/Tabs.js +131 -62
- package/tabs/Tabs.test.js +122 -67
- package/tabs/types.d.ts +8 -8
- package/tag/Tag.js +54 -27
- package/tag/Tag.test.js +31 -20
- package/tag/types.d.ts +7 -7
- package/text-input/Icons.js +3 -0
- package/text-input/Suggestion.js +24 -8
- package/text-input/Suggestions.js +36 -11
- package/text-input/TextInput.js +144 -59
- package/text-input/TextInput.stories.tsx +1 -1
- package/text-input/TextInput.test.js +858 -539
- package/text-input/types.d.ts +9 -9
- package/textarea/Textarea.js +73 -38
- package/textarea/Textarea.test.js +173 -98
- package/textarea/types.d.ts +4 -4
- package/toggle-group/ToggleGroup.d.ts +2 -2
- package/toggle-group/ToggleGroup.js +59 -21
- package/toggle-group/ToggleGroup.test.js +72 -40
- package/toggle-group/types.d.ts +11 -11
- package/typography/Typography.d.ts +2 -2
- package/typography/Typography.js +23 -110
- package/typography/Typography.stories.tsx +1 -1
- package/typography/types.d.ts +1 -1
- package/useTheme.d.ts +1234 -1
- package/useTheme.js +6 -0
- package/useTranslatedLabels.d.ts +84 -2
- package/useTranslatedLabels.js +5 -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 +138 -0
- package/wizard/Wizard.js +47 -13
- package/wizard/Wizard.test.js +81 -54
- package/wizard/types.d.ts +7 -8
- package/card/ice-cream.jpg +0 -0
- package/translatedLabelsType.d.ts +0 -82
- /package/{translatedLabelsType.js → grid/types.js} +0 -0
package/dropdown/DropdownMenu.js
CHANGED
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports["default"] = void 0;
|
|
9
|
+
|
|
8
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
+
|
|
9
12
|
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
10
14
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
+
|
|
11
16
|
var _DropdownMenuItem = _interopRequireDefault(require("./DropdownMenuItem"));
|
|
17
|
+
|
|
12
18
|
var _templateObject;
|
|
19
|
+
|
|
13
20
|
var DropdownMenu = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
14
21
|
var id = _ref.id,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
dropdownTriggerId = _ref.dropdownTriggerId,
|
|
23
|
+
iconsPosition = _ref.iconsPosition,
|
|
24
|
+
visualFocusIndex = _ref.visualFocusIndex,
|
|
25
|
+
menuItemOnClick = _ref.menuItemOnClick,
|
|
26
|
+
onKeyDown = _ref.onKeyDown,
|
|
27
|
+
options = _ref.options,
|
|
28
|
+
styles = _ref.styles;
|
|
22
29
|
return /*#__PURE__*/_react["default"].createElement(DropdownMenuContainer, {
|
|
23
30
|
onMouseDown: function onMouseDown(event) {
|
|
24
31
|
// Prevent the onBlur event from closing menu when clicking on the menu since
|
|
@@ -45,7 +52,8 @@ var DropdownMenu = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
45
52
|
});
|
|
46
53
|
}));
|
|
47
54
|
});
|
|
48
|
-
|
|
55
|
+
|
|
56
|
+
var DropdownMenuContainer = _styledComponents["default"].ul(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n box-sizing: border-box;\n max-height: 230px;\n min-width: min-content;\n padding: 0;\n margin: 0;\n background-color: ", ";\n border-width: ", ";\n border-style: ", ";\n border-color: ", ";\n border-radius: ", ";\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);\n outline: none;\n\n overflow-y: auto;\n &::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n }\n &::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: 6px;\n }\n &::-webkit-scrollbar-track {\n background-color: ", ";\n border-radius: 6px;\n }\n"])), function (props) {
|
|
49
57
|
return props.theme.optionBackgroundColor;
|
|
50
58
|
}, function (props) {
|
|
51
59
|
return props.theme.borderThickness;
|
|
@@ -55,6 +63,12 @@ var DropdownMenuContainer = _styledComponents["default"].ul(_templateObject || (
|
|
|
55
63
|
return props.theme.borderColor;
|
|
56
64
|
}, function (props) {
|
|
57
65
|
return props.theme.borderRadius;
|
|
66
|
+
}, function (props) {
|
|
67
|
+
return props.theme.scrollBarThumbColor;
|
|
68
|
+
}, function (props) {
|
|
69
|
+
return props.theme.scrollBarTrackColor;
|
|
58
70
|
});
|
|
71
|
+
|
|
59
72
|
var _default = /*#__PURE__*/_react["default"].memo(DropdownMenu);
|
|
73
|
+
|
|
60
74
|
exports["default"] = _default;
|
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports["default"] = void 0;
|
|
9
|
+
|
|
8
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
+
|
|
9
12
|
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
10
14
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
+
|
|
11
16
|
var _templateObject, _templateObject2, _templateObject3;
|
|
17
|
+
|
|
12
18
|
var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
13
19
|
var id = _ref.id,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
visuallyFocused = _ref.visuallyFocused,
|
|
21
|
+
iconPosition = _ref.iconPosition,
|
|
22
|
+
_onClick = _ref.onClick,
|
|
23
|
+
option = _ref.option;
|
|
18
24
|
return /*#__PURE__*/_react["default"].createElement(DropdownMenuItemContainer, {
|
|
19
25
|
visuallyFocused: visuallyFocused,
|
|
20
26
|
onClick: function onClick() {
|
|
@@ -24,13 +30,12 @@ var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
|
24
30
|
role: "menuitem",
|
|
25
31
|
tabIndex: -1
|
|
26
32
|
}, iconPosition === "after" && /*#__PURE__*/_react["default"].createElement(DropdownMenuItemLabel, null, option.label), option.icon && /*#__PURE__*/_react["default"].createElement(DropdownMenuItemIcon, {
|
|
27
|
-
iconPosition: iconPosition,
|
|
28
|
-
label: option.label,
|
|
29
33
|
role: typeof option.icon === "string" ? undefined : "img"
|
|
30
34
|
}, typeof option.icon === "string" ? /*#__PURE__*/_react["default"].createElement("img", {
|
|
31
35
|
src: option.icon
|
|
32
36
|
}) : option.icon), iconPosition === "before" && /*#__PURE__*/_react["default"].createElement(DropdownMenuItemLabel, null, option.label));
|
|
33
37
|
};
|
|
38
|
+
|
|
34
39
|
var DropdownMenuItemContainer = _styledComponents["default"].li(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n box-sizing: border-box;\n display: flex;\n align-items: center;\n gap: ", ";\n min-height: 36px;\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n cursor: pointer;\n\n ", "\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n"])), function (props) {
|
|
35
40
|
return props.theme.optionIconSpacing;
|
|
36
41
|
}, function (props) {
|
|
@@ -48,6 +53,7 @@ var DropdownMenuItemContainer = _styledComponents["default"].li(_templateObject
|
|
|
48
53
|
}, function (props) {
|
|
49
54
|
return props.theme.activeOptionBackgroundColor;
|
|
50
55
|
});
|
|
56
|
+
|
|
51
57
|
var DropdownMenuItemLabel = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: 1.5rem;\n color: ", ";\n white-space: nowrap;\n"])), function (props) {
|
|
52
58
|
return props.theme.optionFontFamily;
|
|
53
59
|
}, function (props) {
|
|
@@ -59,6 +65,7 @@ var DropdownMenuItemLabel = _styledComponents["default"].span(_templateObject2 |
|
|
|
59
65
|
}, function (props) {
|
|
60
66
|
return props.theme.optionFontColor;
|
|
61
67
|
});
|
|
68
|
+
|
|
62
69
|
var DropdownMenuItemIcon = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n color: ", ";\n\n img,\n svg {\n width: ", ";\n height: ", ";\n }\n"])), function (props) {
|
|
63
70
|
return props.theme.optionIconColor;
|
|
64
71
|
}, function (props) {
|
|
@@ -66,5 +73,7 @@ var DropdownMenuItemIcon = _styledComponents["default"].div(_templateObject3 ||
|
|
|
66
73
|
}, function (props) {
|
|
67
74
|
return props.theme.optionIconSize;
|
|
68
75
|
});
|
|
76
|
+
|
|
69
77
|
var _default = /*#__PURE__*/_react["default"].memo(DropdownMenuItem);
|
|
78
|
+
|
|
70
79
|
exports["default"] = _default;
|
package/dropdown/types.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
+
declare type Margin = {
|
|
4
4
|
top?: Space;
|
|
5
5
|
bottom?: Space;
|
|
6
6
|
left?: Space;
|
|
7
7
|
right?: Space;
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
|
|
11
|
-
export type Option = {
|
|
9
|
+
declare type Size = "small" | "medium" | "large" | "fillParent" | "fitContent";
|
|
10
|
+
declare type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
|
|
11
|
+
export declare type Option = {
|
|
12
12
|
/**
|
|
13
13
|
* Option display value.
|
|
14
14
|
*/
|
|
@@ -23,7 +23,7 @@ export type Option = {
|
|
|
23
23
|
*/
|
|
24
24
|
value: string;
|
|
25
25
|
};
|
|
26
|
-
type Props = {
|
|
26
|
+
declare type Props = {
|
|
27
27
|
/**
|
|
28
28
|
* An array of objects representing the options.
|
|
29
29
|
*/
|
|
@@ -78,7 +78,7 @@ type Props = {
|
|
|
78
78
|
*/
|
|
79
79
|
disabled?: boolean;
|
|
80
80
|
};
|
|
81
|
-
export type DropdownMenuProps = {
|
|
81
|
+
export declare type DropdownMenuProps = {
|
|
82
82
|
id: string;
|
|
83
83
|
dropdownTriggerId: string;
|
|
84
84
|
iconsPosition: "before" | "after";
|
|
@@ -90,7 +90,7 @@ export type DropdownMenuProps = {
|
|
|
90
90
|
width: number;
|
|
91
91
|
};
|
|
92
92
|
};
|
|
93
|
-
export type DropdownMenuItemProps = {
|
|
93
|
+
export declare type DropdownMenuItemProps = {
|
|
94
94
|
id: string;
|
|
95
95
|
visuallyFocused: boolean;
|
|
96
96
|
iconPosition: "before" | "after";
|