@solostylist/ui-kit 1.0.198 → 1.0.201

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 (210) hide show
  1. package/dist/{Select-80JhW337.js → Select-D2l9rDWL.js} +1594 -1594
  2. package/dist/entries/core.d.ts +15 -15
  3. package/dist/entries/core.js +98 -101
  4. package/dist/main.js +176 -179
  5. package/dist/s-blur-text/s-blur-text.js +25 -24
  6. package/dist/s-chat-message/s-chat-message.js +1 -1
  7. package/dist/s-comment-message/s-comment-message.js +1 -1
  8. package/dist/s-countdown/s-count-box.js +40 -37
  9. package/dist/s-countdown/s-count-down.js +73 -101
  10. package/dist/s-date-picker/s-date-picker.js +1 -1
  11. package/dist/s-datetime-picker/s-datetime-picker.js +1 -1
  12. package/dist/s-dialog-confirm/index.d.ts +1 -1
  13. package/dist/s-dialog-confirm/s-dialog-confirm.d.ts +1 -1
  14. package/dist/s-dialog-message/index.d.ts +1 -1
  15. package/dist/s-dialog-message/s-dialog-message.d.ts +1 -1
  16. package/dist/s-file-dropzone/s-file-dropzone.js +13 -13
  17. package/dist/s-link/index.d.ts +2 -0
  18. package/dist/s-link/index.js +4 -0
  19. package/dist/{s-button-link/s-button-link.d.ts → s-link/s-link.d.ts} +5 -5
  20. package/dist/s-link/s-link.js +37 -0
  21. package/dist/s-pixel-reveal/s-pixel-reveal.js +28 -28
  22. package/dist/s-review/s-review.js +1 -1
  23. package/dist/s-snackbar-message/s-snackbar-message.js +18 -18
  24. package/dist/s-text-editor/s-text-editor-toolbar.js +1 -1
  25. package/dist/s-theme-provider/s-theme-provider.js +24 -35
  26. package/dist/s-tool-bar/index.d.ts +2 -0
  27. package/dist/s-tool-bar/index.js +4 -0
  28. package/dist/{s-ai-tool-bar/s-ai-tool-bar.d.ts → s-tool-bar/s-tool-bar.d.ts} +23 -30
  29. package/dist/s-tool-bar/s-tool-bar.js +478 -0
  30. package/dist/theme/components/accordion-details.d.ts +8 -0
  31. package/dist/theme/components/accordion-details.js +8 -0
  32. package/dist/theme/components/accordion-summary.d.ts +1033 -0
  33. package/dist/theme/components/accordion-summary.js +17 -0
  34. package/dist/theme/components/accordion.d.ts +35 -0
  35. package/dist/theme/components/accordion.js +32 -0
  36. package/dist/theme/components/app-bar.d.ts +24 -0
  37. package/dist/theme/components/app-bar.js +18 -0
  38. package/dist/theme/components/autocomplete.d.ts +31 -0
  39. package/dist/theme/components/autocomplete.js +30 -0
  40. package/dist/theme/components/button-base.d.ts +12 -0
  41. package/dist/theme/components/button-base.js +15 -0
  42. package/dist/theme/components/card-actions.d.ts +7 -0
  43. package/dist/theme/components/card-actions.js +10 -0
  44. package/dist/theme/components/card-content.d.ts +7 -0
  45. package/dist/theme/components/card-content.js +11 -0
  46. package/dist/theme/components/card-header.d.ts +7 -0
  47. package/dist/theme/components/card-header.js +10 -0
  48. package/dist/theme/components/card.d.ts +2046 -0
  49. package/dist/theme/components/card.js +35 -0
  50. package/dist/theme/components/checkbox.d.ts +1046 -0
  51. package/dist/theme/components/checkbox.js +65 -0
  52. package/dist/theme/components/components.js +112 -30
  53. package/dist/theme/components/dialog-actions.d.ts +12 -0
  54. package/dist/theme/components/dialog-actions.js +10 -0
  55. package/dist/theme/components/dialog.d.ts +19 -0
  56. package/dist/theme/components/dialog.js +17 -0
  57. package/dist/theme/components/drawer.d.ts +12 -0
  58. package/dist/theme/components/drawer.js +10 -0
  59. package/dist/theme/components/form-label.d.ts +17 -0
  60. package/dist/theme/components/form-label.js +11 -0
  61. package/dist/theme/components/icon.d.ts +17 -0
  62. package/dist/theme/components/icon.js +22 -0
  63. package/dist/theme/components/input-adornment.d.ts +1027 -0
  64. package/dist/theme/components/input-adornment.js +13 -0
  65. package/dist/theme/components/input-base.d.ts +18 -0
  66. package/dist/theme/components/input-base.js +16 -0
  67. package/dist/theme/components/linear-progress.d.ts +1023 -0
  68. package/dist/theme/components/linear-progress.js +16 -0
  69. package/dist/theme/components/link.d.ts +42 -0
  70. package/dist/theme/components/link.js +38 -0
  71. package/dist/theme/components/list-item-button.d.ts +155 -0
  72. package/dist/theme/components/list-item-button.js +44 -0
  73. package/dist/theme/components/list-item-icon.d.ts +7 -0
  74. package/dist/theme/components/list-item-icon.js +10 -0
  75. package/dist/theme/components/list-item-text.d.ts +22 -0
  76. package/dist/theme/components/list-item-text.js +16 -0
  77. package/dist/theme/components/list-item.d.ts +92 -0
  78. package/dist/theme/components/list-item.js +20 -0
  79. package/dist/theme/components/list-subheader.d.ts +20 -0
  80. package/dist/theme/components/list-subheader.js +14 -0
  81. package/dist/theme/components/list.d.ts +10 -0
  82. package/dist/theme/components/list.js +13 -0
  83. package/dist/theme/components/menu-item.d.ts +8 -0
  84. package/dist/theme/components/menu-item.js +8 -0
  85. package/dist/theme/components/menu.d.ts +20 -0
  86. package/dist/theme/components/menu.js +23 -0
  87. package/dist/theme/components/outlined-input.d.ts +81 -0
  88. package/dist/theme/components/outlined-input.js +64 -0
  89. package/dist/theme/components/pagination-item.d.ts +1028 -0
  90. package/dist/theme/components/pagination-item.js +18 -0
  91. package/dist/theme/components/paper.d.ts +5 -0
  92. package/dist/theme/components/paper.js +8 -0
  93. package/dist/theme/components/select.d.ts +7 -0
  94. package/dist/theme/components/select.js +13 -0
  95. package/dist/theme/components/step-connector.d.ts +15 -0
  96. package/dist/theme/components/step-connector.js +13 -0
  97. package/dist/theme/components/step-icon.d.ts +1043 -0
  98. package/dist/theme/components/step-icon.js +46 -0
  99. package/dist/theme/components/step-label.d.ts +1025 -0
  100. package/dist/theme/components/step-label.js +13 -0
  101. package/dist/theme/components/tab.d.ts +1031 -0
  102. package/dist/theme/components/tab.js +34 -0
  103. package/dist/theme/components/table-cell.d.ts +12 -0
  104. package/dist/theme/components/table-cell.js +10 -0
  105. package/dist/theme/components/table-pagination.d.ts +14 -0
  106. package/dist/theme/components/table-pagination.js +18 -0
  107. package/dist/theme/components/tabs.d.ts +1046 -0
  108. package/dist/theme/components/tabs.js +24 -0
  109. package/dist/theme/components/toggle-button-group.d.ts +1024 -0
  110. package/dist/theme/components/toggle-button-group.js +23 -0
  111. package/dist/theme/components/toggle-button.d.ts +1027 -0
  112. package/dist/theme/components/toggle-button.js +21 -0
  113. package/dist/{useMobilePicker-DVnEuXv1.js → useMobilePicker-B-bNHHXB.js} +1 -1
  114. package/dist/utils/index.d.ts +0 -1
  115. package/dist/utils/index.js +7 -9
  116. package/dist/{utils-CHdpkEZx.js → utils-D1UMIV0b.js} +13 -6
  117. package/package.json +10 -5
  118. package/dist/s-accordion/package.json +0 -5
  119. package/dist/s-action-overlay/package.json +0 -5
  120. package/dist/s-ai-tool-bar/index.d.ts +0 -2
  121. package/dist/s-ai-tool-bar/index.js +0 -5
  122. package/dist/s-ai-tool-bar/package.json +0 -5
  123. package/dist/s-ai-tool-bar/s-ai-tool-bar.js +0 -481
  124. package/dist/s-autocomplete/package.json +0 -5
  125. package/dist/s-avatar/package.json +0 -5
  126. package/dist/s-blur-text/package.json +0 -5
  127. package/dist/s-breadcrumbs/package.json +0 -5
  128. package/dist/s-button/package.json +0 -5
  129. package/dist/s-button-link/index.d.ts +0 -2
  130. package/dist/s-button-link/index.js +0 -4
  131. package/dist/s-button-link/package.json +0 -5
  132. package/dist/s-button-link/s-button-link.js +0 -37
  133. package/dist/s-carousel/package.json +0 -5
  134. package/dist/s-category-card/package.json +0 -5
  135. package/dist/s-chat-input/package.json +0 -5
  136. package/dist/s-chat-message/package.json +0 -5
  137. package/dist/s-checkbox/package.json +0 -5
  138. package/dist/s-chip/package.json +0 -5
  139. package/dist/s-chips/package.json +0 -5
  140. package/dist/s-code-block/package.json +0 -5
  141. package/dist/s-comment-message/package.json +0 -5
  142. package/dist/s-copyable-text/package.json +0 -5
  143. package/dist/s-countdown/package.json +0 -5
  144. package/dist/s-data-table/package.json +0 -5
  145. package/dist/s-date-picker/package.json +0 -5
  146. package/dist/s-datetime-picker/package.json +0 -5
  147. package/dist/s-dialog/package.json +0 -5
  148. package/dist/s-dialog-confirm/package.json +0 -5
  149. package/dist/s-dialog-message/package.json +0 -5
  150. package/dist/s-empty/package.json +0 -5
  151. package/dist/s-error/package.json +0 -5
  152. package/dist/s-error-layout/package.json +0 -5
  153. package/dist/s-file-dropzone/package.json +0 -5
  154. package/dist/s-file-icon/package.json +0 -5
  155. package/dist/s-flex-box/package.json +0 -5
  156. package/dist/s-form/package.json +0 -5
  157. package/dist/s-gallery/package.json +0 -5
  158. package/dist/s-glow-button/package.json +0 -5
  159. package/dist/s-gradient-icon/package.json +0 -5
  160. package/dist/s-i18n-provider/package.json +0 -5
  161. package/dist/s-icon-button/package.json +0 -5
  162. package/dist/s-image-comparison/package.json +0 -5
  163. package/dist/s-image-modal/package.json +0 -5
  164. package/dist/s-item-not-found/package.json +0 -5
  165. package/dist/s-label/package.json +0 -5
  166. package/dist/s-language-switcher/package.json +0 -5
  167. package/dist/s-lazy-image/package.json +0 -5
  168. package/dist/s-localization-provider/package.json +0 -5
  169. package/dist/s-moving-border/package.json +0 -5
  170. package/dist/s-multi-select/package.json +0 -5
  171. package/dist/s-no-ssr/package.json +0 -5
  172. package/dist/s-overlay-scrollbar/package.json +0 -5
  173. package/dist/s-pagination/package.json +0 -5
  174. package/dist/s-pixel-reveal/package.json +0 -5
  175. package/dist/s-radial-pulse-animate/package.json +0 -5
  176. package/dist/s-rating/package.json +0 -5
  177. package/dist/s-review/package.json +0 -5
  178. package/dist/s-scroll-reveal/package.json +0 -6
  179. package/dist/s-scroll-to-top/package.json +0 -5
  180. package/dist/s-scroll-velocity/package.json +0 -5
  181. package/dist/s-select/package.json +0 -5
  182. package/dist/s-select-list/package.json +0 -5
  183. package/dist/s-skeleton/package.json +0 -5
  184. package/dist/s-snackbar-message/package.json +0 -5
  185. package/dist/s-spotlight-cursor/package.json +0 -5
  186. package/dist/s-stripe/package.json +0 -5
  187. package/dist/s-tabs/package.json +0 -4
  188. package/dist/s-text-editor/package.json +0 -5
  189. package/dist/s-text-field/package.json +0 -5
  190. package/dist/s-text-shimmer/package.json +0 -5
  191. package/dist/s-text-truncation/package.json +0 -5
  192. package/dist/s-theme-demo/package.json +0 -5
  193. package/dist/s-theme-provider/package.json +0 -5
  194. package/dist/s-theme-switch/package.json +0 -5
  195. package/dist/s-tip/package.json +0 -5
  196. package/dist/s-two-pane-layout/package.json +0 -5
  197. package/dist/s-typewriter-text/package.json +0 -6
  198. package/dist/s-zoom-image/package.json +0 -5
  199. package/dist/theme/customizations/data-display.d.ts +0 -2
  200. package/dist/theme/customizations/data-display.js +0 -142
  201. package/dist/theme/customizations/feedback.d.ts +0 -2
  202. package/dist/theme/customizations/feedback.js +0 -39
  203. package/dist/theme/customizations/inputs.d.ts +0 -2
  204. package/dist/theme/customizations/inputs.js +0 -230
  205. package/dist/theme/customizations/navigation.d.ts +0 -2
  206. package/dist/theme/customizations/navigation.js +0 -226
  207. package/dist/theme/customizations/surfaces.d.ts +0 -2
  208. package/dist/theme/customizations/surfaces.js +0 -111
  209. package/dist/utils/bytes-to-size.d.ts +0 -1
  210. package/dist/utils/bytes-to-size.js +0 -9
