@solostylist/ui-kit 1.0.224 → 1.0.226

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 (246) hide show
  1. package/dist/{ArrowUpward-BMKLosZj.js → ArrowUpward-DONVUi9Q.js} +1 -1
  2. package/dist/{ButtonBase-Bo6ysVGS.js → ButtonBase-BDefit5I.js} +100 -99
  3. package/dist/{ChevronRight-OLNOfW9P.js → ChevronRight-cBbrlMYh.js} +1 -1
  4. package/dist/{Close-Bj2HYB9Q.js → Close-DRS0T6Yu.js} +1 -1
  5. package/dist/{Collapse-CnXmaDqT.js → Collapse-Dtji6IrM.js} +4 -3
  6. package/dist/{ContentCopy-Br2p19dq.js → ContentCopy-C4mVqexq.js} +1 -1
  7. package/dist/{Download-BhSXOhCI.js → Download-D277qwl2.js} +1 -1
  8. package/dist/{ExpandMore-Bu7_1g6Q.js → ExpandMore-DIsT5FOp.js} +1 -1
  9. package/dist/{Favorite-BJSuHe0H.js → Favorite-CbvuQfe4.js} +1 -1
  10. package/dist/{FormControl-DYkaP-oD.js → FormControl-DMZWdEWz.js} +6 -6
  11. package/dist/{InfoOutlined-C1AW3f5V.js → InfoOutlined-BCzG-5py.js} +1 -1
  12. package/dist/{Menu-C-0KEauj.js → Menu-CbHevx8q.js} +20 -20
  13. package/dist/{MenuItem-DWivWkNb.js → MenuItem-CCClg9Si.js} +8 -8
  14. package/dist/{MenuList-5HOyYdgq.js → MenuList-5C2nFAWS.js} +45 -45
  15. package/dist/{Modal-C1VRVWBZ.js → Modal-Cu5Cgh-q.js} +109 -108
  16. package/dist/{Paper-BY4X6-u_.js → Paper-Cy7rReyx.js} +1 -1
  17. package/dist/{Typography-EsraKPZO.js → Typography-DqtTB0ZJ.js} +2 -2
  18. package/dist/{UnfoldMoreRounded-pz7NMMy3.js → UnfoldMoreRounded-Cbt8Oi8S.js} +1 -1
  19. package/dist/{autocomplete-qLj7AqcP.js → autocomplete-Du0flrk6.js} +1 -1
  20. package/dist/{avatar-BuMhUthq.js → avatar-DQtjHpOs.js} +2 -2
  21. package/dist/{checkbox-B95Vlykq.js → checkbox-BGA2cVbl.js} +17 -17
  22. package/dist/{createSvgIcon-BdNZIlKS.js → createSvgIcon-HW-tbFcL.js} +1 -1
  23. package/dist/{mergeSlotProps-DBBJwoun.js → mergeSlotProps-slENzJO5.js} +1 -1
  24. package/dist/monthCalendarClasses-C1jHkjgt.js +14 -0
  25. package/dist/s-accordion/index.js +1 -1
  26. package/dist/s-accordion/s-accordion.js +1 -1
  27. package/dist/{s-accordion-CXHBadZ_.js → s-accordion-D2VsBSgb.js} +7 -7
  28. package/dist/s-breadcrumbs/s-breadcrumbs.js +1 -1
  29. package/dist/s-carousel/index.js +1 -1
  30. package/dist/s-carousel/s-carousel.js +1 -1
  31. package/dist/{s-carousel-BUJYCigy.js → s-carousel-S6CRrrpW.js} +7 -9
  32. package/dist/s-category-card/s-category-card.js +0 -1
  33. package/dist/s-chat-input/index.js +1 -1
  34. package/dist/s-chat-input/s-chat-input.js +1 -1
  35. package/dist/s-chat-input-DNptuBb0.js +352 -0
  36. package/dist/s-chat-message/index.js +1 -1
  37. package/dist/s-chat-message/s-chat-message.js +1 -1
  38. package/dist/{s-chat-message-ox4Sj6xh.js → s-chat-message-Bsvsh45G.js} +4 -6
  39. package/dist/s-chips/index.js +1 -1
  40. package/dist/s-chips/s-chips.js +1 -1
  41. package/dist/{s-chips-DelHx6zM.js → s-chips-CH0zKaz-.js} +1 -1
  42. package/dist/s-code-block/index.js +1 -1
  43. package/dist/s-code-block/s-code-block.js +1 -1
  44. package/dist/{s-code-block-sjt0AQb_.js → s-code-block-ByNQ4Zq5.js} +1 -1
  45. package/dist/s-comment-message/index.js +1 -1
  46. package/dist/s-comment-message/s-comment-message.js +1 -1
  47. package/dist/{s-comment-message-DzjXXLZQ.js → s-comment-message-DF580Qxk.js} +13 -19
  48. package/dist/s-copyable-text/s-copyable-text.js +1 -1
  49. package/dist/s-data-table/index.js +1 -1
  50. package/dist/s-data-table/s-data-table.js +1 -1
  51. package/dist/{s-data-table-TrCdKq9r.js → s-data-table-B8llaX-A.js} +9 -9
  52. package/dist/s-date-picker/index.js +1 -1
  53. package/dist/s-date-picker/picker-action-bar.d.ts +12 -0
  54. package/dist/s-date-picker/picker-action-bar.js +52 -0
  55. package/dist/s-date-picker/s-date-picker.d.ts +1 -4
  56. package/dist/s-date-picker/s-date-picker.js +1 -1
  57. package/dist/s-date-picker-CLncO3oo.js +640 -0
  58. package/dist/s-datetime-picker/index.js +1 -1
  59. package/dist/s-datetime-picker/s-datetime-picker.d.ts +1 -4
  60. package/dist/s-datetime-picker/s-datetime-picker.js +1 -1
  61. package/dist/{s-datetime-picker-rCWovez1.js → s-datetime-picker-Dy1fX3rI.js} +806 -799
  62. package/dist/s-dialog/s-dialog.d.ts +3 -3
  63. package/dist/s-dialog/s-dialog.js +8 -8
  64. package/dist/s-dialog-confirm/s-dialog-confirm.d.ts +7 -1
  65. package/dist/s-dialog-confirm/s-dialog-confirm.js +7 -7
  66. package/dist/s-dialog-message/s-dialog-message.js +3 -4
  67. package/dist/s-empty/s-empty.js +2 -5
  68. package/dist/s-error/s-error.js +1 -1
  69. package/dist/s-error-layout/s-error-layout.d.ts +1 -1
  70. package/dist/s-error-layout/s-error-layout.js +3 -2
  71. package/dist/s-file-dropzone/index.js +1 -1
  72. package/dist/s-file-dropzone/s-file-dropzone.d.ts +1 -4
  73. package/dist/s-file-dropzone/s-file-dropzone.js +1 -1
  74. package/dist/{s-file-dropzone-oaQoRV92.js → s-file-dropzone-CbaOf3_3.js} +47 -42
  75. package/dist/s-gallery/gallery-grid-item.d.ts +17 -0
  76. package/dist/s-gallery/gallery-grid-item.js +112 -0
  77. package/dist/s-gallery/gallery-layout.d.ts +16 -0
  78. package/dist/s-gallery/gallery-layout.js +50 -0
  79. package/dist/s-gallery/gallery-media-item.d.ts +15 -0
  80. package/dist/s-gallery/gallery-media-item.js +112 -0
  81. package/dist/s-gallery/index.d.ts +5 -2
  82. package/dist/s-gallery/index.js +2 -1
  83. package/dist/s-gallery/s-gallery.d.ts +1 -17
  84. package/dist/s-gallery/s-gallery.js +38 -284
  85. package/dist/s-image-comparison/s-image-comparison.js +46 -42
  86. package/dist/s-image-modal/default-media-item.d.ts +9 -0
  87. package/dist/s-image-modal/default-media-item.js +34 -0
  88. package/dist/s-image-modal/image-modal-thumbnail-dock.d.ts +11 -0
  89. package/dist/s-image-modal/image-modal-thumbnail-dock.js +102 -0
  90. package/dist/s-image-modal/index.d.ts +2 -2
  91. package/dist/s-image-modal/index.js +2 -1
  92. package/dist/s-image-modal/s-image-modal.d.ts +1 -52
  93. package/dist/s-image-modal/s-image-modal.js +2 -2
  94. package/dist/s-image-modal/types.d.ts +52 -0
  95. package/dist/s-image-modal/types.js +0 -0
  96. package/dist/s-image-modal/use-image-modal-navigation.d.ts +29 -0
  97. package/dist/s-image-modal/use-image-modal-navigation.js +57 -0
  98. package/dist/s-image-modal-hhRD4727.js +243 -0
  99. package/dist/s-label/s-label.js +1 -1
  100. package/dist/s-language-switcher/index.js +1 -1
  101. package/dist/s-language-switcher/s-language-switcher.js +1 -1
  102. package/dist/{s-language-switcher-vievp2VS.js → s-language-switcher-BKK0r8Kh.js} +4 -4
  103. package/dist/s-localization-provider/index.js +1 -1
  104. package/dist/s-localization-provider/s-localization-provider.js +1 -1
  105. package/dist/{s-localization-provider-YCsec18c.js → s-localization-provider-DDO9UEu_.js} +4 -4
  106. package/dist/s-nav-item/s-nav-item.js +1 -1
  107. package/dist/s-nav-items/s-nav-items.js +4 -7
  108. package/dist/s-pagination/s-pagination.js +12 -15
  109. package/dist/s-review/index.js +1 -1
  110. package/dist/s-review/s-review.js +1 -1
  111. package/dist/{s-review-D4FBfBPF.js → s-review-f0OI1oqM.js} +18 -27
  112. package/dist/s-scroll-reveal/s-scroll-reveal.js +1 -1
  113. package/dist/s-scroll-to-top/s-scroll-to-top.js +1 -1
  114. package/dist/s-select/index.js +1 -1
  115. package/dist/s-select/s-select.d.ts +2 -0
  116. package/dist/s-select/s-select.js +1 -1
  117. package/dist/{s-select-b8CHbeCf.js → s-select-BqWS_5Bs.js} +21 -21
  118. package/dist/s-select-list/s-select-list.js +2 -11
  119. package/dist/s-spotlight-cursor/s-spotlight-cursor.js +23 -15
  120. package/dist/s-stripe/s-stripe-cvc.d.ts +1 -5
  121. package/dist/s-stripe/s-stripe-cvc.js +11 -11
  122. package/dist/s-stripe/s-stripe-expiry.d.ts +1 -5
  123. package/dist/s-stripe/s-stripe-expiry.js +11 -11
  124. package/dist/s-stripe/s-stripe-number.d.ts +1 -5
  125. package/dist/s-stripe/s-stripe-number.js +11 -11
  126. package/dist/s-stripe/s-stripe.d.ts +11 -4
  127. package/dist/s-stripe/s-stripe.js +19 -17
  128. package/dist/s-stripe/stripe-input.js +41 -32
  129. package/dist/s-text-editor/index.js +1 -1
  130. package/dist/s-text-editor/s-text-editor-toolbar.js +1 -1
  131. package/dist/s-text-editor/s-text-editor.d.ts +1 -4
  132. package/dist/s-text-editor/s-text-editor.js +21 -24
  133. package/dist/{s-text-editor-toolbar-CCK7yyNS.js → s-text-editor-toolbar-DrQ8v-4J.js} +45 -44
  134. package/dist/s-text-field/index.js +1 -1
  135. package/dist/s-text-field/s-text-field.d.ts +3 -4
  136. package/dist/s-text-field/s-text-field.js +1 -1
  137. package/dist/s-text-field-DLSDoq7u.js +42 -0
  138. package/dist/s-theme-demo/index.js +1 -1
  139. package/dist/s-theme-demo/s-theme-demo.js +1 -1
  140. package/dist/{s-theme-demo-THHj5mFp.js → s-theme-demo-DeY0K6MC.js} +4 -4
  141. package/dist/s-theme-provider/s-theme-provider.js +26 -25
  142. package/dist/s-theme-switch/index.js +1 -1
  143. package/dist/s-theme-switch/s-theme-switch.js +1 -1
  144. package/dist/{s-theme-switch-V3Q58mkG.js → s-theme-switch-B0KHb2wu.js} +1 -1
  145. package/dist/s-tip/index.js +1 -1
  146. package/dist/s-tip/s-tip.js +1 -1
  147. package/dist/{s-tip-Dwu5T2u0.js → s-tip-Beuy9MLR.js} +2 -2
  148. package/dist/s-tool-bar/index.d.ts +1 -1
  149. package/dist/s-tool-bar/index.js +1 -1
  150. package/dist/s-tool-bar/s-tool-bar.d.ts +1 -155
  151. package/dist/s-tool-bar/s-tool-bar.js +114 -2
  152. package/dist/s-tool-bar/tool-bar-action-buttons.d.ts +15 -0
  153. package/dist/s-tool-bar/tool-bar-action-buttons.js +2 -0
  154. package/dist/s-tool-bar/tool-bar-image-input.d.ts +8 -0
  155. package/dist/s-tool-bar/tool-bar-image-input.js +2 -0
  156. package/dist/s-tool-bar/tool-bar-inputs.d.ts +3 -0
  157. package/dist/s-tool-bar/tool-bar-inputs.js +139 -0
  158. package/dist/s-tool-bar/types.d.ts +170 -0
  159. package/dist/s-tool-bar/types.js +0 -0
  160. package/dist/s-tool-bar/utils.d.ts +10 -0
  161. package/dist/s-tool-bar/utils.js +22 -0
  162. package/dist/theme/components/accordion-summary.js +2 -2
  163. package/dist/theme/components/accordion.js +1 -1
  164. package/dist/theme/components/alert.d.ts +1 -1
  165. package/dist/theme/components/alert.js +1 -1
  166. package/dist/theme/components/autocomplete.js +1 -1
  167. package/dist/theme/components/avatar.d.ts +10 -1
  168. package/dist/theme/components/avatar.js +1 -1
  169. package/dist/theme/components/card.js +4 -4
  170. package/dist/theme/components/checkbox.js +1 -1
  171. package/dist/theme/components/chip.js +17 -6
  172. package/dist/theme/components/components.js +134 -118
  173. package/dist/theme/components/date-calendar.d.ts +13 -0
  174. package/dist/theme/components/date-calendar.js +7 -0
  175. package/dist/theme/components/day-calendar.d.ts +14 -1
  176. package/dist/theme/components/day-calendar.js +14 -1
  177. package/dist/theme/components/dialog-actions.js +1 -1
  178. package/dist/theme/components/dialog-content.d.ts +13 -0
  179. package/dist/theme/components/dialog-content.js +7 -0
  180. package/dist/theme/components/dialog-title.d.ts +21 -0
  181. package/dist/theme/components/dialog-title.js +7 -0
  182. package/dist/theme/components/form-label.js +1 -1
  183. package/dist/theme/components/icon-button.d.ts +5 -1
  184. package/dist/theme/components/icon-button.js +18 -24
  185. package/dist/theme/components/linear-progress.js +2 -2
  186. package/dist/theme/components/link.d.ts +1 -1
  187. package/dist/theme/components/link.js +2 -2
  188. package/dist/theme/components/list-item-button.js +2 -2
  189. package/dist/theme/components/list-item.js +3 -3
  190. package/dist/theme/components/month-calendar.d.ts +27 -0
  191. package/dist/theme/components/month-calendar.js +14 -0
  192. package/dist/theme/components/multi-section-digital-clock-section.js +25 -0
  193. package/dist/theme/components/outlined-input.js +6 -6
  194. package/dist/theme/components/picker-day.d.ts +16 -2
  195. package/dist/theme/components/picker-day.js +13 -1
  196. package/dist/theme/components/pickers-arrow-switcher.d.ts +12 -0
  197. package/dist/theme/components/pickers-arrow-switcher.js +4 -0
  198. package/dist/theme/components/pickers-calendar-header.d.ts +38 -0
  199. package/dist/theme/components/pickers-calendar-header.js +24 -0
  200. package/dist/theme/components/select.js +2 -2
  201. package/dist/theme/components/slider.d.ts +29 -2
  202. package/dist/theme/components/slider.js +14 -2
  203. package/dist/theme/components/step-connector.d.ts +1 -1
  204. package/dist/theme/components/step-connector.js +1 -1
  205. package/dist/theme/components/step-icon.js +1 -1
  206. package/dist/theme/components/tab.js +1 -1
  207. package/dist/theme/components/table-pagination.js +1 -1
  208. package/dist/theme/components/toggle-button-group.js +1 -1
  209. package/dist/theme/components/toggle-button.js +1 -1
  210. package/dist/theme/components/year-calendar.d.ts +36 -0
  211. package/dist/theme/components/year-calendar.js +17 -0
  212. package/dist/theme/theme-primitives.d.ts +36 -0
  213. package/dist/theme/theme-primitives.js +2 -2
  214. package/dist/{theme-primitives-D2vHHGiX.js → theme-primitives-7ruiI7gY.js} +10 -3
  215. package/dist/{toggle-button-group-ABwIhV4P.js → toggle-button-group-Dx9fvVok.js} +4 -4
  216. package/dist/{toggle-button-BUsRxHn0.js → toggle-button-j6VLaPoa.js} +3 -3
  217. package/dist/tool-bar-action-buttons-B4QhqdK_.js +50 -0
  218. package/dist/tool-bar-image-input-BKFAtyJ1.js +138 -0
  219. package/dist/{useControlled-DXKqhylj.js → useControlled-BtZNCHV0.js} +1 -1
  220. package/dist/useForkRef-yOYCJHzF.js +29 -0
  221. package/dist/{useMobilePicker-ujH2nH2-.js → useMobilePicker-C8toWhEP.js} +7657 -7674
  222. package/dist/{useSlot-Dkc1Mj31.js → useSlot-IwEDsR9t.js} +107 -133
  223. package/dist/{utils-CCnIUPad.js → utils-CU6O7jrX.js} +5 -5
  224. package/dist/{LocalizationProvider-BdaUKqz3.js → warning-CFMmJJnf.js} +51 -51
  225. package/dist/yearCalendarClasses-DypEe_Vn.js +14 -0
  226. package/package.json +1 -1
  227. package/dist/s-chat-input-DKGeMh55.js +0 -299
  228. package/dist/s-date-picker-BkZIEZoz.js +0 -634
  229. package/dist/s-image-modal-DA3DBNbv.js +0 -397
  230. package/dist/s-text-field-Ck5QMhYI.js +0 -41
  231. package/dist/s-tool-bar-DGfyNoYW.js +0 -454
  232. /package/dist/{buttonBaseClasses-BLZbMisL.js → buttonBaseClasses-BVDyR-hz.js} +0 -0
  233. /package/dist/{checkboxClasses-DSyvUOsN.js → checkboxClasses-DPzQcJz-.js} +0 -0
  234. /package/dist/{createSimplePaletteValueFilter-GHK52GLU.js → createSimplePaletteValueFilter-5v48HHyU.js} +0 -0
  235. /package/dist/{extends-D8CDMpIy.js → extends-DM-C9PwL.js} +0 -0
  236. /package/dist/{formLabelClasses-Cv7W0Roi.js → formLabelClasses-BfRVjiBm.js} +0 -0
  237. /package/dist/{iconButtonClasses-9jjSQ9-U.js → iconButtonClasses-LyjwljJq.js} +0 -0
  238. /package/dist/{inputAdornmentClasses-VKwluNTs.js → inputAdornmentClasses-DHmz00nZ.js} +0 -0
  239. /package/dist/{objectWithoutPropertiesLoose-BpY-kC5L.js → objectWithoutPropertiesLoose-kj3TmhoA.js} +0 -0
  240. /package/dist/{outlinedInputClasses-Cz4pnn0X.js → outlinedInputClasses-Z5R6RJE3.js} +0 -0
  241. /package/dist/{selectClasses-DvT1febA.js → selectClasses-vjNpSSyQ.js} +0 -0
  242. /package/dist/{svgIconClasses-D46YUMKp.js → svgIconClasses-BtHvkhy5.js} +0 -0
  243. /package/dist/{tabClasses-KqPlYv0c.js → tabClasses-CmFw6sbs.js} +0 -0
  244. /package/dist/{typographyClasses-CFf0OFiD.js → typographyClasses-CspzYrIn.js} +0 -0
  245. /package/dist/{useControlled-2-C6cXjG.js → useControlled-DuSwFVhD.js} +0 -0
  246. /package/dist/{useFormControl-B4z6ONhx.js → useFormControl-bYnTwZE5.js} +0 -0
