@owp/core 2.5.8 → 2.5.10

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/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/OwpDialog/OwpDialog.js +67 -46
  6. package/dist/components/OwpDialog/OwpDialog.js.map +1 -1
  7. package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js +162 -153
  8. package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js.map +1 -1
  9. package/dist/components/OwpTable/OwpDataTable.js +297 -283
  10. package/dist/components/OwpTable/OwpDataTable.js.map +1 -1
  11. package/dist/components/OwpTable/OwpFieldTable.js +98 -86
  12. package/dist/components/OwpTable/OwpFieldTable.js.map +1 -1
  13. package/dist/components/OwpTable/OwpTable.js +145 -127
  14. package/dist/components/OwpTable/OwpTable.js.map +1 -1
  15. package/dist/components/OwpTable/internal/defaultTableStyle.js +21 -15
  16. package/dist/components/OwpTable/internal/defaultTableStyle.js.map +1 -1
  17. package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js +195 -147
  18. package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js.map +1 -1
  19. package/dist/constants/tableTheme.js.map +1 -1
  20. package/dist/features/themePreview/components/ThemePreviewCanvas.js +300 -263
  21. package/dist/features/themePreview/components/ThemePreviewCanvas.js.map +1 -1
  22. package/dist/features/themePreview/components/ThemePreviewCanvasSections.js +148 -141
  23. package/dist/features/themePreview/components/ThemePreviewCanvasSections.js.map +1 -1
  24. package/dist/features/themePreview/components/ThemePreviewColorField.js +168 -138
  25. package/dist/features/themePreview/components/ThemePreviewColorField.js.map +1 -1
  26. package/dist/features/themePreview/components/ThemePreviewControls.js +410 -218
  27. package/dist/features/themePreview/components/ThemePreviewControls.js.map +1 -1
  28. package/dist/features/themePreview/components/themePreviewCanvas.shared.js +145 -125
  29. package/dist/features/themePreview/components/themePreviewCanvas.shared.js.map +1 -1
  30. package/dist/features/themePreview/configs/table.js +4 -2
  31. package/dist/features/themePreview/configs/table.js.map +1 -1
  32. package/dist/features/themePreview/dialogs/ThemePreviewDialog.js +124 -118
  33. package/dist/features/themePreview/dialogs/ThemePreviewDialog.js.map +1 -1
  34. package/dist/features/themePreview/hooks/useThemePreview.js +275 -193
  35. package/dist/features/themePreview/hooks/useThemePreview.js.map +1 -1
  36. package/dist/features/themePreview/utils/themePreviewDefinitions.js +8 -0
  37. package/dist/features/themePreview/utils/themePreviewDefinitions.js.map +1 -1
  38. package/dist/features/themePreview/utils/themePreviewSettings.js +188 -151
  39. package/dist/features/themePreview/utils/themePreviewSettings.js.map +1 -1
  40. package/dist/features/themePreview.js +18 -17
  41. package/dist/layout/components/toggles/NavigationSearchToggle.js +3 -3
  42. package/dist/layout/components/toolbar/ToolbarLayout.js +36 -35
  43. package/dist/layout/components/toolbar/ToolbarLayout.js.map +1 -1
  44. package/dist/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 +9 -0
  45. package/dist/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.map +1 -0
  46. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/constants.js +1 -1
  47. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE93/constants.js +1 -1
  48. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/constants.js +1 -1
  49. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/constants.js +1 -1
  50. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js +1 -1
  51. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js +1 -1
  52. 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
  53. package/dist/owp-app.css +1 -1
  54. package/dist/types/components/OwpDialog/OwpDialog.d.ts +2 -0
  55. package/dist/types/components/OwpTable/OwpFieldTable.d.ts +3 -2
  56. package/dist/types/components/OwpTable/internal/defaultTableStyle.d.ts +2 -0
  57. package/dist/types/constants/tableTheme.d.ts +1 -0
  58. package/dist/types/features/themePreview/components/ThemePreviewColorField.d.ts +3 -1
  59. package/dist/types/features/themePreview/components/ThemePreviewControls.d.ts +4 -1
  60. package/dist/types/features/themePreview/configs/settings.d.ts +2 -0
  61. package/dist/types/features/themePreview/configs/table.d.ts +2 -0
  62. package/dist/types/features/themePreview/hooks/useThemePreview.d.ts +3 -0
  63. package/dist/types/features/themePreview/utils/index.d.ts +1 -1
  64. package/dist/types/features/themePreview/utils/themePreviewSettings.d.ts +11 -1
  65. package/dist/types/types/OwpTableThemeTypes.d.ts +8 -0
  66. package/package.json +1 -1
