@solostylist/ui-kit 2.0.6 → 2.0.7
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.
- package/dist/components-DWGB2MCO.js +148 -0
- package/dist/{gradients-DSnBONEQ.js → gradients-CUC4WH9i.js} +1 -1
- package/dist/main.js +1 -1
- package/dist/palettes/index.js +1 -1
- package/dist/{palettes-CJLuEy1m.js → palettes-B1trNROL.js} +2 -2
- package/dist/s-brand-logo/index.js +1 -1
- package/dist/s-brand-logo/s-brand-logo.js +1 -1
- package/dist/s-chat-message/s-chat-message.js +1 -1
- package/dist/s-comment-message/s-comment-message.js +1 -1
- package/dist/s-file-dropzone/s-file-dropzone.js +1 -1
- package/dist/s-image-viewer/image-viewer-thumbnail-dock.js +1 -1
- package/dist/s-product-gallery/index.d.ts +1 -1
- package/dist/s-product-gallery/s-product-gallery.d.ts +28 -11
- package/dist/s-product-gallery/s-product-gallery.js +302 -246
- package/dist/s-review/s-review.js +1 -1
- package/dist/s-segmented-control/s-segmented-control.js +3 -3
- package/dist/s-stripe/stripe-input.js +1 -1
- package/dist/s-theme-demo/theme-demo-color-ramps-section.js +1 -1
- package/dist/s-theme-provider/s-theme-provider.js +10 -10
- package/dist/theme/component-augmentation.d.ts +1 -1
- package/dist/theme/components/accordion-details.d.ts +2 -8
- package/dist/theme/components/accordion-summary.d.ts +2 -1036
- package/dist/theme/components/accordion.d.ts +2 -43
- package/dist/theme/components/alert.d.ts +2 -4160
- package/dist/theme/components/app-bar.d.ts +2 -24
- package/dist/theme/components/autocomplete.d.ts +2 -78
- package/dist/theme/components/avatar.d.ts +2 -19
- package/dist/theme/components/backdrop.d.ts +2 -12
- package/dist/theme/components/button-base.d.ts +2 -7
- package/dist/theme/components/button.d.ts +2 -1117
- package/dist/theme/components/card-actions.d.ts +2 -7
- package/dist/theme/components/card-content.d.ts +2 -7
- package/dist/theme/components/card-header.d.ts +2 -7
- package/dist/theme/components/card.d.ts +2 -2046
- package/dist/theme/components/card.js +1 -1
- package/dist/theme/components/checkbox.d.ts +2 -1038
- package/dist/theme/components/checkbox.js +1 -1
- package/dist/theme/components/chip.d.ts +2 -2
- package/dist/theme/components/components.d.ts +68 -0
- package/dist/theme/components/components.js +2 -73
- package/dist/theme/components/container.d.ts +2 -5
- package/dist/theme/components/css-baseline.d.ts +2 -9
- package/dist/theme/components/date-calendar.d.ts +2 -13
- package/dist/theme/components/day-calendar.d.ts +2 -25
- package/dist/theme/components/dialog-actions.d.ts +2 -12
- package/dist/theme/components/dialog-content.d.ts +2 -13
- package/dist/theme/components/dialog-title.d.ts +2 -21
- package/dist/theme/components/dialog.d.ts +2 -25
- package/dist/theme/components/drawer.d.ts +2 -13
- package/dist/theme/components/form-control.d.ts +2 -7
- package/dist/theme/components/form-label.d.ts +2 -20
- package/dist/theme/components/icon-button.d.ts +2 -1100
- package/dist/theme/components/icon.d.ts +2 -17
- package/dist/theme/components/input-adornment.d.ts +2 -19
- package/dist/theme/components/input-base.d.ts +2 -18
- package/dist/theme/components/linear-progress.d.ts +2 -1023
- package/dist/theme/components/link.d.ts +2 -42
- package/dist/theme/components/list-item-button.d.ts +2 -120
- package/dist/theme/components/list-item-icon.d.ts +2 -7
- package/dist/theme/components/list-item-text.d.ts +2 -22
- package/dist/theme/components/list-item.d.ts +2 -129
- package/dist/theme/components/list-subheader.d.ts +2 -20
- package/dist/theme/components/list.d.ts +2 -10
- package/dist/theme/components/menu-item.d.ts +2 -8
- package/dist/theme/components/menu.d.ts +2 -20
- package/dist/theme/components/month-calendar.d.ts +2 -1088
- package/dist/theme/components/multi-section-digital-clock-section.d.ts +2 -2
- package/dist/theme/components/outlined-input.d.ts +2 -113
- package/dist/theme/components/pagination-item.d.ts +2 -1085
- package/dist/theme/components/pagination.d.ts +2 -14
- package/dist/theme/components/paper.d.ts +2 -5
- package/dist/theme/components/picker-day.d.ts +2 -1055
- package/dist/theme/components/pickers-arrow-switcher.d.ts +2 -12
- package/dist/theme/components/pickers-calendar-header.d.ts +2 -83
- package/dist/theme/components/popover.d.ts +2 -18
- package/dist/theme/components/rating.d.ts +2 -19
- package/dist/theme/components/select.d.ts +2 -31
- package/dist/theme/components/skeleton.d.ts +2 -2
- package/dist/theme/components/slider.d.ts +2 -0
- package/dist/theme/components/slot.d.ts +7 -0
- package/dist/theme/components/slot.js +0 -0
- package/dist/theme/components/step-connector.d.ts +2 -12
- package/dist/theme/components/step-icon.d.ts +2 -1034
- package/dist/theme/components/step-label.d.ts +2 -1025
- package/dist/theme/components/svg-icon.d.ts +2 -31
- package/dist/theme/components/switch.d.ts +2 -1027
- package/dist/theme/components/tab.d.ts +2 -30
- package/dist/theme/components/table-cell.d.ts +2 -12
- package/dist/theme/components/table-pagination.d.ts +2 -14
- package/dist/theme/components/tabs.d.ts +2 -36
- package/dist/theme/components/toggle-button-group.d.ts +2 -12
- package/dist/theme/components/toggle-button.d.ts +2 -1148
- package/dist/theme/components/tooltip.d.ts +2 -3
- package/dist/theme/components/year-calendar.d.ts +2 -1090
- package/dist/theme/theme-primitives.d.ts +2 -0
- package/dist/theme/theme-primitives.js +1 -1
- package/dist/{theme-primitives-CRfnMsNy.js → theme-primitives-DXekeATD.js} +29 -26
- package/package.json +4 -2
- /package/dist/{colors-CNjL5fhq.js → colors-DscJqo7m.js} +0 -0
- /package/dist/{s-brand-logo-CErW9Slg.js → s-brand-logo-Gi1MKnv9.js} +0 -0
- /package/dist/{utils-CMeAWSRO.js → utils-CXRJYVCd.js} +0 -0
|
@@ -2,31 +2,42 @@ import { toSxArray as e } from "../utils/sx.js";
|
|
|
2
2
|
import { resolveOwnerStateSlotProps as t } from "../utils/slots.js";
|
|
3
3
|
import { SLazyImage as n } from "../s-lazy-image/s-lazy-image.js";
|
|
4
4
|
import { SIconButton as r } from "../s-icon-button/s-icon-button.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { mergeSlotProps as p, useControlled as ne, useEventCallback as m, useForkRef as h } from "@mui/material/utils";
|
|
5
|
+
import * as i from "react";
|
|
6
|
+
import { createElement as a } from "react";
|
|
7
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
|
+
import { Box as c, ButtonBase as l, CircularProgress as u, Typography as d, styled as f, useThemeProps as ee } from "@mui/material";
|
|
9
|
+
import { mergeSlotProps as p, setRef as te, useControlled as ne, useEventCallback as m, useForkRef as h } from "@mui/material/utils";
|
|
11
10
|
import g from "@mui/utils/appendOwnerState";
|
|
11
|
+
import re from "@mui/icons-material/ImageOutlined";
|
|
12
12
|
import _ from "@mui/icons-material/PlayArrowRounded";
|
|
13
13
|
//#region lib/s-product-gallery/s-product-gallery.tsx
|
|
14
|
-
var
|
|
14
|
+
var v = (e) => e === "start" || e === "end", y = (e, t) => `calc(${t ? e.spacing(5.5) : e.spacing(8)} + 4px)`, b = (e, t) => t ? e.spacing(1) : e.spacing(1.5), ie = f(c, {
|
|
15
15
|
name: "SProductGallery",
|
|
16
16
|
slot: "Root",
|
|
17
17
|
shouldForwardProp: (e) => e !== "ownerState"
|
|
18
|
-
})({
|
|
18
|
+
})(({ ownerState: e, theme: t }) => {
|
|
19
|
+
let n = v(e.thumbnailsPosition), r = e.thumbnailsPosition === "end", i = e.variant === "compact";
|
|
20
|
+
return {
|
|
21
|
+
width: "100%",
|
|
22
|
+
...n && { [t.breakpoints.up("sm")]: {
|
|
23
|
+
position: "relative",
|
|
24
|
+
[r ? "paddingInlineEnd" : "paddingInlineStart"]: `calc(${y(t, i)} + ${b(t, i)})`
|
|
25
|
+
} }
|
|
26
|
+
};
|
|
27
|
+
}), ae = f(c, {
|
|
19
28
|
name: "SProductGallery",
|
|
20
29
|
slot: "Stage",
|
|
21
30
|
shouldForwardProp: (e) => e !== "ownerState"
|
|
22
31
|
})(({ ownerState: e, theme: t }) => ({
|
|
23
32
|
aspectRatio: String(e.aspectRatio),
|
|
24
33
|
backgroundColor: (t.vars ?? t).palette.background.paper,
|
|
25
|
-
borderRadius: t.radius.md,
|
|
34
|
+
borderRadius: e.variant === "compact" ? t.radius.sm : t.radius.md,
|
|
35
|
+
flex: 1,
|
|
36
|
+
minWidth: 0,
|
|
26
37
|
overflow: "hidden",
|
|
27
38
|
position: "relative",
|
|
28
39
|
width: "100%"
|
|
29
|
-
})),
|
|
40
|
+
})), oe = f(c, {
|
|
30
41
|
name: "SProductGallery",
|
|
31
42
|
slot: "Media",
|
|
32
43
|
shouldForwardProp: (e) => e !== "ownerState"
|
|
@@ -40,14 +51,10 @@ var re = f(l, {
|
|
|
40
51
|
gridArea: "1 / 1",
|
|
41
52
|
minWidth: 0
|
|
42
53
|
}
|
|
43
|
-
}),
|
|
54
|
+
}), se = f(n, {
|
|
44
55
|
name: "SProductGallery",
|
|
45
56
|
slot: "Image",
|
|
46
57
|
shouldForwardProp: (e) => e !== "ownerState"
|
|
47
|
-
})({}), se = f(i, {
|
|
48
|
-
name: "SProductGallery",
|
|
49
|
-
slot: "Carousel",
|
|
50
|
-
shouldForwardProp: (e) => e !== "ownerState"
|
|
51
58
|
})({}), ce = f("video", {
|
|
52
59
|
name: "SProductGallery",
|
|
53
60
|
slot: "Video",
|
|
@@ -61,9 +68,10 @@ var re = f(l, {
|
|
|
61
68
|
objectFit: "cover",
|
|
62
69
|
position: "absolute",
|
|
63
70
|
width: "100%"
|
|
64
|
-
}), le = f(
|
|
71
|
+
}), le = f(c, {
|
|
65
72
|
name: "SProductGallery",
|
|
66
|
-
slot: "VideoFrame"
|
|
73
|
+
slot: "VideoFrame",
|
|
74
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
67
75
|
})({
|
|
68
76
|
height: "100%",
|
|
69
77
|
minHeight: 0,
|
|
@@ -71,7 +79,8 @@ var re = f(l, {
|
|
|
71
79
|
width: "100%"
|
|
72
80
|
}), ue = f(r, {
|
|
73
81
|
name: "SProductGallery",
|
|
74
|
-
slot: "VideoPlayButton"
|
|
82
|
+
slot: "VideoPlayButton",
|
|
83
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
75
84
|
})(({ theme: e }) => {
|
|
76
85
|
let t = (e.vars ?? e).palette;
|
|
77
86
|
return {
|
|
@@ -88,68 +97,96 @@ var re = f(l, {
|
|
|
88
97
|
},
|
|
89
98
|
"& svg": { fontSize: e.typography.pxToRem(32) }
|
|
90
99
|
};
|
|
91
|
-
}), de = f(
|
|
100
|
+
}), de = f(c, {
|
|
92
101
|
name: "SProductGallery",
|
|
93
102
|
slot: "Thumbnails",
|
|
94
103
|
shouldForwardProp: (e) => e !== "ownerState"
|
|
95
|
-
})(({
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
104
|
+
})(({ ownerState: e, theme: t }) => {
|
|
105
|
+
let n = v(e.thumbnailsPosition), r = e.thumbnailsPosition === "end", i = e.variant === "compact";
|
|
106
|
+
return {
|
|
107
|
+
display: "flex",
|
|
108
|
+
flexDirection: "row",
|
|
109
|
+
gap: i ? t.spacing(.5) : t.spacing(1),
|
|
110
|
+
marginTop: i ? t.spacing(.75) : t.spacing(1),
|
|
111
|
+
maxWidth: "100%",
|
|
112
|
+
overflowX: "auto",
|
|
113
|
+
overflowY: "hidden",
|
|
114
|
+
padding: "2px",
|
|
115
|
+
scrollbarWidth: "none",
|
|
116
|
+
width: "100%",
|
|
117
|
+
"&::-webkit-scrollbar": { display: "none" },
|
|
118
|
+
...n && { [t.breakpoints.up("sm")]: {
|
|
119
|
+
flexDirection: "column",
|
|
120
|
+
gap: i ? t.spacing(.5) : t.spacing(.75),
|
|
121
|
+
insetBlock: 0,
|
|
122
|
+
[r ? "insetInlineEnd" : "insetInlineStart"]: 0,
|
|
123
|
+
marginTop: 0,
|
|
124
|
+
maxWidth: "none",
|
|
125
|
+
overflowX: "hidden",
|
|
126
|
+
overflowY: "auto",
|
|
127
|
+
position: "absolute",
|
|
128
|
+
width: y(t, i)
|
|
129
|
+
} }
|
|
130
|
+
};
|
|
131
|
+
}), fe = f(l, {
|
|
99
132
|
name: "SProductGallery",
|
|
100
133
|
slot: "Thumbnail",
|
|
101
134
|
shouldForwardProp: (e) => e !== "ownerState"
|
|
102
|
-
})(({
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
"
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}
|
|
135
|
+
})(({ ownerState: e, theme: t }) => {
|
|
136
|
+
let n = e.variant === "compact", r = n ? t.spacing(5.5) : t.spacing(8);
|
|
137
|
+
return {
|
|
138
|
+
aspectRatio: "1",
|
|
139
|
+
backgroundColor: (t.vars ?? t).palette.background.paper,
|
|
140
|
+
borderRadius: n ? t.radius.sm : t.radius.md,
|
|
141
|
+
boxSizing: "border-box",
|
|
142
|
+
display: "block",
|
|
143
|
+
flexShrink: 0,
|
|
144
|
+
height: r,
|
|
145
|
+
minHeight: r,
|
|
146
|
+
minWidth: r,
|
|
147
|
+
opacity: t.interaction.mediaIdleOpacity,
|
|
148
|
+
overflow: "hidden",
|
|
149
|
+
padding: 0,
|
|
150
|
+
position: "relative",
|
|
151
|
+
transition: t.transitions.create(["opacity", "box-shadow"]),
|
|
152
|
+
width: r,
|
|
153
|
+
"&.Mui-focusVisible": {
|
|
154
|
+
boxShadow: `0 0 0 2px ${(t.vars ?? t).palette.primary.main}`,
|
|
155
|
+
outline: 0,
|
|
156
|
+
zIndex: 2
|
|
157
|
+
},
|
|
158
|
+
"&::after": {
|
|
159
|
+
border: "2px solid transparent",
|
|
160
|
+
borderRadius: "inherit",
|
|
161
|
+
content: "\"\"",
|
|
162
|
+
inset: 0,
|
|
163
|
+
pointerEvents: "none",
|
|
164
|
+
position: "absolute",
|
|
165
|
+
transition: t.transitions.create("border-color"),
|
|
166
|
+
zIndex: 1
|
|
167
|
+
},
|
|
168
|
+
"@media (hover: hover) and (pointer: fine)": { "&:hover": { opacity: 1 } },
|
|
169
|
+
"@media (prefers-reduced-motion: reduce)": {
|
|
170
|
+
transition: "none",
|
|
171
|
+
"&::after": { transition: "none" }
|
|
172
|
+
},
|
|
173
|
+
variants: [{
|
|
174
|
+
props: ({ ownerState: e }) => e.selected,
|
|
175
|
+
style: {
|
|
176
|
+
"&::after": { borderColor: (t.vars ?? t).palette.primary.main },
|
|
177
|
+
opacity: 1
|
|
178
|
+
}
|
|
179
|
+
}]
|
|
180
|
+
};
|
|
181
|
+
}), pe = f(c, {
|
|
146
182
|
name: "SProductGallery",
|
|
147
|
-
slot: "VideoIndicator"
|
|
183
|
+
slot: "VideoIndicator",
|
|
184
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
148
185
|
})(({ theme: e }) => {
|
|
149
186
|
let t = (e.vars ?? e).palette;
|
|
150
187
|
return {
|
|
151
188
|
alignItems: "center",
|
|
152
|
-
backgroundColor:
|
|
189
|
+
backgroundColor: t.blackAlpha.medium,
|
|
153
190
|
borderRadius: e.radius.full,
|
|
154
191
|
boxShadow: e.shadows[2],
|
|
155
192
|
color: t.common.white,
|
|
@@ -165,151 +202,182 @@ var re = f(l, {
|
|
|
165
202
|
zIndex: 2,
|
|
166
203
|
"& svg": { fontSize: e.typography.pxToRem(20) }
|
|
167
204
|
};
|
|
168
|
-
}),
|
|
169
|
-
|
|
205
|
+
}), me = f(c, {
|
|
206
|
+
name: "SProductGallery",
|
|
207
|
+
slot: "Empty",
|
|
208
|
+
shouldForwardProp: (e) => e !== "ownerState"
|
|
209
|
+
})(({ theme: e }) => {
|
|
210
|
+
let t = (e.vars ?? e).palette;
|
|
211
|
+
return {
|
|
212
|
+
alignItems: "center",
|
|
213
|
+
color: t.text.secondary,
|
|
214
|
+
display: "flex",
|
|
215
|
+
flexDirection: "column",
|
|
216
|
+
height: "100%",
|
|
217
|
+
inset: 0,
|
|
218
|
+
justifyContent: "center",
|
|
219
|
+
padding: e.spacing(2),
|
|
220
|
+
position: "absolute",
|
|
221
|
+
width: "100%",
|
|
222
|
+
"& svg": {
|
|
223
|
+
color: t.action.disabled,
|
|
224
|
+
fontSize: e.typography.pxToRem(40),
|
|
225
|
+
marginBottom: e.spacing(.5)
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
}), x = 1;
|
|
229
|
+
function S(e, t) {
|
|
170
230
|
return e !== void 0 && Number.isFinite(e) && e > 0 ? e : t;
|
|
171
231
|
}
|
|
172
|
-
function
|
|
173
|
-
return typeof e == "number" ?
|
|
232
|
+
function he(e, t) {
|
|
233
|
+
return typeof e == "number" ? S(e, typeof t == "number" ? t : x) : typeof e == "string" && e.trim() ? e : t;
|
|
174
234
|
}
|
|
175
|
-
function
|
|
235
|
+
function ge(e) {
|
|
176
236
|
return e.type === "video" ? e.thumbnailSrc ?? e.poster ?? "" : e.thumbnailSrc ?? e.src;
|
|
177
237
|
}
|
|
178
|
-
function
|
|
238
|
+
function C(e) {
|
|
179
239
|
return e.type === "video" ? e.ariaLabel : e.alt;
|
|
180
240
|
}
|
|
181
|
-
function
|
|
241
|
+
function w(e) {
|
|
182
242
|
return e ? `${e.type ?? "image"}:${e.id}:${e.src}` : "";
|
|
183
243
|
}
|
|
184
|
-
var
|
|
185
|
-
let r =
|
|
244
|
+
var _e = (e, t, n) => {
|
|
245
|
+
let r = C(e);
|
|
186
246
|
return r ? `Show ${r}, ${t + 1} of ${n}` : `Show ${e.type === "video" ? "video" : "image"} ${t + 1} of ${n}`;
|
|
187
247
|
};
|
|
188
|
-
function
|
|
189
|
-
return `${
|
|
248
|
+
function ve(e, t, n) {
|
|
249
|
+
return `${C(e) || (e.type === "video" ? "Product video" : "Product image")} ${t + 1} of ${n}`;
|
|
190
250
|
}
|
|
191
|
-
|
|
192
|
-
|
|
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({
|
|
251
|
+
var T = i.forwardRef(function(r, c) {
|
|
252
|
+
let { aspectRatio: l = x, defaultValue: f, emptyText: v = "No product media", getThumbnailAriaLabel: y = _e, items: b, onChange: S, slotProps: C, slots: T, sx: E, thumbnailsLabel: D = "Choose product media", thumbnailsPosition: ye = "bottom", value: O, variant: be = "standard", ...k } = ee({
|
|
196
253
|
props: r,
|
|
197
254
|
name: "SProductGallery"
|
|
198
|
-
}),
|
|
199
|
-
controlled:
|
|
200
|
-
default:
|
|
255
|
+
}), xe = he(l, x), Se = i.useRef(b[0]?.id ?? ""), Ce = i.useRef(f === void 0), [A, j] = ne({
|
|
256
|
+
controlled: O,
|
|
257
|
+
default: f ?? Se.current,
|
|
201
258
|
name: "SProductGallery",
|
|
202
259
|
state: "value"
|
|
203
|
-
}),
|
|
260
|
+
}), M = O !== void 0, N = b.findIndex((e) => e.id === A), we = !M && b.length > 0 && N < 0 && (A !== "" || Ce.current), P = N >= 0 ? N : we ? 0 : -1, F = b[P] ?? null, I = F?.id ?? "", Te = w(F), L = F?.type === "video" ? Te : "", R = i.useRef([]), z = i.useRef(!1), B = i.useRef(null), V = i.useRef(!1), [H, U] = i.useState({
|
|
204
261
|
mediaKey: "",
|
|
205
262
|
loading: !1,
|
|
206
263
|
started: !1
|
|
207
|
-
}),
|
|
208
|
-
...
|
|
209
|
-
aspectRatio:
|
|
210
|
-
activeItem:
|
|
211
|
-
activeIndex:
|
|
212
|
-
defaultValue:
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
264
|
+
}), W = H.mediaKey === L ? H : null, G = W?.loading ?? !1, K = W?.started ?? !1, q = i.useId(), J = {
|
|
265
|
+
...k,
|
|
266
|
+
aspectRatio: xe,
|
|
267
|
+
activeItem: F,
|
|
268
|
+
activeIndex: P,
|
|
269
|
+
defaultValue: f,
|
|
270
|
+
emptyText: v,
|
|
271
|
+
getThumbnailAriaLabel: y,
|
|
272
|
+
items: b,
|
|
273
|
+
onChange: S,
|
|
274
|
+
sx: E,
|
|
275
|
+
thumbnailsLabel: D,
|
|
276
|
+
thumbnailsPosition: ye,
|
|
277
|
+
value: I,
|
|
278
|
+
variant: be
|
|
279
|
+
}, Y = t(C?.video, J), Ee = h(B, Y?.ref);
|
|
280
|
+
i.useEffect(() => {
|
|
281
|
+
!M && F && A !== I && j(I);
|
|
223
282
|
}, [
|
|
224
|
-
P,
|
|
225
283
|
F,
|
|
284
|
+
I,
|
|
285
|
+
M,
|
|
226
286
|
j,
|
|
227
|
-
A
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
287
|
+
A
|
|
288
|
+
]), i.useEffect(() => {
|
|
289
|
+
if (P < 0) return;
|
|
290
|
+
if (!z.current) {
|
|
291
|
+
z.current = !0;
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
let e = typeof window < "u" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
295
|
+
R.current[P]?.scrollIntoView?.({
|
|
296
|
+
block: "nearest",
|
|
297
|
+
inline: "nearest",
|
|
298
|
+
behavior: e ? "auto" : "smooth"
|
|
299
|
+
});
|
|
300
|
+
}, [P]), i.useEffect(() => {
|
|
301
|
+
V.current = !1, U({
|
|
302
|
+
mediaKey: "",
|
|
303
|
+
loading: !1,
|
|
304
|
+
started: !1
|
|
305
|
+
});
|
|
306
|
+
}, [L]);
|
|
307
|
+
let De = m((e, t) => {
|
|
308
|
+
let n = b[t];
|
|
309
|
+
!n || n.id === F?.id || (j(n.id), S?.(e, n.id));
|
|
310
|
+
}), Oe = m(() => {
|
|
311
|
+
let e = B.current;
|
|
312
|
+
if (!e || F?.type !== "video") return;
|
|
313
|
+
let t = w(F);
|
|
314
|
+
V.current = !0, U({
|
|
242
315
|
mediaKey: t,
|
|
243
316
|
loading: !0,
|
|
244
317
|
started: !1
|
|
245
318
|
}), e.play().catch(() => {
|
|
246
|
-
|
|
319
|
+
V.current = !1, U((n) => B.current === e && n.mediaKey === t ? {
|
|
247
320
|
...n,
|
|
248
321
|
loading: !1,
|
|
249
322
|
started: !1
|
|
250
323
|
} : n);
|
|
251
324
|
});
|
|
252
|
-
}),
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
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, {
|
|
325
|
+
}), ke = T?.root ?? ie, Ae = T?.stage ?? ae, je = T?.media ?? oe, Me = T?.image ?? se, Ne = T?.video ?? ce, X = T?.videoFrame ?? le, Pe = T?.videoPlayButton ?? ue, Fe = T?.videoIndicator ?? pe, Ie = T?.thumbnails ?? de, Le = T?.thumbnail ?? fe, Re = T?.empty ?? me, { ref: ze, sx: Be, ...Z } = g(ke, p(t(C?.root, J), k), J), Ve = h(ze, c), Q = g(Ae, t(C?.stage, J) ?? {}, J), He = g(je, t(C?.media, J) ?? {}, J), $ = g(Ie, t(C?.thumbnails, J) ?? {}, J), Ue = g(Re, t(C?.empty, J) ?? {}, J), We = t(C?.videoFrame, J), Ge = t(C?.videoPlayButton, J), Ke = t(C?.videoIndicator, J), qe = () => {
|
|
326
|
+
if (!F) return /* @__PURE__ */ s(Re, {
|
|
327
|
+
...Ue,
|
|
328
|
+
children: [/* @__PURE__ */ o(re, {}), /* @__PURE__ */ o(d, {
|
|
329
|
+
variant: "body2",
|
|
330
|
+
children: v
|
|
331
|
+
})]
|
|
332
|
+
});
|
|
333
|
+
if (F.type === "video") {
|
|
334
|
+
let e = w(F), t = (e) => e.currentTarget === B.current, { children: n, controls: r = !0, ...i } = g(Ne, p(Y, {
|
|
265
335
|
controls: !0,
|
|
266
336
|
onCanPlay: (n) => {
|
|
267
|
-
t(n) &&
|
|
337
|
+
t(n) && U((t) => t.mediaKey === e && t.started ? {
|
|
268
338
|
...t,
|
|
269
339
|
loading: !1
|
|
270
340
|
} : t);
|
|
271
341
|
},
|
|
272
342
|
onEnded: (n) => {
|
|
273
|
-
t(n) && (
|
|
274
|
-
|
|
275
|
-
loading: !1
|
|
276
|
-
|
|
277
|
-
}));
|
|
343
|
+
t(n) && (V.current = !1, U((t) => t.mediaKey === e ? {
|
|
344
|
+
...t,
|
|
345
|
+
loading: !1
|
|
346
|
+
} : t));
|
|
278
347
|
},
|
|
279
348
|
onError: (n) => {
|
|
280
|
-
t(n) && (
|
|
349
|
+
t(n) && (V.current = !1, U({
|
|
281
350
|
mediaKey: e,
|
|
282
351
|
loading: !1,
|
|
283
352
|
started: !1
|
|
284
353
|
}));
|
|
285
354
|
},
|
|
286
355
|
onPause: (n) => {
|
|
287
|
-
t(n) && (
|
|
288
|
-
|
|
289
|
-
loading: !1
|
|
290
|
-
|
|
291
|
-
}));
|
|
356
|
+
t(n) && (V.current = !1, U((t) => t.mediaKey === e ? {
|
|
357
|
+
...t,
|
|
358
|
+
loading: !1
|
|
359
|
+
} : t));
|
|
292
360
|
},
|
|
293
361
|
onPlay: (n) => {
|
|
294
|
-
t(n) &&
|
|
362
|
+
t(n) && U((t) => ({
|
|
295
363
|
mediaKey: e,
|
|
296
364
|
loading: !0,
|
|
297
|
-
started: !1
|
|
298
|
-
});
|
|
365
|
+
started: t.mediaKey === e ? t.started : !1
|
|
366
|
+
}));
|
|
299
367
|
},
|
|
300
368
|
onPlaying: (n) => {
|
|
301
369
|
if (!t(n)) return;
|
|
302
|
-
let r = n.currentTarget, i =
|
|
303
|
-
|
|
370
|
+
let r = n.currentTarget, i = V.current;
|
|
371
|
+
V.current = !1, U({
|
|
304
372
|
mediaKey: e,
|
|
305
373
|
loading: !1,
|
|
306
374
|
started: !0
|
|
307
375
|
}), i && requestAnimationFrame(() => {
|
|
308
|
-
|
|
376
|
+
B.current === r && r.focus({ preventScroll: !0 });
|
|
309
377
|
});
|
|
310
378
|
},
|
|
311
379
|
onWaiting: (n) => {
|
|
312
|
-
t(n) &&
|
|
380
|
+
t(n) && U((t) => ({
|
|
313
381
|
mediaKey: e,
|
|
314
382
|
loading: !0,
|
|
315
383
|
started: t.mediaKey === e && t.started
|
|
@@ -317,111 +385,99 @@ var x = a.forwardRef(function(r, i) {
|
|
|
317
385
|
},
|
|
318
386
|
playsInline: !0,
|
|
319
387
|
preload: "metadata"
|
|
320
|
-
}),
|
|
321
|
-
|
|
322
|
-
"aria-
|
|
323
|
-
|
|
388
|
+
}), J), a = g(X, p(We, { "aria-busy": G || void 0 }), J), c = g(Pe, p(Ge, {
|
|
389
|
+
"aria-busy": G || void 0,
|
|
390
|
+
"aria-label": G ? `Loading ${F.ariaLabel}` : `Play ${F.ariaLabel}`,
|
|
391
|
+
disabled: G,
|
|
392
|
+
onClick: Oe,
|
|
393
|
+
variant: "overlay"
|
|
394
|
+
}), J);
|
|
395
|
+
return /* @__PURE__ */ s(X, {
|
|
396
|
+
...a,
|
|
397
|
+
children: [/* @__PURE__ */ o(Ne, {
|
|
324
398
|
...i,
|
|
325
|
-
"aria-label":
|
|
326
|
-
controls: r &&
|
|
327
|
-
poster:
|
|
328
|
-
ref:
|
|
329
|
-
src:
|
|
399
|
+
"aria-label": F.ariaLabel,
|
|
400
|
+
controls: r && K,
|
|
401
|
+
poster: F.poster,
|
|
402
|
+
ref: Ee,
|
|
403
|
+
src: F.src,
|
|
330
404
|
children: n
|
|
331
|
-
}),
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
onClick: Ae,
|
|
336
|
-
variant: "overlay",
|
|
337
|
-
children: U ? /* @__PURE__ */ s(d, {
|
|
338
|
-
"aria-label": `Loading ${P.ariaLabel}`,
|
|
405
|
+
}), K ? null : /* @__PURE__ */ o(Pe, {
|
|
406
|
+
...c,
|
|
407
|
+
children: G ? /* @__PURE__ */ o(u, {
|
|
408
|
+
"aria-label": `Loading ${F.ariaLabel}`,
|
|
339
409
|
color: "inherit",
|
|
340
|
-
size:
|
|
341
|
-
}) : /* @__PURE__ */
|
|
342
|
-
})
|
|
343
|
-
},
|
|
410
|
+
size: 32
|
|
411
|
+
}) : /* @__PURE__ */ o(_, {})
|
|
412
|
+
})]
|
|
413
|
+
}, e);
|
|
344
414
|
}
|
|
345
|
-
let { slotProps: e, ...n } = p(t(
|
|
415
|
+
let { slotProps: e, ...n } = p(t(C?.image, J), { variant: "rectangular" }), r = g(Me, n, J), i = {
|
|
346
416
|
...e,
|
|
347
417
|
image: p(e?.image, { sx: { objectFit: "cover" } })
|
|
348
418
|
};
|
|
349
|
-
return /* @__PURE__ */
|
|
419
|
+
return /* @__PURE__ */ a(Me, {
|
|
350
420
|
...r,
|
|
351
|
-
alt:
|
|
352
|
-
key: `${
|
|
421
|
+
alt: F.alt,
|
|
422
|
+
key: `${F.type ?? "image"}:${F.id}:${F.src}`,
|
|
353
423
|
slotProps: i,
|
|
354
|
-
src:
|
|
424
|
+
src: F.src
|
|
355
425
|
});
|
|
426
|
+
}, Je = (e, r) => {
|
|
427
|
+
let i = r === P, a = {
|
|
428
|
+
...J,
|
|
429
|
+
index: r,
|
|
430
|
+
item: e,
|
|
431
|
+
selected: i
|
|
432
|
+
}, c = t(C?.thumbnail, a), { ref: l, ...u } = g(Le, c ?? {}, a), d = `${q}-thumbnail-${r}`, f = g(Fe, p(Ke, { "aria-hidden": !0 }), J);
|
|
433
|
+
return /* @__PURE__ */ s(Le, {
|
|
434
|
+
"aria-controls": q,
|
|
435
|
+
"aria-label": y(e, r, b.length),
|
|
436
|
+
"aria-pressed": i,
|
|
437
|
+
id: d,
|
|
438
|
+
...u,
|
|
439
|
+
onClick: (e) => {
|
|
440
|
+
c?.onClick?.(e), e.defaultPrevented || De(e, r);
|
|
441
|
+
},
|
|
442
|
+
ref: (e) => {
|
|
443
|
+
R.current[r] = e, te(l, e);
|
|
444
|
+
},
|
|
445
|
+
children: [/* @__PURE__ */ o(n, {
|
|
446
|
+
alt: "",
|
|
447
|
+
src: ge(e),
|
|
448
|
+
variant: "rectangular",
|
|
449
|
+
slotProps: { image: { sx: { objectFit: "cover" } } }
|
|
450
|
+
}), e.type === "video" ? /* @__PURE__ */ o(Fe, {
|
|
451
|
+
...f,
|
|
452
|
+
children: /* @__PURE__ */ o(_, {})
|
|
453
|
+
}) : null]
|
|
454
|
+
}, e.id);
|
|
356
455
|
};
|
|
357
|
-
return /* @__PURE__ */
|
|
358
|
-
...
|
|
359
|
-
"aria-label":
|
|
360
|
-
"aria-roledescription":
|
|
361
|
-
ref:
|
|
362
|
-
role:
|
|
363
|
-
sx: [...e(
|
|
364
|
-
children: [/* @__PURE__ */
|
|
365
|
-
...
|
|
366
|
-
"aria-
|
|
367
|
-
"aria-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
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
|
-
})
|
|
456
|
+
return /* @__PURE__ */ s(ke, {
|
|
457
|
+
...Z,
|
|
458
|
+
"aria-label": Z["aria-label"] ?? "Product media gallery",
|
|
459
|
+
"aria-roledescription": Z["aria-roledescription"] ?? "carousel",
|
|
460
|
+
ref: Ve,
|
|
461
|
+
role: Z.role ?? "group",
|
|
462
|
+
sx: [...e(Be), ...e(E)],
|
|
463
|
+
children: [/* @__PURE__ */ o(Ae, {
|
|
464
|
+
...Q,
|
|
465
|
+
"aria-label": Q["aria-label"] ?? (F ? ve(F, P, b.length) : void 0),
|
|
466
|
+
"aria-roledescription": Q["aria-roledescription"] ?? (F ? "slide" : void 0),
|
|
467
|
+
id: q,
|
|
468
|
+
role: Q.role ?? (F ? "group" : void 0),
|
|
469
|
+
children: /* @__PURE__ */ o(je, {
|
|
470
|
+
...He,
|
|
471
|
+
children: qe()
|
|
421
472
|
})
|
|
473
|
+
}), b.length > 1 ? /* @__PURE__ */ o(Ie, {
|
|
474
|
+
...$,
|
|
475
|
+
"aria-label": $["aria-label"] ?? D,
|
|
476
|
+
role: $.role ?? "group",
|
|
477
|
+
children: b.map((e, t) => Je(e, t))
|
|
422
478
|
}) : null]
|
|
423
479
|
});
|
|
424
480
|
});
|
|
425
|
-
|
|
481
|
+
T.displayName = "SProductGallery";
|
|
426
482
|
//#endregion
|
|
427
|
-
export {
|
|
483
|
+
export { T as SProductGallery, T as default };
|