@vkzstudio/muza-ui 1.5.2 → 1.7.0
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/ArticleCard/ArticleCard.d.ts.map +1 -1
- package/dist/components/ArticleCard/ArticleCard.js +161 -170
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +42 -40
- package/dist/components/Button/Button.stories.d.ts.map +1 -1
- package/dist/components/Carousel/Carousel.d.ts +99 -2
- package/dist/components/Carousel/Carousel.d.ts.map +1 -1
- package/dist/components/Carousel/Carousel.js +208 -151
- package/dist/components/Carousel/Carousel.stories.d.ts +2 -0
- package/dist/components/Carousel/Carousel.stories.d.ts.map +1 -1
- package/dist/components/Carousel/index.js +3 -2
- package/dist/components/CarouselSection/CarouselSection.examples.d.ts +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +22 -3
- package/dist/components/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.js +131 -105
- package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts +3 -2
- package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts.map +1 -1
- package/dist/components/MarketNav/MarketNav.examples.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +28 -29
- package/dist/components/OfferCard/OfferCard.d.ts +45 -17
- package/dist/components/OfferCard/OfferCard.d.ts.map +1 -1
- package/dist/components/OfferCard/OfferCard.js +180 -266
- package/dist/components/OfferCard/OfferCard.stories.d.ts +5 -2
- package/dist/components/OfferCard/OfferCard.stories.d.ts.map +1 -1
- package/dist/components/PartnerCard/PartnerCard.d.ts +90 -26
- package/dist/components/PartnerCard/PartnerCard.d.ts.map +1 -1
- package/dist/components/PartnerCard/PartnerCard.js +323 -264
- package/dist/components/PartnerCard/PartnerCard.stories.d.ts +6 -0
- package/dist/components/PartnerCard/PartnerCard.stories.d.ts.map +1 -1
- package/dist/components/PriceTag/PriceTag.d.ts +37 -0
- package/dist/components/PriceTag/PriceTag.d.ts.map +1 -0
- package/dist/components/PriceTag/PriceTag.js +43 -0
- package/dist/components/PriceTag/PriceTag.stories.d.ts +8 -0
- package/dist/components/PriceTag/PriceTag.stories.d.ts.map +1 -0
- package/dist/components/PriceTag/index.d.ts +2 -0
- package/dist/components/PriceTag/index.d.ts.map +1 -0
- package/dist/components/PriceTag/index.js +5 -0
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +74 -100
- package/dist/components/Select/Select.stories.d.ts.map +1 -1
- package/dist/components/Select/SelectTrigger.d.ts +54 -0
- package/dist/components/Select/SelectTrigger.d.ts.map +1 -0
- package/dist/components/Select/SelectTrigger.js +57 -0
- package/dist/components/Select/SelectTrigger.stories.d.ts +11 -0
- package/dist/components/Select/SelectTrigger.stories.d.ts.map +1 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +6 -2
- package/dist/components/Select/utils.d.ts +10 -1
- package/dist/components/Select/utils.d.ts.map +1 -1
- package/dist/components/Select/utils.js +3 -5
- package/dist/components/Tooltip/Tooltip.d.ts +18 -7
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +116 -68
- package/dist/components/Tooltip/Tooltip.stories.d.ts +1 -0
- package/dist/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/components/UniversalFooter/UniversalFooter.js +1 -1
- package/dist/components/VoucherCard/VoucherCard.d.ts +24 -1
- package/dist/components/VoucherCard/VoucherCard.d.ts.map +1 -1
- package/dist/components/VoucherCard/VoucherCard.js +68 -76
- package/dist/components/VoucherCard/VoucherCard.stories.d.ts +1 -0
- package/dist/components/VoucherCard/VoucherCard.stories.d.ts.map +1 -1
- package/dist/components/WebCheckoutNav/WebCheckoutNav.examples.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/internal/CardCompactShell.d.ts +80 -0
- package/dist/components/internal/CardCompactShell.d.ts.map +1 -0
- package/dist/components/internal/CardCompactShell.js +148 -0
- package/dist/components/internal/CardImageSlot.d.ts +56 -0
- package/dist/components/internal/CardImageSlot.d.ts.map +1 -0
- package/dist/components/internal/CardImageSlot.js +85 -0
- package/dist/index.js +356 -348
- package/dist/muza-ui.css +1 -1
- package/dist/styles/token-sizes.css +16 -4
- package/dist/utils/cn.d.ts.map +1 -1
- package/dist/utils/cn.js +6 -3
- package/dist/utils/disabledLinkProps.d.ts +8 -1
- package/dist/utils/disabledLinkProps.d.ts.map +1 -1
- package/dist/utils/disabledLinkProps.js +0 -1
- package/llms-full.md +133 -2
- package/llms.txt +2 -0
- package/package.json +3 -1
|
@@ -1,28 +1,55 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsx as p, jsxs as Z } from "react/jsx-runtime";
|
|
2
|
+
import * as r from "react";
|
|
3
|
+
import $ from "embla-carousel-autoplay";
|
|
4
|
+
import ee from "embla-carousel-react";
|
|
5
|
+
import { useMuzaTranslations as U } from "../../translations/TranslationContext.js";
|
|
6
|
+
import { cn as C } from "../../utils/cn.js";
|
|
7
|
+
import { ButtonArrow as K } from "../ButtonArrow/ButtonArrow.js";
|
|
8
|
+
import { Flex as oe } from "../Flex/Flex.js";
|
|
9
|
+
import { SliderIndicators as re } from "../SliderIndicators/SliderIndicators.js";
|
|
10
|
+
import { useMediaQuery as te } from "../../hooks/use-media-query.js";
|
|
11
|
+
const se = "(prefers-reduced-motion: reduce)", ae = 5e3, F = r.createContext(null), v = () => {
|
|
12
|
+
const t = r.useContext(F);
|
|
11
13
|
if (!t)
|
|
12
14
|
throw new Error("useCarousel must be used within a <Carousel />");
|
|
13
15
|
return t;
|
|
14
|
-
},
|
|
16
|
+
}, le = r.forwardRef(
|
|
15
17
|
({
|
|
16
18
|
orientation: t = "horizontal",
|
|
17
|
-
options:
|
|
18
|
-
align:
|
|
19
|
-
setApi:
|
|
20
|
-
plugins:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
options: l,
|
|
20
|
+
align: u,
|
|
21
|
+
setApi: n,
|
|
22
|
+
plugins: s,
|
|
23
|
+
autoplay: f = !1,
|
|
24
|
+
autoplayDelay: c = ae,
|
|
25
|
+
className: w,
|
|
26
|
+
children: b,
|
|
27
|
+
onPointerEnter: m,
|
|
28
|
+
onPointerLeave: d,
|
|
29
|
+
...x
|
|
30
|
+
}, a) => {
|
|
31
|
+
const i = te(se), y = (s ?? []).some(
|
|
32
|
+
(o) => o.name === "autoplay"
|
|
33
|
+
), g = f && !i && !y, Y = r.useMemo(() => g ? [
|
|
34
|
+
...s ?? [],
|
|
35
|
+
$({
|
|
36
|
+
delay: c,
|
|
37
|
+
// Pause/resume is driven from this component instead of the plugin's
|
|
38
|
+
// own wiring: on touch devices the browser fires a synthetic
|
|
39
|
+
// `mouseenter` after a tap and never a matching `mouseleave`, which
|
|
40
|
+
// leaves the plugin's internal "mouse is over" flag stuck and
|
|
41
|
+
// autoplay dead. `stopOnInteraction: true` keeps the plugin's
|
|
42
|
+
// pointerDown pause (the same thing we'd do ourselves) while leaving
|
|
43
|
+
// every resume decision to us, so hover state is always respected.
|
|
44
|
+
stopOnInteraction: !0,
|
|
45
|
+
stopOnMouseEnter: !1,
|
|
46
|
+
// The plugin's focus-in stop is a one-way trip in this configuration
|
|
47
|
+
// (its matching focusout resume is only registered when
|
|
48
|
+
// `stopOnInteraction` is false), which would kill autoplay for good
|
|
49
|
+
// the first time anything inside gets focused.
|
|
50
|
+
stopOnFocusIn: !1
|
|
51
|
+
})
|
|
52
|
+
] : s, [g, c, s]), [j, e] = ee(
|
|
26
53
|
{
|
|
27
54
|
// `skipSnaps: true` lets a longer drag/flick cross several slides
|
|
28
55
|
// before snapping, instead of Embla's default of clamping every drag
|
|
@@ -30,71 +57,100 @@ const R = o.createContext(null), v = () => {
|
|
|
30
57
|
// (e.g. single-slide galleries that should advance one at a time).
|
|
31
58
|
skipSnaps: !0,
|
|
32
59
|
// `align` prop is a baseline; an explicit `options.align` overrides it.
|
|
33
|
-
...
|
|
34
|
-
...
|
|
60
|
+
...u !== void 0 && { align: u },
|
|
61
|
+
...l,
|
|
35
62
|
axis: t === "horizontal" ? "x" : "y"
|
|
36
63
|
},
|
|
37
|
-
|
|
38
|
-
), [
|
|
39
|
-
|
|
40
|
-
}, []),
|
|
41
|
-
|
|
42
|
-
}, []),
|
|
64
|
+
Y
|
|
65
|
+
), [Q, B] = r.useState(!1), [V, q] = r.useState(!1), [G, J] = r.useState(0), [M, O] = r.useState(0), h = r.useCallback((o) => {
|
|
66
|
+
o && (J(o.selectedScrollSnap()), B(o.canScrollPrev()), q(o.canScrollNext()));
|
|
67
|
+
}, []), z = r.useCallback((o) => {
|
|
68
|
+
o && O(o.scrollSnapList().length);
|
|
69
|
+
}, []), E = r.useCallback(() => {
|
|
43
70
|
e == null || e.scrollPrev();
|
|
44
|
-
}, [e]),
|
|
71
|
+
}, [e]), P = r.useCallback(() => {
|
|
45
72
|
e == null || e.scrollNext();
|
|
46
|
-
}, [e]),
|
|
47
|
-
(
|
|
48
|
-
e == null || e.scrollTo(
|
|
73
|
+
}, [e]), W = r.useCallback(
|
|
74
|
+
(o) => {
|
|
75
|
+
e == null || e.scrollTo(o);
|
|
49
76
|
},
|
|
50
77
|
[e]
|
|
51
|
-
),
|
|
52
|
-
(
|
|
53
|
-
const
|
|
54
|
-
|
|
78
|
+
), X = r.useCallback(
|
|
79
|
+
(o) => {
|
|
80
|
+
const L = t === "horizontal" ? "ArrowLeft" : "ArrowUp", D = t === "horizontal" ? "ArrowRight" : "ArrowDown";
|
|
81
|
+
o.key === L ? (o.preventDefault(), E()) : o.key === D && (o.preventDefault(), P());
|
|
55
82
|
},
|
|
56
|
-
[t,
|
|
83
|
+
[t, E, P]
|
|
57
84
|
);
|
|
58
|
-
|
|
59
|
-
!e || !
|
|
60
|
-
}, [e,
|
|
85
|
+
r.useEffect(() => {
|
|
86
|
+
!e || !n || n(e);
|
|
87
|
+
}, [e, n]), r.useEffect(() => {
|
|
61
88
|
if (e)
|
|
62
|
-
return
|
|
63
|
-
e.off("select",
|
|
89
|
+
return O(e.scrollSnapList().length), h(e), e.on("select", h), e.on("reInit", h), e.on("reInit", z), () => {
|
|
90
|
+
e.off("select", h), e.off("reInit", h), e.off("reInit", z);
|
|
64
91
|
};
|
|
65
|
-
}, [e,
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
92
|
+
}, [e, h, z]);
|
|
93
|
+
const T = r.useRef(!1), S = r.useRef(!1), N = r.useRef(!1), R = g && M > 1, A = r.useCallback(
|
|
94
|
+
() => R ? e == null ? void 0 : e.plugins().autoplay : void 0,
|
|
95
|
+
[e, R]
|
|
96
|
+
), k = r.useCallback(() => {
|
|
97
|
+
var o;
|
|
98
|
+
(o = A()) == null || o.stop();
|
|
99
|
+
}, [A]), I = r.useCallback(() => {
|
|
100
|
+
var o;
|
|
101
|
+
T.current || S.current || (o = A()) == null || o.play();
|
|
102
|
+
}, [A]);
|
|
103
|
+
r.useEffect(() => {
|
|
104
|
+
if (!e || !R) return;
|
|
105
|
+
const o = () => {
|
|
106
|
+
S.current = !0, N.current = !0, k();
|
|
107
|
+
}, L = () => {
|
|
108
|
+
S.current = !1, I();
|
|
109
|
+
}, D = () => {
|
|
110
|
+
N.current && (N.current = !1, I());
|
|
111
|
+
};
|
|
112
|
+
return e.on("pointerDown", o), e.on("pointerUp", L), e.on("settle", D), () => {
|
|
113
|
+
e.off("pointerDown", o), e.off("pointerUp", L), e.off("settle", D), S.current = !1, N.current = !1;
|
|
114
|
+
};
|
|
115
|
+
}, [e, R, k, I]);
|
|
116
|
+
const _ = [], H = [];
|
|
117
|
+
return r.Children.forEach(b, (o) => {
|
|
118
|
+
r.isValidElement(o) && o.type === fe ? _.push(o) : H.push(o);
|
|
119
|
+
}), /* @__PURE__ */ p(
|
|
120
|
+
F.Provider,
|
|
71
121
|
{
|
|
72
122
|
value: {
|
|
73
|
-
carouselRef:
|
|
123
|
+
carouselRef: j,
|
|
74
124
|
api: e,
|
|
75
|
-
options:
|
|
125
|
+
options: l,
|
|
76
126
|
orientation: t,
|
|
77
|
-
plugins:
|
|
78
|
-
scrollPrev:
|
|
79
|
-
scrollNext:
|
|
80
|
-
canScrollPrev:
|
|
81
|
-
canScrollNext:
|
|
82
|
-
selectedIndex:
|
|
83
|
-
scrollTo:
|
|
84
|
-
slidesCount:
|
|
127
|
+
plugins: s,
|
|
128
|
+
scrollPrev: E,
|
|
129
|
+
scrollNext: P,
|
|
130
|
+
canScrollPrev: Q,
|
|
131
|
+
canScrollNext: V,
|
|
132
|
+
selectedIndex: G,
|
|
133
|
+
scrollTo: W,
|
|
134
|
+
slidesCount: M
|
|
85
135
|
},
|
|
86
|
-
children: /* @__PURE__ */
|
|
136
|
+
children: /* @__PURE__ */ Z(
|
|
87
137
|
"div",
|
|
88
138
|
{
|
|
89
|
-
ref:
|
|
90
|
-
onKeyDownCapture:
|
|
91
|
-
className:
|
|
139
|
+
ref: a,
|
|
140
|
+
onKeyDownCapture: X,
|
|
141
|
+
className: w,
|
|
92
142
|
role: "region",
|
|
93
143
|
"aria-roledescription": "carousel",
|
|
94
|
-
|
|
144
|
+
onPointerEnter: (o) => {
|
|
145
|
+
o.pointerType === "mouse" && (T.current = !0, k()), m == null || m(o);
|
|
146
|
+
},
|
|
147
|
+
onPointerLeave: (o) => {
|
|
148
|
+
o.pointerType === "mouse" && (T.current = !1, I()), d == null || d(o);
|
|
149
|
+
},
|
|
150
|
+
...x,
|
|
95
151
|
children: [
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
|
|
152
|
+
/* @__PURE__ */ p("div", { className: "relative", children: H }),
|
|
153
|
+
_
|
|
98
154
|
]
|
|
99
155
|
}
|
|
100
156
|
)
|
|
@@ -102,90 +158,90 @@ const R = o.createContext(null), v = () => {
|
|
|
102
158
|
);
|
|
103
159
|
}
|
|
104
160
|
);
|
|
105
|
-
|
|
106
|
-
const
|
|
107
|
-
({ className: t, overflowVisible:
|
|
108
|
-
const { carouselRef:
|
|
109
|
-
return /* @__PURE__ */
|
|
161
|
+
le.displayName = "Carousel";
|
|
162
|
+
const ne = r.forwardRef(
|
|
163
|
+
({ className: t, overflowVisible: l = !1, ...u }, n) => {
|
|
164
|
+
const { carouselRef: s, orientation: f } = v(), c = f === "horizontal";
|
|
165
|
+
return /* @__PURE__ */ p(
|
|
110
166
|
"div",
|
|
111
167
|
{
|
|
112
|
-
ref:
|
|
113
|
-
className:
|
|
168
|
+
ref: s,
|
|
169
|
+
className: C(
|
|
114
170
|
// touch-action: keeps cross-axis native scroll while same-axis swipes go to Embla
|
|
115
171
|
"select-none",
|
|
116
|
-
|
|
117
|
-
|
|
172
|
+
l ? "overflow-visible" : "overflow-hidden",
|
|
173
|
+
c ? "[touch-action:pan-y_pinch-zoom]" : "[touch-action:pan-x_pinch-zoom]"
|
|
118
174
|
),
|
|
119
|
-
children: /* @__PURE__ */
|
|
120
|
-
|
|
175
|
+
children: /* @__PURE__ */ p(
|
|
176
|
+
oe,
|
|
121
177
|
{
|
|
122
|
-
ref:
|
|
123
|
-
direction:
|
|
124
|
-
className:
|
|
125
|
-
|
|
178
|
+
ref: n,
|
|
179
|
+
direction: c ? "row" : "column",
|
|
180
|
+
className: C(
|
|
181
|
+
c ? "-ml-comp-carousel-gap" : "-mt-comp-carousel-gap",
|
|
126
182
|
t
|
|
127
183
|
),
|
|
128
|
-
...
|
|
184
|
+
...u
|
|
129
185
|
}
|
|
130
186
|
)
|
|
131
187
|
}
|
|
132
188
|
);
|
|
133
189
|
}
|
|
134
190
|
);
|
|
135
|
-
|
|
136
|
-
const
|
|
137
|
-
({ className: t, ...
|
|
138
|
-
const { orientation:
|
|
139
|
-
return /* @__PURE__ */
|
|
191
|
+
ne.displayName = "CarouselContent";
|
|
192
|
+
const ce = r.forwardRef(
|
|
193
|
+
({ className: t, ...l }, u) => {
|
|
194
|
+
const { orientation: n } = v();
|
|
195
|
+
return /* @__PURE__ */ p(
|
|
140
196
|
"div",
|
|
141
197
|
{
|
|
142
|
-
ref:
|
|
198
|
+
ref: u,
|
|
143
199
|
role: "group",
|
|
144
200
|
"aria-roledescription": "slide",
|
|
145
|
-
className:
|
|
201
|
+
className: C(
|
|
146
202
|
"min-w-0 shrink-0 grow-0 basis-full",
|
|
147
203
|
{
|
|
148
|
-
"pl-comp-carousel-gap":
|
|
149
|
-
"pt-comp-carousel-gap":
|
|
204
|
+
"pl-comp-carousel-gap": n === "horizontal",
|
|
205
|
+
"pt-comp-carousel-gap": n !== "horizontal"
|
|
150
206
|
},
|
|
151
207
|
t
|
|
152
208
|
),
|
|
153
|
-
...
|
|
209
|
+
...l
|
|
154
210
|
}
|
|
155
211
|
);
|
|
156
212
|
}
|
|
157
213
|
);
|
|
158
|
-
|
|
159
|
-
const
|
|
214
|
+
ce.displayName = "CarouselItem";
|
|
215
|
+
const ue = r.forwardRef(
|
|
160
216
|
({
|
|
161
217
|
className: t,
|
|
162
|
-
size:
|
|
163
|
-
ariaLabel:
|
|
164
|
-
hideWhenDisabled:
|
|
165
|
-
onClick:
|
|
218
|
+
size: l = "default",
|
|
219
|
+
ariaLabel: u,
|
|
220
|
+
hideWhenDisabled: n = !1,
|
|
221
|
+
onClick: s,
|
|
166
222
|
...f
|
|
167
|
-
},
|
|
168
|
-
const { orientation:
|
|
169
|
-
return
|
|
170
|
-
|
|
223
|
+
}, c) => {
|
|
224
|
+
const { orientation: w, scrollPrev: b, canScrollPrev: m } = v(), d = U(), x = u ?? d.carousel.previousAriaLabel, a = w === "horizontal", i = l === "sm";
|
|
225
|
+
return n && !m ? null : /* @__PURE__ */ p(
|
|
226
|
+
K,
|
|
171
227
|
{
|
|
172
|
-
ref:
|
|
228
|
+
ref: c,
|
|
173
229
|
direction: "left",
|
|
174
|
-
size:
|
|
175
|
-
disabled: !
|
|
176
|
-
"aria-label":
|
|
177
|
-
onClick: (
|
|
178
|
-
|
|
230
|
+
size: l,
|
|
231
|
+
disabled: !m,
|
|
232
|
+
"aria-label": x,
|
|
233
|
+
onClick: (y) => {
|
|
234
|
+
b(), s == null || s(y);
|
|
179
235
|
},
|
|
180
|
-
className:
|
|
236
|
+
className: C(
|
|
181
237
|
"absolute",
|
|
182
238
|
{
|
|
183
239
|
"top-1/2 -translate-y-1/2": a,
|
|
184
240
|
"left-1/2 -translate-x-1/2 rotate-90": !a,
|
|
185
|
-
"-left-comp-carousel-arrow-offset-sm": a &&
|
|
186
|
-
"-left-comp-carousel-arrow-offset": a && !
|
|
187
|
-
"-top-comp-carousel-arrow-offset-v-sm": !a &&
|
|
188
|
-
"-top-comp-carousel-arrow-offset-v": !a && !
|
|
241
|
+
"-left-comp-carousel-arrow-offset-sm": a && i,
|
|
242
|
+
"-left-comp-carousel-arrow-offset": a && !i,
|
|
243
|
+
"-top-comp-carousel-arrow-offset-v-sm": !a && i,
|
|
244
|
+
"-top-comp-carousel-arrow-offset-v": !a && !i
|
|
189
245
|
},
|
|
190
246
|
t
|
|
191
247
|
),
|
|
@@ -194,37 +250,37 @@ const q = o.forwardRef(
|
|
|
194
250
|
);
|
|
195
251
|
}
|
|
196
252
|
);
|
|
197
|
-
|
|
198
|
-
const
|
|
253
|
+
ue.displayName = "CarouselPrevious";
|
|
254
|
+
const ie = r.forwardRef(
|
|
199
255
|
({
|
|
200
256
|
className: t,
|
|
201
|
-
size:
|
|
202
|
-
ariaLabel:
|
|
203
|
-
hideWhenDisabled:
|
|
204
|
-
onClick:
|
|
257
|
+
size: l = "default",
|
|
258
|
+
ariaLabel: u,
|
|
259
|
+
hideWhenDisabled: n = !1,
|
|
260
|
+
onClick: s,
|
|
205
261
|
...f
|
|
206
|
-
},
|
|
207
|
-
const { orientation:
|
|
208
|
-
return
|
|
209
|
-
|
|
262
|
+
}, c) => {
|
|
263
|
+
const { orientation: w, scrollNext: b, canScrollNext: m } = v(), d = U(), x = u ?? d.carousel.nextAriaLabel, a = w === "horizontal", i = l === "sm";
|
|
264
|
+
return n && !m ? null : /* @__PURE__ */ p(
|
|
265
|
+
K,
|
|
210
266
|
{
|
|
211
|
-
ref:
|
|
267
|
+
ref: c,
|
|
212
268
|
direction: "right",
|
|
213
|
-
size:
|
|
214
|
-
disabled: !
|
|
215
|
-
"aria-label":
|
|
216
|
-
onClick: (
|
|
217
|
-
|
|
269
|
+
size: l,
|
|
270
|
+
disabled: !m,
|
|
271
|
+
"aria-label": x,
|
|
272
|
+
onClick: (y) => {
|
|
273
|
+
b(), s == null || s(y);
|
|
218
274
|
},
|
|
219
|
-
className:
|
|
275
|
+
className: C(
|
|
220
276
|
"absolute",
|
|
221
277
|
{
|
|
222
278
|
"top-1/2 -translate-y-1/2": a,
|
|
223
279
|
"left-1/2 -translate-x-1/2 rotate-90": !a,
|
|
224
|
-
"-right-comp-carousel-arrow-offset-sm": a &&
|
|
225
|
-
"-right-comp-carousel-arrow-offset": a && !
|
|
226
|
-
"-bottom-comp-carousel-arrow-offset-v-sm": !a &&
|
|
227
|
-
"-bottom-comp-carousel-arrow-offset-v": !a && !
|
|
280
|
+
"-right-comp-carousel-arrow-offset-sm": a && i,
|
|
281
|
+
"-right-comp-carousel-arrow-offset": a && !i,
|
|
282
|
+
"-bottom-comp-carousel-arrow-offset-v-sm": !a && i,
|
|
283
|
+
"-bottom-comp-carousel-arrow-offset-v": !a && !i
|
|
228
284
|
},
|
|
229
285
|
t
|
|
230
286
|
),
|
|
@@ -233,31 +289,32 @@ const G = o.forwardRef(
|
|
|
233
289
|
);
|
|
234
290
|
}
|
|
235
291
|
);
|
|
236
|
-
|
|
237
|
-
const
|
|
292
|
+
ie.displayName = "CarouselNext";
|
|
293
|
+
const fe = ({
|
|
238
294
|
className: t,
|
|
239
|
-
ariaLabel:
|
|
240
|
-
buttonAriaLabel:
|
|
295
|
+
ariaLabel: l,
|
|
296
|
+
buttonAriaLabel: u
|
|
241
297
|
}) => {
|
|
242
|
-
const { selectedIndex:
|
|
243
|
-
return f <= 1 ? null : /* @__PURE__ */
|
|
244
|
-
|
|
298
|
+
const { selectedIndex: n, scrollTo: s, slidesCount: f } = v(), c = U();
|
|
299
|
+
return f <= 1 ? null : /* @__PURE__ */ p(
|
|
300
|
+
re,
|
|
245
301
|
{
|
|
246
302
|
count: f,
|
|
247
|
-
activeIndex:
|
|
248
|
-
onDotClick:
|
|
303
|
+
activeIndex: n,
|
|
304
|
+
onDotClick: s,
|
|
249
305
|
interactive: !0,
|
|
250
|
-
className:
|
|
251
|
-
ariaLabel:
|
|
252
|
-
buttonAriaLabel:
|
|
306
|
+
className: C("mt-comp-carousel-dots-gap", t),
|
|
307
|
+
ariaLabel: l ?? c.carousel.dotsAriaLabel,
|
|
308
|
+
buttonAriaLabel: u ?? c.carousel.dotAriaLabel
|
|
253
309
|
}
|
|
254
310
|
);
|
|
255
311
|
};
|
|
256
312
|
export {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
313
|
+
le as Carousel,
|
|
314
|
+
ne as CarouselContent,
|
|
315
|
+
fe as CarouselDots,
|
|
316
|
+
ce as CarouselItem,
|
|
317
|
+
ie as CarouselNext,
|
|
318
|
+
ue as CarouselPrevious,
|
|
319
|
+
v as useCarousel
|
|
263
320
|
};
|
|
@@ -8,6 +8,8 @@ export declare const Vertical: Story;
|
|
|
8
8
|
export declare const MultipleVisible: Story;
|
|
9
9
|
export declare const WithLinks: Story;
|
|
10
10
|
export declare const Looping: Story;
|
|
11
|
+
export declare const Autoplay: Story;
|
|
12
|
+
export declare const CustomControls: Story;
|
|
11
13
|
export declare const SmallArrows: Story;
|
|
12
14
|
export declare const NoDots: Story;
|
|
13
15
|
//# sourceMappingURL=Carousel.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Carousel/Carousel.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"Carousel.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Carousel/Carousel.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAI3D,OAAO,EACL,QAAQ,EAOT,MAAM,YAAY,CAAA;AAEnB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,QAAQ,CAgD/B,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,QAAQ,CAAC,CAAA;AAiCtC,eAAO,MAAM,OAAO,EAAE,KA4BrB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAiCtB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KA4B7B,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAyCvB,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,KA8BrB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAqCtB,CAAA;AA2BD,eAAO,MAAM,cAAc,EAAE,KAoD5B,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KA6BzB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KA2BpB,CAAA"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Carousel as r, CarouselContent as s, CarouselDots as u, CarouselItem as C, CarouselNext as a, CarouselPrevious as l } from "./Carousel.js";
|
|
1
|
+
import { Carousel as r, CarouselContent as s, CarouselDots as u, CarouselItem as C, CarouselNext as a, CarouselPrevious as l, useCarousel as t } from "./Carousel.js";
|
|
2
2
|
export {
|
|
3
3
|
r as Carousel,
|
|
4
4
|
s as CarouselContent,
|
|
5
5
|
u as CarouselDots,
|
|
6
6
|
C as CarouselItem,
|
|
7
7
|
a as CarouselNext,
|
|
8
|
-
l as CarouselPrevious
|
|
8
|
+
l as CarouselPrevious,
|
|
9
|
+
t as useCarousel
|
|
9
10
|
};
|
|
@@ -25,7 +25,7 @@ export interface CarouselSectionProps {
|
|
|
25
25
|
*/
|
|
26
26
|
export declare const CarouselSection: ({ title, items, ctaLabel, ctaHref, }: CarouselSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
27
|
/**
|
|
28
|
-
* Pre-rendered slides using the library `OfferCard` (compact
|
|
28
|
+
* Pre-rendered slides using the library `OfferCard` (tinted compact variant).
|
|
29
29
|
* Below desktop the fixed `w-[284px]` drives the peeking multi-card layout;
|
|
30
30
|
* `lg:w-full` lets the card fill its slide so the desktop fractional bases
|
|
31
31
|
* (3 → 4 → 5 per view) line up exactly. `h-full` matches the tallest card.
|
|
@@ -92,7 +92,26 @@ export interface IDropdownItem {
|
|
|
92
92
|
description?: React.ReactNode;
|
|
93
93
|
}
|
|
94
94
|
/** Props for DropdownMenuItem. Standard clickable item with optional icon. Extends Radix Item with IDropdownItem. */
|
|
95
|
-
export
|
|
95
|
+
export interface DropdownMenuItemProps extends React.ComponentProps<typeof DropdownMenuPrimitive.Item>, IDropdownItem {
|
|
96
|
+
/**
|
|
97
|
+
* Renders the single child as the menu item's root element, merging the item's
|
|
98
|
+
* props, styling, ref and event handlers onto it. Use it for navigation
|
|
99
|
+
* entries so they become real links — preserving middle-click, Ctrl+click,
|
|
100
|
+
* "open in new tab", "copy link address", link semantics for screen readers
|
|
101
|
+
* and framework prefetching, none of which an `onSelect` handler can offer.
|
|
102
|
+
*
|
|
103
|
+
* `icon` and `description` still render: the icon is injected as a sibling
|
|
104
|
+
* inside the child, and the child's own content is wrapped in the standard
|
|
105
|
+
* label. Keyboard navigation, typeahead and `onSelect` are unchanged.
|
|
106
|
+
*
|
|
107
|
+
* @default false
|
|
108
|
+
* @example
|
|
109
|
+
* <DropdownMenuItem asChild icon={<HeartBold />}>
|
|
110
|
+
* <Link href="/profile/favorite">Favorites</Link>
|
|
111
|
+
* </DropdownMenuItem>
|
|
112
|
+
*/
|
|
113
|
+
asChild?: boolean;
|
|
114
|
+
}
|
|
96
115
|
/**
|
|
97
116
|
* Props for DropdownMenuButtonItem. Menu item rendered as a Button for more prominent actions
|
|
98
117
|
* such as upgrade or sign-up calls-to-action inside the menu. Pass `buttonProps` to configure the inner Button.
|
|
@@ -110,9 +129,9 @@ export type DropdownMenuButtonItemProps = React.ComponentProps<typeof DropdownMe
|
|
|
110
129
|
buttonProps: ButtonProps;
|
|
111
130
|
};
|
|
112
131
|
/** Standard clickable menu item with optional icon and variant styling. */
|
|
113
|
-
declare const DropdownMenuItem: ({ className, variant, children, icon, disabled, isActive, description, ...props }: DropdownMenuItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
132
|
+
declare const DropdownMenuItem: ({ className, variant, children, icon, disabled, isActive, description, asChild, ...props }: DropdownMenuItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
114
133
|
declare const DropdownMenuButtonItem: ({ children, buttonProps, className, ...props }: DropdownMenuButtonItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
115
|
-
declare const DropdownMenuCheckboxItem: ({ className, children, checked, variant, icon, description, ...props }: DropdownMenuCheckboxItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
134
|
+
declare const DropdownMenuCheckboxItem: ({ className, children, checked, variant, icon, description, asChild, ...props }: DropdownMenuCheckboxItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
116
135
|
declare const DropdownMenuRadioGroup: ({ value, onValueChange, ...props }: DropdownMenuRadioGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
117
136
|
declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuRadioItemProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
118
137
|
declare const DropdownMenuSeparator: ({ className, ...props }: DropdownMenuSeparatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../../src/components/DropdownMenu/DropdownMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAA;
|
|
1
|
+
{"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../../src/components/DropdownMenu/DropdownMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAA;AAItE,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,WAAW,CAAA;AAKpD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,iBACf,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,IAAI,CAAC;IAC/D,kDAAkD;IAClD,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,gEAAgE;IAChE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,0EAA0E;IAC1E,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,yCAAyC;IACzC,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAA;CACpB;AAED,oFAAoF;AACpF,MAAM,MAAM,uBAAuB,GAAG,KAAK,CAAC,cAAc,CACxD,OAAO,qBAAqB,CAAC,MAAM,CACpC,CAAA;AAED,4FAA4F;AAC5F,MAAM,MAAM,wBAAwB,GAAG,KAAK,CAAC,cAAc,CACzD,OAAO,qBAAqB,CAAC,OAAO,CACrC,CAAA;AAED;;GAEG;AACH,MAAM,WAAW,wBACf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