@szum-tech/design-system 3.11.1 → 3.12.1
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/alert/index.d.cts +3 -3
- package/dist/components/alert/index.d.ts +3 -3
- package/dist/components/badge/index.d.cts +3 -3
- package/dist/components/badge/index.d.ts +3 -3
- package/dist/components/badge-overflow/index.cjs +182 -0
- package/dist/components/badge-overflow/index.d.cts +21 -0
- package/dist/components/badge-overflow/index.d.ts +21 -0
- package/dist/components/badge-overflow/index.js +160 -0
- package/dist/components/button/index.cjs +10 -10
- package/dist/components/button/index.d.cts +5 -5
- package/dist/components/button/index.d.ts +5 -5
- package/dist/components/button/index.js +10 -10
- package/dist/components/carousel/index.cjs +261 -0
- package/dist/components/carousel/index.d.cts +47 -0
- package/dist/components/carousel/index.d.ts +47 -0
- package/dist/components/carousel/index.js +230 -0
- package/dist/components/color-swatch/index.d.cts +3 -3
- package/dist/components/color-swatch/index.d.ts +3 -3
- package/dist/components/dialog/index.d.cts +3 -3
- package/dist/components/dialog/index.d.ts +3 -3
- package/dist/components/empty/index.d.cts +3 -3
- package/dist/components/empty/index.d.ts +3 -3
- package/dist/components/field/index.d.cts +4 -4
- package/dist/components/field/index.d.ts +4 -4
- package/dist/components/index.cjs +104 -104
- package/dist/components/index.js +10 -10
- package/dist/components/item/index.d.cts +7 -7
- package/dist/components/item/index.d.ts +7 -7
- package/dist/components/radio-group/index.d.cts +12 -1
- package/dist/components/radio-group/index.d.ts +12 -1
- package/dist/components/sheet/index.d.cts +3 -3
- package/dist/components/sheet/index.d.ts +3 -3
- package/dist/components/status/index.d.cts +3 -3
- package/dist/components/status/index.d.ts +3 -3
- package/dist/components/stepper/index.cjs +10 -10
- package/dist/components/stepper/index.d.cts +1 -1
- package/dist/components/stepper/index.d.ts +1 -1
- package/dist/components/stepper/index.js +10 -10
- package/dist/components/timeline/index.d.cts +1 -1
- package/dist/components/timeline/index.d.ts +1 -1
- package/dist/components/toaster/index.cjs +10 -10
- package/dist/components/toaster/index.js +10 -10
- package/package.json +19 -18
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkCP43WJCN_cjs = require('../../chunk-CP43WJCN.cjs');
|
|
4
|
+
require('../../chunk-DGWBE2Y3.cjs');
|
|
5
|
+
require('../../chunk-GYXQUTWZ.cjs');
|
|
6
|
+
require('../../chunk-YEFLGE3L.cjs');
|
|
7
|
+
require('../../chunk-NU5UQPBX.cjs');
|
|
8
|
+
require('../../chunk-KQ6QE7BT.cjs');
|
|
9
|
+
require('../../chunk-EUH466AL.cjs');
|
|
10
|
+
require('../../chunk-A7SBXO2Y.cjs');
|
|
11
|
+
require('../../chunk-S2BCU6WG.cjs');
|
|
12
|
+
require('../../chunk-TH44JYXB.cjs');
|
|
13
|
+
require('../../chunk-XENOUBSI.cjs');
|
|
14
|
+
require('../../chunk-UJX74PFK.cjs');
|
|
15
|
+
require('../../chunk-XJZOANXX.cjs');
|
|
16
|
+
require('../../chunk-3WSQRFUY.cjs');
|
|
17
|
+
require('../../chunk-GHV2TURY.cjs');
|
|
18
|
+
require('../../chunk-VK5EX3OG.cjs');
|
|
19
|
+
require('../../chunk-CXHDWIGF.cjs');
|
|
20
|
+
require('../../chunk-DTYX7CYN.cjs');
|
|
21
|
+
require('../../chunk-6X26XC6P.cjs');
|
|
22
|
+
require('../../chunk-5AA4IE2T.cjs');
|
|
23
|
+
require('../../chunk-CFJ44JVK.cjs');
|
|
24
|
+
require('../../chunk-UIOBJSKZ.cjs');
|
|
25
|
+
require('../../chunk-S3ANEJJ7.cjs');
|
|
26
|
+
require('../../chunk-2WQJ36RD.cjs');
|
|
27
|
+
require('../../chunk-ZVF7J4EI.cjs');
|
|
28
|
+
require('../../chunk-2Y2ZCPNV.cjs');
|
|
29
|
+
require('../../chunk-HCHVDUI6.cjs');
|
|
30
|
+
require('../../chunk-ULEEQ723.cjs');
|
|
31
|
+
require('../../chunk-USIW3VT5.cjs');
|
|
32
|
+
require('../../chunk-XIQUR62A.cjs');
|
|
33
|
+
require('../../chunk-X3ZT3KGX.cjs');
|
|
34
|
+
require('../../chunk-3GNVQFCK.cjs');
|
|
35
|
+
require('../../chunk-TMXVL5CV.cjs');
|
|
36
|
+
require('../../chunk-I7AV5IQO.cjs');
|
|
37
|
+
var chunkH2BWO3SI_cjs = require('../../chunk-H2BWO3SI.cjs');
|
|
38
|
+
var React2 = require('react');
|
|
39
|
+
var useEmblaCarousel = require('embla-carousel-react');
|
|
40
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
41
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
42
|
+
var lucideReact = require('lucide-react');
|
|
43
|
+
|
|
44
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
45
|
+
|
|
46
|
+
function _interopNamespace(e) {
|
|
47
|
+
if (e && e.__esModule) return e;
|
|
48
|
+
var n = Object.create(null);
|
|
49
|
+
if (e) {
|
|
50
|
+
Object.keys(e).forEach(function (k) {
|
|
51
|
+
if (k !== 'default') {
|
|
52
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
53
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
get: function () { return e[k]; }
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
n.default = e;
|
|
61
|
+
return Object.freeze(n);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
|
|
65
|
+
var useEmblaCarousel__default = /*#__PURE__*/_interopDefault(useEmblaCarousel);
|
|
66
|
+
|
|
67
|
+
var CarouselContext = React2__namespace.createContext(null);
|
|
68
|
+
function useCarousel() {
|
|
69
|
+
const context = React2__namespace.useContext(CarouselContext);
|
|
70
|
+
if (!context) {
|
|
71
|
+
throw new Error("useCarousel must be used within a <Carousel />");
|
|
72
|
+
}
|
|
73
|
+
return context;
|
|
74
|
+
}
|
|
75
|
+
var carouselVariants = classVarianceAuthority.cva("relative", {
|
|
76
|
+
variants: {
|
|
77
|
+
orientation: {
|
|
78
|
+
horizontal: "",
|
|
79
|
+
vertical: ""
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
defaultVariants: {
|
|
83
|
+
orientation: "horizontal"
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
var carouselContentVariants = classVarianceAuthority.cva("flex", {
|
|
87
|
+
variants: {
|
|
88
|
+
orientation: {
|
|
89
|
+
horizontal: "-ml-4",
|
|
90
|
+
vertical: "-mt-4 flex-col"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
defaultVariants: {
|
|
94
|
+
orientation: "horizontal"
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
var carouselItemVariants = classVarianceAuthority.cva("min-w-0 shrink-0 grow-0 basis-full", {
|
|
98
|
+
variants: {
|
|
99
|
+
orientation: {
|
|
100
|
+
horizontal: "pl-4",
|
|
101
|
+
vertical: "pt-4"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
defaultVariants: {
|
|
105
|
+
orientation: "horizontal"
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
function Carousel({
|
|
109
|
+
orientation = "horizontal",
|
|
110
|
+
opts,
|
|
111
|
+
setApi,
|
|
112
|
+
plugins,
|
|
113
|
+
className,
|
|
114
|
+
children,
|
|
115
|
+
...props
|
|
116
|
+
}) {
|
|
117
|
+
const [carouselRef, api] = useEmblaCarousel__default.default(
|
|
118
|
+
{
|
|
119
|
+
...opts,
|
|
120
|
+
axis: orientation === "horizontal" ? "x" : "y"
|
|
121
|
+
},
|
|
122
|
+
plugins
|
|
123
|
+
);
|
|
124
|
+
const [canScrollPrev, setCanScrollPrev] = React2__namespace.useState(false);
|
|
125
|
+
const [canScrollNext, setCanScrollNext] = React2__namespace.useState(false);
|
|
126
|
+
const onSelect = React2__namespace.useCallback((api2) => {
|
|
127
|
+
if (!api2) return;
|
|
128
|
+
setCanScrollPrev(api2.canScrollPrev());
|
|
129
|
+
setCanScrollNext(api2.canScrollNext());
|
|
130
|
+
}, []);
|
|
131
|
+
const scrollPrev = React2__namespace.useCallback(() => {
|
|
132
|
+
api?.scrollPrev();
|
|
133
|
+
}, [api]);
|
|
134
|
+
const scrollNext = React2__namespace.useCallback(() => {
|
|
135
|
+
api?.scrollNext();
|
|
136
|
+
}, [api]);
|
|
137
|
+
const handleKeyDown = React2__namespace.useCallback(
|
|
138
|
+
(event) => {
|
|
139
|
+
if (event.key === "ArrowLeft") {
|
|
140
|
+
event.preventDefault();
|
|
141
|
+
scrollPrev();
|
|
142
|
+
} else if (event.key === "ArrowRight") {
|
|
143
|
+
event.preventDefault();
|
|
144
|
+
scrollNext();
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
[scrollPrev, scrollNext]
|
|
148
|
+
);
|
|
149
|
+
React2__namespace.useEffect(() => {
|
|
150
|
+
if (!api || !setApi) return;
|
|
151
|
+
setApi(api);
|
|
152
|
+
}, [api, setApi]);
|
|
153
|
+
React2__namespace.useEffect(() => {
|
|
154
|
+
if (!api) return;
|
|
155
|
+
onSelect(api);
|
|
156
|
+
api.on("reInit", onSelect);
|
|
157
|
+
api.on("select", onSelect);
|
|
158
|
+
return () => {
|
|
159
|
+
api?.off("reInit", onSelect);
|
|
160
|
+
api?.off("select", onSelect);
|
|
161
|
+
};
|
|
162
|
+
}, [api, onSelect]);
|
|
163
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
164
|
+
CarouselContext.Provider,
|
|
165
|
+
{
|
|
166
|
+
value: {
|
|
167
|
+
carouselRef,
|
|
168
|
+
api,
|
|
169
|
+
opts,
|
|
170
|
+
orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
|
|
171
|
+
scrollPrev,
|
|
172
|
+
scrollNext,
|
|
173
|
+
canScrollPrev,
|
|
174
|
+
canScrollNext
|
|
175
|
+
},
|
|
176
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
177
|
+
"div",
|
|
178
|
+
{
|
|
179
|
+
onKeyDownCapture: handleKeyDown,
|
|
180
|
+
className: carouselVariants({ orientation, className }),
|
|
181
|
+
role: "region",
|
|
182
|
+
"aria-roledescription": "carousel",
|
|
183
|
+
"data-slot": "carousel",
|
|
184
|
+
...props,
|
|
185
|
+
children
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
}
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
function CarouselContent({ className, ...props }) {
|
|
192
|
+
const { carouselRef, orientation } = useCarousel();
|
|
193
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: carouselRef, className: "overflow-hidden", "data-slot": "carousel-content", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: carouselContentVariants({ orientation, className }), ...props }) });
|
|
194
|
+
}
|
|
195
|
+
function CarouselItem({ className, ...props }) {
|
|
196
|
+
const { orientation } = useCarousel();
|
|
197
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
198
|
+
"div",
|
|
199
|
+
{
|
|
200
|
+
role: "group",
|
|
201
|
+
"aria-roledescription": "slide",
|
|
202
|
+
"data-slot": "carousel-item",
|
|
203
|
+
className: carouselItemVariants({ orientation, className }),
|
|
204
|
+
...props
|
|
205
|
+
}
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
function CarouselPrevious({ className, variant = "outline", size = "icon", ...props }) {
|
|
209
|
+
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
210
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
211
|
+
chunkCP43WJCN_cjs.Button,
|
|
212
|
+
{
|
|
213
|
+
"data-slot": "carousel-previous",
|
|
214
|
+
variant,
|
|
215
|
+
size,
|
|
216
|
+
className: chunkH2BWO3SI_cjs.cn(
|
|
217
|
+
"absolute size-8 rounded-full",
|
|
218
|
+
orientation === "horizontal" ? "top-1/2 -left-12 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
219
|
+
className
|
|
220
|
+
),
|
|
221
|
+
disabled: !canScrollPrev,
|
|
222
|
+
onClick: scrollPrev,
|
|
223
|
+
...props,
|
|
224
|
+
children: [
|
|
225
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowLeft, {}),
|
|
226
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Previous slide" })
|
|
227
|
+
]
|
|
228
|
+
}
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
function CarouselNext({ className, variant = "outline", size = "icon", ...props }) {
|
|
232
|
+
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
233
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
234
|
+
chunkCP43WJCN_cjs.Button,
|
|
235
|
+
{
|
|
236
|
+
"data-slot": "carousel-next",
|
|
237
|
+
variant,
|
|
238
|
+
size,
|
|
239
|
+
className: chunkH2BWO3SI_cjs.cn(
|
|
240
|
+
"absolute size-8 rounded-full",
|
|
241
|
+
orientation === "horizontal" ? "top-1/2 -right-12 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
242
|
+
className
|
|
243
|
+
),
|
|
244
|
+
disabled: !canScrollNext,
|
|
245
|
+
onClick: scrollNext,
|
|
246
|
+
...props,
|
|
247
|
+
children: [
|
|
248
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowRight, {}),
|
|
249
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Next slide" })
|
|
250
|
+
]
|
|
251
|
+
}
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
exports.Carousel = Carousel;
|
|
256
|
+
exports.CarouselContent = CarouselContent;
|
|
257
|
+
exports.CarouselContext = CarouselContext;
|
|
258
|
+
exports.CarouselItem = CarouselItem;
|
|
259
|
+
exports.CarouselNext = CarouselNext;
|
|
260
|
+
exports.CarouselPrevious = CarouselPrevious;
|
|
261
|
+
exports.useCarousel = useCarousel;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import useEmblaCarousel, { UseEmblaCarouselType } from 'embla-carousel-react';
|
|
4
|
+
import { Button } from '../button/index.cjs';
|
|
5
|
+
import 'class-variance-authority';
|
|
6
|
+
import 'class-variance-authority/types';
|
|
7
|
+
|
|
8
|
+
type CarouselApi = UseEmblaCarouselType[1];
|
|
9
|
+
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
10
|
+
type CarouselOptions = UseCarouselParameters[0];
|
|
11
|
+
type CarouselPlugin = UseCarouselParameters[1];
|
|
12
|
+
type CarouselContextProps = {
|
|
13
|
+
carouselRef: ReturnType<typeof useEmblaCarousel>[0];
|
|
14
|
+
api: ReturnType<typeof useEmblaCarousel>[1];
|
|
15
|
+
scrollPrev: () => void;
|
|
16
|
+
scrollNext: () => void;
|
|
17
|
+
canScrollPrev: boolean;
|
|
18
|
+
canScrollNext: boolean;
|
|
19
|
+
opts?: CarouselOptions;
|
|
20
|
+
plugins?: CarouselPlugin;
|
|
21
|
+
orientation?: "horizontal" | "vertical";
|
|
22
|
+
setApi?: (api: CarouselApi) => void;
|
|
23
|
+
};
|
|
24
|
+
declare const CarouselContext: React.Context<CarouselContextProps>;
|
|
25
|
+
declare function useCarousel(): CarouselContextProps;
|
|
26
|
+
|
|
27
|
+
type CarouselProps = React.ComponentProps<"div"> & {
|
|
28
|
+
opts?: CarouselOptions;
|
|
29
|
+
plugins?: CarouselPlugin;
|
|
30
|
+
orientation?: "horizontal" | "vertical";
|
|
31
|
+
setApi?: (api: CarouselApi) => void;
|
|
32
|
+
};
|
|
33
|
+
declare function Carousel({ orientation, opts, setApi, plugins, className, children, ...props }: CarouselProps): react_jsx_runtime.JSX.Element;
|
|
34
|
+
|
|
35
|
+
type CarouselContentProps = React.ComponentProps<"div">;
|
|
36
|
+
declare function CarouselContent({ className, ...props }: CarouselContentProps): react_jsx_runtime.JSX.Element;
|
|
37
|
+
|
|
38
|
+
type CarouselItemProps = React.ComponentProps<"div">;
|
|
39
|
+
declare function CarouselItem({ className, ...props }: CarouselItemProps): react_jsx_runtime.JSX.Element;
|
|
40
|
+
|
|
41
|
+
type CarouselPreviousProps = React.ComponentProps<typeof Button>;
|
|
42
|
+
declare function CarouselPrevious({ className, variant, size, ...props }: CarouselPreviousProps): react_jsx_runtime.JSX.Element;
|
|
43
|
+
|
|
44
|
+
type CarouselNextProps = React.ComponentProps<typeof Button>;
|
|
45
|
+
declare function CarouselNext({ className, variant, size, ...props }: CarouselNextProps): react_jsx_runtime.JSX.Element;
|
|
46
|
+
|
|
47
|
+
export { Carousel, type CarouselApi, CarouselContent, type CarouselContentProps, CarouselContext, type CarouselContextProps, CarouselItem, type CarouselItemProps, CarouselNext, type CarouselNextProps, type CarouselOptions, type CarouselPlugin, CarouselPrevious, type CarouselPreviousProps, type CarouselProps, type UseCarouselParameters, useCarousel };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import useEmblaCarousel, { UseEmblaCarouselType } from 'embla-carousel-react';
|
|
4
|
+
import { Button } from '../button/index.js';
|
|
5
|
+
import 'class-variance-authority';
|
|
6
|
+
import 'class-variance-authority/types';
|
|
7
|
+
|
|
8
|
+
type CarouselApi = UseEmblaCarouselType[1];
|
|
9
|
+
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
10
|
+
type CarouselOptions = UseCarouselParameters[0];
|
|
11
|
+
type CarouselPlugin = UseCarouselParameters[1];
|
|
12
|
+
type CarouselContextProps = {
|
|
13
|
+
carouselRef: ReturnType<typeof useEmblaCarousel>[0];
|
|
14
|
+
api: ReturnType<typeof useEmblaCarousel>[1];
|
|
15
|
+
scrollPrev: () => void;
|
|
16
|
+
scrollNext: () => void;
|
|
17
|
+
canScrollPrev: boolean;
|
|
18
|
+
canScrollNext: boolean;
|
|
19
|
+
opts?: CarouselOptions;
|
|
20
|
+
plugins?: CarouselPlugin;
|
|
21
|
+
orientation?: "horizontal" | "vertical";
|
|
22
|
+
setApi?: (api: CarouselApi) => void;
|
|
23
|
+
};
|
|
24
|
+
declare const CarouselContext: React.Context<CarouselContextProps>;
|
|
25
|
+
declare function useCarousel(): CarouselContextProps;
|
|
26
|
+
|
|
27
|
+
type CarouselProps = React.ComponentProps<"div"> & {
|
|
28
|
+
opts?: CarouselOptions;
|
|
29
|
+
plugins?: CarouselPlugin;
|
|
30
|
+
orientation?: "horizontal" | "vertical";
|
|
31
|
+
setApi?: (api: CarouselApi) => void;
|
|
32
|
+
};
|
|
33
|
+
declare function Carousel({ orientation, opts, setApi, plugins, className, children, ...props }: CarouselProps): react_jsx_runtime.JSX.Element;
|
|
34
|
+
|
|
35
|
+
type CarouselContentProps = React.ComponentProps<"div">;
|
|
36
|
+
declare function CarouselContent({ className, ...props }: CarouselContentProps): react_jsx_runtime.JSX.Element;
|
|
37
|
+
|
|
38
|
+
type CarouselItemProps = React.ComponentProps<"div">;
|
|
39
|
+
declare function CarouselItem({ className, ...props }: CarouselItemProps): react_jsx_runtime.JSX.Element;
|
|
40
|
+
|
|
41
|
+
type CarouselPreviousProps = React.ComponentProps<typeof Button>;
|
|
42
|
+
declare function CarouselPrevious({ className, variant, size, ...props }: CarouselPreviousProps): react_jsx_runtime.JSX.Element;
|
|
43
|
+
|
|
44
|
+
type CarouselNextProps = React.ComponentProps<typeof Button>;
|
|
45
|
+
declare function CarouselNext({ className, variant, size, ...props }: CarouselNextProps): react_jsx_runtime.JSX.Element;
|
|
46
|
+
|
|
47
|
+
export { Carousel, type CarouselApi, CarouselContent, type CarouselContentProps, CarouselContext, type CarouselContextProps, CarouselItem, type CarouselItemProps, CarouselNext, type CarouselNextProps, type CarouselOptions, type CarouselPlugin, CarouselPrevious, type CarouselPreviousProps, type CarouselProps, type UseCarouselParameters, useCarousel };
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { Button } from '../../chunk-QTYNFISP.js';
|
|
2
|
+
import '../../chunk-K5AURCK5.js';
|
|
3
|
+
import '../../chunk-IWF52DDE.js';
|
|
4
|
+
import '../../chunk-OCOCENE6.js';
|
|
5
|
+
import '../../chunk-OQCNPNPS.js';
|
|
6
|
+
import '../../chunk-WXZE35FK.js';
|
|
7
|
+
import '../../chunk-WMGJCB7O.js';
|
|
8
|
+
import '../../chunk-U7XZJQ4O.js';
|
|
9
|
+
import '../../chunk-DL54DIMD.js';
|
|
10
|
+
import '../../chunk-PBEZZMAB.js';
|
|
11
|
+
import '../../chunk-4TRADSTP.js';
|
|
12
|
+
import '../../chunk-M7NIRB3U.js';
|
|
13
|
+
import '../../chunk-E5TYGWGE.js';
|
|
14
|
+
import '../../chunk-P5IUC7HJ.js';
|
|
15
|
+
import '../../chunk-DTSFPOLX.js';
|
|
16
|
+
import '../../chunk-BTSHACKG.js';
|
|
17
|
+
import '../../chunk-HNRVLRMN.js';
|
|
18
|
+
import '../../chunk-3MH6P44N.js';
|
|
19
|
+
import '../../chunk-VT5GDGZJ.js';
|
|
20
|
+
import '../../chunk-UGSNASZM.js';
|
|
21
|
+
import '../../chunk-KGGCA634.js';
|
|
22
|
+
import '../../chunk-XJIUGEPN.js';
|
|
23
|
+
import '../../chunk-I3RSTJP6.js';
|
|
24
|
+
import '../../chunk-YUMKV5TH.js';
|
|
25
|
+
import '../../chunk-U3QKV7I4.js';
|
|
26
|
+
import '../../chunk-6BSR3O2J.js';
|
|
27
|
+
import '../../chunk-5F2Y65JH.js';
|
|
28
|
+
import '../../chunk-3RK5PCIC.js';
|
|
29
|
+
import '../../chunk-P4JIMFSL.js';
|
|
30
|
+
import '../../chunk-SB5UG7OC.js';
|
|
31
|
+
import '../../chunk-B7RHEMZH.js';
|
|
32
|
+
import '../../chunk-5MV54MWS.js';
|
|
33
|
+
import '../../chunk-5MJPZUTO.js';
|
|
34
|
+
import '../../chunk-NGVFYKAT.js';
|
|
35
|
+
import { cn } from '../../chunk-ZD2QRAOX.js';
|
|
36
|
+
import * as React2 from 'react';
|
|
37
|
+
import useEmblaCarousel from 'embla-carousel-react';
|
|
38
|
+
import { cva } from 'class-variance-authority';
|
|
39
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
40
|
+
import { ArrowLeft, ArrowRight } from 'lucide-react';
|
|
41
|
+
|
|
42
|
+
var CarouselContext = React2.createContext(null);
|
|
43
|
+
function useCarousel() {
|
|
44
|
+
const context = React2.useContext(CarouselContext);
|
|
45
|
+
if (!context) {
|
|
46
|
+
throw new Error("useCarousel must be used within a <Carousel />");
|
|
47
|
+
}
|
|
48
|
+
return context;
|
|
49
|
+
}
|
|
50
|
+
var carouselVariants = cva("relative", {
|
|
51
|
+
variants: {
|
|
52
|
+
orientation: {
|
|
53
|
+
horizontal: "",
|
|
54
|
+
vertical: ""
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
defaultVariants: {
|
|
58
|
+
orientation: "horizontal"
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
var carouselContentVariants = cva("flex", {
|
|
62
|
+
variants: {
|
|
63
|
+
orientation: {
|
|
64
|
+
horizontal: "-ml-4",
|
|
65
|
+
vertical: "-mt-4 flex-col"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
defaultVariants: {
|
|
69
|
+
orientation: "horizontal"
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
var carouselItemVariants = cva("min-w-0 shrink-0 grow-0 basis-full", {
|
|
73
|
+
variants: {
|
|
74
|
+
orientation: {
|
|
75
|
+
horizontal: "pl-4",
|
|
76
|
+
vertical: "pt-4"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
defaultVariants: {
|
|
80
|
+
orientation: "horizontal"
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
function Carousel({
|
|
84
|
+
orientation = "horizontal",
|
|
85
|
+
opts,
|
|
86
|
+
setApi,
|
|
87
|
+
plugins,
|
|
88
|
+
className,
|
|
89
|
+
children,
|
|
90
|
+
...props
|
|
91
|
+
}) {
|
|
92
|
+
const [carouselRef, api] = useEmblaCarousel(
|
|
93
|
+
{
|
|
94
|
+
...opts,
|
|
95
|
+
axis: orientation === "horizontal" ? "x" : "y"
|
|
96
|
+
},
|
|
97
|
+
plugins
|
|
98
|
+
);
|
|
99
|
+
const [canScrollPrev, setCanScrollPrev] = React2.useState(false);
|
|
100
|
+
const [canScrollNext, setCanScrollNext] = React2.useState(false);
|
|
101
|
+
const onSelect = React2.useCallback((api2) => {
|
|
102
|
+
if (!api2) return;
|
|
103
|
+
setCanScrollPrev(api2.canScrollPrev());
|
|
104
|
+
setCanScrollNext(api2.canScrollNext());
|
|
105
|
+
}, []);
|
|
106
|
+
const scrollPrev = React2.useCallback(() => {
|
|
107
|
+
api?.scrollPrev();
|
|
108
|
+
}, [api]);
|
|
109
|
+
const scrollNext = React2.useCallback(() => {
|
|
110
|
+
api?.scrollNext();
|
|
111
|
+
}, [api]);
|
|
112
|
+
const handleKeyDown = React2.useCallback(
|
|
113
|
+
(event) => {
|
|
114
|
+
if (event.key === "ArrowLeft") {
|
|
115
|
+
event.preventDefault();
|
|
116
|
+
scrollPrev();
|
|
117
|
+
} else if (event.key === "ArrowRight") {
|
|
118
|
+
event.preventDefault();
|
|
119
|
+
scrollNext();
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
[scrollPrev, scrollNext]
|
|
123
|
+
);
|
|
124
|
+
React2.useEffect(() => {
|
|
125
|
+
if (!api || !setApi) return;
|
|
126
|
+
setApi(api);
|
|
127
|
+
}, [api, setApi]);
|
|
128
|
+
React2.useEffect(() => {
|
|
129
|
+
if (!api) return;
|
|
130
|
+
onSelect(api);
|
|
131
|
+
api.on("reInit", onSelect);
|
|
132
|
+
api.on("select", onSelect);
|
|
133
|
+
return () => {
|
|
134
|
+
api?.off("reInit", onSelect);
|
|
135
|
+
api?.off("select", onSelect);
|
|
136
|
+
};
|
|
137
|
+
}, [api, onSelect]);
|
|
138
|
+
return /* @__PURE__ */ jsx(
|
|
139
|
+
CarouselContext.Provider,
|
|
140
|
+
{
|
|
141
|
+
value: {
|
|
142
|
+
carouselRef,
|
|
143
|
+
api,
|
|
144
|
+
opts,
|
|
145
|
+
orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
|
|
146
|
+
scrollPrev,
|
|
147
|
+
scrollNext,
|
|
148
|
+
canScrollPrev,
|
|
149
|
+
canScrollNext
|
|
150
|
+
},
|
|
151
|
+
children: /* @__PURE__ */ jsx(
|
|
152
|
+
"div",
|
|
153
|
+
{
|
|
154
|
+
onKeyDownCapture: handleKeyDown,
|
|
155
|
+
className: carouselVariants({ orientation, className }),
|
|
156
|
+
role: "region",
|
|
157
|
+
"aria-roledescription": "carousel",
|
|
158
|
+
"data-slot": "carousel",
|
|
159
|
+
...props,
|
|
160
|
+
children
|
|
161
|
+
}
|
|
162
|
+
)
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
function CarouselContent({ className, ...props }) {
|
|
167
|
+
const { carouselRef, orientation } = useCarousel();
|
|
168
|
+
return /* @__PURE__ */ jsx("div", { ref: carouselRef, className: "overflow-hidden", "data-slot": "carousel-content", children: /* @__PURE__ */ jsx("div", { className: carouselContentVariants({ orientation, className }), ...props }) });
|
|
169
|
+
}
|
|
170
|
+
function CarouselItem({ className, ...props }) {
|
|
171
|
+
const { orientation } = useCarousel();
|
|
172
|
+
return /* @__PURE__ */ jsx(
|
|
173
|
+
"div",
|
|
174
|
+
{
|
|
175
|
+
role: "group",
|
|
176
|
+
"aria-roledescription": "slide",
|
|
177
|
+
"data-slot": "carousel-item",
|
|
178
|
+
className: carouselItemVariants({ orientation, className }),
|
|
179
|
+
...props
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
function CarouselPrevious({ className, variant = "outline", size = "icon", ...props }) {
|
|
184
|
+
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
185
|
+
return /* @__PURE__ */ jsxs(
|
|
186
|
+
Button,
|
|
187
|
+
{
|
|
188
|
+
"data-slot": "carousel-previous",
|
|
189
|
+
variant,
|
|
190
|
+
size,
|
|
191
|
+
className: cn(
|
|
192
|
+
"absolute size-8 rounded-full",
|
|
193
|
+
orientation === "horizontal" ? "top-1/2 -left-12 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
194
|
+
className
|
|
195
|
+
),
|
|
196
|
+
disabled: !canScrollPrev,
|
|
197
|
+
onClick: scrollPrev,
|
|
198
|
+
...props,
|
|
199
|
+
children: [
|
|
200
|
+
/* @__PURE__ */ jsx(ArrowLeft, {}),
|
|
201
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Previous slide" })
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
function CarouselNext({ className, variant = "outline", size = "icon", ...props }) {
|
|
207
|
+
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
208
|
+
return /* @__PURE__ */ jsxs(
|
|
209
|
+
Button,
|
|
210
|
+
{
|
|
211
|
+
"data-slot": "carousel-next",
|
|
212
|
+
variant,
|
|
213
|
+
size,
|
|
214
|
+
className: cn(
|
|
215
|
+
"absolute size-8 rounded-full",
|
|
216
|
+
orientation === "horizontal" ? "top-1/2 -right-12 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
217
|
+
className
|
|
218
|
+
),
|
|
219
|
+
disabled: !canScrollNext,
|
|
220
|
+
onClick: scrollNext,
|
|
221
|
+
...props,
|
|
222
|
+
children: [
|
|
223
|
+
/* @__PURE__ */ jsx(ArrowRight, {}),
|
|
224
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Next slide" })
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export { Carousel, CarouselContent, CarouselContext, CarouselItem, CarouselNext, CarouselPrevious, useCarousel };
|
|
@@ -3,9 +3,9 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
5
5
|
|
|
6
|
-
declare const colorSwatchVariants: (props?:
|
|
7
|
-
size?: "default" | "sm" | "lg"
|
|
8
|
-
} & class_variance_authority_types.ClassProp)
|
|
6
|
+
declare const colorSwatchVariants: (props?: {
|
|
7
|
+
size?: "default" | "sm" | "lg";
|
|
8
|
+
} & class_variance_authority_types.ClassProp) => string;
|
|
9
9
|
|
|
10
10
|
type ColorSwatchVariantsProps = VariantProps<typeof colorSwatchVariants>;
|
|
11
11
|
type ColorSwatchSize = NonNullable<ColorSwatchVariantsProps["size"]>;
|
|
@@ -3,9 +3,9 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
5
5
|
|
|
6
|
-
declare const colorSwatchVariants: (props?:
|
|
7
|
-
size?: "default" | "sm" | "lg"
|
|
8
|
-
} & class_variance_authority_types.ClassProp)
|
|
6
|
+
declare const colorSwatchVariants: (props?: {
|
|
7
|
+
size?: "default" | "sm" | "lg";
|
|
8
|
+
} & class_variance_authority_types.ClassProp) => string;
|
|
9
9
|
|
|
10
10
|
type ColorSwatchVariantsProps = VariantProps<typeof colorSwatchVariants>;
|
|
11
11
|
type ColorSwatchSize = NonNullable<ColorSwatchVariantsProps["size"]>;
|
|
@@ -16,9 +16,9 @@ type DialogContentProps = React.ComponentProps<typeof Dialog$1.Content> & {
|
|
|
16
16
|
};
|
|
17
17
|
declare function DialogContent({ className, children, width, showCloseButton, ...props }: DialogContentProps): react_jsx_runtime.JSX.Element;
|
|
18
18
|
|
|
19
|
-
declare const dialogContentVariants: (props?:
|
|
20
|
-
width?: "sm" | "lg" | "xs" | "md" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "full"
|
|
21
|
-
} & class_variance_authority_types.ClassProp)
|
|
19
|
+
declare const dialogContentVariants: (props?: {
|
|
20
|
+
width?: "sm" | "lg" | "xs" | "md" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "full";
|
|
21
|
+
} & class_variance_authority_types.ClassProp) => string;
|
|
22
22
|
|
|
23
23
|
type DialogContentCvaProps = VariantProps<typeof dialogContentVariants>;
|
|
24
24
|
type DialogContentWidth = NonNullable<DialogContentCvaProps["width"]>;
|
|
@@ -16,9 +16,9 @@ type DialogContentProps = React.ComponentProps<typeof Dialog$1.Content> & {
|
|
|
16
16
|
};
|
|
17
17
|
declare function DialogContent({ className, children, width, showCloseButton, ...props }: DialogContentProps): react_jsx_runtime.JSX.Element;
|
|
18
18
|
|
|
19
|
-
declare const dialogContentVariants: (props?:
|
|
20
|
-
width?: "sm" | "lg" | "xs" | "md" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "full"
|
|
21
|
-
} & class_variance_authority_types.ClassProp)
|
|
19
|
+
declare const dialogContentVariants: (props?: {
|
|
20
|
+
width?: "sm" | "lg" | "xs" | "md" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "full";
|
|
21
|
+
} & class_variance_authority_types.ClassProp) => string;
|
|
22
22
|
|
|
23
23
|
type DialogContentCvaProps = VariantProps<typeof dialogContentVariants>;
|
|
24
24
|
type DialogContentWidth = NonNullable<DialogContentCvaProps["width"]>;
|
|
@@ -21,9 +21,9 @@ type EmptyContentProps = React.ComponentProps<"div">;
|
|
|
21
21
|
declare function EmptyContent({ className, ...props }: EmptyContentProps): react_jsx_runtime.JSX.Element;
|
|
22
22
|
|
|
23
23
|
type EmptyMediaProps = React.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>;
|
|
24
|
-
declare const emptyMediaVariants: (props?:
|
|
25
|
-
variant?: "default" | "icon"
|
|
26
|
-
} & class_variance_authority_types.ClassProp)
|
|
24
|
+
declare const emptyMediaVariants: (props?: {
|
|
25
|
+
variant?: "default" | "icon";
|
|
26
|
+
} & class_variance_authority_types.ClassProp) => string;
|
|
27
27
|
declare function EmptyMedia({ className, variant, ...props }: EmptyMediaProps): react_jsx_runtime.JSX.Element;
|
|
28
28
|
|
|
29
29
|
export { Empty, EmptyContent, type EmptyContentProps, EmptyDescription, type EmptyDescriptionProps, EmptyHeader, type EmptyHeaderProps, EmptyMedia, type EmptyMediaProps, type EmptyProps, EmptyTitle, type EmptyTitleProps };
|
|
@@ -21,9 +21,9 @@ type EmptyContentProps = React.ComponentProps<"div">;
|
|
|
21
21
|
declare function EmptyContent({ className, ...props }: EmptyContentProps): react_jsx_runtime.JSX.Element;
|
|
22
22
|
|
|
23
23
|
type EmptyMediaProps = React.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>;
|
|
24
|
-
declare const emptyMediaVariants: (props?:
|
|
25
|
-
variant?: "default" | "icon"
|
|
26
|
-
} & class_variance_authority_types.ClassProp)
|
|
24
|
+
declare const emptyMediaVariants: (props?: {
|
|
25
|
+
variant?: "default" | "icon";
|
|
26
|
+
} & class_variance_authority_types.ClassProp) => string;
|
|
27
27
|
declare function EmptyMedia({ className, variant, ...props }: EmptyMediaProps): react_jsx_runtime.JSX.Element;
|
|
28
28
|
|
|
29
29
|
export { Empty, EmptyContent, type EmptyContentProps, EmptyDescription, type EmptyDescriptionProps, EmptyHeader, type EmptyHeaderProps, EmptyMedia, type EmptyMediaProps, type EmptyProps, EmptyTitle, type EmptyTitleProps };
|