@dxc-technology/halstack-react 0.0.0-c593452 → 0.0.0-c680086
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 +10 -0
- package/BackgroundColorContext.js +1 -4
- package/ThemeContext.d.ts +15 -0
- package/ThemeContext.js +5 -8
- package/V3Select/V3Select.js +2 -2
- package/V3Textarea/V3Textarea.js +2 -2
- package/accordion/Accordion.d.ts +1 -1
- package/accordion/Accordion.js +11 -22
- package/accordion/Accordion.stories.tsx +307 -0
- package/accordion/types.d.ts +4 -8
- package/accordion-group/AccordionGroup.js +2 -2
- package/accordion-group/AccordionGroup.stories.tsx +225 -0
- package/accordion-group/types.d.ts +4 -8
- package/alert/Alert.js +2 -2
- package/alert/Alert.stories.tsx +170 -0
- package/alert/types.d.ts +1 -1
- package/badge/Badge.js +1 -1
- package/bleed/Bleed.d.ts +3 -0
- package/bleed/Bleed.js +84 -0
- package/bleed/Bleed.stories.tsx +342 -0
- package/bleed/types.d.ts +13 -0
- package/bleed/types.js +5 -0
- package/box/Box.d.ts +4 -0
- package/box/Box.js +6 -32
- package/box/Box.stories.tsx +132 -0
- package/box/types.d.ts +43 -0
- package/box/types.js +5 -0
- package/button/Button.d.ts +1 -1
- package/button/Button.js +15 -26
- package/button/Button.stories.tsx +223 -242
- package/button/types.d.ts +9 -13
- package/card/Card.js +5 -6
- package/card/Card.stories.tsx +201 -0
- package/card/ice-cream.jpg +0 -0
- package/card/types.d.ts +4 -6
- package/checkbox/Checkbox.js +2 -2
- package/checkbox/Checkbox.stories.tsx +192 -0
- package/checkbox/types.d.ts +2 -2
- package/chip/Chip.d.ts +4 -0
- package/chip/Chip.js +16 -76
- package/chip/Chip.stories.tsx +119 -0
- package/chip/types.d.ts +45 -0
- package/chip/types.js +5 -0
- package/common/variables.js +86 -44
- package/date/Date.js +1 -1
- package/date-input/DateInput.js +10 -13
- package/date-input/DateInput.stories.tsx +138 -0
- package/dialog/Dialog.d.ts +4 -0
- package/dialog/Dialog.js +8 -26
- package/dialog/Dialog.stories.tsx +212 -0
- package/dialog/types.d.ts +43 -0
- package/dialog/types.js +5 -0
- package/dropdown/Dropdown.d.ts +1 -1
- package/dropdown/Dropdown.js +13 -35
- package/dropdown/Dropdown.stories.tsx +249 -0
- package/dropdown/types.d.ts +6 -15
- package/file-input/FileInput.d.ts +4 -0
- package/file-input/FileInput.js +167 -109
- package/file-input/FileInput.stories.tsx +507 -0
- package/file-input/FileItem.d.ts +14 -0
- package/file-input/FileItem.js +12 -21
- package/file-input/types.d.ts +112 -0
- package/file-input/types.js +5 -0
- package/footer/Footer.d.ts +4 -0
- package/footer/Footer.js +31 -70
- package/footer/Footer.stories.tsx +130 -0
- package/footer/Icons.d.ts +2 -0
- package/footer/Icons.js +3 -3
- package/footer/types.d.ts +65 -0
- package/footer/types.js +5 -0
- package/header/Header.d.ts +7 -0
- package/header/Header.js +28 -30
- package/header/Header.stories.tsx +162 -0
- package/header/Icons.d.ts +2 -0
- package/header/Icons.js +2 -27
- package/header/types.d.ts +47 -0
- package/header/types.js +5 -0
- package/heading/Heading.d.ts +4 -0
- package/heading/Heading.js +7 -24
- package/heading/Heading.stories.tsx +54 -0
- package/heading/types.d.ts +33 -0
- package/heading/types.js +5 -0
- package/input-text/InputText.js +2 -2
- package/inset/Inset.d.ts +3 -0
- package/inset/Inset.js +84 -0
- package/inset/Inset.stories.tsx +229 -0
- package/inset/types.d.ts +13 -0
- package/inset/types.js +5 -0
- package/layout/ApplicationLayout.d.ts +10 -0
- package/layout/ApplicationLayout.js +9 -19
- package/layout/ApplicationLayout.stories.tsx +171 -0
- package/layout/types.d.ts +57 -0
- package/layout/types.js +5 -0
- package/link/Link.d.ts +3 -0
- package/link/Link.js +10 -40
- package/link/Link.stories.tsx +151 -0
- package/link/types.d.ts +70 -0
- package/link/types.js +5 -0
- package/list/List.d.ts +4 -0
- package/list/List.js +47 -0
- package/list/List.stories.tsx +95 -0
- package/list/types.d.ts +7 -0
- package/list/types.js +5 -0
- package/main.d.ts +8 -3
- package/main.js +42 -2
- package/number-input/NumberInput.d.ts +4 -0
- package/number-input/NumberInput.js +5 -50
- package/number-input/NumberInput.stories.tsx +115 -0
- package/number-input/NumberInputContext.d.ts +4 -0
- package/number-input/NumberInputContext.js +5 -2
- package/number-input/numberInputContextTypes.d.ts +19 -0
- package/number-input/numberInputContextTypes.js +5 -0
- package/number-input/types.d.ts +117 -0
- package/number-input/types.js +5 -0
- package/package.json +4 -2
- package/paginator/Paginator.js +2 -8
- package/paginator/Paginator.stories.tsx +63 -0
- package/password-input/PasswordInput.d.ts +4 -0
- package/password-input/PasswordInput.js +19 -55
- package/password-input/{PasswordInput.stories.jsx → PasswordInput.stories.tsx} +4 -4
- package/password-input/types.d.ts +107 -0
- package/password-input/types.js +5 -0
- package/progress-bar/ProgressBar.js +5 -5
- package/progress-bar/ProgressBar.stories.jsx +58 -0
- package/radio/Radio.js +2 -2
- package/radio/Radio.stories.tsx +192 -0
- package/radio/types.d.ts +2 -2
- package/radio-group/Radio.d.ts +4 -0
- package/radio-group/Radio.js +140 -0
- package/radio-group/RadioGroup.d.ts +4 -0
- package/radio-group/RadioGroup.js +273 -0
- package/radio-group/RadioGroup.stories.tsx +79 -0
- package/radio-group/RadioGroup.test.js +248 -0
- package/radio-group/types.d.ts +36 -0
- package/radio-group/types.js +5 -0
- package/resultsetTable/ResultsetTable.d.ts +4 -0
- package/resultsetTable/ResultsetTable.js +9 -29
- package/resultsetTable/ResultsetTable.stories.tsx +275 -0
- package/resultsetTable/types.d.ts +67 -0
- package/resultsetTable/types.js +5 -0
- package/row/Row.d.ts +3 -0
- package/row/Row.js +127 -0
- package/row/Row.stories.tsx +237 -0
- package/row/types.d.ts +10 -0
- package/row/types.js +5 -0
- package/select/Select.d.ts +4 -0
- package/select/Select.js +20 -22
- package/select/Select.stories.tsx +572 -0
- package/select/types.d.ts +170 -0
- package/select/types.js +5 -0
- package/sidenav/Sidenav.d.ts +9 -0
- package/sidenav/Sidenav.js +6 -15
- package/sidenav/Sidenav.stories.tsx +182 -0
- package/sidenav/types.d.ts +50 -0
- package/sidenav/types.js +5 -0
- package/slider/Slider.d.ts +1 -1
- package/slider/Slider.js +43 -32
- package/slider/Slider.stories.tsx +177 -0
- package/slider/types.d.ts +2 -7
- package/spinner/Spinner.d.ts +4 -0
- package/spinner/Spinner.js +8 -25
- package/spinner/Spinner.stories.jsx +103 -0
- package/spinner/types.d.ts +32 -0
- package/spinner/types.js +5 -0
- package/stack/Stack.d.ts +3 -0
- package/stack/Stack.js +97 -0
- package/stack/Stack.stories.tsx +164 -0
- package/stack/types.d.ts +9 -0
- package/stack/types.js +5 -0
- package/switch/Switch.js +4 -4
- package/switch/Switch.stories.tsx +160 -0
- package/table/Table.d.ts +4 -0
- package/table/Table.js +3 -3
- package/table/Table.stories.jsx +277 -0
- package/table/types.d.ts +21 -0
- package/table/types.js +5 -0
- package/tabs/Tabs.js +11 -9
- package/tabs/Tabs.stories.tsx +120 -0
- package/tabs/types.d.ts +25 -18
- package/tag/Tag.d.ts +4 -0
- package/tag/Tag.js +26 -46
- package/tag/Tag.stories.tsx +138 -0
- package/tag/types.d.ts +69 -0
- package/tag/types.js +5 -0
- package/text/Text.d.ts +7 -0
- package/text/Text.js +30 -0
- package/text/Text.stories.tsx +19 -0
- package/text-input/TextInput.d.ts +4 -0
- package/text-input/TextInput.js +54 -85
- package/text-input/TextInput.stories.tsx +456 -0
- package/text-input/types.d.ts +159 -0
- package/text-input/types.js +5 -0
- package/textarea/Textarea.d.ts +4 -0
- package/textarea/Textarea.js +27 -60
- package/textarea/Textarea.stories.jsx +4 -3
- package/textarea/types.d.ts +130 -0
- package/textarea/types.js +5 -0
- package/toggle/Toggle.js +1 -1
- package/toggle-group/ToggleGroup.d.ts +4 -0
- package/toggle-group/ToggleGroup.js +16 -45
- package/toggle-group/ToggleGroup.stories.tsx +173 -0
- package/toggle-group/types.d.ts +97 -0
- package/toggle-group/types.js +5 -0
- package/upload/buttons-upload/ButtonsUpload.js +2 -2
- package/upload/dragAndDropArea/DragAndDropArea.js +2 -2
- package/upload/file-upload/FileToUpload.js +1 -1
- package/upload/files-upload/FilesToUpload.js +1 -1
- package/upload/transaction/Transaction.js +2 -2
- package/upload/transactions/Transactions.js +1 -1
- package/useTheme.d.ts +2 -0
- package/useTheme.js +1 -1
- package/wizard/Wizard.d.ts +4 -0
- package/wizard/Wizard.js +69 -59
- package/wizard/Wizard.stories.tsx +224 -0
- package/wizard/types.d.ts +60 -0
- package/wizard/types.js +5 -0
- package/box/index.d.ts +0 -25
- package/chip/index.d.ts +0 -22
- package/dialog/index.d.ts +0 -18
- 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/link/index.d.ts +0 -23
- package/number-input/index.d.ts +0 -113
- package/password-input/index.d.ts +0 -94
- package/resultsetTable/index.d.ts +0 -19
- package/select/index.d.ts +0 -131
- package/sidenav/index.d.ts +0 -13
- package/spinner/index.d.ts +0 -17
- package/table/index.d.ts +0 -13
- package/tag/index.d.ts +0 -24
- package/text-input/index.d.ts +0 -135
- package/textarea/index.d.ts +0 -117
- package/toggle-group/index.d.ts +0 -21
- package/wizard/Icons.js +0 -65
- package/wizard/index.d.ts +0 -18
package/chip/Chip.js
CHANGED
|
@@ -9,23 +9,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports["default"] = void 0;
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
13
|
|
|
14
14
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
15
|
|
|
16
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
17
|
-
|
|
18
16
|
var _react = _interopRequireDefault(require("react"));
|
|
19
17
|
|
|
20
18
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
21
19
|
|
|
22
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
|
-
|
|
24
20
|
var _variables = require("../common/variables.js");
|
|
25
21
|
|
|
26
22
|
var _utils = require("../common/utils.js");
|
|
27
23
|
|
|
28
|
-
var _useTheme = _interopRequireDefault(require("../useTheme
|
|
24
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
29
25
|
|
|
30
26
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
31
27
|
|
|
@@ -37,9 +33,7 @@ var DxcChip = function DxcChip(_ref) {
|
|
|
37
33
|
var label = _ref.label,
|
|
38
34
|
suffixIcon = _ref.suffixIcon,
|
|
39
35
|
prefixIcon = _ref.prefixIcon,
|
|
40
|
-
suffixIconSrc = _ref.suffixIconSrc,
|
|
41
36
|
onClickSuffix = _ref.onClickSuffix,
|
|
42
|
-
prefixIconSrc = _ref.prefixIconSrc,
|
|
43
37
|
onClickPrefix = _ref.onClickPrefix,
|
|
44
38
|
disabled = _ref.disabled,
|
|
45
39
|
margin = _ref.margin,
|
|
@@ -51,49 +45,33 @@ var DxcChip = function DxcChip(_ref) {
|
|
|
51
45
|
}, /*#__PURE__*/_react["default"].createElement(StyledDxcChip, {
|
|
52
46
|
disabled: disabled,
|
|
53
47
|
margin: margin
|
|
54
|
-
}, prefixIcon
|
|
48
|
+
}, prefixIcon && /*#__PURE__*/_react["default"].createElement(IconContainer, {
|
|
55
49
|
disabled: disabled,
|
|
56
50
|
prefixIcon: true,
|
|
57
51
|
label: label,
|
|
58
52
|
mode: "prefix",
|
|
59
53
|
tabIndex: typeof onClickPrefix === "function" && !disabled ? tabIndex : -1,
|
|
60
54
|
onClick: function onClick() {
|
|
61
|
-
return onClickPrefix && !disabled && onClickPrefix(
|
|
62
|
-
},
|
|
63
|
-
interactuable: typeof onClickPrefix === "function" && !disabled
|
|
64
|
-
}, (0, _typeof2["default"])(prefixIcon) === "object" ? prefixIcon : /*#__PURE__*/_react["default"].createElement(prefixIcon)) : prefixIconSrc && /*#__PURE__*/_react["default"].createElement(PrefixIconContainer, {
|
|
65
|
-
disabled: disabled,
|
|
66
|
-
src: prefixIconSrc,
|
|
67
|
-
label: label,
|
|
68
|
-
tabIndex: typeof onClickPrefix === "function" && !disabled ? tabIndex : -1,
|
|
69
|
-
onClick: function onClick() {
|
|
70
|
-
return onClickPrefix && !disabled && onClickPrefix(label);
|
|
55
|
+
return onClickPrefix && !disabled && onClickPrefix();
|
|
71
56
|
},
|
|
72
57
|
interactuable: typeof onClickPrefix === "function" && !disabled
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}, label), suffixIcon
|
|
58
|
+
}, typeof prefixIcon === "string" ? /*#__PURE__*/_react["default"].createElement(PrefixIconContainer, {
|
|
59
|
+
src: prefixIcon
|
|
60
|
+
}) : prefixIcon), label && /*#__PURE__*/_react["default"].createElement(ChipTextContainer, {
|
|
61
|
+
disabled: disabled
|
|
62
|
+
}, label), suffixIcon && /*#__PURE__*/_react["default"].createElement(IconContainer, {
|
|
78
63
|
disabled: disabled,
|
|
79
64
|
suffixIcon: true,
|
|
80
65
|
mode: "suffix",
|
|
81
66
|
label: label,
|
|
82
67
|
tabIndex: typeof onClickSuffix === "function" && !disabled ? tabIndex : -1,
|
|
83
68
|
onClick: function onClick() {
|
|
84
|
-
return onClickSuffix && !disabled && onClickSuffix(
|
|
69
|
+
return onClickSuffix && !disabled && onClickSuffix();
|
|
85
70
|
},
|
|
86
71
|
interactuable: typeof onClickSuffix === "function" && !disabled
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
label: label,
|
|
91
|
-
tabIndex: typeof onClickSuffix === "function" && !disabled ? tabIndex : -1,
|
|
92
|
-
onClick: function onClick() {
|
|
93
|
-
return onClickSuffix && !disabled && onClickSuffix(label);
|
|
94
|
-
},
|
|
95
|
-
interactuable: typeof onClickSuffix === "function" && !disabled
|
|
96
|
-
})));
|
|
72
|
+
}, typeof suffixIcon === "string" ? /*#__PURE__*/_react["default"].createElement(SuffixIconContainer, {
|
|
73
|
+
src: suffixIcon
|
|
74
|
+
}) : suffixIcon)));
|
|
97
75
|
};
|
|
98
76
|
|
|
99
77
|
var getCursor = function getCursor(interactuable, disabled) {
|
|
@@ -159,34 +137,14 @@ var ChipTextContainer = _styledComponents["default"].span(_templateObject2 || (_
|
|
|
159
137
|
return disabled && "not-allowed" || "default";
|
|
160
138
|
});
|
|
161
139
|
|
|
162
|
-
var SuffixIconContainer = _styledComponents["default"].img(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["
|
|
163
|
-
return props.disabled ? props.theme.disabledIconColor : props.theme.iconColor;
|
|
164
|
-
}, function (props) {
|
|
165
|
-
return getCursor(props.interactuable, props.disabled);
|
|
166
|
-
}, function (props) {
|
|
167
|
-
return (props.label || props.suffixIconSrc) && props.theme.iconSpacing || props.prefixIconSrc && "5px";
|
|
168
|
-
}, function (props) {
|
|
169
|
-
return props.theme.iconSize;
|
|
170
|
-
}, function (props) {
|
|
171
|
-
return props.theme.iconSize;
|
|
172
|
-
});
|
|
140
|
+
var SuffixIconContainer = _styledComponents["default"].img(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])([""])));
|
|
173
141
|
|
|
174
|
-
var PrefixIconContainer = _styledComponents["default"].img(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["
|
|
175
|
-
return props.disabled ? props.theme.disabledIconColor : props.theme.iconColor;
|
|
176
|
-
}, function (props) {
|
|
177
|
-
return getCursor(props.interactuable, props.disabled);
|
|
178
|
-
}, function (props) {
|
|
179
|
-
return (props.label || props.suffixIconSrc) && props.theme.iconSpacing || props.prefixIconSrc && "5px";
|
|
180
|
-
}, function (props) {
|
|
181
|
-
return props.theme.iconSize;
|
|
182
|
-
}, function (props) {
|
|
183
|
-
return props.theme.iconSize;
|
|
184
|
-
});
|
|
142
|
+
var PrefixIconContainer = _styledComponents["default"].img(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])([""])));
|
|
185
143
|
|
|
186
144
|
var IconContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n ", "\n ", "\n width: ", ";\n height: ", ";\n overflow: hidden;\n\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n &:focus {\n outline-color: ", ";\n outline-width: 2px;\n ", "\n }\n"])), function (props) {
|
|
187
145
|
return props.disabled ? props.theme.disabledIconColor : props.theme.iconColor;
|
|
188
146
|
}, function (props) {
|
|
189
|
-
return props.prefixIcon ? "margin-right: ".concat((props.label || props.suffixIcon
|
|
147
|
+
return props.prefixIcon ? "margin-right: ".concat((props.label || props.suffixIcon) && props.theme.iconSpacing || props.prefixIcon && "0", ";") : "margin-left: ".concat((props.label || props.prefixIcon) && props.theme.iconSpacing || props.prefixIcon && "0", ";");
|
|
190
148
|
}, function (props) {
|
|
191
149
|
return getCursor(props.interactuable, props.disabled);
|
|
192
150
|
}, function (props) {
|
|
@@ -199,23 +157,5 @@ var IconContainer = _styledComponents["default"].div(_templateObject5 || (_templ
|
|
|
199
157
|
return props.disabled && "outline: none;";
|
|
200
158
|
});
|
|
201
159
|
|
|
202
|
-
DxcChip.propTypes = {
|
|
203
|
-
label: _propTypes["default"].string,
|
|
204
|
-
disabled: _propTypes["default"].bool,
|
|
205
|
-
theme: _propTypes["default"].oneOf(["dark", "light"]),
|
|
206
|
-
suffixIcon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
|
|
207
|
-
prefixIcon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
|
|
208
|
-
suffixIconSrc: _propTypes["default"].string,
|
|
209
|
-
prefixIconSrc: _propTypes["default"].string,
|
|
210
|
-
onClickSuffix: _propTypes["default"].func,
|
|
211
|
-
onClickPrefix: _propTypes["default"].func,
|
|
212
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
213
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
214
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
215
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
216
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
217
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
218
|
-
tabIndex: _propTypes["default"].number
|
|
219
|
-
};
|
|
220
160
|
var _default = DxcChip;
|
|
221
161
|
exports["default"] = _default;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { userEvent, within } from "@storybook/testing-library";
|
|
3
|
+
import DxcChip from "./Chip";
|
|
4
|
+
import Title from "../../.storybook/components/Title";
|
|
5
|
+
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: "Chip",
|
|
9
|
+
component: DxcChip,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const iconSVG = (
|
|
13
|
+
<svg viewBox="0 0 24 24" fill="currentColor">
|
|
14
|
+
<path d="M0 0h24v24H0z" fill="none" />
|
|
15
|
+
<path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" />
|
|
16
|
+
</svg>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export const Chromatic = () => (
|
|
20
|
+
<>
|
|
21
|
+
<ExampleContainer>
|
|
22
|
+
<Title title="Basic chip" theme="light" level={4} />
|
|
23
|
+
<DxcChip label="Default Chip" />
|
|
24
|
+
</ExampleContainer>
|
|
25
|
+
<ExampleContainer>
|
|
26
|
+
<Title title="Chip with prefix" theme="light" level={4} />
|
|
27
|
+
<DxcChip label="Chip with prefix" prefixIcon={iconSVG} />
|
|
28
|
+
</ExampleContainer>
|
|
29
|
+
<ExampleContainer>
|
|
30
|
+
<Title title="Chip with suffix" theme="light" level={4} />
|
|
31
|
+
<DxcChip label="Chip with suffix" suffixIcon={iconSVG} />
|
|
32
|
+
</ExampleContainer>
|
|
33
|
+
<ExampleContainer>
|
|
34
|
+
<Title title="Chip with prefix and suffix" theme="light" level={4} />
|
|
35
|
+
<DxcChip label="Chip with prefix and suffix" prefixIcon={iconSVG} suffixIcon={iconSVG} />
|
|
36
|
+
</ExampleContainer>
|
|
37
|
+
<ExampleContainer>
|
|
38
|
+
<Title title="Disabled chip" theme="light" level={4} />
|
|
39
|
+
<DxcChip label="Disabled" disabled prefixIcon={iconSVG} suffixIcon={iconSVG} />
|
|
40
|
+
</ExampleContainer>
|
|
41
|
+
<ExampleContainer>
|
|
42
|
+
<Title title="Chip with ellipsis" theme="light" level={4} />
|
|
43
|
+
<DxcChip label="With ellipsis asdfasdf asdf asdfasdf asdf asdfasdf asdfasdf asdf asdf adfasrfasf afsdg afgasfg asdf asdf asdf asdf asdf asdf asdf afdg asfg asdfg asdf asdf asdf asdfasdf asd fas df asd asdf asdf asdfasd fg ssssssssssss ssss" />
|
|
44
|
+
</ExampleContainer>
|
|
45
|
+
<ExampleContainer>
|
|
46
|
+
<Title title="Chip with ellipsis and suffix" theme="light" level={4} />
|
|
47
|
+
<DxcChip
|
|
48
|
+
suffixIcon={iconSVG}
|
|
49
|
+
label="With ellipsis asdfasdf asdf asdfasdf asdf asdfasdf asdfasdf asdf asdf adfasrfasf afsdg afgasfg asdf asdf asdf asdf asdf asdf asdf afdg asfg asdfg asdf asdf asdf asdfasdf asd fas df asd asdf asdf asdfasd fgsss"
|
|
50
|
+
/>
|
|
51
|
+
</ExampleContainer>
|
|
52
|
+
<ExampleContainer>
|
|
53
|
+
<Title title="Chip with ellipsis and prefix" theme="light" level={4} />
|
|
54
|
+
<DxcChip
|
|
55
|
+
prefixIcon={iconSVG}
|
|
56
|
+
label="With ellipsis asdfasdf asdf asdfasdf asdf asdfasdf asdfasdf asdf asdf adfasrfasf afsdg afgasfg asdf asdf asdf asdf asdf asdf asdf afdg asfg asdfg asdf asdf asdf asdfasdf asd fas df asd asdf asdf asdfasd fgsss"
|
|
57
|
+
/>
|
|
58
|
+
</ExampleContainer>
|
|
59
|
+
<ExampleContainer>
|
|
60
|
+
<Title title="Chip with ellipsis, suffix and prefix" theme="light" level={4} />
|
|
61
|
+
<DxcChip
|
|
62
|
+
prefixIcon={iconSVG}
|
|
63
|
+
suffixIcon={iconSVG}
|
|
64
|
+
label="With ellipsis asdfasdf asdf asdfasdf asdf asdfasdf asdfasdf asdf asdf adfasrfasf afsdg afgasfg asdf asdf asdf asdf asdf asdf asdf afdg asfg asdfg asdf asdf asdf asdfasdf asd fas df asd asdf asdf asdfasdf"
|
|
65
|
+
/>
|
|
66
|
+
</ExampleContainer>
|
|
67
|
+
<Title title="Margins" theme="light" level={2} />
|
|
68
|
+
<ExampleContainer>
|
|
69
|
+
<Title title="Xxsmall margin" theme="light" level={4} />
|
|
70
|
+
<DxcChip label="xxsmall" margin="xxsmall" />
|
|
71
|
+
</ExampleContainer>
|
|
72
|
+
<ExampleContainer>
|
|
73
|
+
<Title title="Xsmall margin" theme="light" level={4} />
|
|
74
|
+
<DxcChip label="xsmall" margin="xsmall" />
|
|
75
|
+
</ExampleContainer>
|
|
76
|
+
<ExampleContainer>
|
|
77
|
+
<Title title="Small margin" theme="light" level={4} />
|
|
78
|
+
<DxcChip label="small" margin="small" />
|
|
79
|
+
</ExampleContainer>
|
|
80
|
+
<ExampleContainer>
|
|
81
|
+
<Title title="Medium margin" theme="light" level={4} />
|
|
82
|
+
<DxcChip label="medium" margin="medium" />
|
|
83
|
+
</ExampleContainer>
|
|
84
|
+
<ExampleContainer>
|
|
85
|
+
<Title title="Large margin" theme="light" level={4} />
|
|
86
|
+
<DxcChip label="large" margin="large" />
|
|
87
|
+
</ExampleContainer>
|
|
88
|
+
<ExampleContainer>
|
|
89
|
+
<Title title="Xlarge margin" theme="light" level={4} />
|
|
90
|
+
<DxcChip label="xlarge" margin="xlarge" />
|
|
91
|
+
</ExampleContainer>
|
|
92
|
+
<ExampleContainer>
|
|
93
|
+
<Title title="Xxlarge margin" theme="light" level={4} />
|
|
94
|
+
<DxcChip label="xxlarge" margin="xxlarge" />
|
|
95
|
+
</ExampleContainer>
|
|
96
|
+
</>
|
|
97
|
+
);
|
|
98
|
+
const ChipPrefixFocused = () => (
|
|
99
|
+
<ExampleContainer>
|
|
100
|
+
<Title title="Chip with prefix" theme="light" level={4} />
|
|
101
|
+
<DxcChip label="Chip with prefix" prefixIcon={iconSVG} onClickPrefix={() => {}} />
|
|
102
|
+
</ExampleContainer>
|
|
103
|
+
);
|
|
104
|
+
const ChipSuffixFocused = () => (
|
|
105
|
+
<ExampleContainer>
|
|
106
|
+
<Title title="Chip with suffix" theme="light" level={4} />
|
|
107
|
+
<DxcChip label="Chip with suffix" suffixIcon={iconSVG} onClickSuffix={() => {}} />
|
|
108
|
+
</ExampleContainer>
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
export const PrefixFocused = ChipPrefixFocused.bind({});
|
|
112
|
+
PrefixFocused.play = async ({ canvasElement }) => {
|
|
113
|
+
await userEvent.tab();
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export const SuffixFocused = ChipSuffixFocused.bind({});
|
|
117
|
+
SuffixFocused.play = async ({ canvasElement }) => {
|
|
118
|
+
await userEvent.tab();
|
|
119
|
+
};
|
package/chip/types.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
+
declare type Margin = {
|
|
4
|
+
top?: Space;
|
|
5
|
+
bottom?: Space;
|
|
6
|
+
left?: Space;
|
|
7
|
+
right?: Space;
|
|
8
|
+
};
|
|
9
|
+
declare type SVG = React.SVGProps<SVGSVGElement>;
|
|
10
|
+
declare type Props = {
|
|
11
|
+
/**
|
|
12
|
+
* Text to be placed on the chip.
|
|
13
|
+
*/
|
|
14
|
+
label?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Element or path used as icon to be placed after the chip label.
|
|
17
|
+
*/
|
|
18
|
+
suffixIcon?: string | SVG;
|
|
19
|
+
/**
|
|
20
|
+
* Element or path used as icon to be placed before the chip label.
|
|
21
|
+
*/
|
|
22
|
+
prefixIcon?: string | SVG;
|
|
23
|
+
/**
|
|
24
|
+
* This function will be called when the suffix is clicked.
|
|
25
|
+
*/
|
|
26
|
+
onClickSuffix?: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* This function will be called when the prefix is clicked.
|
|
29
|
+
*/
|
|
30
|
+
onClickPrefix?: () => void;
|
|
31
|
+
/**
|
|
32
|
+
* If true, the component will be disabled.
|
|
33
|
+
*/
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
37
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
38
|
+
*/
|
|
39
|
+
margin?: Space | Margin;
|
|
40
|
+
/**
|
|
41
|
+
* Value of the tabindex attribute.
|
|
42
|
+
*/
|
|
43
|
+
tabIndex?: number;
|
|
44
|
+
};
|
|
45
|
+
export default Props;
|
package/chip/types.js
ADDED
package/common/variables.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -9,7 +7,7 @@ exports.typeface = exports.spaces = exports.responsiveSizes = exports.globalToke
|
|
|
9
7
|
|
|
10
8
|
var _Icons = require("../header/Icons");
|
|
11
9
|
|
|
12
|
-
var _Icons2 =
|
|
10
|
+
var _Icons2 = require("../footer/Icons");
|
|
13
11
|
|
|
14
12
|
var globalTokens = {
|
|
15
13
|
// Color
|
|
@@ -99,7 +97,7 @@ var globalTokens = {
|
|
|
99
97
|
type_sans: "Open Sans, sans-serif",
|
|
100
98
|
type_scale_root: "16px",
|
|
101
99
|
type_scale_08: "3.75rem",
|
|
102
|
-
type_scale_07: "
|
|
100
|
+
type_scale_07: "2.5rem",
|
|
103
101
|
type_scale_06: "2rem",
|
|
104
102
|
type_scale_05: "1.5rem",
|
|
105
103
|
type_scale_04: "1.25rem",
|
|
@@ -164,7 +162,6 @@ exports.globalTokens = globalTokens;
|
|
|
164
162
|
var componentTokens = {
|
|
165
163
|
accordion: {
|
|
166
164
|
backgroundColor: globalTokens.hal_white,
|
|
167
|
-
disabledBackgroundColor: globalTokens.transparent,
|
|
168
165
|
hoverBackgroundColor: globalTokens.hal_purple_l_95,
|
|
169
166
|
arrowColor: globalTokens.hal_purple_s_38,
|
|
170
167
|
disabledArrowColor: globalTokens.hal_grey_l_60,
|
|
@@ -535,17 +532,16 @@ var componentTokens = {
|
|
|
535
532
|
errorMessageFontFamily: globalTokens.type_sans,
|
|
536
533
|
errorMessageFontSize: globalTokens.type_scale_01,
|
|
537
534
|
errorMessageFontWeight: globalTokens.type_regular,
|
|
538
|
-
errorMessageLineHeight: globalTokens.
|
|
535
|
+
errorMessageLineHeight: globalTokens.type_leading_normal,
|
|
539
536
|
dropBorderThickness: globalTokens.border_width_1,
|
|
540
537
|
dropBorderStyle: globalTokens.border_dashed,
|
|
541
538
|
dropBorderRadius: globalTokens.border_radius_large,
|
|
542
539
|
fileItemBorderThickness: globalTokens.border_width_1,
|
|
543
540
|
fileItemBorderStyle: globalTokens.border_solid,
|
|
544
541
|
fileItemBorderRadius: globalTokens.border_radius_medium,
|
|
545
|
-
hoverDeleteFileItemBackgroundColor:
|
|
546
|
-
activeDeleteFileItemBackgroundColor:
|
|
547
|
-
|
|
548
|
-
errorActiveDeleteFileItemBackgroundColor: globalTokens.hal_red_s_41
|
|
542
|
+
hoverDeleteFileItemBackgroundColor: "#0000000d",
|
|
543
|
+
activeDeleteFileItemBackgroundColor: "#00000033",
|
|
544
|
+
focusActionBorderColor: globalTokens.hal_blue_l_50
|
|
549
545
|
},
|
|
550
546
|
footer: {
|
|
551
547
|
height: "124px",
|
|
@@ -565,7 +561,7 @@ var componentTokens = {
|
|
|
565
561
|
copyrightFontStyle: globalTokens.type_normal,
|
|
566
562
|
copyrightFontWeight: globalTokens.type_regular,
|
|
567
563
|
copyrightFontColor: globalTokens.hal_white,
|
|
568
|
-
logo:
|
|
564
|
+
logo: "",
|
|
569
565
|
logoHeight: "32px",
|
|
570
566
|
logoWidth: "auto",
|
|
571
567
|
socialLinksSize: "24px",
|
|
@@ -583,8 +579,8 @@ var componentTokens = {
|
|
|
583
579
|
hamburguerTextTransform: globalTokens.type_uppercase,
|
|
584
580
|
hamburguerIconColor: globalTokens.hal_black,
|
|
585
581
|
hamburguerHoverColor: globalTokens.mediumGreyBlack,
|
|
586
|
-
logo:
|
|
587
|
-
logoResponsive:
|
|
582
|
+
logo: "",
|
|
583
|
+
logoResponsive: "",
|
|
588
584
|
logoHeight: "40px",
|
|
589
585
|
logoWidth: "auto",
|
|
590
586
|
menuBackgroundColor: globalTokens.hal_white,
|
|
@@ -608,37 +604,37 @@ var componentTokens = {
|
|
|
608
604
|
heading: {
|
|
609
605
|
level1FontColor: globalTokens.inherit,
|
|
610
606
|
level1FontFamily: globalTokens.type_sans,
|
|
611
|
-
level1FontSize: globalTokens.
|
|
607
|
+
level1FontSize: globalTokens.type_scale_07,
|
|
612
608
|
level1FontStyle: globalTokens.type_normal,
|
|
613
|
-
level1FontWeight: globalTokens.
|
|
609
|
+
level1FontWeight: globalTokens.type_semibold,
|
|
614
610
|
level1LineHeight: globalTokens.type_leading_compact_01,
|
|
615
611
|
level1LetterSpacing: globalTokens.type_spacing_tight_01,
|
|
616
612
|
level2FontColor: globalTokens.inherit,
|
|
617
613
|
level2FontFamily: globalTokens.type_sans,
|
|
618
|
-
level2FontSize: globalTokens.
|
|
614
|
+
level2FontSize: globalTokens.type_scale_05,
|
|
619
615
|
level2FontStyle: globalTokens.type_normal,
|
|
620
|
-
level2FontWeight: globalTokens.
|
|
616
|
+
level2FontWeight: globalTokens.type_semibold,
|
|
621
617
|
level2LineHeight: globalTokens.type_leading_normal,
|
|
622
618
|
level2LetterSpacing: globalTokens.type_spacing_normal,
|
|
623
619
|
level3FontColor: globalTokens.inherit,
|
|
624
620
|
level3FontFamily: globalTokens.type_sans,
|
|
625
|
-
level3FontSize: globalTokens.
|
|
621
|
+
level3FontSize: globalTokens.type_scale_04,
|
|
626
622
|
level3FontStyle: globalTokens.type_normal,
|
|
627
|
-
level3FontWeight: globalTokens.
|
|
623
|
+
level3FontWeight: globalTokens.type_semibold,
|
|
628
624
|
level3LineHeight: globalTokens.type_leading_compact_01,
|
|
629
625
|
level3LetterSpacing: globalTokens.type_spacing_wide_01,
|
|
630
626
|
level4FontColor: globalTokens.inherit,
|
|
631
627
|
level4FontFamily: globalTokens.type_sans,
|
|
632
|
-
level4FontSize: globalTokens.
|
|
628
|
+
level4FontSize: globalTokens.type_scale_03,
|
|
633
629
|
level4FontStyle: globalTokens.type_normal,
|
|
634
|
-
level4FontWeight: globalTokens.
|
|
630
|
+
level4FontWeight: globalTokens.type_semibold,
|
|
635
631
|
level4LineHeight: globalTokens.type_leading_normal,
|
|
636
632
|
level4LetterSpacing: globalTokens.type_spacing_normal,
|
|
637
633
|
level5FontColor: globalTokens.inherit,
|
|
638
634
|
level5FontFamily: globalTokens.type_sans,
|
|
639
|
-
level5FontSize: globalTokens.
|
|
635
|
+
level5FontSize: globalTokens.type_scale_02,
|
|
640
636
|
level5FontStyle: globalTokens.type_normal,
|
|
641
|
-
level5FontWeight: globalTokens.
|
|
637
|
+
level5FontWeight: globalTokens.type_semibold,
|
|
642
638
|
level5LineHeight: globalTokens.type_leading_normal,
|
|
643
639
|
level5LetterSpacing: globalTokens.type_spacing_wide_01
|
|
644
640
|
},
|
|
@@ -880,6 +876,44 @@ var componentTokens = {
|
|
|
880
876
|
fontStyle: globalTokens.type_normal,
|
|
881
877
|
fontWeight: globalTokens.type_regular
|
|
882
878
|
},
|
|
879
|
+
radioGroup: {
|
|
880
|
+
fontFamily: globalTokens.type_sans,
|
|
881
|
+
radioInputColor: globalTokens.hal_blue_l_45,
|
|
882
|
+
hoverRadioInputColor: globalTokens.hal_blue_s_35,
|
|
883
|
+
focusBorderColor: globalTokens.hal_blue_l_50,
|
|
884
|
+
activeRadioInputColor: globalTokens.hal_blue_d_20,
|
|
885
|
+
errorRadioInputColor: globalTokens.hal_red_s_41,
|
|
886
|
+
hoverErrorRadioInputColor: globalTokens.hal_red_d_30,
|
|
887
|
+
activeErrorRadioInputColor: globalTokens.hal_red_d_20,
|
|
888
|
+
readonlyRadioInputColor: globalTokens.hal_grey_l_60,
|
|
889
|
+
hoverReadonlyRadioInputColor: globalTokens.color_grey_600,
|
|
890
|
+
activeReadonlyRadioInputColor: globalTokens.hal_grey_s_40,
|
|
891
|
+
disabledRadioInputColor: globalTokens.hal_grey_l_60,
|
|
892
|
+
disabledLabelFontColor: globalTokens.hal_grey_l_60,
|
|
893
|
+
disabledHelperTextFontColor: globalTokens.hal_grey_l_60,
|
|
894
|
+
disabledRadioInputLabelFontColor: globalTokens.hal_grey_l_60,
|
|
895
|
+
errorMessageColor: globalTokens.hal_red_s_41,
|
|
896
|
+
labelFontColor: globalTokens.hal_black,
|
|
897
|
+
labelFontSize: globalTokens.type_scale_02,
|
|
898
|
+
labelFontStyle: globalTokens.type_normal,
|
|
899
|
+
labelFontWeight: globalTokens.type_semibold,
|
|
900
|
+
labelLineHeight: globalTokens.type_leading_loose_01,
|
|
901
|
+
optionalLabelFontWeight: globalTokens.type_regular,
|
|
902
|
+
helperTextFontColor: globalTokens.hal_black,
|
|
903
|
+
helperTextFontSize: globalTokens.type_scale_01,
|
|
904
|
+
helperTextFontStyle: globalTokens.type_normal,
|
|
905
|
+
helperTextFontWeight: globalTokens.type_regular,
|
|
906
|
+
helperTextLineHeight: globalTokens.type_leading_normal,
|
|
907
|
+
radioInputLabelFontColor: globalTokens.hal_black,
|
|
908
|
+
radioInputLabelFontSize: globalTokens.type_scale_02,
|
|
909
|
+
radioInputLabelFontStyle: globalTokens.type_normal,
|
|
910
|
+
radioInputLabelFontWeight: globalTokens.type_regular,
|
|
911
|
+
radioInputLabelLineHeight: globalTokens.type_leading_loose_01,
|
|
912
|
+
groupLabelMargin: globalTokens.spacing_03,
|
|
913
|
+
radioInputLabelMargin: globalTokens.spacing_03,
|
|
914
|
+
groupVerticalGutter: globalTokens.spacing_02,
|
|
915
|
+
groupHorizontalGutter: globalTokens.spacing_07
|
|
916
|
+
},
|
|
883
917
|
select: {
|
|
884
918
|
fontFamily: globalTokens.type_sans,
|
|
885
919
|
disabledColor: globalTokens.hal_grey_l_60,
|
|
@@ -1042,9 +1076,13 @@ var componentTokens = {
|
|
|
1042
1076
|
},
|
|
1043
1077
|
slider: {
|
|
1044
1078
|
fontFamily: globalTokens.type_sans,
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1079
|
+
limitValuesFontColor: globalTokens.hal_black,
|
|
1080
|
+
limitValuesFontColorOnDark: globalTokens.hal_white,
|
|
1081
|
+
limitValuesFontSize: globalTokens.type_scale_03,
|
|
1082
|
+
limitValuesFontStyle: globalTokens.type_normal,
|
|
1083
|
+
limitValuesFontWeight: globalTokens.type_regular,
|
|
1084
|
+
limitValuesFontLetterSpacing: globalTokens.type_spacing_normal,
|
|
1085
|
+
disabledLimitValuesFontColor: globalTokens.hal_grey_l_60,
|
|
1048
1086
|
labelFontFamily: globalTokens.type_sans,
|
|
1049
1087
|
labelFontSize: globalTokens.type_scale_02,
|
|
1050
1088
|
labelFontStyle: globalTokens.type_normal,
|
|
@@ -1058,9 +1096,13 @@ var componentTokens = {
|
|
|
1058
1096
|
fontColor: globalTokens.hal_black,
|
|
1059
1097
|
fontColorOnDark: globalTokens.hal_white,
|
|
1060
1098
|
labelFontColor: globalTokens.hal_black,
|
|
1099
|
+
labelFontColorOnDark: globalTokens.hal_white,
|
|
1061
1100
|
helperTextFontColor: globalTokens.hal_black,
|
|
1062
|
-
|
|
1063
|
-
|
|
1101
|
+
helperTextFontColorOnDark: globalTokens.hal_white,
|
|
1102
|
+
disabledLabelFontColor: globalTokens.hal_grey_l_60,
|
|
1103
|
+
disabledLabelFontColorOnDark: globalTokens.hal_grey_l_60,
|
|
1104
|
+
disabledHelperTextFontColor: globalTokens.hal_grey_l_60,
|
|
1105
|
+
disabledHelperTextFontColorOnDark: globalTokens.hal_grey_l_60,
|
|
1064
1106
|
thumbHeight: "12px",
|
|
1065
1107
|
thumbWidth: "12px",
|
|
1066
1108
|
hoverThumbHeight: "14px",
|
|
@@ -1142,30 +1184,30 @@ var componentTokens = {
|
|
|
1142
1184
|
"switch": {
|
|
1143
1185
|
checkedTrackBackgroundColor: globalTokens.hal_purple_s_38,
|
|
1144
1186
|
checkedTrackBackgroundColorOnDark: globalTokens.hal_purple_s_38,
|
|
1145
|
-
checkedThumbBackgroundColor: globalTokens.
|
|
1146
|
-
checkedThumbBackgroundColorOnDark: globalTokens.
|
|
1147
|
-
uncheckedTrackBackgroundColor: globalTokens.
|
|
1148
|
-
uncheckedTrackBackgroundColorOnDark: globalTokens.
|
|
1149
|
-
uncheckedThumbBackgroundColor: globalTokens.
|
|
1150
|
-
uncheckedThumbBackgroundColorOnDark: globalTokens.
|
|
1151
|
-
disabledCheckedTrackBackgroundColor: globalTokens.
|
|
1187
|
+
checkedThumbBackgroundColor: globalTokens.hal_white,
|
|
1188
|
+
checkedThumbBackgroundColorOnDark: globalTokens.hal_white,
|
|
1189
|
+
uncheckedTrackBackgroundColor: globalTokens.hal_grey_l_75,
|
|
1190
|
+
uncheckedTrackBackgroundColorOnDark: globalTokens.hal_grey_l_75,
|
|
1191
|
+
uncheckedThumbBackgroundColor: globalTokens.hal_white,
|
|
1192
|
+
uncheckedThumbBackgroundColorOnDark: globalTokens.hal_white,
|
|
1193
|
+
disabledCheckedTrackBackgroundColor: globalTokens.hal_purple_l_95,
|
|
1152
1194
|
disabledCheckedTrackBackgroundColorOnDark: "#1c0b24",
|
|
1153
|
-
disabledCheckedThumbBackgroundColor: globalTokens.
|
|
1154
|
-
disabledCheckedThumbBackgroundColorOnDark: globalTokens.
|
|
1155
|
-
disabledUncheckedTrackBackgroundColor: globalTokens.
|
|
1195
|
+
disabledCheckedThumbBackgroundColor: globalTokens.hal_white,
|
|
1196
|
+
disabledCheckedThumbBackgroundColorOnDark: globalTokens.hal_white,
|
|
1197
|
+
disabledUncheckedTrackBackgroundColor: globalTokens.hal_grey_l_95,
|
|
1156
1198
|
disabledUncheckedTrackBackgroundColorOnDark: "#363636",
|
|
1157
|
-
disabledUncheckedThumbBackgroundColor: globalTokens.
|
|
1158
|
-
disabledUncheckedThumbBackgroundColorOnDark: globalTokens.
|
|
1159
|
-
disabledLabelFontColor: globalTokens.
|
|
1199
|
+
disabledUncheckedThumbBackgroundColor: globalTokens.hal_white,
|
|
1200
|
+
disabledUncheckedThumbBackgroundColorOnDark: globalTokens.hal_white,
|
|
1201
|
+
disabledLabelFontColor: globalTokens.hal_grey_l_60,
|
|
1160
1202
|
disabledLabelFontColorOnDark: "#575757",
|
|
1161
1203
|
disabledLabelFontStyle: globalTokens.type_normal,
|
|
1162
1204
|
labelFontFamily: globalTokens.type_sans,
|
|
1163
1205
|
labelFontSize: globalTokens.type_scale_root,
|
|
1164
1206
|
labelFontStyle: globalTokens.type_normal,
|
|
1165
1207
|
labelFontWeight: globalTokens.type_regular,
|
|
1166
|
-
labelFontColor: globalTokens.
|
|
1167
|
-
labelFontColorOnDark: globalTokens.
|
|
1168
|
-
thumbFocusColor: globalTokens.
|
|
1208
|
+
labelFontColor: globalTokens.hal_black,
|
|
1209
|
+
labelFontColorOnDark: globalTokens.hal_white,
|
|
1210
|
+
thumbFocusColor: globalTokens.hal_blue_l_50,
|
|
1169
1211
|
thumbFocusColorOnDark: "#1682FF",
|
|
1170
1212
|
thumbHeight: "24px",
|
|
1171
1213
|
thumbWidth: "24px",
|
package/date/Date.js
CHANGED
|
@@ -39,7 +39,7 @@ var _InputText = _interopRequireDefault(require("../input-text/InputText"));
|
|
|
39
39
|
|
|
40
40
|
var _variables = require("../common/variables.js");
|
|
41
41
|
|
|
42
|
-
var _useTheme = _interopRequireDefault(require("../useTheme
|
|
42
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
43
43
|
|
|
44
44
|
var _templateObject, _DxcDate$propTypes;
|
|
45
45
|
|
package/date-input/DateInput.js
CHANGED
|
@@ -29,7 +29,7 @@ var _dateFns = _interopRequireDefault(require("@date-io/date-fns"));
|
|
|
29
29
|
|
|
30
30
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
31
31
|
|
|
32
|
-
var _useTheme = _interopRequireDefault(require("../useTheme
|
|
32
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
33
33
|
|
|
34
34
|
var _TextInput = _interopRequireDefault(require("../text-input/TextInput"));
|
|
35
35
|
|
|
@@ -40,15 +40,13 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
40
40
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
41
41
|
|
|
42
42
|
var DxcDateInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
43
|
-
var
|
|
44
|
-
label = _ref$label === void 0 ? "" : _ref$label,
|
|
43
|
+
var label = _ref.label,
|
|
45
44
|
_ref$name = _ref.name,
|
|
46
45
|
name = _ref$name === void 0 ? "" : _ref$name,
|
|
47
46
|
value = _ref.value,
|
|
48
47
|
_ref$format = _ref.format,
|
|
49
48
|
format = _ref$format === void 0 ? "dd-MM-yyyy" : _ref$format,
|
|
50
|
-
|
|
51
|
-
helperText = _ref$helperText === void 0 ? "" : _ref$helperText,
|
|
49
|
+
helperText = _ref.helperText,
|
|
52
50
|
_ref$placeholder = _ref.placeholder,
|
|
53
51
|
placeholder = _ref$placeholder === void 0 ? false : _ref$placeholder,
|
|
54
52
|
_ref$clearable = _ref.clearable,
|
|
@@ -59,8 +57,7 @@ var DxcDateInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
59
57
|
optional = _ref$optional === void 0 ? false : _ref$optional,
|
|
60
58
|
onChange = _ref.onChange,
|
|
61
59
|
onBlur = _ref.onBlur,
|
|
62
|
-
|
|
63
|
-
error = _ref$error === void 0 ? "" : _ref$error,
|
|
60
|
+
error = _ref.error,
|
|
64
61
|
_ref$autocomplete = _ref.autocomplete,
|
|
65
62
|
autocomplete = _ref$autocomplete === void 0 ? "off" : _ref$autocomplete,
|
|
66
63
|
margin = _ref.margin,
|
|
@@ -85,6 +82,7 @@ var DxcDateInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
85
82
|
setAnchorEl = _useState6[1];
|
|
86
83
|
|
|
87
84
|
var colorsTheme = (0, _useTheme["default"])();
|
|
85
|
+
var refDate = ref || (0, _react.useRef)(null);
|
|
88
86
|
|
|
89
87
|
var handleCalendarOnKeyDown = function handleCalendarOnKeyDown(event) {
|
|
90
88
|
switch (event.keyCode) {
|
|
@@ -135,11 +133,10 @@ var DxcDateInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
135
133
|
return (0, _moment["default"])(value !== null && value !== void 0 ? value : innerValue, format.toUpperCase(), true).format();
|
|
136
134
|
};
|
|
137
135
|
|
|
138
|
-
var openCalendar = function openCalendar(
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
136
|
+
var openCalendar = function openCalendar() {
|
|
137
|
+
var dateBtn = refDate.current.getElementsByTagName("button")[0];
|
|
138
|
+
setIsOpen(!isOpen);
|
|
139
|
+
setAnchorEl(dateBtn);
|
|
143
140
|
};
|
|
144
141
|
|
|
145
142
|
var closeCalendar = function closeCalendar() {
|
|
@@ -321,7 +318,7 @@ var DxcDateInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
321
318
|
margin: margin,
|
|
322
319
|
size: size,
|
|
323
320
|
tabIndex: tabIndex,
|
|
324
|
-
ref:
|
|
321
|
+
ref: refDate
|
|
325
322
|
}), /*#__PURE__*/_react["default"].createElement(_Popover["default"], {
|
|
326
323
|
onKeyDown: handleCalendarOnKeyDown,
|
|
327
324
|
open: isOpen,
|