@solostylist/ui-kit 1.0.166 → 1.0.168

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 (241) hide show
  1. package/dist/{Typography-B7LOtCzI.js → Typography-C8jwvSWe.js} +1 -1
  2. package/dist/main.d.ts +5 -3
  3. package/dist/main.js +182 -172
  4. package/dist/s-accordion/index.js +2 -2
  5. package/dist/s-accordion/s-accordion.d.ts +17 -1
  6. package/dist/s-accordion/s-accordion.js +252 -238
  7. package/dist/s-action-overlay/index.js +1 -1
  8. package/dist/s-action-overlay/s-action-overlay.d.ts +34 -1
  9. package/dist/s-action-overlay/s-action-overlay.js +67 -55
  10. package/dist/s-ai-tool-bar/index.d.ts +2 -0
  11. package/dist/s-ai-tool-bar/index.js +3 -2
  12. package/dist/s-ai-tool-bar/s-ai-tool-bar.d.ts +43 -22
  13. package/dist/s-ai-tool-bar/s-ai-tool-bar.js +336 -255
  14. package/dist/s-autocomplete/index.js +2 -2
  15. package/dist/s-autocomplete/s-autocomplete.d.ts +13 -15
  16. package/dist/s-autocomplete/s-autocomplete.js +25 -17
  17. package/dist/s-avatar/index.js +2 -2
  18. package/dist/s-avatar/s-avatar.d.ts +16 -1
  19. package/dist/s-avatar/s-avatar.js +23 -10
  20. package/dist/s-blur-text/index.js +2 -2
  21. package/dist/s-blur-text/s-blur-text.d.ts +4 -13
  22. package/dist/s-blur-text/s-blur-text.js +57 -51
  23. package/dist/s-breadcrumbs/index.js +2 -2
  24. package/dist/s-breadcrumbs/s-breadcrumbs.d.ts +20 -1
  25. package/dist/s-breadcrumbs/s-breadcrumbs.js +39 -30
  26. package/dist/s-button/index.js +2 -2
  27. package/dist/s-button/s-button.d.ts +7 -1
  28. package/dist/s-button/s-button.js +15 -5
  29. package/dist/s-button-link/index.js +2 -2
  30. package/dist/s-button-link/s-button-link.d.ts +12 -26
  31. package/dist/s-button-link/s-button-link.js +36 -26
  32. package/dist/s-carousel/index.js +1 -1
  33. package/dist/s-carousel/s-carousel.d.ts +11 -1
  34. package/dist/s-carousel/s-carousel.js +233 -223
  35. package/dist/s-category-card/index.js +2 -2
  36. package/dist/s-category-card/s-category-card.d.ts +28 -1
  37. package/dist/s-category-card/s-category-card.js +77 -58
  38. package/dist/s-chat-input/index.js +2 -2
  39. package/dist/s-chat-input/s-chat-input.d.ts +12 -1
  40. package/dist/s-chat-input/s-chat-input.js +92 -82
  41. package/dist/s-chat-message/index.js +2 -2
  42. package/dist/s-chat-message/s-chat-message.d.ts +22 -1
  43. package/dist/s-chat-message/s-chat-message.js +144 -133
  44. package/dist/s-checkbox/index.js +2 -2
  45. package/dist/s-checkbox/s-checkbox.d.ts +2 -15
  46. package/dist/s-checkbox/s-checkbox.js +20 -10
  47. package/dist/s-chip/index.js +2 -2
  48. package/dist/s-chip/s-chip.d.ts +7 -1
  49. package/dist/s-chip/s-chip.js +15 -5
  50. package/dist/s-chips/index.js +2 -2
  51. package/dist/s-chips/s-chips.d.ts +5 -18
  52. package/dist/s-chips/s-chips.js +56 -41
  53. package/dist/s-comment-message/index.js +2 -2
  54. package/dist/s-comment-message/s-comment-message.d.ts +26 -1
  55. package/dist/s-comment-message/s-comment-message.js +95 -89
  56. package/dist/s-copyable-text/index.js +1 -1
  57. package/dist/s-copyable-text/s-copyable-text.d.ts +9 -36
  58. package/dist/s-copyable-text/s-copyable-text.js +31 -21
  59. package/dist/s-countdown/index.d.ts +3 -2
  60. package/dist/s-countdown/index.js +4 -3
  61. package/dist/s-countdown/s-count-box.d.ts +39 -0
  62. package/dist/s-countdown/s-count-box.js +112 -0
  63. package/dist/s-countdown/s-count-down.d.ts +6 -50
  64. package/dist/s-countdown/s-count-down.js +110 -175
  65. package/dist/s-data-table/index.js +2 -2
  66. package/dist/s-data-table/s-data-table.d.ts +9 -65
  67. package/dist/s-data-table/s-data-table.js +381 -371
  68. package/dist/s-date-picker/index.js +2 -2
  69. package/dist/s-date-picker/s-date-picker.d.ts +6 -17
  70. package/dist/s-date-picker/s-date-picker.js +124 -107
  71. package/dist/s-datetime-picker/index.js +2 -2
  72. package/dist/s-datetime-picker/s-datetime-picker.d.ts +5 -16
  73. package/dist/s-datetime-picker/s-datetime-picker.js +897 -887
  74. package/dist/s-dialog/index.js +2 -2
  75. package/dist/s-dialog/s-dialog.d.ts +3 -16
  76. package/dist/s-dialog/s-dialog.js +32 -23
  77. package/dist/s-dialog-confirm/index.js +3 -3
  78. package/dist/s-dialog-confirm/s-dialog-confirm.d.ts +5 -13
  79. package/dist/s-dialog-confirm/s-dialog-confirm.js +55 -48
  80. package/dist/s-dialog-message/index.js +4 -4
  81. package/dist/s-dialog-message/s-dialog-message.d.ts +5 -15
  82. package/dist/s-dialog-message/s-dialog-message.js +45 -38
  83. package/dist/s-empty/index.js +2 -2
  84. package/dist/s-empty/s-empty.d.ts +5 -20
  85. package/dist/s-empty/s-empty.js +14 -4
  86. package/dist/s-error/index.js +2 -2
  87. package/dist/s-error/s-error.d.ts +5 -20
  88. package/dist/s-error/s-error.js +16 -6
  89. package/dist/s-error-layout/index.js +2 -2
  90. package/dist/s-error-layout/s-error-layout.d.ts +6 -1
  91. package/dist/s-error-layout/s-error-layout.js +60 -51
  92. package/dist/s-file-dropzone/index.js +2 -2
  93. package/dist/s-file-dropzone/s-file-dropzone.d.ts +6 -51
  94. package/dist/s-file-dropzone/s-file-dropzone.js +64 -54
  95. package/dist/s-file-icon/index.js +2 -2
  96. package/dist/s-file-icon/s-file-icon.d.ts +5 -25
  97. package/dist/s-file-icon/s-file-icon.js +14 -8
  98. package/dist/s-flex-box/index.js +2 -2
  99. package/dist/s-flex-box/s-flex-box.d.ts +10 -1
  100. package/dist/s-flex-box/s-flex-box.js +14 -4
  101. package/dist/s-form/index.js +2 -2
  102. package/dist/s-form/s-form.d.ts +5 -14
  103. package/dist/s-form/s-form.js +19 -9
  104. package/dist/s-gallery/index.js +33 -3
  105. package/dist/s-gallery/s-gallery.d.ts +3 -36
  106. package/dist/s-gallery/s-gallery.js +108 -78
  107. package/dist/s-glow-button/s-glow-button.d.ts +6 -42
  108. package/dist/s-glow-button/s-glow-button.js +29 -47
  109. package/dist/s-gradient-icon/index.d.ts +1 -1
  110. package/dist/s-gradient-icon/index.js +1 -1
  111. package/dist/s-gradient-icon/s-gradient-icon.d.ts +8 -68
  112. package/dist/s-gradient-icon/s-gradient-icon.js +54 -44
  113. package/dist/s-i18n-provider/index.js +1 -1
  114. package/dist/s-i18n-provider/s-i18n-provider.d.ts +5 -33
  115. package/dist/s-i18n-provider/s-i18n-provider.js +25 -15
  116. package/dist/s-icon-button/index.js +2 -2
  117. package/dist/s-icon-button/s-icon-button.d.ts +6 -19
  118. package/dist/s-icon-button/s-icon-button.js +14 -4
  119. package/dist/s-image-comparison/s-image-comparison.js +50 -45
  120. package/dist/s-image-modal/index.js +3 -3
  121. package/dist/s-image-modal/s-image-modal.d.ts +4 -20
  122. package/dist/s-image-modal/s-image-modal.js +150 -135
  123. package/dist/s-item-not-found/index.js +2 -2
  124. package/dist/s-item-not-found/s-item-not-found.d.ts +14 -1
  125. package/dist/s-item-not-found/s-item-not-found.js +21 -10
  126. package/dist/s-label/index.js +2 -2
  127. package/dist/s-label/s-label.d.ts +9 -25
  128. package/dist/s-label/s-label.js +19 -9
  129. package/dist/s-language-switcher/index.js +3 -3
  130. package/dist/s-language-switcher/s-language-switcher.d.ts +20 -33
  131. package/dist/s-language-switcher/s-language-switcher.js +137 -115
  132. package/dist/s-lazy-image/index.js +10 -2
  133. package/dist/s-lazy-image/s-lazy-image.d.ts +12 -58
  134. package/dist/s-lazy-image/s-lazy-image.js +53 -58
  135. package/dist/s-localization-provider/index.js +2 -2
  136. package/dist/s-localization-provider/s-localization-provider.d.ts +6 -27
  137. package/dist/s-localization-provider/s-localization-provider.js +157 -149
  138. package/dist/s-moving-border/index.js +2 -2
  139. package/dist/s-moving-border/s-moving-border.d.ts +3 -33
  140. package/dist/s-moving-border/s-moving-border.js +65 -55
  141. package/dist/s-multi-select/index.js +2 -2
  142. package/dist/s-multi-select/s-multi-select.d.ts +5 -15
  143. package/dist/s-multi-select/s-multi-select.js +54 -45
  144. package/dist/s-no-ssr/index.js +2 -2
  145. package/dist/s-no-ssr/s-no-ssr.d.ts +5 -33
  146. package/dist/s-no-ssr/s-no-ssr.js +21 -11
  147. package/dist/s-overlay-scrollbar/index.js +2 -2
  148. package/dist/s-overlay-scrollbar/s-overlay-scrollbar.d.ts +10 -1
  149. package/dist/s-overlay-scrollbar/s-overlay-scrollbar.js +16 -11
  150. package/dist/s-pagination/index.js +2 -2
  151. package/dist/s-pagination/s-pagination.d.ts +5 -23
  152. package/dist/s-pagination/s-pagination.js +17 -11
  153. package/dist/s-pixel-reveal/index.d.ts +2 -0
  154. package/dist/s-pixel-reveal/index.js +4 -0
  155. package/dist/s-pixel-reveal/package.json +5 -0
  156. package/dist/s-pixel-reveal/s-pixel-reveal.d.ts +27 -0
  157. package/dist/s-pixel-reveal/s-pixel-reveal.js +156 -0
  158. package/dist/s-radial-pulse-animate/index.js +2 -2
  159. package/dist/s-radial-pulse-animate/s-radial-pulse-animate.d.ts +12 -1
  160. package/dist/s-radial-pulse-animate/s-radial-pulse-animate.js +52 -42
  161. package/dist/s-rating/index.js +2 -2
  162. package/dist/s-rating/s-rating.d.ts +7 -1
  163. package/dist/s-rating/s-rating.js +15 -5
  164. package/dist/s-review/index.js +2 -2
  165. package/dist/s-review/s-review.d.ts +25 -1
  166. package/dist/s-review/s-review.js +104 -97
  167. package/dist/s-scroll-reveal/index.js +2 -2
  168. package/dist/s-scroll-reveal/s-scroll-reveal.d.ts +17 -36
  169. package/dist/s-scroll-reveal/s-scroll-reveal.js +43 -33
  170. package/dist/s-scroll-to-top/index.js +2 -2
  171. package/dist/s-scroll-to-top/s-scroll-to-top.d.ts +12 -17
  172. package/dist/s-scroll-to-top/s-scroll-to-top.js +20 -15
  173. package/dist/s-select/index.js +2 -2
  174. package/dist/s-select/s-select.d.ts +3 -22
  175. package/dist/s-select/s-select.js +76 -72
  176. package/dist/s-select-list/index.js +2 -2
  177. package/dist/s-select-list/s-select-list.d.ts +16 -19
  178. package/dist/s-select-list/s-select-list.js +33 -28
  179. package/dist/s-skeleton/index.js +2 -2
  180. package/dist/s-skeleton/s-skeleton.d.ts +6 -22
  181. package/dist/s-skeleton/s-skeleton.js +28 -18
  182. package/dist/s-snackbar-message/index.js +4 -4
  183. package/dist/s-snackbar-message/s-snackbar-message.d.ts +5 -23
  184. package/dist/s-snackbar-message/s-snackbar-message.js +38 -31
  185. package/dist/s-spotlight-cursor/index.js +2 -2
  186. package/dist/s-spotlight-cursor/s-spotlight-cursor.d.ts +10 -44
  187. package/dist/s-spotlight-cursor/s-spotlight-cursor.js +35 -29
  188. package/dist/s-stripe/index.d.ts +4 -1
  189. package/dist/s-stripe/index.js +7 -4
  190. package/dist/s-stripe/s-stripe-cvc.d.ts +8 -0
  191. package/dist/s-stripe/s-stripe-cvc.js +15 -0
  192. package/dist/s-stripe/s-stripe-expiry.d.ts +8 -0
  193. package/dist/s-stripe/s-stripe-expiry.js +15 -0
  194. package/dist/s-stripe/s-stripe-number.d.ts +8 -0
  195. package/dist/s-stripe/s-stripe-number.js +15 -0
  196. package/dist/s-stripe/s-stripe.d.ts +6 -85
  197. package/dist/s-stripe/s-stripe.js +24 -27
  198. package/dist/s-stripe/stripe-input.js +22 -18
  199. package/dist/s-tabs/index.js +6 -6
  200. package/dist/s-tabs/s-tab-panel.d.ts +11 -1
  201. package/dist/s-tabs/s-tab-panel.js +25 -16
  202. package/dist/s-tabs/s-tab.js +9 -5
  203. package/dist/s-tabs/s-tabs.d.ts +24 -3
  204. package/dist/s-tabs/s-tabs.js +34 -25
  205. package/dist/s-text-editor/index.js +3 -3
  206. package/dist/s-text-editor/s-text-editor-toolbar.js +91 -76
  207. package/dist/s-text-editor/s-text-editor.d.ts +13 -11
  208. package/dist/s-text-editor/s-text-editor.js +44 -30
  209. package/dist/s-text-field/index.js +2 -2
  210. package/dist/s-text-field/s-text-field.d.ts +6 -15
  211. package/dist/s-text-field/s-text-field.js +38 -28
  212. package/dist/s-text-shimmer/index.js +2 -2
  213. package/dist/s-text-shimmer/s-text-shimmer.d.ts +10 -1
  214. package/dist/s-text-shimmer/s-text-shimmer.js +27 -18
  215. package/dist/s-text-truncation/index.js +2 -2
  216. package/dist/s-text-truncation/s-text-truncation.d.ts +9 -38
  217. package/dist/s-text-truncation/s-text-truncation.js +34 -20
  218. package/dist/s-theme-demo/s-theme-demo.js +238 -223
  219. package/dist/s-theme-provider/index.js +1 -1
  220. package/dist/s-theme-provider/s-theme-provider.d.ts +5 -17
  221. package/dist/s-theme-provider/s-theme-provider.js +44 -34
  222. package/dist/s-theme-switch/s-theme-switch.js +23 -19
  223. package/dist/s-tip/index.js +2 -2
  224. package/dist/s-tip/s-tip.d.ts +5 -22
  225. package/dist/s-tip/s-tip.js +22 -12
  226. package/dist/s-two-pane-layout/index.js +10 -2
  227. package/dist/s-two-pane-layout/s-two-pane-layout.d.ts +7 -1
  228. package/dist/s-two-pane-layout/s-two-pane-layout.js +58 -48
  229. package/dist/s-typewriter-text/index.js +2 -2
  230. package/dist/s-typewriter-text/s-typewriter-text.d.ts +17 -1
  231. package/dist/s-typewriter-text/s-typewriter-text.js +37 -27
  232. package/dist/s-zoom-image/index.js +10 -2
  233. package/dist/s-zoom-image/s-zoom-image.d.ts +10 -42
  234. package/dist/s-zoom-image/s-zoom-image.js +62 -52
  235. package/dist/theme/components/alert.d.ts +1440 -1440
  236. package/dist/theme/components/button.d.ts +2156 -2156
  237. package/dist/theme/components/chip.d.ts +2 -2
  238. package/dist/theme/customizations/data-display.js +1 -1
  239. package/dist/{typographyClasses-C7fhAsUD.js → typographyClasses-DDyl9mok.js} +4 -4
  240. package/dist/{useMobilePicker-DgxcRrRB.js → useMobilePicker-C1RZZUWr.js} +1 -1
  241. package/package.json +10 -4
