@solostylist/ui-kit 2.0.1 → 2.0.3

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 (102) hide show
  1. package/dist/s-animated-gradient-text/index.d.ts +2 -0
  2. package/dist/s-animated-gradient-text/index.js +2 -0
  3. package/dist/s-animated-gradient-text/s-animated-gradient-text.d.ts +64 -0
  4. package/dist/s-animated-gradient-text/s-animated-gradient-text.js +92 -0
  5. package/dist/s-announcement-bar/index.d.ts +2 -0
  6. package/dist/s-announcement-bar/index.js +2 -0
  7. package/dist/s-announcement-bar/s-announcement-bar.d.ts +113 -0
  8. package/dist/s-announcement-bar/s-announcement-bar.js +272 -0
  9. package/dist/s-carousel/s-carousel.d.ts +2 -0
  10. package/dist/s-carousel/s-carousel.js +52 -50
  11. package/dist/s-date-picker/s-date-picker.js +1 -1
  12. package/dist/s-datetime-picker/s-datetime-picker.js +1 -1
  13. package/dist/s-drawer/index.d.ts +3 -0
  14. package/dist/s-drawer/index.js +2 -0
  15. package/dist/s-drawer/s-drawer.d.ts +70 -0
  16. package/dist/s-drawer/s-drawer.js +139 -0
  17. package/dist/s-gradient-blob-pulse/index.d.ts +2 -0
  18. package/dist/s-gradient-blob-pulse/index.js +2 -0
  19. package/dist/s-gradient-blob-pulse/s-gradient-blob-pulse.d.ts +62 -0
  20. package/dist/s-gradient-blob-pulse/s-gradient-blob-pulse.js +236 -0
  21. package/dist/s-gradient-icon/index.d.ts +1 -1
  22. package/dist/s-gradient-icon/s-gradient-icon.d.ts +4 -4
  23. package/dist/s-gradient-icon/s-gradient-icon.js +2 -2
  24. package/dist/s-icon-button/s-icon-button.d.ts +6 -2
  25. package/dist/s-interactive-card/index.d.ts +3 -0
  26. package/dist/s-interactive-card/index.js +2 -0
  27. package/dist/s-interactive-card/s-interactive-card.d.ts +57 -0
  28. package/dist/s-interactive-card/s-interactive-card.js +150 -0
  29. package/dist/s-language-switcher/s-language-switcher.js +66 -71
  30. package/dist/s-list-action-item/index.d.ts +2 -0
  31. package/dist/s-list-action-item/index.js +2 -0
  32. package/dist/s-list-action-item/s-list-action-item.d.ts +89 -0
  33. package/dist/s-list-action-item/s-list-action-item.js +149 -0
  34. package/dist/s-mega-menu/index.d.ts +3 -0
  35. package/dist/s-mega-menu/index.js +2 -0
  36. package/dist/s-mega-menu/mega-menu-panel.d.ts +38 -0
  37. package/dist/s-mega-menu/mega-menu-panel.js +251 -0
  38. package/dist/s-mega-menu/mega-menu-slots.d.ts +65 -0
  39. package/dist/s-mega-menu/mega-menu-slots.js +232 -0
  40. package/dist/s-mega-menu/mega-menu-trigger.d.ts +35 -0
  41. package/dist/s-mega-menu/mega-menu-trigger.js +49 -0
  42. package/dist/s-mega-menu/s-mega-menu.d.ts +23 -0
  43. package/dist/s-mega-menu/s-mega-menu.js +225 -0
  44. package/dist/s-mega-menu/types.d.ts +188 -0
  45. package/dist/s-mega-menu/types.js +0 -0
  46. package/dist/s-mega-menu/utils.d.ts +51 -0
  47. package/dist/s-mega-menu/utils.js +51 -0
  48. package/dist/s-mobile-dock/index.d.ts +3 -0
  49. package/dist/s-mobile-dock/index.js +2 -0
  50. package/dist/s-mobile-dock/s-mobile-dock.d.ts +96 -0
  51. package/dist/s-mobile-dock/s-mobile-dock.js +145 -0
  52. package/dist/s-nav-item/index.d.ts +1 -1
  53. package/dist/s-nav-item/s-nav-item.d.ts +35 -16
  54. package/dist/s-nav-item/s-nav-item.js +55 -77
  55. package/dist/s-nav-items/s-nav-items.js +68 -112
  56. package/dist/s-number-range/index.d.ts +3 -0
  57. package/dist/s-number-range/index.js +2 -0
  58. package/dist/s-number-range/s-number-range.d.ts +109 -0
  59. package/dist/s-number-range/s-number-range.js +250 -0
  60. package/dist/s-popover/index.d.ts +5 -0
  61. package/dist/s-popover/index.js +3 -0
  62. package/dist/s-popover/placement.d.ts +14 -0
  63. package/dist/s-popover/placement.js +65 -0
  64. package/dist/s-popover/s-popover-content.d.ts +22 -0
  65. package/dist/s-popover/s-popover-content.js +21 -0
  66. package/dist/s-popover/s-popover.d.ts +59 -0
  67. package/dist/s-popover/s-popover.js +66 -0
  68. package/dist/s-product-card/index.d.ts +3 -0
  69. package/dist/s-product-card/index.js +2 -0
  70. package/dist/s-product-card/s-product-card.d.ts +216 -0
  71. package/dist/s-product-card/s-product-card.js +499 -0
  72. package/dist/s-product-gallery/index.d.ts +3 -0
  73. package/dist/s-product-gallery/index.js +2 -0
  74. package/dist/s-product-gallery/s-product-gallery.d.ts +116 -0
  75. package/dist/s-product-gallery/s-product-gallery.js +427 -0
  76. package/dist/s-scroll-to-top/s-scroll-to-top.d.ts +1 -1
  77. package/dist/s-segmented-control/index.d.ts +3 -0
  78. package/dist/s-segmented-control/index.js +2 -0
  79. package/dist/s-segmented-control/s-segmented-control.d.ts +94 -0
  80. package/dist/s-segmented-control/s-segmented-control.js +298 -0
  81. package/dist/s-stepper/index.d.ts +3 -0
  82. package/dist/s-stepper/index.js +2 -0
  83. package/dist/s-stepper/s-stepper.d.ts +90 -0
  84. package/dist/s-stepper/s-stepper.js +102 -0
  85. package/dist/s-swatch/index.d.ts +3 -0
  86. package/dist/s-swatch/index.js +2 -0
  87. package/dist/s-swatch/s-swatch.d.ts +235 -0
  88. package/dist/s-swatch/s-swatch.js +218 -0
  89. package/dist/s-text-editor/s-text-editor-toolbar.js +105 -108
  90. package/dist/s-tool-item/s-tool-item.d.ts +10 -6
  91. package/dist/s-tool-item/s-tool-item.js +12 -12
  92. package/dist/theme/component-augmentation.d.ts +65 -1
  93. package/dist/theme/components/drawer.d.ts +1 -0
  94. package/dist/theme/components/drawer.js +4 -1
  95. package/dist/theme/components/slider.js +18 -1
  96. package/dist/theme/components/step-connector.d.ts +0 -3
  97. package/dist/theme/components/step-connector.js +1 -6
  98. package/dist/theme/components/step-icon.d.ts +3 -12
  99. package/dist/theme/components/step-icon.js +3 -14
  100. package/package.json +7 -2
  101. package/dist/theme/components/components.d.ts +0 -2
  102. package/dist/theme/components/slider.d.ts +0 -34