@@ -0,0 +1,112 @@
1
+ import e from "../s-lazy-image/s-lazy-image.js";
2
+ import { useEffect as t, useRef as n, useState as r } from "react";
3
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
4
+ import { Box as o } from "@mui/material";
5
+ //#region lib/s-gallery/gallery-media-item.tsx
6
+ function s(e) {
7
+ return new Promise((t) => {
8
+ let n = () => {
9
+ e.removeEventListener("canplay", n), t();
10
+ };
11
+ e.addEventListener("canplay", n, { once: !0 });
12
+ });
13
+ }
14
+ var c = ({ item: c, sx: l, onClick: u }) => {
15
+ let d = n(null), [f, p] = r(!1), [m, h] = r(!0);
16
+ if (t(() => {
17
+ let e = new IntersectionObserver((e) => {
18
+ e.forEach((e) => p(e.isIntersecting));
19
+ }, {
20
+ root: null,
21
+ rootMargin: "50px",
22
+ threshold: .1
23
+ }), t = d.current;
24
+ return t && e.observe(t), () => {
25
+ t && e.unobserve(t);
26
+ };
27
+ }, []), t(() => {
28
+ let e = !0, t = d.current;
29
+ return f ? (async () => {
30
+ if (!(!t || !f || !e)) try {
31
+ if (t.readyState < 3 && (h(!0), await s(t)), !e) return;
32
+ h(!1), await t.play();
33
+ } catch (e) {
34
+ console.warn("Video playback failed:", e);
35
+ }
36
+ })() : t && t.pause(), () => {
37
+ e = !1, t && (t.pause(), t.removeAttribute("src"), t.load());
38
+ };
39
+ }, [f]), c.type === "video") return /* @__PURE__ */ a(o, {
40
+ sx: {
41
+ position: "relative",
42
+ overflow: "hidden",
43
+ width: "100%",
44
+ height: "100%",
45
+ ...l
46
+ },
47
+ children: [/* @__PURE__ */ i(o, {
48
+ component: "video",
49
+ ref: d,
50
+ onClick: u,
51
+ playsInline: !0,
52
+ muted: !0,
53
+ loop: !0,
54
+ preload: "auto",
55
+ sx: {
56
+ width: "100%",
57
+ height: "100%",
58
+ objectFit: "cover",
59
+ opacity: m ? .8 : 1,
60
+ transition: "opacity 0.2s",
61
+ transform: "translateZ(0)",
62
+ willChange: "transform",
63
+ display: "block"
64
+ },
65
+ children: /* @__PURE__ */ i("source", {
66
+ src: c.url,
67
+ type: "video/mp4"
68
+ })
69
+ }), m && /* @__PURE__ */ i(o, {
70
+ sx: {
71
+ position: "absolute",
72
+ inset: 0,
73
+ display: "flex",
74
+ alignItems: "center",
75
+ justifyContent: "center",
76
+ bgcolor: "action.disabled"
77
+ },
78
+ children: /* @__PURE__ */ i(o, { sx: {
79
+ width: 24,
80
+ height: 24,
81
+ borderRadius: "50%",
82
+ border: "2px solid",
83
+ borderColor: "divider",
84
+ borderTopColor: "primary.main",
85
+ animation: "spin 0.8s linear infinite",
86
+ "@keyframes spin": { to: { transform: "rotate(360deg)" } }
87
+ } })
88
+ })]
89
+ });
90
+ let g = l && typeof l == "object" && "objectFit" in l && typeof l.objectFit == "string" ? l.objectFit : "cover";
91
+ return /* @__PURE__ */ i(o, {
92
+ onClick: u,
93
+ sx: {
94
+ width: "100%",
95
+ height: "100%",
96
+ ...l
97
+ },
98
+ children: /* @__PURE__ */ i(e, {
99
+ src: c.url,
100
+ alt: c.title ?? "",
101
+ style: {
102
+ objectFit: g,
103
+ cursor: u ? "pointer" : "default",
104
+ display: "block",
105
+ width: "100%",
106
+ height: "100%"
107
+ }
108
+ })
109
+ });
110
+ };
111
+ //#endregion
112
+ export { c as MediaItem };
@@ -1,2 +1,5 @@
1
- export { default, default as SGallery, MediaItem } from './s-gallery';
2
- export type { SGalleryProps, MediaItemProps, GalleryLayoutVariant } from './s-gallery';
1
+ export { default, default as SGallery } from './s-gallery';
2
+ export type { SGalleryProps } from './s-gallery';
3
+ export { MediaItem } from './gallery-media-item';
4
+ export type { MediaItemProps } from './gallery-media-item';
5
+ export type { GalleryLayoutVariant } from './gallery-layout';
@@ -1,2 +1,3 @@
1
- import { MediaItem as e, SGallery as t } from "./s-gallery.js";
1
+ import { MediaItem as e } from "./gallery-media-item.js";
2
+ import { SGallery as t } from "./s-gallery.js";
2
3
  export { e as MediaItem, t as SGallery, t as default };
