@stackone/malachite 2.62.1 → 2.63.0

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