@@ -0,0 +1,427 @@
1
+ import { toSxArray as e } from "../utils/sx.js";
2
+ import { resolveOwnerStateSlotProps as t } from "../utils/slots.js";
3
+ import { SLazyImage as n } from "../s-lazy-image/s-lazy-image.js";
4
+ import { SIconButton as r } from "../s-icon-button/s-icon-button.js";
5
+ import { SCarousel as i } from "../s-carousel/s-carousel.js";
6
+ import * as a from "react";
7
+ import { createElement as o } from "react";
8
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
9
+ import { Box as l, ButtonBase as u, CircularProgress as d, styled as f, useTheme as ee, useThemeProps as te } from "@mui/material";
10
+ import { mergeSlotProps as p, useControlled as ne, useEventCallback as m, useForkRef as h } from "@mui/material/utils";
11
+ import g from "@mui/utils/appendOwnerState";
12
+ import _ from "@mui/icons-material/PlayArrowRounded";
13
+ //#region lib/s-product-gallery/s-product-gallery.tsx
14
+ var re = f(l, {
15
+ name: "SProductGallery",
16
+ slot: "Root",
17
+ shouldForwardProp: (e) => e !== "ownerState"
18
+ })({ width: "100%" }), ie = f(l, {
19
+ name: "SProductGallery",
20
+ slot: "Stage",
21
+ shouldForwardProp: (e) => e !== "ownerState"
22
+ })(({ ownerState: e, theme: t }) => ({
23
+ aspectRatio: String(e.aspectRatio),
24
+ backgroundColor: (t.vars ?? t).palette.background.paper,
25
+ borderRadius: t.radius.md,
26
+ overflow: "hidden",
27
+ position: "relative",
28
+ width: "100%"
29
+ })), ae = f(l, {
30
+ name: "SProductGallery",
31
+ slot: "Media",
32
+ shouldForwardProp: (e) => e !== "ownerState"
33
+ })({
34
+ display: "grid",
35
+ height: "100%",
36
+ minWidth: 0,
37
+ position: "relative",
38
+ width: "100%",
39
+ "& > *": {
40
+ gridArea: "1 / 1",
41
+ minWidth: 0
42
+ }
43
+ }), oe = f(n, {
44
+ name: "SProductGallery",
45
+ slot: "Image",
46
+ shouldForwardProp: (e) => e !== "ownerState"
47
+ })({}), se = f(i, {
48
+ name: "SProductGallery",
49
+ slot: "Carousel",
50
+ shouldForwardProp: (e) => e !== "ownerState"
51
+ })({}), ce = f("video", {
52
+ name: "SProductGallery",
53
+ slot: "Video",
54
+ shouldForwardProp: (e) => e !== "ownerState"
55
+ })({
56
+ display: "block",
57
+ height: "100%",
58
+ inset: 0,
59
+ maxHeight: "100%",
60
+ minHeight: 0,
61
+ objectFit: "cover",
62
+ position: "absolute",
63
+ width: "100%"
64
+ }), le = f(l, {
65
+ name: "SProductGallery",
66
+ slot: "VideoFrame"
67
+ })({
68
+ height: "100%",
69
+ minHeight: 0,
70
+ position: "relative",
71
+ width: "100%"
72
+ }), ue = f(r, {
73
+ name: "SProductGallery",
74
+ slot: "VideoPlayButton"
75
+ })(({ theme: e }) => {
76
+ let t = (e.vars ?? e).palette;
77
+ return {
78
+ height: e.spacing(7),
79
+ left: "50%",
80
+ position: "absolute",
81
+ top: "50%",
82
+ transform: "translate(-50%, -50%)",
83
+ width: e.spacing(7),
84
+ zIndex: 2,
85
+ "&.Mui-disabled": {
86
+ backgroundColor: t.blackAlpha.medium,
87
+ color: t.common.white
88
+ },
89
+ "& svg": { fontSize: e.typography.pxToRem(32) }
90
+ };
91
+ }), de = f(l, {
92
+ name: "SProductGallery",
93
+ slot: "Thumbnails",
94
+ shouldForwardProp: (e) => e !== "ownerState"
95
+ })(({ theme: e }) => ({
96
+ marginTop: e.spacing(1),
97
+ width: "100%"
98
+ })), fe = f(u, {
99
+ name: "SProductGallery",
100
+ slot: "Thumbnail",
101
+ shouldForwardProp: (e) => e !== "ownerState"
102
+ })(({ theme: e }) => ({
103
+ backgroundColor: (e.vars ?? e).palette.background.paper,
104
+ boxSizing: "border-box",
105
+ borderRadius: e.radius.md,
106
+ display: "block",
107
+ height: e.spacing(7),
108
+ minHeight: e.spacing(5.5),
109
+ minWidth: e.spacing(5.5),
110
+ opacity: .72,
111
+ overflow: "hidden",
112
+ padding: 0,
113
+ position: "relative",
114
+ transition: e.transitions.create("opacity"),
115
+ marginInline: e.spacing(.5),
116
+ width: `calc(100% - ${e.spacing(1)})`,
117
+ [e.breakpoints.down("sm")]: { height: e.spacing(6.5) },
118
+ "&.Mui-focusVisible": {
119
+ outline: 0,
120
+ boxShadow: `0 0 0 2px ${(e.vars ?? e).palette.primary.main}`,
121
+ zIndex: 2
122
+ },
123
+ "&::after": {
124
+ border: "2px solid transparent",
125
+ borderRadius: "inherit",
126
+ content: "\"\"",
127
+ inset: 0,
128
+ pointerEvents: "none",
129
+ position: "absolute",
130
+ transition: e.transitions.create("border-color"),
131
+ zIndex: 1
132
+ },
133
+ "@media (hover: hover) and (pointer: fine)": { "&:hover": { opacity: 1 } },
134
+ "@media (prefers-reduced-motion: reduce)": {
135
+ transition: "none",
136
+ "&::after": { transition: "none" }
137
+ },
138
+ variants: [{
139
+ props: ({ ownerState: e }) => e.selected,
140
+ style: {
141
+ "&::after": { borderColor: (e.vars ?? e).palette.primary.main },
142
+ opacity: 1
143
+ }
144
+ }]
145
+ })), pe = f(l, {
146
+ name: "SProductGallery",
147
+ slot: "VideoIndicator"
148
+ })(({ theme: e }) => {
149
+ let t = (e.vars ?? e).palette;
150
+ return {
151
+ alignItems: "center",
152
+ backgroundColor: e.alpha(t.common.black, .58),
153
+ borderRadius: e.radius.full,
154
+ boxShadow: e.shadows[2],
155
+ color: t.common.white,
156
+ display: "flex",
157
+ height: e.spacing(3.5),
158
+ justifyContent: "center",
159
+ left: "50%",
160
+ pointerEvents: "none",
161
+ position: "absolute",
162
+ top: "50%",
163
+ transform: "translate(-50%, -50%)",
164
+ width: e.spacing(3.5),
165
+ zIndex: 2,
166
+ "& svg": { fontSize: e.typography.pxToRem(20) }
167
+ };
168
+ }), v = 1, me = 6;
169
+ function he(e, t) {
170
+ return e !== void 0 && Number.isFinite(e) && e > 0 ? e : t;
171
+ }
172
+ function ge(e, t) {
173
+ return typeof e == "number" ? he(e, typeof t == "number" ? t : v) : typeof e == "string" && e.trim() ? e : t;
174
+ }
175
+ function _e(e) {
176
+ return e.type === "video" ? e.thumbnailSrc ?? e.poster ?? "" : e.thumbnailSrc ?? e.src;
177
+ }
178
+ function y(e) {
179
+ return e.type === "video" ? e.ariaLabel : e.alt;
180
+ }
181
+ function b(e) {
182
+ return e ? `${e.type ?? "image"}:${e.id}:${e.src}` : "";
183
+ }
184
+ var ve = (e, t, n) => {
185
+ let r = y(e);
186
+ return r ? `Show ${r}, ${t + 1} of ${n}` : `Show ${e.type === "video" ? "video" : "image"} ${t + 1} of ${n}`;
187
+ };
188
+ function ye(e, t, n) {
189
+ return `${y(e) || (e.type === "video" ? "Product video" : "Product image")} ${t + 1} of ${n}`;
190
+ }
191
+ function be(e, t) {
192
+ typeof e == "function" ? e(t) : e && (e.current = t);
193
+ }
194
+ var x = a.forwardRef(function(r, i) {
195
+ let { aspectRatio: l = v, defaultValue: u, getThumbnailAriaLabel: f = ve, items: y, onChange: x, slotProps: S, slots: C, sx: w, thumbnailsLabel: T = "Choose product media", thumbnailsToShow: xe = me, value: E, ...D } = te({
196
+ props: r,
197
+ name: "SProductGallery"
198
+ }), Se = ee(), Ce = ge(l, v), O = Math.max(1, Math.floor(he(xe, me))), we = a.useRef(y[0]?.id ?? ""), Te = a.useRef(u === void 0), [k, A] = ne({
199
+ controlled: E,
200
+ default: u ?? we.current,
201
+ name: "SProductGallery",
202
+ state: "value"
203
+ }), j = E !== void 0, M = y.findIndex((e) => e.id === k), Ee = !j && y.length > 0 && M < 0 && (k !== "" || Te.current), N = M >= 0 ? M : Ee ? 0 : -1, P = y[N] ?? null, F = P?.id ?? "", De = b(P), I = P?.type === "video" ? De : "", L = a.useRef(null), R = a.useRef(null), z = a.useRef(!1), [B, V] = a.useState({
204
+ mediaKey: "",
205
+ loading: !1,
206
+ started: !1
207
+ }), H = B.mediaKey === I ? B : null, U = H?.loading ?? !1, W = H?.started ?? !1, G = a.useId(), K = {
208
+ ...D,
209
+ aspectRatio: Ce,
210
+ activeItem: P,
211
+ activeIndex: N,
212
+ defaultValue: u,
213
+ getThumbnailAriaLabel: f,
214
+ items: y,
215
+ onChange: x,
216
+ sx: w,
217
+ thumbnailsLabel: T,
218
+ thumbnailsToShow: O,
219
+ value: F
220
+ }, q = t(S?.video, K), Oe = h(R, q?.ref);
221
+ a.useEffect(() => {
222
+ !j && P && k !== F && A(F);
223
+ }, [
224
+ P,
225
+ F,
226
+ j,
227
+ A,
228
+ k
229
+ ]), a.useEffect(() => {
230
+ N >= 0 && L.current?.scrollTo(N);
231
+ }, [N]), a.useEffect(() => {
232
+ z.current = !1;
233
+ }, [I]);
234
+ let ke = m((e, t) => {
235
+ let n = y[t];
236
+ !n || n.id === P?.id || (A(n.id), x?.(e, n.id));
237
+ }), Ae = m(() => {
238
+ let e = R.current;
239
+ if (!e || P?.type !== "video") return;
240
+ let t = b(P);
241
+ z.current = !0, V({
242
+ mediaKey: t,
243
+ loading: !0,
244
+ started: !1
245
+ }), e.play().catch(() => {
246
+ z.current = !1, V((n) => R.current === e && n.mediaKey === t ? {
247
+ ...n,
248
+ loading: !1,
249
+ started: !1
250
+ } : n);
251
+ });
252
+ }), je = C?.root ?? re, Me = C?.stage ?? ie, Ne = C?.media ?? ae, Pe = C?.image ?? oe, Fe = C?.video ?? ce, J = C?.thumbnails ?? de, Ie = C?.carousel ?? se, Le = C?.thumbnail ?? fe, { ref: Re, sx: ze, ...Y } = g(je, p(t(S?.root, K), D), K), Be = h(Re, i), X = g(Me, t(S?.stage, K) ?? {}, K), Ve = g(Ne, t(S?.media, K) ?? {}, K), Z = g(J, t(S?.thumbnails, K) ?? {}, K), He = t(S?.carousel, K), Q = Math.min(y.length, O), $ = He?.slotProps, Ue = g(Ie, p(He, {
253
+ arrows: y.length > Q,
254
+ slotProps: {
255
+ ...$,
256
+ viewport: {
257
+ ...$?.viewport,
258
+ sx: [{ py: .5 }, ...e($?.viewport?.sx)]
259
+ }
260
+ }
261
+ }), K), We = () => {
262
+ if (!P) return null;
263
+ if (P.type === "video") {
264
+ let e = b(P), t = (e) => e.currentTarget === R.current, { children: n, controls: r = !0, ...i } = g(Fe, p(q, {
265
+ controls: !0,
266
+ onCanPlay: (n) => {
267
+ t(n) && V((t) => t.mediaKey === e && t.started ? {
268
+ ...t,
269
+ loading: !1
270
+ } : t);
271
+ },
272
+ onEnded: (n) => {
273
+ t(n) && (z.current = !1, V({
274
+ mediaKey: e,
275
+ loading: !1,
276
+ started: !1
277
+ }));
278
+ },
279
+ onError: (n) => {
280
+ t(n) && (z.current = !1, V({
281
+ mediaKey: e,
282
+ loading: !1,
283
+ started: !1
284
+ }));
285
+ },
286
+ onPause: (n) => {
287
+ t(n) && (z.current = !1, V({
288
+ mediaKey: e,
289
+ loading: !1,
290
+ started: !1
291
+ }));
292
+ },
293
+ onPlay: (n) => {
294
+ t(n) && V({
295
+ mediaKey: e,
296
+ loading: !0,
297
+ started: !1
298
+ });
299
+ },
300
+ onPlaying: (n) => {
301
+ if (!t(n)) return;
302
+ let r = n.currentTarget, i = z.current;
303
+ z.current = !1, V({
304
+ mediaKey: e,
305
+ loading: !1,
306
+ started: !0
307
+ }), i && requestAnimationFrame(() => {
308
+ R.current === r && r.focus({ preventScroll: !0 });
309
+ });
310
+ },
311
+ onWaiting: (n) => {
312
+ t(n) && V((t) => ({
313
+ mediaKey: e,
314
+ loading: !0,
315
+ started: t.mediaKey === e && t.started
316
+ }));
317
+ },
318
+ playsInline: !0,
319
+ preload: "metadata"
320
+ }), K);
321
+ return /* @__PURE__ */ c(le, {
322
+ "aria-busy": U || void 0,
323
+ children: [/* @__PURE__ */ s(Fe, {
324
+ ...i,
325
+ "aria-label": P.ariaLabel,
326
+ controls: r && W,
327
+ poster: P.poster,
328
+ ref: Oe,
329
+ src: P.src,
330
+ children: n
331
+ }), !W || U ? /* @__PURE__ */ s(ue, {
332
+ "aria-busy": U || void 0,
333
+ "aria-label": U ? `Loading ${P.ariaLabel}` : `Play ${P.ariaLabel}`,
334
+ disabled: U,
335
+ onClick: Ae,
336
+ variant: "overlay",
337
+ children: U ? /* @__PURE__ */ s(d, {
338
+ "aria-label": `Loading ${P.ariaLabel}`,
339
+ color: "inherit",
340
+ size: 28
341
+ }) : /* @__PURE__ */ s(_, {})
342
+ }) : null]
343
+ }, `${P.type}:${P.id}:${P.src}`);
344
+ }
345
+ let { slotProps: e, ...n } = p(t(S?.image, K), { variant: "rectangular" }), r = g(Pe, n, K), i = {
346
+ ...e,
347
+ image: p(e?.image, { sx: { objectFit: "cover" } })
348
+ };
349
+ return /* @__PURE__ */ o(Pe, {
350
+ ...r,
351
+ alt: P.alt,
352
+ key: `${P.type ?? "image"}:${P.id}:${P.src}`,
353
+ slotProps: i,
354
+ src: P.src
355
+ });
356
+ };
357
+ return /* @__PURE__ */ c(je, {
358
+ ...Y,
359
+ "aria-label": Y["aria-label"] ?? "Product media gallery",
360
+ "aria-roledescription": Y["aria-roledescription"] ?? "carousel",
361
+ ref: Be,
362
+ role: Y.role ?? "group",
363
+ sx: [...e(ze), ...e(w)],
364
+ children: [/* @__PURE__ */ s(Me, {
365
+ ...X,
366
+ "aria-hidden": X["aria-hidden"] ?? !P,
367
+ "aria-label": X["aria-label"] ?? (P ? ye(P, N, y.length) : void 0),
368
+ "aria-roledescription": X["aria-roledescription"] ?? (P ? "slide" : void 0),
369
+ id: G,
370
+ role: X.role ?? (P ? "group" : void 0),
371
+ children: /* @__PURE__ */ s(Ne, {
372
+ ...Ve,
373
+ children: We()
374
+ })
375
+ }), y.length > 1 ? /* @__PURE__ */ s(J, {
376
+ ...Z,
377
+ "aria-label": Z["aria-label"] ?? T,
378
+ role: Z.role ?? "group",
379
+ children: /* @__PURE__ */ s(Ie, {
380
+ ...Ue,
381
+ apiRef: L,
382
+ autoplay: !1,
383
+ centerMode: !1,
384
+ infinite: !1,
385
+ responsive: [{
386
+ breakpoint: Se.breakpoints.values.sm,
387
+ settings: { slidesToShow: Math.max(Math.ceil(Q / 2), 1) }
388
+ }],
389
+ slidesToShow: Q,
390
+ spaceBetween: 0,
391
+ children: y.map((e, r) => {
392
+ let i = r === N, a = {
393
+ ...K,
394
+ index: r,
395
+ item: e,
396
+ selected: i
397
+ }, o = t(S?.thumbnail, a), { ref: l, ...u } = g(Le, o ?? {}, a), d = `${G}-thumbnail-${r}`;
398
+ return /* @__PURE__ */ c(Le, {
399
+ ...u,
400
+ "aria-controls": G,
401
+ "aria-label": f(e, r, y.length),
402
+ "aria-pressed": i,
403
+ id: d,
404
+ onClick: (e) => {
405
+ o?.onClick?.(e), e.defaultPrevented || ke(e, r);
406
+ },
407
+ ref: (e) => {
408
+ be(l, e);
409
+ },
410
+ children: [/* @__PURE__ */ s(n, {
411
+ alt: "",
412
+ src: _e(e),
413
+ variant: "rectangular",
414
+ slotProps: { image: { sx: { objectFit: "cover" } } }
415
+ }), e.type === "video" ? /* @__PURE__ */ s(pe, {
416
+ "aria-hidden": !0,
417
+ children: /* @__PURE__ */ s(_, {})
418
+ }) : null]
419
+ }, e.id);
420
+ })
421
+ })
422
+ }) : null]
423
+ });
424
+ });
425
+ x.displayName = "SProductGallery";
426
+ //#endregion
427
+ export { x as SProductGallery, x as default };
@@ -1,6 +1,6 @@
1
1
  import { SIconButtonProps } from '../s-icon-button';