@@ -1,22 +1,6 @@
1
1
  import { default as React } from 'react';
2
- import { SxProps, Theme } from '@mui/material';
3
2
  import { MediaItemType } from '../s-image-modal';
4
- /**
5
- * Props for individual MediaItem components
6
- */
7
- export type MediaItemProps = {
8
- /** Media item data */
9
- item: MediaItemType;
10
- /** Custom styling */
11
- sx?: SxProps<Theme>;
12
- /** Click handler */
13
- onClick?: () => void;
14
- };
15
- export declare const MediaItem: React.FC<MediaItemProps>;
16
- /**
17
- * Built-in layout variants for the gallery
18
- */
19
- export type GalleryLayoutVariant = 'masonry' | 'grid' | 'spotlight' | 'featured' | 'highlight' | 'custom';
3
+ import { GalleryLayoutVariant } from './gallery-layout';
20
4
  /**
21
5
  * Props for the SGallery component.
22
6
  */
@@ -1,184 +1,40 @@
1
- import { n as e } from "../s-image-modal-DA3DBNbv.js";
2
- import t from "../s-lazy-image/s-lazy-image.js";
3
- import { useEffect as n, useId as r, useRef as i, useState as a } from "react";
4
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
5
- import { Box as c, Paper as l, Skeleton as u, Typography as d } from "@mui/material";
6
- import { AnimatePresence as f, motion as p } from "framer-motion";
1
+ import { t as e } from "../s-image-modal-hhRD4727.js";
2
+ import { GalleryGridItem as t } from "./gallery-grid-item.js";
3
+ import { applyLayoutVariant as n, getLayoutDimensions as r } from "./gallery-layout.js";
4
+ import { useCallback as i, useEffect as a, useId as o, useState as s } from "react";
5
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
6
+ import { Box as u, Paper as d, Skeleton as f } from "@mui/material";
7
+ import { AnimatePresence as p, motion as m } from "framer-motion";
7
8
  //#region lib/s-gallery/s-gallery.tsx