@@ -0,0 +1,21 @@
1
+ import { brand as t, gray as o } from "../theme-primitives.js";
2
+ import { g as r } from "../../generateUtilityClasses-E9gROIFd.js";
3
+ const s = r("MuiToggleButton", ["root", "disabled", "selected", "standard", "primary", "secondary", "sizeSmall", "sizeMedium", "sizeLarge", "fullWidth"]), i = {
4
+ styleOverrides: {
5
+ root: ({ theme: e }) => ({
6
+ padding: "12px 16px",
7
+ textTransform: "none",
8
+ borderRadius: "10px",
9
+ fontWeight: 500,
10
+ ...e.applyStyles("dark", {
11
+ color: o[400],
12
+ [`&.${s.selected}`]: {
13
+ color: t[300]
14
+ }
15
+ })
16
+ })
17
+ }
18
+ };
19
+ export {
20
+ i as MuiToggleButton
21
+ };
@@ -14,7 +14,7 @@ import { g as je } from "./generateUtilityClasses-E9gROIFd.js";
14
14
  import { _ as la, u as bn, r as Qn, c as Er, B as yn, b as Le, i as Lo, e as ca, j as Tr } from "./ButtonBase-D73M0QY5.js";
15
15
  import { u as zn } from "./useEnhancedEffect-CJGo-L3B.js";