2
2
  import * as React from 'react';
3
- export interface SScrollToTopProps extends Omit<SIconButtonProps, 'children' | 'component' | 'variant'> {
3
+ export interface SScrollToTopProps extends Omit<SIconButtonProps, 'children' | 'component' | 'target' | 'variant'> {
4
4
  /** Icon rendered inside the button. */
5
5
  icon?: React.ReactNode;
6
6
  /** Scroll target monitored by MUI's scroll trigger; defaults to the window. */
@@ -0,0 +1,3 @@
1
+ export { default, default as SSegmentedControl } from './s-segmented-control';
2
+ export type { SSegmentedControlOption, SSegmentedControlOptionState, SSegmentedControlOwnerState, SSegmentedControlProps, SSegmentedControlSize, SSegmentedControlSlotProps, SSegmentedControlSlots, } from './s-segmented-control';
3
+ export type {} from '../theme/component-augmentation';
@@ -0,0 +1,2 @@
1
+ import { SSegmentedControl as e } from "./s-segmented-control.js";
2
+ export { e as SSegmentedControl, e as default };
@@ -0,0 +1,94 @@
1
+ import { BoxProps, ButtonBaseProps, TypographyProps } from '@mui/material';
2
+ import { OwnerStateSlotProps as MuiOwnerStateSlotProps } from '../utils/slots';
3
+ import * as React from 'react';
4
+ /** Height tier of the control. */
5
+ export type SSegmentedControlSize = 'small' | 'medium';
6
+ /** A single selectable segment. */
7
+ export interface SSegmentedControlOption<T extends React.Key = string> {
8
+ /** Optional trailing content, e.g. a count or an `SChip`. */
9
+ badge?: React.ReactNode;
10
+ /** Prevents this segment from being selected or focused. */
11
+ disabled?: boolean;
12
+ /** Optional leading content, typically an icon element. */
13
+ icon?: React.ReactNode;
14
+ /** Visible segment label. */
15
+ label: React.ReactNode;
16
+ /** Value committed when this segment becomes selected. */
17
+ value: T;
18
+ }
19
+ /**
20
+ * A `radiogroup` needs an accessible name, so exactly one of `aria-label` /
21
+ * `aria-labelledby` is required.
22
+ */
23
+ type SSegmentedControlAccessibleName = {
24
+ 'aria-label': string;
25
+ 'aria-labelledby'?: string;
26
+ } | {
27
+ 'aria-label'?: never;
28
+ 'aria-labelledby': string;
29
+ };
30
+ export interface SSegmentedControlSlots {
31
+ /** Trailing badge wrapper rendered for options that define `badge`. */
32
+ badge?: React.ElementType;
33
+ /** Leading icon wrapper rendered for options that define `icon`. */
34
+ icon?: React.ElementType;
35
+ /** Absolutely positioned element that slides behind the selected segment. */
36
+ indicator?: React.ElementType;
37
+ /** Option label element. */
38
+ label?: React.ElementType;
39
+ /** Interactive `role="radio"` element rendered for every option. */
40
+ option?: React.ElementType;
41
+ /** Outer `role="radiogroup"` element. */
42
+ root?: React.ElementType;
43
+ }
44
+ export interface SSegmentedControlSlotProps<T extends React.Key = string> {
45
+ /** Props or option-state callback for the badge slot. */
46
+ badge?: MuiOwnerStateSlotProps<Omit<BoxProps, 'children'>, SSegmentedControlOptionState<T>>;
47
+ /** Props or option-state callback for the icon slot. */
48
+ icon?: MuiOwnerStateSlotProps<Omit<BoxProps, 'children'>, SSegmentedControlOptionState<T>>;
49
+ /** Props or owner-state callback for the indicator slot. */
50
+ indicator?: MuiOwnerStateSlotProps<Omit<BoxProps, 'children'>, SSegmentedControlOwnerState<T>>;
51
+ /** Props or option-state callback for the label slot. */
52
+ label?: MuiOwnerStateSlotProps<Omit<TypographyProps, 'children'>, SSegmentedControlOptionState<T>>;
53
+ /** Props or option-state callback for the option slot. */
54
+ option?: MuiOwnerStateSlotProps<Omit<ButtonBaseProps, 'children' | 'disabled' | 'onClick' | 'onKeyDown' | 'tabIndex'>, SSegmentedControlOptionState<T>>;
55
+ /** Props or owner-state callback for the root slot. */
56
+ root?: MuiOwnerStateSlotProps<Omit<BoxProps, 'children'>, SSegmentedControlOwnerState<T>>;
57
+ }
58
+ /** Props for a segmented control built on ARIA radiogroup semantics. */
59
+ export type SSegmentedControlProps<T extends React.Key = string> = Omit<BoxProps, 'children' | 'component' | 'defaultValue' | 'onChange' | 'value'> & SSegmentedControlAccessibleName & {
60
+ /** Initially selected value when the control is uncontrolled. */
61
+ defaultValue?: T;
62
+ /** Disables the whole control. Individual segments use `options[].disabled`. */
63
+ disabled?: boolean;
64
+ /** Stretches the control and distributes segments evenly across its width. */
65
+ fullWidth?: boolean;
66
+ /** Called whenever the selection changes. */
67
+ onChange?: (event: React.SyntheticEvent, value: T) => void;
68
+ /** Segments rendered by the control, in visual order. */
69
+ options: readonly SSegmentedControlOption<T>[];
70
+ /** Height tier of the control. */
71
+ size?: SSegmentedControlSize;
72
+ /** Props or state callbacks for internal structural slots. */
73
+ slotProps?: SSegmentedControlSlotProps<T>;
74
+ /** Components used for internal structural slots. */
75
+ slots?: SSegmentedControlSlots;
76
+ /** Selected value for controlled usage. */
77
+ value?: T;
78
+ };
79
+ export type SSegmentedControlOwnerState<T extends React.Key = string> = SSegmentedControlProps<T> & {
80
+ disabled: boolean;
81
+ fullWidth: boolean;
82
+ selectedDisabled: boolean;
83
+ size: SSegmentedControlSize;
84
+ };
85
+ export type SSegmentedControlOptionState<T extends React.Key = string> = SSegmentedControlOwnerState<T> & {
86
+ option: SSegmentedControlOption<T>;
87
+ selected: boolean;
88
+ };
89
+ interface SSegmentedControlComponent {
90
+ <T extends React.Key = string>(props: SSegmentedControlProps<T> & React.RefAttributes<HTMLDivElement>): React.JSX.Element;
91
+ displayName?: string;
92
+ }
93
+ export declare const SSegmentedControl: SSegmentedControlComponent;
94
+ export default SSegmentedControl;