@stackone/malachite 2.62.0 → 2.63.0
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/COMPONENTS.md +2 -0
- package/dist/assets/icons/caret_double_left.svg.js +6 -0
- package/dist/assets/icons/caret_double_left.svg.js.map +1 -0
- package/dist/assets/icons/caret_double_right.svg.js +6 -0
- package/dist/assets/icons/caret_double_right.svg.js.map +1 -0
- package/dist/components/Card.js +77 -68
- package/dist/components/Card.js.map +1 -1
- package/dist/components/Chat/ChatThread.js +1 -2
- package/dist/components/Chat/ChatThread.js.map +1 -1
- package/dist/components/CustomIcons/CaretDoubleLeftIcon.js +21 -0
- package/dist/components/CustomIcons/CaretDoubleLeftIcon.js.map +1 -0
- package/dist/components/CustomIcons/CaretDoubleRightIcon.js +21 -0
- package/dist/components/CustomIcons/CaretDoubleRightIcon.js.map +1 -0
- package/dist/components/CustomIcons/index.js +306 -300
- package/dist/components/CustomIcons/index.js.map +1 -1
- package/dist/components/DatePicker.js +36 -0
- package/dist/components/DatePicker.js.map +1 -0
- package/dist/components/DatePickerField.js +246 -0
- package/dist/components/DatePickerField.js.map +1 -0
- package/dist/components/DatePickerPanel.js +399 -0
- package/dist/components/DatePickerPanel.js.map +1 -0
- package/dist/components/DatePickerTrigger.js +68 -0
- package/dist/components/DatePickerTrigger.js.map +1 -0
- package/dist/components/DateRangePicker.js +43 -0
- package/dist/components/DateRangePicker.js.map +1 -0
- package/dist/components/dateMath.js +153 -0
- package/dist/components/dateMath.js.map +1 -0
- package/dist/components/datePickerStyles.js +46 -0
- package/dist/components/datePickerStyles.js.map +1 -0
- package/dist/components/useDatePickerDraft.js +126 -0
- package/dist/components/useDatePickerDraft.js.map +1 -0
- package/dist/index.d.ts +233 -101
- package/dist/index.js +431 -423
- package/dist/index.js.map +1 -1
- package/dist/tailwind.css.js +1 -1
- package/dist/theme.js +372 -349
- package/dist/theme.js.map +1 -1
- package/package.json +1 -1
package/dist/theme.js
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
const
|
|
1
|
+
const F = [
|
|
2
|
+
"hoverBackground",
|
|
3
|
+
"subtleHoverBackground",
|
|
4
|
+
"outsideForeground",
|
|
5
|
+
"selectedBackground",
|
|
6
|
+
"selectedHoverBorder",
|
|
7
|
+
"todayBorder",
|
|
8
|
+
"todayHoverBorder",
|
|
9
|
+
"rangeBackground",
|
|
10
|
+
"pressedOpacity"
|
|
11
|
+
], B = (r) => `--malachite-date-picker-${r.replace(/([A-Z])/g, "-$1").toLowerCase()}`, f = {
|
|
2
12
|
background: "rgba(0, 175, 102)",
|
|
3
13
|
foreground: "rgb(2, 122, 66)",
|
|
4
14
|
border: "rgba(0, 175, 102, 0.2)",
|
|
5
15
|
backgroundGlass: "rgba(0, 175, 102, 0.08)"
|
|
6
|
-
},
|
|
16
|
+
}, $ = "0px 1px 0px 0px rgba(0, 175, 102, 0.15)", h = {
|
|
7
17
|
small: "28px",
|
|
8
18
|
medium: "32px",
|
|
9
19
|
large: "42px"
|
|
@@ -17,7 +27,7 @@ const h = {
|
|
|
17
27
|
xlarge: "18px",
|
|
18
28
|
xxlarge: "22px"
|
|
19
29
|
},
|
|
20
|
-
controlHeights: { ...
|
|
30
|
+
controlHeights: { ...h },
|
|
21
31
|
iconSizes: {
|
|
22
32
|
xsmall: "12px",
|
|
23
33
|
small: "13px",
|
|
@@ -42,7 +52,7 @@ const h = {
|
|
|
42
52
|
glow: "0px 0px 10px 0px rgba(0, 0, 0, 0.2)",
|
|
43
53
|
glowLg: "0px 0px 20px 0px rgba(0, 0, 0, 0.2)",
|
|
44
54
|
default: "0px 1px 0px 0px rgba(0, 0, 0, 0.15)",
|
|
45
|
-
accent:
|
|
55
|
+
accent: $,
|
|
46
56
|
success: "0px 1px 0px 0px rgba(0, 175, 102, 0.15)",
|
|
47
57
|
warning: "0px 1px 0px 0px rgba(241, 139, 10, 0.15)",
|
|
48
58
|
error: "0px 1px 0px 0px rgba(197, 63, 63, 0.15)"
|
|
@@ -111,7 +121,7 @@ const h = {
|
|
|
111
121
|
border: "rgb(232, 232, 232)",
|
|
112
122
|
borderHover: "rgb(186, 186, 186)"
|
|
113
123
|
},
|
|
114
|
-
accent:
|
|
124
|
+
accent: f,
|
|
115
125
|
control: {
|
|
116
126
|
borderHover: "rgba(0, 175, 102, 0.4)"
|
|
117
127
|
},
|
|
@@ -537,7 +547,7 @@ const h = {
|
|
|
537
547
|
// #4A3F7A, from the Chat.Suggestion mock
|
|
538
548
|
}
|
|
539
549
|
}
|
|
540
|
-
},
|
|
550
|
+
}, y = {
|
|
541
551
|
fontSizes: {
|
|
542
552
|
xsmall: "11px",
|
|
543
553
|
small: "13px",
|
|
@@ -547,7 +557,7 @@ const h = {
|
|
|
547
557
|
xlarge: "18px",
|
|
548
558
|
xxlarge: "22px"
|
|
549
559
|
},
|
|
550
|
-
controlHeights: { ...
|
|
560
|
+
controlHeights: { ...h },
|
|
551
561
|
iconSizes: {
|
|
552
562
|
xsmall: "12px",
|
|
553
563
|
small: "13px",
|
|
@@ -1068,168 +1078,170 @@ const h = {
|
|
|
1068
1078
|
surfaceForeground: "rgb(134, 120, 186)"
|
|
1069
1079
|
}
|
|
1070
1080
|
}
|
|
1071
|
-
},
|
|
1072
|
-
function
|
|
1081
|
+
}, S = "malachite-theme-mode", v = "malachite-custom-theme", Z = /^--[A-Za-z0-9_-]+$/, A = /[{};]|\/\*|\*\//, M = /^[A-Za-z0-9_-]+$/;
|
|
1082
|
+
function O(r, l) {
|
|
1073
1083
|
if (typeof r == "string") {
|
|
1074
|
-
if (
|
|
1084
|
+
if (A.test(r)) {
|
|
1075
1085
|
console.warn(
|
|
1076
|
-
`Malachite: ignoring theme value at ${
|
|
1086
|
+
`Malachite: ignoring theme value at ${l} — CSS syntax characters ({ } ; /* */) are not allowed.`
|
|
1077
1087
|
);
|
|
1078
1088
|
return;
|
|
1079
1089
|
}
|
|
1080
1090
|
return r;
|
|
1081
1091
|
}
|
|
1082
1092
|
if (r === null || typeof r != "object") return r;
|
|
1083
|
-
const
|
|
1093
|
+
const t = {};
|
|
1084
1094
|
for (const [o, n] of Object.entries(r)) {
|
|
1085
|
-
const
|
|
1086
|
-
if (!
|
|
1095
|
+
const u = l ? `${l}.${o}` : o;
|
|
1096
|
+
if (!M.test(o)) {
|
|
1087
1097
|
console.warn(
|
|
1088
|
-
`Malachite: ignoring a theme key under ${
|
|
1098
|
+
`Malachite: ignoring a theme key under ${l || "<root>"} — theme keys may contain only letters, digits, hyphens and underscores.`
|
|
1089
1099
|
);
|
|
1090
1100
|
continue;
|
|
1091
1101
|
}
|
|
1092
|
-
const
|
|
1093
|
-
|
|
1102
|
+
const a = O(n, u);
|
|
1103
|
+
a !== void 0 && (t[o] = a);
|
|
1094
1104
|
}
|
|
1095
|
-
return
|
|
1105
|
+
return t;
|
|
1096
1106
|
}
|
|
1097
|
-
const
|
|
1098
|
-
function
|
|
1107
|
+
const w = /* @__PURE__ */ new Set();
|
|
1108
|
+
function I(r) {
|
|
1099
1109
|
try {
|
|
1100
|
-
if (
|
|
1110
|
+
if (w.has(r))
|
|
1101
1111
|
return;
|
|
1102
|
-
|
|
1103
|
-
} catch (
|
|
1104
|
-
console.error("Error registering shadow root:",
|
|
1112
|
+
w.add(r), G(r);
|
|
1113
|
+
} catch (l) {
|
|
1114
|
+
console.error("Error registering shadow root:", l);
|
|
1105
1115
|
}
|
|
1106
1116
|
}
|
|
1107
|
-
function
|
|
1117
|
+
function W(r) {
|
|
1108
1118
|
try {
|
|
1109
|
-
|
|
1110
|
-
} catch (
|
|
1111
|
-
console.error("Error unregistering shadow root:",
|
|
1119
|
+
w.delete(r);
|
|
1120
|
+
} catch (l) {
|
|
1121
|
+
console.error("Error unregistering shadow root:", l);
|
|
1112
1122
|
}
|
|
1113
1123
|
}
|
|
1114
|
-
const
|
|
1124
|
+
const R = {
|
|
1115
1125
|
rowVariant: "row-variant",
|
|
1116
1126
|
boxShadow: "box-shadow"
|
|
1117
1127
|
};
|
|
1118
|
-
function
|
|
1128
|
+
function C(r, l, t) {
|
|
1119
1129
|
Object.entries(r).forEach(([o, n]) => {
|
|
1120
|
-
const
|
|
1121
|
-
typeof n == "object" && n !== null ? Object.entries(n).forEach(([
|
|
1122
|
-
const
|
|
1123
|
-
typeof
|
|
1124
|
-
const
|
|
1125
|
-
|
|
1126
|
-
`${
|
|
1127
|
-
|
|
1130
|
+
const u = R[o] ?? o;
|
|
1131
|
+
typeof n == "object" && n !== null ? Object.entries(n).forEach(([a, d]) => {
|
|
1132
|
+
const g = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1133
|
+
typeof d == "object" && d !== null ? Object.entries(d).forEach(([s, c]) => {
|
|
1134
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1135
|
+
t(
|
|
1136
|
+
`${l}-${u}-${g}-${i}`,
|
|
1137
|
+
c
|
|
1128
1138
|
);
|
|
1129
|
-
}) :
|
|
1130
|
-
}) :
|
|
1139
|
+
}) : t(`${l}-${u}-${g}`, d);
|
|
1140
|
+
}) : t(`${l}-${u}`, n);
|
|
1131
1141
|
});
|
|
1132
1142
|
}
|
|
1133
|
-
function
|
|
1134
|
-
const
|
|
1135
|
-
if (
|
|
1136
|
-
let
|
|
1137
|
-
|
|
1138
|
-
const
|
|
1139
|
-
Object.entries(r.fontSizes).forEach(([
|
|
1140
|
-
|
|
1141
|
-
}), Object.entries(r.iconSizes).forEach(([
|
|
1142
|
-
|
|
1143
|
-
}), Object.entries(r.radius).forEach(([
|
|
1144
|
-
|
|
1145
|
-
}), Object.entries(r.controlHeights ??
|
|
1146
|
-
|
|
1147
|
-
}), Object.entries(
|
|
1148
|
-
const i =
|
|
1149
|
-
|
|
1150
|
-
}),
|
|
1151
|
-
const i =
|
|
1152
|
-
|
|
1153
|
-
}), Object.entries(r.colors.overlay).forEach(([
|
|
1154
|
-
const i =
|
|
1155
|
-
|
|
1156
|
-
}), Object.entries(r.colors.alert).forEach(([
|
|
1157
|
-
Object.entries(c).forEach(([i,
|
|
1158
|
-
const
|
|
1159
|
-
|
|
1143
|
+
function p(r, l) {
|
|
1144
|
+
const t = r.colors.accent ?? f, o = r.colors.datePicker ?? {}, n = { ...r.shadows, accent: r.shadows.accent ?? $ };
|
|
1145
|
+
if (l instanceof ShadowRoot) {
|
|
1146
|
+
let u = l.querySelector("#malachite-theme-vars");
|
|
1147
|
+
u || (u = document.createElement("style"), u.id = "malachite-theme-vars", l.appendChild(u));
|
|
1148
|
+
const a = [];
|
|
1149
|
+
Object.entries(r.fontSizes).forEach(([s, c]) => {
|
|
1150
|
+
a.push(`--malachite-font-size-${s}: ${c}`);
|
|
1151
|
+
}), Object.entries(r.iconSizes).forEach(([s, c]) => {
|
|
1152
|
+
a.push(`--malachite-icon-size-${s}: ${c}`);
|
|
1153
|
+
}), Object.entries(r.radius).forEach(([s, c]) => {
|
|
1154
|
+
a.push(`--malachite-radius-${s}: ${c}`);
|
|
1155
|
+
}), Object.entries(r.controlHeights ?? h).forEach(([s, c]) => {
|
|
1156
|
+
a.push(`--malachite-control-height-${s}: ${c}`);
|
|
1157
|
+
}), Object.entries(n).forEach(([s, c]) => {
|
|
1158
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1159
|
+
a.push(`--malachite-shadow-${i}: ${c}`);
|
|
1160
|
+
}), a.push(`--malachite-shadow-color: ${r.colors.shadowColor}`), a.push(`--malachite-shadow-opacity: ${r.colors.shadowOpacity}`), Object.entries(r.colors.card).forEach(([s, c]) => {
|
|
1161
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1162
|
+
a.push(`--malachite-card-${i}: ${c}`);
|
|
1163
|
+
}), Object.entries(r.colors.overlay).forEach(([s, c]) => {
|
|
1164
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1165
|
+
a.push(`--malachite-overlay-${i}: ${c}`);
|
|
1166
|
+
}), Object.entries(r.colors.alert).forEach(([s, c]) => {
|
|
1167
|
+
Object.entries(c).forEach(([i, b]) => {
|
|
1168
|
+
const m = i.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1169
|
+
a.push(`--malachite-alert-${s}-${m}: ${b}`);
|
|
1160
1170
|
});
|
|
1161
|
-
}), Object.entries(r.colors.tooltip).forEach(([
|
|
1162
|
-
const i =
|
|
1163
|
-
|
|
1164
|
-
}), Object.entries(r.colors.buttonList).forEach(([
|
|
1165
|
-
const i =
|
|
1166
|
-
|
|
1167
|
-
}), Object.entries(r.colors.pillButton).forEach(([
|
|
1168
|
-
const i =
|
|
1169
|
-
|
|
1170
|
-
}), Object.entries(r.colors.toggle).forEach(([
|
|
1171
|
-
const i =
|
|
1172
|
-
|
|
1173
|
-
}), Object.entries(r.colors.segmentedControl).forEach(([
|
|
1174
|
-
const i =
|
|
1175
|
-
|
|
1176
|
-
}), Object.entries(r.colors.selectableCard).forEach(([
|
|
1177
|
-
const i =
|
|
1178
|
-
|
|
1179
|
-
}), Object.entries(r.colors.cardStrip).forEach(([
|
|
1180
|
-
const i =
|
|
1181
|
-
|
|
1182
|
-
}), Object.entries(r.colors.selectionBar).forEach(([
|
|
1183
|
-
const i =
|
|
1184
|
-
|
|
1185
|
-
}), Object.entries(r.colors.inlineConfirm).forEach(([
|
|
1186
|
-
const i =
|
|
1187
|
-
|
|
1188
|
-
}), Object.entries(r.colors.dropdown).forEach(([
|
|
1189
|
-
const i =
|
|
1190
|
-
|
|
1191
|
-
}), Object.entries(r.colors.control).forEach(([
|
|
1192
|
-
const i =
|
|
1193
|
-
|
|
1194
|
-
}), Object.entries(
|
|
1195
|
-
const i =
|
|
1196
|
-
|
|
1197
|
-
}), Object.entries(
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1171
|
+
}), Object.entries(r.colors.tooltip).forEach(([s, c]) => {
|
|
1172
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1173
|
+
a.push(`--malachite-tooltip-${i}: ${c}`);
|
|
1174
|
+
}), Object.entries(r.colors.buttonList).forEach(([s, c]) => {
|
|
1175
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1176
|
+
a.push(`--malachite-buttonlist-${i}: ${c}`);
|
|
1177
|
+
}), Object.entries(r.colors.pillButton).forEach(([s, c]) => {
|
|
1178
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1179
|
+
a.push(`--malachite-pillbutton-${i}: ${c}`);
|
|
1180
|
+
}), Object.entries(r.colors.toggle).forEach(([s, c]) => {
|
|
1181
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1182
|
+
a.push(`--malachite-toggle-${i}: ${c}`);
|
|
1183
|
+
}), Object.entries(r.colors.segmentedControl).forEach(([s, c]) => {
|
|
1184
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1185
|
+
a.push(`--malachite-segmented-control-${i}: ${c}`);
|
|
1186
|
+
}), Object.entries(r.colors.selectableCard).forEach(([s, c]) => {
|
|
1187
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1188
|
+
a.push(`--malachite-selectable-card-${i}: ${c}`);
|
|
1189
|
+
}), Object.entries(r.colors.cardStrip).forEach(([s, c]) => {
|
|
1190
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1191
|
+
a.push(`--malachite-card-strip-${i}: ${c}`);
|
|
1192
|
+
}), Object.entries(r.colors.selectionBar).forEach(([s, c]) => {
|
|
1193
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1194
|
+
a.push(`--malachite-selection-bar-${i}: ${c}`);
|
|
1195
|
+
}), Object.entries(r.colors.inlineConfirm).forEach(([s, c]) => {
|
|
1196
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1197
|
+
a.push(`--malachite-inline-confirm-${i}: ${c}`);
|
|
1198
|
+
}), Object.entries(r.colors.dropdown).forEach(([s, c]) => {
|
|
1199
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1200
|
+
a.push(`--malachite-dropdown-${i}: ${c}`);
|
|
1201
|
+
}), Object.entries(r.colors.control).forEach(([s, c]) => {
|
|
1202
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1203
|
+
a.push(`--malachite-control-${i}: ${c}`);
|
|
1204
|
+
}), Object.entries(t).forEach(([s, c]) => {
|
|
1205
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1206
|
+
a.push(`--malachite-accent-${i}: ${c}`);
|
|
1207
|
+
}), Object.entries(o).forEach(([s, c]) => {
|
|
1208
|
+
c && a.push(`${B(s)}: ${c}`);
|
|
1209
|
+
}), Object.entries(r.colors.tag).forEach(([s, c]) => {
|
|
1210
|
+
Object.entries(c).forEach(([i, b]) => {
|
|
1211
|
+
const m = i.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1212
|
+
a.push(`--malachite-tag-${s}-${m}: ${b}`);
|
|
1201
1213
|
});
|
|
1202
|
-
}), Object.entries(r.colors.numberTag).forEach(([
|
|
1203
|
-
const i =
|
|
1204
|
-
|
|
1205
|
-
}),
|
|
1214
|
+
}), Object.entries(r.colors.numberTag).forEach(([s, c]) => {
|
|
1215
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1216
|
+
a.push(`--malachite-number-tag-${i}: ${c}`);
|
|
1217
|
+
}), C(
|
|
1206
1218
|
r.colors.table,
|
|
1207
1219
|
"--malachite-table",
|
|
1208
|
-
(
|
|
1209
|
-
), Object.entries(r.colors.text).forEach(([
|
|
1210
|
-
const i =
|
|
1211
|
-
typeof c == "object" && c !== null ? Object.entries(c).forEach(([
|
|
1212
|
-
const
|
|
1213
|
-
typeof
|
|
1214
|
-
([
|
|
1215
|
-
const
|
|
1216
|
-
|
|
1217
|
-
`--malachite-text-${i}-${
|
|
1220
|
+
(s, c) => a.push(`${s}: ${c}`)
|
|
1221
|
+
), Object.entries(r.colors.text).forEach(([s, c]) => {
|
|
1222
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1223
|
+
typeof c == "object" && c !== null ? Object.entries(c).forEach(([b, m]) => {
|
|
1224
|
+
const V = b.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1225
|
+
typeof m == "object" && m !== null ? Object.entries(m).forEach(
|
|
1226
|
+
([H, K]) => {
|
|
1227
|
+
const z = H.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1228
|
+
a.push(
|
|
1229
|
+
`--malachite-text-${i}-${V}-${z}: ${K}`
|
|
1218
1230
|
);
|
|
1219
1231
|
}
|
|
1220
|
-
) :
|
|
1221
|
-
`--malachite-text-${i}-${
|
|
1232
|
+
) : a.push(
|
|
1233
|
+
`--malachite-text-${i}-${V}: ${m}`
|
|
1222
1234
|
);
|
|
1223
|
-
}) :
|
|
1224
|
-
}), Object.entries(r.colors.codeBlock).forEach(([
|
|
1225
|
-
const i =
|
|
1226
|
-
|
|
1227
|
-
}), Object.entries(r.colors.chat).forEach(([
|
|
1228
|
-
const i =
|
|
1229
|
-
|
|
1230
|
-
}), Object.entries(r.colors.assistant).forEach(([
|
|
1231
|
-
const i =
|
|
1232
|
-
|
|
1235
|
+
}) : a.push(`--malachite-text-${i}: ${c}`);
|
|
1236
|
+
}), Object.entries(r.colors.codeBlock).forEach(([s, c]) => {
|
|
1237
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1238
|
+
a.push(`--malachite-codeblock-${i}: ${c}`);
|
|
1239
|
+
}), Object.entries(r.colors.chat).forEach(([s, c]) => {
|
|
1240
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1241
|
+
a.push(`--malachite-chat-${i}: ${c}`);
|
|
1242
|
+
}), Object.entries(r.colors.assistant).forEach(([s, c]) => {
|
|
1243
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1244
|
+
a.push(`--malachite-assistant-${i}: ${c}`);
|
|
1233
1245
|
}), [
|
|
1234
1246
|
"primary",
|
|
1235
1247
|
"secondary",
|
|
@@ -1238,118 +1250,121 @@ function m(r, s) {
|
|
|
1238
1250
|
"success",
|
|
1239
1251
|
"warning",
|
|
1240
1252
|
"error"
|
|
1241
|
-
].forEach((
|
|
1242
|
-
const c = r.colors[
|
|
1243
|
-
Object.entries(c).forEach(([i,
|
|
1244
|
-
const
|
|
1245
|
-
|
|
1253
|
+
].forEach((s) => {
|
|
1254
|
+
const c = r.colors[s];
|
|
1255
|
+
Object.entries(c).forEach(([i, b]) => {
|
|
1256
|
+
const m = i.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1257
|
+
a.push(`--malachite-${s}-${m}: ${b}`);
|
|
1246
1258
|
});
|
|
1247
1259
|
});
|
|
1248
|
-
const g =
|
|
1249
|
-
if (!
|
|
1250
|
-
const c =
|
|
1260
|
+
const g = a.filter((s) => {
|
|
1261
|
+
if (!A.test(s)) return !0;
|
|
1262
|
+
const c = s.split(":", 1)[0].trim(), i = Z.test(c) ? c : "an unnamed token";
|
|
1251
1263
|
return console.warn(`Malachite: dropped an unsafe theme declaration for ${i}`), !1;
|
|
1252
1264
|
});
|
|
1253
|
-
|
|
1254
|
-
} else
|
|
1255
|
-
|
|
1256
|
-
}), Object.entries(r.iconSizes).forEach(([
|
|
1257
|
-
|
|
1258
|
-
}), Object.entries(r.radius).forEach(([
|
|
1259
|
-
|
|
1260
|
-
}), Object.entries(r.controlHeights ??
|
|
1261
|
-
|
|
1262
|
-
}), Object.entries(
|
|
1263
|
-
const g =
|
|
1264
|
-
|
|
1265
|
-
}),
|
|
1265
|
+
u.textContent = `:host { ${g.join("; ")} }`;
|
|
1266
|
+
} else l instanceof HTMLElement && (Object.entries(r.fontSizes).forEach(([a, d]) => {
|
|
1267
|
+
l.style.setProperty(`--malachite-font-size-${a}`, d);
|
|
1268
|
+
}), Object.entries(r.iconSizes).forEach(([a, d]) => {
|
|
1269
|
+
l.style.setProperty(`--malachite-icon-size-${a}`, d);
|
|
1270
|
+
}), Object.entries(r.radius).forEach(([a, d]) => {
|
|
1271
|
+
l.style.setProperty(`--malachite-radius-${a}`, d);
|
|
1272
|
+
}), Object.entries(r.controlHeights ?? h).forEach(([a, d]) => {
|
|
1273
|
+
l.style.setProperty(`--malachite-control-height-${a}`, d);
|
|
1274
|
+
}), Object.entries(n).forEach(([a, d]) => {
|
|
1275
|
+
const g = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1276
|
+
l.style.setProperty(`--malachite-shadow-${g}`, d);
|
|
1277
|
+
}), l.style.setProperty("--malachite-shadow-color", r.colors.shadowColor), l.style.setProperty(
|
|
1266
1278
|
"--malachite-shadow-opacity",
|
|
1267
1279
|
r.colors.shadowOpacity.toString()
|
|
1268
|
-
), Object.entries(r.colors.card).forEach(([
|
|
1269
|
-
const g =
|
|
1270
|
-
|
|
1271
|
-
}), Object.entries(r.colors.overlay).forEach(([
|
|
1272
|
-
const g =
|
|
1273
|
-
|
|
1274
|
-
}), Object.entries(r.colors.alert).forEach(([
|
|
1275
|
-
Object.entries(d).forEach(([g,
|
|
1280
|
+
), Object.entries(r.colors.card).forEach(([a, d]) => {
|
|
1281
|
+
const g = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1282
|
+
l.style.setProperty(`--malachite-card-${g}`, d);
|
|
1283
|
+
}), Object.entries(r.colors.overlay).forEach(([a, d]) => {
|
|
1284
|
+
const g = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1285
|
+
l.style.setProperty(`--malachite-overlay-${g}`, d);
|
|
1286
|
+
}), Object.entries(r.colors.alert).forEach(([a, d]) => {
|
|
1287
|
+
Object.entries(d).forEach(([g, s]) => {
|
|
1276
1288
|
const c = g.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1277
|
-
|
|
1289
|
+
l.style.setProperty(`--malachite-alert-${a}-${c}`, s);
|
|
1278
1290
|
});
|
|
1279
|
-
}), Object.entries(r.colors.tooltip).forEach(([
|
|
1280
|
-
const g =
|
|
1281
|
-
|
|
1282
|
-
}), Object.entries(r.colors.buttonList).forEach(([
|
|
1283
|
-
const g =
|
|
1284
|
-
|
|
1285
|
-
}), Object.entries(r.colors.pillButton).forEach(([
|
|
1286
|
-
const g =
|
|
1287
|
-
|
|
1288
|
-
}), Object.entries(r.colors.toggle).forEach(([
|
|
1289
|
-
const g =
|
|
1290
|
-
|
|
1291
|
-
}), Object.entries(r.colors.segmentedControl).forEach(([
|
|
1292
|
-
const g =
|
|
1293
|
-
|
|
1294
|
-
}), Object.entries(r.colors.selectableCard).forEach(([
|
|
1295
|
-
const g =
|
|
1296
|
-
|
|
1297
|
-
}), Object.entries(r.colors.cardStrip).forEach(([
|
|
1298
|
-
const g =
|
|
1299
|
-
|
|
1300
|
-
}), Object.entries(r.colors.selectionBar).forEach(([
|
|
1301
|
-
const g =
|
|
1302
|
-
|
|
1303
|
-
}), Object.entries(r.colors.inlineConfirm).forEach(([
|
|
1304
|
-
const g =
|
|
1305
|
-
|
|
1306
|
-
}), Object.entries(r.colors.dropdown).forEach(([
|
|
1307
|
-
const g =
|
|
1308
|
-
|
|
1309
|
-
}), Object.entries(r.colors.control).forEach(([
|
|
1310
|
-
const g =
|
|
1311
|
-
|
|
1312
|
-
}), Object.entries(
|
|
1313
|
-
const g =
|
|
1314
|
-
|
|
1315
|
-
}),
|
|
1316
|
-
|
|
1291
|
+
}), Object.entries(r.colors.tooltip).forEach(([a, d]) => {
|
|
1292
|
+
const g = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1293
|
+
l.style.setProperty(`--malachite-tooltip-${g}`, d);
|
|
1294
|
+
}), Object.entries(r.colors.buttonList).forEach(([a, d]) => {
|
|
1295
|
+
const g = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1296
|
+
l.style.setProperty(`--malachite-buttonlist-${g}`, d);
|
|
1297
|
+
}), Object.entries(r.colors.pillButton).forEach(([a, d]) => {
|
|
1298
|
+
const g = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1299
|
+
l.style.setProperty(`--malachite-pillbutton-${g}`, d);
|
|
1300
|
+
}), Object.entries(r.colors.toggle).forEach(([a, d]) => {
|
|
1301
|
+
const g = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1302
|
+
l.style.setProperty(`--malachite-toggle-${g}`, d);
|
|
1303
|
+
}), Object.entries(r.colors.segmentedControl).forEach(([a, d]) => {
|
|
1304
|
+
const g = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1305
|
+
l.style.setProperty(`--malachite-segmented-control-${g}`, d);
|
|
1306
|
+
}), Object.entries(r.colors.selectableCard).forEach(([a, d]) => {
|
|
1307
|
+
const g = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1308
|
+
l.style.setProperty(`--malachite-selectable-card-${g}`, d);
|
|
1309
|
+
}), Object.entries(r.colors.cardStrip).forEach(([a, d]) => {
|
|
1310
|
+
const g = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1311
|
+
l.style.setProperty(`--malachite-card-strip-${g}`, d);
|
|
1312
|
+
}), Object.entries(r.colors.selectionBar).forEach(([a, d]) => {
|
|
1313
|
+
const g = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1314
|
+
l.style.setProperty(`--malachite-selection-bar-${g}`, d);
|
|
1315
|
+
}), Object.entries(r.colors.inlineConfirm).forEach(([a, d]) => {
|
|
1316
|
+
const g = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1317
|
+
l.style.setProperty(`--malachite-inline-confirm-${g}`, d);
|
|
1318
|
+
}), Object.entries(r.colors.dropdown).forEach(([a, d]) => {
|
|
1319
|
+
const g = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1320
|
+
l.style.setProperty(`--malachite-dropdown-${g}`, d);
|
|
1321
|
+
}), Object.entries(r.colors.control).forEach(([a, d]) => {
|
|
1322
|
+
const g = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1323
|
+
l.style.setProperty(`--malachite-control-${g}`, d);
|
|
1324
|
+
}), Object.entries(t).forEach(([a, d]) => {
|
|
1325
|
+
const g = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1326
|
+
l.style.setProperty(`--malachite-accent-${g}`, d);
|
|
1327
|
+
}), F.forEach((a) => {
|
|
1328
|
+
const d = o[a];
|
|
1329
|
+
d ? l.style.setProperty(B(a), d) : l.style.removeProperty(B(a));
|
|
1330
|
+
}), Object.entries(r.colors.tag).forEach(([a, d]) => {
|
|
1331
|
+
Object.entries(d).forEach(([g, s]) => {
|
|
1317
1332
|
const c = g.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1318
|
-
|
|
1333
|
+
l.style.setProperty(`--malachite-tag-${a}-${c}`, s);
|
|
1319
1334
|
});
|
|
1320
|
-
}), Object.entries(r.colors.numberTag).forEach(([
|
|
1321
|
-
const g =
|
|
1322
|
-
|
|
1323
|
-
}),
|
|
1335
|
+
}), Object.entries(r.colors.numberTag).forEach(([a, d]) => {
|
|
1336
|
+
const g = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1337
|
+
l.style.setProperty(`--malachite-number-tag-${g}`, d);
|
|
1338
|
+
}), C(
|
|
1324
1339
|
r.colors.table,
|
|
1325
1340
|
"--malachite-table",
|
|
1326
|
-
(
|
|
1327
|
-
), Object.entries(r.colors.text).forEach(([
|
|
1328
|
-
const g =
|
|
1329
|
-
typeof d == "object" && d !== null ? Object.entries(d).forEach(([
|
|
1330
|
-
const i =
|
|
1341
|
+
(a, d) => l.style.setProperty(a, d)
|
|
1342
|
+
), Object.entries(r.colors.text).forEach(([a, d]) => {
|
|
1343
|
+
const g = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1344
|
+
typeof d == "object" && d !== null ? Object.entries(d).forEach(([s, c]) => {
|
|
1345
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1331
1346
|
typeof c == "object" && c !== null ? Object.entries(c).forEach(
|
|
1332
|
-
([
|
|
1333
|
-
const
|
|
1334
|
-
|
|
1335
|
-
`--malachite-text-${g}-${i}-${
|
|
1336
|
-
|
|
1347
|
+
([b, m]) => {
|
|
1348
|
+
const V = b.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1349
|
+
l.style.setProperty(
|
|
1350
|
+
`--malachite-text-${g}-${i}-${V}`,
|
|
1351
|
+
m
|
|
1337
1352
|
);
|
|
1338
1353
|
}
|
|
1339
|
-
) :
|
|
1354
|
+
) : l.style.setProperty(
|
|
1340
1355
|
`--malachite-text-${g}-${i}`,
|
|
1341
1356
|
c
|
|
1342
1357
|
);
|
|
1343
|
-
}) :
|
|
1344
|
-
}), Object.entries(r.colors.codeBlock).forEach(([
|
|
1345
|
-
const g =
|
|
1346
|
-
|
|
1347
|
-
}), Object.entries(r.colors.chat).forEach(([
|
|
1348
|
-
const g =
|
|
1349
|
-
|
|
1350
|
-
}), Object.entries(r.colors.assistant).forEach(([
|
|
1351
|
-
const g =
|
|
1352
|
-
|
|
1358
|
+
}) : l.style.setProperty(`--malachite-text-${g}`, d);
|
|
1359
|
+
}), Object.entries(r.colors.codeBlock).forEach(([a, d]) => {
|
|
1360
|
+
const g = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1361
|
+
l.style.setProperty(`--malachite-codeblock-${g}`, d);
|
|
1362
|
+
}), Object.entries(r.colors.chat).forEach(([a, d]) => {
|
|
1363
|
+
const g = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1364
|
+
l.style.setProperty(`--malachite-chat-${g}`, d);
|
|
1365
|
+
}), Object.entries(r.colors.assistant).forEach(([a, d]) => {
|
|
1366
|
+
const g = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1367
|
+
l.style.setProperty(`--malachite-assistant-${g}`, d);
|
|
1353
1368
|
}), [
|
|
1354
1369
|
"primary",
|
|
1355
1370
|
"secondary",
|
|
@@ -1358,164 +1373,171 @@ function m(r, s) {
|
|
|
1358
1373
|
"success",
|
|
1359
1374
|
"warning",
|
|
1360
1375
|
"error"
|
|
1361
|
-
].forEach((
|
|
1362
|
-
const d = r.colors[
|
|
1363
|
-
Object.entries(d).forEach(([g,
|
|
1376
|
+
].forEach((a) => {
|
|
1377
|
+
const d = r.colors[a];
|
|
1378
|
+
Object.entries(d).forEach(([g, s]) => {
|
|
1364
1379
|
const c = g.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1365
|
-
|
|
1380
|
+
l.style.setProperty(`--malachite-${a}-${c}`, s);
|
|
1366
1381
|
});
|
|
1367
1382
|
}));
|
|
1368
1383
|
}
|
|
1369
|
-
function
|
|
1384
|
+
function G(r) {
|
|
1370
1385
|
try {
|
|
1371
|
-
const
|
|
1372
|
-
|
|
1373
|
-
} catch (
|
|
1374
|
-
console.error("Error applying theme to shadow root:",
|
|
1386
|
+
const l = x(), t = P(), o = l === "dark" ? y : e, n = t ? k(o, t) : o;
|
|
1387
|
+
p(n, r);
|
|
1388
|
+
} catch (l) {
|
|
1389
|
+
console.error("Error applying theme to shadow root:", l);
|
|
1375
1390
|
}
|
|
1376
1391
|
}
|
|
1377
|
-
function w() {
|
|
1378
|
-
return typeof window > "u" ? "light" : localStorage.getItem(C) || "light";
|
|
1379
|
-
}
|
|
1380
1392
|
function x() {
|
|
1393
|
+
return typeof window > "u" ? "light" : localStorage.getItem(S) || "light";
|
|
1394
|
+
}
|
|
1395
|
+
function P() {
|
|
1381
1396
|
if (typeof window > "u") return null;
|
|
1382
|
-
const r = localStorage.getItem(
|
|
1397
|
+
const r = localStorage.getItem(v);
|
|
1383
1398
|
if (!r) return null;
|
|
1384
1399
|
try {
|
|
1385
1400
|
return JSON.parse(r);
|
|
1386
1401
|
} catch {
|
|
1387
|
-
return localStorage.removeItem(
|
|
1402
|
+
return localStorage.removeItem(v), null;
|
|
1388
1403
|
}
|
|
1389
1404
|
}
|
|
1390
|
-
function
|
|
1391
|
-
typeof window < "u" && localStorage.setItem(
|
|
1405
|
+
function T(r) {
|
|
1406
|
+
typeof window < "u" && localStorage.setItem(S, r);
|
|
1392
1407
|
}
|
|
1393
|
-
function
|
|
1394
|
-
typeof window < "u" && localStorage.setItem(
|
|
1408
|
+
function _(r) {
|
|
1409
|
+
typeof window < "u" && localStorage.setItem(v, JSON.stringify(r));
|
|
1395
1410
|
}
|
|
1396
|
-
function
|
|
1397
|
-
const
|
|
1398
|
-
if (
|
|
1399
|
-
...o.controlHeights ??
|
|
1400
|
-
...
|
|
1401
|
-
}),
|
|
1402
|
-
if (o.colors = { ...o.colors },
|
|
1411
|
+
function k(r, l) {
|
|
1412
|
+
const t = O(l, ""), o = { ...r };
|
|
1413
|
+
if (t.fontSizes && (o.fontSizes = { ...o.fontSizes, ...t.fontSizes }), t.iconSizes && (o.iconSizes = { ...o.iconSizes, ...t.iconSizes }), t.radius && (o.radius = { ...o.radius, ...t.radius }), t.controlHeights && (o.controlHeights = {
|
|
1414
|
+
...o.controlHeights ?? h,
|
|
1415
|
+
...t.controlHeights
|
|
1416
|
+
}), t.shadows && (o.shadows = { ...o.shadows, ...t.shadows }), t.colors) {
|
|
1417
|
+
if (o.colors = { ...o.colors }, t.colors.shadowColor !== void 0 && (o.colors.shadowColor = t.colors.shadowColor), t.colors.shadowOpacity !== void 0 && (o.colors.shadowOpacity = t.colors.shadowOpacity), t.colors.card && (o.colors.card = { ...o.colors.card, ...t.colors.card }), t.colors.overlay && (o.colors.overlay = { ...o.colors.overlay, ...t.colors.overlay }), t.colors.alert) {
|
|
1403
1418
|
o.colors.alert = { ...o.colors.alert };
|
|
1404
1419
|
for (const n of Object.keys(
|
|
1405
|
-
|
|
1420
|
+
t.colors.alert
|
|
1406
1421
|
)) {
|
|
1407
|
-
const
|
|
1408
|
-
|
|
1422
|
+
const u = t.colors.alert[n];
|
|
1423
|
+
u && (o.colors.alert[n] = { ...o.colors.alert[n], ...u });
|
|
1409
1424
|
}
|
|
1410
1425
|
}
|
|
1411
|
-
if (
|
|
1412
|
-
...o.colors.accent ??
|
|
1413
|
-
...
|
|
1414
|
-
}),
|
|
1426
|
+
if (t.colors.tooltip && (o.colors.tooltip = { ...o.colors.tooltip, ...t.colors.tooltip }), t.colors.primary && (o.colors.primary = { ...o.colors.primary, ...t.colors.primary }), t.colors.accent && (o.colors.accent = {
|
|
1427
|
+
...o.colors.accent ?? f,
|
|
1428
|
+
...t.colors.accent
|
|
1429
|
+
}), t.colors.datePicker && (o.colors.datePicker = {
|
|
1430
|
+
...o.colors.datePicker,
|
|
1431
|
+
...t.colors.datePicker
|
|
1432
|
+
}), t.colors.control && (o.colors.control = { ...o.colors.control, ...t.colors.control }), t.colors.outline && (o.colors.outline = { ...o.colors.outline, ...t.colors.outline }), t.colors.secondary && (o.colors.secondary = { ...o.colors.secondary, ...t.colors.secondary }), t.colors.destructive && (o.colors.destructive = {
|
|
1415
1433
|
...o.colors.destructive,
|
|
1416
|
-
...
|
|
1417
|
-
}),
|
|
1434
|
+
...t.colors.destructive
|
|
1435
|
+
}), t.colors.success && (o.colors.success = { ...o.colors.success, ...t.colors.success }), t.colors.warning && (o.colors.warning = { ...o.colors.warning, ...t.colors.warning }), t.colors.error && (o.colors.error = { ...o.colors.error, ...t.colors.error }), t.colors.buttonList && (o.colors.buttonList = { ...o.colors.buttonList, ...t.colors.buttonList }), t.colors.pillButton && (o.colors.pillButton = { ...o.colors.pillButton, ...t.colors.pillButton }), t.colors.toggle && (o.colors.toggle = { ...o.colors.toggle, ...t.colors.toggle }), t.colors.segmentedControl && (o.colors.segmentedControl = {
|
|
1418
1436
|
...o.colors.segmentedControl,
|
|
1419
|
-
...
|
|
1420
|
-
}),
|
|
1437
|
+
...t.colors.segmentedControl
|
|
1438
|
+
}), t.colors.selectableCard && (o.colors.selectableCard = {
|
|
1421
1439
|
...o.colors.selectableCard,
|
|
1422
|
-
...
|
|
1423
|
-
}),
|
|
1440
|
+
...t.colors.selectableCard
|
|
1441
|
+
}), t.colors.cardStrip && (o.colors.cardStrip = { ...o.colors.cardStrip, ...t.colors.cardStrip }), t.colors.selectionBar && (o.colors.selectionBar = {
|
|
1424
1442
|
...o.colors.selectionBar,
|
|
1425
|
-
...
|
|
1426
|
-
}),
|
|
1443
|
+
...t.colors.selectionBar
|
|
1444
|
+
}), t.colors.inlineConfirm && (o.colors.inlineConfirm = {
|
|
1427
1445
|
...o.colors.inlineConfirm,
|
|
1428
|
-
...
|
|
1429
|
-
}),
|
|
1446
|
+
...t.colors.inlineConfirm
|
|
1447
|
+
}), t.colors.dropdown && (o.colors.dropdown = { ...o.colors.dropdown, ...t.colors.dropdown }), t.colors.tag) {
|
|
1430
1448
|
o.colors.tag = { ...o.colors.tag };
|
|
1431
1449
|
for (const n of Object.keys(
|
|
1432
|
-
|
|
1450
|
+
t.colors.tag
|
|
1433
1451
|
)) {
|
|
1434
|
-
const
|
|
1435
|
-
|
|
1452
|
+
const u = t.colors.tag[n];
|
|
1453
|
+
u && (o.colors.tag[n] = { ...o.colors.tag[n], ...u });
|
|
1436
1454
|
}
|
|
1437
1455
|
}
|
|
1438
|
-
if (
|
|
1439
|
-
const { rightSideText: n, ...
|
|
1440
|
-
o.colors.text = { ...o.colors.text, ...
|
|
1456
|
+
if (t.colors.numberTag && (o.colors.numberTag = { ...o.colors.numberTag, ...t.colors.numberTag }), t.colors.text) {
|
|
1457
|
+
const { rightSideText: n, ...u } = t.colors.text;
|
|
1458
|
+
o.colors.text = { ...o.colors.text, ...u }, n && (o.colors.text.rightSideText = {
|
|
1441
1459
|
...o.colors.text.rightSideText,
|
|
1442
1460
|
...n
|
|
1443
1461
|
});
|
|
1444
1462
|
}
|
|
1445
|
-
if (
|
|
1446
|
-
const { header: n, row:
|
|
1447
|
-
if (o.colors.table = { ...o.colors.table, ...
|
|
1463
|
+
if (t.colors.codeBlock && (o.colors.codeBlock = { ...o.colors.codeBlock, ...t.colors.codeBlock }), t.colors.chat && (o.colors.chat = { ...o.colors.chat, ...t.colors.chat }), t.colors.assistant && (o.colors.assistant = { ...o.colors.assistant, ...t.colors.assistant }), t.colors.table) {
|
|
1464
|
+
const { header: n, row: u, borderedRow: a, rowVariant: d, error: g, ...s } = t.colors.table;
|
|
1465
|
+
if (o.colors.table = { ...o.colors.table, ...s }, n && (o.colors.table.header = { ...o.colors.table.header, ...n }), u && (o.colors.table.row = { ...o.colors.table.row, ...u }), a && (o.colors.table.borderedRow = {
|
|
1448
1466
|
...o.colors.table.borderedRow,
|
|
1449
|
-
...
|
|
1450
|
-
}),
|
|
1451
|
-
const
|
|
1452
|
-
for (const
|
|
1453
|
-
const b =
|
|
1454
|
-
b && (i
|
|
1467
|
+
...a
|
|
1468
|
+
}), g && (o.colors.table.error = { ...o.colors.table.error, ...g }), d) {
|
|
1469
|
+
const c = { ...o.colors.table.rowVariant };
|
|
1470
|
+
for (const i of Object.keys(d)) {
|
|
1471
|
+
const b = d[i];
|
|
1472
|
+
b && (c[i] = { ...c[i], ...b });
|
|
1455
1473
|
}
|
|
1456
|
-
o.colors.table.rowVariant =
|
|
1474
|
+
o.colors.table.rowVariant = c;
|
|
1457
1475
|
}
|
|
1458
1476
|
}
|
|
1459
1477
|
}
|
|
1460
1478
|
return o;
|
|
1461
1479
|
}
|
|
1462
|
-
function
|
|
1463
|
-
|
|
1464
|
-
const
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
}),
|
|
1480
|
+
function N(r) {
|
|
1481
|
+
_(r);
|
|
1482
|
+
const l = x(), o = k(l === "dark" ? y : e, r);
|
|
1483
|
+
p(o, document.documentElement), w.forEach((n) => {
|
|
1484
|
+
p(o, n);
|
|
1485
|
+
}), l === "dark" ? document.documentElement.setAttribute("data-theme", "dark") : document.documentElement.removeAttribute("data-theme");
|
|
1468
1486
|
}
|
|
1469
|
-
function
|
|
1470
|
-
const
|
|
1471
|
-
|
|
1487
|
+
function Y(r, l) {
|
|
1488
|
+
const t = l === "dark" ? y : e, o = P(), n = o ? k(t, o) : t;
|
|
1489
|
+
p(n, r);
|
|
1472
1490
|
}
|
|
1473
|
-
function
|
|
1474
|
-
|
|
1475
|
-
const r =
|
|
1476
|
-
|
|
1477
|
-
|
|
1491
|
+
function L() {
|
|
1492
|
+
T("light"), document.documentElement.removeAttribute("data-theme");
|
|
1493
|
+
const r = P(), l = r ? k(e, r) : e;
|
|
1494
|
+
p(l, document.documentElement), w.forEach((t) => {
|
|
1495
|
+
p(l, t);
|
|
1478
1496
|
});
|
|
1479
1497
|
}
|
|
1480
|
-
function
|
|
1481
|
-
|
|
1482
|
-
const r =
|
|
1483
|
-
|
|
1484
|
-
|
|
1498
|
+
function j() {
|
|
1499
|
+
T("dark"), document.documentElement.setAttribute("data-theme", "dark");
|
|
1500
|
+
const r = P(), l = r ? k(y, r) : y;
|
|
1501
|
+
p(l, document.documentElement), w.forEach((t) => {
|
|
1502
|
+
p(l, t);
|
|
1485
1503
|
});
|
|
1486
1504
|
}
|
|
1487
|
-
function
|
|
1488
|
-
return
|
|
1505
|
+
function U() {
|
|
1506
|
+
return x() === "dark" ? (L(), "light") : (j(), "dark");
|
|
1489
1507
|
}
|
|
1490
|
-
function
|
|
1491
|
-
|
|
1508
|
+
function J(r) {
|
|
1509
|
+
N(r);
|
|
1492
1510
|
}
|
|
1493
|
-
function
|
|
1494
|
-
const r =
|
|
1495
|
-
localStorage.removeItem(
|
|
1511
|
+
function q() {
|
|
1512
|
+
const r = x();
|
|
1513
|
+
localStorage.removeItem(v), r === "dark" ? j() : L();
|
|
1496
1514
|
}
|
|
1497
|
-
function
|
|
1515
|
+
function D() {
|
|
1498
1516
|
if (typeof window < "u") {
|
|
1499
|
-
const r =
|
|
1517
|
+
const r = x(), l = P();
|
|
1500
1518
|
if (r === "dark") {
|
|
1501
|
-
if (
|
|
1502
|
-
const
|
|
1503
|
-
|
|
1519
|
+
if (l) {
|
|
1520
|
+
const t = k(y, l);
|
|
1521
|
+
p(t, document.documentElement);
|
|
1504
1522
|
} else
|
|
1505
|
-
|
|
1523
|
+
p(y, document.documentElement);
|
|
1506
1524
|
document.documentElement.setAttribute("data-theme", "dark");
|
|
1507
1525
|
} else {
|
|
1508
|
-
if (
|
|
1509
|
-
const
|
|
1510
|
-
|
|
1526
|
+
if (l) {
|
|
1527
|
+
const t = k(e, l);
|
|
1528
|
+
p(t, document.documentElement);
|
|
1511
1529
|
} else
|
|
1512
|
-
|
|
1530
|
+
p(e, document.documentElement);
|
|
1513
1531
|
document.documentElement.removeAttribute("data-theme");
|
|
1514
1532
|
}
|
|
1515
1533
|
}
|
|
1516
1534
|
}
|
|
1517
|
-
function
|
|
1518
|
-
const r = getComputedStyle(document.documentElement);
|
|
1535
|
+
function X() {
|
|
1536
|
+
const r = getComputedStyle(document.documentElement), l = {};
|
|
1537
|
+
for (const t of F) {
|
|
1538
|
+
const o = r.getPropertyValue(B(t)).trim();
|
|
1539
|
+
o && (l[t] = o);
|
|
1540
|
+
}
|
|
1519
1541
|
return {
|
|
1520
1542
|
fontSizes: {
|
|
1521
1543
|
xsmall: r.getPropertyValue("--malachite-font-size-xsmall").trim() || e.fontSizes.xsmall,
|
|
@@ -1533,9 +1555,9 @@ function U() {
|
|
|
1533
1555
|
large: r.getPropertyValue("--malachite-icon-size-large").trim() || e.iconSizes.large
|
|
1534
1556
|
},
|
|
1535
1557
|
controlHeights: {
|
|
1536
|
-
small: r.getPropertyValue("--malachite-control-height-small").trim() ||
|
|
1537
|
-
medium: r.getPropertyValue("--malachite-control-height-medium").trim() ||
|
|
1538
|
-
large: r.getPropertyValue("--malachite-control-height-large").trim() ||
|
|
1558
|
+
small: r.getPropertyValue("--malachite-control-height-small").trim() || h.small,
|
|
1559
|
+
medium: r.getPropertyValue("--malachite-control-height-medium").trim() || h.medium,
|
|
1560
|
+
large: r.getPropertyValue("--malachite-control-height-large").trim() || h.large
|
|
1539
1561
|
},
|
|
1540
1562
|
radius: {
|
|
1541
1563
|
xs: r.getPropertyValue("--malachite-radius-xs").trim() || e.radius.xs,
|
|
@@ -1555,7 +1577,7 @@ function U() {
|
|
|
1555
1577
|
glow: r.getPropertyValue("--malachite-shadow-glow").trim() || e.shadows.glow,
|
|
1556
1578
|
glowLg: r.getPropertyValue("--malachite-shadow-glow-lg").trim() || e.shadows.glowLg,
|
|
1557
1579
|
default: r.getPropertyValue("--malachite-shadow-default").trim() || e.shadows.default,
|
|
1558
|
-
accent: r.getPropertyValue("--malachite-shadow-accent").trim() ||
|
|
1580
|
+
accent: r.getPropertyValue("--malachite-shadow-accent").trim() || $,
|
|
1559
1581
|
success: r.getPropertyValue("--malachite-shadow-success").trim() || e.shadows.success,
|
|
1560
1582
|
warning: r.getPropertyValue("--malachite-shadow-warning").trim() || e.shadows.warning,
|
|
1561
1583
|
error: r.getPropertyValue("--malachite-shadow-error").trim() || e.shadows.error
|
|
@@ -1618,11 +1640,12 @@ function U() {
|
|
|
1618
1640
|
borderHover: r.getPropertyValue("--malachite-primary-border-hover").trim() || e.colors.primary.borderHover
|
|
1619
1641
|
},
|
|
1620
1642
|
accent: {
|
|
1621
|
-
background: r.getPropertyValue("--malachite-accent-background").trim() ||
|
|
1622
|
-
foreground: r.getPropertyValue("--malachite-accent-foreground").trim() ||
|
|
1623
|
-
border: r.getPropertyValue("--malachite-accent-border").trim() ||
|
|
1624
|
-
backgroundGlass: r.getPropertyValue("--malachite-accent-background-glass").trim() ||
|
|
1643
|
+
background: r.getPropertyValue("--malachite-accent-background").trim() || f.background,
|
|
1644
|
+
foreground: r.getPropertyValue("--malachite-accent-foreground").trim() || f.foreground,
|
|
1645
|
+
border: r.getPropertyValue("--malachite-accent-border").trim() || f.border,
|
|
1646
|
+
backgroundGlass: r.getPropertyValue("--malachite-accent-background-glass").trim() || f.backgroundGlass
|
|
1625
1647
|
},
|
|
1648
|
+
datePicker: l,
|
|
1626
1649
|
control: {
|
|
1627
1650
|
borderHover: r.getPropertyValue("--malachite-control-border-hover").trim() || e.colors.control.borderHover
|
|
1628
1651
|
},
|
|
@@ -1934,26 +1957,26 @@ function U() {
|
|
|
1934
1957
|
}
|
|
1935
1958
|
};
|
|
1936
1959
|
}
|
|
1937
|
-
let
|
|
1938
|
-
const
|
|
1939
|
-
|
|
1960
|
+
let E = !1;
|
|
1961
|
+
const Q = () => {
|
|
1962
|
+
E || (E = !0, D());
|
|
1940
1963
|
};
|
|
1941
1964
|
export {
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1965
|
+
h as CONTROL_HEIGHT,
|
|
1966
|
+
J as applyCustomTheme,
|
|
1967
|
+
j as applyDarkTheme,
|
|
1968
|
+
L as applyLightTheme,
|
|
1969
|
+
N as applyTheme,
|
|
1970
|
+
Y as applyThemeVars,
|
|
1971
|
+
y as darkTheme,
|
|
1949
1972
|
e as defaultTheme,
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1973
|
+
Q as ensureThemeInitialized,
|
|
1974
|
+
X as getCurrentTheme,
|
|
1975
|
+
x as getCurrentThemeMode,
|
|
1976
|
+
D as initializeTheme,
|
|
1977
|
+
I as registerShadowRoot,
|
|
1978
|
+
q as resetTheme,
|
|
1979
|
+
U as toggleTheme,
|
|
1980
|
+
W as unregisterShadowRoot
|
|
1958
1981
|
};
|
|
1959
1982
|
//# sourceMappingURL=theme.js.map
|