16
16
  import { c as _e, u as qe, m as it } from "./DefaultPropsProvider-DPuuPIbS.js";
17
- import { u as Xn, C as ua, i as Vr, f as Zn, O as da, a as pa, b as fa, S as ma, F as Fr, I as vn } from "./Select-80JhW337.js";
17
+ import { u as Xn, C as ua, i as Vr, f as Zn, O as da, a as pa, b as fa, S as ma, F as Fr, I as vn } from "./Select-D2l9rDWL.js";
18
18
  import { u as zt, F as ha } from "./useFormControl-CatNKXAi.js";
19
19
  import { c as Mt } from "./createSimplePaletteValueFilter-B7--0ryQ.js";
20
20
  import { c as pt } from "./createSvgIcon-BkbeLOhM.js";
@@ -1,3 +1,2 @@
1
1
  export * from './dayjs';
2
- export * from './bytes-to-size';
3
2
  export * from './logger';
@@ -1,13 +1,11 @@
1
1
  import { formatDatePosted as r } from "./dayjs.js";
2
- import { bytesToSize as g } from "./bytes-to-size.js";
3
- import { LogLevel as f, Logger as m, createLogger as p, logger as s } from "./logger.js";
4
- import { default as L } from "dayjs";
2
+ import { LogLevel as g, Logger as a, createLogger as f, logger as m } from "./logger.js";
3
+ import { default as d } from "dayjs";
5
4
  export {
6
- f as LogLevel,
7
- m as Logger,
8
- g as bytesToSize,
9
- p as createLogger,
10
- L as dayjs,
5
+ g as LogLevel,
6
+ a as Logger,
7
+ f as createLogger,
8
+ d as dayjs,
11
9
  r as formatDatePosted,
12
- s as logger
10
+ m as logger
13
11
  };
