@stackone/malachite 2.86.0 → 2.87.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 +3 -2
- package/dist/components/Card.js +128 -75
- package/dist/components/Card.js.map +1 -1
- package/dist/components/FilterSearch.js +228 -224
- package/dist/components/FilterSearch.js.map +1 -1
- package/dist/components/FrameHeader.js +36 -0
- package/dist/components/FrameHeader.js.map +1 -0
- package/dist/components/LoadingBar.js +5 -5
- package/dist/components/LoadingBar.js.map +1 -1
- package/dist/components/MultiSelect.js +431 -382
- package/dist/components/MultiSelect.js.map +1 -1
- package/dist/components/Table/Table.js +630 -606
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/TimeBarChart/TimeBarChart.js +241 -0
- package/dist/components/TimeBarChart/TimeBarChart.js.map +1 -0
- package/dist/components/TimeBarChart/TimeBarChartAxes.js +49 -0
- package/dist/components/TimeBarChart/TimeBarChartAxes.js.map +1 -0
- package/dist/components/TimeBarChart/TimeBarChartBars.js +58 -0
- package/dist/components/TimeBarChart/TimeBarChartBars.js.map +1 -0
- package/dist/components/TimeBarChart/TimeBarChartLegend.js +29 -0
- package/dist/components/TimeBarChart/TimeBarChartLegend.js.map +1 -0
- package/dist/components/TimeBarChart/TimeBarChartTable.js +33 -0
- package/dist/components/TimeBarChart/TimeBarChartTable.js.map +1 -0
- package/dist/components/TimeBarChart/TimeBarChartTooltip.js +77 -0
- package/dist/components/TimeBarChart/TimeBarChartTooltip.js.map +1 -0
- package/dist/components/TimeBarChart/stackLayout.js +25 -0
- package/dist/components/TimeBarChart/stackLayout.js.map +1 -0
- package/dist/components/TimeBarChart/timeBuckets.js +133 -0
- package/dist/components/TimeBarChart/timeBuckets.js.map +1 -0
- package/dist/components/TimeBarChart/tones.js +10 -0
- package/dist/components/TimeBarChart/tones.js.map +1 -0
- package/dist/components/dateMath.js +1 -0
- package/dist/components/dateMath.js.map +1 -1
- package/dist/components/filterSearchModel.js +53 -45
- package/dist/components/filterSearchModel.js.map +1 -1
- package/dist/components/frameStyles.js +14 -0
- package/dist/components/frameStyles.js.map +1 -0
- package/dist/components/headerContent.js +10 -0
- package/dist/components/headerContent.js.map +1 -0
- package/dist/index.d.ts +123 -3
- package/dist/index.js +24 -22
- package/dist/index.js.map +1 -1
- package/dist/tailwind.css.js +1 -1
- package/dist/theme.js +340 -340
- package/dist/theme.js.map +1 -1
- package/package.json +1 -1
package/dist/theme.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const A = [
|
|
2
2
|
"hoverBackground",
|
|
3
3
|
"subtleHoverBackground",
|
|
4
4
|
"outsideForeground",
|
|
@@ -8,12 +8,12 @@ const E = [
|
|
|
8
8
|
"todayHoverBorder",
|
|
9
9
|
"rangeBackground",
|
|
10
10
|
"pressedOpacity"
|
|
11
|
-
],
|
|
11
|
+
], v = (r) => `--malachite-date-picker-${r.replace(/([A-Z])/g, "-$1").toLowerCase()}`, y = {
|
|
12
12
|
background: "rgba(0, 175, 102)",
|
|
13
13
|
foreground: "rgb(2, 122, 66)",
|
|
14
14
|
border: "rgba(0, 175, 102, 0.2)",
|
|
15
15
|
backgroundGlass: "rgba(0, 175, 102, 0.08)"
|
|
16
|
-
},
|
|
16
|
+
}, F = "0px 1px 0px 0px rgba(0, 175, 102, 0.15)", f = {
|
|
17
17
|
small: "28px",
|
|
18
18
|
medium: "32px",
|
|
19
19
|
large: "42px"
|
|
@@ -27,7 +27,7 @@ const E = [
|
|
|
27
27
|
xlarge: "18px",
|
|
28
28
|
xxlarge: "22px"
|
|
29
29
|
},
|
|
30
|
-
controlHeights: { ...
|
|
30
|
+
controlHeights: { ...f },
|
|
31
31
|
iconSizes: {
|
|
32
32
|
xsmall: "12px",
|
|
33
33
|
small: "13px",
|
|
@@ -52,7 +52,7 @@ const E = [
|
|
|
52
52
|
glow: "0px 0px 10px 0px rgba(0, 0, 0, 0.2)",
|
|
53
53
|
glowLg: "0px 0px 20px 0px rgba(0, 0, 0, 0.2)",
|
|
54
54
|
default: "0px 1px 0px 0px rgba(0, 0, 0, 0.15)",
|
|
55
|
-
accent:
|
|
55
|
+
accent: F,
|
|
56
56
|
success: "0px 1px 0px 0px rgba(0, 175, 102, 0.15)",
|
|
57
57
|
warning: "0px 1px 0px 0px rgba(241, 139, 10, 0.15)",
|
|
58
58
|
error: "0px 1px 0px 0px rgba(197, 63, 63, 0.15)"
|
|
@@ -121,7 +121,7 @@ const E = [
|
|
|
121
121
|
border: "rgb(232, 232, 232)",
|
|
122
122
|
borderHover: "rgb(186, 186, 186)"
|
|
123
123
|
},
|
|
124
|
-
accent:
|
|
124
|
+
accent: y,
|
|
125
125
|
control: {
|
|
126
126
|
borderHover: "rgba(0, 175, 102, 0.4)"
|
|
127
127
|
},
|
|
@@ -552,7 +552,7 @@ const E = [
|
|
|
552
552
|
// #4A3F7A, from the Chat.Suggestion mock
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
|
-
},
|
|
555
|
+
}, k = {
|
|
556
556
|
fontSizes: {
|
|
557
557
|
xsmall: "11px",
|
|
558
558
|
small: "13px",
|
|
@@ -562,7 +562,7 @@ const E = [
|
|
|
562
562
|
xlarge: "18px",
|
|
563
563
|
xxlarge: "22px"
|
|
564
564
|
},
|
|
565
|
-
controlHeights: { ...
|
|
565
|
+
controlHeights: { ...f },
|
|
566
566
|
iconSizes: {
|
|
567
567
|
xsmall: "12px",
|
|
568
568
|
small: "13px",
|
|
@@ -1093,10 +1093,10 @@ const E = [
|
|
|
1093
1093
|
surfaceForeground: "rgb(134, 120, 186)"
|
|
1094
1094
|
}
|
|
1095
1095
|
}
|
|
1096
|
-
},
|
|
1097
|
-
function
|
|
1096
|
+
}, O = "malachite-theme-mode", $ = "malachite-custom-theme", R = /^--[A-Za-z0-9_-]+$/, L = /[{};]|\/\*|\*\//, G = /^[A-Za-z0-9_-]+$/;
|
|
1097
|
+
function T(r, l) {
|
|
1098
1098
|
if (typeof r == "string") {
|
|
1099
|
-
if (
|
|
1099
|
+
if (L.test(r)) {
|
|
1100
1100
|
console.warn(
|
|
1101
1101
|
`Malachite: ignoring theme value at ${l} — CSS syntax characters ({ } ; /* */) are not allowed.`
|
|
1102
1102
|
);
|
|
@@ -1105,161 +1105,161 @@ function O(r, l) {
|
|
|
1105
1105
|
return r;
|
|
1106
1106
|
}
|
|
1107
1107
|
if (r === null || typeof r != "object") return r;
|
|
1108
|
-
const
|
|
1109
|
-
for (const [o,
|
|
1108
|
+
const a = {};
|
|
1109
|
+
for (const [o, n] of Object.entries(r)) {
|
|
1110
1110
|
const u = l ? `${l}.${o}` : o;
|
|
1111
|
-
if (!
|
|
1111
|
+
if (!G.test(o)) {
|
|
1112
1112
|
console.warn(
|
|
1113
1113
|
`Malachite: ignoring a theme key under ${l || "<root>"} — theme keys may contain only letters, digits, hyphens and underscores.`
|
|
1114
1114
|
);
|
|
1115
1115
|
continue;
|
|
1116
1116
|
}
|
|
1117
|
-
const
|
|
1118
|
-
|
|
1117
|
+
const b = T(n, u);
|
|
1118
|
+
b !== void 0 && (a[o] = b);
|
|
1119
1119
|
}
|
|
1120
|
-
return
|
|
1120
|
+
return a;
|
|
1121
1121
|
}
|
|
1122
|
-
const
|
|
1123
|
-
function
|
|
1122
|
+
const x = /* @__PURE__ */ new Set();
|
|
1123
|
+
function Y(r) {
|
|
1124
1124
|
try {
|
|
1125
|
-
if (
|
|
1125
|
+
if (x.has(r))
|
|
1126
1126
|
return;
|
|
1127
|
-
|
|
1127
|
+
x.add(r), D(r);
|
|
1128
1128
|
} catch (l) {
|
|
1129
1129
|
console.error("Error registering shadow root:", l);
|
|
1130
1130
|
}
|
|
1131
1131
|
}
|
|
1132
|
-
function
|
|
1132
|
+
function U(r) {
|
|
1133
1133
|
try {
|
|
1134
|
-
|
|
1134
|
+
x.delete(r);
|
|
1135
1135
|
} catch (l) {
|
|
1136
1136
|
console.error("Error unregistering shadow root:", l);
|
|
1137
1137
|
}
|
|
1138
1138
|
}
|
|
1139
|
-
const
|
|
1139
|
+
const _ = {
|
|
1140
1140
|
rowVariant: "row-variant",
|
|
1141
1141
|
boxShadow: "box-shadow"
|
|
1142
1142
|
};
|
|
1143
|
-
function
|
|
1144
|
-
Object.entries(r).forEach(([o,
|
|
1145
|
-
const u =
|
|
1146
|
-
typeof
|
|
1147
|
-
const
|
|
1148
|
-
typeof
|
|
1149
|
-
const
|
|
1150
|
-
|
|
1151
|
-
`${l}-${u}-${
|
|
1152
|
-
|
|
1143
|
+
function E(r, l, a) {
|
|
1144
|
+
Object.entries(r).forEach(([o, n]) => {
|
|
1145
|
+
const u = _[o] ?? o;
|
|
1146
|
+
typeof n == "object" && n !== null ? Object.entries(n).forEach(([b, t]) => {
|
|
1147
|
+
const d = b.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1148
|
+
typeof t == "object" && t !== null ? Object.entries(t).forEach(([g, s]) => {
|
|
1149
|
+
const c = g.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1150
|
+
a(
|
|
1151
|
+
`${l}-${u}-${d}-${c}`,
|
|
1152
|
+
s
|
|
1153
1153
|
);
|
|
1154
|
-
}) :
|
|
1155
|
-
}) :
|
|
1154
|
+
}) : a(`${l}-${u}-${d}`, t);
|
|
1155
|
+
}) : a(`${l}-${u}`, n);
|
|
1156
1156
|
});
|
|
1157
1157
|
}
|
|
1158
|
-
function p(r, l) {
|
|
1159
|
-
const
|
|
1158
|
+
function p(r, l, a = "light") {
|
|
1159
|
+
const o = r.colors.accent ?? y, n = r.colors.datePicker ?? {}, u = { ...r.shadows, accent: r.shadows.accent ?? F };
|
|
1160
1160
|
if (l instanceof ShadowRoot) {
|
|
1161
|
-
let
|
|
1162
|
-
|
|
1163
|
-
const
|
|
1161
|
+
let b = l.querySelector("#malachite-theme-vars");
|
|
1162
|
+
b || (b = document.createElement("style"), b.id = "malachite-theme-vars", l.appendChild(b));
|
|
1163
|
+
const t = [];
|
|
1164
1164
|
Object.entries(r.fontSizes).forEach(([s, c]) => {
|
|
1165
|
-
|
|
1165
|
+
t.push(`--malachite-font-size-${s}: ${c}`);
|
|
1166
1166
|
}), Object.entries(r.iconSizes).forEach(([s, c]) => {
|
|
1167
|
-
|
|
1167
|
+
t.push(`--malachite-icon-size-${s}: ${c}`);
|
|
1168
1168
|
}), Object.entries(r.radius).forEach(([s, c]) => {
|
|
1169
|
-
|
|
1170
|
-
}), Object.entries(r.controlHeights ??
|
|
1171
|
-
|
|
1172
|
-
}), Object.entries(
|
|
1173
|
-
const
|
|
1174
|
-
|
|
1175
|
-
}),
|
|
1176
|
-
const
|
|
1177
|
-
|
|
1169
|
+
t.push(`--malachite-radius-${s}: ${c}`);
|
|
1170
|
+
}), Object.entries(r.controlHeights ?? f).forEach(([s, c]) => {
|
|
1171
|
+
t.push(`--malachite-control-height-${s}: ${c}`);
|
|
1172
|
+
}), Object.entries(u).forEach(([s, c]) => {
|
|
1173
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1174
|
+
t.push(`--malachite-shadow-${i}: ${c}`);
|
|
1175
|
+
}), t.push(`--malachite-shadow-color: ${r.colors.shadowColor}`), t.push(`--malachite-shadow-opacity: ${r.colors.shadowOpacity}`), Object.entries(r.colors.card).forEach(([s, c]) => {
|
|
1176
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1177
|
+
t.push(`--malachite-card-${i}: ${c}`);
|
|
1178
1178
|
}), Object.entries(r.colors.overlay).forEach(([s, c]) => {
|
|
1179
|
-
const
|
|
1180
|
-
|
|
1179
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1180
|
+
t.push(`--malachite-overlay-${i}: ${c}`);
|
|
1181
1181
|
}), Object.entries(r.colors.alert).forEach(([s, c]) => {
|
|
1182
|
-
Object.entries(c).forEach(([
|
|
1183
|
-
const m =
|
|
1184
|
-
|
|
1182
|
+
Object.entries(c).forEach(([i, h]) => {
|
|
1183
|
+
const m = i.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1184
|
+
t.push(`--malachite-alert-${s}-${m}: ${h}`);
|
|
1185
1185
|
});
|
|
1186
1186
|
}), Object.entries(r.colors.tooltip).forEach(([s, c]) => {
|
|
1187
|
-
const
|
|
1188
|
-
|
|
1187
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1188
|
+
t.push(`--malachite-tooltip-${i}: ${c}`);
|
|
1189
1189
|
}), Object.entries(r.colors.buttonList).forEach(([s, c]) => {
|
|
1190
|
-
const
|
|
1191
|
-
|
|
1190
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1191
|
+
t.push(`--malachite-buttonlist-${i}: ${c}`);
|
|
1192
1192
|
}), Object.entries(r.colors.pillButton).forEach(([s, c]) => {
|
|
1193
|
-
const
|
|
1194
|
-
|
|
1193
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1194
|
+
t.push(`--malachite-pillbutton-${i}: ${c}`);
|
|
1195
1195
|
}), Object.entries(r.colors.toggle).forEach(([s, c]) => {
|
|
1196
|
-
const
|
|
1197
|
-
|
|
1196
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1197
|
+
t.push(`--malachite-toggle-${i}: ${c}`);
|
|
1198
1198
|
}), Object.entries(r.colors.segmentedControl).forEach(([s, c]) => {
|
|
1199
|
-
const
|
|
1200
|
-
|
|
1199
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1200
|
+
t.push(`--malachite-segmented-control-${i}: ${c}`);
|
|
1201
1201
|
}), Object.entries(r.colors.selectableCard).forEach(([s, c]) => {
|
|
1202
|
-
const
|
|
1203
|
-
|
|
1202
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1203
|
+
t.push(`--malachite-selectable-card-${i}: ${c}`);
|
|
1204
1204
|
}), Object.entries(r.colors.cardStrip).forEach(([s, c]) => {
|
|
1205
|
-
const
|
|
1206
|
-
|
|
1205
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1206
|
+
t.push(`--malachite-card-strip-${i}: ${c}`);
|
|
1207
1207
|
}), Object.entries(r.colors.selectionBar).forEach(([s, c]) => {
|
|
1208
|
-
const
|
|
1209
|
-
|
|
1208
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1209
|
+
t.push(`--malachite-selection-bar-${i}: ${c}`);
|
|
1210
1210
|
}), Object.entries(r.colors.inlineConfirm).forEach(([s, c]) => {
|
|
1211
|
-
const
|
|
1212
|
-
|
|
1211
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1212
|
+
t.push(`--malachite-inline-confirm-${i}: ${c}`);
|
|
1213
1213
|
}), Object.entries(r.colors.closeButton).forEach(([s, c]) => {
|
|
1214
|
-
const
|
|
1215
|
-
|
|
1214
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1215
|
+
t.push(`--malachite-close-button-${i}: ${c}`);
|
|
1216
1216
|
}), Object.entries(r.colors.dropdown).forEach(([s, c]) => {
|
|
1217
|
-
const
|
|
1218
|
-
|
|
1217
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1218
|
+
t.push(`--malachite-dropdown-${i}: ${c}`);
|
|
1219
1219
|
}), Object.entries(r.colors.control).forEach(([s, c]) => {
|
|
1220
|
-
const
|
|
1221
|
-
|
|
1222
|
-
}), Object.entries(t).forEach(([s, c]) => {
|
|
1223
|
-
const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1224
|
-
a.push(`--malachite-accent-${n}: ${c}`);
|
|
1220
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1221
|
+
t.push(`--malachite-control-${i}: ${c}`);
|
|
1225
1222
|
}), Object.entries(o).forEach(([s, c]) => {
|
|
1226
|
-
|
|
1223
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1224
|
+
t.push(`--malachite-accent-${i}: ${c}`);
|
|
1225
|
+
}), Object.entries(n).forEach(([s, c]) => {
|
|
1226
|
+
c && t.push(`${v(s)}: ${c}`);
|
|
1227
1227
|
}), Object.entries(r.colors.tag).forEach(([s, c]) => {
|
|
1228
|
-
Object.entries(c).forEach(([
|
|
1229
|
-
const m =
|
|
1230
|
-
|
|
1228
|
+
Object.entries(c).forEach(([i, h]) => {
|
|
1229
|
+
const m = i.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1230
|
+
t.push(`--malachite-tag-${s}-${m}: ${h}`);
|
|
1231
1231
|
});
|
|
1232
1232
|
}), Object.entries(r.colors.numberTag).forEach(([s, c]) => {
|
|
1233
|
-
const
|
|
1234
|
-
|
|
1235
|
-
}),
|
|
1233
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1234
|
+
t.push(`--malachite-number-tag-${i}: ${c}`);
|
|
1235
|
+
}), E(
|
|
1236
1236
|
r.colors.table,
|
|
1237
1237
|
"--malachite-table",
|
|
1238
|
-
(s, c) =>
|
|
1238
|
+
(s, c) => t.push(`${s}: ${c}`)
|
|
1239
1239
|
), Object.entries(r.colors.text).forEach(([s, c]) => {
|
|
1240
|
-
const
|
|
1241
|
-
typeof c == "object" && c !== null ? Object.entries(c).forEach(([
|
|
1242
|
-
const
|
|
1240
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1241
|
+
typeof c == "object" && c !== null ? Object.entries(c).forEach(([h, m]) => {
|
|
1242
|
+
const B = h.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1243
1243
|
typeof m == "object" && m !== null ? Object.entries(m).forEach(
|
|
1244
|
-
([
|
|
1245
|
-
const
|
|
1246
|
-
|
|
1247
|
-
`--malachite-text-${
|
|
1244
|
+
([z, Z]) => {
|
|
1245
|
+
const M = z.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1246
|
+
t.push(
|
|
1247
|
+
`--malachite-text-${i}-${B}-${M}: ${Z}`
|
|
1248
1248
|
);
|
|
1249
1249
|
}
|
|
1250
|
-
) :
|
|
1251
|
-
`--malachite-text-${
|
|
1250
|
+
) : t.push(
|
|
1251
|
+
`--malachite-text-${i}-${B}: ${m}`
|
|
1252
1252
|
);
|
|
1253
|
-
}) :
|
|
1253
|
+
}) : t.push(`--malachite-text-${i}: ${c}`);
|
|
1254
1254
|
}), Object.entries(r.colors.codeBlock).forEach(([s, c]) => {
|
|
1255
|
-
const
|
|
1256
|
-
|
|
1255
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1256
|
+
t.push(`--malachite-codeblock-${i}: ${c}`);
|
|
1257
1257
|
}), Object.entries(r.colors.chat).forEach(([s, c]) => {
|
|
1258
|
-
const
|
|
1259
|
-
|
|
1258
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1259
|
+
t.push(`--malachite-chat-${i}: ${c}`);
|
|
1260
1260
|
}), Object.entries(r.colors.assistant).forEach(([s, c]) => {
|
|
1261
|
-
const
|
|
1262
|
-
|
|
1261
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1262
|
+
t.push(`--malachite-assistant-${i}: ${c}`);
|
|
1263
1263
|
}), [
|
|
1264
1264
|
"primary",
|
|
1265
1265
|
"secondary",
|
|
@@ -1270,122 +1270,122 @@ function p(r, l) {
|
|
|
1270
1270
|
"error"
|
|
1271
1271
|
].forEach((s) => {
|
|
1272
1272
|
const c = r.colors[s];
|
|
1273
|
-
Object.entries(c).forEach(([
|
|
1274
|
-
const m =
|
|
1275
|
-
|
|
1273
|
+
Object.entries(c).forEach(([i, h]) => {
|
|
1274
|
+
const m = i.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1275
|
+
t.push(`--malachite-${s}-${m}: ${h}`);
|
|
1276
1276
|
});
|
|
1277
1277
|
});
|
|
1278
|
-
const
|
|
1279
|
-
if (!
|
|
1280
|
-
const c = s.split(":", 1)[0].trim(),
|
|
1281
|
-
return console.warn(`Malachite: dropped an unsafe theme declaration for ${
|
|
1278
|
+
const g = t.filter((s) => {
|
|
1279
|
+
if (!L.test(s)) return !0;
|
|
1280
|
+
const c = s.split(":", 1)[0].trim(), i = R.test(c) ? c : "an unnamed token";
|
|
1281
|
+
return console.warn(`Malachite: dropped an unsafe theme declaration for ${i}`), !1;
|
|
1282
1282
|
});
|
|
1283
|
-
|
|
1284
|
-
} else l instanceof HTMLElement && (Object.entries(r.fontSizes).forEach(([
|
|
1285
|
-
l.style.setProperty(`--malachite-font-size-${
|
|
1286
|
-
}), Object.entries(r.iconSizes).forEach(([
|
|
1287
|
-
l.style.setProperty(`--malachite-icon-size-${
|
|
1288
|
-
}), Object.entries(r.radius).forEach(([
|
|
1289
|
-
l.style.setProperty(`--malachite-radius-${
|
|
1290
|
-
}), Object.entries(r.controlHeights ??
|
|
1291
|
-
l.style.setProperty(`--malachite-control-height-${
|
|
1292
|
-
}), Object.entries(
|
|
1293
|
-
const
|
|
1294
|
-
l.style.setProperty(`--malachite-shadow-${
|
|
1283
|
+
b.textContent = `:host { color-scheme: ${a}; ${g.join("; ")} }`;
|
|
1284
|
+
} else l instanceof HTMLElement && (Object.entries(r.fontSizes).forEach(([t, d]) => {
|
|
1285
|
+
l.style.setProperty(`--malachite-font-size-${t}`, d);
|
|
1286
|
+
}), Object.entries(r.iconSizes).forEach(([t, d]) => {
|
|
1287
|
+
l.style.setProperty(`--malachite-icon-size-${t}`, d);
|
|
1288
|
+
}), Object.entries(r.radius).forEach(([t, d]) => {
|
|
1289
|
+
l.style.setProperty(`--malachite-radius-${t}`, d);
|
|
1290
|
+
}), Object.entries(r.controlHeights ?? f).forEach(([t, d]) => {
|
|
1291
|
+
l.style.setProperty(`--malachite-control-height-${t}`, d);
|
|
1292
|
+
}), Object.entries(u).forEach(([t, d]) => {
|
|
1293
|
+
const g = t.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1294
|
+
l.style.setProperty(`--malachite-shadow-${g}`, d);
|
|
1295
1295
|
}), l.style.setProperty("--malachite-shadow-color", r.colors.shadowColor), l.style.setProperty(
|
|
1296
1296
|
"--malachite-shadow-opacity",
|
|
1297
1297
|
r.colors.shadowOpacity.toString()
|
|
1298
|
-
), Object.entries(r.colors.card).forEach(([
|
|
1299
|
-
const
|
|
1300
|
-
l.style.setProperty(`--malachite-card-${
|
|
1301
|
-
}), Object.entries(r.colors.overlay).forEach(([
|
|
1302
|
-
const
|
|
1303
|
-
l.style.setProperty(`--malachite-overlay-${
|
|
1304
|
-
}), Object.entries(r.colors.alert).forEach(([
|
|
1305
|
-
Object.entries(d).forEach(([
|
|
1306
|
-
const c =
|
|
1307
|
-
l.style.setProperty(`--malachite-alert-${
|
|
1298
|
+
), Object.entries(r.colors.card).forEach(([t, d]) => {
|
|
1299
|
+
const g = t.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1300
|
+
l.style.setProperty(`--malachite-card-${g}`, d);
|
|
1301
|
+
}), Object.entries(r.colors.overlay).forEach(([t, d]) => {
|
|
1302
|
+
const g = t.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1303
|
+
l.style.setProperty(`--malachite-overlay-${g}`, d);
|
|
1304
|
+
}), Object.entries(r.colors.alert).forEach(([t, d]) => {
|
|
1305
|
+
Object.entries(d).forEach(([g, s]) => {
|
|
1306
|
+
const c = g.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1307
|
+
l.style.setProperty(`--malachite-alert-${t}-${c}`, s);
|
|
1308
1308
|
});
|
|
1309
|
-
}), Object.entries(r.colors.tooltip).forEach(([
|
|
1310
|
-
const
|
|
1311
|
-
l.style.setProperty(`--malachite-tooltip-${
|
|
1312
|
-
}), Object.entries(r.colors.buttonList).forEach(([
|
|
1313
|
-
const
|
|
1314
|
-
l.style.setProperty(`--malachite-buttonlist-${
|
|
1315
|
-
}), Object.entries(r.colors.pillButton).forEach(([
|
|
1316
|
-
const
|
|
1317
|
-
l.style.setProperty(`--malachite-pillbutton-${
|
|
1318
|
-
}), Object.entries(r.colors.toggle).forEach(([
|
|
1319
|
-
const
|
|
1320
|
-
l.style.setProperty(`--malachite-toggle-${
|
|
1321
|
-
}), Object.entries(r.colors.segmentedControl).forEach(([
|
|
1322
|
-
const
|
|
1323
|
-
l.style.setProperty(`--malachite-segmented-control-${
|
|
1324
|
-
}), Object.entries(r.colors.selectableCard).forEach(([
|
|
1325
|
-
const
|
|
1326
|
-
l.style.setProperty(`--malachite-selectable-card-${
|
|
1327
|
-
}), Object.entries(r.colors.cardStrip).forEach(([
|
|
1328
|
-
const
|
|
1329
|
-
l.style.setProperty(`--malachite-card-strip-${
|
|
1330
|
-
}), Object.entries(r.colors.selectionBar).forEach(([
|
|
1331
|
-
const
|
|
1332
|
-
l.style.setProperty(`--malachite-selection-bar-${
|
|
1333
|
-
}), Object.entries(r.colors.inlineConfirm).forEach(([
|
|
1334
|
-
const
|
|
1335
|
-
l.style.setProperty(`--malachite-inline-confirm-${
|
|
1336
|
-
}), Object.entries(r.colors.closeButton).forEach(([
|
|
1337
|
-
const
|
|
1338
|
-
l.style.setProperty(`--malachite-close-button-${
|
|
1339
|
-
}), Object.entries(r.colors.dropdown).forEach(([
|
|
1340
|
-
const
|
|
1341
|
-
l.style.setProperty(`--malachite-dropdown-${
|
|
1342
|
-
}), Object.entries(r.colors.control).forEach(([
|
|
1343
|
-
const
|
|
1344
|
-
l.style.setProperty(`--malachite-control-${
|
|
1345
|
-
}), Object.entries(
|
|
1346
|
-
const
|
|
1347
|
-
l.style.setProperty(`--malachite-accent-${
|
|
1348
|
-
}),
|
|
1349
|
-
const d =
|
|
1350
|
-
d ? l.style.setProperty(
|
|
1351
|
-
}), Object.entries(r.colors.tag).forEach(([
|
|
1352
|
-
Object.entries(d).forEach(([
|
|
1353
|
-
const c =
|
|
1354
|
-
l.style.setProperty(`--malachite-tag-${
|
|
1309
|
+
}), Object.entries(r.colors.tooltip).forEach(([t, d]) => {
|
|
1310
|
+
const g = t.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1311
|
+
l.style.setProperty(`--malachite-tooltip-${g}`, d);
|
|
1312
|
+
}), Object.entries(r.colors.buttonList).forEach(([t, d]) => {
|
|
1313
|
+
const g = t.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1314
|
+
l.style.setProperty(`--malachite-buttonlist-${g}`, d);
|
|
1315
|
+
}), Object.entries(r.colors.pillButton).forEach(([t, d]) => {
|
|
1316
|
+
const g = t.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1317
|
+
l.style.setProperty(`--malachite-pillbutton-${g}`, d);
|
|
1318
|
+
}), Object.entries(r.colors.toggle).forEach(([t, d]) => {
|
|
1319
|
+
const g = t.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1320
|
+
l.style.setProperty(`--malachite-toggle-${g}`, d);
|
|
1321
|
+
}), Object.entries(r.colors.segmentedControl).forEach(([t, d]) => {
|
|
1322
|
+
const g = t.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1323
|
+
l.style.setProperty(`--malachite-segmented-control-${g}`, d);
|
|
1324
|
+
}), Object.entries(r.colors.selectableCard).forEach(([t, d]) => {
|
|
1325
|
+
const g = t.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1326
|
+
l.style.setProperty(`--malachite-selectable-card-${g}`, d);
|
|
1327
|
+
}), Object.entries(r.colors.cardStrip).forEach(([t, d]) => {
|
|
1328
|
+
const g = t.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1329
|
+
l.style.setProperty(`--malachite-card-strip-${g}`, d);
|
|
1330
|
+
}), Object.entries(r.colors.selectionBar).forEach(([t, d]) => {
|
|
1331
|
+
const g = t.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1332
|
+
l.style.setProperty(`--malachite-selection-bar-${g}`, d);
|
|
1333
|
+
}), Object.entries(r.colors.inlineConfirm).forEach(([t, d]) => {
|
|
1334
|
+
const g = t.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1335
|
+
l.style.setProperty(`--malachite-inline-confirm-${g}`, d);
|
|
1336
|
+
}), Object.entries(r.colors.closeButton).forEach(([t, d]) => {
|
|
1337
|
+
const g = t.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1338
|
+
l.style.setProperty(`--malachite-close-button-${g}`, d);
|
|
1339
|
+
}), Object.entries(r.colors.dropdown).forEach(([t, d]) => {
|
|
1340
|
+
const g = t.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1341
|
+
l.style.setProperty(`--malachite-dropdown-${g}`, d);
|
|
1342
|
+
}), Object.entries(r.colors.control).forEach(([t, d]) => {
|
|
1343
|
+
const g = t.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1344
|
+
l.style.setProperty(`--malachite-control-${g}`, d);
|
|
1345
|
+
}), Object.entries(o).forEach(([t, d]) => {
|
|
1346
|
+
const g = t.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1347
|
+
l.style.setProperty(`--malachite-accent-${g}`, d);
|
|
1348
|
+
}), A.forEach((t) => {
|
|
1349
|
+
const d = n[t];
|
|
1350
|
+
d ? l.style.setProperty(v(t), d) : l.style.removeProperty(v(t));
|
|
1351
|
+
}), Object.entries(r.colors.tag).forEach(([t, d]) => {
|
|
1352
|
+
Object.entries(d).forEach(([g, s]) => {
|
|
1353
|
+
const c = g.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1354
|
+
l.style.setProperty(`--malachite-tag-${t}-${c}`, s);
|
|
1355
1355
|
});
|
|
1356
|
-
}), Object.entries(r.colors.numberTag).forEach(([
|
|
1357
|
-
const
|
|
1358
|
-
l.style.setProperty(`--malachite-number-tag-${
|
|
1359
|
-
}),
|
|
1356
|
+
}), Object.entries(r.colors.numberTag).forEach(([t, d]) => {
|
|
1357
|
+
const g = t.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1358
|
+
l.style.setProperty(`--malachite-number-tag-${g}`, d);
|
|
1359
|
+
}), E(
|
|
1360
1360
|
r.colors.table,
|
|
1361
1361
|
"--malachite-table",
|
|
1362
|
-
(
|
|
1363
|
-
), Object.entries(r.colors.text).forEach(([
|
|
1364
|
-
const
|
|
1362
|
+
(t, d) => l.style.setProperty(t, d)
|
|
1363
|
+
), Object.entries(r.colors.text).forEach(([t, d]) => {
|
|
1364
|
+
const g = t.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1365
1365
|
typeof d == "object" && d !== null ? Object.entries(d).forEach(([s, c]) => {
|
|
1366
|
-
const
|
|
1366
|
+
const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1367
1367
|
typeof c == "object" && c !== null ? Object.entries(c).forEach(
|
|
1368
|
-
([
|
|
1369
|
-
const
|
|
1368
|
+
([h, m]) => {
|
|
1369
|
+
const B = h.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1370
1370
|
l.style.setProperty(
|
|
1371
|
-
`--malachite-text-${
|
|
1371
|
+
`--malachite-text-${g}-${i}-${B}`,
|
|
1372
1372
|
m
|
|
1373
1373
|
);
|
|
1374
1374
|
}
|
|
1375
1375
|
) : l.style.setProperty(
|
|
1376
|
-
`--malachite-text-${
|
|
1376
|
+
`--malachite-text-${g}-${i}`,
|
|
1377
1377
|
c
|
|
1378
1378
|
);
|
|
1379
|
-
}) : l.style.setProperty(`--malachite-text-${
|
|
1380
|
-
}), Object.entries(r.colors.codeBlock).forEach(([
|
|
1381
|
-
const
|
|
1382
|
-
l.style.setProperty(`--malachite-codeblock-${
|
|
1383
|
-
}), Object.entries(r.colors.chat).forEach(([
|
|
1384
|
-
const
|
|
1385
|
-
l.style.setProperty(`--malachite-chat-${
|
|
1386
|
-
}), Object.entries(r.colors.assistant).forEach(([
|
|
1387
|
-
const
|
|
1388
|
-
l.style.setProperty(`--malachite-assistant-${
|
|
1379
|
+
}) : l.style.setProperty(`--malachite-text-${g}`, d);
|
|
1380
|
+
}), Object.entries(r.colors.codeBlock).forEach(([t, d]) => {
|
|
1381
|
+
const g = t.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1382
|
+
l.style.setProperty(`--malachite-codeblock-${g}`, d);
|
|
1383
|
+
}), Object.entries(r.colors.chat).forEach(([t, d]) => {
|
|
1384
|
+
const g = t.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1385
|
+
l.style.setProperty(`--malachite-chat-${g}`, d);
|
|
1386
|
+
}), Object.entries(r.colors.assistant).forEach(([t, d]) => {
|
|
1387
|
+
const g = t.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1388
|
+
l.style.setProperty(`--malachite-assistant-${g}`, d);
|
|
1389
1389
|
}), [
|
|
1390
1390
|
"primary",
|
|
1391
1391
|
"secondary",
|
|
@@ -1394,173 +1394,173 @@ function p(r, l) {
|
|
|
1394
1394
|
"success",
|
|
1395
1395
|
"warning",
|
|
1396
1396
|
"error"
|
|
1397
|
-
].forEach((
|
|
1398
|
-
const d = r.colors[
|
|
1399
|
-
Object.entries(d).forEach(([
|
|
1400
|
-
const c =
|
|
1401
|
-
l.style.setProperty(`--malachite-${
|
|
1397
|
+
].forEach((t) => {
|
|
1398
|
+
const d = r.colors[t];
|
|
1399
|
+
Object.entries(d).forEach(([g, s]) => {
|
|
1400
|
+
const c = g.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1401
|
+
l.style.setProperty(`--malachite-${t}-${c}`, s);
|
|
1402
1402
|
});
|
|
1403
1403
|
}));
|
|
1404
1404
|
}
|
|
1405
|
-
function
|
|
1405
|
+
function D(r) {
|
|
1406
1406
|
try {
|
|
1407
|
-
const l =
|
|
1408
|
-
p(
|
|
1407
|
+
const l = P(), a = V(), o = l === "dark" ? k : e, n = a ? w(o, a) : o;
|
|
1408
|
+
p(n, r, l);
|
|
1409
1409
|
} catch (l) {
|
|
1410
1410
|
console.error("Error applying theme to shadow root:", l);
|
|
1411
1411
|
}
|
|
1412
1412
|
}
|
|
1413
|
-
function x() {
|
|
1414
|
-
return typeof window > "u" ? "light" : localStorage.getItem(S) || "light";
|
|
1415
|
-
}
|
|
1416
1413
|
function P() {
|
|
1414
|
+
return typeof window > "u" ? "light" : localStorage.getItem(O) || "light";
|
|
1415
|
+
}
|
|
1416
|
+
function V() {
|
|
1417
1417
|
if (typeof window > "u") return null;
|
|
1418
|
-
const r = localStorage.getItem(
|
|
1418
|
+
const r = localStorage.getItem($);
|
|
1419
1419
|
if (!r) return null;
|
|
1420
1420
|
try {
|
|
1421
1421
|
return JSON.parse(r);
|
|
1422
1422
|
} catch {
|
|
1423
|
-
return localStorage.removeItem(
|
|
1423
|
+
return localStorage.removeItem($), null;
|
|
1424
1424
|
}
|
|
1425
1425
|
}
|
|
1426
|
-
function
|
|
1427
|
-
typeof window < "u" && localStorage.setItem(
|
|
1426
|
+
function j(r) {
|
|
1427
|
+
typeof window < "u" && localStorage.setItem(O, r);
|
|
1428
1428
|
}
|
|
1429
|
-
function
|
|
1430
|
-
typeof window < "u" && localStorage.setItem(
|
|
1429
|
+
function N(r) {
|
|
1430
|
+
typeof window < "u" && localStorage.setItem($, JSON.stringify(r));
|
|
1431
1431
|
}
|
|
1432
|
-
function
|
|
1433
|
-
const
|
|
1434
|
-
if (
|
|
1435
|
-
...o.controlHeights ??
|
|
1436
|
-
...
|
|
1437
|
-
}),
|
|
1438
|
-
if (o.colors = { ...o.colors },
|
|
1432
|
+
function w(r, l) {
|
|
1433
|
+
const a = T(l, ""), o = { ...r };
|
|
1434
|
+
if (a.fontSizes && (o.fontSizes = { ...o.fontSizes, ...a.fontSizes }), a.iconSizes && (o.iconSizes = { ...o.iconSizes, ...a.iconSizes }), a.radius && (o.radius = { ...o.radius, ...a.radius }), a.controlHeights && (o.controlHeights = {
|
|
1435
|
+
...o.controlHeights ?? f,
|
|
1436
|
+
...a.controlHeights
|
|
1437
|
+
}), a.shadows && (o.shadows = { ...o.shadows, ...a.shadows }), a.colors) {
|
|
1438
|
+
if (o.colors = { ...o.colors }, a.colors.shadowColor !== void 0 && (o.colors.shadowColor = a.colors.shadowColor), a.colors.shadowOpacity !== void 0 && (o.colors.shadowOpacity = a.colors.shadowOpacity), a.colors.card && (o.colors.card = { ...o.colors.card, ...a.colors.card }), a.colors.overlay && (o.colors.overlay = { ...o.colors.overlay, ...a.colors.overlay }), a.colors.alert) {
|
|
1439
1439
|
o.colors.alert = { ...o.colors.alert };
|
|
1440
|
-
for (const
|
|
1441
|
-
|
|
1440
|
+
for (const n of Object.keys(
|
|
1441
|
+
a.colors.alert
|
|
1442
1442
|
)) {
|
|
1443
|
-
const u =
|
|
1444
|
-
u && (o.colors.alert[
|
|
1443
|
+
const u = a.colors.alert[n];
|
|
1444
|
+
u && (o.colors.alert[n] = { ...o.colors.alert[n], ...u });
|
|
1445
1445
|
}
|
|
1446
1446
|
}
|
|
1447
|
-
if (
|
|
1448
|
-
...o.colors.accent ??
|
|
1449
|
-
...
|
|
1450
|
-
}),
|
|
1447
|
+
if (a.colors.tooltip && (o.colors.tooltip = { ...o.colors.tooltip, ...a.colors.tooltip }), a.colors.primary && (o.colors.primary = { ...o.colors.primary, ...a.colors.primary }), a.colors.accent && (o.colors.accent = {
|
|
1448
|
+
...o.colors.accent ?? y,
|
|
1449
|
+
...a.colors.accent
|
|
1450
|
+
}), a.colors.datePicker && (o.colors.datePicker = {
|
|
1451
1451
|
...o.colors.datePicker,
|
|
1452
|
-
...
|
|
1453
|
-
}),
|
|
1452
|
+
...a.colors.datePicker
|
|
1453
|
+
}), a.colors.control && (o.colors.control = { ...o.colors.control, ...a.colors.control }), a.colors.outline && (o.colors.outline = { ...o.colors.outline, ...a.colors.outline }), a.colors.secondary && (o.colors.secondary = { ...o.colors.secondary, ...a.colors.secondary }), a.colors.destructive && (o.colors.destructive = {
|
|
1454
1454
|
...o.colors.destructive,
|
|
1455
|
-
...
|
|
1456
|
-
}),
|
|
1455
|
+
...a.colors.destructive
|
|
1456
|
+
}), a.colors.success && (o.colors.success = { ...o.colors.success, ...a.colors.success }), a.colors.warning && (o.colors.warning = { ...o.colors.warning, ...a.colors.warning }), a.colors.error && (o.colors.error = { ...o.colors.error, ...a.colors.error }), a.colors.buttonList && (o.colors.buttonList = { ...o.colors.buttonList, ...a.colors.buttonList }), a.colors.pillButton && (o.colors.pillButton = { ...o.colors.pillButton, ...a.colors.pillButton }), a.colors.toggle && (o.colors.toggle = { ...o.colors.toggle, ...a.colors.toggle }), a.colors.segmentedControl && (o.colors.segmentedControl = {
|
|
1457
1457
|
...o.colors.segmentedControl,
|
|
1458
|
-
...
|
|
1459
|
-
}),
|
|
1458
|
+
...a.colors.segmentedControl
|
|
1459
|
+
}), a.colors.selectableCard && (o.colors.selectableCard = {
|
|
1460
1460
|
...o.colors.selectableCard,
|
|
1461
|
-
...
|
|
1462
|
-
}),
|
|
1461
|
+
...a.colors.selectableCard
|
|
1462
|
+
}), a.colors.cardStrip && (o.colors.cardStrip = { ...o.colors.cardStrip, ...a.colors.cardStrip }), a.colors.selectionBar && (o.colors.selectionBar = {
|
|
1463
1463
|
...o.colors.selectionBar,
|
|
1464
|
-
...
|
|
1465
|
-
}),
|
|
1464
|
+
...a.colors.selectionBar
|
|
1465
|
+
}), a.colors.inlineConfirm && (o.colors.inlineConfirm = {
|
|
1466
1466
|
...o.colors.inlineConfirm,
|
|
1467
|
-
...
|
|
1468
|
-
}),
|
|
1467
|
+
...a.colors.inlineConfirm
|
|
1468
|
+
}), a.colors.closeButton && (o.colors.closeButton = {
|
|
1469
1469
|
...o.colors.closeButton,
|
|
1470
|
-
...
|
|
1471
|
-
}),
|
|
1470
|
+
...a.colors.closeButton
|
|
1471
|
+
}), a.colors.dropdown && (o.colors.dropdown = { ...o.colors.dropdown, ...a.colors.dropdown }), a.colors.tag) {
|
|
1472
1472
|
o.colors.tag = { ...o.colors.tag };
|
|
1473
|
-
for (const
|
|
1474
|
-
|
|
1473
|
+
for (const n of Object.keys(
|
|
1474
|
+
a.colors.tag
|
|
1475
1475
|
)) {
|
|
1476
|
-
const u =
|
|
1477
|
-
u && (o.colors.tag[
|
|
1476
|
+
const u = a.colors.tag[n];
|
|
1477
|
+
u && (o.colors.tag[n] = { ...o.colors.tag[n], ...u });
|
|
1478
1478
|
}
|
|
1479
1479
|
}
|
|
1480
|
-
if (
|
|
1481
|
-
const { rightSideText:
|
|
1482
|
-
o.colors.text = { ...o.colors.text, ...u },
|
|
1480
|
+
if (a.colors.numberTag && (o.colors.numberTag = { ...o.colors.numberTag, ...a.colors.numberTag }), a.colors.text) {
|
|
1481
|
+
const { rightSideText: n, ...u } = a.colors.text;
|
|
1482
|
+
o.colors.text = { ...o.colors.text, ...u }, n && (o.colors.text.rightSideText = {
|
|
1483
1483
|
...o.colors.text.rightSideText,
|
|
1484
|
-
...
|
|
1484
|
+
...n
|
|
1485
1485
|
});
|
|
1486
1486
|
}
|
|
1487
|
-
if (
|
|
1488
|
-
const { header:
|
|
1489
|
-
if (o.colors.table = { ...o.colors.table, ...
|
|
1487
|
+
if (a.colors.codeBlock && (o.colors.codeBlock = { ...o.colors.codeBlock, ...a.colors.codeBlock }), a.colors.chat && (o.colors.chat = { ...o.colors.chat, ...a.colors.chat }), a.colors.assistant && (o.colors.assistant = { ...o.colors.assistant, ...a.colors.assistant }), a.colors.table) {
|
|
1488
|
+
const { header: n, row: u, borderedRow: b, rowVariant: t, error: d, ...g } = a.colors.table;
|
|
1489
|
+
if (o.colors.table = { ...o.colors.table, ...g }, n && (o.colors.table.header = { ...o.colors.table.header, ...n }), u && (o.colors.table.row = { ...o.colors.table.row, ...u }), b && (o.colors.table.borderedRow = {
|
|
1490
1490
|
...o.colors.table.borderedRow,
|
|
1491
|
-
...
|
|
1492
|
-
}),
|
|
1493
|
-
const
|
|
1494
|
-
for (const
|
|
1495
|
-
const
|
|
1496
|
-
|
|
1491
|
+
...b
|
|
1492
|
+
}), d && (o.colors.table.error = { ...o.colors.table.error, ...d }), t) {
|
|
1493
|
+
const s = { ...o.colors.table.rowVariant };
|
|
1494
|
+
for (const c of Object.keys(t)) {
|
|
1495
|
+
const i = t[c];
|
|
1496
|
+
i && (s[c] = { ...s[c], ...i });
|
|
1497
1497
|
}
|
|
1498
|
-
o.colors.table.rowVariant =
|
|
1498
|
+
o.colors.table.rowVariant = s;
|
|
1499
1499
|
}
|
|
1500
1500
|
}
|
|
1501
1501
|
}
|
|
1502
1502
|
return o;
|
|
1503
1503
|
}
|
|
1504
|
-
function
|
|
1505
|
-
|
|
1506
|
-
const l =
|
|
1507
|
-
p(o, document.documentElement),
|
|
1508
|
-
p(o,
|
|
1509
|
-
}), l
|
|
1504
|
+
function I(r) {
|
|
1505
|
+
N(r);
|
|
1506
|
+
const l = P(), o = w(l === "dark" ? k : e, r);
|
|
1507
|
+
p(o, document.documentElement), x.forEach((n) => {
|
|
1508
|
+
p(o, n, l);
|
|
1509
|
+
}), C(l);
|
|
1510
1510
|
}
|
|
1511
|
-
function
|
|
1512
|
-
const
|
|
1513
|
-
p(
|
|
1511
|
+
function J(r, l) {
|
|
1512
|
+
const a = l === "dark" ? k : e, o = V(), n = o ? w(a, o) : a;
|
|
1513
|
+
p(n, r, l);
|
|
1514
1514
|
}
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1515
|
+
const C = (r) => {
|
|
1516
|
+
r === "dark" ? document.documentElement.setAttribute("data-theme", "dark") : document.documentElement.removeAttribute("data-theme");
|
|
1517
|
+
};
|
|
1518
|
+
function H() {
|
|
1519
|
+
j("light"), C("light");
|
|
1520
|
+
const r = V(), l = r ? w(e, r) : e;
|
|
1521
|
+
p(l, document.documentElement), x.forEach((a) => {
|
|
1522
|
+
p(l, a, "light");
|
|
1520
1523
|
});
|
|
1521
1524
|
}
|
|
1522
|
-
function
|
|
1523
|
-
|
|
1524
|
-
const r =
|
|
1525
|
-
p(l, document.documentElement),
|
|
1526
|
-
p(l,
|
|
1525
|
+
function K() {
|
|
1526
|
+
j("dark"), C("dark");
|
|
1527
|
+
const r = V(), l = r ? w(k, r) : k;
|
|
1528
|
+
p(l, document.documentElement), x.forEach((a) => {
|
|
1529
|
+
p(l, a, "dark");
|
|
1527
1530
|
});
|
|
1528
1531
|
}
|
|
1529
|
-
function
|
|
1530
|
-
return
|
|
1532
|
+
function q() {
|
|
1533
|
+
return P() === "dark" ? (H(), "light") : (K(), "dark");
|
|
1531
1534
|
}
|
|
1532
|
-
function
|
|
1533
|
-
|
|
1535
|
+
function X(r) {
|
|
1536
|
+
I(r);
|
|
1534
1537
|
}
|
|
1535
|
-
function
|
|
1536
|
-
const r =
|
|
1537
|
-
localStorage.removeItem(
|
|
1538
|
+
function Q() {
|
|
1539
|
+
const r = P();
|
|
1540
|
+
localStorage.removeItem($), r === "dark" ? K() : H();
|
|
1538
1541
|
}
|
|
1539
|
-
function
|
|
1542
|
+
function W() {
|
|
1540
1543
|
if (typeof window < "u") {
|
|
1541
|
-
const r =
|
|
1542
|
-
if (r === "dark")
|
|
1544
|
+
const r = P(), l = V();
|
|
1545
|
+
if (r === "dark")
|
|
1543
1546
|
if (l) {
|
|
1544
|
-
const
|
|
1545
|
-
p(
|
|
1547
|
+
const a = w(k, l);
|
|
1548
|
+
p(a, document.documentElement);
|
|
1546
1549
|
} else
|
|
1547
|
-
p(
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
p(e, document.documentElement);
|
|
1555
|
-
document.documentElement.removeAttribute("data-theme");
|
|
1556
|
-
}
|
|
1550
|
+
p(k, document.documentElement);
|
|
1551
|
+
else if (l) {
|
|
1552
|
+
const a = w(e, l);
|
|
1553
|
+
p(a, document.documentElement);
|
|
1554
|
+
} else
|
|
1555
|
+
p(e, document.documentElement);
|
|
1556
|
+
C(r);
|
|
1557
1557
|
}
|
|
1558
1558
|
}
|
|
1559
|
-
function
|
|
1559
|
+
function rr() {
|
|
1560
1560
|
const r = getComputedStyle(document.documentElement), l = {};
|
|
1561
|
-
for (const
|
|
1562
|
-
const o = r.getPropertyValue(
|
|
1563
|
-
o && (l[
|
|
1561
|
+
for (const a of A) {
|
|
1562
|
+
const o = r.getPropertyValue(v(a)).trim();
|
|
1563
|
+
o && (l[a] = o);
|
|
1564
1564
|
}
|
|
1565
1565
|
return {
|
|
1566
1566
|
fontSizes: {
|
|
@@ -1579,9 +1579,9 @@ function X() {
|
|
|
1579
1579
|
large: r.getPropertyValue("--malachite-icon-size-large").trim() || e.iconSizes.large
|
|
1580
1580
|
},
|
|
1581
1581
|
controlHeights: {
|
|
1582
|
-
small: r.getPropertyValue("--malachite-control-height-small").trim() ||
|
|
1583
|
-
medium: r.getPropertyValue("--malachite-control-height-medium").trim() ||
|
|
1584
|
-
large: r.getPropertyValue("--malachite-control-height-large").trim() ||
|
|
1582
|
+
small: r.getPropertyValue("--malachite-control-height-small").trim() || f.small,
|
|
1583
|
+
medium: r.getPropertyValue("--malachite-control-height-medium").trim() || f.medium,
|
|
1584
|
+
large: r.getPropertyValue("--malachite-control-height-large").trim() || f.large
|
|
1585
1585
|
},
|
|
1586
1586
|
radius: {
|
|
1587
1587
|
xs: r.getPropertyValue("--malachite-radius-xs").trim() || e.radius.xs,
|
|
@@ -1601,7 +1601,7 @@ function X() {
|
|
|
1601
1601
|
glow: r.getPropertyValue("--malachite-shadow-glow").trim() || e.shadows.glow,
|
|
1602
1602
|
glowLg: r.getPropertyValue("--malachite-shadow-glow-lg").trim() || e.shadows.glowLg,
|
|
1603
1603
|
default: r.getPropertyValue("--malachite-shadow-default").trim() || e.shadows.default,
|
|
1604
|
-
accent: r.getPropertyValue("--malachite-shadow-accent").trim() ||
|
|
1604
|
+
accent: r.getPropertyValue("--malachite-shadow-accent").trim() || F,
|
|
1605
1605
|
success: r.getPropertyValue("--malachite-shadow-success").trim() || e.shadows.success,
|
|
1606
1606
|
warning: r.getPropertyValue("--malachite-shadow-warning").trim() || e.shadows.warning,
|
|
1607
1607
|
error: r.getPropertyValue("--malachite-shadow-error").trim() || e.shadows.error
|
|
@@ -1664,10 +1664,10 @@ function X() {
|
|
|
1664
1664
|
borderHover: r.getPropertyValue("--malachite-primary-border-hover").trim() || e.colors.primary.borderHover
|
|
1665
1665
|
},
|
|
1666
1666
|
accent: {
|
|
1667
|
-
background: r.getPropertyValue("--malachite-accent-background").trim() ||
|
|
1668
|
-
foreground: r.getPropertyValue("--malachite-accent-foreground").trim() ||
|
|
1669
|
-
border: r.getPropertyValue("--malachite-accent-border").trim() ||
|
|
1670
|
-
backgroundGlass: r.getPropertyValue("--malachite-accent-background-glass").trim() ||
|
|
1667
|
+
background: r.getPropertyValue("--malachite-accent-background").trim() || y.background,
|
|
1668
|
+
foreground: r.getPropertyValue("--malachite-accent-foreground").trim() || y.foreground,
|
|
1669
|
+
border: r.getPropertyValue("--malachite-accent-border").trim() || y.border,
|
|
1670
|
+
backgroundGlass: r.getPropertyValue("--malachite-accent-background-glass").trim() || y.backgroundGlass
|
|
1671
1671
|
},
|
|
1672
1672
|
datePicker: l,
|
|
1673
1673
|
control: {
|
|
@@ -1986,26 +1986,26 @@ function X() {
|
|
|
1986
1986
|
}
|
|
1987
1987
|
};
|
|
1988
1988
|
}
|
|
1989
|
-
let
|
|
1990
|
-
const
|
|
1991
|
-
|
|
1989
|
+
let S = !1;
|
|
1990
|
+
const er = () => {
|
|
1991
|
+
S || (S = !0, W());
|
|
1992
1992
|
};
|
|
1993
1993
|
export {
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
1994
|
+
f as CONTROL_HEIGHT,
|
|
1995
|
+
X as applyCustomTheme,
|
|
1996
|
+
K as applyDarkTheme,
|
|
1997
|
+
H as applyLightTheme,
|
|
1998
|
+
I as applyTheme,
|
|
1999
|
+
J as applyThemeVars,
|
|
2000
|
+
k as darkTheme,
|
|
2001
2001
|
e as defaultTheme,
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2002
|
+
er as ensureThemeInitialized,
|
|
2003
|
+
rr as getCurrentTheme,
|
|
2004
|
+
P as getCurrentThemeMode,
|
|
2005
|
+
W as initializeTheme,
|
|
2006
|
+
Y as registerShadowRoot,
|
|
2007
|
+
Q as resetTheme,
|
|
2008
|
+
q as toggleTheme,
|
|
2009
|
+
U as unregisterShadowRoot
|
|
2010
2010
|
};
|
|
2011
2011
|
//# sourceMappingURL=theme.js.map
|