@owp/core 2.5.10 → 2.5.11

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 (61) hide show
  1. package/dist/_virtual/index16.js +4 -4
  2. package/dist/_virtual/index17.js +4 -4
  3. package/dist/_virtual/index18.js +4 -4
  4. package/dist/_virtual/index19.js +4 -4
  5. package/dist/components/OwpTable/OwpFieldTable.js +108 -92
  6. package/dist/components/OwpTable/OwpFieldTable.js.map +1 -1
  7. package/dist/components/OwpTable/OwpTable.js +161 -141
  8. package/dist/components/OwpTable/OwpTable.js.map +1 -1
  9. package/dist/components/OwpTable/internal/FieldTableValue.js +43 -0
  10. package/dist/components/OwpTable/internal/FieldTableValue.js.map +1 -0
  11. package/dist/components/OwpTable/internal/defaultTableStyle.js +13 -10
  12. package/dist/components/OwpTable/internal/defaultTableStyle.js.map +1 -1
  13. package/dist/components/OwpTreeGrid/OwpTreeGrid.js +170 -169
  14. package/dist/components/OwpTreeGrid/OwpTreeGrid.js.map +1 -1
  15. package/dist/components/OwpTreeGrid/internal/treeGridTheme.js +79 -76
  16. package/dist/components/OwpTreeGrid/internal/treeGridTheme.js.map +1 -1
  17. package/dist/configs/defaultConfig.js +110 -70
  18. package/dist/configs/defaultConfig.js.map +1 -1
  19. package/dist/constants/tableTheme.js +7 -6
  20. package/dist/constants/tableTheme.js.map +1 -1
  21. package/dist/features/themePreview/components/ThemePreviewCanvas.js +275 -273
  22. package/dist/features/themePreview/components/ThemePreviewCanvas.js.map +1 -1
  23. package/dist/features/themePreview/components/ThemePreviewCanvasSections.js +552 -316
  24. package/dist/features/themePreview/components/ThemePreviewCanvasSections.js.map +1 -1
  25. package/dist/features/themePreview/components/ThemePreviewColorField.js +227 -201
  26. package/dist/features/themePreview/components/ThemePreviewColorField.js.map +1 -1
  27. package/dist/features/themePreview/components/ThemePreviewControls.js +176 -160
  28. package/dist/features/themePreview/components/ThemePreviewControls.js.map +1 -1
  29. package/dist/features/themePreview/components/themePreviewCanvas.shared.js +38 -38
  30. package/dist/features/themePreview/components/themePreviewCanvas.shared.js.map +1 -1
  31. package/dist/features/themePreview/configs/settings.js +33 -20
  32. package/dist/features/themePreview/configs/settings.js.map +1 -1
  33. package/dist/features/themePreview/dialogs/ThemePreviewDialog.js +227 -220
  34. package/dist/features/themePreview/dialogs/ThemePreviewDialog.js.map +1 -1
  35. package/dist/features/themePreview/hooks/useThemePreview.js +213 -204
  36. package/dist/features/themePreview/hooks/useThemePreview.js.map +1 -1
  37. package/dist/features/themePreview/utils/themePreviewDefinitions.js +63 -30
  38. package/dist/features/themePreview/utils/themePreviewDefinitions.js.map +1 -1
  39. package/dist/layout/components/navbar/NavbarToggleButton.js +46 -42
  40. package/dist/layout/components/navbar/NavbarToggleButton.js.map +1 -1
  41. package/dist/layout/components/toggles/NavigationSearchToggle.js +3 -3
  42. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/constants.js +1 -1
  43. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/constants.js +1 -1
  44. package/dist/node_modules/.pnpm/react-overlays@5.2.1_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-overlays/esm/Portal.js +1 -1
  45. package/dist/owp-app.css +1 -1
  46. package/dist/types/components/OwpTable/OwpFieldTable.d.ts +7 -3
  47. package/dist/types/components/OwpTable/OwpTable.d.ts +3 -1
  48. package/dist/types/components/OwpTable/internal/FieldTableValue.d.ts +17 -0
  49. package/dist/types/components/OwpTable/internal/defaultTableStyle.d.ts +3 -0
  50. package/dist/types/components/OwpTreeGrid/OwpTreeGrid.d.ts +3 -1
  51. package/dist/types/components/OwpTreeGrid/internal/treeGridTheme.d.ts +1 -1
  52. package/dist/types/configs/defaultConfig.d.ts +42 -3
  53. package/dist/types/constants/tableTheme.d.ts +1 -0
  54. package/dist/types/features/themePreview/components/ThemePreviewCanvasSections.d.ts +8 -0
  55. package/dist/types/features/themePreview/components/themePreviewCanvas.shared.d.ts +3 -3
  56. package/dist/types/features/themePreview/configs/settings.d.ts +12 -0
  57. package/dist/types/index.d.ts +1 -0
  58. package/dist/types/types/OwpMuiThemeTypes.d.ts +9 -0
  59. package/dist/types/types/OwpTableThemeTypes.d.ts +1 -0
  60. package/dist/types/types/index.d.ts +1 -0
  61. package/package.json +1 -1
