@solostylist/ui-kit 1.0.196 → 1.0.198

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 (108) hide show
  1. package/dist/{ArrowUpward-JWPHrR6I.js → ArrowUpward-D8eqD-si.js} +1 -1
  2. package/dist/{Box-p3bpOtdn.js → Box-BkXoTbe8.js} +3 -3
  3. package/dist/{ButtonBase-PbSTzuUP.js → ButtonBase-D73M0QY5.js} +7 -7
  4. package/dist/{ChevronLeft-BJjuFNNQ.js → ChevronLeft-BmgmPHp9.js} +1 -1
  5. package/dist/{ChevronRight-5ZX3FodP.js → ChevronRight-DbWSr8yz.js} +1 -1
  6. package/dist/{Close-C-pCw-CD.js → Close-lHCUMitI.js} +1 -1
  7. package/dist/{ContentCopy-CNxsEhmq.js → ContentCopy-D4SuJd86.js} +1 -1
  8. package/dist/{DefaultPropsProvider-2MEHB2yv.js → DefaultPropsProvider-DPuuPIbS.js} +2 -2
  9. package/dist/{Download-D97XSAig.js → Download-BoRQUwCf.js} +1 -1
  10. package/dist/{ExpandMore-CTZrSZlF.js → ExpandMore-C7yRQv1-.js} +1 -1
  11. package/dist/{Favorite-Cvjg7GqN.js → Favorite-Bz_HcMgN.js} +1 -1
  12. package/dist/{Menu-_ZW9WiF2.js → Menu-GVFDMHCN.js} +137 -131
  13. package/dist/{MenuItem-DTapLhin.js → MenuItem-2wG8I2HO.js} +5 -5
  14. package/dist/{Paper-5nSdRRBA.js → Paper-CR019bki.js} +6 -6
  15. package/dist/{Select-J5gDqfEk.js → Select-80JhW337.js} +7 -7
  16. package/dist/{Stack-BlwLEm6H.js → Stack-Dfjnuorw.js} +5 -5
  17. package/dist/{Typography-Cum5_Ehu.js → Typography-PcmlIqm1.js} +4 -4
  18. package/dist/assets/s-overlay-scrollbar.css +1 -1
  19. package/dist/{createSvgIcon-DTNHY3_v.js → createSvgIcon-BkbeLOhM.js} +3 -3
  20. package/dist/{createTheme-CIXJrNxb.js → createTheme-DgoJyWM-.js} +874 -871
  21. package/dist/defaultTheme-CulFxfLR.js +5 -0
  22. package/dist/{extendSxProp-CyoueGTe.js → extendSxProp-BJEIxcAx.js} +1 -1
  23. package/dist/{index-8LcCMmwl.js → index-DtGYsHSv.js} +4 -4
  24. package/dist/s-accordion/s-accordion.js +89 -89
  25. package/dist/s-action-overlay/s-action-overlay.js +7 -7
  26. package/dist/s-ai-tool-bar/s-ai-tool-bar.d.ts +44 -0
  27. package/dist/s-ai-tool-bar/s-ai-tool-bar.js +241 -272
  28. package/dist/s-avatar/s-avatar.js +2 -2
  29. package/dist/s-breadcrumbs/s-breadcrumbs.js +1 -1
  30. package/dist/s-carousel/s-carousel.d.ts +4 -4
  31. package/dist/s-carousel/s-carousel.js +4 -4
  32. package/dist/s-chat-input/s-chat-input.js +4 -4
  33. package/dist/s-chat-message/s-chat-message.js +135 -124
  34. package/dist/s-chips/s-chips.js +35 -35
  35. package/dist/s-code-block/s-code-block.js +1 -1
  36. package/dist/s-comment-message/s-comment-message.js +5 -5
  37. package/dist/s-copyable-text/s-copyable-text.js +1 -1
  38. package/dist/s-countdown/s-count-down.d.ts +15 -10
  39. package/dist/s-countdown/s-count-down.js +84 -101
  40. package/dist/s-data-table/s-data-table.js +75 -76
  41. package/dist/s-date-picker/s-date-picker.js +43 -47
  42. package/dist/s-datetime-picker/s-datetime-picker.js +782 -782
  43. package/dist/s-dialog/s-dialog.js +1 -1
  44. package/dist/s-dialog-confirm/s-dialog-confirm.js +2 -2
  45. package/dist/s-dialog-message/s-dialog-message.js +2 -2
  46. package/dist/s-empty/s-empty.js +1 -1
  47. package/dist/s-file-dropzone/s-file-dropzone.js +4 -4
  48. package/dist/s-file-icon/s-file-icon.js +15 -15
  49. package/dist/s-flex-box/s-flex-box.js +1 -1
  50. package/dist/s-gallery/s-gallery.js +1 -1
  51. package/dist/s-gradient-icon/s-gradient-icon.js +5 -5
  52. package/dist/s-image-comparison/s-image-comparison.js +3 -3
  53. package/dist/s-image-modal/s-image-modal.js +7 -7
  54. package/dist/s-label/s-label.d.ts +1 -1
  55. package/dist/s-label/s-label.js +1 -1
  56. package/dist/s-language-switcher/s-language-switcher.js +8 -8
  57. package/dist/s-localization-provider/s-localization-provider.js +1 -1
  58. package/dist/s-moving-border/s-moving-border.d.ts +5 -5
  59. package/dist/s-multi-select/s-multi-select.js +3 -3
  60. package/dist/s-overlay-scrollbar/s-overlay-scrollbar.js +6 -6
  61. package/dist/s-pixel-reveal/s-pixel-reveal.js +76 -71
  62. package/dist/s-radial-pulse-animate/s-radial-pulse-animate.js +2 -2
  63. package/dist/s-review/s-review.d.ts +3 -2
  64. package/dist/s-review/s-review.js +19 -19
  65. package/dist/s-scroll-to-top/s-scroll-to-top.js +5 -5
  66. package/dist/s-scroll-velocity/scroll-velocity-container.d.ts +1 -1
  67. package/dist/s-scroll-velocity/scroll-velocity-row.d.ts +3 -3
  68. package/dist/s-scroll-velocity/scroll-velocity-row.js +2 -2
  69. package/dist/s-select/s-select.d.ts +3 -0
  70. package/dist/s-select/s-select.js +60 -72
  71. package/dist/s-select-list/s-select-list.js +1 -1
  72. package/dist/s-stripe/s-stripe-cvc.d.ts +1 -1
  73. package/dist/s-stripe/s-stripe-expiry.d.ts +1 -1
  74. package/dist/s-stripe/s-stripe-number.d.ts +1 -1
  75. package/dist/s-stripe/stripe-input.d.ts +1 -1
  76. package/dist/s-text-editor/s-text-editor-toolbar.js +64 -60
  77. package/dist/s-text-editor/s-text-editor.js +1 -1
  78. package/dist/s-text-field/s-text-field.js +1 -1
  79. package/dist/s-text-shimmer/s-text-shimmer.js +3 -3
  80. package/dist/s-theme-demo/s-theme-demo.js +2 -2
  81. package/dist/s-theme-provider/s-theme-provider.d.ts +1 -1
  82. package/dist/s-theme-switch/s-theme-switch.js +1 -1
  83. package/dist/s-tip/s-tip.js +3 -3
  84. package/dist/{styled-BR6UL29H.js → styled-8Y5KoVix.js} +2 -2
  85. package/dist/theme/components/avatar.js +1 -1
  86. package/dist/theme/components/button.d.ts +2 -2
  87. package/dist/theme/components/button.js +1 -1
  88. package/dist/theme/components/chip.d.ts +2 -2
  89. package/dist/theme/components/chip.js +1 -1
  90. package/dist/theme/components/icon-button.d.ts +2 -2
  91. package/dist/theme/components/popover.js +2 -2
  92. package/dist/theme/components/skeleton.js +1 -1
  93. package/dist/theme/components/tooltip.js +5 -5
  94. package/dist/theme/customizations/data-display.js +12 -12
  95. package/dist/theme/customizations/feedback.js +2 -2
  96. package/dist/theme/customizations/inputs.js +12 -12
  97. package/dist/theme/customizations/navigation.js +28 -28
  98. package/dist/theme/customizations/surfaces.js +11 -11
  99. package/dist/theme/theme-primitives.js +1 -1
  100. package/dist/{useMobilePicker-C0pYjskU.js → useMobilePicker-DVnEuXv1.js} +3936 -3653
  101. package/dist/{useTheme-DSvhq4Np.js → useTheme-CWPkv7g3.js} +1 -1
  102. package/dist/{useThemeProps-C-oV4Fbz.js → useThemeProps-XYgXGzjS.js} +1 -1
  103. package/dist/utils/logger.d.ts +1 -1
  104. package/dist/utils-CHdpkEZx.js +33 -0
  105. package/dist/{warning-BZ61Y8gI.js → warning-Ba-7BBAN.js} +3 -3
  106. package/package.json +59 -59
  107. package/dist/defaultTheme-DLue8Fr1.js +0 -5
  108. package/dist/utils-DJIrqgo5.js +0 -18
