@stackone/malachite 2.86.0 → 2.88.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.
Files changed (66) hide show
  1. package/COMPONENTS.md +5 -4
  2. package/dist/components/Accordion.js +206 -179
  3. package/dist/components/Accordion.js.map +1 -1
  4. package/dist/components/Button.js +118 -81
  5. package/dist/components/Button.js.map +1 -1
  6. package/dist/components/Card.js +128 -75
  7. package/dist/components/Card.js.map +1 -1
  8. package/dist/components/Chat/ChatModelPicker.js +70 -67
  9. package/dist/components/Chat/ChatModelPicker.js.map +1 -1
  10. package/dist/components/FilterSearch.js +237 -232
  11. package/dist/components/FilterSearch.js.map +1 -1
  12. package/dist/components/FrameHeader.js +36 -0
  13. package/dist/components/FrameHeader.js.map +1 -0
  14. package/dist/components/LoadingBar.js +5 -5
  15. package/dist/components/LoadingBar.js.map +1 -1
  16. package/dist/components/MultiSelect.js +438 -388
  17. package/dist/components/MultiSelect.js.map +1 -1
  18. package/dist/components/PinnedCornerCap.js +32 -19
  19. package/dist/components/PinnedCornerCap.js.map +1 -1
  20. package/dist/components/QueryInput.js +95 -92
  21. package/dist/components/QueryInput.js.map +1 -1
  22. package/dist/components/SplitButton.js +62 -61
  23. package/dist/components/SplitButton.js.map +1 -1
  24. package/dist/components/Surface.js +98 -94
  25. package/dist/components/Surface.js.map +1 -1
  26. package/dist/components/Table/Table.js +630 -606
  27. package/dist/components/Table/Table.js.map +1 -1
  28. package/dist/components/TimeBarChart/TimeBarChart.js +241 -0
  29. package/dist/components/TimeBarChart/TimeBarChart.js.map +1 -0
  30. package/dist/components/TimeBarChart/TimeBarChartAxes.js +49 -0
  31. package/dist/components/TimeBarChart/TimeBarChartAxes.js.map +1 -0
  32. package/dist/components/TimeBarChart/TimeBarChartBars.js +58 -0
  33. package/dist/components/TimeBarChart/TimeBarChartBars.js.map +1 -0
  34. package/dist/components/TimeBarChart/TimeBarChartLegend.js +29 -0
  35. package/dist/components/TimeBarChart/TimeBarChartLegend.js.map +1 -0
  36. package/dist/components/TimeBarChart/TimeBarChartTable.js +33 -0
  37. package/dist/components/TimeBarChart/TimeBarChartTable.js.map +1 -0
  38. package/dist/components/TimeBarChart/TimeBarChartTooltip.js +77 -0
  39. package/dist/components/TimeBarChart/TimeBarChartTooltip.js.map +1 -0
  40. package/dist/components/TimeBarChart/stackLayout.js +25 -0
  41. package/dist/components/TimeBarChart/stackLayout.js.map +1 -0
  42. package/dist/components/TimeBarChart/timeBuckets.js +133 -0
  43. package/dist/components/TimeBarChart/timeBuckets.js.map +1 -0
  44. package/dist/components/TimeBarChart/tones.js +10 -0
  45. package/dist/components/TimeBarChart/tones.js.map +1 -0
  46. package/dist/components/Tooltip.js +93 -90
  47. package/dist/components/Tooltip.js.map +1 -1
  48. package/dist/components/activeElement.js +5 -1
  49. package/dist/components/activeElement.js.map +1 -1
  50. package/dist/components/dateMath.js +1 -0
  51. package/dist/components/dateMath.js.map +1 -1
  52. package/dist/components/filterSearchModel.js +53 -45
  53. package/dist/components/filterSearchModel.js.map +1 -1
  54. package/dist/components/frameStyles.js +14 -0
  55. package/dist/components/frameStyles.js.map +1 -0
  56. package/dist/components/headerContent.js +10 -0
  57. package/dist/components/headerContent.js.map +1 -0
  58. package/dist/components/useFollowTrigger.js +28 -0
  59. package/dist/components/useFollowTrigger.js.map +1 -0
  60. package/dist/index.d.ts +131 -9
  61. package/dist/index.js +24 -22
  62. package/dist/index.js.map +1 -1
  63. package/dist/tailwind.css.js +1 -1
  64. package/dist/theme.js +340 -340
  65. package/dist/theme.js.map +1 -1
  66. package/package.json +1 -1
