@dxc-technology/halstack-react 0.0.0-3a698b0 → 0.0.0-3ac400c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BackgroundColorContext.d.ts +1 -10
- package/BackgroundColorContext.js +4 -21
- package/HalstackContext.d.ts +25 -129
- package/HalstackContext.js +10 -35
- package/README.md +47 -0
- package/accordion/Accordion.d.ts +1 -1
- package/accordion/Accordion.js +24 -76
- package/accordion/Accordion.stories.tsx +1 -113
- package/accordion/Accordion.test.js +18 -33
- package/accordion/types.d.ts +5 -17
- package/accordion-group/AccordionGroup.d.ts +4 -3
- package/accordion-group/AccordionGroup.js +27 -75
- package/accordion-group/AccordionGroup.stories.tsx +78 -77
- package/accordion-group/AccordionGroup.test.js +43 -71
- package/accordion-group/AccordionGroupAccordion.d.ts +4 -0
- package/accordion-group/AccordionGroupAccordion.js +31 -0
- package/accordion-group/types.d.ts +6 -18
- package/alert/Alert.js +16 -53
- 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.d.ts +1 -1
- package/box/Box.js +16 -55
- package/box/Box.stories.tsx +25 -53
- package/box/Box.test.js +1 -6
- package/box/types.d.ts +3 -15
- package/bulleted-list/BulletedList.js +19 -53
- package/bulleted-list/BulletedList.stories.tsx +8 -93
- package/bulleted-list/types.d.ts +32 -5
- package/button/Button.d.ts +1 -1
- package/button/Button.js +66 -99
- package/button/Button.stories.tsx +8 -89
- package/button/Button.test.js +17 -16
- package/button/types.d.ts +8 -4
- package/card/Card.d.ts +1 -1
- package/card/Card.js +39 -79
- package/card/Card.stories.tsx +0 -29
- package/card/Card.test.js +10 -21
- package/card/types.d.ts +6 -12
- package/checkbox/Checkbox.js +85 -120
- 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 +34 -66
- package/chip/Chip.stories.tsx +25 -17
- package/chip/Chip.test.js +15 -28
- package/chip/types.d.ts +4 -4
- package/common/OpenSans.css +68 -80
- package/common/coreTokens.d.ts +237 -0
- package/common/coreTokens.js +184 -0
- package/common/utils.js +2 -8
- package/common/variables.d.ts +24 -268
- package/common/variables.js +860 -1111
- package/container/Container.d.ts +4 -0
- package/container/Container.js +194 -0
- package/container/Container.stories.tsx +214 -0
- package/container/types.d.ts +74 -0
- package/date-input/Calendar.js +15 -59
- 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.d.ts +1 -1
- package/dialog/Dialog.js +15 -60
- package/dialog/Dialog.stories.tsx +215 -169
- package/dialog/Dialog.test.js +125 -187
- package/dialog/types.d.ts +18 -26
- package/dropdown/Dropdown.js +39 -93
- package/dropdown/Dropdown.test.js +391 -378
- package/dropdown/DropdownMenu.js +13 -20
- 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 +14 -41
- package/file-input/types.d.ts +10 -10
- package/flex/Flex.js +27 -39
- package/flex/Flex.stories.tsx +24 -10
- package/flex/types.d.ts +74 -9
- package/footer/Footer.d.ts +1 -1
- package/footer/Footer.js +54 -112
- package/footer/Footer.stories.tsx +19 -95
- package/footer/Footer.test.js +21 -33
- package/footer/Icons.d.ts +2 -2
- package/footer/Icons.js +2 -7
- package/footer/types.d.ts +21 -29
- package/grid/Grid.d.ts +1 -1
- package/grid/Grid.js +2 -17
- package/grid/Grid.stories.tsx +38 -38
- package/grid/types.d.ts +10 -10
- package/header/Header.d.ts +2 -2
- package/header/Header.js +31 -114
- package/header/Header.stories.tsx +7 -71
- 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 -20
- 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 +4 -0
- package/image/Image.js +70 -0
- package/image/Image.stories.tsx +127 -0
- package/image/types.d.ts +72 -0
- package/inset/Inset.js +13 -21
- package/inset/Inset.stories.tsx +1 -1
- package/inset/types.d.ts +2 -2
- package/layout/ApplicationLayout.d.ts +5 -5
- package/layout/ApplicationLayout.js +28 -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 +5 -6
- package/link/Link.js +22 -43
- package/link/Link.test.js +23 -41
- package/link/types.d.ts +14 -14
- package/main.d.ts +4 -3
- package/main.js +17 -58
- package/nav-tabs/NavTabs.d.ts +2 -2
- package/nav-tabs/NavTabs.js +16 -51
- package/nav-tabs/NavTabs.stories.tsx +15 -1
- package/nav-tabs/NavTabs.test.js +36 -43
- package/nav-tabs/Tab.js +36 -69
- package/nav-tabs/types.d.ts +14 -15
- package/number-input/NumberInput.d.ts +7 -0
- package/number-input/NumberInput.js +26 -35
- package/number-input/NumberInput.stories.tsx +42 -26
- package/number-input/NumberInput.test.js +700 -412
- package/number-input/types.d.ts +11 -5
- package/package.json +30 -28
- package/paginator/Icons.d.ts +5 -5
- package/paginator/Icons.js +5 -19
- package/paginator/Paginator.js +16 -44
- package/paginator/Paginator.test.js +229 -199
- package/paginator/types.d.ts +3 -3
- package/paragraph/Paragraph.js +3 -19
- package/paragraph/Paragraph.stories.tsx +0 -17
- package/password-input/Icons.d.ts +6 -0
- package/password-input/Icons.js +35 -0
- package/password-input/PasswordInput.js +57 -126
- package/password-input/PasswordInput.stories.tsx +1 -33
- package/password-input/PasswordInput.test.js +157 -140
- package/password-input/types.d.ts +8 -7
- package/progress-bar/ProgressBar.js +21 -53
- 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 +31 -63
- package/radio-group/RadioGroup.js +45 -93
- 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 +70 -155
- package/select/Select.stories.tsx +3 -3
- package/select/Select.test.js +1946 -1804
- package/select/types.d.ts +14 -15
- package/sidenav/Icons.d.ts +7 -0
- package/sidenav/Icons.js +47 -0
- package/sidenav/Sidenav.d.ts +2 -2
- package/sidenav/Sidenav.js +80 -150
- package/sidenav/Sidenav.stories.tsx +60 -60
- package/sidenav/Sidenav.test.js +3 -10
- package/sidenav/types.d.ts +31 -28
- package/slider/Slider.js +68 -125
- package/slider/Slider.test.js +107 -103
- package/slider/types.d.ts +4 -4
- package/spinner/Spinner.js +16 -54
- package/spinner/Spinner.test.js +25 -34
- package/spinner/types.d.ts +3 -3
- package/switch/Switch.js +49 -97
- 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 +5 -27
- package/table/Table.test.js +1 -6
- package/table/types.d.ts +8 -8
- package/tabs/Tab.js +10 -29
- package/tabs/Tabs.js +52 -129
- 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 +15 -65
- package/text-input/TextInput.js +189 -284
- 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 +67 -109
- package/textarea/{Textarea.stories.jsx → Textarea.stories.tsx} +58 -100
- package/textarea/Textarea.test.js +150 -179
- package/textarea/types.d.ts +9 -5
- package/toggle-group/ToggleGroup.d.ts +2 -2
- package/toggle-group/ToggleGroup.js +90 -107
- package/toggle-group/ToggleGroup.stories.tsx +7 -4
- package/toggle-group/ToggleGroup.test.js +68 -87
- package/toggle-group/types.d.ts +26 -17
- package/typography/Typography.js +4 -13
- package/typography/types.d.ts +1 -1
- package/useTheme.d.ts +21 -122
- 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 +24 -42
- package/wizard/Wizard.js +14 -49
- package/wizard/Wizard.test.js +53 -80
- package/wizard/types.d.ts +6 -6
- package/card/ice-cream.jpg +0 -0
- package/number-input/NumberInputContext.d.ts +0 -4
- package/number-input/NumberInputContext.js +0 -19
- package/number-input/numberInputContextTypes.d.ts +0 -19
- package/resultsetTable/Icons.d.ts +0 -7
- package/slider/Slider.stories.tsx +0 -240
- /package/{resultsetTable → container}/types.js +0 -0
- /package/{number-input/numberInputContextTypes.js → image/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
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare type BackgroundColors = "dark" | "light";
|
|
3
|
-
declare const BackgroundColorContext: React.Context<BackgroundColors>;
|
|
4
|
-
declare type BackgroundColorProviderPropsType = {
|
|
5
|
-
color: string;
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
};
|
|
8
|
-
declare const BackgroundColorProvider: ({ color, children }: BackgroundColorProviderPropsType) => JSX.Element;
|
|
9
|
-
export default BackgroundColorContext;
|
|
10
|
-
export { BackgroundColorProvider };
|
|
1
|
+
export {};
|
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports["default"] = exports.BackgroundColorProvider = void 0;
|
|
11
|
-
|
|
12
5
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
|
|
14
6
|
var _color = _interopRequireDefault(require("color"));
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
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; }
|
|
19
|
-
|
|
7
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
8
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
20
9
|
var BackgroundColorContext = /*#__PURE__*/_react["default"].createContext(null);
|
|
21
|
-
|
|
22
10
|
var getColorType = function getColorType(hexColor) {
|
|
23
11
|
try {
|
|
24
12
|
if (hexColor) {
|
|
@@ -30,18 +18,13 @@ var getColorType = function getColorType(hexColor) {
|
|
|
30
18
|
return "light";
|
|
31
19
|
}
|
|
32
20
|
};
|
|
33
|
-
|
|
34
21
|
var BackgroundColorProvider = function BackgroundColorProvider(_ref) {
|
|
35
22
|
var color = _ref.color,
|
|
36
|
-
|
|
23
|
+
children = _ref.children;
|
|
37
24
|
var colorType = (0, _react.useMemo)(function () {
|
|
38
25
|
return getColorType(color);
|
|
39
26
|
}, [color]);
|
|
40
27
|
return /*#__PURE__*/_react["default"].createElement(BackgroundColorContext.Provider, {
|
|
41
28
|
value: colorType
|
|
42
29
|
}, children);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
exports.BackgroundColorProvider = BackgroundColorProvider;
|
|
46
|
-
var _default = BackgroundColorContext;
|
|
47
|
-
exports["default"] = _default;
|
|
30
|
+
};
|
package/HalstackContext.d.ts
CHANGED
|
@@ -111,7 +111,6 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
111
111
|
};
|
|
112
112
|
bulletedList: {
|
|
113
113
|
fontColor: string;
|
|
114
|
-
fontColorOnDark: string;
|
|
115
114
|
bulletIconHeight: string;
|
|
116
115
|
bulletIconWidth: string;
|
|
117
116
|
bulletHeight: string;
|
|
@@ -126,19 +125,12 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
126
125
|
paddingTop: string;
|
|
127
126
|
paddingBottom: string;
|
|
128
127
|
focusBorderColor: string;
|
|
129
|
-
focusBorderColorOnDark: string;
|
|
130
128
|
primaryBackgroundColor: string;
|
|
131
|
-
primaryBackgroundColorOnDark: string;
|
|
132
129
|
primaryFontColor: string;
|
|
133
|
-
primaryFontColorOnDark: string;
|
|
134
130
|
primaryHoverBackgroundColor: string;
|
|
135
|
-
primaryHoverBackgroundColorOnDark: string;
|
|
136
131
|
primaryActiveBackgroundColor: string;
|
|
137
|
-
primaryActiveBackgroundColorOnDark: string;
|
|
138
132
|
primaryDisabledBackgroundColor: string;
|
|
139
|
-
primaryDisabledBackgroundColorOnDark: string;
|
|
140
133
|
primaryDisabledFontColor: string;
|
|
141
|
-
primaryDisabledFontColorOnDark: string;
|
|
142
134
|
primaryBorderThickness: string;
|
|
143
135
|
primaryBorderStyle: string;
|
|
144
136
|
primaryBorderRadius: string;
|
|
@@ -146,23 +138,14 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
146
138
|
primaryFontSize: string;
|
|
147
139
|
primaryFontWeight: string;
|
|
148
140
|
secondaryBackgroundColor: string;
|
|
149
|
-
secondaryBackgroundColorOnDark: string;
|
|
150
141
|
secondaryFontColor: string;
|
|
151
|
-
secondaryFontColorOnDark: string;
|
|
152
142
|
secondaryHoverFontColor: string;
|
|
153
|
-
secondaryHoverFontColorOnDark: string;
|
|
154
143
|
secondaryBorderColor: string;
|
|
155
|
-
secondaryBorderColorOnDark: string;
|
|
156
144
|
secondaryHoverBackgroundColor: string;
|
|
157
|
-
secondaryHoverBackgroundColorOnDark: string;
|
|
158
145
|
secondaryActiveBackgroundColor: string;
|
|
159
|
-
secondaryActiveBackgroundColorOnDark: string;
|
|
160
146
|
secondaryDisabledBackgroundColor: string;
|
|
161
|
-
secondaryDisabledBackgroundColorOnDark: string;
|
|
162
147
|
secondaryDisabledFontColor: string;
|
|
163
|
-
secondaryDisabledFontColorOnDark: string;
|
|
164
148
|
secondaryDisabledBorderColor: string;
|
|
165
|
-
secondaryDisabledBorderColorOnDark: string;
|
|
166
149
|
secondaryBorderThickness: string;
|
|
167
150
|
secondaryBorderStyle: string;
|
|
168
151
|
secondaryBorderRadius: string;
|
|
@@ -170,17 +153,11 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
170
153
|
secondaryFontSize: string;
|
|
171
154
|
secondaryFontWeight: string;
|
|
172
155
|
textBackgroundColor: string;
|
|
173
|
-
textBackgroundColorOnDark: string;
|
|
174
156
|
textFontColor: string;
|
|
175
|
-
textFontColorOnDark: string;
|
|
176
157
|
textHoverBackgroundColor: string;
|
|
177
|
-
textHoverBackgroundColorOnDark: string;
|
|
178
158
|
textActiveBackgroundColor: string;
|
|
179
|
-
textActiveBackgroundColorOnDark: string;
|
|
180
159
|
textDisabledBackgroundColor: string;
|
|
181
|
-
textDisabledBackgroundColorOnDark: string;
|
|
182
160
|
textDisabledFontColor: string;
|
|
183
|
-
textDisabledFontColorOnDark: string;
|
|
184
161
|
textBorderThickness: string;
|
|
185
162
|
textBorderStyle: string;
|
|
186
163
|
textBorderRadius: string;
|
|
@@ -194,30 +171,24 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
194
171
|
};
|
|
195
172
|
checkbox: {
|
|
196
173
|
backgroundColorChecked: string;
|
|
197
|
-
backgroundColorCheckedOnDark: string;
|
|
198
174
|
hoverBackgroundColorChecked: string;
|
|
199
|
-
hoverBackgroundColorCheckedOnDark: string;
|
|
200
175
|
disabledBackgroundColorChecked: string;
|
|
201
|
-
|
|
176
|
+
readOnlyBackgroundColorChecked: string;
|
|
177
|
+
hoverReadOnlyBackgroundColorChecked: string;
|
|
202
178
|
borderColor: string;
|
|
203
|
-
borderColorOnDark: string;
|
|
204
179
|
hoverBorderColor: string;
|
|
205
|
-
hoverBorderColorOnDark: string;
|
|
206
180
|
disabledBorderColor: string;
|
|
207
|
-
|
|
181
|
+
readOnlyBorderColor: string;
|
|
182
|
+
hoverReadOnlyBorderColor: string;
|
|
208
183
|
checkColor: string;
|
|
209
|
-
checkColorOnDark: string;
|
|
210
184
|
disabledCheckColor: string;
|
|
211
|
-
|
|
185
|
+
readOnlyCheckColor: string;
|
|
212
186
|
fontFamily: string;
|
|
213
187
|
fontSize: string;
|
|
214
188
|
fontWeight: string;
|
|
215
189
|
fontColor: string;
|
|
216
|
-
fontColorOnDark: string;
|
|
217
190
|
disabledFontColor: string;
|
|
218
|
-
disabledFontColorOnDark: string;
|
|
219
191
|
focusColor: string;
|
|
220
|
-
focusColorOnDark: string;
|
|
221
192
|
checkLabelSpacing: string;
|
|
222
193
|
};
|
|
223
194
|
chip: {
|
|
@@ -432,10 +403,7 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
432
403
|
hamburguerIconColor: string;
|
|
433
404
|
hamburguerHoverColor: string;
|
|
434
405
|
logo: string;
|
|
435
|
-
logoResponsive: string;
|
|
436
|
-
* This type is used to allow partial themes and labels objects to be passed to the HalstackProvider.
|
|
437
|
-
* This is an extension of the already extisting Partial type, which only allows one level of partiality.
|
|
438
|
-
*/
|
|
406
|
+
logoResponsive: string;
|
|
439
407
|
logoHeight: string;
|
|
440
408
|
logoWidth: string;
|
|
441
409
|
menuBackgroundColor: string;
|
|
@@ -454,7 +422,6 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
454
422
|
underlinedThickness: string;
|
|
455
423
|
underlinedStyle: string;
|
|
456
424
|
contentColor: string;
|
|
457
|
-
contentColorOnDark: string;
|
|
458
425
|
};
|
|
459
426
|
heading: {
|
|
460
427
|
level1FontColor: string;
|
|
@@ -493,6 +460,14 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
493
460
|
level5LineHeight: string;
|
|
494
461
|
level5LetterSpacing: string;
|
|
495
462
|
};
|
|
463
|
+
image: {
|
|
464
|
+
captionFontColor: string;
|
|
465
|
+
captionFontFamily: string;
|
|
466
|
+
captionFontSize: string;
|
|
467
|
+
captionFontStyle: string;
|
|
468
|
+
captionFontWeight: string;
|
|
469
|
+
captionLineHeight: string;
|
|
470
|
+
};
|
|
496
471
|
link: {
|
|
497
472
|
fontColor: string;
|
|
498
473
|
fontFamily: string;
|
|
@@ -504,7 +479,7 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
504
479
|
underlineSpacing: string;
|
|
505
480
|
underlineStyle: string;
|
|
506
481
|
underlineThickness: string;
|
|
507
|
-
|
|
482
|
+
disabledFontColor: string;
|
|
508
483
|
hoverFontColor: string;
|
|
509
484
|
hoverUnderlineColor: string;
|
|
510
485
|
visitedFontColor: string;
|
|
@@ -553,31 +528,26 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
553
528
|
};
|
|
554
529
|
paragraph: {
|
|
555
530
|
fontColor: string;
|
|
556
|
-
fontColorOnDark: string;
|
|
557
531
|
display: string;
|
|
558
532
|
fontSize: string;
|
|
559
533
|
fontWeight: string;
|
|
560
534
|
};
|
|
561
535
|
progressBar: {
|
|
562
536
|
trackLineColor: string;
|
|
563
|
-
trackLineColorOnDark: string;
|
|
564
537
|
totalLineColor: string;
|
|
565
538
|
labelFontFamily: string;
|
|
566
539
|
labelFontSize: string;
|
|
567
540
|
labelFontStyle: string;
|
|
568
541
|
labelFontWeight: string;
|
|
569
542
|
labelFontColor: string;
|
|
570
|
-
labelFontColorOnDark: string;
|
|
571
543
|
labelFontTextTransform: string;
|
|
572
544
|
valueFontFamily: string;
|
|
573
545
|
valueFontSize: string;
|
|
574
546
|
valueFontStyle: string;
|
|
575
547
|
valueFontWeight: string;
|
|
576
548
|
valueFontColor: string;
|
|
577
|
-
valueFontColorOnDark: string;
|
|
578
549
|
valueFontTextTransform: string;
|
|
579
550
|
helperTextFontColor: string;
|
|
580
|
-
helperTextFontColorOnDark: string;
|
|
581
551
|
helperTextFontSize: string;
|
|
582
552
|
helperTextFontStyle: string;
|
|
583
553
|
helperTextFontWeight: string;
|
|
@@ -613,9 +583,9 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
613
583
|
errorRadioInputColor: string;
|
|
614
584
|
hoverErrorRadioInputColor: string;
|
|
615
585
|
activeErrorRadioInputColor: string;
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
586
|
+
readOnlyRadioInputColor: string;
|
|
587
|
+
hoverReadOnlyRadioInputColor: string;
|
|
588
|
+
activeReadOnlyRadioInputColor: string;
|
|
619
589
|
disabledRadioInputColor: string;
|
|
620
590
|
disabledLabelFontColor: string;
|
|
621
591
|
disabledHelperTextFontColor: string;
|
|
@@ -755,7 +725,6 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
755
725
|
slider: {
|
|
756
726
|
fontFamily: string;
|
|
757
727
|
limitValuesFontColor: string;
|
|
758
|
-
limitValuesFontColorOnDark: string;
|
|
759
728
|
limitValuesFontSize: string;
|
|
760
729
|
limitValuesFontStyle: string;
|
|
761
730
|
limitValuesFontWeight: string;
|
|
@@ -772,15 +741,10 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
772
741
|
helperTextFontWeight: string;
|
|
773
742
|
helperTextLineHeight: string;
|
|
774
743
|
fontColor: string;
|
|
775
|
-
fontColorOnDark: string;
|
|
776
744
|
labelFontColor: string;
|
|
777
|
-
labelFontColorOnDark: string;
|
|
778
745
|
helperTextFontColor: string;
|
|
779
|
-
helperTextFontColorOnDark: string;
|
|
780
746
|
disabledLabelFontColor: string;
|
|
781
|
-
disabledLabelFontColorOnDark: string;
|
|
782
747
|
disabledHelperTextFontColor: string;
|
|
783
|
-
disabledHelperTextFontColorOnDark: string;
|
|
784
748
|
thumbHeight: string;
|
|
785
749
|
thumbWidth: string;
|
|
786
750
|
hoverThumbHeight: string;
|
|
@@ -788,40 +752,28 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
788
752
|
thumbVerticalPosition: string;
|
|
789
753
|
hoverThumbVerticalPosition: string;
|
|
790
754
|
thumbBackgroundColor: string;
|
|
791
|
-
thumbBackgroundColorOnDark: string;
|
|
792
755
|
hoverThumbScale: string;
|
|
793
756
|
hoverThumbBackgroundColor: string;
|
|
794
|
-
hoverThumbBackgroundColorOnDark: string;
|
|
795
757
|
activeThumbScale: string;
|
|
796
758
|
activeThumbBackgroundColor: string;
|
|
797
|
-
activeThumbBackgroundColorOnDark: string;
|
|
798
759
|
focusThumbBackgroundColor: string;
|
|
799
|
-
focusThumbBackgroundColorOnDark: string;
|
|
800
760
|
tickHeight: string;
|
|
801
761
|
tickWidth: string;
|
|
802
762
|
tickVerticalPosition: string;
|
|
803
763
|
tickBackgroundColor: string;
|
|
804
|
-
tickBackgroundColorOnDark: string;
|
|
805
764
|
trackLineThickness: string;
|
|
806
765
|
trackLineVerticalPosition: string;
|
|
807
766
|
trackLineColor: string;
|
|
808
|
-
trackLineColorOnDark: string;
|
|
809
767
|
totalLineThickness: string;
|
|
810
768
|
totalLineVerticalPosition: string;
|
|
811
769
|
totalLineColor: string;
|
|
812
|
-
totalLineColorOnDark: string;
|
|
813
770
|
disabledThumbVerticalPosition: string;
|
|
814
771
|
disabledThumbBackgroundColor: string;
|
|
815
|
-
disabledThumbBackgroundColorOnDark: string;
|
|
816
772
|
disabledTickVerticalPosition: string;
|
|
817
773
|
disabledTickBackgroundColor: string;
|
|
818
|
-
disabledTickBackgroundColorOnDark: string;
|
|
819
774
|
disabledTrackLineColor: string;
|
|
820
|
-
disabledTrackLineColorOnDark: string;
|
|
821
775
|
disabledTotalLineColor: string;
|
|
822
|
-
disabledTotalLineColorOnDark: string;
|
|
823
776
|
focusColor: string;
|
|
824
|
-
focusColorOnDark: string;
|
|
825
777
|
floorLabelMarginRight: string;
|
|
826
778
|
ceilLabelMarginLeft: string;
|
|
827
779
|
inputMarginLeft: string;
|
|
@@ -835,14 +787,12 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
835
787
|
labelFontStyle: string;
|
|
836
788
|
labelFontWeight: string;
|
|
837
789
|
labelFontColor: string;
|
|
838
|
-
labelFontColorOnDark: string;
|
|
839
790
|
labelTextAlign: string;
|
|
840
791
|
progressValueFontFamily: string;
|
|
841
792
|
progressValueFontSize: string;
|
|
842
793
|
progressValueFontStyle: string;
|
|
843
794
|
progressValueFontWeight: string;
|
|
844
795
|
progressValueFontColor: string;
|
|
845
|
-
progressValueFontColorOnDark: string;
|
|
846
796
|
progressValueTextAlign: string;
|
|
847
797
|
overlayBackgroundColor: string;
|
|
848
798
|
overlayOpacity: string;
|
|
@@ -861,32 +811,21 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
861
811
|
};
|
|
862
812
|
switch: {
|
|
863
813
|
checkedTrackBackgroundColor: string;
|
|
864
|
-
checkedTrackBackgroundColorOnDark: string;
|
|
865
814
|
checkedThumbBackgroundColor: string;
|
|
866
|
-
checkedThumbBackgroundColorOnDark: string;
|
|
867
815
|
uncheckedTrackBackgroundColor: string;
|
|
868
|
-
uncheckedTrackBackgroundColorOnDark: string;
|
|
869
816
|
uncheckedThumbBackgroundColor: string;
|
|
870
|
-
uncheckedThumbBackgroundColorOnDark: string;
|
|
871
817
|
disabledCheckedTrackBackgroundColor: string;
|
|
872
|
-
disabledCheckedTrackBackgroundColorOnDark: string;
|
|
873
818
|
disabledCheckedThumbBackgroundColor: string;
|
|
874
|
-
disabledCheckedThumbBackgroundColorOnDark: string;
|
|
875
819
|
disabledUncheckedTrackBackgroundColor: string;
|
|
876
|
-
disabledUncheckedTrackBackgroundColorOnDark: string;
|
|
877
820
|
disabledUncheckedThumbBackgroundColor: string;
|
|
878
|
-
disabledUncheckedThumbBackgroundColorOnDark: string;
|
|
879
821
|
disabledLabelFontColor: string;
|
|
880
|
-
disabledLabelFontColorOnDark: string;
|
|
881
822
|
disabledLabelFontStyle: string;
|
|
882
823
|
labelFontFamily: string;
|
|
883
824
|
labelFontSize: string;
|
|
884
825
|
labelFontStyle: string;
|
|
885
826
|
labelFontWeight: string;
|
|
886
827
|
labelFontColor: string;
|
|
887
|
-
labelFontColorOnDark: string;
|
|
888
828
|
thumbFocusColor: string;
|
|
889
|
-
thumbFocusColorOnDark: string;
|
|
890
829
|
thumbHeight: string;
|
|
891
830
|
thumbWidth: string;
|
|
892
831
|
thumbShift: string;
|
|
@@ -988,130 +927,87 @@ declare const HalstackContext: React.Context<DeepPartial<{
|
|
|
988
927
|
textarea: {
|
|
989
928
|
fontFamily: string;
|
|
990
929
|
enabledBorderColor: string;
|
|
991
|
-
enabledBorderColorOnDark: string;
|
|
992
930
|
hoverBorderColor: string;
|
|
993
|
-
hoverBorderColorOnDark: string;
|
|
994
931
|
focusBorderColor: string;
|
|
995
|
-
focusBorderColorOnDark: string;
|
|
996
932
|
disabledBorderColor: string;
|
|
997
|
-
disabledBorderColorOnDark: string;
|
|
998
933
|
disabledContainerFillColor: string;
|
|
999
|
-
|
|
934
|
+
readOnlyBorderColor: string;
|
|
935
|
+
hoverReadOnlyBorderColor: string;
|
|
1000
936
|
errorBorderColor: string;
|
|
1001
|
-
errorBorderColorOnDark: string;
|
|
1002
937
|
hoverErrorBorderColor: string;
|
|
1003
|
-
hoverErrorBorderColorOnDark: string;
|
|
1004
938
|
inputMarginTop: string;
|
|
1005
939
|
inputMarginBottom: string;
|
|
1006
940
|
errorMessageColor: string;
|
|
1007
|
-
errorMessageColorOnDark: string;
|
|
1008
941
|
labelFontColor: string;
|
|
1009
|
-
labelFontColorOnDark: string;
|
|
1010
942
|
labelFontSize: string;
|
|
1011
943
|
labelFontStyle: string;
|
|
1012
944
|
labelFontWeight: string;
|
|
1013
945
|
labelLineHeight: string;
|
|
1014
946
|
disabledLabelFontColor: string;
|
|
1015
|
-
disabledLabelFontColorOnDark: string;
|
|
1016
947
|
optionalLabelFontWeight: string;
|
|
1017
948
|
helperTextFontColor: string;
|
|
1018
|
-
helperTextFontColorOnDark: string;
|
|
1019
949
|
helperTextFontSize: string;
|
|
1020
950
|
helperTextFontStyle: string;
|
|
1021
951
|
helperTextFontWeight: string;
|
|
1022
952
|
helperTextLineHeight: string;
|
|
1023
953
|
disabledHelperTextFontColor: string;
|
|
1024
|
-
disabledHelperTextFontColorOnDark: string;
|
|
1025
954
|
placeholderFontColor: string;
|
|
1026
|
-
placeholderFontColorOnDark: string;
|
|
1027
955
|
disabledPlaceholderFontColor: string;
|
|
1028
|
-
disabledPlaceholderFontColorOnDark: string;
|
|
1029
956
|
valueFontColor: string;
|
|
1030
|
-
valueFontColorOnDark: string;
|
|
1031
957
|
valueFontSize: string;
|
|
1032
958
|
valueFontStyle: string;
|
|
1033
959
|
valueFontWeight: string;
|
|
1034
960
|
disabledValueFontColor: string;
|
|
1035
|
-
disabledValueFontColorOnDark: string;
|
|
1036
961
|
};
|
|
1037
962
|
textInput: {
|
|
1038
963
|
fontFamily: string;
|
|
1039
964
|
enabledBorderColor: string;
|
|
1040
|
-
enabledBorderColorOnDark: string;
|
|
1041
965
|
hoverBorderColor: string;
|
|
1042
|
-
hoverBorderColorOnDark: string;
|
|
1043
966
|
focusBorderColor: string;
|
|
1044
|
-
focusBorderColorOnDark: string;
|
|
1045
967
|
disabledBorderColor: string;
|
|
1046
|
-
disabledBorderColorOnDark: string;
|
|
1047
968
|
disabledContainerFillColor: string;
|
|
1048
|
-
|
|
969
|
+
readOnlyBorderColor: string;
|
|
970
|
+
hoverReadOnlyBorderColor: string;
|
|
1049
971
|
errorBorderColor: string;
|
|
1050
|
-
errorBorderColorOnDark: string;
|
|
1051
972
|
hoverErrorBorderColor: string;
|
|
1052
|
-
hoverErrorBorderColorOnDark: string;
|
|
1053
973
|
inputMarginTop: string;
|
|
1054
974
|
inputMarginBottom: string;
|
|
1055
975
|
errorMessageColor: string;
|
|
1056
|
-
errorMessageColorOnDark: string;
|
|
1057
976
|
errorIconColor: string;
|
|
1058
|
-
errorIconColorOnDark: string;
|
|
1059
977
|
labelFontColor: string;
|
|
1060
|
-
labelFontColorOnDark: string;
|
|
1061
978
|
labelFontSize: string;
|
|
1062
979
|
labelFontStyle: string;
|
|
1063
980
|
labelFontWeight: string;
|
|
1064
981
|
labelLineHeight: string;
|
|
1065
982
|
disabledLabelFontColor: string;
|
|
1066
|
-
disabledLabelFontColorOnDark: string;
|
|
1067
983
|
optionalLabelFontWeight: string;
|
|
1068
984
|
helperTextFontColor: string;
|
|
1069
|
-
helperTextFontColorOnDark: string;
|
|
1070
985
|
helperTextFontSize: string;
|
|
1071
986
|
helperTextFontStyle: string;
|
|
1072
987
|
helperTextFontWeight: string;
|
|
1073
988
|
helperTextLineHeight: string;
|
|
1074
989
|
disabledHelperTextFontColor: string;
|
|
1075
|
-
disabledHelperTextFontColorOnDark: string;
|
|
1076
990
|
prefixColor: string;
|
|
1077
|
-
prefixColorOnDark: string;
|
|
1078
991
|
suffixColor: string;
|
|
1079
|
-
suffixColorOnDark: string;
|
|
1080
992
|
disabledPrefixColor: string;
|
|
1081
993
|
disabledSuffixColor: string;
|
|
1082
|
-
disabledPrefixColorOnDark: string;
|
|
1083
|
-
disabledSuffixColorOnDark: string;
|
|
1084
994
|
placeholderFontColor: string;
|
|
1085
|
-
placeholderFontColorOnDark: string;
|
|
1086
995
|
disabledPlaceholderFontColor: string;
|
|
1087
|
-
disabledPlaceholderFontColorOnDark: string;
|
|
1088
996
|
valueFontColor: string;
|
|
1089
|
-
valueFontColorOnDark: string;
|
|
1090
997
|
valueFontSize: string;
|
|
1091
998
|
valueFontStyle: string;
|
|
1092
999
|
valueFontWeight: string;
|
|
1093
1000
|
disabledValueFontColor: string;
|
|
1094
|
-
disabledValueFontColorOnDark: string;
|
|
1095
1001
|
actionIconColor: string;
|
|
1096
|
-
actionIconColorOnDark: string;
|
|
1097
1002
|
disabledActionIconColor: string;
|
|
1098
|
-
disabledActionIconColorOnDark: string;
|
|
1099
1003
|
hoverActionIconColor: string;
|
|
1100
|
-
hoverActionIconColorOnDark: string;
|
|
1101
1004
|
focusActionIconColor: string;
|
|
1102
|
-
focusActionIconColorOnDark: string;
|
|
1103
1005
|
activeActionIconColor: string;
|
|
1104
|
-
activeActionIconColorOnDark: string;
|
|
1105
1006
|
actionBackgroundColor: string;
|
|
1106
|
-
actionBackgroundColorOnDark: string;
|
|
1107
1007
|
disabledActionBackgroundColor: string;
|
|
1108
|
-
disabledActionBackgroundColorOnDark: string;
|
|
1109
1008
|
hoverActionBackgroundColor: string;
|
|
1110
|
-
hoverActionBackgroundColorOnDark: string;
|
|
1111
1009
|
focusActionBorderColor: string;
|
|
1112
|
-
focusActionBorderColorOnDark: string;
|
|
1113
1010
|
activeActionBackgroundColor: string;
|
|
1114
|
-
activeActionBackgroundColorOnDark: string;
|
|
1115
1011
|
listDialogBackgroundColor: string;
|
|
1116
1012
|
listDialogBorderColor: string;
|
|
1117
1013
|
listOptionDividerColor: string;
|
|
@@ -1323,12 +1219,12 @@ declare const HalstackLanguageContext: React.Context<DeepPartial<{
|
|
|
1323
1219
|
}>>;
|
|
1324
1220
|
/**
|
|
1325
1221
|
* This type is used to allow partial themes and labels objects to be passed to the HalstackProvider.
|
|
1326
|
-
* This is an extension of the already
|
|
1222
|
+
* This is an extension of the already existing Partial type, which only allows one level of partiality.
|
|
1327
1223
|
*/
|
|
1328
|
-
|
|
1224
|
+
type DeepPartial<T> = {
|
|
1329
1225
|
[P in keyof T]?: Partial<T[P]>;
|
|
1330
1226
|
};
|
|
1331
|
-
|
|
1227
|
+
type HalstackProviderPropsType = {
|
|
1332
1228
|
theme?: DeepPartial<OpinionatedTheme>;
|
|
1333
1229
|
advancedTheme?: DeepPartial<AdvancedTheme>;
|
|
1334
1230
|
labels?: DeepPartial<TranslatedLabels>;
|
package/HalstackContext.js
CHANGED
|
@@ -1,36 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports["default"] = exports.HalstackProvider = exports.HalstackLanguageContext = void 0;
|
|
11
|
-
|
|
12
9
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
|
-
|
|
14
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
|
|
16
11
|
var _color = _interopRequireDefault(require("color"));
|
|
17
|
-
|
|
18
12
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
19
|
-
|
|
20
13
|
var _variables = require("./common/variables");
|
|
21
|
-
|
|
22
14
|
var _templateObject;
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
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; }
|
|
27
|
-
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
28
17
|
var HalstackContext = /*#__PURE__*/_react["default"].createContext(null);
|
|
29
|
-
|
|
30
|
-
var HalstackLanguageContext = /*#__PURE__*/_react["default"].createContext(null);
|
|
31
|
-
|
|
32
|
-
exports.HalstackLanguageContext = HalstackLanguageContext;
|
|
33
|
-
|
|
18
|
+
var HalstackLanguageContext = exports.HalstackLanguageContext = /*#__PURE__*/_react["default"].createContext(null);
|
|
34
19
|
var addLightness = function addLightness(newLightness, hexColor) {
|
|
35
20
|
try {
|
|
36
21
|
if (hexColor) {
|
|
@@ -43,7 +28,6 @@ var addLightness = function addLightness(newLightness, hexColor) {
|
|
|
43
28
|
return null;
|
|
44
29
|
}
|
|
45
30
|
};
|
|
46
|
-
|
|
47
31
|
var subLightness = function subLightness(newLightness, hexColor) {
|
|
48
32
|
try {
|
|
49
33
|
if (hexColor) {
|
|
@@ -56,7 +40,6 @@ var subLightness = function subLightness(newLightness, hexColor) {
|
|
|
56
40
|
return null;
|
|
57
41
|
}
|
|
58
42
|
};
|
|
59
|
-
|
|
60
43
|
var parseAdvancedTheme = function parseAdvancedTheme(advancedTheme) {
|
|
61
44
|
var allTokensCopy = JSON.parse(JSON.stringify(_variables.componentTokens));
|
|
62
45
|
Object.keys(allTokensCopy).map(function (component) {
|
|
@@ -70,10 +53,8 @@ var parseAdvancedTheme = function parseAdvancedTheme(advancedTheme) {
|
|
|
70
53
|
});
|
|
71
54
|
return allTokensCopy;
|
|
72
55
|
};
|
|
73
|
-
|
|
74
56
|
var parseTheme = function parseTheme(theme) {
|
|
75
57
|
var _theme$alert$baseColo, _theme$alert, _theme$alert$accentCo, _theme$alert2, _theme$alert$accentCo2, _theme$alert3, _theme$alert$overlayC, _theme$alert4, _theme$accordion$assi, _theme$accordion, _theme$accordion$titl, _theme$accordion2, _theme$accordion$acce, _theme$accordion3, _theme$accordion$acce2, _theme$accordion4, _addLightness, _theme$accordion5, _theme$box$baseColor, _theme$box, _theme$button$primary, _theme$button, _theme$button$baseCol, _theme$button2, _theme$button$baseCol2, _theme$button3, _theme$button$seconda, _theme$button4, _theme$button$baseCol3, _theme$button5, _theme$button$baseCol4, _theme$button6, _theme$button$baseCol5, _theme$button7, _subLightness, _theme$button8, _subLightness2, _theme$button9, _subLightness3, _theme$button10, _addLightness2, _theme$button11, _addLightness3, _theme$button12, _theme$checkbox$baseC, _theme$checkbox, _theme$checkbox$baseC2, _theme$checkbox2, _theme$checkbox$check, _theme$checkbox3, _theme$checkbox$fontC, _theme$checkbox4, _subLightness4, _theme$checkbox5, _subLightness5, _theme$checkbox6, _theme$chip$baseColor, _theme$chip, _theme$chip$fontColor, _theme$chip2, _theme$chip$iconColor, _theme$chip3, _subLightness6, _theme$chip4, _subLightness7, _theme$chip5, _theme$dateInput$base, _theme$dateInput, _theme$dateInput$sele, _theme$dateInput2, _subLightness8, _theme$dateInput3, _theme$dateInput$sele2, _theme$dateInput4, _theme$dateInput$base2, _theme$dateInput5, _subLightness9, _theme$dateInput6, _theme$dateInput$sele3, _theme$dateInput7, _addLightness4, _theme$dateInput8, _addLightness5, _theme$dateInput9, _addLightness6, _theme$dateInput10, _theme$dialog$baseCol, _theme$dialog, _theme$dialog$closeIc, _theme$dialog2, _theme$dialog$overlay, _theme$dialog3, _theme$dropdown$baseC, _theme$dropdown, _theme$dropdown$fontC, _theme$dropdown2, _theme$dropdown$fontC2, _theme$dropdown3, _theme$dropdown$fontC3, _theme$dropdown4, _theme$dropdown$optio, _theme$dropdown5, _theme$dropdown$optio2, _theme$dropdown6, _subLightness10, _theme$dropdown7, _subLightness11, _theme$dropdown8, _subLightness12, _theme$dropdown9, _subLightness13, _theme$dropdown10, _theme$fileInput$font, _theme$fileInput, _theme$fileInput$font2, _theme$fileInput2, _theme$fileInput$font3, _theme$fileInput3, _theme$fileInput$font4, _theme$fileInput4, _theme$footer$baseCol, _theme$footer, _theme$footer$fontCol, _theme$footer2, _theme$footer$fontCol2, _theme$footer3, _theme$footer$fontCol3, _theme$footer4, _theme$footer$accentC, _theme$footer5, _theme$footer$logo, _theme$footer6, _theme$header$baseCol, _theme$header, _theme$header$accentC, _theme$header2, _theme$header$menuBas, _theme$header3, _theme$header$fontCol, _theme$header4, _theme$header$hamburg, _theme$header5, _addLightness7, _theme$header6, _theme$header$logo, _theme$header7, _theme$header$logoRes, _theme$header8, _theme$header$content, _theme$header9, _theme$header$overlay, _theme$header10, _theme$link$baseColor, _theme$link, _theme$link$baseColor2, _theme$link2, _theme$navTabs$baseCo, _theme$navTabs, _theme$navTabs$baseCo2, _theme$navTabs2, _theme$navTabs$baseCo3, _theme$navTabs3, _theme$navTabs$baseCo4, _theme$navTabs4, _theme$navTabs$accent, _theme$navTabs5, _addLightness8, _theme$navTabs6, _addLightness9, _theme$navTabs7, _theme$paginator$base, _theme$paginator, _theme$paginator$font, _theme$paginator2, _theme$progressBar$ac, _theme$progressBar, _theme$progressBar$ba, _theme$progressBar2, _theme$progressBar$fo, _theme$progressBar3, _theme$progressBar$fo2, _theme$progressBar4, _theme$progressBar$fo3, _theme$progressBar5, _theme$progressBar$ov, _theme$progressBar6, _theme$progressBar$ov2, _theme$progressBar7, _theme$quickNav$fontC, _theme$quickNav, _theme$quickNav$accen, _theme$quickNav2, _theme$radioGroup$bas, _theme$radioGroup, _theme$radioGroup$fon, _theme$radioGroup2, _theme$radioGroup$fon2, _theme$radioGroup3, _theme$radioGroup$fon3, _theme$radioGroup4, _subLightness14, _theme$radioGroup5, _subLightness15, _theme$radioGroup6, _theme$select$selecte, _theme$select, _theme$select$fontCol, _theme$select2, _theme$select$fontCol2, _theme$select3, _theme$select$fontCol3, _theme$select4, _theme$select$optionF, _theme$select5, _addLightness10, _theme$select6, _theme$select$fontCol4, _theme$select7, _theme$select$hoverBo, _theme$select8, _subLightness16, _theme$select9, _subLightness17, _theme$select10, _theme$sidenav$baseCo, _theme$sidenav, _theme$slider$fontCol, _theme$slider, _theme$slider$fontCol2, _theme$slider2, _theme$slider$fontCol3, _theme$slider3, _theme$slider$baseCol, _theme$slider4, _theme$slider$baseCol2, _theme$slider5, _theme$slider$baseCol3, _theme$slider6, _theme$slider$baseCol4, _theme$slider7, _theme$slider$totalLi, _theme$slider8, _subLightness18, _theme$slider9, _subLightness19, _theme$slider10, _theme$spinner$accent, _theme$spinner, _theme$spinner$baseCo, _theme$spinner2, _theme$spinner$overla, _theme$spinner3, _theme$spinner$fontCo, _theme$spinner4, _theme$spinner$fontCo2, _theme$spinner5, _theme$spinner$overla2, _theme$spinner6, _theme$spinner$overla3, _theme$spinner7, _theme$switch$checked, _theme$switch, _theme$switch$fontCol, _theme$switch2, _addLightness11, _theme$switch3, _theme$table$baseColo, _theme$table, _theme$table$headerFo, _theme$table2, _theme$table$cellFont, _theme$table3, _theme$table$headerFo2, _theme$table4, _theme$tabs$baseColor, _theme$tabs, _theme$tabs$baseColor2, _theme$tabs2, _theme$tabs$baseColor3, _theme$tabs3, _theme$tabs$baseColor4, _theme$tabs4, _addLightness12, _theme$tabs5, _addLightness13, _theme$tabs6, _theme$tag$fontColor, _theme$tag, _theme$tag$iconColor, _theme$tag2, _theme$textInput$font, _theme$textInput, _theme$textInput$font2, _theme$textInput2, _theme$textInput$font3, _theme$textInput3, _theme$textInput$font4, _theme$textInput4, _theme$textInput$font5, _theme$textInput5, _theme$textInput$font6, _theme$textInput6, _theme$textInput$font7, _theme$textInput7, _theme$textInput$hove, _theme$textInput8, _addLightness14, _theme$textInput9, _addLightness15, _theme$textInput10, _addLightness16, _theme$textInput11, _theme$textarea$fontC, _theme$textarea, _theme$textarea$fontC2, _theme$textarea2, _theme$textarea$fontC3, _theme$textarea3, _theme$textarea$hover, _theme$textarea4, _addLightness17, _theme$textarea5, _theme$toggleGroup$se, _theme$toggleGroup, _theme$toggleGroup$se2, _theme$toggleGroup2, _theme$toggleGroup$un, _theme$toggleGroup3, _theme$toggleGroup$se3, _theme$toggleGroup4, _theme$toggleGroup$un2, _theme$toggleGroup5, _subLightness20, _theme$toggleGroup6, _subLightness21, _theme$toggleGroup7, _addLightness18, _theme$toggleGroup8, _addLightness19, _theme$toggleGroup9, _subLightness22, _theme$toggleGroup10, _theme$wizard$baseCol, _theme$wizard, _theme$wizard$selecte, _theme$wizard2, _theme$wizard$baseCol2, _theme$wizard3, _theme$wizard$fontCol, _theme$wizard4, _theme$wizard$fontCol2, _theme$wizard5, _theme$wizard$fontCol3, _theme$wizard6, _theme$wizard$fontCol4, _theme$wizard7, _addLightness20, _theme$wizard8, _addLightness21, _theme$wizard9, _addLightness22, _theme$wizard10, _addLightness23, _theme$wizard11;
|
|
76
|
-
|
|
77
58
|
var componentTokensCopy = JSON.parse(JSON.stringify(_variables.componentTokens));
|
|
78
59
|
var alertTokens = componentTokensCopy.alert;
|
|
79
60
|
alertTokens.infoBackgroundColor = (_theme$alert$baseColo = theme === null || theme === void 0 ? void 0 : (_theme$alert = theme.alert) === null || _theme$alert === void 0 ? void 0 : _theme$alert.baseColor) !== null && _theme$alert$baseColo !== void 0 ? _theme$alert$baseColo : alertTokens.infoBackgroundColor;
|
|
@@ -289,7 +270,6 @@ var parseTheme = function parseTheme(theme) {
|
|
|
289
270
|
wizardTokens.unvisitedHelperTextFontColor = (_addLightness23 = addLightness(40, theme === null || theme === void 0 ? void 0 : (_theme$wizard11 = theme.wizard) === null || _theme$wizard11 === void 0 ? void 0 : _theme$wizard11.fontColor)) !== null && _addLightness23 !== void 0 ? _addLightness23 : wizardTokens.unvisitedHelperTextFontColor;
|
|
290
271
|
return componentTokensCopy;
|
|
291
272
|
};
|
|
292
|
-
|
|
293
273
|
var parseLabels = function parseLabels(labels) {
|
|
294
274
|
var parsedLabels = _variables.defaultTranslatedComponentLabels;
|
|
295
275
|
Object.keys(labels).map(function (component) {
|
|
@@ -303,17 +283,17 @@ var parseLabels = function parseLabels(labels) {
|
|
|
303
283
|
});
|
|
304
284
|
return parsedLabels;
|
|
305
285
|
};
|
|
286
|
+
|
|
306
287
|
/**
|
|
307
288
|
* This type is used to allow partial themes and labels objects to be passed to the HalstackProvider.
|
|
308
|
-
* This is an extension of the already
|
|
289
|
+
* This is an extension of the already existing Partial type, which only allows one level of partiality.
|
|
309
290
|
*/
|
|
310
291
|
|
|
311
|
-
|
|
312
|
-
var HalstackProvider = function HalstackProvider(_ref) {
|
|
292
|
+
var HalstackProvider = exports.HalstackProvider = function HalstackProvider(_ref) {
|
|
313
293
|
var theme = _ref.theme,
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
294
|
+
advancedTheme = _ref.advancedTheme,
|
|
295
|
+
labels = _ref.labels,
|
|
296
|
+
children = _ref.children;
|
|
317
297
|
var parsedTheme = (0, _react.useMemo)(function () {
|
|
318
298
|
return theme ? parseTheme(theme) : advancedTheme ? parseAdvancedTheme(advancedTheme) : _variables.componentTokens;
|
|
319
299
|
}, [theme, advancedTheme]);
|
|
@@ -326,10 +306,5 @@ var HalstackProvider = function HalstackProvider(_ref) {
|
|
|
326
306
|
value: parsedLabels
|
|
327
307
|
}, children)));
|
|
328
308
|
};
|
|
329
|
-
|
|
330
|
-
exports.HalstackProvider = HalstackProvider;
|
|
331
|
-
|
|
332
309
|
var Halstack = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n @import url(\"https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;0,800;1,300;1,400;1,600;1,700;1,800&display=swap\");\n"])));
|
|
333
|
-
|
|
334
|
-
var _default = HalstackContext;
|
|
335
|
-
exports["default"] = _default;
|
|
310
|
+
var _default = exports["default"] = HalstackContext;
|