@@ -1,4 +1,4 @@
1
- const m = (o) => (typeof o == "string" ? new Date(o) : o).toLocaleTimeString("en-US", {
1
+ const c = (o) => (typeof o == "string" ? new Date(o) : o).toLocaleTimeString("en-US", {
2
2
  hour: "2-digit",
3
3
  minute: "2-digit",
4
4
  hour12: !0
@@ -7,7 +7,7 @@ const m = (o) => (typeof o == "string" ? new Date(o) : o).toLocaleTimeString("en
7
7
  return "";
8
8
  const t = ["Bytes", "KB", "MB", "GB"], i = Math.floor(Math.log(o) / Math.log(1024));
9
9
  return Math.round(o / Math.pow(1024, i) * 100) / 100 + " " + t[i];
10
- }, c = (o) => {
10
+ }, m = (o) => {
11
11
  const t = /* @__PURE__ */ new Date(), i = typeof o == "string" ? new Date(o) : o, a = Math.floor((t.getTime() - i.getTime()) / 1e3);
12
12
  if (a < 60)
13
13
  return "just now";
@@ -18,16 +18,23 @@ const m = (o) => (typeof o == "string" ? new Date(o) : o).toLocaleTimeString("en
18
18
  { limit: 2592e3, divisor: 604800, singular: "1 week ago", plural: "weeks ago" },
19
19
  { limit: 31536e3, divisor: 2592e3, singular: "1 month ago", plural: "months ago" }
20
20
  ];
21
- for (const { limit: s, divisor: l, singular: g, plural: u } of n)
21
+ for (const { limit: s, divisor: l, singular: u, plural: g } of n)
22
22
  if (a < s) {
23
23
  const e = Math.floor(a / l);
24
- return e === 1 ? g : `${e} ${u}`;
24
+ return e === 1 ? u : `${e} ${g}`;
25
25
  }
26
26
  const r = Math.floor(a / 31536e3);
27
27
  return r === 1 ? "1 year ago" : `${r} years ago`;
28
28
  };
29
+ function h(o, t = 2) {
30
+ if (o === 0)
31
+ return "0 Bytes";
32
+ const i = 1024, a = t < 0 ? 0 : t, n = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], r = Math.floor(Math.log(o) / Math.log(i));
33
+ return `${parseFloat((o / Math.pow(i, r)).toFixed(a))} ${n[r]}`;
34
+ }
29
35
  export {
30
- m as a,
36
+ c as a,
37
+ h as b,
31
38
  f,
32
- c as g
39
+ m as g
33
40
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "registry": "https://registry.npmjs.org"
5
5
  },
6
- "version": "1.0.198",
6
+ "version": "1.0.201",
7
7
  "description": "advanced ui kit for solostylist",
8
8
  "type": "module",
9
9
  "main": "dist/main.js",
@@ -65,7 +65,10 @@
65
65
  "types": "./dist/entries/i18n.d.ts",
66
66
  "import": "./dist/entries/i18n.js"
67
67
  },
68
- "./*": "./dist/*.js"
68
+ "./*": {
69
+ "types": "./dist/*/index.d.ts",
70
+ "import": "./dist/*/index.js"
71
+ }
69
72
  },
70
73
  "typesVersions": {
71
74
  "*": {
@@ -104,6 +107,9 @@
104
107
  ],
105
108
  "i18n": [
106
109
  "./dist/entries/i18n.d.ts"
110
+ ],
111
+ "*": [
112
+ "./dist/*/index.d.ts"
107
113
  ]
108
114
  }
109
115
  },
