@vkzstudio/muza-ui 1.5.1 → 1.6.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/Accordion/Accordion.js +1 -1
- package/dist/components/Accordion/index.js +16 -0
- package/dist/components/Alert/Alert.js +6 -6
- package/dist/components/Alert/index.js +4 -0
- package/dist/components/ArticleCard/ArticleCard.js +11 -11
- package/dist/components/ArticleCard/index.js +7 -0
- package/dist/components/Avatar/index.js +6 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +4 -4
- package/dist/components/Breadcrumb/index.js +10 -0
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +44 -42
- package/dist/components/Button/Button.stories.d.ts.map +1 -1
- package/dist/components/Button/index.js +6 -0
- package/dist/components/ButtonArrow/index.js +5 -0
- package/dist/components/Calendar/Calendar.js +6 -6
- package/dist/components/Calendar/index.js +10 -0
- package/dist/components/Card/Card.js +7 -7
- package/dist/components/Card/index.js +5 -0
- package/dist/components/CardCheckboxAmount/CardCheckboxAmount.js +8 -8
- package/dist/components/CardCheckboxAmount/index.js +4 -0
- 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 +10 -0
- package/dist/components/CategoryCard/CategoryCard.js +2 -2
- package/dist/components/CategoryCard/index.js +6 -0
- package/dist/components/CategoryIcon/index.js +5 -0
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Checkbox/index.js +4 -0
- package/dist/components/Chip/Chip.js +5 -5
- package/dist/components/Chip/index.js +5 -0
- package/dist/components/DataTable/index.js +5 -0
- package/dist/components/DatePicker/DatePicker.js +18 -18
- package/dist/components/DatePicker/index.js +7 -0
- package/dist/components/DatePickerButton/DatePickerButton.js +5 -5
- package/dist/components/DatePickerButton/index.js +5 -0
- package/dist/components/Dialog/Dialog.js +21 -20
- package/dist/components/Dialog/index.js +13 -0
- package/dist/components/DotDivider/index.js +5 -0
- 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/DropdownMenu/index.js +14 -0
- package/dist/components/DropdownSearchMenu/DropdownSearchMenu.js +7 -6
- package/dist/components/DropdownSearchMenu/index.js +7 -0
- package/dist/components/EdgeButton/EdgeButton.js +1 -1
- package/dist/components/EdgeButton/index.js +5 -0
- package/dist/components/EmptyState/index.js +4 -0
- package/dist/components/ExpandableTable/ExpandableTable.js +13 -13
- package/dist/components/ExpandableTable/index.js +4 -0
- package/dist/components/FileUpload/FileItem.js +1 -1
- package/dist/components/FileUpload/FileUpload.js +7 -7
- package/dist/components/FileUpload/index.js +4 -0
- package/dist/components/Flex/Flex.js +5 -5
- package/dist/components/Flex/index.js +7 -0
- package/dist/components/FormField/FormField.js +9 -9
- package/dist/components/FormField/InputHint.js +4 -4
- package/dist/components/FormField/index.js +8 -0
- package/dist/components/HeartButton/index.js +5 -0
- package/dist/components/Icons/index.js +65 -0
- package/dist/components/InfoCard/InfoCard.js +45 -0
- package/dist/components/InfoCard/index.js +5 -0
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/index.js +4 -0
- package/dist/components/InputOTP/InputOTP.js +7 -7
- package/dist/components/InputOTP/index.js +7 -0
- package/dist/components/LanguageSwitcher/LanguageSwitcher.js +9 -9
- package/dist/components/LanguageSwitcher/index.js +6 -0
- package/dist/components/Lightbox/Lightbox.js +1 -1
- package/dist/components/Lightbox/index.js +8 -0
- package/dist/components/Loader/index.js +4 -0
- package/dist/components/LoginScreen/LoginScreen.js +4 -4
- package/dist/components/LoginScreen/index.js +8 -0
- 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 +40 -41
- package/dist/components/MultiSelect/index.js +4 -0
- package/dist/components/MuzaUIProvider/MuzaUIProvider.js +5 -5
- package/dist/components/MuzaUIProvider/index.js +13 -0
- package/dist/components/MuzaUIProvider/theme/ThemeSetterModal.js +17 -17
- package/dist/components/OfferCard/OfferCard.js +11 -11
- package/dist/components/OfferCard/index.js +7 -0
- package/dist/components/PageContainer/index.js +5 -0
- package/dist/components/Pagination/Pagination.js +5 -5
- package/dist/components/Pagination/index.js +4 -0
- package/dist/components/PartnerCard/PartnerCard.js +10 -10
- package/dist/components/PartnerCard/index.js +6 -0
- package/dist/components/PasswordInput/PasswordInput.js +7 -7
- package/dist/components/PasswordInput/index.js +4 -0
- package/dist/components/PhoneInput/CountrySelector.js +5 -5
- package/dist/components/PhoneInput/PhoneInput.js +8 -8
- package/dist/components/PhoneInput/index.js +4 -0
- package/dist/components/PinIndicator/index.js +4 -0
- package/dist/components/Popover/index.js +7 -0
- package/dist/components/Progress/index.js +5 -0
- package/dist/components/Radio/index.js +5 -0
- package/dist/components/Rating/Rating.js +5 -5
- package/dist/components/Rating/index.js +4 -0
- package/dist/components/RatingBlock/RatingBlock.js +2 -2
- package/dist/components/RatingBlock/index.js +4 -0
- package/dist/components/Reorderable/index.js +9 -0
- package/dist/components/ReorderableTable/ReorderableTable.js +7 -6
- package/dist/components/ReorderableTable/index.js +4 -0
- package/dist/components/ResponsiveLayoutTable/ResponsiveLayoutTable.js +5 -5
- package/dist/components/ResponsiveLayoutTable/index.js +4 -0
- package/dist/components/SearchFilters/SearchFilters.js +11 -11
- package/dist/components/SearchFilters/index.js +5 -0
- package/dist/components/Searchbar/index.js +4 -0
- package/dist/components/SegmentedControl/index.js +5 -0
- package/dist/components/SegmentedIconControl/index.js +5 -0
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +77 -103
- 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 +8 -0
- 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/Sheet/Sheet.js +13 -12
- package/dist/components/Sheet/index.js +15 -0
- package/dist/components/Skeleton/index.js +4 -0
- package/dist/components/Slider/index.js +7 -0
- package/dist/components/SliderIndicators/index.js +4 -0
- package/dist/components/Stepper/Stepper.js +6 -6
- package/dist/components/Stepper/index.js +4 -0
- package/dist/components/SwipeButton/SwipeButton.js +14 -14
- package/dist/components/SwipeButton/index.js +4 -0
- package/dist/components/Switch/index.js +4 -0
- package/dist/components/Tag/index.js +5 -0
- package/dist/components/TextEditor/EditorToolbar.js +15 -15
- package/dist/components/TextEditor/LinkBubbleMenu.js +9 -9
- package/dist/components/TextEditor/TextEditor.js +12 -12
- package/dist/components/TextEditor/index.js +9 -0
- package/dist/components/Textarea/Textarea.js +1 -1
- package/dist/components/Textarea/index.js +4 -0
- package/dist/components/TimePicker/TimePicker.js +4 -4
- package/dist/components/TimePicker/index.js +4 -0
- package/dist/components/Toast/Toast.js +7 -7
- package/dist/components/Toast/index.js +7 -0
- package/dist/components/Toggle/index.js +5 -0
- package/dist/components/ToggleCheckButton/index.js +5 -0
- package/dist/components/ToggleGroup/ToggleGroup.js +4 -4
- package/dist/components/ToggleGroup/index.js +5 -0
- package/dist/components/Tooltip/Tooltip.js +6 -6
- package/dist/components/Tooltip/index.js +7 -0
- package/dist/components/TransactionsListView/TransactionsListView.js +2 -2
- package/dist/components/TransactionsListView/index.js +5 -0
- package/dist/components/Typography/index.js +5 -0
- package/dist/components/TypographyLink/index.js +5 -0
- package/dist/components/UniversalFooter/UniversalFooter.js +3 -3
- package/dist/components/UniversalFooter/index.js +18 -0
- package/dist/components/VoucherCard/VoucherCard.js +2 -2
- package/dist/components/VoucherCard/index.js +7 -0
- package/dist/components/WebCheckoutNav/WebCheckoutNav.examples.d.ts.map +1 -1
- package/dist/index.js +434 -429
- package/dist/muza-ui.css +1 -1
- package/dist/utils/index.js +13 -0
- package/llms-full.md +133 -2
- package/llms.txt +2 -0
- package/package.json +23 -5
|
@@ -1,28 +1,55 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { Flex as
|
|
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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
export {
|
|
3
|
+
r as Carousel,
|
|
4
|
+
s as CarouselContent,
|
|
5
|
+
u as CarouselDots,
|
|
6
|
+
C as CarouselItem,
|
|
7
|
+
a as CarouselNext,
|
|
8
|
+
l as CarouselPrevious,
|
|
9
|
+
t as useCarousel
|
|
10
|
+
};
|
|
@@ -2,10 +2,10 @@ import { jsxs as l, Fragment as N, jsx as e } from "react/jsx-runtime";
|
|
|
2
2
|
import * as i from "react";
|
|
3
3
|
import { Slot as C } from "@radix-ui/react-slot";
|
|
4
4
|
import { cva as w } from "class-variance-authority";
|
|
5
|
-
import { Flex as x } from "../Flex/Flex.js";
|
|
6
5
|
import { cn as t } from "../../utils/cn.js";
|
|
7
|
-
import {
|
|
6
|
+
import { Flex as x } from "../Flex/Flex.js";
|
|
8
7
|
import { Skeleton as n } from "../Skeleton/Skeleton.js";
|
|
8
|
+
import { Typography as f } from "../Typography/Typography.js";
|
|
9
9
|
const S = w([
|
|
10
10
|
"group inline-flex w-full items-center gap-md no-underline",
|
|
11
11
|
"py-sm pr-2xl pl-sm",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as s, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as v, useId as N } from "react";
|
|
3
3
|
import * as c from "@radix-ui/react-checkbox";
|
|
4
|
-
import { CheckMinus as z, Checked as w } from "../Icons/CustomIcons.js";
|
|
5
4
|
import { cn as a } from "../../utils/cn.js";
|
|
5
|
+
import { CheckMinus as z, Checked as w } from "../Icons/CustomIcons.js";
|
|
6
6
|
import { Typography as n } from "../Typography/Typography.js";
|
|
7
7
|
const C = v(
|
|
8
8
|
({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import * as l from "react";
|
|
3
3
|
import { cva as m } from "class-variance-authority";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { cn as f } from "../../utils/cn.js";
|
|
5
|
+
import { CheckCircleBold as p } from "@solar-icons/react-perf";
|
|
6
|
+
import { EmptyCircle as x } from "../Icons/CustomIcons.js";
|
|
7
7
|
import { Typography as b } from "../Typography/Typography.js";
|
|
8
8
|
const v = m(
|
|
9
9
|
[
|
|
@@ -73,11 +73,11 @@ const v = m(
|
|
|
73
73
|
"aria-disabled": e,
|
|
74
74
|
disabled: e,
|
|
75
75
|
"data-state": r ? "checked" : "unchecked",
|
|
76
|
-
className:
|
|
76
|
+
className: f(v({ checked: r, disabled: e, className: a })),
|
|
77
77
|
onClick: d,
|
|
78
78
|
...s,
|
|
79
79
|
children: [
|
|
80
|
-
r ? /* @__PURE__ */ t(
|
|
80
|
+
r ? /* @__PURE__ */ t(p, {}) : /* @__PURE__ */ t(x, {}),
|
|
81
81
|
/* @__PURE__ */ t(
|
|
82
82
|
b,
|
|
83
83
|
{
|