@kaizen/components 1.4.19 → 1.4.20-canary.3469
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/dist/esm/index.js +0 -53
- package/dist/iife/Icon.module-VD7NKLAR-VD7NKLAR.scss +72 -0
- package/dist/iife/KaizenProvider/ThemeProvider/ThemeManager.js +420 -398
- package/dist/iife/KaizenProvider/ThemeProvider/ThemeManager.spec.js +423 -404
- package/dist/iife/KaizenProvider/ThemeProvider/index.js +434 -412
- package/dist/iife/KaizenProvider/index.js +436 -414
- package/dist/iife/__future__/index.js +915 -594
- package/dist/iife/index.js +1965 -115235
- package/dist/index.d.ts +1 -41
- package/dist/index.js +1 -54
- package/package.json +32 -32
- package/dist/iife/ActionButton.module-LHTIA2D3.scss +0 -10
- package/dist/iife/Avatar.module-GUG7HXMZ.scss +0 -165
- package/dist/iife/AvatarGroup.module-QAVTI4PR.scss +0 -85
- package/dist/iife/Base.module-DJPJNUQ5.scss +0 -80
- package/dist/iife/BaseButton.module-4FKZZLVI.scss +0 -103
- package/dist/iife/Brand.module-FCHTLJQK.scss +0 -4
- package/dist/iife/BrandMoment.module-4P7H2D3W.scss +0 -196
- package/dist/iife/Calendar.module-H7XBQXTA.scss +0 -211
- package/dist/iife/CalendarRange.module-QWW624PJ.scss +0 -64
- package/dist/iife/CalendarSingle.module-N2P3DWLM.scss +0 -18
- package/dist/iife/Card.module-VEUOO2LT.scss +0 -38
- package/dist/iife/Collapsible.module-ZJNVWQIB.scss +0 -119
- package/dist/iife/CollapsibleGroup.module-UR2SIYLJ.scss +0 -10
- package/dist/iife/ConfirmationModal.module-RN2H7KPL.scss +0 -157
- package/dist/iife/Content.module-6CTLBAHR.scss +0 -25
- package/dist/iife/ContextModal.module-TTFVPUPU.scss +0 -77
- package/dist/iife/DateInput.module-YBXARKD2.scss +0 -3
- package/dist/iife/DateInputDescription.module-SGAJNB7K.scss +0 -19
- package/dist/iife/DateInputField.module-2LG4I24X.scss +0 -5
- package/dist/iife/DateInputWithIconButton.module-RSUEQ345.scss +0 -53
- package/dist/iife/DateRangePicker.module-EIUGUIIA.scss +0 -115
- package/dist/iife/DropdownButton.module-WZ6FRRPS.scss +0 -44
- package/dist/iife/EditableRichTextContent.module-N2SFSI5C.scss +0 -25
- package/dist/iife/EmptyState.module-DOSURL5X.scss +0 -156
- package/dist/iife/ExpertAdviceCollapsible.module-L554JCXB.scss +0 -47
- package/dist/iife/FilterMenuButton.module-26EL5K3H.scss +0 -19
- package/dist/iife/FilterSplitButton.module-LMMEHFXQ.scss +0 -133
- package/dist/iife/FloatingCalendarWrapper.module-62NLSOUD.scss +0 -12
- package/dist/iife/GenericModal.module-DW6NSOGA.scss +0 -110
- package/dist/iife/GenericModalSection.module-MJ4MTMSP.scss +0 -7
- package/dist/iife/GenericNotification.module-DAERSOHE.scss +0 -115
- package/dist/iife/GenericTile.module-ZXQ4XWP4.scss +0 -136
- package/dist/iife/GuidanceBlock.module-FAHJFZMK.scss +0 -324
- package/dist/iife/HeroCard.module-LXHTKJTW.scss +0 -106
- package/dist/iife/InputEditModal.module-X3TLJPFO.scss +0 -36
- package/dist/iife/LikertScaleLegacy.module-JYCJ5CON.scss +0 -298
- package/dist/iife/LinkPopover-7NCAPCQ3.scss +0 -22
- package/dist/iife/MainActions.module-T43D33YO.scss +0 -16
- package/dist/iife/MenuDropdown.module-DYV6JLT6.scss +0 -26
- package/dist/iife/MenuItem.module-LD7ZYX4T.scss +0 -99
- package/dist/iife/MenuList.module-44RMG7CF.scss +0 -35
- package/dist/iife/MobileActions.module-Z6PD4VIR.scss +0 -198
- package/dist/iife/ModalAccessibleDescription.module-NIJNKHHO.scss +0 -3
- package/dist/iife/ModalAccessibleLabel.module-NG26HDU4.scss +0 -58
- package/dist/iife/ModalFooter.module-TK3HAXMB.scss +0 -69
- package/dist/iife/ModalHeader.module-6SW7KZ22.scss +0 -23
- package/dist/iife/MultiActionTile.module-4Y2NA4H6.scss +0 -3
- package/dist/iife/NavigationTabs.module-VDIXMFXJ.scss +0 -108
- package/dist/iife/Pagination.module-U5S6WZ5K.scss +0 -124
- package/dist/iife/Popover.module-5ZQUBHXG.scss +0 -264
- package/dist/iife/ProgressBar.module-RL2UWVEH.scss +0 -91
- package/dist/iife/RichTextContent.module-4HA44IM4.scss +0 -5
- package/dist/iife/RichTextEditor.module-ZHXEK4XJ.scss +0 -97
- package/dist/iife/RoadblockModal.module-KVZCYLF2.scss +0 -45
- package/dist/iife/Select.module-6LHWOGGY.scss +0 -391
- package/dist/iife/Skirt.module-S3GPHMMQ.scss +0 -32
- package/dist/iife/SkirtCard.module-6YQ4PS2K.scss +0 -16
- package/dist/iife/SplitButton.module-WMGCIDDK.scss +0 -4
- package/dist/iife/StatelessMenu.module-SX2T5P4I.scss +0 -3
- package/dist/iife/Table.module-LCDRXCBP.scss +0 -233
- package/dist/iife/Tabs.module-BUPNPYW4.scss +0 -172
- package/dist/iife/Tag.module-T6PQJLSW.scss +0 -268
- package/dist/iife/TileGrid.module-NJQFVYRS.scss +0 -23
- package/dist/iife/TimeField.module-B4WNYAUE.scss +0 -75
- package/dist/iife/TimeSegment.module-TKOTKIXH.scss +0 -53
- package/dist/iife/TitleBlockMenuItem.module-LWVSMJTH.scss +0 -99
- package/dist/iife/TitleBlockZen.module-OK3QIC4Y.scss +0 -695
- package/dist/iife/ToastNotificationsList.module-EHDVGWDW.scss +0 -26
- package/dist/iife/ToggleIconButton.module-COM67MDC.scss +0 -132
- package/dist/iife/Toolbar.module-3BZYZE6H.scss +0 -44
- package/dist/iife/Toolbar.module-BP3GTBGW.scss +0 -6
- package/dist/iife/ToolbarSection.module-LZTHWGO7.scss +0 -15
- package/dist/iife/Well.module-4TIRC3HQ.scss +0 -73
- package/dist/iife/add-link.icon-2JH25LOT.svg +0 -3
- package/dist/iife/arrow-left.icon-RWWYLDT3.svg +0 -17
- package/dist/iife/arrow-right.icon-3ZGNCW3O.svg +0 -17
- package/dist/iife/bold.icon-FEZQ56AP.svg +0 -3
- package/dist/iife/bulletted-list.icon-ZDSXNO72.svg +0 -3
- package/dist/iife/caution.icon-BHBJMNMA.svg +0 -1
- package/dist/iife/clear-white.icon-O3ZK5Z2K.svg +0 -18
- package/dist/iife/close.icon-7H6W45MB.svg +0 -1
- package/dist/iife/date-start.icon-NV4EVRXI.svg +0 -17
- package/dist/iife/decrease-indent.icon-VAYQUHQG.svg +0 -3
- package/dist/iife/edit.icon-YJ4EIXHJ.svg +0 -17
- package/dist/iife/ellipsis.icon-DECY5OPU.svg +0 -17
- package/dist/iife/exclamation.icon-FJBHW7NP.svg +0 -17
- package/dist/iife/external-link.icon-7FNRTMN2.svg +0 -17
- package/dist/iife/hamburger.icon-YHQT7RB6.svg +0 -17
- package/dist/iife/increase-indent.icon-3XUPJEBD.svg +0 -3
- package/dist/iife/information-white.icon-3DXZDERC.svg +0 -19
- package/dist/iife/information.icon-5LHKLG66.svg +0 -17
- package/dist/iife/italics.icon-WWQDZP3S.svg +0 -3
- package/dist/iife/meatballs.icon-DECY5OPU.svg +0 -17
- package/dist/iife/numbered-list.icon-WPE4LE5R.svg +0 -3
- package/dist/iife/remove-link.icon-QMFTP7WO.svg +0 -3
- package/dist/iife/sort-ascending.icon-E24DTSHO.svg +0 -17
- package/dist/iife/sort-descending.icon-4SMPW2PG.svg +0 -17
- package/dist/iife/success-white.icon-VXFA2PUU.svg +0 -18
- package/dist/iife/underline.icon-ACYVVVSD.svg +0 -3
- package/dist/iife/user.icon-24JPACDP.svg +0 -17
- package/dist/styles.css +0 -98
- /package/dist/iife/{Dropdown.module-4CIBZTRZ.scss → Dropdown.module-4CIBZTRZ-4CIBZTRZ.scss} +0 -0
- /package/dist/iife/{Layout.module-MZ6JYT46.scss → Layout.module-MZ6JYT46-MZ6JYT46.scss} +0 -0
- /package/dist/iife/{Margin.module-DJURK5K7.scss → Margin.module-DJURK5K7-DJURK5K7.scss} +0 -0
- /package/dist/iife/{Menu.module-N76N74LN.scss → Menu.module-N76N74LN-N76N74LN.scss} +0 -0
- /package/dist/iife/{Padding.module-QSNUEZBU.scss → Padding.module-QSNUEZBU-QSNUEZBU.scss} +0 -0
- /package/dist/iife/{SkipLink.module-KAZA7PAL.scss → SkipLink.module-KAZA7PAL-KAZA7PAL.scss} +0 -0
- /package/dist/iife/{Text.module-SXGFOHGJ.scss → Text.module-SXGFOHGJ-SXGFOHGJ.scss} +0 -0
- /package/dist/iife/{VisuallyHidden.module-E5JUNEF5.scss → VisuallyHidden.module-E5JUNEF5-E5JUNEF5.scss} +0 -0
|
@@ -6,9 +6,16 @@
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __esm = (fn, res) => function __init() {
|
|
10
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
11
|
+
};
|
|
9
12
|
var __commonJS = (cb, mod) => function __require() {
|
|
10
13
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
11
14
|
};
|
|
15
|
+
var __export = (target, all) => {
|
|
16
|
+
for (var name in all)
|
|
17
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
+
};
|
|
12
19
|
var __copyProps = (to, from, except, desc) => {
|
|
13
20
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
21
|
for (let key of __getOwnPropNames(from))
|
|
@@ -17,6 +24,7 @@
|
|
|
17
24
|
}
|
|
18
25
|
return to;
|
|
19
26
|
};
|
|
27
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
28
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
29
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
30
|
// file that has been converted to a CommonJS file using a Babel-
|
|
@@ -26,13 +34,12 @@
|
|
|
26
34
|
mod
|
|
27
35
|
));
|
|
28
36
|
|
|
29
|
-
// ../design-tokens/
|
|
30
|
-
var
|
|
31
|
-
|
|
37
|
+
// ../design-tokens/src/themes/heart.ts
|
|
38
|
+
var heartTheme;
|
|
39
|
+
var init_heart = __esm({
|
|
40
|
+
"../design-tokens/src/themes/heart.ts"() {
|
|
32
41
|
"use strict";
|
|
33
|
-
|
|
34
|
-
exports.heartTheme = void 0;
|
|
35
|
-
exports.heartTheme = {
|
|
42
|
+
heartTheme = {
|
|
36
43
|
themeKey: "heart",
|
|
37
44
|
animation: {
|
|
38
45
|
easingFunction: {
|
|
@@ -343,26 +350,21 @@
|
|
|
343
350
|
}
|
|
344
351
|
});
|
|
345
352
|
|
|
346
|
-
// ../design-tokens/
|
|
347
|
-
var
|
|
348
|
-
|
|
353
|
+
// ../design-tokens/src/themes/index.ts
|
|
354
|
+
var defaultTheme;
|
|
355
|
+
var init_themes = __esm({
|
|
356
|
+
"../design-tokens/src/themes/index.ts"() {
|
|
349
357
|
"use strict";
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
var heart_2 = require_heart();
|
|
354
|
-
Object.defineProperty(exports, "heartTheme", { enumerable: true, get: function() {
|
|
355
|
-
return heart_2.heartTheme;
|
|
356
|
-
} });
|
|
357
|
-
exports.defaultTheme = heart_1.heartTheme;
|
|
358
|
+
init_heart();
|
|
359
|
+
init_heart();
|
|
360
|
+
defaultTheme = heartTheme;
|
|
358
361
|
}
|
|
359
362
|
});
|
|
360
363
|
|
|
361
|
-
// ../design-tokens/
|
|
362
|
-
var
|
|
363
|
-
"../design-tokens/
|
|
364
|
+
// ../design-tokens/src/types.ts
|
|
365
|
+
var init_types = __esm({
|
|
366
|
+
"../design-tokens/src/types.ts"() {
|
|
364
367
|
"use strict";
|
|
365
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
366
368
|
}
|
|
367
369
|
});
|
|
368
370
|
|
|
@@ -1070,236 +1072,157 @@
|
|
|
1070
1072
|
}
|
|
1071
1073
|
});
|
|
1072
1074
|
|
|
1073
|
-
// ../design-tokens/
|
|
1074
|
-
var
|
|
1075
|
-
|
|
1075
|
+
// ../design-tokens/src/lib/cssVariables.ts
|
|
1076
|
+
var import_lodash, objectPathToCssVarFunction, objectPathToCssVarIdentifier;
|
|
1077
|
+
var init_cssVariables = __esm({
|
|
1078
|
+
"../design-tokens/src/lib/cssVariables.ts"() {
|
|
1076
1079
|
"use strict";
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
}
|
|
1080
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1081
|
-
exports.objectPathToCssVarIdentifier = exports.objectPathToCssVarFunction = void 0;
|
|
1082
|
-
var lodash_kebabcase_1 = __importDefault(require_lodash());
|
|
1083
|
-
var objectPathToCssVarFunction = function(path, value) {
|
|
1084
|
-
return "var(".concat((0, exports.objectPathToCssVarIdentifier)(path), ", ").concat(value, ")");
|
|
1085
|
-
};
|
|
1086
|
-
exports.objectPathToCssVarFunction = objectPathToCssVarFunction;
|
|
1087
|
-
var objectPathToCssVarIdentifier = function(path) {
|
|
1088
|
-
return "--".concat(path.map(lodash_kebabcase_1.default).join("-"));
|
|
1089
|
-
};
|
|
1090
|
-
exports.objectPathToCssVarIdentifier = objectPathToCssVarIdentifier;
|
|
1080
|
+
import_lodash = __toESM(require_lodash());
|
|
1081
|
+
objectPathToCssVarFunction = (path, value) => `var(${objectPathToCssVarIdentifier(path)}, ${value})`;
|
|
1082
|
+
objectPathToCssVarIdentifier = (path) => `--${path.map(import_lodash.default).join("-")}`;
|
|
1091
1083
|
}
|
|
1092
1084
|
});
|
|
1093
1085
|
|
|
1094
|
-
// ../design-tokens/
|
|
1095
|
-
var
|
|
1096
|
-
|
|
1086
|
+
// ../design-tokens/src/lib/addExtraThemeEntries.ts
|
|
1087
|
+
var import_color_string, addExtraThemeEntries;
|
|
1088
|
+
var init_addExtraThemeEntries = __esm({
|
|
1089
|
+
"../design-tokens/src/lib/addExtraThemeEntries.ts"() {
|
|
1097
1090
|
"use strict";
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
1108
|
-
};
|
|
1109
|
-
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
1110
|
-
return mod && mod.__esModule ? mod : { "default": mod };
|
|
1111
|
-
};
|
|
1112
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1113
|
-
exports.addExtraThemeEntries = void 0;
|
|
1114
|
-
var color_string_1 = __importDefault(require_color_string());
|
|
1115
|
-
var cssVariables_1 = require_cssVariables();
|
|
1116
|
-
var addExtraThemeEntries = function(path, key, value, printValue, _a) {
|
|
1117
|
-
var _b;
|
|
1118
|
-
var augmentWithId = _a.augmentWithId;
|
|
1119
|
-
var colorRgb = typeof value === "string" ? color_string_1.default.get.rgb(value) : null;
|
|
1120
|
-
var result = (_b = {}, _b[key] = printValue(path, value), _b);
|
|
1091
|
+
import_color_string = __toESM(require_color_string());
|
|
1092
|
+
init_cssVariables();
|
|
1093
|
+
addExtraThemeEntries = (path, key, value, printValue, {
|
|
1094
|
+
augmentWithId
|
|
1095
|
+
}) => {
|
|
1096
|
+
const colorRgb = typeof value === "string" ? import_color_string.default.get.rgb(value) : null;
|
|
1097
|
+
const result = {
|
|
1098
|
+
[key]: printValue(path, value)
|
|
1099
|
+
};
|
|
1121
1100
|
if (colorRgb) {
|
|
1122
1101
|
result[key] = printValue(path, value).toLowerCase();
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
result[
|
|
1102
|
+
const rgbPath = [...path, "rgb"];
|
|
1103
|
+
const rgbTriple = printValue(rgbPath, colorRgb.slice(0, 3).join(", "));
|
|
1104
|
+
result[`${key}-rgb`] = rgbTriple;
|
|
1126
1105
|
if (augmentWithId) {
|
|
1127
|
-
result[
|
|
1106
|
+
result[`${key}-rgb-id`] = objectPathToCssVarIdentifier(rgbPath);
|
|
1128
1107
|
}
|
|
1129
1108
|
}
|
|
1130
1109
|
if (augmentWithId) {
|
|
1131
|
-
result[
|
|
1110
|
+
result[`${key}-id`] = objectPathToCssVarIdentifier(path);
|
|
1132
1111
|
}
|
|
1133
1112
|
return result;
|
|
1134
1113
|
};
|
|
1135
|
-
exports.addExtraThemeEntries = addExtraThemeEntries;
|
|
1136
1114
|
}
|
|
1137
1115
|
});
|
|
1138
1116
|
|
|
1139
|
-
// ../design-tokens/
|
|
1140
|
-
|
|
1141
|
-
|
|
1117
|
+
// ../design-tokens/src/lib/mapLeafsOfObject.ts
|
|
1118
|
+
function mapLeafsOfObject(object, mapper) {
|
|
1119
|
+
const recurser = (currentPath, obj) => {
|
|
1120
|
+
const handleEntry = (key, value) => {
|
|
1121
|
+
const pathToKey = [...currentPath, key];
|
|
1122
|
+
if (typeof value === "object" && value !== null && value !== void 0) {
|
|
1123
|
+
return recurser(pathToKey, value);
|
|
1124
|
+
}
|
|
1125
|
+
return mapper(pathToKey, value);
|
|
1126
|
+
};
|
|
1127
|
+
return Object.entries(obj).reduce(
|
|
1128
|
+
(acc, [nextKey, nextValue]) => ({
|
|
1129
|
+
...acc,
|
|
1130
|
+
[nextKey]: handleEntry(nextKey, nextValue)
|
|
1131
|
+
}),
|
|
1132
|
+
{}
|
|
1133
|
+
);
|
|
1134
|
+
};
|
|
1135
|
+
return recurser([], object);
|
|
1136
|
+
}
|
|
1137
|
+
var init_mapLeafsOfObject = __esm({
|
|
1138
|
+
"../design-tokens/src/lib/mapLeafsOfObject.ts"() {
|
|
1142
1139
|
"use strict";
|
|
1143
|
-
var __assign = exports && exports.__assign || function() {
|
|
1144
|
-
__assign = Object.assign || function(t) {
|
|
1145
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
1146
|
-
s = arguments[i];
|
|
1147
|
-
for (var p in s)
|
|
1148
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
1149
|
-
t[p] = s[p];
|
|
1150
|
-
}
|
|
1151
|
-
return t;
|
|
1152
|
-
};
|
|
1153
|
-
return __assign.apply(this, arguments);
|
|
1154
|
-
};
|
|
1155
|
-
var __spreadArray = exports && exports.__spreadArray || function(to, from, pack) {
|
|
1156
|
-
if (pack || arguments.length === 2)
|
|
1157
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
1158
|
-
if (ar || !(i in from)) {
|
|
1159
|
-
if (!ar)
|
|
1160
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
1161
|
-
ar[i] = from[i];
|
|
1162
|
-
}
|
|
1163
|
-
}
|
|
1164
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
1165
|
-
};
|
|
1166
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1167
|
-
exports.mapLeafsOfObject = void 0;
|
|
1168
|
-
function mapLeafsOfObject(object, mapper) {
|
|
1169
|
-
var recurser = function(currentPath, obj) {
|
|
1170
|
-
var handleEntry = function(key, value) {
|
|
1171
|
-
var pathToKey = __spreadArray(__spreadArray([], currentPath, true), [key], false);
|
|
1172
|
-
if (typeof value === "object" && value !== null && value !== void 0) {
|
|
1173
|
-
return recurser(pathToKey, value);
|
|
1174
|
-
}
|
|
1175
|
-
return mapper(pathToKey, value);
|
|
1176
|
-
};
|
|
1177
|
-
return Object.entries(obj).reduce(function(acc, _a) {
|
|
1178
|
-
var _b;
|
|
1179
|
-
var nextKey = _a[0], nextValue = _a[1];
|
|
1180
|
-
return __assign(__assign({}, acc), (_b = {}, _b[nextKey] = handleEntry(nextKey, nextValue), _b));
|
|
1181
|
-
}, {});
|
|
1182
|
-
};
|
|
1183
|
-
return recurser([], object);
|
|
1184
|
-
}
|
|
1185
|
-
exports.mapLeafsOfObject = mapLeafsOfObject;
|
|
1186
1140
|
}
|
|
1187
1141
|
});
|
|
1188
1142
|
|
|
1189
|
-
// ../design-tokens/
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1143
|
+
// ../design-tokens/src/lib/makeCssVariableDefinitionsMap.ts
|
|
1144
|
+
function makeCssVariableDefinitionsMap(theme) {
|
|
1145
|
+
let accumulatedCssVariables = {};
|
|
1146
|
+
mapLeafsOfObject(theme, (path, value) => {
|
|
1147
|
+
const key = objectPathToCssVarIdentifier(path);
|
|
1148
|
+
const nextCssVariables = addExtraThemeEntries(
|
|
1149
|
+
path,
|
|
1150
|
+
key,
|
|
1151
|
+
value,
|
|
1152
|
+
(_, v) => `${v}`,
|
|
1153
|
+
{ augmentWithId: false }
|
|
1154
|
+
);
|
|
1155
|
+
accumulatedCssVariables = {
|
|
1156
|
+
...accumulatedCssVariables,
|
|
1157
|
+
...nextCssVariables
|
|
1204
1158
|
};
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
var nextCssVariables = (0, addExtraThemeEntries_1.addExtraThemeEntries)(path, key, value, function(_, v) {
|
|
1215
|
-
return "".concat(v);
|
|
1216
|
-
}, { augmentWithId: false });
|
|
1217
|
-
accumulatedCssVariables = __assign(__assign({}, accumulatedCssVariables), nextCssVariables);
|
|
1218
|
-
});
|
|
1219
|
-
return accumulatedCssVariables;
|
|
1220
|
-
}
|
|
1221
|
-
exports.makeCssVariableDefinitionsMap = makeCssVariableDefinitionsMap3;
|
|
1159
|
+
});
|
|
1160
|
+
return accumulatedCssVariables;
|
|
1161
|
+
}
|
|
1162
|
+
var init_makeCssVariableDefinitionsMap = __esm({
|
|
1163
|
+
"../design-tokens/src/lib/makeCssVariableDefinitionsMap.ts"() {
|
|
1164
|
+
"use strict";
|
|
1165
|
+
init_addExtraThemeEntries();
|
|
1166
|
+
init_cssVariables();
|
|
1167
|
+
init_mapLeafsOfObject();
|
|
1222
1168
|
}
|
|
1223
1169
|
});
|
|
1224
1170
|
|
|
1225
|
-
// ../design-tokens/
|
|
1226
|
-
var
|
|
1227
|
-
|
|
1171
|
+
// ../design-tokens/src/ThemeManager.ts
|
|
1172
|
+
var ThemeManager;
|
|
1173
|
+
var init_ThemeManager = __esm({
|
|
1174
|
+
"../design-tokens/src/ThemeManager.ts"() {
|
|
1228
1175
|
"use strict";
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
return _this.rootElement;
|
|
1247
|
-
};
|
|
1248
|
-
this.getRootElementId = function() {
|
|
1249
|
-
return _this.rootElementId;
|
|
1250
|
-
};
|
|
1251
|
-
this.getCurrentTheme = function() {
|
|
1252
|
-
return _this.theme;
|
|
1253
|
-
};
|
|
1254
|
-
this.setRootElement = function(element) {
|
|
1255
|
-
_this.rootElement = element;
|
|
1256
|
-
};
|
|
1257
|
-
this.setRootElementId = function(rootElementId2) {
|
|
1258
|
-
return _this.rootElementId = rootElementId2;
|
|
1259
|
-
};
|
|
1260
|
-
this.setAndApplyTheme = function(theme2, force) {
|
|
1261
|
-
if (!force) {
|
|
1262
|
-
if (_this.theme === theme2)
|
|
1263
|
-
return;
|
|
1264
|
-
}
|
|
1265
|
-
_this.theme = theme2;
|
|
1266
|
-
_this.applyCurrentTheme();
|
|
1267
|
-
_this.notifyThemeChangeListeners(theme2);
|
|
1268
|
-
};
|
|
1269
|
-
this.addThemeChangeListener = function(listener) {
|
|
1270
|
-
_this.themeChangeListeners.push(listener);
|
|
1271
|
-
};
|
|
1272
|
-
this.removeThemeChangeListener = function(listener) {
|
|
1273
|
-
_this.themeChangeListeners = _this.themeChangeListeners.filter(function(l) {
|
|
1274
|
-
return l !== listener;
|
|
1275
|
-
});
|
|
1276
|
-
};
|
|
1277
|
-
this.applyCurrentTheme = function() {
|
|
1278
|
-
var _a;
|
|
1279
|
-
if (typeof window !== "undefined") {
|
|
1280
|
-
_this.setRootElement((_a = document.getElementById(_this.rootElementId)) !== null && _a !== void 0 ? _a : document.documentElement);
|
|
1281
|
-
var cssVariableDefinitions = (0, makeCssVariableDefinitionsMap_1.makeCssVariableDefinitionsMap)(_this.theme);
|
|
1282
|
-
Object.entries(cssVariableDefinitions).forEach(function(_a2) {
|
|
1283
|
-
var _b;
|
|
1284
|
-
var key = _a2[0], value = _a2[1];
|
|
1285
|
-
(_b = _this.rootElement) === null || _b === void 0 ? void 0 : _b.style.setProperty(key, value);
|
|
1286
|
-
});
|
|
1287
|
-
}
|
|
1288
|
-
};
|
|
1289
|
-
this.notifyThemeChangeListeners = function(theme2) {
|
|
1290
|
-
_this.themeChangeListeners.forEach(function(listener) {
|
|
1291
|
-
return listener(theme2);
|
|
1292
|
-
});
|
|
1293
|
-
};
|
|
1176
|
+
init_makeCssVariableDefinitionsMap();
|
|
1177
|
+
ThemeManager = class {
|
|
1178
|
+
constructor(theme, rootElementId = "", apply = true) {
|
|
1179
|
+
this.themeChangeListeners = [];
|
|
1180
|
+
this.rootElement = null;
|
|
1181
|
+
this.getRootElement = () => this.rootElement;
|
|
1182
|
+
this.getRootElementId = () => this.rootElementId;
|
|
1183
|
+
this.getCurrentTheme = () => this.theme;
|
|
1184
|
+
this.setRootElement = (element) => {
|
|
1185
|
+
this.rootElement = element;
|
|
1186
|
+
};
|
|
1187
|
+
this.setRootElementId = (rootElementId) => this.rootElementId = rootElementId;
|
|
1188
|
+
this.setAndApplyTheme = (theme, force) => {
|
|
1189
|
+
if (!force) {
|
|
1190
|
+
if (this.theme === theme)
|
|
1191
|
+
return;
|
|
1192
|
+
}
|
|
1294
1193
|
this.theme = theme;
|
|
1295
|
-
this.
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1194
|
+
this.applyCurrentTheme();
|
|
1195
|
+
this.notifyThemeChangeListeners(theme);
|
|
1196
|
+
};
|
|
1197
|
+
this.addThemeChangeListener = (listener) => {
|
|
1198
|
+
this.themeChangeListeners.push(listener);
|
|
1199
|
+
};
|
|
1200
|
+
this.removeThemeChangeListener = (listener) => {
|
|
1201
|
+
this.themeChangeListeners = this.themeChangeListeners.filter(
|
|
1202
|
+
(l) => l !== listener
|
|
1203
|
+
);
|
|
1204
|
+
};
|
|
1205
|
+
this.applyCurrentTheme = () => {
|
|
1206
|
+
if (typeof window !== "undefined") {
|
|
1207
|
+
this.setRootElement(
|
|
1208
|
+
document.getElementById(this.rootElementId) ?? document.documentElement
|
|
1209
|
+
);
|
|
1210
|
+
const cssVariableDefinitions = makeCssVariableDefinitionsMap(this.theme);
|
|
1211
|
+
Object.entries(cssVariableDefinitions).forEach(([key, value]) => {
|
|
1212
|
+
var _a;
|
|
1213
|
+
(_a = this.rootElement) == null ? void 0 : _a.style.setProperty(key, value);
|
|
1214
|
+
});
|
|
1215
|
+
}
|
|
1216
|
+
};
|
|
1217
|
+
this.notifyThemeChangeListeners = (theme) => {
|
|
1218
|
+
this.themeChangeListeners.forEach((listener) => listener(theme));
|
|
1219
|
+
};
|
|
1220
|
+
this.theme = theme;
|
|
1221
|
+
this.rootElementId = rootElementId;
|
|
1222
|
+
if (apply)
|
|
1223
|
+
this.applyCurrentTheme();
|
|
1224
|
+
}
|
|
1225
|
+
};
|
|
1303
1226
|
}
|
|
1304
1227
|
});
|
|
1305
1228
|
|
|
@@ -2659,7 +2582,7 @@
|
|
|
2659
2582
|
}
|
|
2660
2583
|
return dispatcher.useContext(Context);
|
|
2661
2584
|
}
|
|
2662
|
-
function
|
|
2585
|
+
function useState2(initialState) {
|
|
2663
2586
|
var dispatcher = resolveDispatcher();
|
|
2664
2587
|
return dispatcher.useState(initialState);
|
|
2665
2588
|
}
|
|
@@ -3461,7 +3384,7 @@
|
|
|
3461
3384
|
exports.useMemo = useMemo;
|
|
3462
3385
|
exports.useReducer = useReducer;
|
|
3463
3386
|
exports.useRef = useRef;
|
|
3464
|
-
exports.useState =
|
|
3387
|
+
exports.useState = useState2;
|
|
3465
3388
|
exports.useSyncExternalStore = useSyncExternalStore;
|
|
3466
3389
|
exports.useTransition = useTransition;
|
|
3467
3390
|
exports.version = ReactVersion;
|
|
@@ -3485,209 +3408,305 @@
|
|
|
3485
3408
|
}
|
|
3486
3409
|
});
|
|
3487
3410
|
|
|
3488
|
-
// ../design-tokens/
|
|
3489
|
-
var
|
|
3490
|
-
|
|
3411
|
+
// ../design-tokens/src/react/ThemeProvider.tsx
|
|
3412
|
+
var import_react, ThemeContext, ThemeProvider, useTheme;
|
|
3413
|
+
var init_ThemeProvider = __esm({
|
|
3414
|
+
"../design-tokens/src/react/ThemeProvider.tsx"() {
|
|
3491
3415
|
"use strict";
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
3509
|
-
} : function(o, v) {
|
|
3510
|
-
o["default"] = v;
|
|
3511
|
-
});
|
|
3512
|
-
var __importStar = exports && exports.__importStar || function(mod) {
|
|
3513
|
-
if (mod && mod.__esModule)
|
|
3514
|
-
return mod;
|
|
3515
|
-
var result = {};
|
|
3516
|
-
if (mod != null) {
|
|
3517
|
-
for (var k in mod)
|
|
3518
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
3519
|
-
__createBinding(result, mod, k);
|
|
3520
|
-
}
|
|
3521
|
-
__setModuleDefault(result, mod);
|
|
3522
|
-
return result;
|
|
3523
|
-
};
|
|
3524
|
-
var __rest = exports && exports.__rest || function(s, e) {
|
|
3525
|
-
var t = {};
|
|
3526
|
-
for (var p in s)
|
|
3527
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3528
|
-
t[p] = s[p];
|
|
3529
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
3530
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
3531
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
3532
|
-
t[p[i]] = s[p[i]];
|
|
3533
|
-
}
|
|
3534
|
-
return t;
|
|
3535
|
-
};
|
|
3536
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3537
|
-
exports.useTheme = exports.ThemeProvider = exports.ThemeContext = void 0;
|
|
3538
|
-
var react_1 = __importStar(require_react());
|
|
3539
|
-
var __1 = require_dist();
|
|
3540
|
-
exports.ThemeContext = react_1.default.createContext(__1.defaultTheme);
|
|
3541
|
-
var ThemeProvider = function(_a) {
|
|
3542
|
-
var themeManager = _a.themeManager, props = __rest(_a, ["themeManager"]);
|
|
3543
|
-
var themeManagerInstance = (0, react_1.useState)(function() {
|
|
3544
|
-
return themeManager || new __1.ThemeManager(__1.defaultTheme);
|
|
3545
|
-
})[0];
|
|
3546
|
-
var _b = react_1.default.useState(themeManagerInstance.getCurrentTheme()), theme = _b[0], setTheme = _b[1];
|
|
3547
|
-
react_1.default.useEffect(function() {
|
|
3548
|
-
var cancelled = false;
|
|
3549
|
-
var listener = function(newTheme) {
|
|
3416
|
+
import_react = __toESM(require_react());
|
|
3417
|
+
init_src();
|
|
3418
|
+
ThemeContext = import_react.default.createContext(defaultTheme);
|
|
3419
|
+
ThemeProvider = ({
|
|
3420
|
+
themeManager,
|
|
3421
|
+
...props
|
|
3422
|
+
}) => {
|
|
3423
|
+
const [themeManagerInstance] = (0, import_react.useState)(
|
|
3424
|
+
() => themeManager || new ThemeManager(defaultTheme)
|
|
3425
|
+
);
|
|
3426
|
+
const [theme, setTheme] = import_react.default.useState(
|
|
3427
|
+
themeManagerInstance.getCurrentTheme()
|
|
3428
|
+
);
|
|
3429
|
+
import_react.default.useEffect(() => {
|
|
3430
|
+
let cancelled = false;
|
|
3431
|
+
const listener = (newTheme) => {
|
|
3550
3432
|
if (!cancelled)
|
|
3551
3433
|
setTheme(newTheme);
|
|
3552
3434
|
};
|
|
3553
3435
|
themeManagerInstance.addThemeChangeListener(listener);
|
|
3554
|
-
return
|
|
3436
|
+
return () => {
|
|
3555
3437
|
cancelled = true;
|
|
3556
3438
|
themeManagerInstance.removeThemeChangeListener(listener);
|
|
3557
3439
|
};
|
|
3558
3440
|
}, []);
|
|
3559
|
-
return
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
)
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3441
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(ThemeContext.Provider, { value: theme }, props.children), /* @__PURE__ */ import_react.default.createElement(
|
|
3442
|
+
"link",
|
|
3443
|
+
{
|
|
3444
|
+
rel: "preload",
|
|
3445
|
+
href: "https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-bold.woff2",
|
|
3446
|
+
as: "font",
|
|
3447
|
+
type: "font/woff2",
|
|
3448
|
+
crossOrigin: "anonymous"
|
|
3449
|
+
}
|
|
3450
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
3451
|
+
"link",
|
|
3452
|
+
{
|
|
3453
|
+
rel: "preload",
|
|
3454
|
+
href: "https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-demi-bold.woff2",
|
|
3455
|
+
as: "font",
|
|
3456
|
+
type: "font/woff2",
|
|
3457
|
+
crossOrigin: "anonymous"
|
|
3458
|
+
}
|
|
3459
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
3460
|
+
"link",
|
|
3461
|
+
{
|
|
3462
|
+
rel: "preload",
|
|
3463
|
+
href: "https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-medium.woff2",
|
|
3464
|
+
as: "font",
|
|
3465
|
+
type: "font/woff2",
|
|
3466
|
+
crossOrigin: "anonymous"
|
|
3467
|
+
}
|
|
3468
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
3469
|
+
"link",
|
|
3470
|
+
{
|
|
3471
|
+
rel: "preload",
|
|
3472
|
+
href: "https://d1e7r7b0lb8p4d.cloudfront.net/fonts/inter/inter-regular.woff2",
|
|
3473
|
+
as: "font",
|
|
3474
|
+
type: "font/woff2",
|
|
3475
|
+
crossOrigin: "anonymous"
|
|
3476
|
+
}
|
|
3477
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
3478
|
+
"link",
|
|
3479
|
+
{
|
|
3480
|
+
rel: "preload",
|
|
3481
|
+
href: "https://d1e7r7b0lb8p4d.cloudfront.net/fonts/tiempos/tiempos-headline-bold.woff2",
|
|
3482
|
+
as: "font",
|
|
3483
|
+
type: "font/woff2",
|
|
3484
|
+
crossOrigin: "anonymous"
|
|
3485
|
+
}
|
|
3486
|
+
));
|
|
3573
3487
|
};
|
|
3574
|
-
|
|
3488
|
+
useTheme = () => import_react.default.useContext(ThemeContext);
|
|
3575
3489
|
}
|
|
3576
3490
|
});
|
|
3577
3491
|
|
|
3578
|
-
// ../design-tokens/
|
|
3579
|
-
var
|
|
3580
|
-
"../design-tokens/
|
|
3492
|
+
// ../design-tokens/src/react/index.tsx
|
|
3493
|
+
var init_react = __esm({
|
|
3494
|
+
"../design-tokens/src/react/index.tsx"() {
|
|
3581
3495
|
"use strict";
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3496
|
+
init_ThemeProvider();
|
|
3497
|
+
}
|
|
3498
|
+
});
|
|
3499
|
+
|
|
3500
|
+
// ../design-tokens/src/tailwind/tailwind-presets.ts
|
|
3501
|
+
var require_tailwind_presets = __commonJS({
|
|
3502
|
+
"../design-tokens/src/tailwind/tailwind-presets.ts"(exports, module) {
|
|
3503
|
+
"use strict";
|
|
3504
|
+
init_src();
|
|
3505
|
+
var preset = {
|
|
3506
|
+
theme: {
|
|
3507
|
+
colors: {
|
|
3508
|
+
transparent: "transparent",
|
|
3509
|
+
current: "currentColor",
|
|
3510
|
+
inherit: "inherit",
|
|
3511
|
+
...defaultTheme.color,
|
|
3512
|
+
...defaultTheme.dataViz
|
|
3513
|
+
},
|
|
3514
|
+
spacing: {
|
|
3515
|
+
...defaultTheme.spacing
|
|
3516
|
+
},
|
|
3517
|
+
boxShadow: {
|
|
3518
|
+
none: "none",
|
|
3519
|
+
sm: defaultTheme.shadow.small.boxShadow,
|
|
3520
|
+
lg: defaultTheme.shadow.large.boxShadow
|
|
3521
|
+
},
|
|
3522
|
+
borderRadius: {
|
|
3523
|
+
none: "0px",
|
|
3524
|
+
default: "7px",
|
|
3525
|
+
"focus-ring": "10px"
|
|
3526
|
+
},
|
|
3527
|
+
borderWidth: {
|
|
3528
|
+
"width-none": "0px",
|
|
3529
|
+
"width-default": "2px",
|
|
3530
|
+
"width-focus-ring": "2px"
|
|
3531
|
+
},
|
|
3532
|
+
// how do we want to handle our focus rings?
|
|
3533
|
+
// tailwind used a `ring` property
|
|
3534
|
+
borderColor: {
|
|
3535
|
+
"color-solid": defaultTheme.border.solid.borderColor,
|
|
3536
|
+
"color-transparent": defaultTheme.border.borderless.borderColor,
|
|
3537
|
+
"color-focus-ring": defaultTheme.color.blue[600]
|
|
3538
|
+
},
|
|
3539
|
+
fontFamily: {
|
|
3540
|
+
"family-paragraph": defaultTheme.typography.paragraphBody.fontFamily,
|
|
3541
|
+
"family-heading": defaultTheme.typography.heading1.fontFamily,
|
|
3542
|
+
"family-data": defaultTheme.typography.dataLarge.fontFamily,
|
|
3543
|
+
"family-display": defaultTheme.typography.display0.fontFamily
|
|
3544
|
+
},
|
|
3545
|
+
fontSize: {
|
|
3546
|
+
"size-display": defaultTheme.typography.display0.fontSize,
|
|
3547
|
+
"size-heading-1": defaultTheme.typography.heading1.fontSize,
|
|
3548
|
+
"size-heading-2": defaultTheme.typography.heading2.fontSize,
|
|
3549
|
+
"size-heading-3": defaultTheme.typography.heading3.fontSize,
|
|
3550
|
+
"size-heading-4": defaultTheme.typography.heading4.fontSize,
|
|
3551
|
+
"size-heading-5": defaultTheme.typography.heading5.fontSize,
|
|
3552
|
+
"size-heading-6": defaultTheme.typography.heading6.fontSize,
|
|
3553
|
+
"size-paragraph": defaultTheme.typography.paragraphBody.fontSize,
|
|
3554
|
+
"size-paragraph-lede": defaultTheme.typography.paragraphIntroLede.fontSize,
|
|
3555
|
+
"size-paragraph-sm": defaultTheme.typography.paragraphSmall.fontSize,
|
|
3556
|
+
"size-paragraph-xs": defaultTheme.typography.paragraphExtraSmall.fontSize,
|
|
3557
|
+
"size-data-lg": defaultTheme.typography.dataLarge.fontSize,
|
|
3558
|
+
"size-data-md": defaultTheme.typography.dataMedium.fontSize,
|
|
3559
|
+
"size-data-sm": defaultTheme.typography.dataSmall.fontSize,
|
|
3560
|
+
"size-data-units-lg": defaultTheme.typography.dataLargeUnits.fontSize,
|
|
3561
|
+
"size-data-units-md": defaultTheme.typography.dataMediumUnits.fontSize,
|
|
3562
|
+
"size-data-units-sm": defaultTheme.typography.dataSmallUnits.fontSize
|
|
3563
|
+
},
|
|
3564
|
+
// font weights could have specific tokens (current don't)
|
|
3565
|
+
fontWeight: {
|
|
3566
|
+
normal: "400",
|
|
3567
|
+
medium: "500",
|
|
3568
|
+
semibold: "600",
|
|
3569
|
+
bold: "700",
|
|
3570
|
+
extrabold: "800",
|
|
3571
|
+
"weight-paragraph": "400",
|
|
3572
|
+
"weight-paragraph-bold": "600",
|
|
3573
|
+
"weight-data": "700",
|
|
3574
|
+
"weight-heading": "700",
|
|
3575
|
+
"weight-display": "800"
|
|
3576
|
+
},
|
|
3577
|
+
lineHeight: {
|
|
3578
|
+
"height-display": defaultTheme.typography.display0.lineHeight,
|
|
3579
|
+
"height-heading-1": defaultTheme.typography.heading1.lineHeight,
|
|
3580
|
+
"height-heading-2": defaultTheme.typography.heading2.lineHeight,
|
|
3581
|
+
"height-heading-3": defaultTheme.typography.heading3.lineHeight,
|
|
3582
|
+
"height-heading-4": defaultTheme.typography.heading4.lineHeight,
|
|
3583
|
+
"height-heading-5": defaultTheme.typography.heading5.lineHeight,
|
|
3584
|
+
"height-heading-6": defaultTheme.typography.heading6.lineHeight,
|
|
3585
|
+
"height-paragraph": defaultTheme.typography.paragraphBody.lineHeight,
|
|
3586
|
+
"height-paragraph-lede": defaultTheme.typography.paragraphIntroLede.lineHeight,
|
|
3587
|
+
"height-paragraph-sm": defaultTheme.typography.paragraphSmall.lineHeight,
|
|
3588
|
+
"height-paragraph-xs": defaultTheme.typography.paragraphExtraSmall.lineHeight,
|
|
3589
|
+
"height-data-lg": defaultTheme.typography.dataLarge.lineHeight,
|
|
3590
|
+
"height-data-md": defaultTheme.typography.dataMedium.lineHeight,
|
|
3591
|
+
"height-data-sm": defaultTheme.typography.dataSmall.lineHeight,
|
|
3592
|
+
"height-data-units-lg": defaultTheme.typography.dataLargeUnits.lineHeight,
|
|
3593
|
+
"height-data-units-md": defaultTheme.typography.dataMediumUnits.lineHeight,
|
|
3594
|
+
"height-data-units-sm": defaultTheme.typography.dataSmallUnits.lineHeight
|
|
3595
|
+
},
|
|
3596
|
+
letterSpacing: {
|
|
3597
|
+
"spacing-normal": "normal"
|
|
3598
|
+
},
|
|
3599
|
+
// A mix of layout styles
|
|
3600
|
+
maxWidth: {
|
|
3601
|
+
content: defaultTheme.layout.contentMaxWidth,
|
|
3602
|
+
"content-with-side": defaultTheme.layout.contentMaxWidthWithSidebar
|
|
3603
|
+
},
|
|
3604
|
+
width: {
|
|
3605
|
+
"content-side-margin": defaultTheme.layout.contentSideMargin
|
|
3606
|
+
},
|
|
3607
|
+
height: {
|
|
3608
|
+
"mobile-actions-drawer-height": defaultTheme.layout.mobileActionsDrawerHeight,
|
|
3609
|
+
"navigation-bar-height": defaultTheme.layout.navigationBarHeight
|
|
3610
|
+
},
|
|
3611
|
+
// we will probably want to review viewport sizing
|
|
3612
|
+
screens: {
|
|
3613
|
+
...defaultTheme.layout.breakpoints
|
|
3614
|
+
}
|
|
3590
3615
|
}
|
|
3591
|
-
Object.defineProperty(o, k2, desc);
|
|
3592
|
-
} : function(o, m, k, k2) {
|
|
3593
|
-
if (k2 === void 0)
|
|
3594
|
-
k2 = k;
|
|
3595
|
-
o[k2] = m[k];
|
|
3596
|
-
});
|
|
3597
|
-
var __exportStar = exports && exports.__exportStar || function(m, exports2) {
|
|
3598
|
-
for (var p in m)
|
|
3599
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p))
|
|
3600
|
-
__createBinding(exports2, m, p);
|
|
3601
3616
|
};
|
|
3602
|
-
|
|
3603
|
-
__exportStar(require_ThemeProvider(), exports);
|
|
3617
|
+
module.exports.TailwindPreset = preset;
|
|
3604
3618
|
}
|
|
3605
3619
|
});
|
|
3606
3620
|
|
|
3607
|
-
// ../design-tokens/
|
|
3608
|
-
var
|
|
3609
|
-
|
|
3621
|
+
// ../design-tokens/src/tailwind/index.ts
|
|
3622
|
+
var tailwind_exports = {};
|
|
3623
|
+
var init_tailwind = __esm({
|
|
3624
|
+
"../design-tokens/src/tailwind/index.ts"() {
|
|
3610
3625
|
"use strict";
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
if (!leafKey) {
|
|
3628
|
-
throw new Error("leafKey is undefined");
|
|
3629
|
-
}
|
|
3630
|
-
var cssVariablesOfToken = (0, addExtraThemeEntries_1.addExtraThemeEntries)(leafPath, leafKey, value, printValue, { augmentWithId: true });
|
|
3631
|
-
Object.assign(leafObject, cssVariablesOfToken);
|
|
3632
|
-
};
|
|
3633
|
-
(0, mapLeafsOfObject_1.mapLeafsOfObject)(theme, mapper);
|
|
3634
|
-
return augmentedTheme;
|
|
3626
|
+
__reExport(tailwind_exports, __toESM(require_tailwind_presets()));
|
|
3627
|
+
}
|
|
3628
|
+
});
|
|
3629
|
+
|
|
3630
|
+
// ../design-tokens/src/lib/makeCssVariableTheme.ts
|
|
3631
|
+
function makeCSSVariableTheme(theme, printValue = objectPathToCssVarFunction) {
|
|
3632
|
+
const augmentedTheme = {};
|
|
3633
|
+
const mapper = (leafPath, value) => {
|
|
3634
|
+
const leafKey = leafPath[leafPath.length - 1];
|
|
3635
|
+
const pathWithoutLast = leafPath.slice(0, leafPath.length - 1);
|
|
3636
|
+
const leafObject = pathWithoutLast.reduce(
|
|
3637
|
+
(child, segment) => child[segment] || (child[segment] = {}),
|
|
3638
|
+
augmentedTheme
|
|
3639
|
+
);
|
|
3640
|
+
if (!leafKey) {
|
|
3641
|
+
throw new Error("leafKey is undefined");
|
|
3635
3642
|
}
|
|
3636
|
-
|
|
3643
|
+
const cssVariablesOfToken = addExtraThemeEntries(
|
|
3644
|
+
leafPath,
|
|
3645
|
+
leafKey,
|
|
3646
|
+
value,
|
|
3647
|
+
printValue,
|
|
3648
|
+
{ augmentWithId: true }
|
|
3649
|
+
);
|
|
3650
|
+
Object.assign(leafObject, cssVariablesOfToken);
|
|
3651
|
+
};
|
|
3652
|
+
mapLeafsOfObject(theme, mapper);
|
|
3653
|
+
return augmentedTheme;
|
|
3654
|
+
}
|
|
3655
|
+
var init_makeCssVariableTheme = __esm({
|
|
3656
|
+
"../design-tokens/src/lib/makeCssVariableTheme.ts"() {
|
|
3657
|
+
"use strict";
|
|
3658
|
+
init_addExtraThemeEntries();
|
|
3659
|
+
init_cssVariables();
|
|
3660
|
+
init_mapLeafsOfObject();
|
|
3637
3661
|
}
|
|
3638
3662
|
});
|
|
3639
3663
|
|
|
3640
|
-
// ../design-tokens/
|
|
3641
|
-
var
|
|
3642
|
-
|
|
3664
|
+
// ../design-tokens/src/index.ts
|
|
3665
|
+
var src_exports = {};
|
|
3666
|
+
__export(src_exports, {
|
|
3667
|
+
ThemeContext: () => ThemeContext,
|
|
3668
|
+
ThemeManager: () => ThemeManager,
|
|
3669
|
+
ThemeProvider: () => ThemeProvider,
|
|
3670
|
+
defaultTheme: () => defaultTheme,
|
|
3671
|
+
heartTheme: () => heartTheme,
|
|
3672
|
+
makeCSSVariableTheme: () => makeCSSVariableTheme,
|
|
3673
|
+
makeCssVariableDefinitionsMap: () => makeCssVariableDefinitionsMap,
|
|
3674
|
+
mapLeafsOfObject: () => mapLeafsOfObject,
|
|
3675
|
+
useTheme: () => useTheme
|
|
3676
|
+
});
|
|
3677
|
+
var init_src = __esm({
|
|
3678
|
+
"../design-tokens/src/index.ts"() {
|
|
3643
3679
|
"use strict";
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
Object.defineProperty(o, k2, desc);
|
|
3654
|
-
} : function(o, m, k, k2) {
|
|
3655
|
-
if (k2 === void 0)
|
|
3656
|
-
k2 = k;
|
|
3657
|
-
o[k2] = m[k];
|
|
3658
|
-
});
|
|
3659
|
-
var __exportStar = exports && exports.__exportStar || function(m, exports2) {
|
|
3660
|
-
for (var p in m)
|
|
3661
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p))
|
|
3662
|
-
__createBinding(exports2, m, p);
|
|
3663
|
-
};
|
|
3664
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3665
|
-
exports.mapLeafsOfObject = exports.makeCSSVariableTheme = exports.makeCssVariableDefinitionsMap = void 0;
|
|
3666
|
-
__exportStar(require_themes(), exports);
|
|
3667
|
-
__exportStar(require_types(), exports);
|
|
3668
|
-
__exportStar(require_ThemeManager(), exports);
|
|
3669
|
-
__exportStar(require_react2(), exports);
|
|
3670
|
-
var makeCssVariableDefinitionsMap_1 = require_makeCssVariableDefinitionsMap();
|
|
3671
|
-
Object.defineProperty(exports, "makeCssVariableDefinitionsMap", { enumerable: true, get: function() {
|
|
3672
|
-
return makeCssVariableDefinitionsMap_1.makeCssVariableDefinitionsMap;
|
|
3673
|
-
} });
|
|
3674
|
-
var makeCssVariableTheme_1 = require_makeCssVariableTheme();
|
|
3675
|
-
Object.defineProperty(exports, "makeCSSVariableTheme", { enumerable: true, get: function() {
|
|
3676
|
-
return makeCssVariableTheme_1.makeCSSVariableTheme;
|
|
3677
|
-
} });
|
|
3678
|
-
var mapLeafsOfObject_1 = require_mapLeafsOfObject();
|
|
3679
|
-
Object.defineProperty(exports, "mapLeafsOfObject", { enumerable: true, get: function() {
|
|
3680
|
-
return mapLeafsOfObject_1.mapLeafsOfObject;
|
|
3681
|
-
} });
|
|
3680
|
+
init_themes();
|
|
3681
|
+
init_types();
|
|
3682
|
+
init_ThemeManager();
|
|
3683
|
+
init_react();
|
|
3684
|
+
init_tailwind();
|
|
3685
|
+
__reExport(src_exports, tailwind_exports);
|
|
3686
|
+
init_makeCssVariableDefinitionsMap();
|
|
3687
|
+
init_makeCssVariableTheme();
|
|
3688
|
+
init_mapLeafsOfObject();
|
|
3682
3689
|
}
|
|
3683
3690
|
});
|
|
3684
3691
|
|
|
3685
|
-
//
|
|
3686
|
-
var
|
|
3692
|
+
// ../design-tokens/index.ts
|
|
3693
|
+
var design_tokens_exports = {};
|
|
3694
|
+
__export(design_tokens_exports, {
|
|
3695
|
+
ThemeContext: () => ThemeContext,
|
|
3696
|
+
ThemeManager: () => ThemeManager,
|
|
3697
|
+
ThemeProvider: () => ThemeProvider,
|
|
3698
|
+
defaultTheme: () => defaultTheme,
|
|
3699
|
+
heartTheme: () => heartTheme,
|
|
3700
|
+
makeCSSVariableTheme: () => makeCSSVariableTheme,
|
|
3701
|
+
makeCssVariableDefinitionsMap: () => makeCssVariableDefinitionsMap,
|
|
3702
|
+
mapLeafsOfObject: () => mapLeafsOfObject,
|
|
3703
|
+
useTheme: () => useTheme
|
|
3704
|
+
});
|
|
3705
|
+
init_src();
|
|
3706
|
+
__reExport(design_tokens_exports, src_exports);
|
|
3687
3707
|
|
|
3688
3708
|
// src/KaizenProvider/ThemeProvider/ThemeManager.ts
|
|
3689
|
-
var
|
|
3690
|
-
var ThemeManager = class {
|
|
3709
|
+
var ThemeManager2 = class {
|
|
3691
3710
|
constructor(theme, rootElementId = "", apply = true) {
|
|
3692
3711
|
this.themeChangeListeners = [];
|
|
3693
3712
|
this.rootElement = null;
|
|
@@ -3720,7 +3739,7 @@
|
|
|
3720
3739
|
this.setRootElement(
|
|
3721
3740
|
document.getElementById(this.rootElementId) ?? document.documentElement
|
|
3722
3741
|
);
|
|
3723
|
-
const cssVariableDefinitions =
|
|
3742
|
+
const cssVariableDefinitions = makeCssVariableDefinitionsMap(this.theme);
|
|
3724
3743
|
Object.entries(cssVariableDefinitions).forEach(([key, value]) => {
|
|
3725
3744
|
var _a;
|
|
3726
3745
|
(_a = this.rootElement) == null ? void 0 : _a.style.setProperty(key, value);
|
|
@@ -3739,15 +3758,15 @@
|
|
|
3739
3758
|
|
|
3740
3759
|
// src/KaizenProvider/ThemeProvider/ThemeManager.spec.ts
|
|
3741
3760
|
var assertThemeIsActive = (theme, rootElement) => {
|
|
3742
|
-
const variables =
|
|
3761
|
+
const variables = makeCssVariableDefinitionsMap(theme);
|
|
3743
3762
|
Object.entries(variables).forEach(([key, value]) => {
|
|
3744
3763
|
expect(rootElement == null ? void 0 : rootElement.style.getPropertyValue(key)).toBe(value);
|
|
3745
3764
|
});
|
|
3746
3765
|
};
|
|
3747
|
-
describe(
|
|
3766
|
+
describe(ThemeManager2.name, () => {
|
|
3748
3767
|
test.skip("activates initial theme on construction", () => {
|
|
3749
|
-
const themeManager = new
|
|
3750
|
-
assertThemeIsActive(
|
|
3768
|
+
const themeManager = new ThemeManager2(heartTheme);
|
|
3769
|
+
assertThemeIsActive(heartTheme, themeManager.getRootElement());
|
|
3751
3770
|
});
|
|
3752
3771
|
});
|
|
3753
3772
|
})();
|