@@ -216,8 +222,7 @@
216
222
  "uuid": "^13.0.0",
217
223
  "vite": "^7.3.1",
218
224
  "vite-plugin-dts": "^4.5.4",
219
- "vite-plugin-lib-inject-css": "^2.2.2",
220
- "vite-plugin-static-copy": "^3.2.0"
225
+ "vite-plugin-lib-inject-css": "^2.2.2"
221
226
  },
222
227
  "lint-staged": {
223
228
  "*.{js,jsx,ts,tsx}": [
@@ -239,6 +244,6 @@
239
244
  "author": "Lê Đặng Trường Đạt",
240
245
  "license": "ISC",
241
246
  "dependencies": {
242
- "@solostylist/core": "^1.0.0"
247
+ "@solostylist/core": "^1.0.3"
243
248
  }
244
249
  }
@@ -1,5 +0,0 @@
1
- {
2
- "main": "./index.js",
3
- "types": "./index.d.ts",
4
- "sideEffects": false
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "main": "./index.js",
3
- "types": "./index.d.ts",
4
- "sideEffects": false
5
- }
@@ -1,2 +0,0 @@
1
- export { default, SAiToolBarInputType } from './s-ai-tool-bar';
2
- export type { SAiToolBarProps, SAiToolBarInput, SAiToolBarValue, SAiToolBarOption } from './s-ai-tool-bar';
@@ -1,5 +0,0 @@
1
- import { SAiToolBarInputType as r, SAiToolBar as e } from "./s-ai-tool-bar.js";
2
- export {
3
- r as SAiToolBarInputType,
4
- e as default
5
- };
@@ -1,5 +0,0 @@
1
- {
2
- "main": "./index.js",
3
- "types": "./index.d.ts",
4
- "sideEffects": false
5
- }
@@ -1,481 +0,0 @@
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
- import { createPortal as oe } from "react-dom";
8
- import { SSelect as ae } from "../s-select/s-select.js";
9
- const ce = P(/* @__PURE__ */ t.jsx("path", {
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 = P(/* @__PURE__ */ t.jsx("path", {
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 = P(/* @__PURE__ */ t.jsx("path", {
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 = P(/* @__PURE__ */ t.jsx("path", {
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
- }), "InfoOutlined");
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
- q,
21
- {
22
- value: s,
23
- onChange: (h) => i(h.target.value),
24
- onFocus: n,
25
- onBlur: m,
26
- placeholder: e.placeholder ?? e.label,
27
- disabled: c,
28
- multiline: !0,
29
- minRows: e.minRows ?? 2,
30
- maxRows: e.maxRows ?? 5,
31
- fullWidth: !0,
32
- ...e.componentProps?.textarea ?? {}
33
- }
34
- )), D = u.memo((e) => /* @__PURE__ */ t.jsx(
35
- Z,
36
- {
37
- variant: "caption",
38
- sx: {
39
- whiteSpace: "nowrap",
40
- overflow: "hidden",
41
- textOverflow: "ellipsis",
42
- width: "100% !important",
43
- textAlign: "center"
44
- },
45
- children: e.label
46
- }
47
- )), fe = u.memo(({ input: e, value: s, onChange: i, onFocus: n, onBlur: m, disabled: c }) => /* @__PURE__ */ t.jsxs(
48
- o,
49
- {
50
- sx: {
51
- width: 120,
52
- display: "flex",
53
- flexDirection: "column"
54
- },
55
- children: [
56
- /* @__PURE__ */ t.jsx(D, { label: e.label }),
57
- /* @__PURE__ */ t.jsx(
58
- q,
59
- {
60
- type: "number",
61
- value: s ?? e.defaultValue ?? 0,
62
- onChange: (h) => i(Number(h.target.value)),
63
- onFocus: n,
64
- onBlur: m,
65
- disabled: c,
66
- slotProps: {
67
- htmlInput: {
68
- min: e.min,
69
- max: e.max,
70
- step: e.step
71
- }
72
- },
73
- sx: {
74
- "& input": {
75
- textAlign: "center"
76
- }
77
- },
78
- ...e.componentProps?.number ?? {}
79
- }
80
- )
81
- ]
82
- }
83
- )), ue = u.memo(({ input: e, value: s, onChange: i, onFocus: n, onBlur: m, disabled: c }) => /* @__PURE__ */ t.jsxs(
84
- o,
85
- {
86
- sx: {
87
- width: 180,
88
- display: "flex",
89
- flexDirection: "column"
90
- },
91
- children: [
92
- /* @__PURE__ */ t.jsx(D, { label: e.label }),
93
- /* @__PURE__ */ t.jsx(
94
- ae,
95
- {
96
- value: s ?? e.defaultValue ?? "",
97
- onChange: (h) => i(h.target.value),
98
- onFocus: n,
99
- onBlur: m,
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 ?? {}
108
- }
109
- )
110
- ]
111
- }
112
- )), ge = u.memo(({ input: e, value: s, onChange: i, onFocus: n, onBlur: m, disabled: c }) => /* @__PURE__ */ t.jsxs(
113
- o,
114
- {
115
- sx: {
116
- width: 160,
117
- display: "flex",
118
- flexDirection: "column"
119
- },
120
- children: [
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(
124
- ee,
125
- {
126
- value: s ?? e.defaultValue ?? e.min ?? 0,
127
- onChange: (h, p) => i(p),
128
- onMouseDown: n,
129
- onMouseUp: m,
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 ?? {}
136
- }
137
- ),
138
- /* @__PURE__ */ t.jsx(
139
- o,
140
- {
141
- sx: {
142
- minWidth: 60,
143
- textAlign: "center",
144
- fontWeight: 500,
145
- fontSize: "0.875rem"
146
- },
147
- children: s ?? e.defaultValue ?? e.min ?? 0
148
- }
149
- )
150
- ] })
151
- ]
152
- }
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;
155
- $(() => {
156
- const f = [];
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));
168
- };
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);
176
- } else
177
- i(d[0]);
178
- f.target.value = "";
179
- }
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);
184
- } else
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(
191
- "input",
192
- {
193
- ref: m,
194
- type: "file",
195
- accept: "image/*",
196
- multiple: j,
197
- onChange: k,
198
- disabled: n,
199
- style: { display: "none" },
200
- ...e.componentProps?.image ?? {}
201
- }
202
- ),
203
- c.map((f, d) => /* @__PURE__ */ t.jsxs(
204
- o,
205
- {
206
- onMouseEnter: () => C(d),
207
- onMouseLeave: () => C(null),
208
- sx: {
209
- width: 50,
210
- height: 50,
211
- border: 1,
212
- borderColor: n ? "action.disabled" : "divider",
213
- borderRadius: 1,
214
- display: "flex",
215
- alignItems: "center",
216
- justifyContent: "center",
217
- cursor: n ? "not-allowed" : "default",
218
- position: "relative",
219
- overflow: "hidden",
220
- transition: "all 0.2s"
221
- },
222
- children: [
223
- /* @__PURE__ */ t.jsx(
224
- o,
225
- {
226
- component: "img",
227
- src: f,
228
- alt: `Preview ${d + 1}`,
229
- sx: {
230
- width: "100%",
231
- height: "100%",
232
- objectFit: "cover"
233
- }
234
- }
235
- ),
236
- !n && p === d && /* @__PURE__ */ t.jsx(
237
- o,
238
- {
239
- onClick: (r) => v(r, d),
240
- sx: {
241
- position: "absolute",
242
- top: 0,
243
- left: 0,
244
- right: 0,
245
- bottom: 0,
246
- display: "flex",
247
- alignItems: "center",
248
- justifyContent: "center"
249
- },
250
- children: /* @__PURE__ */ t.jsx(w, { onClick: (r) => v(r, d), children: /* @__PURE__ */ t.jsx(Q, {}) })
251
- }
252
- )
253
- ]
254
- },
255
- d
256
- )),
257
- (c.length === 0 || M) && /* @__PURE__ */ t.jsx(
258
- o,
259
- {
260
- onClick: E,
261
- sx: {
262
- width: 50,
263
- height: 50,
264
- border: 1,
265
- borderColor: n ? "action.disabled" : "divider",
266
- borderRadius: 1,
267
- display: "flex",
268
- alignItems: "center",
269
- justifyContent: "center",
270
- cursor: n ? "not-allowed" : "pointer",
271
- transition: "all 0.2s",
272
- "&:hover": {
273
- bgcolor: "action.hover"
274
- }
275
- },
276
- children: /* @__PURE__ */ t.jsx(
277
- ce,
278
- {
279
- sx: {
280
- fontSize: 20,
281
- color: n ? "action.disabled" : "divider"
282
- }
283
- }
284
- )
285
- }
286
- )
287
- ] });
288
- }), pe = u.memo(({ input: e, value: s, onChange: i, onFocus: n, onBlur: m, disabled: c }) => /* @__PURE__ */ t.jsxs(
289
- o,
290
- {
291
- sx: {
292
- display: "flex",
293
- flexDirection: "column",
294
- alignItems: "center",
295
- minWidth: 60
296
- },
297
- children: [
298
- /* @__PURE__ */ t.jsx(D, { label: e.label }),
299
- /* @__PURE__ */ t.jsx(
300
- te,
301
- {
302
- checked: s ?? e.defaultValue ?? !1,
303
- onChange: (h) => i(h.target.checked),
304
- onFocus: n,
305
- onBlur: m,
306
- disabled: c,
307
- ...e.componentProps?.checkbox ?? {}
308
- }
309
- )
310
- ]
311
- }
312
- )), Ie = (e) => {
313
- switch (e.input.type) {
314
- case "textarea":
315
- return /* @__PURE__ */ t.jsx(he, { ...e });
316
- case "number":
317
- return /* @__PURE__ */ t.jsx(fe, { ...e });
318
- case "slider":
319
- return /* @__PURE__ */ t.jsx(ge, { ...e });
320
- case "select":
321
- return /* @__PURE__ */ t.jsx(ue, { ...e });
322
- case "image":
323
- return /* @__PURE__ */ t.jsx(je, { input: e.input, value: e.value, onChange: e.onChange, disabled: e.disabled });
324
- case "checkbox":
325
- return /* @__PURE__ */ t.jsx(pe, { ...e });
326
- default:
327
- return null;
328
- }
329
- }, be = ({
330
- inputs: e = [],
331
- onProcess: s,
332
- onReset: i,
333
- onDownload: n,
334
- processing: m = !1,
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",
345
- infoTooltip: f = "Information",
346
- infoTitle: d = "Tool Information",
347
- infoContent: r,
348
- position: g = "bottom",
349
- relative: a = !1,
350
- containerSx: b,
351
- sx: R
352
- }) => {
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),
359
- {
360
- imageInputs: [],
361
- textareaInputs: [],
362
- paramInputs: []
363
- }
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
- );
392
- },
393
- [h, k, O, F, V]
394
- ), H = /* @__PURE__ */ t.jsxs(
395
- o,
396
- {
397
- sx: {
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
408
- },
409
- children: [
410
- /* @__PURE__ */ t.jsxs(
411
- o,
412
- {
413
- sx: {
414
- display: "flex",
415
- flexDirection: "column",
416
- gap: 2,
417
- p: 2,
418
- borderRadius: 2,
419
- border: 1,
420
- borderColor: "divider",
421
- bgcolor: "background.default",
422
- ...R
423
- },
424
- children: [
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,
429
- {
430
- sx: {
431
- display: "flex",
432
- alignItems: "center",
433
- gap: 2,
434
- flex: 1
435
- },
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)
439
- ] })
440
- }
441
- ),
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,
450
- {
451
- onClick: s,
452
- disabled: I || !N || c || m,
453
- size: "large",
454
- children: /* @__PURE__ */ t.jsx(
455
- ie,
456
- {
457
- color: I || !N || c || m ? "disabled" : "primary"
458
- }
459
- )
460
- }
461
- ) }) })
462
- ] })
463
- ] })
464
- ]
465
- }
466
- ),
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 })
470
- ] })
471
- ]
472
- }
473
- );
474
- return !a && typeof window < "u" ? oe(H, document.body) : H;
475
- };
476
- be.displayName = "SAiToolBar";
477
- export {
478
- be as SAiToolBar,
479
- me as SAiToolBarInputType,
480
- be as default
481
- };
@@ -1,5 +0,0 @@
1
- {
2
- "main": "./index.js",
3
- "types": "./index.d.ts",
4
- "sideEffects": false
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "main": "./index.js",
3
- "types": "./index.d.ts",
4
- "sideEffects": false
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "main": "./index.js",
3
- "types": "./index.d.ts",
4
- "sideEffects": false
5
- }