@solostylist/ui-kit 1.0.165 → 1.0.166

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +13 -13
  2. package/dist/Download-UsLvGg3y.js +8 -0
  3. package/dist/main.d.ts +2 -0
  4. package/dist/main.js +169 -167
  5. package/dist/s-accordion/package.json +5 -5
  6. package/dist/s-action-overlay/package.json +5 -5
  7. package/dist/s-ai-tool-bar/index.js +4 -0
  8. package/dist/s-ai-tool-bar/package.json +5 -0
  9. package/dist/s-ai-tool-bar/s-ai-tool-bar.d.ts +104 -0
  10. package/dist/s-ai-tool-bar/s-ai-tool-bar.js +480 -0
  11. package/dist/s-avatar/package.json +5 -5
  12. package/dist/s-blur-text/package.json +5 -5
  13. package/dist/s-breadcrumbs/package.json +5 -5
  14. package/dist/s-button/package.json +5 -5
  15. package/dist/s-carousel/package.json +4 -4
  16. package/dist/s-category-card/package.json +4 -4
  17. package/dist/s-chat-input/package.json +5 -5
  18. package/dist/s-chat-message/s-chat-message.js +30 -31
  19. package/dist/s-chip/package.json +5 -5
  20. package/dist/s-comment-message/package.json +5 -5
  21. package/dist/s-image-comparison/package.json +5 -5
  22. package/dist/s-image-modal/package.json +5 -5
  23. package/dist/s-radial-pulse-animate/package.json +5 -5
  24. package/dist/s-rating/package.json +5 -5
  25. package/dist/s-review/package.json +5 -5
  26. package/dist/s-scroll-reveal/package.json +5 -5
  27. package/dist/s-scroll-to-top/package.json +5 -5
  28. package/dist/s-tabs/package.json +3 -3
  29. package/dist/s-text-shimmer/package.json +4 -4
  30. package/dist/s-theme-demo/package.json +5 -5
  31. package/dist/s-theme-switch/package.json +4 -4
  32. package/dist/s-typewriter-text/package.json +5 -5
  33. package/dist/theme/components/alert.d.ts +1440 -1440
  34. package/dist/theme/components/button.d.ts +2156 -2156
  35. package/dist/theme/components/chip.d.ts +2 -2
  36. package/package.json +113 -113