@@ -1,16 +1,16 @@
1
- var J = Object.defineProperty;
2
- var l = (t, e) => J(t, "name", { value: e, configurable: !0 });
3
- import { jsx as o, jsxs as c, Fragment as Q } from "../../../node_modules/.pnpm/@emotion_react@11.14.0_@types_react@19.2.14_react@19.2.4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
4
- import { IconButton as X, Typography as v, InputAdornment as Z, MenuItem as ee, TextField as L, Box as h, Divider as re, Popover as te, Button as le } from "@mui/material";
5
- import oe from "../../../node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/RestartAltOutlined.js";
6
- import { blue as ne, lightBlue as ae, cyan as ie, teal as ue, green as ce, amber as se, orange as pe, deepOrange as de, red as me, pink as he, purple as fe, deepPurple as xe, indigo as ge, grey as be, blueGrey as Pe } from "@mui/material/colors";
7
- import { useState as x, useRef as ve, useEffect as w } from "react";
8
- import { getThemePreviewPaletteValue as we } from "../utils/themePreviewSettings.js";
9
- import { getColorAlphaValue as ye, toColorPickerValue as z, applyColorPickerValue as N } from "../utils/color.js";
10
- const ke = {
1
+ var oe = Object.defineProperty;
2
+ var l = (t, e) => oe(t, "name", { value: e, configurable: !0 });
3
+ import { jsx as n, jsxs as d, Fragment as ae } from "../../../node_modules/.pnpm/@emotion_react@11.14.0_@types_react@19.2.14_react@19.2.4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
4
+ import { IconButton as ie, Typography as k, InputAdornment as ue, MenuItem as ce, TextField as Q, Box as g, Divider as se, Popover as pe, Button as de } from "@mui/material";
5
+ import me from "../../../node_modules/.pnpm/@mui_icons-material@7.3.9_@mui_material@7.3.9_@emotion_react@11.14.0_@types_react@19.2._dc2be6bc014bebdac88a574e3e02c144/node_modules/@mui/icons-material/esm/RestartAltOutlined.js";
6
+ import { blue as he, lightBlue as fe, cyan as xe, teal as ge, green as we, amber as be, orange as ve, deepOrange as Pe, red as ye, pink as Ce, purple as ke, deepPurple as Te, indigo as Ve, grey as Ie, blueGrey as Ee } from "@mui/material/colors";
7
+ import { useState as w, useRef as T, useEffect as b } from "react";
8
+ import { getThemePreviewPaletteValue as Ae } from "../utils/themePreviewSettings.js";
9
+ import { getColorAlphaValue as Me, toColorPickerValue as V, applyColorPickerValue as X } from "../utils/color.js";
10
+ const Be = {
11
11
  "px-number": "px",
12
12
  "rem-number": "rem"
13
- }, Ce = [
13
+ }, Re = [
14
14
  "50",
15
15
  "100",
16
16
  "200",
@@ -25,93 +25,113 @@ const ke = {
25
25
  "A200",
26
26
  "A400",
27
27
  "A700"
28
- ], Te = [
29
- ["Blue", ne],
30
- ["Light Blue", ae],
31
- ["Cyan", ie],
32
- ["Teal", ue],
33
- ["Green", ce],
34
- ["Amber", se],
35
- ["Orange", pe],
36
- ["Deep Orange", de],
37
- ["Red", me],
38
- ["Pink", he],
39
- ["Purple", fe],
40
- ["Deep Purple", xe],
41
- ["Indigo", ge],
42
- ["Grey", be],
43
- ["Blue Grey", Pe]
44
- ], Ie = Te.map(([t, e]) => ({
28
+ ], ze = [
29
+ ["Blue", he],
30
+ ["Light Blue", fe],
31
+ ["Cyan", xe],
32
+ ["Teal", ge],
33
+ ["Green", we],
34
+ ["Amber", be],
35
+ ["Orange", ve],
36
+ ["Deep Orange", Pe],
37
+ ["Red", ye],
38
+ ["Pink", Ce],
39
+ ["Purple", ke],
40
+ ["Deep Purple", Te],
41
+ ["Indigo", Ve],
42
+ ["Grey", Ie],
43
+ ["Blue Grey", Ee]
44
+ ], re = ze.map(([t, e]) => ({
45
45
  label: t,
46
- colors: Ce.reduce((n, s) => {
47
- const m = e[s];
48
- return m && n.push({
49
- key: `${t}-${s}`,
50
- shade: s,
51
- value: m
52
- }), n;
46
+ colors: Re.reduce((o, m) => {
47
+ const f = e[m];
48
+ return f && o.push({
49
+ key: `${t}-${m}`,
50
+ shade: m,
51
+ value: f
52
+ }), o;
53
53
  }, [])
54
- })), Ee = 500, G = 32, j = 20;
55
- function Ve(t, e) {
54
+ })), De = new Set(
55
+ re.flatMap(
56
+ (t) => t.colors.map((e) => e.value.toLowerCase())
57
+ )
58
+ ), Se = 500, Z = 32, ee = 20;
59
+ function _e(t, e) {
56
60
  return t.replace(new RegExp(`${e}$`, "i"), "");
57
61
  }
58
- l(Ve, "getUnitInputDisplayValue");
59
- function K(t) {
60
- const e = t.replace(/[^0-9.,]/g, "").replace(/,/g, "."), n = e.indexOf(".");
61
- if (n < 0)
62
+ l(_e, "getUnitInputDisplayValue");
63
+ function te(t) {
64
+ const e = t.replace(/[^0-9.,]/g, "").replace(/,/g, "."), o = e.indexOf(".");
65
+ if (o < 0)
62
66
  return e;
63
- const s = e.slice(0, n), m = e.slice(n + 1).replace(/\./g, "");
64
- return `${s}.${m}`;
67
+ const m = e.slice(0, o), f = e.slice(o + 1).replace(/\./g, "");
68
+ return `${m}.${f}`;
65
69
  }
66
- l(K, "normalizeUnitInputDisplayValue");
67
- function Ae(t) {
68
- const e = K(t);
70
+ l(te, "normalizeUnitInputDisplayValue");
71
+ function We(t) {
72
+ const e = te(t);
69
73
  return !e || e === "." ? "" : e.startsWith(".") ? `0${e}` : e.endsWith(".") ? e.slice(0, -1) : e;
70
74
  }
71
- l(Ae, "normalizeCommittedUnitInputDisplayValue");
72
- function Be(t, e) {
73
- const n = Ae(t);
74
- return n ? `${n}${e}` : "";
75
+ l(We, "normalizeCommittedUnitInputDisplayValue");
76
+ function Oe(t, e) {
77
+ const o = We(t);
78
+ return o ? `${o}${e}` : "";
75
79
  }
76
- l(Be, "normalizeUnitInputValue");
77
- function ze(t) {
78
- return (t ? ke[t] : null) ?? null;
80
+ l(Oe, "normalizeUnitInputValue");
81
+ function $e(t) {
82
+ return (t ? Be[t] : null) ?? null;
79
83
  }
80
- l(ze, "getUnitValueFormat");
81
- function $e({
84
+ l($e, "getUnitValueFormat");
85
+ function qe({
82
86
  disabled: t = !1,
83
87
  definition: e,
84
- resetVersion: n,
85
- sectionKey: s,
86
- settings: m,
87
- onChange: g,
88
- onReset: y
88
+ resetVersion: o,
89
+ sectionKey: m,
90
+ settings: f,
91
+ onChange: v,
92
+ onReset: I
89
93
  }) {
90
- var F, U;
91
- const [D, k] = x(null), i = we(m, s, e.path), u = ze(e.valueFormat), M = e.showColorPicker !== !1, R = e.allowAlpha ? ye(i) : null, _ = [e.description];
92
- e.allowAlpha && _.push(
93
- R ? `알파값은 ${R}로 고정되고 색상만 변경됩니다. Pick 또는 MUI로 색상만 변경할 수 있습니다.` : "알파값은 고정되고 색상만 변경됩니다. Pick 또는 MUI로 색상만 변경할 수 있습니다."
94
+ var Y, J;
95
+ const [P, E] = w(null), W = T(null), a = Ae(f, m, e.path), c = $e(e.valueFormat), O = e.showColorPicker !== !1, $ = e.allowAlpha ? Me(a) : null, F = [e.description];
96
+ e.allowAlpha && F.push(
97
+ $ ? `알파값은 ${$}로 고정되고 색상만 변경됩니다. Pick 또는 MUI로 색상만 변경할 수 있습니다.` : "알파값은 고정되고 색상만 변경됩니다. Pick 또는 MUI로 색상만 변경할 수 있습니다."
94
98
  );
95
- const Y = _.filter(Boolean).join(" "), C = !!((F = e.options) != null && F.length), T = !!(e.allowAlpha && M && !C && !u), f = u ? Ve(i, u) : i, q = M, p = !C && !T, [I, E] = x(f), [W, b] = x(!1), [O, V] = x(z(i)), [A, B] = x(!1), a = ve(null);
96
- w(() => {
97
- !p || W || E(f);
98
- }, [p, f, W]), w(() => {
99
- A || V(z(i));
100
- }, [A, i]), w(() => () => {
101
- a.current && window.clearTimeout(a.current);
102
- }, []), w(() => {
103
- typeof n > "u" || (a.current && (window.clearTimeout(a.current), a.current = null), E(f), b(!1), V(z(i)), B(!1));
104
- }, [n]);
105
- const H = /* @__PURE__ */ l((r) => {
106
- g(
99
+ const le = F.filter(Boolean).join(" "), A = !!((Y = e.options) != null && Y.length), M = !!(e.allowAlpha && O && !A && !c), x = c ? _e(a, c) : a, H = O, B = H ? V(a).toLowerCase() : null, y = B && De.has(B) ? B : null, h = !A && !M, [R, z] = w(x), [L, C] = w(!1), [U, D] = w(V(a)), [S, _] = w(!1), i = T(null), N = T(x), G = T(a);
100
+ N.current = x, G.current = a, b(() => {
101
+ !h || L || z(x);
102
+ }, [h, x, L]), b(() => {
103
+ S || D(V(a));
104
+ }, [S, a]), b(() => () => {
105
+ i.current && window.clearTimeout(i.current);
106
+ }, []), b(() => {
107
+ if (!P || !y)
108
+ return;
109
+ const r = window.requestAnimationFrame(() => {
110
+ var s;
111
+ const u = (s = W.current) == null ? void 0 : s.querySelector(
112
+ `[data-mui-palette-value="${y}"]`
113
+ );
114
+ u == null || u.scrollIntoView({
115
+ block: "center",
116
+ inline: "nearest"
117
+ });
118
+ });
119
+ return () => {
120
+ window.cancelAnimationFrame(r);
121
+ };
122
+ }, [y, P]), b(() => {
123
+ typeof o > "u" || (i.current && (window.clearTimeout(i.current), i.current = null), z(N.current), C(!1), D(V(G.current)), _(!1));
124
+ }, [o]);
125
+ const j = /* @__PURE__ */ l((r) => {
126
+ v(
107
127
  e.path,
108
- u ? Be(r, u) : r
128
+ c ? Oe(r, c) : r
109
129
  );
110
- }, "commitBufferedTextValue"), S = /* @__PURE__ */ l((r) => {
111
- a.current && (window.clearTimeout(a.current), a.current = null), B(!1), g(e.path, N(i, r));
112
- }, "commitBufferedPickerValue"), $ = y || u ? /* @__PURE__ */ o(Z, { position: "end", children: /* @__PURE__ */ c("div", { className: "flex items-center gap-6 pr-2", children: [
113
- y ? /* @__PURE__ */ o(
114
- X,
130
+ }, "commitBufferedTextValue"), K = /* @__PURE__ */ l((r) => {
131
+ i.current && (window.clearTimeout(i.current), i.current = null), _(!1), v(e.path, X(a, r));
132
+ }, "commitBufferedPickerValue"), q = I || c ? /* @__PURE__ */ n(ue, { position: "end", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-6 pr-2", children: [
133
+ I ? /* @__PURE__ */ n(
134
+ ie,
115
135
  {
116
136
  size: "small",
117
137
  "aria-label": `${e.label} reset`,
@@ -120,7 +140,7 @@ function $e({
120
140
  r.preventDefault();
121
141
  }, "onMouseDown"),
122
142
  onClick: /* @__PURE__ */ l(() => {
123
- y(e.path);
143
+ I(e.path);
124
144
  }, "onClick"),
125
145
  sx: {
126
146
  border: "1px solid #cbd5e1",
@@ -128,62 +148,62 @@ function $e({
128
148
  color: "#6b7280",
129
149
  p: 0.25
130
150
  },
131
- children: /* @__PURE__ */ o(oe, { sx: { fontSize: 16 } })
151
+ children: /* @__PURE__ */ n(me, { sx: { fontSize: 16 } })
132
152
  }
133
153
  ) : null,
134
- u ? /* @__PURE__ */ o(v, { variant: "body2", sx: { whiteSpace: "nowrap" }, children: u }) : null
154
+ c ? /* @__PURE__ */ n(k, { variant: "body2", sx: { whiteSpace: "nowrap" }, children: c }) : null
135
155
  ] }) }) : void 0;
136
- return /* @__PURE__ */ c("div", { className: "grid grid-cols-[minmax(0,1fr)_144px] items-start gap-12", children: [
137
- /* @__PURE__ */ o(
138
- L,
156
+ return /* @__PURE__ */ d("div", { className: "grid grid-cols-[minmax(0,1fr)_144px] items-start gap-12", children: [
157
+ /* @__PURE__ */ n(
158
+ Q,
139
159
  {
140
- select: C,
160
+ select: A,
141
161
  label: e.label,
142
162
  size: "small",
143
- value: p ? I : f,
163
+ value: h ? R : x,
144
164
  disabled: t,
145
165
  onChange: /* @__PURE__ */ l((r) => {
146
- if (T)
166
+ if (M)
147
167
  return;
148
- const d = u ? K(r.target.value) : r.target.value;
149
- if (p) {
150
- E(d);
168
+ const u = c ? te(r.target.value) : r.target.value;
169
+ if (h) {
170
+ z(u);
151
171
  return;
152
172
  }
153
- g(e.path, d);
173
+ v(e.path, u);
154
174
  }, "onChange"),
155
175
  onFocus: /* @__PURE__ */ l(() => {
156
- p && b(!0);
176
+ h && C(!0);
157
177
  }, "onFocus"),
158
178
  onBlur: /* @__PURE__ */ l(() => {
159
- p && (b(!1), H(I));
179
+ h && (C(!1), j(R));
160
180
  }, "onBlur"),
161
181
  onKeyDown: /* @__PURE__ */ l((r) => {
162
- !p || r.key !== "Enter" || (r.preventDefault(), b(!1), H(I), r.currentTarget.blur());
182
+ !h || r.key !== "Enter" || (r.preventDefault(), C(!1), j(R), r.currentTarget.blur());
163
183
  }, "onKeyDown"),
164
- helperText: Y,
184
+ helperText: le,
165
185
  slotProps: {
166
186
  htmlInput: {
167
- ...u ? {
187
+ ...c ? {
168
188
  inputMode: "decimal"
169
189
  } : {},
170
- ...T ? {
190
+ ...M ? {
171
191
  readOnly: !0
172
192
  } : {}
173
193
  },
174
194
  input: {
175
- ...$ ? {
176
- endAdornment: $
195
+ ...q ? {
196
+ endAdornment: q
177
197
  } : {}
178
198
  }
179
199
  },
180
- children: (U = e.options) == null ? void 0 : U.map((r) => /* @__PURE__ */ o(ee, { value: r.value, children: r.label }, r.value))
200
+ children: (J = e.options) == null ? void 0 : J.map((r) => /* @__PURE__ */ n(ce, { value: r.value, children: r.label }, r.value))
181
201
  }
182
202
  ),
183
- q ? /* @__PURE__ */ c("div", { className: "grid grid-cols-2 gap-6", children: [
184
- /* @__PURE__ */ c(Q, { children: [
185
- /* @__PURE__ */ o(
186
- le,
203
+ H ? /* @__PURE__ */ d("div", { className: "grid grid-cols-2 gap-6", children: [
204
+ /* @__PURE__ */ d(ae, { children: [
205
+ /* @__PURE__ */ n(
206
+ de,
187
207
  {
188
208
  size: "small",
189
209
  fullWidth: !0,
@@ -191,31 +211,31 @@ function $e({
191
211
  disabled: t,
192
212
  sx: {
193
213
  fontSize: "1.2rem",
194
- height: G,
214
+ height: Z,
195
215
  minWidth: 0
196
216
  },
197
217
  onClick: /* @__PURE__ */ l((r) => {
198
- k(r.currentTarget);
218
+ E(r.currentTarget);
199
219
  }, "onClick"),
200
220
  children: "MUI"
201
221
  }
202
222
  ),
203
- /* @__PURE__ */ o(
204
- L,
223
+ /* @__PURE__ */ n(
224
+ Q,
205
225
  {
206
226
  hiddenLabel: !0,
207
227
  type: "color",
208
228
  size: "small",
209
- value: O,
229
+ value: U,
210
230
  disabled: t,
211
231
  onChange: /* @__PURE__ */ l((r) => {
212
- const d = r.target.value;
213
- V(d), B(!0), a.current && window.clearTimeout(a.current), a.current = window.setTimeout(() => {
214
- S(d);
215
- }, Ee);
232
+ const u = r.target.value;
233
+ D(u), _(!0), i.current && window.clearTimeout(i.current), i.current = window.setTimeout(() => {
234
+ K(u);
235
+ }, Se);
216
236
  }, "onChange"),
217
237
  onBlur: /* @__PURE__ */ l(() => {
218
- A && S(O);
238
+ S && K(U);
219
239
  }, "onBlur"),
220
240
  slotProps: {
221
241
  htmlInput: {
@@ -224,7 +244,7 @@ function $e({
224
244
  },
225
245
  sx: {
226
246
  "& .MuiOutlinedInput-root": {
227
- height: G,
247
+ height: Z,
228
248
  px: 0.5
229
249
  },
230
250
  '& input[type="color"]': {
@@ -234,8 +254,8 @@ function $e({
234
254
  border: 0,
235
255
  borderRadius: 0,
236
256
  display: "block",
237
- height: j,
238
- minHeight: j,
257
+ height: ee,
258
+ minHeight: ee,
239
259
  overflow: "hidden",
240
260
  padding: 0,
241
261
  p: 0,
@@ -256,14 +276,14 @@ function $e({
256
276
  }
257
277
  }
258
278
  ),
259
- D ? /* @__PURE__ */ o(
260
- te,
279
+ P ? /* @__PURE__ */ n(
280
+ pe,
261
281
  {
262
282
  open: !0,
263
- anchorEl: D,
283
+ anchorEl: P,
264
284
  transitionDuration: 0,
265
285
  onClose: /* @__PURE__ */ l(() => {
266
- k(null);
286
+ E(null);
267
287
  }, "onClose"),
268
288
  anchorOrigin: {
269
289
  vertical: "bottom",
@@ -285,10 +305,10 @@ function $e({
285
305
  }
286
306
  }
287
307
  },
288
- children: /* @__PURE__ */ o("div", { className: "flex min-w-0 flex-col gap-10", children: Ie.map((r, d) => /* @__PURE__ */ c(h, { className: "flex flex-col gap-10", children: [
289
- d > 0 ? /* @__PURE__ */ o(re, { flexItem: !0 }) : null,
290
- /* @__PURE__ */ c(
291
- h,
308
+ children: /* @__PURE__ */ n("div", { ref: W, className: "flex min-w-0 flex-col gap-10", children: re.map((r, u) => /* @__PURE__ */ d(g, { className: "flex flex-col gap-10", children: [
309
+ u > 0 ? /* @__PURE__ */ n(se, { flexItem: !0 }) : null,
310
+ /* @__PURE__ */ d(
311
+ g,
292
312
  {
293
313
  sx: {
294
314
  display: "grid",
@@ -299,9 +319,9 @@ function $e({
299
319
  }
300
320
  },
301
321
  children: [
302
- /* @__PURE__ */ o(v, { variant: "caption", color: "text.secondary", children: r.label }),
303
- /* @__PURE__ */ o(
304
- h,
322
+ /* @__PURE__ */ n(k, { variant: "caption", color: "text.secondary", children: r.label }),
323
+ /* @__PURE__ */ n(
324
+ g,
305
325
  {
306
326
  sx: {
307
327
  display: "grid",
@@ -309,68 +329,74 @@ function $e({
309
329
  gridTemplateColumns: "repeat(auto-fit, minmax(68px, 1fr))",
310
330
  minWidth: 0
311
331
  },
312
- children: r.colors.map((P) => /* @__PURE__ */ c(
313
- h,
314
- {
315
- component: "button",
316
- type: "button",
317
- onClick: /* @__PURE__ */ l(() => {
318
- g(
319
- e.path,
320
- N(i, P.value)
321
- ), k(null);
322
- }, "onClick"),
323
- sx: {
324
- alignItems: "center",
325
- backgroundColor: "background.paper",
326
- border: "1px solid",
327
- borderColor: "divider",
328
- borderRadius: 1,
329
- color: "text.secondary",
330
- cursor: "pointer",
331
- display: "flex",
332
- flexDirection: "column",
333
- gap: 0.5,
334
- justifyContent: "center",
335
- minWidth: 0,
336
- p: 0.5,
337
- transition: "background-color 120ms ease, border-color 120ms ease",
338
- width: "100%",
339
- "&:hover": {
340
- backgroundColor: "action.hover",
341
- borderColor: "text.secondary"
342
- }
343
- },
344
- children: [
345
- /* @__PURE__ */ o(
346
- h,
347
- {
348
- sx: {
349
- width: 30,
350
- height: 30,
351
- borderRadius: 1,
352
- backgroundColor: P.value,
353
- border: "1px solid",
354
- borderColor: "divider"
355
- }
356
- }
357
- ),
358
- /* @__PURE__ */ o(
359
- h,
360
- {
361
- component: "span",
362
- sx: {
363
- fontSize: "0.75rem",
364
- fontWeight: 600,
365
- lineHeight: 1
366
- },
367
- children: P.shade
332
+ children: r.colors.map((s) => {
333
+ const p = y === s.value.toLowerCase();
334
+ return /* @__PURE__ */ d(
335
+ g,
336
+ {
337
+ component: "button",
338
+ type: "button",
339
+ "data-mui-palette-value": s.value.toLowerCase(),
340
+ "aria-current": p ? "true" : void 0,
341
+ onClick: /* @__PURE__ */ l(() => {
342
+ v(
343
+ e.path,
344
+ X(a, s.value)
345
+ ), E(null);
346
+ }, "onClick"),
347
+ sx: {
348
+ alignItems: "center",
349
+ backgroundColor: p ? "action.selected" : "background.paper",
350
+ border: "1px solid",
351
+ borderColor: p ? "primary.main" : "divider",
352
+ borderRadius: 1,
353
+ boxShadow: p ? (ne) => `0 0 0 1px ${ne.palette.primary.main}` : "none",
354
+ color: p ? "text.primary" : "text.secondary",
355
+ cursor: "pointer",
356
+ display: "flex",
357
+ flexDirection: "column",
358
+ gap: 0.5,
359
+ justifyContent: "center",
360
+ minWidth: 0,
361
+ p: 0.5,
362
+ transition: "background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease",
363
+ width: "100%",
364
+ "&:hover": {
365
+ backgroundColor: "action.hover",
366
+ borderColor: p ? "primary.main" : "text.secondary"
368
367
  }
369
- )
370
- ]
371
- },
372
- P.key
373
- ))
368
+ },
369
+ children: [
370
+ /* @__PURE__ */ n(
371
+ g,
372
+ {
373
+ sx: {
374
+ width: 30,
375
+ height: 30,
376
+ borderRadius: 1,
377
+ backgroundColor: s.value,
378
+ border: "1px solid",
379
+ borderColor: p ? "primary.main" : "divider"
380
+ }
381
+ }
382
+ ),
383
+ /* @__PURE__ */ n(
384
+ g,
385
+ {
386
+ component: "span",
387
+ sx: {
388
+ fontSize: "0.75rem",
389
+ fontWeight: p ? 700 : 600,
390
+ lineHeight: 1
391
+ },
392
+ children: s.shade
393
+ }
394
+ )
395
+ ]
396
+ },
397
+ s.key
398
+ );
399
+ })
374
400
  }
375
401
  )
376
402
  ]
@@ -380,23 +406,23 @@ function $e({
380
406
  }
381
407
  ) : null
382
408
  ] }),
383
- e.allowAlpha ? /* @__PURE__ */ c("div", { className: "col-span-2 flex flex-col gap-2", children: [
384
- /* @__PURE__ */ o(v, { variant: "caption", color: "text.secondary", children: "Current" }),
385
- /* @__PURE__ */ o(
386
- v,
409
+ e.allowAlpha ? /* @__PURE__ */ d("div", { className: "col-span-2 flex flex-col gap-2", children: [
410
+ /* @__PURE__ */ n(k, { variant: "caption", color: "text.secondary", children: "Current" }),
411
+ /* @__PURE__ */ n(
412
+ k,
387
413
  {
388
414
  variant: "caption",
389
415
  color: "text.secondary",
390
416
  className: "truncate whitespace-nowrap",
391
- children: i || "-"
417
+ children: a || "-"
392
418
  }
393
419
  )
394
420
  ] }) : null
395
- ] }) : /* @__PURE__ */ o("div", {})
421
+ ] }) : /* @__PURE__ */ n("div", {})
396
422
  ] });
397
423
  }
398
- l($e, "ThemePreviewColorField");
424
+ l(qe, "ThemePreviewColorField");
399
425
  export {
400
- $e as ThemePreviewColorField
426
+ qe as ThemePreviewColorField
401
427
  };
402
428
  //# sourceMappingURL=ThemePreviewColorField.js.map