@@ -1,72 +1,75 @@
1
- var L = Object.defineProperty;
2
- var h = (e, a) => L(e, "name", { value: a, configurable: !0 });
3
- import { jsxs as p, jsx as o } 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 { ButtonBase as R, Typography as b, Paper as $, TextField as A, MenuItem as F, FormControlLabel as V, Checkbox as H, Divider as Y } from "@mui/material";
5
- import { useState as Z, useMemo as M } from "react";
6
- import { ThemePreviewColorField as U } from "./ThemePreviewColorField.js";
7
- import { getThemePreviewPresetOptionsByMode as q, THEME_PREVIEW_CUSTOM_PRESET_KEY as D, getThemePreviewPaletteValue as W, isThemePreviewCustomSection as J } from "../utils/themePreviewSettings.js";
8
- import { themePreviewFieldGroupsBySection as Q, themePreviewSectionOptions as _ } from "../utils/themePreviewDefinitions.js";
9
- import { deriveThemePreviewPaletteGroupValues as X } from "../utils/color.js";
10
- function O(e) {
11
- return e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (a) => a.toUpperCase());
1
+ var ie = Object.defineProperty;
2
+ var s = (r, d) => ie(r, "name", { value: d, configurable: !0 });
3
+ import { jsx as o, jsxs as u } 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 { MenuItem as W, ButtonBase as ae, Typography as x, Paper as A, TextField as Y, Divider as Z, Box as se, IconButton as de, FormControlLabel as ce, Checkbox as he } from "@mui/material";
5
+ import ue 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 { ThemeProvider as me, createTheme as fe } from "@mui/material/styles";
7
+ import { useState as pe, useMemo as T } from "react";
8
+ import { toolbarCuratedPresetKeys as be, designSystemPresetKeys as Ce } from "../configs/presets.js";
9
+ import { ThemePreviewColorField as q } from "./ThemePreviewColorField.js";
10
+ import { getThemePreviewPresetOptionsByMode as ve, THEME_PREVIEW_CUSTOM_PRESET_KEY as J, isThemePreviewCustomSection as ge, getThemePreviewPaletteValue as G } from "../utils/themePreviewSettings.js";
11
+ import { themePreviewFieldGroupsBySection as xe, themePreviewSectionOptions as X } from "../utils/themePreviewDefinitions.js";
12
+ import { deriveThemePreviewPaletteGroupValues as ye } from "../utils/color.js";
13
+ function Pe(r) {
14
+ return r.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (d) => d.toUpperCase());
12
15
  }