package/dist/theme.js CHANGED
@@ -1,4 +1,4 @@
1
- const E = [
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
- ], B = (r) => `--malachite-date-picker-${r.replace(/([A-Z])/g, "-$1").toLowerCase()}`, f = {
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
- }, $ = "0px 1px 0px 0px rgba(0, 175, 102, 0.15)", h = {
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: { ...h },
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: f,
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
- }, y = {
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: { ...h },
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
- }, S = "malachite-theme-mode", v = "malachite-custom-theme", Z = /^--[A-Za-z0-9_-]+$/, A = /[{};]|\/\*|\*\//, M = /^[A-Za-z0-9_-]+$/;
1097
- function O(r, l) {
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 (A.test(r)) {
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 t = {};
1109
- for (const [o, g] of Object.entries(r)) {
1108
+ const a = {};
1109
+ for (const [o, n] of Object.entries(r)) {
1110
1110
  const u = l ? `${l}.${o}` : o;
1111
- if (!M.test(o)) {
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 a = O(g, u);
1118
- a !== void 0 && (t[o] = a);
1117
+ const b = T(n, u);
1118
+ b !== void 0 && (a[o] = b);
1119
1119
  }
1120
- return t;
1120
+ return a;
1121
1121
  }
1122
- const w = /* @__PURE__ */ new Set();
1123
- function I(r) {
1122
+ const x = /* @__PURE__ */ new Set();
1123
+ function Y(r) {
1124
1124
  try {
1125
- if (w.has(r))
1125
+ if (x.has(r))
1126
1126
  return;
1127
- w.add(r), G(r);
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 W(r) {
1132
+ function U(r) {
1133
1133
  try {
1134
- w.delete(r);
1134
+ x.delete(r);
1135
1135
  } catch (l) {
1136
1136
  console.error("Error unregistering shadow root:", l);
1137
1137
  }
1138
1138
  }
1139
- const R = {
1139
+ const _ = {
1140
1140
  rowVariant: "row-variant",
1141
1141
  boxShadow: "box-shadow"
1142
1142
  };
1143
- function C(r, l, t) {
1144
- Object.entries(r).forEach(([o, g]) => {
1145
- const u = R[o] ?? o;
1146
- typeof g == "object" && g !== null ? Object.entries(g).forEach(([a, d]) => {
1147
- const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
1148
- typeof d == "object" && d !== null ? Object.entries(d).forEach(([s, c]) => {
1149
- const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
1150
- t(
1151
- `${l}-${u}-${i}-${n}`,
1152
- c
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
- }) : t(`${l}-${u}-${i}`, d);
1155
- }) : t(`${l}-${u}`, g);
1154
+ }) : a(`${l}-${u}-${d}`, t);
1155
+ }) : a(`${l}-${u}`, n);
1156
1156
  });
1157
1157
  }
1158
- function p(r, l) {
1159
- const t = r.colors.accent ?? f, o = r.colors.datePicker ?? {}, g = { ...r.shadows, accent: r.shadows.accent ?? $ };
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 u = l.querySelector("#malachite-theme-vars");
1162
- u || (u = document.createElement("style"), u.id = "malachite-theme-vars", l.appendChild(u));
1163
- const a = [];
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
- a.push(`--malachite-font-size-${s}: ${c}`);
1165
+ t.push(`--malachite-font-size-${s}: ${c}`);
1166
1166
  }), Object.entries(r.iconSizes).forEach(([s, c]) => {
1167
- a.push(`--malachite-icon-size-${s}: ${c}`);
1167
+ t.push(`--malachite-icon-size-${s}: ${c}`);
1168
1168
  }), Object.entries(r.radius).forEach(([s, c]) => {
1169
- a.push(`--malachite-radius-${s}: ${c}`);
1170
- }), Object.entries(r.controlHeights ?? h).forEach(([s, c]) => {
1171
- a.push(`--malachite-control-height-${s}: ${c}`);
1172
- }), Object.entries(g).forEach(([s, c]) => {
1173
- const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
1174
- a.push(`--malachite-shadow-${n}: ${c}`);
1175
- }), a.push(`--malachite-shadow-color: ${r.colors.shadowColor}`), a.push(`--malachite-shadow-opacity: ${r.colors.shadowOpacity}`), Object.entries(r.colors.card).forEach(([s, c]) => {
1176
- const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
1177
- a.push(`--malachite-card-${n}: ${c}`);
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 n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
1180
- a.push(`--malachite-overlay-${n}: ${c}`);
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(([n, b]) => {
1183
- const m = n.replace(/([A-Z])/g, "-$1").toLowerCase();
1184
- a.push(`--malachite-alert-${s}-${m}: ${b}`);
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 n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
1188
- a.push(`--malachite-tooltip-${n}: ${c}`);
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 n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
1191
- a.push(`--malachite-buttonlist-${n}: ${c}`);
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 n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
1194
- a.push(`--malachite-pillbutton-${n}: ${c}`);
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 n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
1197
- a.push(`--malachite-toggle-${n}: ${c}`);
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 n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
1200
- a.push(`--malachite-segmented-control-${n}: ${c}`);
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 n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
1203
- a.push(`--malachite-selectable-card-${n}: ${c}`);
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 n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
1206
- a.push(`--malachite-card-strip-${n}: ${c}`);
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 n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
1209
- a.push(`--malachite-selection-bar-${n}: ${c}`);
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 n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
1212
- a.push(`--malachite-inline-confirm-${n}: ${c}`);
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 n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
1215
- a.push(`--malachite-close-button-${n}: ${c}`);
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 n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
1218
- a.push(`--malachite-dropdown-${n}: ${c}`);
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 n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
1221
- a.push(`--malachite-control-${n}: ${c}`);
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
- c && a.push(`${B(s)}: ${c}`);
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(([n, b]) => {
1229
- const m = n.replace(/([A-Z])/g, "-$1").toLowerCase();
1230
- a.push(`--malachite-tag-${s}-${m}: ${b}`);
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 n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
1234
- a.push(`--malachite-number-tag-${n}: ${c}`);
1235
- }), C(
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) => a.push(`${s}: ${c}`)
1238
+ (s, c) => t.push(`${s}: ${c}`)
1239
1239
  ), Object.entries(r.colors.text).forEach(([s, c]) => {
1240
- const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
1241
- typeof c == "object" && c !== null ? Object.entries(c).forEach(([b, m]) => {
1242
- const V = b.replace(/([A-Z])/g, "-$1").toLowerCase();
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
- ([H, K]) => {
1245
- const z = H.replace(/([A-Z])/g, "-$1").toLowerCase();
1246
- a.push(
1247
- `--malachite-text-${n}-${V}-${z}: ${K}`
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
- ) : a.push(
1251
- `--malachite-text-${n}-${V}: ${m}`
1250
+ ) : t.push(
1251
+ `--malachite-text-${i}-${B}: ${m}`
1252
1252
  );
1253
- }) : a.push(`--malachite-text-${n}: ${c}`);
1253
+ }) : t.push(`--malachite-text-${i}: ${c}`);
1254
1254
  }), Object.entries(r.colors.codeBlock).forEach(([s, c]) => {
1255
- const n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
1256
- a.push(`--malachite-codeblock-${n}: ${c}`);
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 n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
1259
- a.push(`--malachite-chat-${n}: ${c}`);
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 n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
1262
- a.push(`--malachite-assistant-${n}: ${c}`);
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(([n, b]) => {
1274
- const m = n.replace(/([A-Z])/g, "-$1").toLowerCase();
1275
- a.push(`--malachite-${s}-${m}: ${b}`);
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 i = a.filter((s) => {
1279
- if (!A.test(s)) return !0;
1280
- const c = s.split(":", 1)[0].trim(), n = Z.test(c) ? c : "an unnamed token";
1281
- return console.warn(`Malachite: dropped an unsafe theme declaration for ${n}`), !1;
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
- u.textContent = `:host { ${i.join("; ")} }`;
1284
- } else l instanceof HTMLElement && (Object.entries(r.fontSizes).forEach(([a, d]) => {
1285
- l.style.setProperty(`--malachite-font-size-${a}`, d);
1286
- }), Object.entries(r.iconSizes).forEach(([a, d]) => {
1287
- l.style.setProperty(`--malachite-icon-size-${a}`, d);
1288
- }), Object.entries(r.radius).forEach(([a, d]) => {
1289
- l.style.setProperty(`--malachite-radius-${a}`, d);
1290
- }), Object.entries(r.controlHeights ?? h).forEach(([a, d]) => {
1291
- l.style.setProperty(`--malachite-control-height-${a}`, d);
1292
- }), Object.entries(g).forEach(([a, d]) => {
1293
- const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
1294
- l.style.setProperty(`--malachite-shadow-${i}`, d);
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(([a, d]) => {
1299
- const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
1300
- l.style.setProperty(`--malachite-card-${i}`, d);
1301
- }), Object.entries(r.colors.overlay).forEach(([a, d]) => {
1302
- const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
1303
- l.style.setProperty(`--malachite-overlay-${i}`, d);
1304
- }), Object.entries(r.colors.alert).forEach(([a, d]) => {
1305
- Object.entries(d).forEach(([i, s]) => {
1306
- const c = i.replace(/([A-Z])/g, "-$1").toLowerCase();
1307
- l.style.setProperty(`--malachite-alert-${a}-${c}`, s);
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(([a, d]) => {
1310
- const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
1311
- l.style.setProperty(`--malachite-tooltip-${i}`, d);
1312
- }), Object.entries(r.colors.buttonList).forEach(([a, d]) => {
1313
- const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
1314
- l.style.setProperty(`--malachite-buttonlist-${i}`, d);
1315
- }), Object.entries(r.colors.pillButton).forEach(([a, d]) => {
1316
- const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
1317
- l.style.setProperty(`--malachite-pillbutton-${i}`, d);
1318
- }), Object.entries(r.colors.toggle).forEach(([a, d]) => {
1319
- const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
1320
- l.style.setProperty(`--malachite-toggle-${i}`, d);
1321
- }), Object.entries(r.colors.segmentedControl).forEach(([a, d]) => {
1322
- const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
1323
- l.style.setProperty(`--malachite-segmented-control-${i}`, d);
1324
- }), Object.entries(r.colors.selectableCard).forEach(([a, d]) => {
1325
- const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
1326
- l.style.setProperty(`--malachite-selectable-card-${i}`, d);
1327
- }), Object.entries(r.colors.cardStrip).forEach(([a, d]) => {
1328
- const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
1329
- l.style.setProperty(`--malachite-card-strip-${i}`, d);
1330
- }), Object.entries(r.colors.selectionBar).forEach(([a, d]) => {
1331
- const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
1332
- l.style.setProperty(`--malachite-selection-bar-${i}`, d);
1333
- }), Object.entries(r.colors.inlineConfirm).forEach(([a, d]) => {
1334
- const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
1335
- l.style.setProperty(`--malachite-inline-confirm-${i}`, d);
1336
- }), Object.entries(r.colors.closeButton).forEach(([a, d]) => {
1337
- const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
1338
- l.style.setProperty(`--malachite-close-button-${i}`, d);
1339
- }), Object.entries(r.colors.dropdown).forEach(([a, d]) => {
1340
- const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
1341
- l.style.setProperty(`--malachite-dropdown-${i}`, d);
1342
- }), Object.entries(r.colors.control).forEach(([a, d]) => {
1343
- const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
1344
- l.style.setProperty(`--malachite-control-${i}`, d);
1345
- }), Object.entries(t).forEach(([a, d]) => {
1346
- const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
1347
- l.style.setProperty(`--malachite-accent-${i}`, d);
1348
- }), E.forEach((a) => {
1349
- const d = o[a];
1350
- d ? l.style.setProperty(B(a), d) : l.style.removeProperty(B(a));
1351
- }), Object.entries(r.colors.tag).forEach(([a, d]) => {
1352
- Object.entries(d).forEach(([i, s]) => {
1353
- const c = i.replace(/([A-Z])/g, "-$1").toLowerCase();
1354
- l.style.setProperty(`--malachite-tag-${a}-${c}`, s);
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(([a, d]) => {
1357
- const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
1358
- l.style.setProperty(`--malachite-number-tag-${i}`, d);
1359
- }), C(
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
- (a, d) => l.style.setProperty(a, d)
1363
- ), Object.entries(r.colors.text).forEach(([a, d]) => {
1364
- const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
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 n = s.replace(/([A-Z])/g, "-$1").toLowerCase();
1366
+ const i = s.replace(/([A-Z])/g, "-$1").toLowerCase();
1367
1367
  typeof c == "object" && c !== null ? Object.entries(c).forEach(
1368
- ([b, m]) => {
1369
- const V = b.replace(/([A-Z])/g, "-$1").toLowerCase();
1368
+ ([h, m]) => {
1369
+ const B = h.replace(/([A-Z])/g, "-$1").toLowerCase();
1370
1370
  l.style.setProperty(
1371
- `--malachite-text-${i}-${n}-${V}`,
1371
+ `--malachite-text-${g}-${i}-${B}`,
1372
1372
  m
1373
1373
  );
1374
1374
  }
1375
1375
  ) : l.style.setProperty(
1376
- `--malachite-text-${i}-${n}`,
1376
+ `--malachite-text-${g}-${i}`,
1377
1377
  c
1378
1378
  );
1379
- }) : l.style.setProperty(`--malachite-text-${i}`, d);
1380
- }), Object.entries(r.colors.codeBlock).forEach(([a, d]) => {
1381
- const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
1382
- l.style.setProperty(`--malachite-codeblock-${i}`, d);
1383
- }), Object.entries(r.colors.chat).forEach(([a, d]) => {
1384
- const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
1385
- l.style.setProperty(`--malachite-chat-${i}`, d);
1386
- }), Object.entries(r.colors.assistant).forEach(([a, d]) => {
1387
- const i = a.replace(/([A-Z])/g, "-$1").toLowerCase();
1388
- l.style.setProperty(`--malachite-assistant-${i}`, d);
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((a) => {
1398
- const d = r.colors[a];
1399
- Object.entries(d).forEach(([i, s]) => {
1400
- const c = i.replace(/([A-Z])/g, "-$1").toLowerCase();
1401
- l.style.setProperty(`--malachite-${a}-${c}`, s);
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 G(r) {
1405
+ function D(r) {
1406
1406
  try {
1407
- const l = x(), t = P(), o = l === "dark" ? y : e, g = t ? k(o, t) : o;
1408
- p(g, r);
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(v);
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(v), null;
1423
+ return localStorage.removeItem($), null;
1424
1424
  }
1425
1425
  }
1426
- function L(r) {
1427
- typeof window < "u" && localStorage.setItem(S, r);
1426
+ function j(r) {
1427
+ typeof window < "u" && localStorage.setItem(O, r);
1428
1428
  }
1429
- function _(r) {
1430
- typeof window < "u" && localStorage.setItem(v, JSON.stringify(r));
1429
+ function N(r) {
1430
+ typeof window < "u" && localStorage.setItem($, JSON.stringify(r));
1431
1431
  }
1432
- function k(r, l) {
1433
- const t = O(l, ""), o = { ...r };
1434
- 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 = {
1435
- ...o.controlHeights ?? h,
1436
- ...t.controlHeights
1437
- }), t.shadows && (o.shadows = { ...o.shadows, ...t.shadows }), t.colors) {
1438
- 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) {
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 g of Object.keys(
1441
- t.colors.alert
1440
+ for (const n of Object.keys(
1441
+ a.colors.alert
1442
1442
  )) {
1443
- const u = t.colors.alert[g];
1444
- u && (o.colors.alert[g] = { ...o.colors.alert[g], ...u });
1443
+ const u = a.colors.alert[n];
1444
+ u && (o.colors.alert[n] = { ...o.colors.alert[n], ...u });
1445
1445
  }
1446
1446
  }
1447
- 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 = {
1448
- ...o.colors.accent ?? f,
1449
- ...t.colors.accent
1450
- }), t.colors.datePicker && (o.colors.datePicker = {
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
- ...t.colors.datePicker
1453
- }), 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 = {
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
- ...t.colors.destructive
1456
- }), 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 = {
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
- ...t.colors.segmentedControl
1459
- }), t.colors.selectableCard && (o.colors.selectableCard = {
1458
+ ...a.colors.segmentedControl
1459
+ }), a.colors.selectableCard && (o.colors.selectableCard = {
1460
1460
  ...o.colors.selectableCard,
1461
- ...t.colors.selectableCard
1462
- }), t.colors.cardStrip && (o.colors.cardStrip = { ...o.colors.cardStrip, ...t.colors.cardStrip }), t.colors.selectionBar && (o.colors.selectionBar = {
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
- ...t.colors.selectionBar
1465
- }), t.colors.inlineConfirm && (o.colors.inlineConfirm = {
1464
+ ...a.colors.selectionBar
1465
+ }), a.colors.inlineConfirm && (o.colors.inlineConfirm = {
1466
1466
  ...o.colors.inlineConfirm,
1467
- ...t.colors.inlineConfirm
1468
- }), t.colors.closeButton && (o.colors.closeButton = {
1467
+ ...a.colors.inlineConfirm
1468
+ }), a.colors.closeButton && (o.colors.closeButton = {
1469
1469
  ...o.colors.closeButton,
1470
- ...t.colors.closeButton
1471
- }), t.colors.dropdown && (o.colors.dropdown = { ...o.colors.dropdown, ...t.colors.dropdown }), t.colors.tag) {
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 g of Object.keys(
1474
- t.colors.tag
1473
+ for (const n of Object.keys(
1474
+ a.colors.tag
1475
1475
  )) {
1476
- const u = t.colors.tag[g];
1477
- u && (o.colors.tag[g] = { ...o.colors.tag[g], ...u });
1476
+ const u = a.colors.tag[n];
1477
+ u && (o.colors.tag[n] = { ...o.colors.tag[n], ...u });
1478
1478
  }
1479
1479
  }
1480
- if (t.colors.numberTag && (o.colors.numberTag = { ...o.colors.numberTag, ...t.colors.numberTag }), t.colors.text) {
1481
- const { rightSideText: g, ...u } = t.colors.text;
1482
- o.colors.text = { ...o.colors.text, ...u }, g && (o.colors.text.rightSideText = {
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
- ...g
1484
+ ...n
1485
1485
  });
1486
1486
  }
1487
- 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) {
1488
- const { header: g, row: u, borderedRow: a, rowVariant: d, error: i, ...s } = t.colors.table;
1489
- 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 = {
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
- ...a
1492
- }), i && (o.colors.table.error = { ...o.colors.table.error, ...i }), d) {
1493
- const c = { ...o.colors.table.rowVariant };
1494
- for (const n of Object.keys(d)) {
1495
- const b = d[n];
1496
- b && (c[n] = { ...c[n], ...b });
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 = c;
1498
+ o.colors.table.rowVariant = s;
1499
1499
  }
1500
1500
  }
1501
1501
  }
1502
1502
  return o;
1503
1503
  }
1504
- function D(r) {
1505
- _(r);
1506
- const l = x(), o = k(l === "dark" ? y : e, r);
1507
- p(o, document.documentElement), w.forEach((g) => {
1508
- p(o, g);
1509
- }), l === "dark" ? document.documentElement.setAttribute("data-theme", "dark") : document.documentElement.removeAttribute("data-theme");
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 Y(r, l) {
1512
- const t = l === "dark" ? y : e, o = P(), g = o ? k(t, o) : t;
1513
- p(g, r);
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
- function T() {
1516
- L("light"), document.documentElement.removeAttribute("data-theme");
1517
- const r = P(), l = r ? k(e, r) : e;
1518
- p(l, document.documentElement), w.forEach((t) => {
1519
- p(l, t);
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 j() {
1523
- L("dark"), document.documentElement.setAttribute("data-theme", "dark");
1524
- const r = P(), l = r ? k(y, r) : y;
1525
- p(l, document.documentElement), w.forEach((t) => {
1526
- p(l, t);
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 U() {
1530
- return x() === "dark" ? (T(), "light") : (j(), "dark");
1532
+ function q() {
1533
+ return P() === "dark" ? (H(), "light") : (K(), "dark");
1531
1534
  }
1532
- function J(r) {
1533
- D(r);
1535
+ function X(r) {
1536
+ I(r);
1534
1537
  }
1535
- function q() {
1536
- const r = x();
1537
- localStorage.removeItem(v), r === "dark" ? j() : T();
1538
+ function Q() {
1539
+ const r = P();
1540
+ localStorage.removeItem($), r === "dark" ? K() : H();
1538
1541
  }
1539
- function N() {
1542
+ function W() {
1540
1543
  if (typeof window < "u") {
1541
- const r = x(), l = P();
1542
- if (r === "dark") {
1544
+ const r = P(), l = V();
1545
+ if (r === "dark")
1543
1546
  if (l) {
1544
- const t = k(y, l);
1545
- p(t, document.documentElement);
1547
+ const a = w(k, l);
1548
+ p(a, document.documentElement);
1546
1549
  } else
1547
- p(y, document.documentElement);
1548
- document.documentElement.setAttribute("data-theme", "dark");
1549
- } else {
1550
- if (l) {
1551
- const t = k(e, l);
1552
- p(t, document.documentElement);
1553
- } else
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 X() {
1559
+ function rr() {
1560
1560
  const r = getComputedStyle(document.documentElement), l = {};
1561
- for (const t of E) {
1562
- const o = r.getPropertyValue(B(t)).trim();
1563
- o && (l[t] = o);
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() || h.small,
1583
- medium: r.getPropertyValue("--malachite-control-height-medium").trim() || h.medium,
1584
- large: r.getPropertyValue("--malachite-control-height-large").trim() || h.large
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() || f.background,
1668
- foreground: r.getPropertyValue("--malachite-accent-foreground").trim() || f.foreground,
1669
- border: r.getPropertyValue("--malachite-accent-border").trim() || f.border,
1670
- backgroundGlass: r.getPropertyValue("--malachite-accent-background-glass").trim() || f.backgroundGlass
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 F = !1;
1990
- const Q = () => {
1991
- F || (F = !0, N());
1989
+ let S = !1;
1990
+ const er = () => {
1991
+ S || (S = !0, W());
1992
1992
  };
1993
1993
  export {
1994
- h as CONTROL_HEIGHT,
1995
- J as applyCustomTheme,
1996
- j as applyDarkTheme,
1997
- T as applyLightTheme,
1998
- D as applyTheme,
1999
- Y as applyThemeVars,
2000
- y as darkTheme,
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
- Q as ensureThemeInitialized,
2003
- X as getCurrentTheme,
2004
- x as getCurrentThemeMode,
2005
- N as initializeTheme,
2006
- I as registerShadowRoot,
2007
- q as resetTheme,
2008
- U as toggleTheme,
2009
- W as unregisterShadowRoot
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