@@ -1,36 +1,37 @@
1
- import { j as e } from "../jsx-runtime-tc70JA_2.js";
2
- import j, { useEffect as $, useState as J, useMemo as X, useCallback as A } from "react";
3
- import { c as S } from "../createSvgIcon-DTNHY3_v.js";
4
- import { C as Q } from "../Close-C-pCw-CD.js";
5
- import { D as Y } from "../Download-D97XSAig.js";
6
- import { TextField as q, Typography as Z, Box as n, Slider as ee, IconButton as L, Checkbox as le, Divider as te, Tooltip as M, Dialog as se, DialogTitle as re, DialogContent as ne } from "@mui/material";
1
+ import { j as t } from "../jsx-runtime-tc70JA_2.js";
2
+ import u, { useEffect as $, useState as J, useMemo as X, useCallback as y } from "react";
3
+ import { c as P } from "../createSvgIcon-BkbeLOhM.js";
4
+ import { C as Q } from "../Close-lHCUMitI.js";
5
+ import { D as Y } from "../Download-BoRQUwCf.js";
6
+ import { TextField as q, Typography as Z, Box as o, Slider as ee, IconButton as w, Checkbox as te, Divider as le, Tooltip as L, Dialog as se, DialogTitle as ne, DialogContent as re } from "@mui/material";
7
7
  import { createPortal as oe } from "react-dom";
8
8
  import { SSelect as ae } from "../s-select/s-select.js";
