@owp/core 2.5.8 → 2.5.9

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