13
- h(O, "getThemePreviewFieldClusterLabel");
14
- function ee(e) {
15
- const a = e.find((u) => u.path.endsWith(".main")), m = e.find((u) => u.path.endsWith(".light")), s = e.find((u) => u.path.endsWith(".dark")), i = e.find((u) => u.path.endsWith(".contrastText"));
16
- return !a || !m && !s && !i ? null : {
17
- mainPath: a.path,
18
- lightPath: m == null ? void 0 : m.path,
19
- darkPath: s == null ? void 0 : s.path,
20
- contrastTextPath: i == null ? void 0 : i.path
16
+ s(Pe, "getThemePreviewFieldClusterLabel");
17
+ function ke(r) {
18
+ const d = r.find((f) => f.path.endsWith(".main")), p = r.find((f) => f.path.endsWith(".light")), m = r.find((f) => f.path.endsWith(".dark")), c = r.find((f) => f.path.endsWith(".contrastText"));
19
+ return !d || !p && !m && !c ? null : {
20
+ mainPath: d.path,
21
+ lightPath: p == null ? void 0 : p.path,
22
+ darkPath: m == null ? void 0 : m.path,
23
+ contrastTextPath: c == null ? void 0 : c.path
21
24
  };
22
25
  }
23
- h(ee, "getThemePreviewAutoDerivedFieldPaths");
24
- function re(e) {
25
- const a = e.reduce(
26
- (t, c) => {
27
- const n = c.path.split(".")[0] ?? "";
28
- return n && (t[n] || (t[n] = []), t[n].push(c)), t;
26
+ s(ke, "getThemePreviewAutoDerivedFieldPaths");
27
+ function we(r) {
28
+ const d = r.reduce(
29
+ (t, h) => {
30
+ const i = h.path.split(".")[0] ?? "";
31
+ return i && (t[i] || (t[i] = []), t[i].push(h)), t;
29
32
  },
30
33
  {}
31
- ), m = Object.fromEntries(
32
- Object.entries(a).map(([t, c]) => [
34
+ ), p = Object.fromEntries(
35
+ Object.entries(d).map(([t, h]) => [
33
36
  t,
34
- c.length
37
+ h.length
35
38
  ])
36
- ), s = new Set(
37
- Object.entries(m).filter(([, t]) => t > 1).map(([t]) => t)
38
- ), i = e.some(
39
- (t) => !s.has(t.path.split(".")[0] ?? "")
39
+ ), m = new Set(
40
+ Object.entries(p).filter(([, t]) => t > 1).map(([t]) => t)
41
+ ), c = r.some(
42
+ (t) => !m.has(t.path.split(".")[0] ?? "")
40
43
  );
41
- if (!(s.size > 1 || i))
42
- return e.map((t) => ({
44
+ if (!(m.size > 1 || c))
45
+ return r.map((t) => ({
43
46
  key: t.path,
44
47
  fields: [t]
45
48
  }));
46
- const C = /* @__PURE__ */ new Set();
47
- return e.reduce((t, c) => {
48
- const n = c.path.split(".")[0] ?? "";
49
- if (!s.has(n))
49
+ const F = /* @__PURE__ */ new Set();
50
+ return r.reduce((t, h) => {
51
+ const i = h.path.split(".")[0] ?? "";
52
+ if (!m.has(i))
50
53
  return t.push({
51
- key: c.path,
52
- fields: [c]
54
+ key: h.path,
55
+ fields: [h]
53
56
  }), t;
54
- if (C.has(n))
57
+ if (F.has(i))
55
58
  return t;
56
- C.add(n);
57
- const y = a[n] ?? [c];
59
+ F.add(i);
60
+ const M = d[i] ?? [h];
58
61
  return t.push({
59
- key: n,
60
- label: O(n),
61
- fields: y,
62
- autoDerivedFieldPaths: ee(y) ?? void 0
62
+ key: i,
63
+ label: Pe(i),
64
+ fields: M,
65
+ autoDerivedFieldPaths: ke(M) ?? void 0
63
66
  }), t;
64
67
  }, []);
65
68
  }
66
- h(re, "getThemePreviewFieldClusters");
67
- const te = Object.fromEntries(
68
- _.map((e) => [e.key, e])
69
- ), x = {
69
+ s(we, "getThemePreviewFieldClusters");
70
+ const Te = Object.fromEntries(
71
+ X.map((r) => [r.key, r])
72
+ ), v = {
70
73
  active: {
71
74
  backgroundColor: "#1ea3e6",
72
75
  borderColor: "#1591cf",
@@ -79,228 +82,417 @@ const te = Object.fromEntries(
79
82
  descriptionColor: "#6b7280",
80
83
  textColor: "#111827"
81
84
  }
82
- }, K = "#d8dee8", oe = "#d1d7e0", le = "#f8fafc", ne = "#ffffff", ae = "#111827";
83
- function pe({
84
- activeSection: e,
85
- presetOptions: a,
86
- selectedMode: m,
87
- selectedPresetKey: s,
88
- settings: i,
89
- onSectionChange: u,
90
- onPaletteValueChange: C,
91
- onPaletteValuesChange: t,
92
- onPresetKeyChange: c,
93
- onPresetModeChange: n
85
+ }, B = "#d8dee8", Be = "#d1d7e0", Fe = "#f8fafc", D = "#ffffff", y = "#111827", g = "#6b7280", O = "#ffffff", ee = "#cbd5e1", Me = "#94a3b8", z = "#1ea3e6", Q = "#111827", Se = "#f8fafc", Ne = "#f8fafc", Ie = fe({
86
+ palette: {
87
+ mode: "light",
88
+ background: {
89
+ default: D,
90
+ paper: D
91
+ },
92
+ divider: B,
93
+ primary: {
94
+ main: z
95
+ },
96
+ secondary: {
97
+ main: z
98
+ },
99
+ text: {
100
+ primary: y,
101
+ secondary: g
102
+ }
103
+ },
104
+ typography: {
105
+ htmlFontSize: 10,
106
+ fontSize: 13,
107
+ body1: {
108
+ fontSize: "1.3rem"
109
+ },
110
+ body2: {
111
+ fontSize: "1.3rem"
112
+ }
113
+ }
114
+ }), Ee = {
115
+ color: y,
116
+ "& .MuiFormHelperText-root": {
117
+ color: g
118
+ },
119
+ "& .MuiInputAdornment-root": {
120
+ color: g
121
+ },
122
+ "& .MuiInputLabel-root": {
123
+ color: g
124
+ },
125
+ "& .MuiInputLabel-root.Mui-focused": {
126
+ color: y
127
+ },
128
+ "& .MuiInputBase-input": {
129
+ color: y
130
+ },
131
+ "& .MuiOutlinedInput-root": {
132
+ backgroundColor: O,
133
+ color: y,
134
+ "& fieldset": {
135
+ borderColor: ee
136
+ },
137
+ "&:hover fieldset": {
138
+ borderColor: Me
139
+ },
140
+ "&.Mui-focused fieldset": {
141
+ borderColor: z,
142
+ borderWidth: 1
143
+ }
144
+ },
145
+ "& .MuiSelect-icon": {
146
+ color: g
147
+ },
148
+ "& .MuiButton-outlined": {
149
+ backgroundColor: O,
150
+ borderColor: Q,
151
+ color: y,
152
+ "&:hover": {
153
+ backgroundColor: Se,
154
+ borderColor: Q
155
+ }
156
+ },
157
+ "& .MuiCheckbox-root": {
158
+ color: g
159
+ },
160
+ "& .MuiCheckbox-root.Mui-checked": {
161
+ color: z
162
+ },
163
+ "& .MuiDivider-root": {
164
+ borderColor: B
165
+ }
166
+ }, We = /* @__PURE__ */ new Set([
167
+ ...be,
168
+ ...Ce
169
+ ]), V = /* @__PURE__ */ new Set(["tableFieldHeader", "tableFieldCell"]);
170
+ function _e({
171
+ activeSection: r,
172
+ presetOptions: d,
173
+ selectedMode: p,
174
+ selectedPresetKey: m,
175
+ settings: c,
176
+ resetVersion: f,
177
+ onSectionChange: F,
178
+ onPaletteValueChange: t,
179
+ onPaletteValuesChange: h,
180
+ onPaletteValueReset: i,
181
+ onPaletteValuesReset: M,
182
+ onPresetKeyChange: re,
183
+ onPresetModeChange: oe
94
184
  }) {
95
- const [y, z] = Z({}), w = !J(e), v = w ? e : null, I = M(
96
- () => w && v ? q(a, v, m) : [],
97
- [w, a, v, m]
98
- ), j = Q[e], G = M(
99
- () => j.map((r) => ({
100
- ...r,
101
- fieldClusters: re(r.fields)
185
+ const [te, le] = pe({}), S = !ge(r), b = S ? r : null, N = T(
186
+ () => S && b ? ve(d, b, p) : [],
187
+ [S, d, b, p]
188
+ ), R = T(
189
+ () => {
190
+ var e;
191
+ return (e = N.find(
192
+ (l) => !We.has(l.key)
193
+ )) == null ? void 0 : e.key;
194
+ },
195
+ [N]
196
+ ), H = xe[r], I = T(
197
+ () => H.map((e) => ({
198
+ ...e,
199
+ fieldClusters: we(e.fields)
102
200
  })),
103
- [j]
104
- ), N = te[e], S = /* @__PURE__ */ h((r, l, T) => {
105
- const P = W(i, r, "common.white") || "#FFFFFF", d = W(i, r, "common.black") || "#111827", g = X(T, {
201
+ [H]
202
+ ), L = T(() => {
203
+ if (r !== "table")
204
+ return [
205
+ {
206
+ key: r,
207
+ fieldGroups: I
208
+ }
209
+ ];
210
+ const e = I.filter(
211
+ (n) => V.has(n.key)
212
+ ), l = I.filter(
213
+ (n) => !V.has(n.key)
214
+ );
215
+ return [
216
+ {
217
+ key: "table-field",
218
+ label: "Field Table",
219
+ fieldGroups: e
220
+ },
221
+ {
222
+ key: "table-base",
223
+ label: "Table",
224
+ fieldGroups: l
225
+ }
226
+ ].filter((n) => n.fieldGroups.length > 0);
227
+ }, [r, I]), j = Te[r], ne = T(
228
+ () => N.flatMap((e) => {
229
+ const l = [];
230
+ return e.key === R && l.push(
231
+ /* @__PURE__ */ o(
232
+ Z,
233
+ {
234
+ component: "li",
235
+ role: "presentation",
236
+ textAlign: "center",
237
+ sx: {
238
+ color: g,
239
+ fontSize: "1.2rem",
240
+ my: 0.5
241
+ },
242
+ children: "legacy"
243
+ },
244
+ "preset-legacy-divider"
245
+ )
246
+ ), l.push(
247
+ /* @__PURE__ */ o(W, { value: e.key, children: e.label }, e.key)
248
+ ), l;
249
+ }),
250
+ [R, N]
251
+ ), U = /* @__PURE__ */ s((e, l, n) => {
252
+ const P = G(c, e, "common.white") || "#FFFFFF", k = G(c, e, "common.black") || "#111827", a = ye(n, {
106
253
  whiteTextColor: P,
107
- blackTextColor: d
254
+ blackTextColor: k
108
255
  });
109
- return g ? [
110
- l.lightPath ? { path: l.lightPath, value: g.light } : null,
111
- l.darkPath ? { path: l.darkPath, value: g.dark } : null,
112
- l.contrastTextPath ? { path: l.contrastTextPath, value: g.contrastText } : null
113
- ].filter((f) => !!f) : [];
114
- }, "getAutoDerivedUpdates");
115
- return /* @__PURE__ */ p("div", { className: "flex h-full min-h-0 flex-col gap-16", children: [
116
- /* @__PURE__ */ o("div", { className: "grid grid-cols-2 gap-12", children: _.map((r) => {
117
- const l = r.key === e;
256
+ return a ? [
257
+ l.lightPath ? { path: l.lightPath, value: a.light } : null,
258
+ l.darkPath ? { path: l.darkPath, value: a.dark } : null,
259
+ l.contrastTextPath ? { path: l.contrastTextPath, value: a.contrastText } : null
260
+ ].filter((K) => !!K) : [];
261
+ }, "getAutoDerivedUpdates"), _ = /* @__PURE__ */ s((e) => {
262
+ const l = e.fieldClusters.flatMap(
263
+ (n) => n.fields.map((P) => P.path)
264
+ );
265
+ return /* @__PURE__ */ u("div", { className: "flex flex-col gap-12", children: [
266
+ e.label ? /* @__PURE__ */ u("div", { className: "flex items-center justify-between gap-8", children: [
267
+ /* @__PURE__ */ o(x, { variant: "subtitle1", fontWeight: 700, children: e.label }),
268
+ /* @__PURE__ */ o(
269
+ de,
270
+ {
271
+ size: "small",
272
+ "aria-label": `${e.label} reset`,
273
+ onClick: /* @__PURE__ */ s(() => {
274
+ M(l);
275
+ }, "onClick"),
276
+ sx: {
277
+ border: `1px solid ${ee}`,
278
+ borderRadius: 1,
279
+ color: g,
280
+ p: 0.5
281
+ },
282
+ children: /* @__PURE__ */ o(ue, { sx: { fontSize: 18 } })
283
+ }
284
+ )
285
+ ] }) : null,
286
+ /* @__PURE__ */ o("div", { className: "grid gap-12", children: e.fieldClusters.map((n) => {
287
+ if (!n.label)
288
+ return n.fields.map((C) => /* @__PURE__ */ o(
289
+ q,
290
+ {
291
+ definition: C,
292
+ resetVersion: f,
293
+ sectionKey: r,
294
+ settings: c,
295
+ onChange: t,
296
+ onReset: i
297
+ },
298
+ C.path
299
+ ));
300
+ const P = `${r}:${e.key}:${n.key}`, k = !!te[P], a = n.autoDerivedFieldPaths, K = !!(a && b);
301
+ return /* @__PURE__ */ u(
302
+ A,
303
+ {
304
+ variant: "outlined",
305
+ sx: {
306
+ backgroundColor: Fe,
307
+ borderColor: Be,
308
+ display: "flex",
309
+ flexDirection: "column",
310
+ gap: 1.5,
311
+ p: 1.5
312
+ },
313
+ children: [
314
+ /* @__PURE__ */ u("div", { className: "flex items-start justify-between gap-12", children: [
315
+ /* @__PURE__ */ o(x, { variant: "body2", fontWeight: 700, children: n.label }),
316
+ K ? /* @__PURE__ */ o(
317
+ ce,
318
+ {
319
+ className: "m-0",
320
+ control: /* @__PURE__ */ o(
321
+ he,
322
+ {
323
+ size: "small",
324
+ checked: k,
325
+ onChange: /* @__PURE__ */ s((C) => {
326
+ const E = C.target.checked;
327
+ le((w) => ({
328
+ ...w,
329
+ [P]: E
330
+ })), !E && (!b || !a || h(
331
+ U(
332
+ b,
333
+ a,
334
+ G(
335
+ c,
336
+ r,
337
+ a.mainPath
338
+ )
339
+ )
340
+ ));
341
+ }, "onChange")
342
+ }
343
+ ),
344
+ label: /* @__PURE__ */ o(x, { variant: "caption", color: "text.secondary", children: "Edit derived colors" })
345
+ }
346
+ ) : null
347
+ ] }),
348
+ /* @__PURE__ */ o("div", { className: "grid gap-12", children: n.fields.map((C) => {
349
+ const E = a && b ? !k && C.path !== a.mainPath : !1;
350
+ return /* @__PURE__ */ o(
351
+ q,
352
+ {
353
+ disabled: E,
354
+ definition: C,
355
+ resetVersion: f,
356
+ sectionKey: r,
357
+ settings: c,
358
+ onChange: /* @__PURE__ */ s((w, $) => {
359
+ if (!a || !b || k || w !== a.mainPath) {
360
+ t(w, $);
361
+ return;
362
+ }
363
+ h([
364
+ { path: w, value: $ },
365
+ ...U(
366
+ b,
367
+ a,
368
+ $
369
+ )
370
+ ]);
371
+ }, "onChange"),
372
+ onReset: i
373
+ },
374
+ C.path
375
+ );
376
+ }) })
377
+ ]
378
+ },
379
+ n.key
380
+ );
381
+ }) })
382
+ ] }, e.key);
383
+ }, "renderFieldGroup");
384
+ return /* @__PURE__ */ o(me, { theme: Ie, children: /* @__PURE__ */ u(se, { sx: Ee, className: "flex h-full min-h-0 flex-col gap-16", children: [
385
+ /* @__PURE__ */ o("div", { className: "grid grid-cols-2 gap-12", children: X.map((e) => {
386
+ const l = e.key === r;
118
387
  return /* @__PURE__ */ o(
119
- R,
388
+ ae,
120
389
  {
121
- onClick: /* @__PURE__ */ h(() => u(r.key), "onClick"),
390
+ onClick: /* @__PURE__ */ s(() => F(e.key), "onClick"),
122
391
  className: "w-full rounded-lg text-left",
123
392
  sx: {
124
393
  alignItems: "flex-start",
125
- backgroundColor: l ? x.active.backgroundColor : x.inactive.backgroundColor,
126
- border: `1px solid ${l ? x.active.borderColor : x.inactive.borderColor}`,
127
- color: l ? x.active.textColor : x.inactive.textColor,
394
+ backgroundColor: l ? v.active.backgroundColor : v.inactive.backgroundColor,
395
+ border: `1px solid ${l ? v.active.borderColor : v.inactive.borderColor}`,
396
+ color: l ? v.active.textColor : v.inactive.textColor,
128
397
  p: 2
129
398
  },
130
- children: /* @__PURE__ */ p("div", { className: "flex w-full flex-col gap-4", children: [
131
- /* @__PURE__ */ o(b, { variant: "subtitle1", fontWeight: 600, children: r.label }),
132
- r.description ? /* @__PURE__ */ o(
133
- b,
399
+ children: /* @__PURE__ */ u("div", { className: "flex w-full flex-col gap-4", children: [
400
+ /* @__PURE__ */ o(x, { variant: "subtitle1", fontWeight: 600, children: e.label }),
401
+ e.description ? /* @__PURE__ */ o(
402
+ x,
134
403
  {
135
404
  variant: "body2",
136
405
  sx: {
137
- color: l ? x.active.descriptionColor : x.inactive.descriptionColor
406
+ color: l ? v.active.descriptionColor : v.inactive.descriptionColor
138
407
  },
139
- children: r.description
408
+ children: e.description
140
409
  }
141
410
  ) : null
142
411
  ] })
143
412
  },
144
- r.key
413
+ e.key
145
414
  );
146
415
  }) }),
147
- /* @__PURE__ */ p(
148
- $,
416
+ /* @__PURE__ */ u(
417
+ A,
149
418
  {
150
419
  className: "flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg",
151
420
  sx: {
152
- backgroundColor: ne,
153
- border: `1px solid ${K}`,
421
+ backgroundColor: D,
422
+ border: `1px solid ${B}`,
154
423
  boxShadow: "none"
155
424
  },
156
425
  children: [
157
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between px-20 py-16", children: /* @__PURE__ */ p("div", { className: "flex min-w-0 flex-1 flex-col gap-14", children: [
158
- /* @__PURE__ */ o(b, { variant: "h6", sx: { color: ae }, children: N == null ? void 0 : N.label }),
159
- w ? /* @__PURE__ */ p("div", { className: "grid gap-12 md:grid-cols-2", children: [
160
- /* @__PURE__ */ p(
161
- A,
426
+ /* @__PURE__ */ o("div", { className: "flex items-center justify-between px-20 py-16", children: /* @__PURE__ */ u("div", { className: "flex min-w-0 flex-1 flex-col gap-14", children: [
427
+ /* @__PURE__ */ o(x, { variant: "h6", sx: { color: y }, children: j == null ? void 0 : j.label }),
428
+ S ? /* @__PURE__ */ u("div", { className: "grid gap-12 md:grid-cols-2", children: [
429
+ /* @__PURE__ */ u(
430
+ Y,
162
431
  {
163
432
  select: !0,
164
433
  label: "Mode",
165
- value: m,
166
- onChange: /* @__PURE__ */ h((r) => {
167
- n(r.target.value);
434
+ value: p,
435
+ onChange: /* @__PURE__ */ s((e) => {
436
+ oe(e.target.value);
168
437
  }, "onChange"),
169
438
  children: [
170
- /* @__PURE__ */ o(F, { value: "light", children: "light" }),
171
- /* @__PURE__ */ o(F, { value: "dark", children: "dark" })
439
+ /* @__PURE__ */ o(W, { value: "light", children: "light" }),
440
+ /* @__PURE__ */ o(W, { value: "dark", children: "dark" })
172
441
  ]
173
442
  }
174
443
  ),
175
- /* @__PURE__ */ p(
176
- A,
444
+ /* @__PURE__ */ u(
445
+ Y,
177
446
  {
178
447
  select: !0,
179
448
  label: "Preset",
180
- value: s,
181
- onChange: /* @__PURE__ */ h((r) => {
182
- c(r.target.value);
449
+ value: m,
450
+ onChange: /* @__PURE__ */ s((e) => {
451
+ re(e.target.value);
183
452
  }, "onChange"),
184
453
  children: [
185
- s === D ? /* @__PURE__ */ o(F, { value: D, children: "custom" }) : null,
186
- I.map((r) => /* @__PURE__ */ o(F, { value: r.key, children: r.label }, r.key))
454
+ m === J ? /* @__PURE__ */ o(W, { value: J, children: "custom" }) : null,
455
+ ne
187
456
  ]
188
457
  }
189
458
  )
190
459
  ] }) : null
191
460
  ] }) }),
192
461
  /* @__PURE__ */ o(
193
- Y,
462
+ Z,
194
463
  {
195
464
  sx: {
196
- borderColor: K
465
+ borderColor: B
197
466
  }
198
467
  }
199
468
  ),
200
- /* @__PURE__ */ o("div", { className: "flex min-h-0 flex-1 flex-col gap-20 overflow-y-auto px-20 py-20", children: G.map((r) => /* @__PURE__ */ p("div", { className: "flex flex-col gap-12", children: [
201
- r.label ? /* @__PURE__ */ o(b, { variant: "subtitle1", fontWeight: 700, children: r.label }) : null,
202
- /* @__PURE__ */ o("div", { className: "grid gap-12", children: r.fieldClusters.map((l) => {
203
- if (!l.label)
204
- return l.fields.map((f) => /* @__PURE__ */ o(
205
- U,
206
- {
207
- definition: f,
208
- sectionKey: e,
209
- settings: i,
210
- onChange: C
211
- },
212
- f.path
213
- ));
214
- const T = `${e}:${r.key}:${l.key}`, P = !!y[T], d = l.autoDerivedFieldPaths, g = !!(d && v);
215
- return /* @__PURE__ */ p(
216
- $,
217
- {
218
- variant: "outlined",
219
- sx: {
220
- backgroundColor: le,
221
- borderColor: oe,
222
- display: "flex",
223
- flexDirection: "column",
224
- gap: 1.5,
225
- p: 1.5
226
- },
227
- children: [
228
- /* @__PURE__ */ p("div", { className: "flex items-start justify-between gap-12", children: [
229
- /* @__PURE__ */ o(b, { variant: "body2", fontWeight: 700, children: l.label }),
230
- g ? /* @__PURE__ */ o(
231
- V,
232
- {
233
- className: "m-0",
234
- control: /* @__PURE__ */ o(
235
- H,
236
- {
237
- size: "small",
238
- checked: P,
239
- onChange: /* @__PURE__ */ h((f) => {
240
- const B = f.target.checked;
241
- z((k) => ({
242
- ...k,
243
- [T]: B
244
- })), !B && (!v || !d || t(
245
- S(
246
- v,
247
- d,
248
- W(
249
- i,
250
- e,
251
- d.mainPath
252
- )
253
- )
254
- ));
255
- }, "onChange")
256
- }
257
- ),
258
- label: /* @__PURE__ */ o(b, { variant: "caption", color: "text.secondary", children: "Edit derived colors" })
259
- }
260
- ) : null
261
- ] }),
262
- /* @__PURE__ */ o("div", { className: "grid gap-12", children: l.fields.map((f) => {
263
- const B = d && v ? !P && f.path !== d.mainPath : !1;
264
- return /* @__PURE__ */ o(
265
- U,
266
- {
267
- disabled: B,
268
- definition: f,
269
- sectionKey: e,
270
- settings: i,
271
- onChange: /* @__PURE__ */ h((k, E) => {
272
- if (!d || !v || P || k !== d.mainPath) {
273
- C(k, E);
274
- return;
275
- }
276
- t(
277
- [
278
- { path: k, value: E },
279
- ...S(
280
- v,
281
- d,
282
- E
283
- )
284
- ]
285
- );
286
- }, "onChange")
287
- },
288
- f.path
289
- );
290
- }) })
291
- ]
292
- },
293
- l.key
294
- );
295
- }) })
296
- ] }, r.key)) })
469
+ /* @__PURE__ */ o("div", { className: "flex min-h-0 flex-1 flex-col gap-20 overflow-y-auto px-20 py-20", children: L.map((e) => r === "table" && L.length > 1 ? /* @__PURE__ */ u(
470
+ A,
471
+ {
472
+ variant: "outlined",
473
+ sx: {
474
+ backgroundColor: Ne,
475
+ borderColor: B,
476
+ boxShadow: "none",
477
+ display: "flex",
478
+ flexDirection: "column",
479
+ gap: 2,
480
+ p: 2
481
+ },
482
+ children: [
483
+ e.label ? /* @__PURE__ */ o(x, { variant: "subtitle1", fontWeight: 700, children: e.label }) : null,
484
+ /* @__PURE__ */ o("div", { className: "grid gap-20", children: e.fieldGroups.map(_) })
485
+ ]
486
+ },
487
+ e.key
488
+ ) : e.fieldGroups.map(_)) })
297
489
  ]
298
490
  }
299
491
  )
300
- ] });
492
+ ] }) });
301
493
  }
302
- h(pe, "ThemePreviewControls");
494
+ s(_e, "ThemePreviewControls");
303
495
  export {
304
- pe as ThemePreviewControls
496
+ _e as ThemePreviewControls
305
497
  };
306
498
  //# sourceMappingURL=ThemePreviewControls.js.map