@stackone/malachite 2.63.0 → 2.65.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 +4 -3
- package/dist/components/Avatar.js +10 -10
- package/dist/components/Avatar.js.map +1 -1
- package/dist/components/Button.js +103 -89
- package/dist/components/Button.js.map +1 -1
- package/dist/components/CloseButton.js +76 -0
- package/dist/components/CloseButton.js.map +1 -0
- package/dist/components/Popover.js +157 -149
- package/dist/components/Popover.js.map +1 -1
- package/dist/components/SplitScreenLayout.js +21 -38
- package/dist/components/SplitScreenLayout.js.map +1 -1
- package/dist/components/Typography/PathText.js +158 -0
- package/dist/components/Typography/PathText.js.map +1 -0
- package/dist/components/Typography/index.js +15 -13
- package/dist/components/Typography/index.js.map +1 -1
- package/dist/components/Typography/pathTextFit.js +42 -0
- package/dist/components/Typography/pathTextFit.js.map +1 -0
- package/dist/components/Typography/pathTextMeasure.js +67 -0
- package/dist/components/Typography/pathTextMeasure.js.map +1 -0
- package/dist/components/focusRing.js +4 -3
- package/dist/components/focusRing.js.map +1 -1
- package/dist/index.d.ts +62 -0
- package/dist/index.js +284 -282
- package/dist/index.js.map +1 -1
- package/dist/tailwind.css.js +1 -1
- package/dist/theme.js +175 -151
- 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 E = [
|
|
2
2
|
"hoverBackground",
|
|
3
3
|
"subtleHoverBackground",
|
|
4
4
|
"outsideForeground",
|
|
@@ -280,6 +280,11 @@ const F = [
|
|
|
280
280
|
divider: "rgba(255, 255, 255, 0.1)",
|
|
281
281
|
shadow: "0px 0px 10px 0px rgba(0, 0, 0, 0.2)"
|
|
282
282
|
},
|
|
283
|
+
closeButton: {
|
|
284
|
+
inverseForeground: "rgba(255, 255, 255, 0.7)",
|
|
285
|
+
inverseHoverForeground: "rgb(255, 255, 255)",
|
|
286
|
+
inverseDisabledForeground: "rgba(255, 255, 255, 0.35)"
|
|
287
|
+
},
|
|
283
288
|
dropdown: {
|
|
284
289
|
border: "rgb(232, 232, 232)",
|
|
285
290
|
borderActive: "rgba(0, 175, 102, 0.6)",
|
|
@@ -805,6 +810,11 @@ const F = [
|
|
|
805
810
|
divider: "rgba(255, 255, 255, 0.16)",
|
|
806
811
|
shadow: "0px 0px 10px 0px rgba(0, 0, 0, 0.45)"
|
|
807
812
|
},
|
|
813
|
+
closeButton: {
|
|
814
|
+
inverseForeground: "rgba(255, 255, 255, 0.7)",
|
|
815
|
+
inverseHoverForeground: "rgb(255, 255, 255)",
|
|
816
|
+
inverseDisabledForeground: "rgba(255, 255, 255, 0.35)"
|
|
817
|
+
},
|
|
808
818
|
dropdown: {
|
|
809
819
|
border: "rgb(100, 100, 100)",
|
|
810
820
|
borderActive: "rgba(50, 205, 132, 0.7)",
|
|
@@ -1091,7 +1101,7 @@ function O(r, l) {
|
|
|
1091
1101
|
}
|
|
1092
1102
|
if (r === null || typeof r != "object") return r;
|
|
1093
1103
|
const t = {};
|
|
1094
|
-
for (const [o,
|
|
1104
|
+
for (const [o, g] of Object.entries(r)) {
|
|
1095
1105
|
const u = l ? `${l}.${o}` : o;
|
|
1096
1106
|
if (!M.test(o)) {
|
|
1097
1107
|
console.warn(
|
|
@@ -1099,7 +1109,7 @@ function O(r, l) {
|
|
|
1099
1109
|
);
|
|
1100
1110
|
continue;
|
|
1101
1111
|
}
|
|
1102
|
-
const a = O(
|
|
1112
|
+
const a = O(g, u);
|
|
1103
1113
|
a !== void 0 && (t[o] = a);
|
|
1104
1114
|
}
|
|
1105
1115
|
return t;
|
|
@@ -1126,22 +1136,22 @@ const R = {
|
|
|
1126
1136
|
boxShadow: "box-shadow"
|
|
1127
1137
|
};
|
|
1128
1138
|
function C(r, l, t) {
|
|
1129
|
-
Object.entries(r).forEach(([o,
|
|
1139
|
+
Object.entries(r).forEach(([o, g]) => {
|
|
1130
1140
|
const u = R[o] ?? o;
|
|
1131
|
-
typeof
|
|
1132
|
-
const
|
|
1141
|
+
typeof g == "object" && g !== null ? Object.entries(g).forEach(([a, d]) => {
|
|
1142
|
+
const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1133
1143
|
typeof d == "object" && d !== null ? Object.entries(d).forEach(([s, c]) => {
|
|
1134
|
-
const
|
|
1144
|
+
const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1135
1145
|
t(
|
|
1136
|
-
`${l}-${u}-${
|
|
1146
|
+
`${l}-${u}-${i}-${n}`,
|
|
1137
1147
|
c
|
|
1138
1148
|
);
|
|
1139
|
-
}) : t(`${l}-${u}-${
|
|
1140
|
-
}) : t(`${l}-${u}`,
|
|
1149
|
+
}) : t(`${l}-${u}-${i}`, d);
|
|
1150
|
+
}) : t(`${l}-${u}`, g);
|
|
1141
1151
|
});
|
|
1142
1152
|
}
|
|
1143
1153
|
function p(r, l) {
|
|
1144
|
-
const t = r.colors.accent ?? f, o = r.colors.datePicker ?? {},
|
|
1154
|
+
const t = r.colors.accent ?? f, o = r.colors.datePicker ?? {}, g = { ...r.shadows, accent: r.shadows.accent ?? $ };
|
|
1145
1155
|
if (l instanceof ShadowRoot) {
|
|
1146
1156
|
let u = l.querySelector("#malachite-theme-vars");
|
|
1147
1157
|
u || (u = document.createElement("style"), u.id = "malachite-theme-vars", l.appendChild(u));
|
|
@@ -1154,94 +1164,97 @@ function p(r, l) {
|
|
|
1154
1164
|
a.push(`--malachite-radius-${s}: ${c}`);
|
|
1155
1165
|
}), Object.entries(r.controlHeights ?? h).forEach(([s, c]) => {
|
|
1156
1166
|
a.push(`--malachite-control-height-${s}: ${c}`);
|
|
1157
|
-
}), Object.entries(
|
|
1158
|
-
const
|
|
1159
|
-
a.push(`--malachite-shadow-${
|
|
1167
|
+
}), Object.entries(g).forEach(([s, c]) => {
|
|
1168
|
+
const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1169
|
+
a.push(`--malachite-shadow-${n}: ${c}`);
|
|
1160
1170
|
}), 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
|
|
1162
|
-
a.push(`--malachite-card-${
|
|
1171
|
+
const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1172
|
+
a.push(`--malachite-card-${n}: ${c}`);
|
|
1163
1173
|
}), Object.entries(r.colors.overlay).forEach(([s, c]) => {
|
|
1164
|
-
const
|
|
1165
|
-
a.push(`--malachite-overlay-${
|
|
1174
|
+
const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1175
|
+
a.push(`--malachite-overlay-${n}: ${c}`);
|
|
1166
1176
|
}), Object.entries(r.colors.alert).forEach(([s, c]) => {
|
|
1167
|
-
Object.entries(c).forEach(([
|
|
1168
|
-
const m =
|
|
1177
|
+
Object.entries(c).forEach(([n, b]) => {
|
|
1178
|
+
const m = n.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1169
1179
|
a.push(`--malachite-alert-${s}-${m}: ${b}`);
|
|
1170
1180
|
});
|
|
1171
1181
|
}), Object.entries(r.colors.tooltip).forEach(([s, c]) => {
|
|
1172
|
-
const
|
|
1173
|
-
a.push(`--malachite-tooltip-${
|
|
1182
|
+
const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1183
|
+
a.push(`--malachite-tooltip-${n}: ${c}`);
|
|
1174
1184
|
}), Object.entries(r.colors.buttonList).forEach(([s, c]) => {
|
|
1175
|
-
const
|
|
1176
|
-
a.push(`--malachite-buttonlist-${
|
|
1185
|
+
const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1186
|
+
a.push(`--malachite-buttonlist-${n}: ${c}`);
|
|
1177
1187
|
}), Object.entries(r.colors.pillButton).forEach(([s, c]) => {
|
|
1178
|
-
const
|
|
1179
|
-
a.push(`--malachite-pillbutton-${
|
|
1188
|
+
const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1189
|
+
a.push(`--malachite-pillbutton-${n}: ${c}`);
|
|
1180
1190
|
}), Object.entries(r.colors.toggle).forEach(([s, c]) => {
|
|
1181
|
-
const
|
|
1182
|
-
a.push(`--malachite-toggle-${
|
|
1191
|
+
const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1192
|
+
a.push(`--malachite-toggle-${n}: ${c}`);
|
|
1183
1193
|
}), Object.entries(r.colors.segmentedControl).forEach(([s, c]) => {
|
|
1184
|
-
const
|
|
1185
|
-
a.push(`--malachite-segmented-control-${
|
|
1194
|
+
const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1195
|
+
a.push(`--malachite-segmented-control-${n}: ${c}`);
|
|
1186
1196
|
}), Object.entries(r.colors.selectableCard).forEach(([s, c]) => {
|
|
1187
|
-
const
|
|
1188
|
-
a.push(`--malachite-selectable-card-${
|
|
1197
|
+
const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1198
|
+
a.push(`--malachite-selectable-card-${n}: ${c}`);
|
|
1189
1199
|
}), Object.entries(r.colors.cardStrip).forEach(([s, c]) => {
|
|
1190
|
-
const
|
|
1191
|
-
a.push(`--malachite-card-strip-${
|
|
1200
|
+
const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1201
|
+
a.push(`--malachite-card-strip-${n}: ${c}`);
|
|
1192
1202
|
}), Object.entries(r.colors.selectionBar).forEach(([s, c]) => {
|
|
1193
|
-
const
|
|
1194
|
-
a.push(`--malachite-selection-bar-${
|
|
1203
|
+
const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1204
|
+
a.push(`--malachite-selection-bar-${n}: ${c}`);
|
|
1195
1205
|
}), Object.entries(r.colors.inlineConfirm).forEach(([s, c]) => {
|
|
1196
|
-
const
|
|
1197
|
-
a.push(`--malachite-inline-confirm-${
|
|
1206
|
+
const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1207
|
+
a.push(`--malachite-inline-confirm-${n}: ${c}`);
|
|
1208
|
+
}), Object.entries(r.colors.closeButton).forEach(([s, c]) => {
|
|
1209
|
+
const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1210
|
+
a.push(`--malachite-close-button-${n}: ${c}`);
|
|
1198
1211
|
}), Object.entries(r.colors.dropdown).forEach(([s, c]) => {
|
|
1199
|
-
const
|
|
1200
|
-
a.push(`--malachite-dropdown-${
|
|
1212
|
+
const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1213
|
+
a.push(`--malachite-dropdown-${n}: ${c}`);
|
|
1201
1214
|
}), Object.entries(r.colors.control).forEach(([s, c]) => {
|
|
1202
|
-
const
|
|
1203
|
-
a.push(`--malachite-control-${
|
|
1215
|
+
const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1216
|
+
a.push(`--malachite-control-${n}: ${c}`);
|
|
1204
1217
|
}), Object.entries(t).forEach(([s, c]) => {
|
|
1205
|
-
const
|
|
1206
|
-
a.push(`--malachite-accent-${
|
|
1218
|
+
const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1219
|
+
a.push(`--malachite-accent-${n}: ${c}`);
|
|
1207
1220
|
}), Object.entries(o).forEach(([s, c]) => {
|
|
1208
1221
|
c && a.push(`${B(s)}: ${c}`);
|
|
1209
1222
|
}), Object.entries(r.colors.tag).forEach(([s, c]) => {
|
|
1210
|
-
Object.entries(c).forEach(([
|
|
1211
|
-
const m =
|
|
1223
|
+
Object.entries(c).forEach(([n, b]) => {
|
|
1224
|
+
const m = n.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1212
1225
|
a.push(`--malachite-tag-${s}-${m}: ${b}`);
|
|
1213
1226
|
});
|
|
1214
1227
|
}), Object.entries(r.colors.numberTag).forEach(([s, c]) => {
|
|
1215
|
-
const
|
|
1216
|
-
a.push(`--malachite-number-tag-${
|
|
1228
|
+
const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1229
|
+
a.push(`--malachite-number-tag-${n}: ${c}`);
|
|
1217
1230
|
}), C(
|
|
1218
1231
|
r.colors.table,
|
|
1219
1232
|
"--malachite-table",
|
|
1220
1233
|
(s, c) => a.push(`${s}: ${c}`)
|
|
1221
1234
|
), Object.entries(r.colors.text).forEach(([s, c]) => {
|
|
1222
|
-
const
|
|
1235
|
+
const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1223
1236
|
typeof c == "object" && c !== null ? Object.entries(c).forEach(([b, m]) => {
|
|
1224
1237
|
const V = b.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1225
1238
|
typeof m == "object" && m !== null ? Object.entries(m).forEach(
|
|
1226
1239
|
([H, K]) => {
|
|
1227
1240
|
const z = H.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1228
1241
|
a.push(
|
|
1229
|
-
`--malachite-text-${
|
|
1242
|
+
`--malachite-text-${n}-${V}-${z}: ${K}`
|
|
1230
1243
|
);
|
|
1231
1244
|
}
|
|
1232
1245
|
) : a.push(
|
|
1233
|
-
`--malachite-text-${
|
|
1246
|
+
`--malachite-text-${n}-${V}: ${m}`
|
|
1234
1247
|
);
|
|
1235
|
-
}) : a.push(`--malachite-text-${
|
|
1248
|
+
}) : a.push(`--malachite-text-${n}: ${c}`);
|
|
1236
1249
|
}), Object.entries(r.colors.codeBlock).forEach(([s, c]) => {
|
|
1237
|
-
const
|
|
1238
|
-
a.push(`--malachite-codeblock-${
|
|
1250
|
+
const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1251
|
+
a.push(`--malachite-codeblock-${n}: ${c}`);
|
|
1239
1252
|
}), Object.entries(r.colors.chat).forEach(([s, c]) => {
|
|
1240
|
-
const
|
|
1241
|
-
a.push(`--malachite-chat-${
|
|
1253
|
+
const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1254
|
+
a.push(`--malachite-chat-${n}: ${c}`);
|
|
1242
1255
|
}), Object.entries(r.colors.assistant).forEach(([s, c]) => {
|
|
1243
|
-
const
|
|
1244
|
-
a.push(`--malachite-assistant-${
|
|
1256
|
+
const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1257
|
+
a.push(`--malachite-assistant-${n}: ${c}`);
|
|
1245
1258
|
}), [
|
|
1246
1259
|
"primary",
|
|
1247
1260
|
"secondary",
|
|
@@ -1252,17 +1265,17 @@ function p(r, l) {
|
|
|
1252
1265
|
"error"
|
|
1253
1266
|
].forEach((s) => {
|
|
1254
1267
|
const c = r.colors[s];
|
|
1255
|
-
Object.entries(c).forEach(([
|
|
1256
|
-
const m =
|
|
1268
|
+
Object.entries(c).forEach(([n, b]) => {
|
|
1269
|
+
const m = n.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1257
1270
|
a.push(`--malachite-${s}-${m}: ${b}`);
|
|
1258
1271
|
});
|
|
1259
1272
|
});
|
|
1260
|
-
const
|
|
1273
|
+
const i = a.filter((s) => {
|
|
1261
1274
|
if (!A.test(s)) return !0;
|
|
1262
|
-
const c = s.split(":", 1)[0].trim(),
|
|
1263
|
-
return console.warn(`Malachite: dropped an unsafe theme declaration for ${
|
|
1275
|
+
const c = s.split(":", 1)[0].trim(), n = Z.test(c) ? c : "an unnamed token";
|
|
1276
|
+
return console.warn(`Malachite: dropped an unsafe theme declaration for ${n}`), !1;
|
|
1264
1277
|
});
|
|
1265
|
-
u.textContent = `:host { ${
|
|
1278
|
+
u.textContent = `:host { ${i.join("; ")} }`;
|
|
1266
1279
|
} else l instanceof HTMLElement && (Object.entries(r.fontSizes).forEach(([a, d]) => {
|
|
1267
1280
|
l.style.setProperty(`--malachite-font-size-${a}`, d);
|
|
1268
1281
|
}), Object.entries(r.iconSizes).forEach(([a, d]) => {
|
|
@@ -1271,100 +1284,103 @@ function p(r, l) {
|
|
|
1271
1284
|
l.style.setProperty(`--malachite-radius-${a}`, d);
|
|
1272
1285
|
}), Object.entries(r.controlHeights ?? h).forEach(([a, d]) => {
|
|
1273
1286
|
l.style.setProperty(`--malachite-control-height-${a}`, d);
|
|
1274
|
-
}), Object.entries(
|
|
1275
|
-
const
|
|
1276
|
-
l.style.setProperty(`--malachite-shadow-${
|
|
1287
|
+
}), Object.entries(g).forEach(([a, d]) => {
|
|
1288
|
+
const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1289
|
+
l.style.setProperty(`--malachite-shadow-${i}`, d);
|
|
1277
1290
|
}), l.style.setProperty("--malachite-shadow-color", r.colors.shadowColor), l.style.setProperty(
|
|
1278
1291
|
"--malachite-shadow-opacity",
|
|
1279
1292
|
r.colors.shadowOpacity.toString()
|
|
1280
1293
|
), Object.entries(r.colors.card).forEach(([a, d]) => {
|
|
1281
|
-
const
|
|
1282
|
-
l.style.setProperty(`--malachite-card-${
|
|
1294
|
+
const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1295
|
+
l.style.setProperty(`--malachite-card-${i}`, d);
|
|
1283
1296
|
}), Object.entries(r.colors.overlay).forEach(([a, d]) => {
|
|
1284
|
-
const
|
|
1285
|
-
l.style.setProperty(`--malachite-overlay-${
|
|
1297
|
+
const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1298
|
+
l.style.setProperty(`--malachite-overlay-${i}`, d);
|
|
1286
1299
|
}), Object.entries(r.colors.alert).forEach(([a, d]) => {
|
|
1287
|
-
Object.entries(d).forEach(([
|
|
1288
|
-
const c =
|
|
1300
|
+
Object.entries(d).forEach(([i, s]) => {
|
|
1301
|
+
const c = i.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1289
1302
|
l.style.setProperty(`--malachite-alert-${a}-${c}`, s);
|
|
1290
1303
|
});
|
|
1291
1304
|
}), Object.entries(r.colors.tooltip).forEach(([a, d]) => {
|
|
1292
|
-
const
|
|
1293
|
-
l.style.setProperty(`--malachite-tooltip-${
|
|
1305
|
+
const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1306
|
+
l.style.setProperty(`--malachite-tooltip-${i}`, d);
|
|
1294
1307
|
}), Object.entries(r.colors.buttonList).forEach(([a, d]) => {
|
|
1295
|
-
const
|
|
1296
|
-
l.style.setProperty(`--malachite-buttonlist-${
|
|
1308
|
+
const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1309
|
+
l.style.setProperty(`--malachite-buttonlist-${i}`, d);
|
|
1297
1310
|
}), Object.entries(r.colors.pillButton).forEach(([a, d]) => {
|
|
1298
|
-
const
|
|
1299
|
-
l.style.setProperty(`--malachite-pillbutton-${
|
|
1311
|
+
const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1312
|
+
l.style.setProperty(`--malachite-pillbutton-${i}`, d);
|
|
1300
1313
|
}), Object.entries(r.colors.toggle).forEach(([a, d]) => {
|
|
1301
|
-
const
|
|
1302
|
-
l.style.setProperty(`--malachite-toggle-${
|
|
1314
|
+
const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1315
|
+
l.style.setProperty(`--malachite-toggle-${i}`, d);
|
|
1303
1316
|
}), Object.entries(r.colors.segmentedControl).forEach(([a, d]) => {
|
|
1304
|
-
const
|
|
1305
|
-
l.style.setProperty(`--malachite-segmented-control-${
|
|
1317
|
+
const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1318
|
+
l.style.setProperty(`--malachite-segmented-control-${i}`, d);
|
|
1306
1319
|
}), Object.entries(r.colors.selectableCard).forEach(([a, d]) => {
|
|
1307
|
-
const
|
|
1308
|
-
l.style.setProperty(`--malachite-selectable-card-${
|
|
1320
|
+
const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1321
|
+
l.style.setProperty(`--malachite-selectable-card-${i}`, d);
|
|
1309
1322
|
}), Object.entries(r.colors.cardStrip).forEach(([a, d]) => {
|
|
1310
|
-
const
|
|
1311
|
-
l.style.setProperty(`--malachite-card-strip-${
|
|
1323
|
+
const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1324
|
+
l.style.setProperty(`--malachite-card-strip-${i}`, d);
|
|
1312
1325
|
}), Object.entries(r.colors.selectionBar).forEach(([a, d]) => {
|
|
1313
|
-
const
|
|
1314
|
-
l.style.setProperty(`--malachite-selection-bar-${
|
|
1326
|
+
const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1327
|
+
l.style.setProperty(`--malachite-selection-bar-${i}`, d);
|
|
1315
1328
|
}), Object.entries(r.colors.inlineConfirm).forEach(([a, d]) => {
|
|
1316
|
-
const
|
|
1317
|
-
l.style.setProperty(`--malachite-inline-confirm-${
|
|
1329
|
+
const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1330
|
+
l.style.setProperty(`--malachite-inline-confirm-${i}`, d);
|
|
1331
|
+
}), Object.entries(r.colors.closeButton).forEach(([a, d]) => {
|
|
1332
|
+
const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1333
|
+
l.style.setProperty(`--malachite-close-button-${i}`, d);
|
|
1318
1334
|
}), Object.entries(r.colors.dropdown).forEach(([a, d]) => {
|
|
1319
|
-
const
|
|
1320
|
-
l.style.setProperty(`--malachite-dropdown-${
|
|
1335
|
+
const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1336
|
+
l.style.setProperty(`--malachite-dropdown-${i}`, d);
|
|
1321
1337
|
}), Object.entries(r.colors.control).forEach(([a, d]) => {
|
|
1322
|
-
const
|
|
1323
|
-
l.style.setProperty(`--malachite-control-${
|
|
1338
|
+
const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1339
|
+
l.style.setProperty(`--malachite-control-${i}`, d);
|
|
1324
1340
|
}), Object.entries(t).forEach(([a, d]) => {
|
|
1325
|
-
const
|
|
1326
|
-
l.style.setProperty(`--malachite-accent-${
|
|
1327
|
-
}),
|
|
1341
|
+
const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1342
|
+
l.style.setProperty(`--malachite-accent-${i}`, d);
|
|
1343
|
+
}), E.forEach((a) => {
|
|
1328
1344
|
const d = o[a];
|
|
1329
1345
|
d ? l.style.setProperty(B(a), d) : l.style.removeProperty(B(a));
|
|
1330
1346
|
}), Object.entries(r.colors.tag).forEach(([a, d]) => {
|
|
1331
|
-
Object.entries(d).forEach(([
|
|
1332
|
-
const c =
|
|
1347
|
+
Object.entries(d).forEach(([i, s]) => {
|
|
1348
|
+
const c = i.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1333
1349
|
l.style.setProperty(`--malachite-tag-${a}-${c}`, s);
|
|
1334
1350
|
});
|
|
1335
1351
|
}), Object.entries(r.colors.numberTag).forEach(([a, d]) => {
|
|
1336
|
-
const
|
|
1337
|
-
l.style.setProperty(`--malachite-number-tag-${
|
|
1352
|
+
const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1353
|
+
l.style.setProperty(`--malachite-number-tag-${i}`, d);
|
|
1338
1354
|
}), C(
|
|
1339
1355
|
r.colors.table,
|
|
1340
1356
|
"--malachite-table",
|
|
1341
1357
|
(a, d) => l.style.setProperty(a, d)
|
|
1342
1358
|
), Object.entries(r.colors.text).forEach(([a, d]) => {
|
|
1343
|
-
const
|
|
1359
|
+
const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1344
1360
|
typeof d == "object" && d !== null ? Object.entries(d).forEach(([s, c]) => {
|
|
1345
|
-
const
|
|
1361
|
+
const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1346
1362
|
typeof c == "object" && c !== null ? Object.entries(c).forEach(
|
|
1347
1363
|
([b, m]) => {
|
|
1348
1364
|
const V = b.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1349
1365
|
l.style.setProperty(
|
|
1350
|
-
`--malachite-text-${
|
|
1366
|
+
`--malachite-text-${i}-${n}-${V}`,
|
|
1351
1367
|
m
|
|
1352
1368
|
);
|
|
1353
1369
|
}
|
|
1354
1370
|
) : l.style.setProperty(
|
|
1355
|
-
`--malachite-text-${
|
|
1371
|
+
`--malachite-text-${i}-${n}`,
|
|
1356
1372
|
c
|
|
1357
1373
|
);
|
|
1358
|
-
}) : l.style.setProperty(`--malachite-text-${
|
|
1374
|
+
}) : l.style.setProperty(`--malachite-text-${i}`, d);
|
|
1359
1375
|
}), Object.entries(r.colors.codeBlock).forEach(([a, d]) => {
|
|
1360
|
-
const
|
|
1361
|
-
l.style.setProperty(`--malachite-codeblock-${
|
|
1376
|
+
const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1377
|
+
l.style.setProperty(`--malachite-codeblock-${i}`, d);
|
|
1362
1378
|
}), Object.entries(r.colors.chat).forEach(([a, d]) => {
|
|
1363
|
-
const
|
|
1364
|
-
l.style.setProperty(`--malachite-chat-${
|
|
1379
|
+
const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1380
|
+
l.style.setProperty(`--malachite-chat-${i}`, d);
|
|
1365
1381
|
}), Object.entries(r.colors.assistant).forEach(([a, d]) => {
|
|
1366
|
-
const
|
|
1367
|
-
l.style.setProperty(`--malachite-assistant-${
|
|
1382
|
+
const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1383
|
+
l.style.setProperty(`--malachite-assistant-${i}`, d);
|
|
1368
1384
|
}), [
|
|
1369
1385
|
"primary",
|
|
1370
1386
|
"secondary",
|
|
@@ -1375,16 +1391,16 @@ function p(r, l) {
|
|
|
1375
1391
|
"error"
|
|
1376
1392
|
].forEach((a) => {
|
|
1377
1393
|
const d = r.colors[a];
|
|
1378
|
-
Object.entries(d).forEach(([
|
|
1379
|
-
const c =
|
|
1394
|
+
Object.entries(d).forEach(([i, s]) => {
|
|
1395
|
+
const c = i.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1380
1396
|
l.style.setProperty(`--malachite-${a}-${c}`, s);
|
|
1381
1397
|
});
|
|
1382
1398
|
}));
|
|
1383
1399
|
}
|
|
1384
1400
|
function G(r) {
|
|
1385
1401
|
try {
|
|
1386
|
-
const l = x(), t = P(), o = l === "dark" ? y : e,
|
|
1387
|
-
p(
|
|
1402
|
+
const l = x(), t = P(), o = l === "dark" ? y : e, g = t ? k(o, t) : o;
|
|
1403
|
+
p(g, r);
|
|
1388
1404
|
} catch (l) {
|
|
1389
1405
|
console.error("Error applying theme to shadow root:", l);
|
|
1390
1406
|
}
|
|
@@ -1402,7 +1418,7 @@ function P() {
|
|
|
1402
1418
|
return localStorage.removeItem(v), null;
|
|
1403
1419
|
}
|
|
1404
1420
|
}
|
|
1405
|
-
function
|
|
1421
|
+
function L(r) {
|
|
1406
1422
|
typeof window < "u" && localStorage.setItem(S, r);
|
|
1407
1423
|
}
|
|
1408
1424
|
function _(r) {
|
|
@@ -1416,11 +1432,11 @@ function k(r, l) {
|
|
|
1416
1432
|
}), t.shadows && (o.shadows = { ...o.shadows, ...t.shadows }), t.colors) {
|
|
1417
1433
|
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) {
|
|
1418
1434
|
o.colors.alert = { ...o.colors.alert };
|
|
1419
|
-
for (const
|
|
1435
|
+
for (const g of Object.keys(
|
|
1420
1436
|
t.colors.alert
|
|
1421
1437
|
)) {
|
|
1422
|
-
const u = t.colors.alert[
|
|
1423
|
-
u && (o.colors.alert[
|
|
1438
|
+
const u = t.colors.alert[g];
|
|
1439
|
+
u && (o.colors.alert[g] = { ...o.colors.alert[g], ...u });
|
|
1424
1440
|
}
|
|
1425
1441
|
}
|
|
1426
1442
|
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 = {
|
|
@@ -1444,32 +1460,35 @@ function k(r, l) {
|
|
|
1444
1460
|
}), t.colors.inlineConfirm && (o.colors.inlineConfirm = {
|
|
1445
1461
|
...o.colors.inlineConfirm,
|
|
1446
1462
|
...t.colors.inlineConfirm
|
|
1463
|
+
}), t.colors.closeButton && (o.colors.closeButton = {
|
|
1464
|
+
...o.colors.closeButton,
|
|
1465
|
+
...t.colors.closeButton
|
|
1447
1466
|
}), t.colors.dropdown && (o.colors.dropdown = { ...o.colors.dropdown, ...t.colors.dropdown }), t.colors.tag) {
|
|
1448
1467
|
o.colors.tag = { ...o.colors.tag };
|
|
1449
|
-
for (const
|
|
1468
|
+
for (const g of Object.keys(
|
|
1450
1469
|
t.colors.tag
|
|
1451
1470
|
)) {
|
|
1452
|
-
const u = t.colors.tag[
|
|
1453
|
-
u && (o.colors.tag[
|
|
1471
|
+
const u = t.colors.tag[g];
|
|
1472
|
+
u && (o.colors.tag[g] = { ...o.colors.tag[g], ...u });
|
|
1454
1473
|
}
|
|
1455
1474
|
}
|
|
1456
1475
|
if (t.colors.numberTag && (o.colors.numberTag = { ...o.colors.numberTag, ...t.colors.numberTag }), t.colors.text) {
|
|
1457
|
-
const { rightSideText:
|
|
1458
|
-
o.colors.text = { ...o.colors.text, ...u },
|
|
1476
|
+
const { rightSideText: g, ...u } = t.colors.text;
|
|
1477
|
+
o.colors.text = { ...o.colors.text, ...u }, g && (o.colors.text.rightSideText = {
|
|
1459
1478
|
...o.colors.text.rightSideText,
|
|
1460
|
-
...
|
|
1479
|
+
...g
|
|
1461
1480
|
});
|
|
1462
1481
|
}
|
|
1463
1482
|
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:
|
|
1465
|
-
if (o.colors.table = { ...o.colors.table, ...s },
|
|
1483
|
+
const { header: g, row: u, borderedRow: a, rowVariant: d, error: i, ...s } = t.colors.table;
|
|
1484
|
+
if (o.colors.table = { ...o.colors.table, ...s }, g && (o.colors.table.header = { ...o.colors.table.header, ...g }), u && (o.colors.table.row = { ...o.colors.table.row, ...u }), a && (o.colors.table.borderedRow = {
|
|
1466
1485
|
...o.colors.table.borderedRow,
|
|
1467
1486
|
...a
|
|
1468
|
-
}),
|
|
1487
|
+
}), i && (o.colors.table.error = { ...o.colors.table.error, ...i }), d) {
|
|
1469
1488
|
const c = { ...o.colors.table.rowVariant };
|
|
1470
|
-
for (const
|
|
1471
|
-
const b = d[
|
|
1472
|
-
b && (c[
|
|
1489
|
+
for (const n of Object.keys(d)) {
|
|
1490
|
+
const b = d[n];
|
|
1491
|
+
b && (c[n] = { ...c[n], ...b });
|
|
1473
1492
|
}
|
|
1474
1493
|
o.colors.table.rowVariant = c;
|
|
1475
1494
|
}
|
|
@@ -1477,42 +1496,42 @@ function k(r, l) {
|
|
|
1477
1496
|
}
|
|
1478
1497
|
return o;
|
|
1479
1498
|
}
|
|
1480
|
-
function
|
|
1499
|
+
function D(r) {
|
|
1481
1500
|
_(r);
|
|
1482
1501
|
const l = x(), o = k(l === "dark" ? y : e, r);
|
|
1483
|
-
p(o, document.documentElement), w.forEach((
|
|
1484
|
-
p(o,
|
|
1502
|
+
p(o, document.documentElement), w.forEach((g) => {
|
|
1503
|
+
p(o, g);
|
|
1485
1504
|
}), l === "dark" ? document.documentElement.setAttribute("data-theme", "dark") : document.documentElement.removeAttribute("data-theme");
|
|
1486
1505
|
}
|
|
1487
1506
|
function Y(r, l) {
|
|
1488
|
-
const t = l === "dark" ? y : e, o = P(),
|
|
1489
|
-
p(
|
|
1507
|
+
const t = l === "dark" ? y : e, o = P(), g = o ? k(t, o) : t;
|
|
1508
|
+
p(g, r);
|
|
1490
1509
|
}
|
|
1491
|
-
function
|
|
1492
|
-
|
|
1510
|
+
function T() {
|
|
1511
|
+
L("light"), document.documentElement.removeAttribute("data-theme");
|
|
1493
1512
|
const r = P(), l = r ? k(e, r) : e;
|
|
1494
1513
|
p(l, document.documentElement), w.forEach((t) => {
|
|
1495
1514
|
p(l, t);
|
|
1496
1515
|
});
|
|
1497
1516
|
}
|
|
1498
1517
|
function j() {
|
|
1499
|
-
|
|
1518
|
+
L("dark"), document.documentElement.setAttribute("data-theme", "dark");
|
|
1500
1519
|
const r = P(), l = r ? k(y, r) : y;
|
|
1501
1520
|
p(l, document.documentElement), w.forEach((t) => {
|
|
1502
1521
|
p(l, t);
|
|
1503
1522
|
});
|
|
1504
1523
|
}
|
|
1505
1524
|
function U() {
|
|
1506
|
-
return x() === "dark" ? (
|
|
1525
|
+
return x() === "dark" ? (T(), "light") : (j(), "dark");
|
|
1507
1526
|
}
|
|
1508
1527
|
function J(r) {
|
|
1509
|
-
|
|
1528
|
+
D(r);
|
|
1510
1529
|
}
|
|
1511
1530
|
function q() {
|
|
1512
1531
|
const r = x();
|
|
1513
|
-
localStorage.removeItem(v), r === "dark" ? j() :
|
|
1532
|
+
localStorage.removeItem(v), r === "dark" ? j() : T();
|
|
1514
1533
|
}
|
|
1515
|
-
function
|
|
1534
|
+
function N() {
|
|
1516
1535
|
if (typeof window < "u") {
|
|
1517
1536
|
const r = x(), l = P();
|
|
1518
1537
|
if (r === "dark") {
|
|
@@ -1534,7 +1553,7 @@ function D() {
|
|
|
1534
1553
|
}
|
|
1535
1554
|
function X() {
|
|
1536
1555
|
const r = getComputedStyle(document.documentElement), l = {};
|
|
1537
|
-
for (const t of
|
|
1556
|
+
for (const t of E) {
|
|
1538
1557
|
const o = r.getPropertyValue(B(t)).trim();
|
|
1539
1558
|
o && (l[t] = o);
|
|
1540
1559
|
}
|
|
@@ -1775,6 +1794,11 @@ function X() {
|
|
|
1775
1794
|
divider: r.getPropertyValue("--malachite-inline-confirm-divider").trim() || e.colors.inlineConfirm.divider,
|
|
1776
1795
|
shadow: r.getPropertyValue("--malachite-inline-confirm-shadow").trim() || e.colors.inlineConfirm.shadow
|
|
1777
1796
|
},
|
|
1797
|
+
closeButton: {
|
|
1798
|
+
inverseForeground: r.getPropertyValue("--malachite-close-button-inverse-foreground").trim() || e.colors.closeButton.inverseForeground,
|
|
1799
|
+
inverseHoverForeground: r.getPropertyValue("--malachite-close-button-inverse-hover-foreground").trim() || e.colors.closeButton.inverseHoverForeground,
|
|
1800
|
+
inverseDisabledForeground: r.getPropertyValue("--malachite-close-button-inverse-disabled-foreground").trim() || e.colors.closeButton.inverseDisabledForeground
|
|
1801
|
+
},
|
|
1778
1802
|
dropdown: {
|
|
1779
1803
|
border: r.getPropertyValue("--malachite-dropdown-border").trim() || e.colors.dropdown.border,
|
|
1780
1804
|
borderActive: r.getPropertyValue("--malachite-dropdown-border-active").trim() || e.colors.dropdown.borderActive,
|
|
@@ -1957,23 +1981,23 @@ function X() {
|
|
|
1957
1981
|
}
|
|
1958
1982
|
};
|
|
1959
1983
|
}
|
|
1960
|
-
let
|
|
1984
|
+
let F = !1;
|
|
1961
1985
|
const Q = () => {
|
|
1962
|
-
|
|
1986
|
+
F || (F = !0, N());
|
|
1963
1987
|
};
|
|
1964
1988
|
export {
|
|
1965
1989
|
h as CONTROL_HEIGHT,
|
|
1966
1990
|
J as applyCustomTheme,
|
|
1967
1991
|
j as applyDarkTheme,
|
|
1968
|
-
|
|
1969
|
-
|
|
1992
|
+
T as applyLightTheme,
|
|
1993
|
+
D as applyTheme,
|
|
1970
1994
|
Y as applyThemeVars,
|
|
1971
1995
|
y as darkTheme,
|
|
1972
1996
|
e as defaultTheme,
|
|
1973
1997
|
Q as ensureThemeInitialized,
|
|
1974
1998
|
X as getCurrentTheme,
|
|
1975
1999
|
x as getCurrentThemeMode,
|
|
1976
|
-
|
|
2000
|
+
N as initializeTheme,
|
|
1977
2001
|
I as registerShadowRoot,
|
|
1978
2002
|
q as resetTheme,
|
|
1979
2003
|
U as toggleTheme,
|