@@ -12,22 +12,9 @@ export interface SChipsProps {
12
12
  /** Text used in overflow chip (default: 'keywords') */
13
13
  overflowText?: string;
14
14
  }
15
- /**
16
- * SChips - A smart chip display component that handles overflow with intelligent truncation.
17
- *
18
- * Key features:
19
- * - Responsive overflow handling that shows '+N more' when chips exceed container width
20
- * - Dynamic width calculation using DOM measurement
21
- * - Tooltip display of hidden chips on hover
22
- * - Click handling for individual chips
23
- * - Automatic recalculation on window resize
24
- * - Configurable overflow text for different use cases
25
- *
26
- * The component uses real DOM measurement to accurately calculate chip widths
27
- * and determines how many chips can fit in the available space.
28
- *
29
- * @param props - SChipsProps with chips array and configuration options
30
- * @returns JSX.Element - Responsive chip display with overflow handling
31
- */
32
- declare const SChips: ({ chips, overflow, onClick, overflowText }: SChipsProps) => React.JSX.Element;
15
+ /** A smart chip display component that handles overflow with intelligent truncation. */
16
+ export declare const SChips: {
17
+ ({ chips, overflow, onClick, overflowText, }: SChipsProps): React.JSX.Element;
18
+ displayName: string;
19
+ };
33
20
  export default SChips;