9
- const ce = S(/* @__PURE__ */ e.jsx("path", {
9
+ const ce = P(/* @__PURE__ */ t.jsx("path", {
10
10
  d: "M19 7v2.99s-1.99.01-2 0V7h-3s.01-1.99 0-2h3V2h2v3h3v2zm-3 4V8h-3V5H5c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-8zM5 19l3-4 2 3 3-4 4 5z"
11
- }), "AddPhotoAlternate"), ie = S(/* @__PURE__ */ e.jsx("path", {
11
+ }), "AddPhotoAlternate"), ie = P(/* @__PURE__ */ t.jsx("path", {
12
12
  d: "m19 9 1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25zm-7.5.5L9 4 6.5 9.5 1 12l5.5 2.5L9 20l2.5-5.5L17 12zM19 15l-1.25 2.75L15 19l2.75 1.25L19 23l1.25-2.75L23 19l-2.75-1.25z"
13
- }), "AutoAwesome"), de = S(/* @__PURE__ */ e.jsx("path", {
13
+ }), "AutoAwesome"), de = P(/* @__PURE__ */ t.jsx("path", {
14
14
  d: "M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6m6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26"
15
- }), "Autorenew"), xe = S(/* @__PURE__ */ e.jsx("path", {
15
+ }), "Autorenew"), xe = P(/* @__PURE__ */ t.jsx("path", {
16
16
  d: "M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"
17
17
  }), "InfoOutlined");
18
- var he = /* @__PURE__ */ ((l) => (l.TEXTAREA = "textarea", l.SLIDER = "slider", l.IMAGE = "image", l.NUMBER = "number", l.SELECT = "select", l.CHECKBOX = "checkbox", l))(he || {});
19
- const me = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, disabled: i }) => /* @__PURE__ */ e.jsx(
18
+ var me = /* @__PURE__ */ ((e) => (e.TEXTAREA = "textarea", e.SLIDER = "slider", e.IMAGE = "image", e.NUMBER = "number", e.SELECT = "select", e.CHECKBOX = "checkbox", e))(me || {});
19
+ const he = u.memo(({ input: e, value: s, onChange: i, onFocus: n, onBlur: m, disabled: c }) => /* @__PURE__ */ t.jsx(
20
20
  q,
21
21
  {
22
- value: r,
23
- onChange: (x) => d(x.target.value),
24
- onFocus: o,
22
+ value: s,
23
+ onChange: (h) => i(h.target.value),
24
+ onFocus: n,
25
25
  onBlur: m,
26
- placeholder: l.placeholder || l.label,
27
- disabled: i,
26
+ placeholder: e.placeholder ?? e.label,
27
+ disabled: c,
28
28
  multiline: !0,
29
- minRows: l.minRows ?? 2,
30
- maxRows: l.maxRows ?? 5,
31
- fullWidth: !0
29
+ minRows: e.minRows ?? 2,
30
+ maxRows: e.maxRows ?? 5,
31
+ fullWidth: !0,
32
+ ...e.componentProps?.textarea ?? {}
32
33
  }
33
- )), z = j.memo((l) => /* @__PURE__ */ e.jsx(
34
+ )), D = u.memo((e) => /* @__PURE__ */ t.jsx(
34
35
  Z,
35
36
  {
36
37
  variant: "caption",
@@ -41,10 +42,10 @@ const me = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
41
42
  width: "100% !important",
42
43
  textAlign: "center"
43
44
  },
44
- children: l.label
45
+ children: e.label
45
46
  }
46
- )), fe = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, disabled: i }) => /* @__PURE__ */ e.jsxs(
47
- n,
47
+ )), fe = u.memo(({ input: e, value: s, onChange: i, onFocus: n, onBlur: m, disabled: c }) => /* @__PURE__ */ t.jsxs(
48
+ o,
48
49
  {
49
50
  sx: {
50
51
  width: 120,
@@ -52,34 +53,35 @@ const me = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
52
53
  flexDirection: "column"
53
54
  },
54
55
  children: [
55
- /* @__PURE__ */ e.jsx(z, { label: l.label }),
56
- /* @__PURE__ */ e.jsx(
56
+ /* @__PURE__ */ t.jsx(D, { label: e.label }),
57
+ /* @__PURE__ */ t.jsx(
57
58
  q,
58
59
  {
59
60
  type: "number",
60
- value: r ?? l.defaultValue ?? 0,
61
- onChange: (x) => d(Number(x.target.value)),
62
- onFocus: o,
61
+ value: s ?? e.defaultValue ?? 0,
62
+ onChange: (h) => i(Number(h.target.value)),
63
+ onFocus: n,
63
64
  onBlur: m,
64
- disabled: i,
65
+ disabled: c,
65
66
  slotProps: {
66
67
  htmlInput: {
67
- min: l.min,
68
- max: l.max,
69
- step: l.step
68
+ min: e.min,
69
+ max: e.max,
70
+ step: e.step
70
71
  }
71
72
  },
72
73
  sx: {
73
74
  "& input": {
74
75
  textAlign: "center"
75
76
  }
76
- }
77
+ },
78
+ ...e.componentProps?.number ?? {}
77
79
  }
78
80
  )
79
81
  ]
80
82
  }
81
- )), ue = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, disabled: i }) => /* @__PURE__ */ e.jsxs(
82
- n,
83
+ )), ue = u.memo(({ input: e, value: s, onChange: i, onFocus: n, onBlur: m, disabled: c }) => /* @__PURE__ */ t.jsxs(
84
+ o,
83
85
  {
84
86
  sx: {
85
87
  width: 180,
@@ -87,27 +89,28 @@ const me = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
87
89
  flexDirection: "column"
88
90
  },
89
91
  children: [
90
- /* @__PURE__ */ e.jsx(z, { label: l.label }),
91
- /* @__PURE__ */ e.jsx(
92
+ /* @__PURE__ */ t.jsx(D, { label: e.label }),
93
+ /* @__PURE__ */ t.jsx(
92
94
  ae,
93
95
  {
94
- value: r ?? l.defaultValue ?? "",
95
- onChange: (x) => d(x.target.value),
96
- onFocus: o,
96
+ value: s ?? e.defaultValue ?? "",
97
+ onChange: (h) => i(h.target.value),
98
+ onFocus: n,
97
99
  onBlur: m,
98
- disabled: i,
99
- placeholder: l.placeholder,
100
- options: l.options || [],
101
- optionLabel: l.optionLabel,
102
- optionValue: l.optionValue,
103
- searchable: l.searchable,
104
- searchPlaceholder: l.searchPlaceholder
100
+ disabled: c,
101
+ placeholder: e.placeholder,
102
+ options: e.options ?? [],
103
+ optionLabel: e.optionLabel,
104
+ optionValue: e.optionValue,
105
+ searchable: e.searchable,
106
+ searchPlaceholder: e.searchPlaceholder,
107
+ ...e.componentProps?.select ?? {}
105
108
  }
106
109
  )
107
110
  ]
108
111
  }
109
- )), ge = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, disabled: i }) => /* @__PURE__ */ e.jsxs(
110
- n,
112
+ )), ge = u.memo(({ input: e, value: s, onChange: i, onFocus: n, onBlur: m, disabled: c }) => /* @__PURE__ */ t.jsxs(
113
+ o,
111
114
  {
112
115
  sx: {
113
116
  width: 160,
@@ -115,24 +118,25 @@ const me = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
115
118
  flexDirection: "column"
116
119
  },
117
120
  children: [
118
- /* @__PURE__ */ e.jsx(z, { label: l.label }),
119
- /* @__PURE__ */ e.jsxs(n, { sx: { display: "flex", alignItems: "center", height: 36 }, children: [
120
- /* @__PURE__ */ e.jsx(
121
+ /* @__PURE__ */ t.jsx(D, { label: e.label }),
122
+ /* @__PURE__ */ t.jsxs(o, { sx: { display: "flex", alignItems: "center", height: 36 }, children: [
123
+ /* @__PURE__ */ t.jsx(
121
124
  ee,
122
125
  {
123
- value: r ?? l.defaultValue ?? l.min ?? 0,
124
- onChange: (x, b) => d(b),
125
- onMouseDown: o,
126
+ value: s ?? e.defaultValue ?? e.min ?? 0,
127
+ onChange: (h, p) => i(p),
128
+ onMouseDown: n,
126
129
  onMouseUp: m,
127
- disabled: i,
128
- min: l.min ?? 0,
129
- max: l.max ?? 100,
130
- step: l.step ?? 1,
131
- sx: { flex: 1 }
130
+ disabled: c,
131
+ min: e.min ?? 0,
132
+ max: e.max ?? 100,
133
+ step: e.step ?? 1,
134
+ sx: { flex: 1 },
135
+ ...e.componentProps?.slider ?? {}
132
136
  }
133
137
  ),
134
- /* @__PURE__ */ e.jsx(
135
- n,
138
+ /* @__PURE__ */ t.jsx(
139
+ o,
136
140
  {
137
141
  sx: {
138
142
  minWidth: 60,
@@ -140,87 +144,88 @@ const me = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
140
144
  fontWeight: 500,
141
145
  fontSize: "0.875rem"
142
146
  },
143
- children: r ?? l.defaultValue ?? l.min ?? 0
147
+ children: s ?? e.defaultValue ?? e.min ?? 0
144
148
  }
145
149
  )
146
150
  ] })
147
151
  ]
148
152
  }
149
- )), je = j.memo(({ input: l, value: r, onChange: d, disabled: o }) => {
150
- const m = j.useRef(null), [i, x] = j.useState([]), [b, F] = j.useState(null), I = l.multiple ?? !1, p = l.maxImages ?? 5;
153
+ )), je = u.memo(({ input: e, value: s, onChange: i, disabled: n }) => {
154
+ const m = u.useRef(null), [c, h] = u.useState([]), [p, C] = u.useState(null), j = e.multiple ?? !1, I = e.maxImages ?? 5;
151
155
  $(() => {
152
156
  const f = [];
153
- return x(((a) => {
154
- if (!a) return [];
155
- const y = Array.isArray(a) ? a : [a], c = [];
156
- return y.forEach((k) => {
157
- if (k instanceof File) {
158
- const E = URL.createObjectURL(k);
159
- c.push(E), f.push(E);
160
- } else typeof k == "string" && c.push(k);
161
- }), c;
162
- })(r)), () => {
163
- f.forEach((a) => URL.revokeObjectURL(a));
157
+ return h(((r) => {
158
+ if (!r) return [];
159
+ const g = Array.isArray(r) ? r : [r], a = [];
160
+ return g.forEach((b) => {
161
+ if (b instanceof File) {
162
+ const R = URL.createObjectURL(b);
163
+ a.push(R), f.push(R);
164
+ } else typeof b == "string" && a.push(b);
165
+ }), a;
166
+ })(s)), () => {
167
+ f.forEach((r) => URL.revokeObjectURL(r));
164
168
  };
165
- }, [r]);
166
- const R = (f) => {
167
- const h = f.target.files;
168
- if (!(!h || h.length === 0)) {
169
- if (I) {
170
- const a = Array.isArray(r) ? r : r instanceof File || typeof r == "string" ? [r] : [], y = Array.from(h).slice(0, p - a.length), c = [...a, ...y];
171
- d(c);
169
+ }, [s]);
170
+ const k = (f) => {
171
+ const d = f.target.files;
172
+ if (!(!d || d.length === 0)) {
173
+ if (j) {
174
+ const r = Array.isArray(s) ? s : s instanceof File || typeof s == "string" ? [s] : [], g = Array.from(d).slice(0, I - r.length), a = [...r, ...g];
175
+ i(a);
172
176
  } else
173
- d(h[0]);
177
+ i(d[0]);
174
178
  f.target.value = "";
175
179
  }
176
- }, D = (f, h) => {
177
- if (f.stopPropagation(), I && Array.isArray(r)) {
178
- const a = r.filter((y, c) => c !== h);
179
- d(a.length > 0 ? a : null);
180
+ }, v = (f, d) => {
181
+ if (f.stopPropagation(), j && Array.isArray(s)) {
182
+ const r = s.filter((g, a) => a !== d);
183
+ i(r.length > 0 ? r : null);
180
184
  } else
181
- d(null);
182
- }, P = () => {
183
- o || I && i.length >= p || m.current?.click();
184
- }, V = I && i.length < p;
185
- return /* @__PURE__ */ e.jsxs(n, { sx: { display: "flex", alignItems: "center", gap: 0.75 }, children: [
186
- /* @__PURE__ */ e.jsx(
185
+ i(null);
186
+ }, E = () => {
187
+ n || j && c.length >= I || m.current?.click();
188
+ }, M = j && c.length < I;
189
+ return /* @__PURE__ */ t.jsxs(o, { sx: { display: "flex", alignItems: "center", gap: 0.75 }, children: [
190
+ /* @__PURE__ */ t.jsx(
187
191
  "input",
188
192
  {
189
193
  ref: m,
190
194
  type: "file",
191
195
  accept: "image/*",
192
- multiple: I,
193
- onChange: R,
194
- disabled: o,
195
- style: { display: "none" }
196
+ multiple: j,
197
+ onChange: k,
198
+ disabled: n,
199
+ style: { display: "none" },
200
+ ...e.componentProps?.image ?? {}
196
201
  }
197
202
  ),
198
- i.map((f, h) => /* @__PURE__ */ e.jsxs(
199
- n,
203
+ c.map((f, d) => /* @__PURE__ */ t.jsxs(
204
+ o,
200
205
  {
201
- onMouseEnter: () => F(h),
202
- onMouseLeave: () => F(null),
206
+ onMouseEnter: () => C(d),
207
+ onMouseLeave: () => C(null),
203
208
  sx: {
204
209
  width: 50,
205
210
  height: 50,
206
211
  border: 1,
207
- borderColor: o ? "action.disabled" : "divider",
212
+ borderColor: n ? "action.disabled" : "divider",
208
213
  borderRadius: 1,
209
214
  display: "flex",
210
215
  alignItems: "center",
211
216
  justifyContent: "center",
212
- cursor: o ? "not-allowed" : "default",
217
+ cursor: n ? "not-allowed" : "default",
213
218
  position: "relative",
214
219
  overflow: "hidden",
215
220
  transition: "all 0.2s"
216
221
  },
217
222
  children: [
218
- /* @__PURE__ */ e.jsx(
219
- n,
223
+ /* @__PURE__ */ t.jsx(
224
+ o,
220
225
  {
221
226
  component: "img",
222
227
  src: f,
223
- alt: `Preview ${h + 1}`,
228
+ alt: `Preview ${d + 1}`,
224
229
  sx: {
225
230
  width: "100%",
226
231
  height: "100%",
@@ -228,10 +233,10 @@ const me = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
228
233
  }
229
234
  }
230
235
  ),
231
- !o && b === h && /* @__PURE__ */ e.jsx(
232
- n,
236
+ !n && p === d && /* @__PURE__ */ t.jsx(
237
+ o,
233
238
  {
234
- onClick: (a) => D(a, h),
239
+ onClick: (r) => v(r, d),
235
240
  sx: {
236
241
  position: "absolute",
237
242
  top: 0,
@@ -242,46 +247,46 @@ const me = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
242
247
  alignItems: "center",
243
248
  justifyContent: "center"
244
249
  },
245
- children: /* @__PURE__ */ e.jsx(L, { onClick: (a) => D(a, h), children: /* @__PURE__ */ e.jsx(Q, {}) })
250
+ children: /* @__PURE__ */ t.jsx(w, { onClick: (r) => v(r, d), children: /* @__PURE__ */ t.jsx(Q, {}) })
246
251
  }
247
252
  )
248
253
  ]
249
254
  },
250
- h
255
+ d
251
256
  )),
252
- (i.length === 0 || V) && /* @__PURE__ */ e.jsx(
253
- n,
257
+ (c.length === 0 || M) && /* @__PURE__ */ t.jsx(
258
+ o,
254
259
  {
255
- onClick: P,
260
+ onClick: E,
256
261
  sx: {
257
262
  width: 50,
258
263
  height: 50,
259
264
  border: 1,
260
- borderColor: o ? "action.disabled" : "divider",
265
+ borderColor: n ? "action.disabled" : "divider",
261
266
  borderRadius: 1,
262
267
  display: "flex",
263
268
  alignItems: "center",
264
269
  justifyContent: "center",
265
- cursor: o ? "not-allowed" : "pointer",
270
+ cursor: n ? "not-allowed" : "pointer",
266
271
  transition: "all 0.2s",
267
272
  "&:hover": {
268
273
  bgcolor: "action.hover"
269
274
  }
270
275
  },
271
- children: /* @__PURE__ */ e.jsx(
276
+ children: /* @__PURE__ */ t.jsx(
272
277
  ce,
273
278
  {
274
279
  sx: {
275
280
  fontSize: 20,
276
- color: o ? "action.disabled" : "divider"
281
+ color: n ? "action.disabled" : "divider"
277
282
  }
278
283
  }
279
284
  )
280
285
  }
281
286
  )
282
287
  ] });
283
- }), ye = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, disabled: i }) => /* @__PURE__ */ e.jsxs(
284
- n,
288
+ }), pe = u.memo(({ input: e, value: s, onChange: i, onFocus: n, onBlur: m, disabled: c }) => /* @__PURE__ */ t.jsxs(
289
+ o,
285
290
  {
286
291
  sx: {
287
292
  display: "flex",
@@ -290,96 +295,120 @@ const me = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
290
295
  minWidth: 60
291
296
  },
292
297
  children: [
293
- /* @__PURE__ */ e.jsx(z, { label: l.label }),
294
- /* @__PURE__ */ e.jsx(
295
- le,
298
+ /* @__PURE__ */ t.jsx(D, { label: e.label }),
299
+ /* @__PURE__ */ t.jsx(
300
+ te,
296
301
  {
297
- checked: r ?? l.defaultValue ?? !1,
298
- onChange: (x) => d(x.target.checked),
299
- onFocus: o,
302
+ checked: s ?? e.defaultValue ?? !1,
303
+ onChange: (h) => i(h.target.checked),
304
+ onFocus: n,
300
305
  onBlur: m,
301
- disabled: i
306
+ disabled: c,
307
+ ...e.componentProps?.checkbox ?? {}
302
308
  }
303
309
  )
304
310
  ]
305
311
  }
306
- )), U = (l) => {
307
- switch (l.input.type) {
312
+ )), Ie = (e) => {
313
+ switch (e.input.type) {
308
314
  case "textarea":
309
- return /* @__PURE__ */ e.jsx(me, { ...l });
315
+ return /* @__PURE__ */ t.jsx(he, { ...e });
310
316
  case "number":
311
- return /* @__PURE__ */ e.jsx(fe, { ...l });
317
+ return /* @__PURE__ */ t.jsx(fe, { ...e });
312
318
  case "slider":
313
- return /* @__PURE__ */ e.jsx(ge, { ...l });
319
+ return /* @__PURE__ */ t.jsx(ge, { ...e });
314
320
  case "select":
315
- return /* @__PURE__ */ e.jsx(ue, { ...l });
321
+ return /* @__PURE__ */ t.jsx(ue, { ...e });
316
322
  case "image":
317
- return /* @__PURE__ */ e.jsx(je, { input: l.input, value: l.value, onChange: l.onChange, disabled: l.disabled });
323
+ return /* @__PURE__ */ t.jsx(je, { input: e.input, value: e.value, onChange: e.onChange, disabled: e.disabled });
318
324
  case "checkbox":
319
- return /* @__PURE__ */ e.jsx(ye, { ...l });
325
+ return /* @__PURE__ */ t.jsx(pe, { ...e });
320
326
  default:
321
327
  return null;
322
328
  }
323
- }, Ie = ({
324
- inputs: l = [],
325
- onProcess: r,
326
- onReset: d,
327
- onDownload: o,
329
+ }, be = ({
330
+ inputs: e = [],
331
+ onProcess: s,
332
+ onReset: i,
333
+ onDownload: n,
328
334
  processing: m = !1,
329
- uploading: i = !1,
330
- inputValues: x = {},
331
- onInputChange: b,
332
- customActionButtons: F,
333
- hideProcessButton: I = !1,
334
- processButtonDisabled: p = !1,
335
- getInputDisabled: R,
336
- processTooltip: D = "Process",
337
- downloadTooltip: P = "Download",
338
- resetTooltip: V = "Reset",
335
+ uploading: c = !1,
336
+ inputValues: h = {},
337
+ onInputChange: p,
338
+ customActionButtons: C,
339
+ hideProcessButton: j = !1,
340
+ processButtonDisabled: I = !1,
341
+ getInputDisabled: k,
342
+ processTooltip: v = "Process",
343
+ downloadTooltip: E = "Download",
344
+ resetTooltip: M = "Reset",
339
345
  infoTooltip: f = "Information",
340
- infoTitle: h = "Tool Information",
341
- infoContent: a,
342
- position: y = "bottom",
343
- relative: c = !1,
344
- containerSx: k,
345
- sx: E
346
+ infoTitle: d = "Tool Information",
347
+ infoContent: r,
348
+ position: g = "bottom",
349
+ relative: a = !1,
350
+ containerSx: b,
351
+ sx: R
346
352
  }) => {
347
- const [G, W] = J(!1), N = X(() => l.length === 0 ? !0 : l.every((t) => {
348
- if (!t.required) return !0;
349
- const s = x[t.key];
350
- return t.type === "textarea" ? s && typeof s == "string" && s.trim() !== "" : t.type === "number" || t.type === "slider" ? s != null : t.type === "select" ? s != null && s !== "" : !0;
351
- }), [l, x]), { imageInputs: B, textareaInputs: _, paramInputs: O } = X(() => l.reduce(
352
- (t, s) => (s.type === "image" ? t.imageInputs.push(s) : s.type === "textarea" ? t.textareaInputs.push(s) : t.paramInputs.push(s), t),
353
+ const [G, B] = J(!1), N = X(() => e.length === 0 ? !0 : e.every((l) => {
354
+ if (!l.required) return !0;
355
+ const x = h[l.key];
356
+ return l.type === "textarea" ? typeof x == "string" && x.trim() !== "" : l.type === "number" || l.type === "slider" ? x != null : l.type === "select" ? x != null && x !== "" : !0;
357
+ }), [e, h]), { imageInputs: S, textareaInputs: _, paramInputs: z } = X(() => e.reduce(
358
+ (l, x) => (x.type === "image" ? l.imageInputs.push(x) : x.type === "textarea" ? l.textareaInputs.push(x) : l.paramInputs.push(x), l),
353
359
  {
354
360
  imageInputs: [],
355
361
  textareaInputs: [],
356
362
  paramInputs: []
357
363
  }
358
- ), [l]), C = A(() => {
359
- }, []), w = A(() => {
360
- }, []), v = A(
361
- (t, s, g) => {
362
- b?.(t, s, g);
364
+ ), [e]), F = y(() => {
365
+ }, []), V = y(() => {
366
+ }, []), O = y(
367
+ (l, x, A) => {
368
+ p?.(l, x, A);
369
+ },
370
+ [p]
371
+ ), K = y(() => B(!0), []), T = y(() => B(!1), []), U = y(
372
+ (l) => {
373
+ const x = h[l.key], A = k?.(l.key) ?? !1;
374
+ return l.renderInput ? /* @__PURE__ */ t.jsx(o, { children: l.renderInput({
375
+ value: x,
376
+ onChange: (W) => O(l.key, W),
377
+ onFocus: F,
378
+ onBlur: V,
379
+ disabled: A
380
+ }) }, l.key) : /* @__PURE__ */ t.jsx(
381
+ Ie,
382
+ {
383
+ input: l,
384
+ value: x,
385
+ onChange: (W) => O(l.key, W),
386
+ onFocus: F,
387
+ onBlur: V,
388
+ disabled: A
389
+ },
390
+ l.key
391
+ );
363
392
  },
364
- [b]
365
- ), K = A(() => W(!0), []), T = A(() => W(!1), []), H = /* @__PURE__ */ e.jsxs(
366
- n,
393
+ [h, k, O, F, V]
394
+ ), H = /* @__PURE__ */ t.jsxs(
395
+ o,
367
396
  {
368
397
  sx: {
369
- position: c ? "relative" : "fixed",
370
- [y]: c ? "auto" : 20,
371
- left: c ? "auto" : "50%",
372
- transform: c ? "none" : "translateX(-50%)",
373
- zIndex: c ? "auto" : 1300,
374
- display: c ? "flex" : "block",
375
- justifyContent: c ? "center" : "initial",
376
- mt: c && y === "top" ? 2 : 0,
377
- mb: c && y === "bottom" ? 2 : 0,
378
- ...k
398
+ position: a ? "relative" : "fixed",
399
+ [g]: a ? "auto" : 20,
400
+ left: a ? "auto" : "50%",
401
+ transform: a ? "none" : "translateX(-50%)",
402
+ zIndex: a ? "auto" : 1300,
403
+ display: a ? "flex" : "block",
404
+ justifyContent: a ? "center" : "initial",
405
+ mt: a && g === "top" ? 2 : 0,
406
+ mb: a && g === "bottom" ? 2 : 0,
407
+ ...b
379
408
  },
380
409
  children: [
381
- /* @__PURE__ */ e.jsxs(
382
- n,
410
+ /* @__PURE__ */ t.jsxs(
411
+ o,
383
412
  {
384
413
  sx: {
385
414
  display: "flex",
@@ -390,33 +419,13 @@ const me = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
390
419
  border: 1,
391
420
  borderColor: "divider",
392
421
  bgcolor: "background.default",
393
- ...E
422
+ ...R
394
423
  },
395
424
  children: [
396
- _.length > 0 && /* @__PURE__ */ e.jsx(n, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: _.map((t) => {
397
- const s = x[t.key], g = R?.(t.key) ?? !1;
398
- return t.renderInput ? /* @__PURE__ */ e.jsx(n, { children: t.renderInput({
399
- value: s,
400
- onChange: (u) => v(t.key, u),
401
- onFocus: C,
402
- onBlur: w,
403
- disabled: g
404
- }) }, t.key) : /* @__PURE__ */ e.jsx(
405
- U,
406
- {
407
- input: t,
408
- value: s,
409
- onChange: (u) => v(t.key, u),
410
- onFocus: C,
411
- onBlur: w,
412
- disabled: g
413
- },
414
- t.key
415
- );
416
- }) }),
417
- /* @__PURE__ */ e.jsxs(n, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
418
- /* @__PURE__ */ e.jsx(
419
- n,
425
+ _.length > 0 && /* @__PURE__ */ t.jsx(o, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: _.map(U) }),
426
+ /* @__PURE__ */ t.jsxs(o, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
427
+ /* @__PURE__ */ t.jsx(
428
+ o,
420
429
  {
421
430
  sx: {
422
431
  display: "flex",
@@ -424,68 +433,28 @@ const me = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
424
433
  gap: 2,
425
434
  flex: 1
426
435
  },
427
- children: (B.length > 0 || O.length > 0) && /* @__PURE__ */ e.jsxs(n, { sx: { display: "flex", alignItems: "flex-end", gap: 1.5 }, children: [
428
- B.map((t) => {
429
- const s = x[t.key], g = R?.(t.key) ?? !1;
430
- return t.renderInput ? /* @__PURE__ */ e.jsx(n, { children: t.renderInput({
431
- value: s,
432
- onChange: (u) => v(t.key, u),
433
- onFocus: C,
434
- onBlur: w,
435
- disabled: g
436
- }) }, t.key) : /* @__PURE__ */ e.jsx(
437
- U,
438
- {
439
- input: t,
440
- value: s,
441
- onChange: (u) => v(t.key, u),
442
- onFocus: C,
443
- onBlur: w,
444
- disabled: g
445
- },
446
- t.key
447
- );
448
- }),
449
- O.map((t) => {
450
- const s = x[t.key], g = R?.(t.key) ?? !1;
451
- return t.renderInput ? /* @__PURE__ */ e.jsx(n, { children: t.renderInput({
452
- value: s,
453
- onChange: (u) => v(t.key, u),
454
- onFocus: C,
455
- onBlur: w,
456
- disabled: g
457
- }) }, t.key) : /* @__PURE__ */ e.jsx(
458
- U,
459
- {
460
- input: t,
461
- value: s,
462
- onChange: (u) => v(t.key, u),
463
- onFocus: C,
464
- onBlur: w,
465
- disabled: g
466
- },
467
- t.key
468
- );
469
- })
436
+ children: (S.length > 0 || z.length > 0) && /* @__PURE__ */ t.jsxs(o, { sx: { display: "flex", alignItems: "flex-end", gap: 1.5 }, children: [
437
+ S.map(U),
438
+ z.map(U)
470
439
  ] })
471
440
  }
472
441
  ),
473
- (B.length > 0 || O.length > 0) && /* @__PURE__ */ e.jsx(te, { orientation: "vertical", flexItem: !0, sx: { mx: 0.5, flexShrink: 0 } }),
474
- /* @__PURE__ */ e.jsxs(n, { sx: { display: "flex", alignItems: "center", gap: 0.75, ml: "auto" }, children: [
475
- F,
476
- a && /* @__PURE__ */ e.jsx(M, { title: f, children: /* @__PURE__ */ e.jsx(L, { onClick: K, children: /* @__PURE__ */ e.jsx(xe, {}) }) }),
477
- /* @__PURE__ */ e.jsx(M, { title: P, children: /* @__PURE__ */ e.jsx(L, { onClick: o, children: /* @__PURE__ */ e.jsx(Y, {}) }) }),
478
- /* @__PURE__ */ e.jsx(M, { title: V, children: /* @__PURE__ */ e.jsx(L, { onClick: d, children: /* @__PURE__ */ e.jsx(de, {}) }) }),
479
- !I && /* @__PURE__ */ e.jsx(M, { title: D, children: /* @__PURE__ */ e.jsx("span", { children: /* @__PURE__ */ e.jsx(
480
- L,
442
+ (S.length > 0 || z.length > 0) && /* @__PURE__ */ t.jsx(le, { orientation: "vertical", flexItem: !0, sx: { mx: 0.5, flexShrink: 0 } }),
443
+ /* @__PURE__ */ t.jsxs(o, { sx: { display: "flex", alignItems: "center", gap: 0.75, ml: "auto" }, children: [
444
+ C,
445
+ r && /* @__PURE__ */ t.jsx(L, { title: f, children: /* @__PURE__ */ t.jsx(w, { onClick: K, children: /* @__PURE__ */ t.jsx(xe, {}) }) }),
446
+ /* @__PURE__ */ t.jsx(L, { title: E, children: /* @__PURE__ */ t.jsx(w, { onClick: n, children: /* @__PURE__ */ t.jsx(Y, {}) }) }),
447
+ /* @__PURE__ */ t.jsx(L, { title: M, children: /* @__PURE__ */ t.jsx(w, { onClick: i, children: /* @__PURE__ */ t.jsx(de, {}) }) }),
448
+ !j && /* @__PURE__ */ t.jsx(L, { title: v, children: /* @__PURE__ */ t.jsx("span", { children: /* @__PURE__ */ t.jsx(
449
+ w,
481
450
  {
482
- onClick: r,
483
- disabled: p || !N || i || m,
451
+ onClick: s,
452
+ disabled: I || !N || c || m,
484
453
  size: "large",
485
- children: /* @__PURE__ */ e.jsx(
454
+ children: /* @__PURE__ */ t.jsx(
486
455
  ie,
487
456
  {
488
- color: p || !N || i || m ? "disabled" : "primary"
457
+ color: I || !N || c || m ? "disabled" : "primary"
489
458
  }
490
459
  )
491
460
  }
@@ -495,18 +464,18 @@ const me = j.memo(({ input: l, value: r, onChange: d, onFocus: o, onBlur: m, dis
495
464
  ]
496
465
  }
497
466
  ),
498
- a && /* @__PURE__ */ e.jsxs(se, { open: G, onClose: T, maxWidth: "sm", fullWidth: !0, children: [
499
- /* @__PURE__ */ e.jsx(re, { children: h }),
500
- /* @__PURE__ */ e.jsx(ne, { children: a })
467
+ r && /* @__PURE__ */ t.jsxs(se, { open: G, onClose: T, maxWidth: "sm", fullWidth: !0, children: [
468
+ /* @__PURE__ */ t.jsx(ne, { children: d }),
469
+ /* @__PURE__ */ t.jsx(re, { children: r })
501
470
  ] })
502
471
  ]
503
472
  }
504
473
  );
505
- return !c && typeof window < "u" ? oe(H, document.body) : H;
474
+ return !a && typeof window < "u" ? oe(H, document.body) : H;
506
475
  };
507
- Ie.displayName = "SAiToolBar";
476
+ be.displayName = "SAiToolBar";
508
477
  export {
509
- Ie as SAiToolBar,
510
- he as SAiToolBarInputType,
511
- Ie as default
478
+ be as SAiToolBar,
479
+ me as SAiToolBarInputType,
480
+ be as default
512
481
  };