@@ -0,0 +1,480 @@
1
+ import { j as e } from "../jsx-runtime-OVHDjVDe.js";
2
+ import I, { useEffect as oe, useState as W, useMemo as D, useCallback as k } from "react";
3
+ import { c as L } from "../createSvgIcon-DxwgGAVe.js";
4
+ import { C as se } from "../Close-BRlEKA2Q.js";
5
+ import { D as te } from "../Download-UsLvGg3y.js";
6
+ import { TextField as G, Typography as ne, Box as n, Slider as le, alpha as z, Divider as ae, Tooltip as B, IconButton as P, Dialog as ce, DialogTitle as ie, DialogContent as de } from "@mui/material";
7
+ import { createPortal as xe } from "react-dom";
8
+ const he = L(/* @__PURE__ */ e.jsx("path", {
9
+ 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"
10
+ }), "AddPhotoAlternate"), me = L(/* @__PURE__ */ e.jsx("path", {
11
+ 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"
12
+ }), "Autorenew"), fe = L(/* @__PURE__ */ e.jsx("path", {
13
+ 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"
14
+ }), "InfoOutlined"), ue = L(/* @__PURE__ */ e.jsx("path", {
15
+ d: "M8 5v14l11-7z"
16
+ }), "PlayArrow"), ye = I.memo(({ input: o, value: c, onChange: m, onFocus: t, onBlur: f, disabled: x }) => /* @__PURE__ */ e.jsx(
17
+ G,
18
+ {
19
+ value: c,
20
+ onChange: (h) => m(h.target.value),
21
+ onFocus: t,
22
+ onBlur: f,
23
+ placeholder: o.placeholder || o.label,
24
+ disabled: x,
25
+ multiline: !0,
26
+ minRows: o.minRows ?? 2,
27
+ maxRows: o.maxRows ?? 5,
28
+ fullWidth: !0
29
+ }
30
+ )), J = I.memo((o) => /* @__PURE__ */ e.jsx(
31
+ ne,
32
+ {
33
+ variant: "caption",
34
+ sx: {
35
+ color: "text.secondary",
36
+ whiteSpace: "nowrap",
37
+ overflow: "hidden",
38
+ textOverflow: "ellipsis",
39
+ width: "100% !important",
40
+ textAlign: "center"
41
+ },
42
+ children: o.label
43
+ }
44
+ )), je = I.memo(({ input: o, value: c, onChange: m, isExpanded: t, onFocus: f, onBlur: x, disabled: h }) => /* @__PURE__ */ e.jsxs(
45
+ n,
46
+ {
47
+ sx: {
48
+ width: t ? 120 : 60,
49
+ transition: "width 0.3s ease",
50
+ display: "flex",
51
+ flexDirection: "column"
52
+ },
53
+ children: [
54
+ /* @__PURE__ */ e.jsx(J, { label: o.label }),
55
+ /* @__PURE__ */ e.jsx(
56
+ G,
57
+ {
58
+ type: "number",
59
+ value: c ?? o.defaultValue ?? 0,
60
+ onChange: (g) => m(Number(g.target.value)),
61
+ onFocus: f,
62
+ onBlur: x,
63
+ disabled: h,
64
+ size: "small",
65
+ slotProps: {
66
+ htmlInput: {
67
+ min: o.min,
68
+ max: o.max,
69
+ step: o.step
70
+ }
71
+ },
72
+ sx: {
73
+ "& input": {
74
+ textAlign: "center"
75
+ }
76
+ }
77
+ }
78
+ )
79
+ ]
80
+ }
81
+ )), ge = I.memo(({ input: o, value: c, onChange: m, isExpanded: t, onFocus: f, onBlur: x, disabled: h }) => /* @__PURE__ */ e.jsxs(
82
+ n,
83
+ {
84
+ sx: {
85
+ width: t ? 160 : 60,
86
+ transition: "width 0.3s ease",
87
+ display: "flex",
88
+ flexDirection: "column"
89
+ },
90
+ children: [
91
+ /* @__PURE__ */ e.jsx(J, { label: o.label }),
92
+ /* @__PURE__ */ e.jsxs(n, { sx: { display: "flex", alignItems: "center", height: 36 }, children: [
93
+ t && /* @__PURE__ */ e.jsx(
94
+ le,
95
+ {
96
+ value: c ?? o.defaultValue ?? o.min ?? 0,
97
+ onChange: (g, v) => m(v),
98
+ onMouseDown: f,
99
+ onMouseUp: x,
100
+ disabled: h,
101
+ min: o.min ?? 0,
102
+ max: o.max ?? 100,
103
+ step: o.step ?? 1,
104
+ size: "small",
105
+ sx: { flex: 1 }
106
+ }
107
+ ),
108
+ /* @__PURE__ */ e.jsx(
109
+ n,
110
+ {
111
+ sx: {
112
+ minWidth: 60,
113
+ textAlign: "center",
114
+ fontWeight: 500,
115
+ fontSize: "0.875rem",
116
+ width: t ? "auto" : "100%"
117
+ },
118
+ children: c ?? o.defaultValue ?? o.min ?? 0
119
+ }
120
+ )
121
+ ] })
122
+ ]
123
+ }
124
+ )), pe = I.memo(({ input: o, value: c, onChange: m, disabled: t }) => {
125
+ const f = I.useRef(null), [x, h] = I.useState([]), [g, v] = I.useState(null), w = o.multiple ?? !1, b = o.maxImages ?? 5;
126
+ oe(() => {
127
+ let d = [];
128
+ return h(((l) => {
129
+ if (!l) return [];
130
+ const p = Array.isArray(l) ? l : [l], a = [];
131
+ return p.forEach((C) => {
132
+ if (C instanceof File) {
133
+ const S = URL.createObjectURL(C);
134
+ a.push(S), d.push(S);
135
+ } else typeof C == "string" && a.push(C);
136
+ }), a;
137
+ })(c)), () => {
138
+ d.forEach((l) => URL.revokeObjectURL(l));
139
+ };
140
+ }, [c]);
141
+ const u = (d) => {
142
+ const i = d.target.files;
143
+ if (!(!i || i.length === 0)) {
144
+ if (w) {
145
+ const l = Array.isArray(c) ? c : c ? [c] : [], p = Array.from(i).slice(0, b - l.length), a = [...l, ...p];
146
+ m(a);
147
+ } else
148
+ m(i[0]);
149
+ d.target.value = "";
150
+ }
151
+ }, O = (d, i) => {
152
+ if (d.stopPropagation(), w && Array.isArray(c)) {
153
+ const l = c.filter((p, a) => a !== i);
154
+ m(l.length > 0 ? l : null);
155
+ } else
156
+ m(null);
157
+ }, T = () => {
158
+ var d;
159
+ t || w && x.length >= b || (d = f.current) == null || d.click();
160
+ }, E = w && x.length < b;
161
+ return /* @__PURE__ */ e.jsxs(n, { sx: { display: "flex", alignItems: "center", gap: 0.75 }, children: [
162
+ /* @__PURE__ */ e.jsx(
163
+ "input",
164
+ {
165
+ ref: f,
166
+ type: "file",
167
+ accept: "image/*",
168
+ multiple: w,
169
+ onChange: u,
170
+ disabled: t,
171
+ style: { display: "none" }
172
+ }
173
+ ),
174
+ x.map((d, i) => /* @__PURE__ */ e.jsxs(
175
+ n,
176
+ {
177
+ onMouseEnter: () => v(i),
178
+ onMouseLeave: () => v(null),
179
+ sx: {
180
+ width: 50,
181
+ height: 50,
182
+ border: 1,
183
+ borderColor: t ? "action.disabled" : "primary.main",
184
+ borderRadius: 1,
185
+ display: "flex",
186
+ alignItems: "center",
187
+ justifyContent: "center",
188
+ cursor: t ? "not-allowed" : "default",
189
+ position: "relative",
190
+ overflow: "hidden",
191
+ transition: "all 0.2s",
192
+ "&:hover": t ? {} : {
193
+ borderColor: "primary.dark"
194
+ }
195
+ },
196
+ children: [
197
+ /* @__PURE__ */ e.jsx(
198
+ n,
199
+ {
200
+ component: "img",
201
+ src: d,
202
+ alt: `Preview ${i + 1}`,
203
+ sx: {
204
+ width: "100%",
205
+ height: "100%",
206
+ objectFit: "cover"
207
+ }
208
+ }
209
+ ),
210
+ !t && g === i && /* @__PURE__ */ e.jsx(
211
+ n,
212
+ {
213
+ onClick: (l) => O(l, i),
214
+ sx: {
215
+ position: "absolute",
216
+ top: 0,
217
+ left: 0,
218
+ right: 0,
219
+ bottom: 0,
220
+ display: "flex",
221
+ alignItems: "center",
222
+ justifyContent: "center",
223
+ bgcolor: z("#000", 0.5),
224
+ cursor: "pointer",
225
+ transition: "background-color 0.2s",
226
+ "&:hover": {
227
+ bgcolor: z("#000", 0.65)
228
+ }
229
+ },
230
+ children: /* @__PURE__ */ e.jsx(
231
+ se,
232
+ {
233
+ sx: {
234
+ fontSize: 16,
235
+ color: "white"
236
+ }
237
+ }
238
+ )
239
+ }
240
+ )
241
+ ]
242
+ },
243
+ i
244
+ )),
245
+ (x.length === 0 || E) && /* @__PURE__ */ e.jsx(
246
+ n,
247
+ {
248
+ onClick: T,
249
+ sx: {
250
+ width: 50,
251
+ height: 50,
252
+ border: 1,
253
+ borderColor: t ? "action.disabled" : "divider",
254
+ borderRadius: 1,
255
+ display: "flex",
256
+ alignItems: "center",
257
+ justifyContent: "center",
258
+ cursor: t ? "not-allowed" : "pointer",
259
+ bgcolor: z("#000", 0.02),
260
+ transition: "all 0.2s",
261
+ "&:hover": t ? {} : {
262
+ borderColor: "primary.main",
263
+ bgcolor: z("#000", 0.04)
264
+ }
265
+ },
266
+ children: /* @__PURE__ */ e.jsx(
267
+ he,
268
+ {
269
+ sx: {
270
+ fontSize: 20,
271
+ color: t ? "action.disabled" : "text.secondary"
272
+ }
273
+ }
274
+ )
275
+ }
276
+ )
277
+ ] });
278
+ }), H = (o) => {
279
+ switch (o.input.type) {
280
+ case "textarea":
281
+ return /* @__PURE__ */ e.jsx(ye, { ...o });
282
+ case "number":
283
+ return /* @__PURE__ */ e.jsx(je, { ...o });
284
+ case "slider":
285
+ return /* @__PURE__ */ e.jsx(ge, { ...o });
286
+ case "image":
287
+ return /* @__PURE__ */ e.jsx(pe, { input: o.input, value: o.value, onChange: o.onChange, disabled: o.disabled });
288
+ default:
289
+ return null;
290
+ }
291
+ }, Re = ({
292
+ inputs: o = [],
293
+ onProcess: c,
294
+ onReset: m,
295
+ onDownload: t,
296
+ processing: f = !1,
297
+ uploading: x = !1,
298
+ inputValues: h = {},
299
+ onInputChange: g,
300
+ customActionButtons: v,
301
+ hideProcessButton: w = !1,
302
+ processButtonDisabled: b = !1,
303
+ getInputDisabled: u,
304
+ processTooltip: O = "Process",
305
+ downloadTooltip: T = "Download",
306
+ resetTooltip: E = "Reset",
307
+ infoTooltip: d = "Information",
308
+ infoTitle: i = "Tool Information",
309
+ infoContent: l,
310
+ position: p = "bottom",
311
+ relative: a = !1
312
+ }) => {
313
+ const [C, S] = W(!1), [K, _] = W(!1), [Q, q] = W(!1), A = C || K, N = D(() => o.length === 0 ? !0 : o.every((r) => {
314
+ if (!r.required) return !0;
315
+ const s = h[r.key];
316
+ return r.type === "textarea" ? s && typeof s == "string" && s.trim() !== "" : r.type === "number" || r.type === "slider" ? s != null : !0;
317
+ }), [o, h]), { imageInputs: U, textareaInputs: X, paramInputs: V } = D(() => o.reduce(
318
+ (r, s) => (s.type === "image" ? r.imageInputs.push(s) : s.type === "textarea" ? r.textareaInputs.push(s) : r.paramInputs.push(s), r),
319
+ {
320
+ imageInputs: [],
321
+ textareaInputs: [],
322
+ paramInputs: []
323
+ }
324
+ ), [o]), Y = k(() => S(!0), []), Z = k(() => S(!1), []), R = k(() => _(!0), []), F = k(() => {
325
+ setTimeout(() => _(!1), 200);
326
+ }, []), M = k(
327
+ (r, s, j) => {
328
+ g == null || g(r, s, j);
329
+ },
330
+ [g]
331
+ ), ee = k(() => q(!0), []), re = k(() => q(!1), []), $ = /* @__PURE__ */ e.jsxs(
332
+ n,
333
+ {
334
+ sx: {
335
+ position: a ? "relative" : "fixed",
336
+ [p]: a ? "auto" : 20,
337
+ left: a ? "auto" : "50%",
338
+ transform: a ? "none" : "translateX(-50%)",
339
+ zIndex: a ? "auto" : 1300,
340
+ display: a ? "flex" : "block",
341
+ justifyContent: a ? "center" : "initial",
342
+ mt: a && p === "top" ? 2 : 0,
343
+ mb: a && p === "bottom" ? 2 : 0
344
+ },
345
+ children: [
346
+ /* @__PURE__ */ e.jsxs(
347
+ n,
348
+ {
349
+ onMouseEnter: Y,
350
+ onMouseLeave: Z,
351
+ sx: {
352
+ display: "flex",
353
+ flexDirection: "column",
354
+ gap: 2,
355
+ p: 2,
356
+ borderRadius: 2,
357
+ border: 1,
358
+ borderColor: "divider"
359
+ },
360
+ children: [
361
+ X.length > 0 && /* @__PURE__ */ e.jsx(n, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: X.map((r) => {
362
+ const s = h[r.key], j = (u == null ? void 0 : u(r.key)) ?? !1;
363
+ return r.renderInput ? /* @__PURE__ */ e.jsx(n, { children: r.renderInput({
364
+ value: s,
365
+ onChange: (y) => M(r.key, y),
366
+ isExpanded: A,
367
+ onFocus: R,
368
+ onBlur: F,
369
+ disabled: j
370
+ }) }, r.key) : /* @__PURE__ */ e.jsx(
371
+ H,
372
+ {
373
+ input: r,
374
+ value: s,
375
+ onChange: (y) => M(r.key, y),
376
+ isExpanded: A,
377
+ onFocus: R,
378
+ onBlur: F,
379
+ disabled: j
380
+ },
381
+ r.key
382
+ );
383
+ }) }),
384
+ /* @__PURE__ */ e.jsxs(n, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
385
+ /* @__PURE__ */ e.jsx(
386
+ n,
387
+ {
388
+ sx: {
389
+ display: "flex",
390
+ alignItems: "center",
391
+ gap: 2,
392
+ flex: 1
393
+ },
394
+ children: (U.length > 0 || V.length > 0) && /* @__PURE__ */ e.jsxs(n, { sx: { display: "flex", alignItems: "flex-end", gap: 1.5 }, children: [
395
+ U.map((r) => {
396
+ const s = h[r.key], j = (u == null ? void 0 : u(r.key)) ?? !1;
397
+ return r.renderInput ? /* @__PURE__ */ e.jsx(n, { children: r.renderInput({
398
+ value: s,
399
+ onChange: (y) => M(r.key, y),
400
+ isExpanded: A,
401
+ onFocus: R,
402
+ onBlur: F,
403
+ disabled: j
404
+ }) }, r.key) : /* @__PURE__ */ e.jsx(
405
+ H,
406
+ {
407
+ input: r,
408
+ value: s,
409
+ onChange: (y) => M(r.key, y),
410
+ isExpanded: A,
411
+ onFocus: R,
412
+ onBlur: F,
413
+ disabled: j
414
+ },
415
+ r.key
416
+ );
417
+ }),
418
+ V.map((r) => {
419
+ const s = h[r.key], j = (u == null ? void 0 : u(r.key)) ?? !1;
420
+ return r.renderInput ? /* @__PURE__ */ e.jsx(n, { children: r.renderInput({
421
+ value: s,
422
+ onChange: (y) => M(r.key, y),
423
+ isExpanded: A,
424
+ onFocus: R,
425
+ onBlur: F,
426
+ disabled: j
427
+ }) }, r.key) : /* @__PURE__ */ e.jsx(
428
+ H,
429
+ {
430
+ input: r,
431
+ value: s,
432
+ onChange: (y) => M(r.key, y),
433
+ isExpanded: A,
434
+ onFocus: R,
435
+ onBlur: F,
436
+ disabled: j
437
+ },
438
+ r.key
439
+ );
440
+ })
441
+ ] })
442
+ }
443
+ ),
444
+ (U.length > 0 || V.length > 0) && /* @__PURE__ */ e.jsx(ae, { orientation: "vertical", flexItem: !0, sx: { mx: 0.5, flexShrink: 0 } }),
445
+ /* @__PURE__ */ e.jsxs(n, { sx: { display: "flex", alignItems: "center", gap: 0.75, ml: "auto" }, children: [
446
+ v,
447
+ l && /* @__PURE__ */ e.jsx(B, { title: d, children: /* @__PURE__ */ e.jsx(P, { onClick: ee, children: /* @__PURE__ */ e.jsx(fe, {}) }) }),
448
+ /* @__PURE__ */ e.jsx(B, { title: T, children: /* @__PURE__ */ e.jsx(P, { onClick: t, children: /* @__PURE__ */ e.jsx(te, {}) }) }),
449
+ /* @__PURE__ */ e.jsx(B, { title: E, children: /* @__PURE__ */ e.jsx(P, { onClick: m, children: /* @__PURE__ */ e.jsx(me, {}) }) }),
450
+ !w && /* @__PURE__ */ e.jsx(B, { title: O, children: /* @__PURE__ */ e.jsx("span", { children: /* @__PURE__ */ e.jsx(
451
+ P,
452
+ {
453
+ onClick: c,
454
+ disabled: b || !N || x || f,
455
+ size: "large",
456
+ children: /* @__PURE__ */ e.jsx(
457
+ ue,
458
+ {
459
+ color: b || !N || x || f ? "disabled" : "primary"
460
+ }
461
+ )
462
+ }
463
+ ) }) })
464
+ ] })
465
+ ] })
466
+ ]
467
+ }
468
+ ),
469
+ l && /* @__PURE__ */ e.jsxs(ce, { open: Q, onClose: re, maxWidth: "sm", fullWidth: !0, children: [
470
+ /* @__PURE__ */ e.jsx(ie, { children: i }),
471
+ /* @__PURE__ */ e.jsx(de, { children: l })
472
+ ] })
473
+ ]
474
+ }
475
+ );
476
+ return !a && typeof window < "u" ? xe($, document.body) : $;
477
+ };
478
+ export {
479
+ Re as default
480
+ };
@@ -1,5 +1,5 @@
1
- {
2
- "main": "./index.js",
3
- "types": "./index.d.ts",
4
- "sideEffects": false
5
- }
1
+ {
2
+ "main": "./index.js",
3
+ "types": "./index.d.ts",
4
+ "sideEffects": false
5
+ }
@@ -1,5 +1,5 @@
1
- {
2
- "main": "./index.js",
3
- "types": "./index.d.ts",
4
- "sideEffects": false
5
- }
1
+ {
2
+ "main": "./index.js",
3
+ "types": "./index.d.ts",
4
+ "sideEffects": false
5
+ }
@@ -1,5 +1,5 @@
1
- {
2
- "main": "./index.js",
3
- "types": "./index.d.ts",
4
- "sideEffects": false
5
- }
1
+ {
2
+ "main": "./index.js",
3
+ "types": "./index.d.ts",
4
+ "sideEffects": false
5
+ }
@@ -1,5 +1,5 @@
1
- {
2
- "main": "./index.js",
3
- "types": "./index.d.ts",
4
- "sideEffects": false
5
- }
1
+ {
2
+ "main": "./index.js",
3
+ "types": "./index.d.ts",
4
+ "sideEffects": false
5
+ }
@@ -1,5 +1,5 @@
1
- {
2
- "main": "./index.js",
3
- "types": "./index.d.ts",
4
- "sideEffects": false
1
+ {
2
+ "main": "./index.js",
3
+ "types": "./index.d.ts",
4
+ "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
- {
2
- "main": "./index.js",
3
- "types": "./index.d.ts",
4
- "sideEffects": false
1
+ {
2
+ "main": "./index.js",
3
+ "types": "./index.d.ts",
4
+ "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
- {
2
- "main": "./index.js",
3
- "types": "./index.d.ts",
4
- "sideEffects": false
5
- }
1
+ {
2
+ "main": "./index.js",
3
+ "types": "./index.d.ts",
4
+ "sideEffects": false
5
+ }