8
- function m(e) {
9
- return new Promise((t) => {
10
- let n = () => {
11
- e.removeEventListener("canplay", n), t();
12
- };
13
- e.addEventListener("canplay", n, { once: !0 });
14
- });
15
- }
16
- function h(e) {
17
- return e % 3 == 0 ? 3 : e % 2 == 0 ? 2 : 4;
18
- }
19
- var g = ({ item: e, sx: r, onClick: l }) => {
20
- let u = i(null), [d, f] = a(!1), [p, h] = a(!0);
21
- if (n(() => {
22
- let e = new IntersectionObserver((e) => {
23
- e.forEach((e) => f(e.isIntersecting));
24
- }, {
25
- root: null,
26
- rootMargin: "50px",
27
- threshold: .1
28
- }), t = u.current;
29
- return t && e.observe(t), () => {
30
- t && e.unobserve(t);
31
- };
32
- }, []), n(() => {
33
- let e = !0, t = u.current;
34
- return d ? (async () => {
35
- if (!(!t || !d || !e)) try {
36
- if (t.readyState < 3 && (h(!0), await m(t)), !e) return;
37
- h(!1), await t.play();
38
- } catch (e) {
39
- console.warn("Video playback failed:", e);
40
- }
41
- })() : t && t.pause(), () => {
42
- e = !1, t && (t.pause(), t.removeAttribute("src"), t.load());
43
- };
44
- }, [d]), e.type === "video") return /* @__PURE__ */ s(c, {
45
- sx: {
46
- position: "relative",
47
- overflow: "hidden",
48
- width: "100%",
49
- height: "100%",
50
- ...r
51
- },
52
- children: [/* @__PURE__ */ o(c, {
53
- component: "video",
54
- ref: u,
55
- onClick: l,
56
- playsInline: !0,
57
- muted: !0,
58
- loop: !0,
59
- preload: "auto",
60
- sx: {
61
- width: "100%",
62
- height: "100%",
63
- objectFit: "cover",
64
- opacity: p ? .8 : 1,
65
- transition: "opacity 0.2s",
66
- transform: "translateZ(0)",
67
- willChange: "transform",
68
- display: "block"
69
- },
70
- children: /* @__PURE__ */ o("source", {
71
- src: e.url,
72
- type: "video/mp4"
73
- })
74
- }), p && /* @__PURE__ */ o(c, {
75
- sx: {
76
- position: "absolute",
77
- inset: 0,
78
- display: "flex",
79
- alignItems: "center",
80
- justifyContent: "center",
81
- bgcolor: "action.disabled"
82
- },
83
- children: /* @__PURE__ */ o(c, { sx: {
84
- width: 24,
85
- height: 24,
86
- borderRadius: "50%",
87
- border: "2px solid",
88
- borderColor: "divider",
89
- borderTopColor: "primary.main",
90
- animation: "spin 0.8s linear infinite",
91
- "@keyframes spin": { to: { transform: "rotate(360deg)" } }
92
- } })
93
- })]
94
- });
95
- let g = r && typeof r == "object" && "objectFit" in r && typeof r.objectFit == "string" ? r.objectFit : "cover";
96
- return /* @__PURE__ */ o(c, {
97
- onClick: l,
98
- sx: {
99
- width: "100%",
100
- height: "100%",
101
- ...r
102
- },
103
- children: /* @__PURE__ */ o(t, {
104
- src: e.url,
105
- alt: e.title ?? "",
106
- style: {
107
- objectFit: g,
108
- cursor: l ? "pointer" : "default",
109
- display: "block",
110
- width: "100%",
111
- height: "100%"
112
- }
113
- })
114
- });
115
- }, _ = (e, t) => {
116
- switch (t) {
117
- case "grid": return {
118
- colSpan: 1,
119
- rowSpan: 2
120
- };
121
- case "masonry": return {
122
- colSpan: 1,
123
- rowSpan: h(e)
124
- };
125
- case "spotlight": return e === 0 ? {
126
- colSpan: 2,
127
- rowSpan: 4
128
- } : {
129
- colSpan: 1,
130
- rowSpan: 2
131
- };
132
- case "featured": return e === 0 ? {
133
- colSpan: 2,
134
- rowSpan: 6
135
- } : {
136
- colSpan: 1,
137
- rowSpan: 2
138
- };
139
- case "highlight": return e === 0 ? {
140
- colSpan: 3,
141
- rowSpan: 6
142
- } : {
143
- colSpan: 1,
144
- rowSpan: 2
145
- };
146
- case "custom": return {
147
- colSpan: 1,
148
- rowSpan: 2
149
- };
150
- }
151
- }, v = (e, t) => t === "custom" ? e : e.map((e, n) => {
152
- let { colSpan: r, rowSpan: i } = _(n, t);
153
- return {
154
- ...e,
155
- colSpan: r,
156
- rowSpan: i
157
- };
158
- }), y = ({ mediaItems: t, variant: i = "masonry", loading: m = !1, skeletonCount: h = 6 }) => {
159
- let [y, b] = a(null), [x, S] = a(() => v(t, i)), [C, w] = a(!1), T = r();
160
- n(() => {
161
- S(v(t, i));
162
- }, [t, i]);
163
- let E = Array.from({ length: h }, (e, t) => ({
164
- id: `${i}-skeleton-${t + 1}`,
165
- ..._(t, i)
166
- }));
167
- return /* @__PURE__ */ s(c, {
9
+ var h = ({ mediaItems: h, variant: g = "masonry", loading: _ = !1, skeletonCount: v = 6 }) => {
10
+ let [y, b] = s(null), [x, S] = s(() => n(h, g)), [C, w] = s(!1), T = o();
11
+ a(() => {
12
+ S(n(h, g));
13
+ }, [h, g]);
14
+ let E = Array.from({ length: v }, (e, t) => ({
15
+ id: `${g}-skeleton-${t + 1}`,
16
+ ...r(t, g)
17
+ })), D = i(() => w(!0), []), O = i((e, t) => {
18
+ if (w(!1), Math.abs(t) > 50) {
19
+ let n = [...x], r = n[e], i = t > 0 ? Math.min(e + 1, x.length - 1) : Math.max(e - 1, 0);
20
+ n.splice(e, 1), n.splice(i, 0, r), S(n);
21
+ }
22
+ }, [x]);
23
+ return /* @__PURE__ */ l(u, {
168
24
  sx: {
169
25
  width: "100%",
170
26
  position: "relative",
171
27
  zIndex: 1
172
28
  },
173
- children: [/* @__PURE__ */ o(e, {
29
+ children: [/* @__PURE__ */ c(e, {
174
30
  selectedItem: y,
175
31
  isOpen: !!y,
176
32
  onClose: () => b(null),
177
33
  onItemChange: b,
178
34
  mediaItems: x
179
- }), /* @__PURE__ */ o(f, {
35
+ }), /* @__PURE__ */ c(p, {
180
36
  mode: "wait",
181
- children: !y && /* @__PURE__ */ o(p.div, {
37
+ children: !y && /* @__PURE__ */ c(m.div, {
182
38
  initial: "hidden",
183
39
  animate: "visible",
184
40
  exit: "hidden",
@@ -189,7 +45,7 @@ var g = ({ item: e, sx: r, onClick: l }) => {
189
45
  transition: { staggerChildren: .1 }
190
46
  }
191
47
  },
192
- children: /* @__PURE__ */ o(c, {
48
+ children: /* @__PURE__ */ c(u, {
193
49
  sx: {
194
50
  display: "grid",
195
51
  gridTemplateColumns: {
@@ -201,7 +57,7 @@ var g = ({ item: e, sx: r, onClick: l }) => {
201
57
  gridAutoRows: "60px",
202
58
  position: "relative"
203
59
  },
204
- children: m ? E.map(({ id: e, colSpan: t, rowSpan: n }) => /* @__PURE__ */ o(l, {
60
+ children: _ ? E.map(({ id: e, colSpan: t, rowSpan: n }) => /* @__PURE__ */ c(d, {
205
61
  sx: {
206
62
  position: "relative",
207
63
  overflow: "hidden",
@@ -209,7 +65,7 @@ var g = ({ item: e, sx: r, onClick: l }) => {
209
65
  gridRow: `span ${n}`,
210
66
  gridColumn: `span ${t}`
211
67
  },
212
- children: /* @__PURE__ */ o(u, {
68
+ children: /* @__PURE__ */ c(f, {
213
69
  variant: "rectangular",
214
70
  animation: "wave",
215
71
  sx: {
@@ -218,122 +74,20 @@ var g = ({ item: e, sx: r, onClick: l }) => {
218
74
  transform: "none"
219
75
  }
220
76
  })
221
- }, e)) : x.map((e, t) => /* @__PURE__ */ o(p.div, {
222
- layoutId: `media-${e.id}-${T}`,
223
- onClick: () => !C && b(e),
224
- variants: {
225
- hidden: {
226
- y: 50,
227
- scale: .9,
228
- opacity: 0
229
- },
230
- visible: {
231
- y: 0,
232
- scale: 1,
233
- opacity: 1,
234
- transition: {
235
- type: "spring",
236
- stiffness: 350,
237
- damping: 25,
238
- delay: t * .05
239
- }
240
- }
241
- },
242
- whileHover: {
243
- filter: "brightness(1.1)",
244
- zIndex: 10
245
- },
246
- drag: !0,
247
- dragConstraints: {
248
- left: 0,
249
- right: 0,
250
- top: 0,
251
- bottom: 0
252
- },
253
- dragElastic: 1,
254
- onDragStart: () => w(!0),
255
- onDragEnd: (e, n) => {
256
- w(!1);
257
- let r = n.offset.x + n.offset.y;
258
- if (Math.abs(r) > 50) {
259
- let e = [...x], n = e[t], i = r > 0 ? Math.min(t + 1, x.length - 1) : Math.max(t - 1, 0);
260
- e.splice(t, 1), e.splice(i, 0, n), S(e);
261
- }
262
- },
263
- style: {
264
- position: "relative",
265
- gridRow: e.rowSpan ? `span ${e.rowSpan}` : "span 2",
266
- gridColumn: e.colSpan ? `span ${e.colSpan}` : "span 1"
267
- },
268
- children: /* @__PURE__ */ s(l, {
269
- sx: {
270
- position: "relative",
271
- overflow: "hidden",
272
- borderRadius: 1,
273
- width: "100%",
274
- height: "100%",
275
- cursor: "grab",
276
- "&:active": { cursor: "grabbing" },
277
- "&:hover .hover-overlay": { opacity: 1 }
278
- },
279
- children: [/* @__PURE__ */ o(g, {
280
- item: e,
281
- sx: {
282
- position: "absolute",
283
- inset: 0,
284
- width: "100%",
285
- height: "100%"
286
- },
287
- onClick: () => !C && b(e)
288
- }), (e.title || e.desc) && /* @__PURE__ */ s(c, {
289
- className: "hover-overlay",
290
- sx: {
291
- position: "absolute",
292
- inset: 0,
293
- display: "flex",
294
- flexDirection: "column",
295
- justifyContent: "flex-end",
296
- padding: 1.5,
297
- pointerEvents: "none",
298
- opacity: 0,
299
- transition: "opacity 0.2s ease-in-out",
300
- color: "common.white",
301
- background: "linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.35) 45%, transparent)"
302
- },
303
- children: [e.title && /* @__PURE__ */ o(d, {
304
- variant: "h6",
305
- sx: {
306
- position: "relative",
307
- fontSize: {
308
- xs: 14,
309
- sm: 18,
310
- md: 20
311
- },
312
- whiteSpace: "nowrap",
313
- overflow: "hidden",
314
- textOverflow: "ellipsis"
315
- },
316
- children: e.title
317
- }), e.desc && /* @__PURE__ */ o(d, {
318
- variant: "body2",
319
- sx: {
320
- position: "relative",
321
- mt: .5,
322
- display: "-webkit-box",
323
- WebkitLineClamp: 2,
324
- WebkitBoxOrient: "vertical",
325
- overflow: "hidden"
326
- },
327
- children: e.desc
328
- })]
329
- })]
330
- })
77
+ }, e)) : x.map((e, n) => /* @__PURE__ */ c(t, {
78
+ item: e,
79
+ index: n,
80
+ instanceId: T,
81
+ isDragging: C,
82
+ onSelect: b,
83
+ onDragStart: D,
84
+ onDragEnd: O
331
85
  }, `${e.id}-${T}`))
332
86
  })
333
87
  })
334
88
  })]
335
89
  });
336
90
  };
337
- y.displayName = "SGallery";
91
+ h.displayName = "SGallery";
338
92
  //#endregion
339
- export { g as MediaItem, y as SGallery, y as default };
93
+ export { h as SGallery, h as default };
@@ -3,31 +3,35 @@ import * as t from "react";
3
3
  import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
4
  import { Box as i } from "@mui/material";
5
5
  //#region lib/s-image-comparison/s-image-comparison.tsx
6
- var a = t.forwardRef(({ sx: a, leftImage: o, rightImage: s, altLeft: c = "Left image", altRight: l = "Right image", initialPosition: u = 50, ...d }, f) => {
7
- let p = Array.isArray(o) ? o : [o], m = Array.isArray(c) ? c : [c], [h, g] = t.useState(0), [_, v] = t.useState(u), [y, b] = t.useState(!1), x = t.useRef(null), S = p.length > 1, C = (e) => {
8
- if (!x.current) return;
9
- let t = x.current.getBoundingClientRect(), n = (e - t.left) / t.width * 100;
10
- n = Math.max(0, Math.min(100, n)), v(n);
11
- }, w = t.useCallback((e) => {
12
- y && C(e.clientX);
13
- }, [y]), T = t.useCallback((e) => {
14
- y && C(e.touches[0].clientX);
15
- }, [y]), E = () => {
16
- b(!0);
17
- }, D = () => {
18
- b(!1);
19
- }, O = (e) => {
20
- v(Number(e.target.value));
6
+ var a = (e) => Math.max(0, Math.min(100, e)), o = t.forwardRef(({ sx: o, leftImage: s, rightImage: c, altLeft: l = "Left image", altRight: u = "Right image", initialPosition: d = 50, ...f }, p) => {
7
+ let m = Array.isArray(s) ? s : [s], h = Array.isArray(l) ? l : [l], [g, _] = t.useState(0), [v, y] = t.useState(() => a(d)), [b, x] = t.useState(!1), S = t.useRef(null), C = m.length > 1;
8
+ t.useEffect(() => {
9
+ y(a(d));
10
+ }, [d]);
11
+ let w = (e) => {
12
+ if (!S.current) return;
13
+ let t = S.current.getBoundingClientRect(), n = (e - t.left) / t.width * 100;
14
+ n = a(n), y(n);
15
+ }, T = t.useCallback((e) => {
16
+ b && w(e.clientX);
17
+ }, [b]), E = t.useCallback((e) => {
18
+ b && w(e.touches[0].clientX);
19
+ }, [b]), D = () => {
20
+ x(!0);
21
+ }, O = () => {
22
+ x(!1);
23
+ }, k = (e) => {
24
+ y(a(Number(e.target.value)));
21
25
  };
22
- return t.useEffect(() => (y ? (document.addEventListener("mousemove", w), document.addEventListener("touchmove", T), document.addEventListener("mouseup", D), document.addEventListener("touchend", D), document.body.style.cursor = "ew-resize") : document.body.style.cursor = "", () => {
23
- document.removeEventListener("mousemove", w), document.removeEventListener("touchmove", T), document.removeEventListener("mouseup", D), document.removeEventListener("touchend", D), document.body.style.cursor = "";
26
+ return t.useEffect(() => (b ? (document.addEventListener("mousemove", T), document.addEventListener("touchmove", E), document.addEventListener("mouseup", O), document.addEventListener("touchend", O), document.body.style.cursor = "ew-resize") : document.body.style.cursor = "", () => {
27
+ document.removeEventListener("mousemove", T), document.removeEventListener("touchmove", E), document.removeEventListener("mouseup", O), document.removeEventListener("touchend", O), document.body.style.cursor = "";
24
28
  }), [
25
- y,
26
- w,
27
- T
29
+ b,
30
+ T,
31
+ E
28
32
  ]), /* @__PURE__ */ r(i, {
29
33
  ref: (e) => {
30
- x.current = e, typeof f == "function" ? f(e) : f && (f.current = e);
34
+ S.current = e, typeof p == "function" ? p(e) : p && (p.current = e);
31
35
  },
32
36
  sx: {
33
37
  position: "relative",
@@ -35,15 +39,15 @@ var a = t.forwardRef(({ sx: a, leftImage: o, rightImage: s, altLeft: c = "Left i
35
39
  height: "100%",
36
40
  overflow: "hidden",
37
41
  userSelect: "none",
38
- ...a
42
+ ...o
39
43
  },
40
- onMouseDown: E,
41
- onTouchStart: E,
42
- ...d,
44
+ onMouseDown: D,
45
+ onTouchStart: D,
46
+ ...f,
43
47
  children: [
44
48
  /* @__PURE__ */ n(e, {
45
- src: s,
46
- alt: l,
49
+ src: c,
50
+ alt: u,
47
51
  style: {
48
52
  position: "absolute",
49
53
  inset: 0,
@@ -62,11 +66,11 @@ var a = t.forwardRef(({ sx: a, leftImage: o, rightImage: s, altLeft: c = "Left i
62
66
  height: "100%",
63
67
  overflow: "hidden",
64
68
  pointerEvents: "none",
65
- clipPath: `polygon(0 0, ${_}% 0, ${_}% 100%, 0 100%)`
69
+ clipPath: `polygon(0 0, ${v}% 0, ${v}% 100%, 0 100%)`
66
70
  },
67
71
  children: /* @__PURE__ */ n(e, {
68
- src: p[h],
69
- alt: m[h] ?? m[0],
72
+ src: m[g],
73
+ alt: h[g] ?? h[0],
70
74
  style: {
71
75
  width: "100%",
72
76
  height: "100%",
@@ -75,7 +79,7 @@ var a = t.forwardRef(({ sx: a, leftImage: o, rightImage: s, altLeft: c = "Left i
75
79
  draggable: !1
76
80
  })
77
81
  }),
78
- S && /* @__PURE__ */ n(i, {
82
+ C && /* @__PURE__ */ n(i, {
79
83
  sx: {
80
84
  position: "absolute",
81
85
  left: 16,
@@ -83,28 +87,28 @@ var a = t.forwardRef(({ sx: a, leftImage: o, rightImage: s, altLeft: c = "Left i
83
87
  display: "flex",
84
88
  gap: 1,
85
89
  zIndex: 1,
86
- pointerEvents: y ? "none" : "auto",
87
- opacity: +(_ > 10),
90
+ pointerEvents: b ? "none" : "auto",
91
+ opacity: +(v > 10),
88
92
  transition: "opacity 0.2s"
89
93
  },
90
94
  onClick: (e) => e.stopPropagation(),
91
95
  onMouseDown: (e) => e.stopPropagation(),
92
- children: p.map((e, t) => /* @__PURE__ */ n(i, {
96
+ children: m.map((e, t) => /* @__PURE__ */ n(i, {
93
97
  onClick: (e) => {
94
- e.stopPropagation(), g(t);
98
+ e.stopPropagation(), _(t);
95
99
  },
96
100
  sx: {
97
101
  width: 8,
98
102
  height: 8,
99
103
  borderRadius: "50%",
100
- bgcolor: h === t ? "primary.main" : "whiteAlpha.medium",
104
+ bgcolor: g === t ? "primary.main" : "whiteAlpha.medium",
101
105
  cursor: "pointer",
102
106
  boxShadow: 1,
103
107
  backdropFilter: "blur(4px)",
104
108
  transition: "all 0.2s",
105
109
  "&:hover": {
106
110
  transform: "scale(1.2)",
107
- bgcolor: h === t ? "primary.main" : "whiteAlpha.dark"
111
+ bgcolor: g === t ? "primary.main" : "whiteAlpha.dark"
108
112
  }
109
113
  }
110
114
  }, e))
@@ -116,15 +120,15 @@ var a = t.forwardRef(({ sx: a, leftImage: o, rightImage: s, altLeft: c = "Left i
116
120
  height: "100%",
117
121
  width: 6,
118
122
  cursor: "ew-resize",
119
- left: `calc(${_}% - 3px)`
123
+ left: `calc(${v}% - 3px)`
120
124
  },
121
125
  children: [/* @__PURE__ */ n(i, {
122
126
  component: "input",
123
127
  type: "range",
124
128
  min: 0,
125
129
  max: 100,
126
- value: _,
127
- onChange: O,
130
+ value: v,
131
+ onChange: k,
128
132
  "aria-label": "Image comparison slider",
129
133
  sx: {
130
134
  position: "absolute",
@@ -149,6 +153,6 @@ var a = t.forwardRef(({ sx: a, leftImage: o, rightImage: s, altLeft: c = "Left i
149
153
  ]
150
154
  });
151
155
  });
152
- a.displayName = "SImageComparison";
156
+ o.displayName = "SImageComparison";
153
157
  //#endregion
154
- export { a as default };
158
+ export { o as default };