@dxc-technology/halstack-react 0.0.0-bd47c58 → 0.0.0-bd89f9e
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 +5 -17
- package/HalstackContext.d.ts +14 -5
- package/HalstackContext.js +9 -34
- package/accordion/Accordion.js +21 -58
- package/accordion/Accordion.stories.tsx +1 -15
- package/accordion/Accordion.test.js +18 -33
- package/accordion/types.d.ts +5 -5
- package/accordion-group/AccordionGroup.js +15 -42
- package/accordion-group/AccordionGroup.stories.tsx +1 -1
- package/accordion-group/AccordionGroup.test.js +42 -60
- package/accordion-group/AccordionGroupAccordion.js +9 -21
- package/accordion-group/types.d.ts +6 -6
- package/alert/Alert.js +14 -46
- package/alert/Alert.test.js +28 -45
- package/alert/types.d.ts +5 -5
- package/badge/Badge.js +4 -17
- package/badge/types.d.ts +1 -1
- package/bleed/Bleed.js +13 -21
- package/bleed/types.d.ts +2 -2
- package/box/Box.js +10 -29
- package/box/Box.test.js +1 -6
- package/box/types.d.ts +3 -3
- package/bulleted-list/BulletedList.js +7 -33
- package/bulleted-list/BulletedList.stories.tsx +1 -91
- package/bulleted-list/types.d.ts +5 -5
- package/button/Button.js +23 -46
- package/button/Button.stories.tsx +5 -86
- package/button/Button.test.js +11 -21
- package/button/types.d.ts +4 -4
- package/card/Card.js +21 -44
- package/card/Card.test.js +10 -21
- package/card/types.d.ts +5 -5
- package/checkbox/Checkbox.js +81 -111
- package/checkbox/Checkbox.stories.tsx +16 -54
- package/checkbox/Checkbox.test.js +107 -63
- package/checkbox/types.d.ts +8 -4
- package/chip/Chip.js +12 -31
- package/chip/Chip.stories.tsx +1 -1
- package/chip/Chip.test.js +15 -28
- package/chip/types.d.ts +4 -4
- package/common/coreTokens.d.ts +105 -14
- package/common/coreTokens.js +40 -23
- package/common/utils.js +2 -8
- package/common/variables.d.ts +15 -6
- package/common/variables.js +17 -15
- package/container/Container.d.ts +4 -0
- package/container/Container.js +198 -0
- package/container/Container.stories.tsx +229 -0
- package/container/types.d.ts +74 -0
- package/date-input/Calendar.js +13 -57
- package/date-input/DateInput.js +50 -96
- package/date-input/DateInput.stories.tsx +11 -30
- package/date-input/DateInput.test.js +674 -701
- package/date-input/DatePicker.js +11 -42
- package/date-input/Icons.d.ts +6 -6
- package/date-input/Icons.js +6 -23
- package/date-input/YearPicker.js +8 -34
- package/date-input/types.d.ts +27 -21
- package/dialog/Dialog.js +11 -35
- package/dialog/Dialog.test.js +125 -187
- package/dialog/types.d.ts +18 -13
- package/dropdown/Dropdown.js +39 -93
- package/dropdown/Dropdown.test.js +391 -378
- package/dropdown/DropdownMenu.js +8 -19
- package/dropdown/DropdownMenuItem.js +5 -17
- package/dropdown/types.d.ts +17 -19
- package/file-input/FileInput.js +180 -248
- package/file-input/FileInput.stories.tsx +1 -1
- package/file-input/FileInput.test.js +356 -354
- package/file-input/FileItem.js +12 -39
- package/file-input/types.d.ts +9 -9
- package/flex/Flex.js +25 -39
- package/flex/types.d.ts +6 -6
- package/footer/Footer.js +9 -39
- package/footer/Footer.stories.tsx +8 -7
- package/footer/Footer.test.js +18 -32
- package/footer/Icons.d.ts +2 -2
- package/footer/Icons.js +2 -7
- package/footer/types.d.ts +13 -13
- package/grid/Grid.js +1 -16
- package/grid/types.d.ts +10 -10
- package/header/Header.d.ts +1 -1
- package/header/Header.js +19 -64
- package/header/Header.test.js +12 -25
- package/header/Icons.d.ts +2 -2
- package/header/Icons.js +2 -7
- package/header/types.d.ts +5 -7
- package/heading/Heading.js +9 -31
- package/heading/Heading.test.js +70 -87
- package/heading/types.d.ts +7 -7
- package/image/Image.d.ts +2 -2
- package/image/Image.js +17 -32
- package/image/types.d.ts +2 -2
- package/inset/Inset.js +13 -21
- package/inset/types.d.ts +2 -2
- package/layout/ApplicationLayout.d.ts +1 -1
- package/layout/ApplicationLayout.js +25 -65
- package/layout/ApplicationLayout.stories.tsx +1 -1
- package/layout/Icons.d.ts +8 -5
- package/layout/Icons.js +51 -59
- package/layout/SidenavContext.d.ts +1 -1
- package/layout/SidenavContext.js +3 -9
- package/layout/types.d.ts +3 -3
- package/link/Link.js +21 -42
- package/link/Link.test.js +23 -41
- package/link/types.d.ts +14 -14
- package/main.d.ts +3 -2
- package/main.js +10 -52
- package/nav-tabs/NavTabs.js +11 -43
- package/nav-tabs/NavTabs.stories.tsx +1 -1
- package/nav-tabs/NavTabs.test.js +36 -43
- package/nav-tabs/Tab.js +16 -45
- package/nav-tabs/types.d.ts +9 -9
- package/number-input/NumberInput.d.ts +1 -1
- package/number-input/NumberInput.js +24 -35
- package/number-input/NumberInput.stories.tsx +42 -26
- package/number-input/NumberInput.test.js +682 -577
- package/number-input/types.d.ts +11 -5
- package/package.json +29 -27
- package/paginator/Icons.d.ts +5 -5
- package/paginator/Icons.js +5 -19
- package/paginator/Paginator.js +14 -39
- package/paginator/Paginator.test.js +224 -207
- package/paginator/types.d.ts +3 -3
- package/paragraph/Paragraph.js +3 -14
- package/paragraph/Paragraph.stories.tsx +0 -17
- package/password-input/Icons.d.ts +3 -3
- package/password-input/Icons.js +1 -5
- package/password-input/PasswordInput.js +26 -48
- package/password-input/PasswordInput.stories.tsx +1 -33
- package/password-input/PasswordInput.test.js +153 -129
- package/password-input/types.d.ts +8 -7
- package/progress-bar/ProgressBar.js +16 -42
- package/progress-bar/{ProgressBar.stories.jsx → ProgressBar.stories.tsx} +1 -1
- package/progress-bar/ProgressBar.test.js +35 -52
- package/progress-bar/types.d.ts +3 -3
- package/quick-nav/QuickNav.js +4 -27
- package/quick-nav/QuickNav.stories.tsx +1 -1
- package/quick-nav/types.d.ts +10 -10
- package/radio-group/Radio.d.ts +1 -1
- package/radio-group/Radio.js +22 -54
- package/radio-group/RadioGroup.js +37 -83
- package/radio-group/RadioGroup.stories.tsx +10 -10
- package/radio-group/RadioGroup.test.js +504 -470
- package/radio-group/types.d.ts +8 -8
- package/resultset-table/Icons.d.ts +7 -0
- package/{resultsetTable → resultset-table}/Icons.js +1 -5
- package/{resultsetTable → resultset-table}/ResultsetTable.js +23 -59
- package/{resultsetTable → resultset-table}/ResultsetTable.test.js +72 -92
- package/{resultsetTable → resultset-table}/types.d.ts +7 -7
- package/resultset-table/types.js +5 -0
- package/select/Icons.d.ts +7 -7
- package/select/Icons.js +1 -5
- package/select/Listbox.js +13 -39
- package/select/Option.js +9 -26
- package/select/Select.js +54 -138
- package/select/Select.stories.tsx +3 -3
- package/select/Select.test.js +1906 -1800
- package/select/types.d.ts +14 -15
- package/sidenav/Icons.d.ts +4 -4
- package/sidenav/Icons.js +1 -5
- package/sidenav/Sidenav.js +24 -63
- package/sidenav/Sidenav.test.js +3 -10
- package/sidenav/types.d.ts +18 -18
- package/slider/Slider.js +38 -86
- package/slider/Slider.test.js +107 -103
- package/slider/types.d.ts +4 -4
- package/spinner/Spinner.js +10 -40
- package/spinner/Spinner.test.js +25 -34
- package/spinner/types.d.ts +3 -3
- package/switch/Switch.js +26 -69
- package/switch/Switch.stories.tsx +0 -34
- package/switch/Switch.test.js +51 -96
- package/switch/types.d.ts +4 -4
- package/table/Table.js +4 -23
- package/table/Table.test.js +1 -6
- package/table/types.d.ts +8 -8
- package/tabs/Tab.js +10 -29
- package/tabs/Tabs.js +48 -124
- package/tabs/Tabs.test.js +62 -118
- package/tabs/types.d.ts +19 -19
- package/tag/Tag.js +21 -51
- package/tag/Tag.test.js +19 -30
- package/tag/types.d.ts +7 -7
- package/text-input/Icons.d.ts +5 -5
- package/text-input/Icons.js +1 -5
- package/text-input/Suggestion.js +9 -26
- package/text-input/Suggestions.d.ts +1 -1
- package/text-input/Suggestions.js +12 -57
- package/text-input/TextInput.js +128 -193
- package/text-input/TextInput.stories.tsx +48 -152
- package/text-input/TextInput.test.js +1210 -1194
- package/text-input/types.d.ts +25 -17
- package/textarea/Textarea.js +60 -96
- package/textarea/{Textarea.stories.jsx → Textarea.stories.tsx} +58 -99
- package/textarea/Textarea.test.js +150 -179
- package/textarea/types.d.ts +9 -5
- package/toggle-group/ToggleGroup.js +20 -57
- package/toggle-group/ToggleGroup.stories.tsx +4 -4
- package/toggle-group/ToggleGroup.test.js +48 -81
- package/toggle-group/types.d.ts +10 -10
- package/typography/Typography.js +4 -13
- package/typography/types.d.ts +1 -1
- package/useTheme.d.ts +12 -3
- package/useTheme.js +1 -8
- package/useTranslatedLabels.js +1 -7
- package/utils/BaseTypography.d.ts +2 -2
- package/utils/BaseTypography.js +16 -30
- package/utils/FocusLock.js +12 -36
- package/wizard/Wizard.js +14 -49
- package/wizard/Wizard.test.js +53 -80
- package/wizard/types.d.ts +6 -6
- package/resultsetTable/Icons.d.ts +0 -7
- package/slider/Slider.stories.tsx +0 -240
- /package/{resultsetTable → container}/types.js +0 -0
- /package/{resultsetTable → resultset-table}/ResultsetTable.d.ts +0 -0
- /package/{resultsetTable → resultset-table}/ResultsetTable.stories.tsx +0 -0
- /package/spinner/{Spinner.stories.jsx → Spinner.stories.tsx} +0 -0
- /package/table/{Table.stories.jsx → Table.stories.tsx} +0 -0
package/common/coreTokens.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var
|
|
8
|
-
|
|
7
|
+
exports.getCoreColorToken = exports["default"] = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
|
+
/**
|
|
12
|
+
* Halstack Color Palette
|
|
13
|
+
* @link https://developer.dxc.com/halstack/next/principles/color/#color-tokens-core-color-tokens
|
|
14
|
+
*/
|
|
15
|
+
var CoreColorTokens = {
|
|
9
16
|
// Color
|
|
10
17
|
// Absolutes
|
|
11
18
|
color_black: "#000000",
|
|
@@ -99,7 +106,34 @@ var CORE_TOKENS = {
|
|
|
99
106
|
color_orange_600: "#f38f20",
|
|
100
107
|
color_orange_700: "#c26c0a",
|
|
101
108
|
color_orange_800: "#915108",
|
|
102
|
-
color_orange_900: "#613605"
|
|
109
|
+
color_orange_900: "#613605"
|
|
110
|
+
};
|
|
111
|
+
var getCoreColorToken = exports.getCoreColorToken = function getCoreColorToken(key) {
|
|
112
|
+
return CoreColorTokens[key];
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Halstack Spacing Principles
|
|
116
|
+
* @link https://developer.dxc.com/halstack/next/principles/spacing/
|
|
117
|
+
*/
|
|
118
|
+
var SpacingTokens = {
|
|
119
|
+
spacing_0: "0rem",
|
|
120
|
+
spacing_2: "0.125rem",
|
|
121
|
+
spacing_4: "0.25rem",
|
|
122
|
+
spacing_8: "0.5rem",
|
|
123
|
+
spacing_12: "0.75rem",
|
|
124
|
+
spacing_16: "1rem",
|
|
125
|
+
spacing_24: "1.5rem",
|
|
126
|
+
spacing_32: "2rem",
|
|
127
|
+
spacing_40: "2.5rem",
|
|
128
|
+
spacing_48: "3rem",
|
|
129
|
+
spacing_56: "3.5rem",
|
|
130
|
+
spacing_64: "4rem",
|
|
131
|
+
spacing_80: "5rem",
|
|
132
|
+
spacing_96: "6rem",
|
|
133
|
+
spacing_112: "7rem"
|
|
134
|
+
};
|
|
135
|
+
var CoreTokens = _objectSpread(_objectSpread(_objectSpread({}, CoreColorTokens), SpacingTokens), {}, {
|
|
136
|
+
inherit: "inherit",
|
|
103
137
|
// Typography
|
|
104
138
|
type_sans: "Open Sans, sans-serif",
|
|
105
139
|
type_scale_root: "16px",
|
|
@@ -134,22 +168,6 @@ var CORE_TOKENS = {
|
|
|
134
168
|
type_leading_normal: "1.5em",
|
|
135
169
|
type_leading_loose_01: "1.715em",
|
|
136
170
|
type_leading_loose_02: "2em",
|
|
137
|
-
// Spacing
|
|
138
|
-
spacing_0: "0rem",
|
|
139
|
-
spacing_2: "0.125rem",
|
|
140
|
-
spacing_4: "0.25rem",
|
|
141
|
-
spacing_8: "0.5rem",
|
|
142
|
-
spacing_12: "0.75rem",
|
|
143
|
-
spacing_16: "1rem",
|
|
144
|
-
spacing_24: "1.5rem",
|
|
145
|
-
spacing_32: "2rem",
|
|
146
|
-
spacing_40: "2.5rem",
|
|
147
|
-
spacing_48: "3rem",
|
|
148
|
-
spacing_56: "3.5rem",
|
|
149
|
-
spacing_64: "4rem",
|
|
150
|
-
spacing_80: "5rem",
|
|
151
|
-
spacing_96: "6rem",
|
|
152
|
-
spacing_112: "7rem",
|
|
153
171
|
// Border
|
|
154
172
|
border_width_0: "0px",
|
|
155
173
|
border_width_1: "1px",
|
|
@@ -162,6 +180,5 @@ var CORE_TOKENS = {
|
|
|
162
180
|
border_solid: "solid",
|
|
163
181
|
border_dashed: "dashed",
|
|
164
182
|
border_none: "none"
|
|
165
|
-
};
|
|
166
|
-
var _default =
|
|
167
|
-
exports["default"] = _default;
|
|
183
|
+
});
|
|
184
|
+
var _default = exports["default"] = CoreTokens;
|
package/common/utils.js
CHANGED
|
@@ -1,22 +1,16 @@
|
|
|
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
7
|
exports.getMargin = void 0;
|
|
9
|
-
|
|
10
8
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
11
|
-
|
|
12
9
|
var _variables = require("./variables");
|
|
13
|
-
|
|
14
|
-
var getMargin = function getMargin(marginProp, side) {
|
|
10
|
+
var getMargin = exports.getMargin = function getMargin(marginProp, side) {
|
|
15
11
|
if (marginProp && (0, _typeof2["default"])(marginProp) === "object") {
|
|
16
12
|
return marginProp[side] && _variables.spaces[marginProp[side]] || "0px";
|
|
17
13
|
} else if (marginProp && typeof marginProp === "string") {
|
|
18
14
|
return _variables.spaces[marginProp];
|
|
19
15
|
} else return "0px";
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
exports.getMargin = getMargin;
|
|
16
|
+
};
|
package/common/variables.d.ts
CHANGED
|
@@ -197,16 +197,21 @@ export declare const componentTokens: {
|
|
|
197
197
|
hoverBackgroundColorCheckedOnDark: string;
|
|
198
198
|
disabledBackgroundColorChecked: string;
|
|
199
199
|
disabledBackgroundColorCheckedOnDark: string;
|
|
200
|
+
readOnlyBackgroundColorChecked: string;
|
|
201
|
+
hoverReadOnlyBackgroundColorChecked: string;
|
|
200
202
|
borderColor: string;
|
|
201
203
|
borderColorOnDark: string;
|
|
202
204
|
hoverBorderColor: string;
|
|
203
205
|
hoverBorderColorOnDark: string;
|
|
204
206
|
disabledBorderColor: string;
|
|
205
207
|
disabledBorderColorOnDark: string;
|
|
208
|
+
readOnlyBorderColor: string;
|
|
209
|
+
hoverReadOnlyBorderColor: string;
|
|
206
210
|
checkColor: string;
|
|
207
211
|
checkColorOnDark: string;
|
|
208
212
|
disabledCheckColor: string;
|
|
209
213
|
disabledCheckColorOnDark: string;
|
|
214
|
+
readOnlyCheckColor: string;
|
|
210
215
|
fontFamily: string;
|
|
211
216
|
fontSize: string;
|
|
212
217
|
fontWeight: string;
|
|
@@ -616,9 +621,9 @@ export declare const componentTokens: {
|
|
|
616
621
|
errorRadioInputColor: string;
|
|
617
622
|
hoverErrorRadioInputColor: string;
|
|
618
623
|
activeErrorRadioInputColor: string;
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
624
|
+
readOnlyRadioInputColor: string;
|
|
625
|
+
hoverReadOnlyRadioInputColor: string;
|
|
626
|
+
activeReadOnlyRadioInputColor: string;
|
|
622
627
|
disabledRadioInputColor: string;
|
|
623
628
|
disabledLabelFontColor: string;
|
|
624
629
|
disabledHelperTextFontColor: string;
|
|
@@ -1000,6 +1005,8 @@ export declare const componentTokens: {
|
|
|
1000
1005
|
disabledBorderColorOnDark: string;
|
|
1001
1006
|
disabledContainerFillColor: string;
|
|
1002
1007
|
disabledContainerFillColorOnDark: string;
|
|
1008
|
+
readOnlyBorderColor: string;
|
|
1009
|
+
hoverReadOnlyBorderColor: string;
|
|
1003
1010
|
errorBorderColor: string;
|
|
1004
1011
|
errorBorderColorOnDark: string;
|
|
1005
1012
|
hoverErrorBorderColor: string;
|
|
@@ -1049,6 +1056,8 @@ export declare const componentTokens: {
|
|
|
1049
1056
|
disabledBorderColorOnDark: string;
|
|
1050
1057
|
disabledContainerFillColor: string;
|
|
1051
1058
|
disabledContainerFillColorOnDark: string;
|
|
1059
|
+
readOnlyBorderColor: string;
|
|
1060
|
+
hoverReadOnlyBorderColor: string;
|
|
1052
1061
|
errorBorderColor: string;
|
|
1053
1062
|
errorBorderColorOnDark: string;
|
|
1054
1063
|
hoverErrorBorderColor: string;
|
|
@@ -1240,8 +1249,8 @@ export declare const componentTokens: {
|
|
|
1240
1249
|
focusColor: string;
|
|
1241
1250
|
};
|
|
1242
1251
|
};
|
|
1243
|
-
export
|
|
1244
|
-
export
|
|
1252
|
+
export type AdvancedTheme = typeof componentTokens;
|
|
1253
|
+
export type OpinionatedTheme = {
|
|
1245
1254
|
accordion: {
|
|
1246
1255
|
accentColor: string;
|
|
1247
1256
|
titleFontColor: string;
|
|
@@ -1487,4 +1496,4 @@ export declare const defaultTranslatedComponentLabels: {
|
|
|
1487
1496
|
nextMonthTitle: string;
|
|
1488
1497
|
};
|
|
1489
1498
|
};
|
|
1490
|
-
export
|
|
1499
|
+
export type TranslatedLabels = typeof defaultTranslatedComponentLabels;
|
package/common/variables.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
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
7
|
exports.spaces = exports.responsiveSizes = exports.defaultTranslatedComponentLabels = exports.componentTokens = void 0;
|
|
9
|
-
|
|
10
8
|
var _coreTokens = _interopRequireDefault(require("./coreTokens"));
|
|
11
|
-
|
|
12
|
-
var componentTokens = {
|
|
9
|
+
var componentTokens = exports.componentTokens = {
|
|
13
10
|
accordion: {
|
|
14
11
|
backgroundColor: _coreTokens["default"].color_white,
|
|
15
12
|
hoverBackgroundColor: _coreTokens["default"].color_purple_100,
|
|
@@ -208,16 +205,21 @@ var componentTokens = {
|
|
|
208
205
|
hoverBackgroundColorCheckedOnDark: _coreTokens["default"].color_white,
|
|
209
206
|
disabledBackgroundColorChecked: _coreTokens["default"].color_grey_500,
|
|
210
207
|
disabledBackgroundColorCheckedOnDark: _coreTokens["default"].color_grey_800,
|
|
208
|
+
readOnlyBackgroundColorChecked: _coreTokens["default"].color_grey_500,
|
|
209
|
+
hoverReadOnlyBackgroundColorChecked: _coreTokens["default"].color_grey_600,
|
|
211
210
|
borderColor: _coreTokens["default"].color_blue_800,
|
|
212
211
|
borderColorOnDark: _coreTokens["default"].color_grey_200,
|
|
213
212
|
hoverBorderColor: _coreTokens["default"].color_blue_900,
|
|
214
213
|
hoverBorderColorOnDark: _coreTokens["default"].color_white,
|
|
215
214
|
disabledBorderColor: _coreTokens["default"].color_grey_500,
|
|
216
215
|
disabledBorderColorOnDark: _coreTokens["default"].color_grey_800,
|
|
216
|
+
readOnlyBorderColor: _coreTokens["default"].color_grey_500,
|
|
217
|
+
hoverReadOnlyBorderColor: _coreTokens["default"].color_grey_600,
|
|
217
218
|
checkColor: _coreTokens["default"].color_white,
|
|
218
219
|
checkColorOnDark: _coreTokens["default"].color_black,
|
|
219
220
|
disabledCheckColor: _coreTokens["default"].color_white,
|
|
220
221
|
disabledCheckColorOnDark: _coreTokens["default"].color_grey_500,
|
|
222
|
+
readOnlyCheckColor: _coreTokens["default"].color_white,
|
|
221
223
|
fontFamily: _coreTokens["default"].type_sans,
|
|
222
224
|
fontSize: _coreTokens["default"].type_scale_02,
|
|
223
225
|
fontWeight: _coreTokens["default"].type_regular,
|
|
@@ -627,9 +629,9 @@ var componentTokens = {
|
|
|
627
629
|
errorRadioInputColor: _coreTokens["default"].color_red_700,
|
|
628
630
|
hoverErrorRadioInputColor: _coreTokens["default"].color_red_800,
|
|
629
631
|
activeErrorRadioInputColor: _coreTokens["default"].color_red_900,
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
632
|
+
readOnlyRadioInputColor: _coreTokens["default"].color_grey_500,
|
|
633
|
+
hoverReadOnlyRadioInputColor: _coreTokens["default"].color_grey_600,
|
|
634
|
+
activeReadOnlyRadioInputColor: _coreTokens["default"].color_grey_700,
|
|
633
635
|
disabledRadioInputColor: _coreTokens["default"].color_grey_500,
|
|
634
636
|
disabledLabelFontColor: _coreTokens["default"].color_grey_500,
|
|
635
637
|
disabledHelperTextFontColor: _coreTokens["default"].color_grey_500,
|
|
@@ -1011,6 +1013,8 @@ var componentTokens = {
|
|
|
1011
1013
|
disabledBorderColorOnDark: _coreTokens["default"].color_grey_500,
|
|
1012
1014
|
disabledContainerFillColor: _coreTokens["default"].color_grey_100,
|
|
1013
1015
|
disabledContainerFillColorOnDark: _coreTokens["default"].color_grey_700,
|
|
1016
|
+
readOnlyBorderColor: _coreTokens["default"].color_grey_500,
|
|
1017
|
+
hoverReadOnlyBorderColor: _coreTokens["default"].color_grey_600,
|
|
1014
1018
|
errorBorderColor: _coreTokens["default"].color_red_700,
|
|
1015
1019
|
errorBorderColorOnDark: _coreTokens["default"].color_red_500,
|
|
1016
1020
|
hoverErrorBorderColor: _coreTokens["default"].color_red_600,
|
|
@@ -1060,6 +1064,8 @@ var componentTokens = {
|
|
|
1060
1064
|
disabledBorderColorOnDark: _coreTokens["default"].color_grey_500,
|
|
1061
1065
|
disabledContainerFillColor: _coreTokens["default"].color_grey_100,
|
|
1062
1066
|
disabledContainerFillColorOnDark: _coreTokens["default"].color_grey_700,
|
|
1067
|
+
readOnlyBorderColor: _coreTokens["default"].color_grey_500,
|
|
1068
|
+
hoverReadOnlyBorderColor: _coreTokens["default"].color_grey_600,
|
|
1063
1069
|
errorBorderColor: _coreTokens["default"].color_red_700,
|
|
1064
1070
|
errorBorderColorOnDark: _coreTokens["default"].color_red_500,
|
|
1065
1071
|
hoverErrorBorderColor: _coreTokens["default"].color_red_600,
|
|
@@ -1251,8 +1257,7 @@ var componentTokens = {
|
|
|
1251
1257
|
focusColor: _coreTokens["default"].color_blue_600
|
|
1252
1258
|
}
|
|
1253
1259
|
};
|
|
1254
|
-
exports.
|
|
1255
|
-
var spaces = {
|
|
1260
|
+
var spaces = exports.spaces = {
|
|
1256
1261
|
xxsmall: "6px",
|
|
1257
1262
|
xsmall: "16px",
|
|
1258
1263
|
small: "24px",
|
|
@@ -1261,16 +1266,14 @@ var spaces = {
|
|
|
1261
1266
|
xlarge: "64px",
|
|
1262
1267
|
xxlarge: "100px"
|
|
1263
1268
|
};
|
|
1264
|
-
exports.
|
|
1265
|
-
var responsiveSizes = {
|
|
1269
|
+
var responsiveSizes = exports.responsiveSizes = {
|
|
1266
1270
|
xsmall: "20",
|
|
1267
1271
|
small: "30",
|
|
1268
1272
|
medium: "45",
|
|
1269
1273
|
large: "66",
|
|
1270
1274
|
xlarge: "90"
|
|
1271
1275
|
};
|
|
1272
|
-
exports.
|
|
1273
|
-
var defaultTranslatedComponentLabels = {
|
|
1276
|
+
var defaultTranslatedComponentLabels = exports.defaultTranslatedComponentLabels = {
|
|
1274
1277
|
formFields: {
|
|
1275
1278
|
optionalLabel: "(Optional)",
|
|
1276
1279
|
requiredSelectionErrorMessage: "This field is required. Please, choose an option.",
|
|
@@ -1365,5 +1368,4 @@ var defaultTranslatedComponentLabels = {
|
|
|
1365
1368
|
previousMonthTitle: "Previous month",
|
|
1366
1369
|
nextMonthTitle: "Next month"
|
|
1367
1370
|
}
|
|
1368
|
-
};
|
|
1369
|
-
exports.defaultTranslatedComponentLabels = defaultTranslatedComponentLabels;
|
|
1371
|
+
};
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
14
|
+
var _coreTokens = require("../common/coreTokens");
|
|
15
|
+
var _BackgroundColorContext = require("../BackgroundColorContext");
|
|
16
|
+
var _templateObject;
|
|
17
|
+
var _excluded = ["display", "width", "height", "overflow"];
|
|
18
|
+
/**
|
|
19
|
+
* This values correspond to the spaces defined in the design system
|
|
20
|
+
* https://developer.dxc.com/halstack/next/principles/spacing/#component-spacing-tokens
|
|
21
|
+
*/
|
|
22
|
+
var spaces = {
|
|
23
|
+
xxsmall: "4px",
|
|
24
|
+
xsmall: "8px",
|
|
25
|
+
small: "12px",
|
|
26
|
+
medium: "16px",
|
|
27
|
+
large: "24px",
|
|
28
|
+
xlarge: "32px",
|
|
29
|
+
xxlarge: "48px"
|
|
30
|
+
};
|
|
31
|
+
var DxcContainer = function DxcContainer(_ref) {
|
|
32
|
+
var _props$background;
|
|
33
|
+
var display = _ref.display,
|
|
34
|
+
width = _ref.width,
|
|
35
|
+
height = _ref.height,
|
|
36
|
+
overflow = _ref.overflow,
|
|
37
|
+
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
38
|
+
return /*#__PURE__*/_react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
|
|
39
|
+
color: (0, _coreTokens.getCoreColorToken)(props === null || props === void 0 ? void 0 : (_props$background = props.background) === null || _props$background === void 0 ? void 0 : _props$background.color)
|
|
40
|
+
}, /*#__PURE__*/_react["default"].createElement(Container, (0, _extends2["default"])({
|
|
41
|
+
$display: display,
|
|
42
|
+
$width: width,
|
|
43
|
+
$height: height,
|
|
44
|
+
$overflow: overflow
|
|
45
|
+
}, props)));
|
|
46
|
+
};
|
|
47
|
+
var getBorderStyles = function getBorderStyles(direction, borderProperties) {
|
|
48
|
+
var _borderProperties$wid, _borderProperties$sty, _getCoreColorToken;
|
|
49
|
+
return "border-".concat(direction, ": ").concat((_borderProperties$wid = borderProperties === null || borderProperties === void 0 ? void 0 : borderProperties.width) !== null && _borderProperties$wid !== void 0 ? _borderProperties$wid : "", " ").concat((_borderProperties$sty = borderProperties === null || borderProperties === void 0 ? void 0 : borderProperties.style) !== null && _borderProperties$sty !== void 0 ? _borderProperties$sty : "", " ").concat((_getCoreColorToken = (0, _coreTokens.getCoreColorToken)(borderProperties === null || borderProperties === void 0 ? void 0 : borderProperties.color)) !== null && _getCoreColorToken !== void 0 ? _getCoreColorToken : "", ";");
|
|
50
|
+
};
|
|
51
|
+
var Container = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n box-sizing: ", ";\n display: ", ";\n width: ", ";\n height: ", ";\n max-width: ", ";\n max-height: ", ";\n min-width: ", ";\n min-height: ", ";\n position: ", ";\n top: ", ";\n right: ", ";\n bottom: ", ";\n left: ", ";\n float: ", ";\n z-index: ", ";\n box-shadow: ", ";\n\n background-attachment: ", ";\n background-clip: ", ";\n background-color: ", ";\n background-image: ", ";\n background-origin: ", ";\n background-position: ", ";\n background-repeat: ", ";\n background-size: ", ";\n\n border-radius: ", ";\n border-width: ", ";\n border-style: ", ";\n border-width: ", ";\n\n ", ";\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n outline: ", ";\n outline-offset: ", ";\n\n overflow: ", ";\n overflow-x: ", ";\n overflow-y: ", ";\n\n padding: ", ";\n padding-top: ", ";\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n"])), function (_ref2) {
|
|
52
|
+
var boxSizing = _ref2.boxSizing;
|
|
53
|
+
return boxSizing;
|
|
54
|
+
}, function (_ref3) {
|
|
55
|
+
var $display = _ref3.$display;
|
|
56
|
+
return $display;
|
|
57
|
+
}, function (_ref4) {
|
|
58
|
+
var $width = _ref4.$width;
|
|
59
|
+
return $width;
|
|
60
|
+
}, function (_ref5) {
|
|
61
|
+
var $height = _ref5.$height;
|
|
62
|
+
return $height;
|
|
63
|
+
}, function (_ref6) {
|
|
64
|
+
var maxWidth = _ref6.maxWidth;
|
|
65
|
+
return maxWidth;
|
|
66
|
+
}, function (_ref7) {
|
|
67
|
+
var maxHeight = _ref7.maxHeight;
|
|
68
|
+
return maxHeight;
|
|
69
|
+
}, function (_ref8) {
|
|
70
|
+
var minWidth = _ref8.minWidth;
|
|
71
|
+
return minWidth;
|
|
72
|
+
}, function (_ref9) {
|
|
73
|
+
var minHeight = _ref9.minHeight;
|
|
74
|
+
return minHeight;
|
|
75
|
+
}, function (_ref10) {
|
|
76
|
+
var position = _ref10.position;
|
|
77
|
+
return position;
|
|
78
|
+
}, function (_ref11) {
|
|
79
|
+
var inset = _ref11.inset;
|
|
80
|
+
return inset === null || inset === void 0 ? void 0 : inset.top;
|
|
81
|
+
}, function (_ref12) {
|
|
82
|
+
var inset = _ref12.inset;
|
|
83
|
+
return inset === null || inset === void 0 ? void 0 : inset.right;
|
|
84
|
+
}, function (_ref13) {
|
|
85
|
+
var inset = _ref13.inset;
|
|
86
|
+
return inset === null || inset === void 0 ? void 0 : inset.bottom;
|
|
87
|
+
}, function (_ref14) {
|
|
88
|
+
var inset = _ref14.inset;
|
|
89
|
+
return inset === null || inset === void 0 ? void 0 : inset.left;
|
|
90
|
+
}, function (_ref15) {
|
|
91
|
+
var _float = _ref15["float"];
|
|
92
|
+
return _float;
|
|
93
|
+
}, function (_ref16) {
|
|
94
|
+
var zIndex = _ref16.zIndex;
|
|
95
|
+
return zIndex;
|
|
96
|
+
}, function (_ref17) {
|
|
97
|
+
var boxShadow = _ref17.boxShadow;
|
|
98
|
+
return boxShadow;
|
|
99
|
+
}, function (_ref18) {
|
|
100
|
+
var background = _ref18.background;
|
|
101
|
+
return background === null || background === void 0 ? void 0 : background.attachment;
|
|
102
|
+
}, function (_ref19) {
|
|
103
|
+
var background = _ref19.background;
|
|
104
|
+
return background === null || background === void 0 ? void 0 : background.clip;
|
|
105
|
+
}, function (_ref20) {
|
|
106
|
+
var background = _ref20.background;
|
|
107
|
+
return (0, _coreTokens.getCoreColorToken)(background === null || background === void 0 ? void 0 : background.color);
|
|
108
|
+
}, function (_ref21) {
|
|
109
|
+
var background = _ref21.background;
|
|
110
|
+
return background === null || background === void 0 ? void 0 : background.image;
|
|
111
|
+
}, function (_ref22) {
|
|
112
|
+
var background = _ref22.background;
|
|
113
|
+
return background === null || background === void 0 ? void 0 : background.origin;
|
|
114
|
+
}, function (_ref23) {
|
|
115
|
+
var background = _ref23.background;
|
|
116
|
+
return background === null || background === void 0 ? void 0 : background.position;
|
|
117
|
+
}, function (_ref24) {
|
|
118
|
+
var background = _ref24.background;
|
|
119
|
+
return background === null || background === void 0 ? void 0 : background.repeat;
|
|
120
|
+
}, function (_ref25) {
|
|
121
|
+
var background = _ref25.background;
|
|
122
|
+
return background === null || background === void 0 ? void 0 : background.size;
|
|
123
|
+
}, function (_ref26) {
|
|
124
|
+
var borderRadius = _ref26.borderRadius;
|
|
125
|
+
return borderRadius;
|
|
126
|
+
}, function (_ref27) {
|
|
127
|
+
var border = _ref27.border;
|
|
128
|
+
return border && "width" in border ? "".concat(border === null || border === void 0 ? void 0 : border.width) : "";
|
|
129
|
+
}, function (_ref28) {
|
|
130
|
+
var border = _ref28.border;
|
|
131
|
+
return border && "style" in border ? "".concat(border === null || border === void 0 ? void 0 : border.style) : "";
|
|
132
|
+
}, function (_ref29) {
|
|
133
|
+
var border = _ref29.border;
|
|
134
|
+
return border && "color" in border ? "".concat((0, _coreTokens.getCoreColorToken)(border === null || border === void 0 ? void 0 : border.color)) : "";
|
|
135
|
+
}, function (_ref30) {
|
|
136
|
+
var border = _ref30.border;
|
|
137
|
+
if (border != null) {
|
|
138
|
+
var styles = "";
|
|
139
|
+
switch (true) {
|
|
140
|
+
case "top" in border:
|
|
141
|
+
styles += getBorderStyles("top", border.top);
|
|
142
|
+
case "right" in border:
|
|
143
|
+
styles += getBorderStyles("right", border.right);
|
|
144
|
+
case "left" in border:
|
|
145
|
+
styles += getBorderStyles("left", border.left);
|
|
146
|
+
case "bottom" in border:
|
|
147
|
+
styles += getBorderStyles("bottom", border.bottom);
|
|
148
|
+
}
|
|
149
|
+
return styles;
|
|
150
|
+
}
|
|
151
|
+
}, function (_ref31) {
|
|
152
|
+
var margin = _ref31.margin;
|
|
153
|
+
return typeof margin === "string" ? spaces[margin] : "";
|
|
154
|
+
}, function (_ref32) {
|
|
155
|
+
var margin = _ref32.margin;
|
|
156
|
+
return (0, _typeof2["default"])(margin) === "object" ? spaces[margin.top] : "";
|
|
157
|
+
}, function (_ref33) {
|
|
158
|
+
var margin = _ref33.margin;
|
|
159
|
+
return (0, _typeof2["default"])(margin) === "object" ? spaces[margin.right] : "";
|
|
160
|
+
}, function (_ref34) {
|
|
161
|
+
var margin = _ref34.margin;
|
|
162
|
+
return (0, _typeof2["default"])(margin) === "object" ? spaces[margin.bottom] : "";
|
|
163
|
+
}, function (_ref35) {
|
|
164
|
+
var margin = _ref35.margin;
|
|
165
|
+
return (0, _typeof2["default"])(margin) === "object" ? spaces[margin.left] : "";
|
|
166
|
+
}, function (_ref36) {
|
|
167
|
+
var _outline$width, _outline$style, _getCoreColorToken2;
|
|
168
|
+
var outline = _ref36.outline;
|
|
169
|
+
return "".concat((_outline$width = outline === null || outline === void 0 ? void 0 : outline.width) !== null && _outline$width !== void 0 ? _outline$width : "", " ").concat((_outline$style = outline === null || outline === void 0 ? void 0 : outline.style) !== null && _outline$style !== void 0 ? _outline$style : "", " ").concat((_getCoreColorToken2 = (0, _coreTokens.getCoreColorToken)(outline === null || outline === void 0 ? void 0 : outline.color)) !== null && _getCoreColorToken2 !== void 0 ? _getCoreColorToken2 : "");
|
|
170
|
+
}, function (_ref37) {
|
|
171
|
+
var outline = _ref37.outline;
|
|
172
|
+
return outline === null || outline === void 0 ? void 0 : outline.offset;
|
|
173
|
+
}, function (_ref38) {
|
|
174
|
+
var $overflow = _ref38.$overflow;
|
|
175
|
+
return typeof $overflow === "string" ? $overflow : "";
|
|
176
|
+
}, function (_ref39) {
|
|
177
|
+
var $overflow = _ref39.$overflow;
|
|
178
|
+
return (0, _typeof2["default"])($overflow) === "object" ? "".concat($overflow === null || $overflow === void 0 ? void 0 : $overflow.x) : "";
|
|
179
|
+
}, function (_ref40) {
|
|
180
|
+
var $overflow = _ref40.$overflow;
|
|
181
|
+
return (0, _typeof2["default"])($overflow) === "object" ? "".concat($overflow === null || $overflow === void 0 ? void 0 : $overflow.y) : "";
|
|
182
|
+
}, function (_ref41) {
|
|
183
|
+
var padding = _ref41.padding;
|
|
184
|
+
return typeof padding === "string" ? spaces[padding] : "";
|
|
185
|
+
}, function (_ref42) {
|
|
186
|
+
var padding = _ref42.padding;
|
|
187
|
+
return (0, _typeof2["default"])(padding) === "object" ? spaces[padding.top] : "";
|
|
188
|
+
}, function (_ref43) {
|
|
189
|
+
var padding = _ref43.padding;
|
|
190
|
+
return (0, _typeof2["default"])(padding) === "object" ? spaces[padding.right] : "";
|
|
191
|
+
}, function (_ref44) {
|
|
192
|
+
var padding = _ref44.padding;
|
|
193
|
+
return (0, _typeof2["default"])(padding) === "object" ? spaces[padding.bottom] : "";
|
|
194
|
+
}, function (_ref45) {
|
|
195
|
+
var padding = _ref45.padding;
|
|
196
|
+
return (0, _typeof2["default"])(padding) === "object" ? spaces[padding.left] : "";
|
|
197
|
+
});
|
|
198
|
+
var _default = exports["default"] = DxcContainer;
|