@@ -1,72 +1,77 @@
1
- import { j as s } from "../jsx-runtime-OVHDjVDe.js";
2
- import { useRef as S, useState as m, useEffect as v } from "react";
3
- import { Box as a, Chip as h, Tooltip as E } from "@mui/material";
4
- const L = ({ chips: n, overflow: r = !0, onClick: l, overflowText: c = "keywords" }) => {
5
- const u = S(null), [w, C] = m([]), [W, j] = m([]), [x, y] = m(0), p = () => {
6
- var f;
7
- const t = ((f = u.current) == null ? void 0 : f.offsetWidth) || 0;
8
- let e = 0, i = 0;
9
- for (let o = 0; o < n.length; o++) {
10
- const b = d(n[o]);
11
- if (e + b <= t)
12
- e += b, i++;
1
+ import { j as n } from "../jsx-runtime-OVHDjVDe.js";
2
+ import { useRef as j, useState as c, useEffect as k } from "react";
3
+ import { Box as l, Chip as u, Tooltip as V } from "@mui/material";
4
+ const h = ({
5
+ chips: e,
6
+ overflow: s = !0,
7
+ onClick: a,
8
+ overflowText: m = "keywords"
9
+ }) => {
10
+ const f = j(null), [v, g] = c([]), [C, b] = c([]), [w, _] = c(0), p = () => {
11
+ var y;
12
+ const i = ((y = f.current) == null ? void 0 : y.offsetWidth) || 0;
13
+ let t = 0, r = 0;
14
+ for (let o = 0; o < e.length; o++) {
15
+ const x = d(e[o]);
16
+ if (t + x <= i)
17
+ t += x, r++;
13
18
  else
14
19
  break;
15
20
  }
16
- if (i < n.length) {
17
- const o = d(`+${n.length - i} ${c}`);
18
- for (; e + o > t && i > 0; )
19
- i--, e -= d(n[i]);
21
+ if (r < e.length) {
22
+ const o = d(`+${e.length - r} ${m}`);
23
+ for (; t + o > i && r > 0; )
24
+ r--, t -= d(e[r]);
20
25
  }
21
- C(n.slice(0, i)), j(n.slice(i)), y(n.length - i);
22
- }, d = (t) => {
23
- const e = document.createElement("span");
24
- e.style.visibility = "hidden", e.style.position = "absolute", e.style.whiteSpace = "nowrap", e.textContent = t.trim(), document.body.appendChild(e);
25
- const i = e.offsetWidth;
26
- return document.body.removeChild(e), i + 16;
27
- }, g = r ? { textOverflow: "ellipsis", whiteSpace: "nowrap", overflow: "hidden" } : {};
28
- return v(() => {
29
- if (r)
26
+ g(e.slice(0, r)), b(e.slice(r)), _(e.length - r);
27
+ }, d = (i) => {
28
+ const t = document.createElement("span");
29
+ t.style.visibility = "hidden", t.style.position = "absolute", t.style.whiteSpace = "nowrap", t.textContent = i.trim(), document.body.appendChild(t);
30
+ const r = t.offsetWidth;
31
+ return document.body.removeChild(t), r + 16;
32
+ }, W = s ? { textOverflow: "ellipsis", whiteSpace: "nowrap", overflow: "hidden" } : {};
33
+ return k(() => {
34
+ if (s)
30
35
  return p(), window.addEventListener("resize", p), () => {
31
36
  window.removeEventListener("resize", p);
32
37
  };
33
- }, [n, r]), /* @__PURE__ */ s.jsxs(a, { ref: u, display: "flex", maxWidth: "100%", flexWrap: r ? "nowrap" : "wrap", ...g, children: [
34
- (r ? w : n).map((t) => /* @__PURE__ */ s.jsx(
35
- a,
38
+ }, [e, s]), /* @__PURE__ */ n.jsxs(l, { ref: f, display: "flex", maxWidth: "100%", flexWrap: s ? "nowrap" : "wrap", ...W, children: [
39
+ (s ? v : e).map((i) => /* @__PURE__ */ n.jsx(
40
+ l,
36
41
  {
37
42
  component: "span",
38
43
  textTransform: "lowercase",
39
44
  onClick: () => {
40
- l == null || l(t);
45
+ a == null || a(i);
41
46
  },
42
- children: /* @__PURE__ */ s.jsx(
43
- h,
47
+ children: /* @__PURE__ */ n.jsx(
48
+ u,
44
49
  {
45
- label: t.trim(),
50
+ label: i.trim(),
46
51
  sx: {
47
52
  mr: 1,
48
53
  mb: 1,
49
54
  userSelect: "none",
50
- cursor: l ? "pointer" : "default"
55
+ cursor: a ? "pointer" : "default"
51
56
  }
52
57
  }
53
58
  )
54
59
  },
55
- t
60
+ i
56
61
  )),
57
- r && x > 0 && /* @__PURE__ */ s.jsx(
58
- E,
62
+ s && w > 0 && /* @__PURE__ */ n.jsx(
63
+ V,
59
64
  {
60
65
  slotProps: {
61
66
  tooltip: { style: { padding: "0.5rem" } }
62
67
  },
63
68
  arrow: !0,
64
69
  placement: "top",
65
- title: /* @__PURE__ */ s.jsx(a, { display: "flex", gap: 1, maxWidth: "240px", flexWrap: "wrap", children: W.map((t) => /* @__PURE__ */ s.jsx(h, { label: t.trim() }, t)) }),
66
- children: /* @__PURE__ */ s.jsx(a, { component: "span", textTransform: "lowercase", children: /* @__PURE__ */ s.jsx(
67
- h,
70
+ title: /* @__PURE__ */ n.jsx(l, { display: "flex", gap: 1, maxWidth: "240px", flexWrap: "wrap", children: C.map((i) => /* @__PURE__ */ n.jsx(u, { label: i.trim() }, i)) }),
71
+ children: /* @__PURE__ */ n.jsx(l, { component: "span", textTransform: "lowercase", children: /* @__PURE__ */ n.jsx(
72
+ u,
68
73
  {
69
- label: `+${x} ${c}`,
74
+ label: `+${w} ${m}`,
70
75
  variant: "outlined",
71
76
  sx: { mr: 1, mb: 1, userSelect: "none", cursor: "pointer" }
72
77
  }
@@ -75,6 +80,16 @@ const L = ({ chips: n, overflow: r = !0, onClick: l, overflowText: c = "keywords
75
80
  )
76
81
  ] });
77
82
  };
83
+ h.displayName = "SChips";
84
+ try {
85
+ h.displayName = "SChips", h.__docgenInfo = { description: "A smart chip display component that handles overflow with intelligent truncation.", displayName: "SChips", props: { chips: { defaultValue: null, description: "Array of strings to display as chips", name: "chips", required: !0, type: { name: "string[]" } }, overflow: { defaultValue: { value: "true" }, description: "Whether to handle overflow with '+N more' chip (default: true)", name: "overflow", required: !1, type: { name: "boolean" } }, onClick: { defaultValue: null, description: "Callback fired when a chip is clicked", name: "onClick", required: !1, type: { name: "((tag: string) => void)" } }, overflowText: { defaultValue: { value: "keywords" }, description: "Text used in overflow chip (default: 'keywords')", name: "overflowText", required: !1, type: { name: "string" } } } };
86
+ } catch {
87
+ }
88
+ try {
89
+ schips.displayName = "schips", schips.__docgenInfo = { description: "A smart chip display component that handles overflow with intelligent truncation.", displayName: "schips", props: { chips: { defaultValue: null, description: "Array of strings to display as chips", name: "chips", required: !0, type: { name: "string[]" } }, overflow: { defaultValue: { value: "true" }, description: "Whether to handle overflow with '+N more' chip (default: true)", name: "overflow", required: !1, type: { name: "boolean" } }, onClick: { defaultValue: null, description: "Callback fired when a chip is clicked", name: "onClick", required: !1, type: { name: "((tag: string) => void)" } }, overflowText: { defaultValue: { value: "keywords" }, description: "Text used in overflow chip (default: 'keywords')", name: "overflowText", required: !1, type: { name: "string" } } } };
90
+ } catch {
91
+ }
78
92
  export {
79
- L as default
93
+ h as SChips,
94
+ h as default
80
95
  };
@@ -1,4 +1,4 @@
1
- import { default as o } from "./s-comment-message.js";
1
+ import { SCommentMessage as m } from "./s-comment-message.js";
2
2
  export {
3
- o as default
3
+ m as default
4
4
  };
@@ -1,25 +1,50 @@
1
1
  import { default as React } from 'react';
2
2
  import { SxProps } from '@mui/material';
3
+ /**
4
+ * Props interface for SCommentMessage component
5
+ */
3
6
  export interface SCommentMessageProps {
7
+ /** Unique identifier for the comment */
4
8
  id?: string | number;
9
+ /** Name of the user who posted the comment */
5
10
  userName: string;
11
+ /** URL of the user avatar image */
6
12
  userAvatar?: string;
13
+ /** The text content of the comment */
7
14
  commentContent: string;
15
+ /** Date/time when the comment was posted */
8
16
  datetime: Date | string;
17
+ /** Number of likes the comment has received */
9
18
  likes?: number;
19
+ /** Whether the current user has liked this comment */
10
20
  isLiked?: boolean;
21
+ /** Array of reply comments */
11
22
  replies?: SCommentMessageProps[];
23
+ /** Total count of replies to display */
12
24
  totalReplies?: number;
25
+ /** Callback function triggered when the like button is clicked */
13
26
  onLike?: (commentId: string | number) => void;
27
+ /** Callback function triggered when the reply button is clicked */
14
28
  onReply?: (commentId: string | number, parentId?: string | number) => void;
29
+ /** Callback function triggered when the expand/collapse replies button is clicked */
15
30
  onToggleReplies?: (commentId: string | number) => void;
31
+ /** Whether to show replies and the expand/collapse functionality */
16
32
  showReplies?: boolean;
33
+ /** Size of the avatar in pixels */
17
34
  avatarSize?: number;
35
+ /** Current nesting level of the comment */
18
36
  level?: number;
37
+ /** Maximum nesting level allowed before stopping further indentation */
19
38
  maxLevel?: number;
39
+ /** Whether to show skeleton loading state instead of content */
20
40
  loading?: boolean;
41
+ /** Custom content to display below the comment actions */
21
42
  children?: React.ReactNode;
43
+ /** Material-UI sx prop for custom styling */
22
44
  sx?: SxProps;
23
45
  }
24
- declare const SCommentMessage: React.FC<SCommentMessageProps>;
46
+ /**
47
+ * A comprehensive comment message component with avatar display, user information, relative timestamps, like functionality, and nested reply support.
48
+ */
49
+ export declare const SCommentMessage: React.FC<SCommentMessageProps>;
25
50
  export default SCommentMessage;
@@ -1,125 +1,131 @@
1
- import { j as t } from "../jsx-runtime-OVHDjVDe.js";
2
- import { useState as S, useEffect as R } from "react";
3
- import { Box as c, Stack as x, Typography as g, IconButton as q, Button as F, Collapse as G } from "@mui/material";
4
- import J from "../s-avatar/s-avatar.js";
5
- import e from "../s-skeleton/s-skeleton.js";
6
- import { F as K } from "../Favorite-DS5Gpq2s.js";
7
- import { c as L } from "../createSvgIcon-DxwgGAVe.js";
8
- import { E as O } from "../ExpandMore-DTWX_mHf.js";
9
- const Q = L(/* @__PURE__ */ t.jsx("path", {
1
+ import { j as e } from "../jsx-runtime-OVHDjVDe.js";
2
+ import { useState as M, useEffect as _ } from "react";
3
+ import { Box as d, Stack as m, Typography as h, IconButton as U, Button as N, Collapse as H } from "@mui/material";
4
+ import { SAvatar as Y } from "../s-avatar/s-avatar.js";
5
+ import { SSkeleton as t } from "../s-skeleton/s-skeleton.js";
6
+ import { F as G } from "../Favorite-DS5Gpq2s.js";
7
+ import { c as C } from "../createSvgIcon-DxwgGAVe.js";
8
+ import { E as J } from "../ExpandMore-DTWX_mHf.js";
9
+ const K = C(/* @__PURE__ */ e.jsx("path", {
10
10
  d: "m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"
11
- }), "ExpandLess"), U = L(/* @__PURE__ */ t.jsx("path", {
11
+ }), "ExpandLess"), O = C(/* @__PURE__ */ e.jsx("path", {
12
12
  d: "M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3m-4.4 15.55-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05"
13
- }), "FavoriteBorder"), X = L(/* @__PURE__ */ t.jsx("path", {
13
+ }), "FavoriteBorder"), Q = C(/* @__PURE__ */ e.jsx("path", {
14
14
  d: "M10 9V5l-7 7 7 7v-4.1c5 0 8.5 1.6 11 5.1-1-5-4-10-11-11"
15
- }), "Reply"), Z = (i) => {
16
- const d = /* @__PURE__ */ new Date(), j = typeof i == "string" ? new Date(i) : i, p = d.getTime() - j.getTime(), f = Math.floor(p / 1e3), n = Math.floor(f / 60), o = Math.floor(n / 60), s = Math.floor(o / 24), h = Math.floor(s / 7), r = Math.floor(s / 30), a = Math.floor(s / 365);
17
- return f < 60 ? "just now" : n < 60 ? n === 1 ? "1 minute ago" : `${n} minutes ago` : o < 24 ? o === 1 ? "1 hour ago" : `${o} hours ago` : s < 7 ? s === 1 ? "1 day ago" : `${s} days ago` : h < 4 ? h === 1 ? "1 week ago" : `${h} weeks ago` : r < 12 ? r === 1 ? "1 month ago" : `${r} months ago` : a === 1 ? "1 year ago" : `${a} years ago`;
18
- }, _ = ({
19
- id: i = Date.now(),
20
- userName: d,
21
- userAvatar: j,
22
- commentContent: p,
23
- datetime: f,
24
- likes: n = 0,
25
- isLiked: o = !1,
26
- replies: s = [],
27
- totalReplies: h,
15
+ }), "Reply"), X = (a) => {
16
+ const u = /* @__PURE__ */ new Date(), g = typeof a == "string" ? new Date(a) : a, y = u.getTime() - g.getTime(), p = Math.floor(y / 1e3), i = Math.floor(p / 60), s = Math.floor(i / 60), n = Math.floor(s / 24), c = Math.floor(n / 7), r = Math.floor(n / 30), o = Math.floor(n / 365);
17
+ return p < 60 ? "just now" : i < 60 ? i === 1 ? "1 minute ago" : `${i} minutes ago` : s < 24 ? s === 1 ? "1 hour ago" : `${s} hours ago` : n < 7 ? n === 1 ? "1 day ago" : `${n} days ago` : c < 4 ? c === 1 ? "1 week ago" : `${c} weeks ago` : r < 12 ? r === 1 ? "1 month ago" : `${r} months ago` : o === 1 ? "1 year ago" : `${o} years ago`;
18
+ }, x = ({
19
+ id: a = Date.now(),
20
+ userName: u,
21
+ userAvatar: g,
22
+ commentContent: y,
23
+ datetime: p,
24
+ likes: i = 0,
25
+ isLiked: s = !1,
26
+ replies: n = [],
27
+ totalReplies: c,
28
28
  onLike: r,
29
- onReply: a,
30
- onToggleReplies: C,
31
- showReplies: u = !0,
32
- avatarSize: m = 48,
33
- level: b = 0,
34
- maxLevel: z = 3,
35
- loading: T = !1,
36
- children: k,
37
- sx: $ = {}
29
+ onReply: o,
30
+ onToggleReplies: q,
31
+ showReplies: v = !0,
32
+ avatarSize: f = 48,
33
+ level: S = 0,
34
+ maxLevel: V = 3,
35
+ loading: $ = !1,
36
+ children: L,
37
+ sx: R = {}
38
38
  }) => {
39
- const [E, v] = S(n), [w, I] = S(o), [y, H] = S(!1), W = () => {
40
- w ? (v((l) => Math.max(0, l - 1)), I(!1)) : (v((l) => l + 1), I(!0)), r && r(i);
41
- }, A = () => {
42
- a && a(i);
43
- }, P = () => {
44
- H(!y), C && C(i);
45
- }, V = Z(f), M = h ?? s.length, B = M > 0, D = Math.min(b, z) * 2;
46
- return R(() => {
47
- v(n);
48
- }, [n]), R(() => {
49
- I(o);
50
- }, [o]), T ? /* @__PURE__ */ t.jsx(c, { sx: { pl: D, py: 1, ...$ }, children: /* @__PURE__ */ t.jsxs(x, { direction: "row", spacing: 2, alignItems: "flex-start", children: [
51
- /* @__PURE__ */ t.jsx(e, { component: "rounded-avatar", width: m, height: m }),
52
- /* @__PURE__ */ t.jsxs(c, { sx: { flex: 1 }, children: [
53
- /* @__PURE__ */ t.jsxs(x, { direction: "row", alignItems: "center", spacing: 2, mb: 1, children: [
54
- /* @__PURE__ */ t.jsx(e, { variant: "text", width: 120, height: 20 }),
55
- /* @__PURE__ */ t.jsx(e, { variant: "text", width: 80, height: 16 })
39
+ const [z, j] = M(i), [w, b] = M(s), [I, E] = M(!1), A = () => {
40
+ w ? (j((l) => Math.max(0, l - 1)), b(!1)) : (j((l) => l + 1), b(!0)), r && r(a);
41
+ }, B = () => {
42
+ o && o(a);
43
+ }, W = () => {
44
+ E(!I), q && q(a);
45
+ }, F = X(p), k = c ?? n.length, D = k > 0, T = Math.min(S, V) * 2;
46
+ return _(() => {
47
+ j(i);
48
+ }, [i]), _(() => {
49
+ b(s);
50
+ }, [s]), $ ? /* @__PURE__ */ e.jsx(d, { sx: { pl: T, py: 1, ...R }, children: /* @__PURE__ */ e.jsxs(m, { direction: "row", spacing: 2, alignItems: "flex-start", children: [
51
+ /* @__PURE__ */ e.jsx(t, { component: "rounded-avatar", width: f, height: f }),
52
+ /* @__PURE__ */ e.jsxs(d, { sx: { flex: 1 }, children: [
53
+ /* @__PURE__ */ e.jsxs(m, { direction: "row", alignItems: "center", spacing: 2, mb: 1, children: [
54
+ /* @__PURE__ */ e.jsx(t, { variant: "text", width: 120, height: 20 }),
55
+ /* @__PURE__ */ e.jsx(t, { variant: "text", width: 80, height: 16 })
56
56
  ] }),
57
- /* @__PURE__ */ t.jsx(e, { variant: "text", width: "100%", height: 16, sx: { mb: 0.5 } }),
58
- /* @__PURE__ */ t.jsx(e, { variant: "text", width: "85%", height: 16, sx: { mb: 0.5 } }),
59
- /* @__PURE__ */ t.jsx(e, { variant: "text", width: "70%", height: 16, sx: { mb: 2 } }),
60
- /* @__PURE__ */ t.jsxs(x, { direction: "row", spacing: 1, alignItems: "center", children: [
61
- /* @__PURE__ */ t.jsx(e, { component: "icon-button" }),
62
- /* @__PURE__ */ t.jsx(e, { variant: "text", width: 20, height: 16 }),
63
- /* @__PURE__ */ t.jsx(e, { variant: "text", width: 60, height: 32 }),
64
- /* @__PURE__ */ t.jsx(e, { variant: "text", width: 80, height: 32 })
57
+ /* @__PURE__ */ e.jsx(t, { variant: "text", width: "100%", height: 16, sx: { mb: 0.5 } }),
58
+ /* @__PURE__ */ e.jsx(t, { variant: "text", width: "85%", height: 16, sx: { mb: 0.5 } }),
59
+ /* @__PURE__ */ e.jsx(t, { variant: "text", width: "70%", height: 16, sx: { mb: 2 } }),
60
+ /* @__PURE__ */ e.jsxs(m, { direction: "row", spacing: 1, alignItems: "center", children: [
61
+ /* @__PURE__ */ e.jsx(t, { component: "icon-button" }),
62
+ /* @__PURE__ */ e.jsx(t, { variant: "text", width: 20, height: 16 }),
63
+ /* @__PURE__ */ e.jsx(t, { variant: "text", width: 60, height: 32 }),
64
+ /* @__PURE__ */ e.jsx(t, { variant: "text", width: 80, height: 32 })
65
65
  ] })
66
66
  ] })
67
- ] }) }) : /* @__PURE__ */ t.jsxs(c, { sx: { pl: D, py: 1, ...$ }, children: [
68
- /* @__PURE__ */ t.jsxs(x, { direction: "row", spacing: 2, alignItems: "flex-start", children: [
69
- /* @__PURE__ */ t.jsx(J, { avatar: j, name: d, size: m }),
70
- /* @__PURE__ */ t.jsxs(c, { sx: { flex: 1 }, children: [
71
- /* @__PURE__ */ t.jsxs(x, { direction: "row", alignItems: "center", spacing: 2, mb: 1, children: [
72
- /* @__PURE__ */ t.jsx(g, { variant: "subtitle2", fontWeight: "600", children: d }),
73
- /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(g, { variant: "caption", color: "text.secondary", children: V }) })
67
+ ] }) }) : /* @__PURE__ */ e.jsxs(d, { sx: { pl: T, py: 1, ...R }, children: [
68
+ /* @__PURE__ */ e.jsxs(m, { direction: "row", spacing: 2, alignItems: "flex-start", children: [
69
+ /* @__PURE__ */ e.jsx(Y, { avatar: g, name: u, size: f }),
70
+ /* @__PURE__ */ e.jsxs(d, { sx: { flex: 1 }, children: [
71
+ /* @__PURE__ */ e.jsxs(m, { direction: "row", alignItems: "center", spacing: 2, mb: 1, children: [
72
+ /* @__PURE__ */ e.jsx(h, { variant: "subtitle2", fontWeight: "600", children: u }),
73
+ /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(h, { variant: "caption", color: "text.secondary", children: F }) })
74
74
  ] }),
75
- /* @__PURE__ */ t.jsx(g, { variant: "body2", sx: { mb: 2, lineHeight: 1.6 }, children: p }),
76
- /* @__PURE__ */ t.jsxs(x, { direction: "row", spacing: 1, alignItems: "center", children: [
77
- /* @__PURE__ */ t.jsx(
78
- q,
75
+ /* @__PURE__ */ e.jsx(h, { variant: "body2", sx: { mb: 2, lineHeight: 1.6 }, children: y }),
76
+ /* @__PURE__ */ e.jsxs(m, { direction: "row", spacing: 1, alignItems: "center", children: [
77
+ /* @__PURE__ */ e.jsx(
78
+ U,
79
79
  {
80
80
  size: "small",
81
- onClick: W,
81
+ onClick: A,
82
82
  sx: {
83
83
  color: w ? "error.main" : "text.secondary"
84
84
  },
85
- children: w ? /* @__PURE__ */ t.jsx(K, { fontSize: "small" }) : /* @__PURE__ */ t.jsx(U, { fontSize: "small" })
85
+ children: w ? /* @__PURE__ */ e.jsx(G, { fontSize: "small" }) : /* @__PURE__ */ e.jsx(O, { fontSize: "small" })
86
86
  }
87
87
  ),
88
- E > 0 && /* @__PURE__ */ t.jsx(g, { variant: "caption", color: "text.secondary", children: E }),
89
- /* @__PURE__ */ t.jsx(F, { size: "small", startIcon: /* @__PURE__ */ t.jsx(X, { fontSize: "small" }), onClick: A, variant: "text", children: "Reply" }),
90
- B && u && /* @__PURE__ */ t.jsxs(
91
- F,
88
+ z > 0 && /* @__PURE__ */ e.jsx(h, { variant: "caption", color: "text.secondary", children: z }),
89
+ /* @__PURE__ */ e.jsx(N, { size: "small", startIcon: /* @__PURE__ */ e.jsx(Q, { fontSize: "small" }), onClick: B, variant: "text", children: "Reply" }),
90
+ D && v && /* @__PURE__ */ e.jsxs(
91
+ N,
92
92
  {
93
93
  size: "small",
94
- startIcon: y ? /* @__PURE__ */ t.jsx(Q, { fontSize: "small" }) : /* @__PURE__ */ t.jsx(O, { fontSize: "small" }),
95
- onClick: P,
94
+ startIcon: I ? /* @__PURE__ */ e.jsx(K, { fontSize: "small" }) : /* @__PURE__ */ e.jsx(J, { fontSize: "small" }),
95
+ onClick: W,
96
96
  variant: "text",
97
97
  children: [
98
- M,
98
+ k,
99
99
  " ",
100
- M === 1 ? "reply" : "replies"
100
+ k === 1 ? "reply" : "replies"
101
101
  ]
102
102
  }
103
103
  )
104
104
  ] }),
105
- k && /* @__PURE__ */ t.jsx(c, { sx: { mt: 2 }, children: k })
105
+ L && /* @__PURE__ */ e.jsx(d, { sx: { mt: 2 }, children: L })
106
106
  ] })
107
107
  ] }),
108
- B && u && /* @__PURE__ */ t.jsx(G, { in: y, children: /* @__PURE__ */ t.jsx(c, { sx: { mt: 2 }, children: s.map((l, Y) => /* @__PURE__ */ t.jsx(
109
- _,
108
+ D && v && /* @__PURE__ */ e.jsx(H, { in: I, children: /* @__PURE__ */ e.jsx(d, { sx: { mt: 2 }, children: n.map((l, P) => /* @__PURE__ */ e.jsx(
109
+ x,
110
110
  {
111
111
  ...l,
112
- level: b + 1,
113
- maxLevel: z,
112
+ level: S + 1,
113
+ maxLevel: V,
114
114
  onLike: r,
115
- onReply: a,
116
- showReplies: u,
117
- avatarSize: Math.max(32, m - 8)
115
+ onReply: o,
116
+ showReplies: v,
117
+ avatarSize: Math.max(32, f - 8)
118
118
  },
119
- l.id || `reply-${Y}`
119
+ l.id || `reply-${P}`
120
120
  )) }) })
121
121
  ] });
122
122
  };
123
+ x.displayName = "SCommentMessage";
124
+ try {
125
+ x.displayName = "SCommentMessage", x.__docgenInfo = { description: "A comprehensive comment message component with avatar display, user information, relative timestamps, like functionality, and nested reply support.", displayName: "SCommentMessage", props: { id: { defaultValue: { value: "Date.now()" }, description: "Unique identifier for the comment", name: "id", required: !1, type: { name: "string | number" } }, userName: { defaultValue: null, description: "Name of the user who posted the comment", name: "userName", required: !0, type: { name: "string" } }, userAvatar: { defaultValue: null, description: "URL of the user avatar image", name: "userAvatar", required: !1, type: { name: "string" } }, commentContent: { defaultValue: null, description: "The text content of the comment", name: "commentContent", required: !0, type: { name: "string" } }, datetime: { defaultValue: null, description: "Date/time when the comment was posted", name: "datetime", required: !0, type: { name: "string | Date" } }, likes: { defaultValue: { value: "0" }, description: "Number of likes the comment has received", name: "likes", required: !1, type: { name: "number" } }, isLiked: { defaultValue: { value: "false" }, description: "Whether the current user has liked this comment", name: "isLiked", required: !1, type: { name: "boolean" } }, replies: { defaultValue: { value: "[]" }, description: "Array of reply comments", name: "replies", required: !1, type: { name: "SCommentMessageProps[]" } }, totalReplies: { defaultValue: null, description: "Total count of replies to display", name: "totalReplies", required: !1, type: { name: "number" } }, onLike: { defaultValue: null, description: "Callback function triggered when the like button is clicked", name: "onLike", required: !1, type: { name: "((commentId: string | number) => void)" } }, onReply: { defaultValue: null, description: "Callback function triggered when the reply button is clicked", name: "onReply", required: !1, type: { name: "((commentId: string | number, parentId?: string | number) => void)" } }, onToggleReplies: { defaultValue: null, description: "Callback function triggered when the expand/collapse replies button is clicked", name: "onToggleReplies", required: !1, type: { name: "((commentId: string | number) => void)" } }, showReplies: { defaultValue: { value: "true" }, description: "Whether to show replies and the expand/collapse functionality", name: "showReplies", required: !1, type: { name: "boolean" } }, avatarSize: { defaultValue: { value: "48" }, description: "Size of the avatar in pixels", name: "avatarSize", required: !1, type: { name: "number" } }, level: { defaultValue: { value: "0" }, description: "Current nesting level of the comment", name: "level", required: !1, type: { name: "number" } }, maxLevel: { defaultValue: { value: "3" }, description: "Maximum nesting level allowed before stopping further indentation", name: "maxLevel", required: !1, type: { name: "number" } }, loading: { defaultValue: { value: "false" }, description: "Whether to show skeleton loading state instead of content", name: "loading", required: !1, type: { name: "boolean" } }, children: { defaultValue: null, description: "Custom content to display below the comment actions", name: "children", required: !1, type: { name: "ReactNode" } }, sx: { defaultValue: { value: "{}" }, description: "Material-UI sx prop for custom styling", name: "sx", required: !1, type: { name: "SxProps" } } } };
126
+ } catch {
127
+ }
123
128
  export {
124
- _ as default
129
+ x as SCommentMessage,
130
+ x as default
125
131
  };
@@ -1,4 +1,4 @@
1
- import { default as o } from "./s-copyable-text.js";
1
+ import { SCopyableText as o } from "./s-copyable-text.js";
2
2
  export {
3
3
  o as default
4
4
  };
@@ -1,49 +1,22 @@
1
1
  import { PaperProps, TypographyProps } from '@mui/material';
2
2
  /**
3
- * Props for the SCopyableText component
3
+ * Props interface for SCopyableText component
4
4
  */
5
5
  export interface SCopyableTextProps {
6
6
  /** The text content to display and copy */
7
7
  text?: string;
8
- /** Additional props to pass to the Typography component */
8
+ /** Props to pass to the Typography component for styling */
9
9
  typographyProps?: TypographyProps;
10
- /** Callback function called when text is successfully copied */
10
+ /** Callback function triggered after text is successfully copied */
11
11
  onCopied?: () => void;
12
- /** Additional props to pass to the Paper component */
12
+ /** Props to pass to the Paper component container */
13
13
  paperProps?: PaperProps;
14
14
  }
15
15
  /**
16
- * Text display component with built-in copy-to-clipboard functionality
17
- *
18
- * Displays text content in a styled container with a copy button overlay.
19
- * Features visual feedback when copying is successful and handles copy
20
- * errors gracefully.
21
- *
22
- * Features:
23
- * - One-click copy to clipboard using modern Clipboard API
24
- * - Visual feedback with icon change and color indication
25
- * - Automatic reset of copied state after 2 seconds
26
- * - Styled text container with border and proper spacing
27
- * - Word wrapping and break-word handling for long content
28
- * - Customizable typography through props
29
- * - Optional callback for copy success events
30
- *
31
- * @param text - The text content to display and enable copying for
32
- * @param typographyProps - Additional Material-UI Typography props for styling
33
- * @param onCopied - Optional callback function triggered when copy succeeds
34
- * @returns JSX element containing styled text with copy button, or null if no text
35
- *
36
- * @example
37
- * ```tsx
38
- * <SCopyableText
39
- * text="const apiKey = 'sk-1234567890abcdef';"
40
- * onCopied={() => console.log('API key copied!')}
41
- * typographyProps={{
42
- * variant: 'code',
43
- * color: 'primary'
44
- * }}
45
- * />
46
- * ```
16
+ * A text display component with built-in copy-to-clipboard functionality and visual feedback.
47
17
  */
48
- declare const SCopyableText: ({ text, typographyProps, onCopied, paperProps }: SCopyableTextProps) => import("react/jsx-runtime").JSX.Element | null;
18
+ export declare const SCopyableText: {
19
+ ({ text, typographyProps, onCopied, paperProps }: SCopyableTextProps): import("react/jsx-runtime").JSX.Element | null;
20
+ displayName: string;
21
+ };
49
22
  export default SCopyableText;
@@ -1,25 +1,25 @@
1
1
  import { j as e } from "../jsx-runtime-OVHDjVDe.js";
2
- import { useState as x } from "react";
3
- import { Paper as d, Box as m, IconButton as h, Typography as u } from "@mui/material";
4
- import { c as n } from "../createSvgIcon-DxwgGAVe.js";
5
- const f = n(/* @__PURE__ */ e.jsx("path", {
2
+ import { useState as d } from "react";
3
+ import { Paper as u, Box as y, IconButton as m, Typography as f } from "@mui/material";
4
+ import { c as s } from "../createSvgIcon-DxwgGAVe.js";
5
+ const x = s(/* @__PURE__ */ e.jsx("path", {
6
6
  d: "M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"
7
- }), "Check"), j = n(/* @__PURE__ */ e.jsx("path", {
7
+ }), "Check"), h = s(/* @__PURE__ */ e.jsx("path", {
8
8
  d: "M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"
9
- }), "ContentCopy"), w = ({ text: r, typographyProps: t, onCopied: o, paperProps: a }) => {
10
- const [s, c] = x(!1), i = async () => {
11
- if (r)
9
+ }), "ContentCopy"), r = ({ text: t, typographyProps: o, onCopied: a, paperProps: i }) => {
10
+ const [p, n] = d(!1), l = async () => {
11
+ if (t)
12
12
  try {
13
- await navigator.clipboard.writeText(r), c(!0), setTimeout(() => c(!1), 2e3), o == null || o();
14
- } catch (l) {
15
- console.error("Failed to copy text:", l);
13
+ await navigator.clipboard.writeText(t), n(!0), setTimeout(() => n(!1), 2e3), a == null || a();
14
+ } catch (c) {
15
+ console.error("Failed to copy text:", c);
16
16
  }
17
17
  };
18
- return r ? /* @__PURE__ */ e.jsx(d, { sx: { p: 2, border: "1px dashed", borderColor: "divider" }, ...a, children: /* @__PURE__ */ e.jsxs(m, { sx: { position: "relative" }, children: [
18
+ return t ? /* @__PURE__ */ e.jsx(u, { sx: { p: 2, border: "1px dashed", borderColor: "divider" }, ...i, children: /* @__PURE__ */ e.jsxs(y, { sx: { position: "relative" }, children: [
19
19
  /* @__PURE__ */ e.jsx(
20
- h,
20
+ m,
21
21
  {
22
- onClick: i,
22
+ onClick: l,
23
23
  size: "small",
24
24
  sx: {
25
25
  position: "absolute",
@@ -28,14 +28,14 @@ const f = n(/* @__PURE__ */ e.jsx("path", {
28
28
  right: 0,
29
29
  zIndex: 1,
30
30
  // Ensure button appears above text
31
- color: s ? "success.main" : "inherit"
31
+ color: p ? "success.main" : "inherit"
32
32
  // Green when copied
33
33
  },
34
- children: s ? /* @__PURE__ */ e.jsx(f, {}) : /* @__PURE__ */ e.jsx(j, {})
34
+ children: p ? /* @__PURE__ */ e.jsx(x, {}) : /* @__PURE__ */ e.jsx(h, {})
35
35
  }
36
36
  ),
37
37
  /* @__PURE__ */ e.jsx(
38
- u,
38
+ f,
39
39
  {
40
40
  variant: "body1",
41
41
  sx: {
@@ -43,16 +43,26 @@ const f = n(/* @__PURE__ */ e.jsx("path", {
43
43
  // Preserve whitespace and line breaks
44
44
  wordBreak: "break-word",
45
45
  // Handle long words gracefully
46
- ...t == null ? void 0 : t.sx
46
+ ...o == null ? void 0 : o.sx
47
47
  // Allow custom styling override
48
48
  },
49
49
  color: "text.secondary",
50
- ...t,
51
- children: r
50
+ ...o,
51
+ children: t
52
52
  }
53
53
  )
54
54
  ] }) }) : null;
55
55
  };
56
+ r.displayName = "SCopyableText";
57
+ try {
58
+ r.displayName = "SCopyableText", r.__docgenInfo = { description: "A text display component with built-in copy-to-clipboard functionality and visual feedback.", displayName: "SCopyableText", props: { text: { defaultValue: null, description: "The text content to display and copy", name: "text", required: !1, type: { name: "string" } }, typographyProps: { defaultValue: null, description: "Props to pass to the Typography component for styling", name: "typographyProps", required: !1, type: { name: "TypographyProps" } }, onCopied: { defaultValue: null, description: "Callback function triggered after text is successfully copied", name: "onCopied", required: !1, type: { name: "(() => void)" } }, paperProps: { defaultValue: null, description: "Props to pass to the Paper component container", name: "paperProps", required: !1, type: { name: "PaperProps" } } } };
59
+ } catch {
60
+ }
61
+ try {
62
+ scopyabletext.displayName = "scopyabletext", scopyabletext.__docgenInfo = { description: "A text display component with built-in copy-to-clipboard functionality and visual feedback.", displayName: "scopyabletext", props: { text: { defaultValue: null, description: "The text content to display and copy", name: "text", required: !1, type: { name: "string" } }, typographyProps: { defaultValue: null, description: "Props to pass to the Typography component for styling", name: "typographyProps", required: !1, type: { name: "TypographyProps" } }, onCopied: { defaultValue: null, description: "Callback function triggered after text is successfully copied", name: "onCopied", required: !1, type: { name: "(() => void)" } }, paperProps: { defaultValue: null, description: "Props to pass to the Paper component container", name: "paperProps", required: !1, type: { name: "PaperProps" } } } };
63
+ } catch {
64
+ }
56
65
  export {
57
- w as default
66
+ r as SCopyableText,
67
+ r as default
58
68
  };
@@ -1,3 +1,4 @@
1
1
  export { default as SCountdown } from './s-count-down';
2
- export { SCountBox } from './s-count-down';
3
- export type { SCountDownProps, SCountBoxProps } from './s-count-down';
2
+ export type { SCountDownProps } from './s-count-down';
3
+ export { SCountBox } from './s-count-box';
4
+ export type { SCountBoxProps } from './s-count-box';