@spawn-llc/design-system 1.1.0 → 1.2.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/DESIGN-SYSTEM.md +4 -0
- package/README.md +8 -6
- package/SPEC.md +3 -1
- package/dist/DESIGN-SYSTEM.md +4 -0
- package/dist/chunk-227VGN2D.js +617 -0
- package/dist/chunk-2UK4FHS3.js +31 -0
- package/dist/chunk-36NOAJFW.js +53 -0
- package/dist/chunk-3EZ5FFYG.js +154 -0
- package/dist/chunk-3PN2XMRA.js +80 -0
- package/dist/chunk-3SLZRFKQ.js +107 -0
- package/dist/chunk-4ABNKOPC.js +18 -0
- package/dist/chunk-4IKPZU4X.js +34 -0
- package/dist/chunk-5YRMB7KW.js +31 -0
- package/dist/chunk-66R4755B.js +37 -0
- package/dist/chunk-ATBQXQM7.js +165 -0
- package/dist/chunk-AUWFUYJI.js +79 -0
- package/dist/chunk-BTGJV2P6.js +237 -0
- package/dist/chunk-BYJWYU66.js +95 -0
- package/dist/chunk-D6UXXTC6.js +18 -0
- package/dist/chunk-DFVSGTAN.js +24 -0
- package/dist/chunk-DQ52UWO2.js +28 -0
- package/dist/chunk-DXXFNPYR.js +20 -0
- package/dist/chunk-GBPD3QPO.js +60 -0
- package/dist/chunk-GHSVAEXO.js +227 -0
- package/dist/chunk-GQIUVLXP.js +42 -0
- package/dist/chunk-HG4AEMA5.js +74 -0
- package/dist/chunk-HK6P54FZ.js +139 -0
- package/dist/chunk-HSP43BHH.js +97 -0
- package/dist/chunk-HYBBZTLY.js +1 -0
- package/dist/chunk-IS2ZVRUW.js +186 -0
- package/dist/chunk-JSULEEYQ.js +9 -0
- package/dist/chunk-K46NYJUT.js +15 -0
- package/dist/chunk-L5SMHZJL.js +162 -0
- package/dist/chunk-LPPLLYOR.js +185 -0
- package/dist/chunk-LYDG55X2.js +194 -0
- package/dist/chunk-MLC45YHE.js +122 -0
- package/dist/chunk-MZEY2L46.js +186 -0
- package/dist/chunk-N34HFTEJ.js +22 -0
- package/dist/chunk-PPW4C342.js +232 -0
- package/dist/chunk-PZCXY6QZ.js +208 -0
- package/dist/chunk-Q3HD7YQZ.js +261 -0
- package/dist/chunk-QF7LZKLC.js +98 -0
- package/dist/chunk-QNUAUOJW.js +15 -0
- package/dist/chunk-QZSQXEOU.js +28 -0
- package/dist/chunk-RBTFEYGV.js +77 -0
- package/dist/chunk-SJMEO63M.js +116 -0
- package/dist/chunk-T6DWCVR3.js +73 -0
- package/dist/chunk-T7GS4AXQ.js +245 -0
- package/dist/chunk-TP35WWVP.js +46 -0
- package/dist/chunk-TQ6CJZMT.js +42 -0
- package/dist/chunk-U7N2A7A3.js +9 -0
- package/dist/chunk-V3NRC7QE.js +142 -0
- package/dist/chunk-VOHNOSMH.js +22 -0
- package/dist/chunk-W3PHWPYP.js +43 -0
- package/dist/chunk-WJ6DNG2Z.js +75 -0
- package/dist/chunk-WMXCMDSQ.js +126 -0
- package/dist/chunk-WSNSTJAR.js +58 -0
- package/dist/chunk-XG3HHC3U.js +79 -0
- package/dist/chunk-XOLQ37I2.js +118 -0
- package/dist/chunk-YFPY5SLS.js +19 -0
- package/dist/chunk-YFVERFQA.js +76 -0
- package/dist/chunk-YL4VCJKF.js +75 -0
- package/dist/chunk-ZMHTPZVQ.js +61 -0
- package/dist/chunk-ZO74KVH3.js +38 -0
- package/dist/components/ui/accordion.d.ts +9 -0
- package/dist/components/ui/accordion.js +3 -0
- package/dist/components/ui/alert-dialog.d.ts +24 -0
- package/dist/components/ui/alert-dialog.js +5 -0
- package/dist/components/ui/alert.d.ts +13 -0
- package/dist/components/ui/alert.js +3 -0
- package/dist/components/ui/aspect-ratio.d.ts +7 -0
- package/dist/components/ui/aspect-ratio.js +3 -0
- package/dist/components/ui/avatar.d.ts +13 -0
- package/dist/components/ui/avatar.js +3 -0
- package/dist/components/ui/badge.d.ts +11 -0
- package/dist/components/ui/badge.js +3 -0
- package/dist/components/ui/breadcrumb.d.ts +12 -0
- package/dist/components/ui/breadcrumb.js +3 -0
- package/dist/components/ui/button-group.d.ts +15 -0
- package/dist/components/ui/button-group.js +4 -0
- package/dist/components/ui/button.d.ts +9 -0
- package/dist/components/ui/button.js +4 -0
- package/dist/components/ui/calendar.d.ts +16 -0
- package/dist/components/ui/calendar.js +5 -0
- package/dist/components/ui/card.d.ts +13 -0
- package/dist/components/ui/card.js +3 -0
- package/dist/components/ui/carousel.d.ts +34 -0
- package/dist/components/ui/carousel.js +5 -0
- package/dist/components/ui/chart.d.ts +46 -0
- package/dist/components/ui/chart.js +3 -0
- package/dist/components/ui/checkbox.d.ts +6 -0
- package/dist/components/ui/checkbox.js +3 -0
- package/dist/components/ui/collapsible.d.ts +8 -0
- package/dist/components/ui/collapsible.js +2 -0
- package/dist/components/ui/combobox.d.ts +26 -0
- package/dist/components/ui/combobox.js +8 -0
- package/dist/components/ui/command.d.ts +22 -0
- package/dist/components/ui/command.js +9 -0
- package/dist/components/ui/context-menu.d.ts +31 -0
- package/dist/components/ui/context-menu.js +3 -0
- package/dist/components/ui/dialog.d.ts +19 -0
- package/dist/components/ui/dialog.js +5 -0
- package/dist/components/ui/direction.d.ts +1 -0
- package/dist/components/ui/direction.js +2 -0
- package/dist/components/ui/drawer.d.ts +15 -0
- package/dist/components/ui/drawer.js +3 -0
- package/dist/components/ui/dropdown-menu.d.ts +31 -0
- package/dist/components/ui/dropdown-menu.js +3 -0
- package/dist/components/ui/empty.d.ts +15 -0
- package/dist/components/ui/empty.js +3 -0
- package/dist/components/ui/field.d.ts +28 -0
- package/dist/components/ui/field.js +5 -0
- package/dist/components/ui/hover-card.d.ts +8 -0
- package/dist/components/ui/hover-card.js +3 -0
- package/dist/components/ui/input-group.d.ts +23 -0
- package/dist/components/ui/input-group.js +7 -0
- package/dist/components/ui/input-otp.d.ts +13 -0
- package/dist/components/ui/input-otp.js +3 -0
- package/dist/components/ui/input.d.ts +5 -0
- package/dist/components/ui/input.js +3 -0
- package/dist/components/ui/item.d.ts +26 -0
- package/dist/components/ui/item.js +4 -0
- package/dist/components/ui/kbd.d.ts +6 -0
- package/dist/components/ui/kbd.js +3 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/label.js +3 -0
- package/dist/components/ui/logo.d.ts +17 -0
- package/dist/components/ui/logo.js +3 -0
- package/dist/components/ui/menubar.d.ts +31 -0
- package/dist/components/ui/menubar.js +4 -0
- package/dist/components/ui/native-select.d.ts +10 -0
- package/dist/components/ui/native-select.js +3 -0
- package/dist/components/ui/navigation-menu.d.ts +15 -0
- package/dist/components/ui/navigation-menu.js +3 -0
- package/dist/components/ui/pagination.d.ts +23 -0
- package/dist/components/ui/pagination.js +5 -0
- package/dist/components/ui/popover.d.ts +11 -0
- package/dist/components/ui/popover.js +3 -0
- package/dist/components/ui/progress.d.ts +10 -0
- package/dist/components/ui/progress.js +3 -0
- package/dist/components/ui/radio-group.d.ts +8 -0
- package/dist/components/ui/radio-group.js +3 -0
- package/dist/components/ui/resizable.d.ts +10 -0
- package/dist/components/ui/resizable.js +3 -0
- package/dist/components/ui/scroll-area.d.ts +7 -0
- package/dist/components/ui/scroll-area.js +3 -0
- package/dist/components/ui/select.d.ts +17 -0
- package/dist/components/ui/select.js +3 -0
- package/dist/components/ui/separator.d.ts +6 -0
- package/dist/components/ui/separator.js +3 -0
- package/dist/components/ui/sheet.d.ts +16 -0
- package/dist/components/ui/sheet.js +5 -0
- package/dist/components/ui/sidebar.d.ts +70 -0
- package/dist/components/ui/sidebar.js +11 -0
- package/dist/components/ui/skeleton.d.ts +5 -0
- package/dist/components/ui/skeleton.js +3 -0
- package/dist/components/ui/slider.d.ts +6 -0
- package/dist/components/ui/slider.js +3 -0
- package/dist/components/ui/sonner.d.ts +6 -0
- package/dist/components/ui/sonner.js +2 -0
- package/dist/components/ui/spinner.d.ts +5 -0
- package/dist/components/ui/spinner.js +3 -0
- package/dist/components/ui/switch.d.ts +8 -0
- package/dist/components/ui/switch.js +3 -0
- package/dist/components/ui/table.d.ts +12 -0
- package/dist/components/ui/table.js +3 -0
- package/dist/components/ui/tabs.d.ts +14 -0
- package/dist/components/ui/tabs.js +3 -0
- package/dist/components/ui/textarea.d.ts +5 -0
- package/dist/components/ui/textarea.js +3 -0
- package/dist/components/ui/toggle-group.d.ts +14 -0
- package/dist/components/ui/toggle-group.js +4 -0
- package/dist/components/ui/toggle.d.ts +12 -0
- package/dist/components/ui/toggle.js +3 -0
- package/dist/components/ui/tooltip.d.ts +9 -0
- package/dist/components/ui/tooltip.js +3 -0
- package/dist/hooks/use-mobile.d.ts +3 -0
- package/dist/hooks/use-mobile.js +2 -0
- package/dist/index.d.ts +98 -640
- package/dist/index.js +60 -5573
- package/dist/lib/button-variants.d.ts +17 -0
- package/dist/lib/button-variants.js +1 -0
- package/dist/lib/contrast.d.ts +9 -0
- package/dist/lib/contrast.js +1 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.js +1 -0
- package/dist/styles.css +1 -1
- package/dist/theme.css +4 -0
- package/dist/{tokens.d.ts → tokens.generated.d.ts} +8 -0
- package/dist/{tokens.js → tokens.generated.js} +4 -0
- package/dist/variants.d.ts +3 -0
- package/dist/variants.js +1 -0
- package/package.json +17 -5
- package/tokens/tokens.css +2 -0
- package/tokens/tokens.json +5 -1
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { Button } from './chunk-N34HFTEJ.js';
|
|
2
|
+
import { cn } from './chunk-U7N2A7A3.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import useEmblaCarousel from 'embla-carousel-react';
|
|
5
|
+
import { ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var CarouselContext = React.createContext(null);
|
|
9
|
+
function useCarousel() {
|
|
10
|
+
const context = React.useContext(CarouselContext);
|
|
11
|
+
if (!context) {
|
|
12
|
+
throw new Error("useCarousel must be used within a <Carousel />");
|
|
13
|
+
}
|
|
14
|
+
return context;
|
|
15
|
+
}
|
|
16
|
+
function Carousel({
|
|
17
|
+
orientation = "horizontal",
|
|
18
|
+
opts,
|
|
19
|
+
setApi,
|
|
20
|
+
plugins,
|
|
21
|
+
className,
|
|
22
|
+
children,
|
|
23
|
+
...props
|
|
24
|
+
}) {
|
|
25
|
+
const [carouselRef, api] = useEmblaCarousel(
|
|
26
|
+
{
|
|
27
|
+
...opts,
|
|
28
|
+
axis: orientation === "horizontal" ? "x" : "y"
|
|
29
|
+
},
|
|
30
|
+
plugins
|
|
31
|
+
);
|
|
32
|
+
const [canScrollPrev, setCanScrollPrev] = React.useState(false);
|
|
33
|
+
const [canScrollNext, setCanScrollNext] = React.useState(false);
|
|
34
|
+
const onSelect = React.useCallback((api2) => {
|
|
35
|
+
if (!api2) return;
|
|
36
|
+
setCanScrollPrev(api2.canScrollPrev());
|
|
37
|
+
setCanScrollNext(api2.canScrollNext());
|
|
38
|
+
}, []);
|
|
39
|
+
const scrollPrev = React.useCallback(() => {
|
|
40
|
+
api?.scrollPrev();
|
|
41
|
+
}, [api]);
|
|
42
|
+
const scrollNext = React.useCallback(() => {
|
|
43
|
+
api?.scrollNext();
|
|
44
|
+
}, [api]);
|
|
45
|
+
const handleKeyDown = React.useCallback(
|
|
46
|
+
(event) => {
|
|
47
|
+
if (event.key === "ArrowLeft") {
|
|
48
|
+
event.preventDefault();
|
|
49
|
+
scrollPrev();
|
|
50
|
+
} else if (event.key === "ArrowRight") {
|
|
51
|
+
event.preventDefault();
|
|
52
|
+
scrollNext();
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
[scrollPrev, scrollNext]
|
|
56
|
+
);
|
|
57
|
+
React.useEffect(() => {
|
|
58
|
+
if (!api || !setApi) return;
|
|
59
|
+
setApi(api);
|
|
60
|
+
}, [api, setApi]);
|
|
61
|
+
React.useEffect(() => {
|
|
62
|
+
if (!api) return;
|
|
63
|
+
onSelect(api);
|
|
64
|
+
api.on("reInit", onSelect);
|
|
65
|
+
api.on("select", onSelect);
|
|
66
|
+
return () => {
|
|
67
|
+
api?.off("select", onSelect);
|
|
68
|
+
};
|
|
69
|
+
}, [api, onSelect]);
|
|
70
|
+
return /* @__PURE__ */ jsx(
|
|
71
|
+
CarouselContext.Provider,
|
|
72
|
+
{
|
|
73
|
+
value: {
|
|
74
|
+
carouselRef,
|
|
75
|
+
api,
|
|
76
|
+
opts,
|
|
77
|
+
orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
|
|
78
|
+
scrollPrev,
|
|
79
|
+
scrollNext,
|
|
80
|
+
canScrollPrev,
|
|
81
|
+
canScrollNext
|
|
82
|
+
},
|
|
83
|
+
children: /* @__PURE__ */ jsx(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
onKeyDownCapture: handleKeyDown,
|
|
87
|
+
className: cn("relative", className),
|
|
88
|
+
role: "region",
|
|
89
|
+
"aria-roledescription": "carousel",
|
|
90
|
+
"data-slot": "carousel",
|
|
91
|
+
...props,
|
|
92
|
+
children
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
function CarouselContent({ className, ...props }) {
|
|
99
|
+
const { carouselRef, orientation } = useCarousel();
|
|
100
|
+
return /* @__PURE__ */ jsx(
|
|
101
|
+
"div",
|
|
102
|
+
{
|
|
103
|
+
ref: carouselRef,
|
|
104
|
+
className: "overflow-hidden",
|
|
105
|
+
"data-slot": "carousel-content",
|
|
106
|
+
children: /* @__PURE__ */ jsx(
|
|
107
|
+
"div",
|
|
108
|
+
{
|
|
109
|
+
className: cn(
|
|
110
|
+
"flex",
|
|
111
|
+
orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
|
|
112
|
+
className
|
|
113
|
+
),
|
|
114
|
+
...props
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
function CarouselItem({ className, ...props }) {
|
|
121
|
+
const { orientation } = useCarousel();
|
|
122
|
+
return /* @__PURE__ */ jsx(
|
|
123
|
+
"div",
|
|
124
|
+
{
|
|
125
|
+
role: "group",
|
|
126
|
+
"aria-roledescription": "slide",
|
|
127
|
+
"data-slot": "carousel-item",
|
|
128
|
+
className: cn(
|
|
129
|
+
"min-w-0 shrink-0 grow-0 basis-full",
|
|
130
|
+
orientation === "horizontal" ? "pl-4" : "pt-4",
|
|
131
|
+
className
|
|
132
|
+
),
|
|
133
|
+
...props
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
function CarouselPrevious({
|
|
138
|
+
className,
|
|
139
|
+
variant = "outline",
|
|
140
|
+
size = "icon-sm",
|
|
141
|
+
...props
|
|
142
|
+
}) {
|
|
143
|
+
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
144
|
+
return /* @__PURE__ */ jsxs(
|
|
145
|
+
Button,
|
|
146
|
+
{
|
|
147
|
+
"data-slot": "carousel-previous",
|
|
148
|
+
variant,
|
|
149
|
+
size,
|
|
150
|
+
className: cn(
|
|
151
|
+
"absolute touch-manipulation rounded-full",
|
|
152
|
+
orientation === "horizontal" ? "inset-y-0 -left-12 my-auto" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
153
|
+
className
|
|
154
|
+
),
|
|
155
|
+
disabled: !canScrollPrev,
|
|
156
|
+
onClick: scrollPrev,
|
|
157
|
+
...props,
|
|
158
|
+
children: [
|
|
159
|
+
/* @__PURE__ */ jsx(ChevronLeftIcon, {}),
|
|
160
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Previous slide" })
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
function CarouselNext({
|
|
166
|
+
className,
|
|
167
|
+
variant = "outline",
|
|
168
|
+
size = "icon-sm",
|
|
169
|
+
...props
|
|
170
|
+
}) {
|
|
171
|
+
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
172
|
+
return /* @__PURE__ */ jsxs(
|
|
173
|
+
Button,
|
|
174
|
+
{
|
|
175
|
+
"data-slot": "carousel-next",
|
|
176
|
+
variant,
|
|
177
|
+
size,
|
|
178
|
+
className: cn(
|
|
179
|
+
"absolute touch-manipulation rounded-full",
|
|
180
|
+
orientation === "horizontal" ? "inset-y-0 -right-12 my-auto" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
181
|
+
className
|
|
182
|
+
),
|
|
183
|
+
disabled: !canScrollNext,
|
|
184
|
+
onClick: scrollNext,
|
|
185
|
+
...props,
|
|
186
|
+
children: [
|
|
187
|
+
/* @__PURE__ */ jsx(ChevronRightIcon, {}),
|
|
188
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Next slide" })
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Button } from './chunk-N34HFTEJ.js';
|
|
2
|
+
import { cn } from './chunk-U7N2A7A3.js';
|
|
3
|
+
import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from 'lucide-react';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
function Pagination({ className, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
"nav",
|
|
9
|
+
{
|
|
10
|
+
role: "navigation",
|
|
11
|
+
"aria-label": "pagination",
|
|
12
|
+
"data-slot": "pagination",
|
|
13
|
+
className: cn("mx-auto flex w-full justify-center", className),
|
|
14
|
+
...props
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
function PaginationContent({
|
|
19
|
+
className,
|
|
20
|
+
...props
|
|
21
|
+
}) {
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
"ul",
|
|
24
|
+
{
|
|
25
|
+
"data-slot": "pagination-content",
|
|
26
|
+
className: cn("flex items-center gap-0.5", className),
|
|
27
|
+
...props
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
function PaginationItem({ ...props }) {
|
|
32
|
+
return /* @__PURE__ */ jsx("li", { "data-slot": "pagination-item", ...props });
|
|
33
|
+
}
|
|
34
|
+
function PaginationLink({
|
|
35
|
+
className,
|
|
36
|
+
isActive,
|
|
37
|
+
size = "icon",
|
|
38
|
+
...props
|
|
39
|
+
}) {
|
|
40
|
+
return /* @__PURE__ */ jsx(
|
|
41
|
+
Button,
|
|
42
|
+
{
|
|
43
|
+
variant: isActive ? "outline" : "ghost",
|
|
44
|
+
size,
|
|
45
|
+
className: cn(className),
|
|
46
|
+
nativeButton: false,
|
|
47
|
+
render: /* @__PURE__ */ jsx(
|
|
48
|
+
"a",
|
|
49
|
+
{
|
|
50
|
+
"aria-current": isActive ? "page" : void 0,
|
|
51
|
+
"data-slot": "pagination-link",
|
|
52
|
+
"data-active": isActive,
|
|
53
|
+
...props
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
function PaginationPrevious({
|
|
60
|
+
className,
|
|
61
|
+
text = "Previous",
|
|
62
|
+
...props
|
|
63
|
+
}) {
|
|
64
|
+
return /* @__PURE__ */ jsxs(
|
|
65
|
+
PaginationLink,
|
|
66
|
+
{
|
|
67
|
+
"aria-label": "Go to previous page",
|
|
68
|
+
size: "default",
|
|
69
|
+
className: cn("pl-1.5!", className),
|
|
70
|
+
...props,
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ jsx(ChevronLeftIcon, { "data-icon": "inline-start" }),
|
|
73
|
+
/* @__PURE__ */ jsx("span", { className: "hidden sm:block", children: text })
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
function PaginationNext({
|
|
79
|
+
className,
|
|
80
|
+
text = "Next",
|
|
81
|
+
...props
|
|
82
|
+
}) {
|
|
83
|
+
return /* @__PURE__ */ jsxs(
|
|
84
|
+
PaginationLink,
|
|
85
|
+
{
|
|
86
|
+
"aria-label": "Go to next page",
|
|
87
|
+
size: "default",
|
|
88
|
+
className: cn("pr-1.5!", className),
|
|
89
|
+
...props,
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ jsx("span", { className: "hidden sm:block", children: text }),
|
|
92
|
+
/* @__PURE__ */ jsx(ChevronRightIcon, { "data-icon": "inline-end" })
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
function PaginationEllipsis({
|
|
98
|
+
className,
|
|
99
|
+
...props
|
|
100
|
+
}) {
|
|
101
|
+
return /* @__PURE__ */ jsxs(
|
|
102
|
+
"span",
|
|
103
|
+
{
|
|
104
|
+
"aria-hidden": true,
|
|
105
|
+
"data-slot": "pagination-ellipsis",
|
|
106
|
+
className: cn(
|
|
107
|
+
"flex size-8 items-center justify-center [&_svg:not([class*='size-'])]:size-4",
|
|
108
|
+
className
|
|
109
|
+
),
|
|
110
|
+
...props,
|
|
111
|
+
children: [
|
|
112
|
+
/* @__PURE__ */ jsx(
|
|
113
|
+
MoreHorizontalIcon,
|
|
114
|
+
{}
|
|
115
|
+
),
|
|
116
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "More pages" })
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious };
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { Separator } from './chunk-DFVSGTAN.js';
|
|
2
|
+
import { cn } from './chunk-U7N2A7A3.js';
|
|
3
|
+
import { mergeProps } from '@base-ui/react/merge-props';
|
|
4
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
function ItemGroup({ className, ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
|
+
"div",
|
|
11
|
+
{
|
|
12
|
+
role: "list",
|
|
13
|
+
"data-slot": "item-group",
|
|
14
|
+
className: cn(
|
|
15
|
+
"group/item-group flex w-full flex-col gap-4 has-data-[size=sm]:gap-2.5 has-data-[size=xs]:gap-2",
|
|
16
|
+
className
|
|
17
|
+
),
|
|
18
|
+
...props
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
function ItemSeparator({
|
|
23
|
+
className,
|
|
24
|
+
...props
|
|
25
|
+
}) {
|
|
26
|
+
return /* @__PURE__ */ jsx(
|
|
27
|
+
Separator,
|
|
28
|
+
{
|
|
29
|
+
"data-slot": "item-separator",
|
|
30
|
+
orientation: "horizontal",
|
|
31
|
+
className: cn("my-2", className),
|
|
32
|
+
...props
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
var itemVariants = cva(
|
|
37
|
+
"group/item flex w-full flex-wrap items-center rounded-lg border text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [a]:transition-colors [a]:hover:bg-muted",
|
|
38
|
+
{
|
|
39
|
+
variants: {
|
|
40
|
+
variant: {
|
|
41
|
+
default: "border-transparent",
|
|
42
|
+
outline: "border-border",
|
|
43
|
+
muted: "border-transparent bg-muted/50"
|
|
44
|
+
},
|
|
45
|
+
size: {
|
|
46
|
+
default: "gap-2.5 px-3 py-2.5",
|
|
47
|
+
sm: "gap-2.5 px-3 py-2.5",
|
|
48
|
+
xs: "gap-2 px-2.5 py-2 in-data-[slot=dropdown-menu-content]:p-0"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
defaultVariants: {
|
|
52
|
+
variant: "default",
|
|
53
|
+
size: "default"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
function Item({
|
|
58
|
+
className,
|
|
59
|
+
variant = "default",
|
|
60
|
+
size = "default",
|
|
61
|
+
render,
|
|
62
|
+
...props
|
|
63
|
+
}) {
|
|
64
|
+
return useRender({
|
|
65
|
+
defaultTagName: "div",
|
|
66
|
+
props: mergeProps(
|
|
67
|
+
{
|
|
68
|
+
className: cn(itemVariants({ variant, size, className }))
|
|
69
|
+
},
|
|
70
|
+
props
|
|
71
|
+
),
|
|
72
|
+
render,
|
|
73
|
+
state: {
|
|
74
|
+
slot: "item",
|
|
75
|
+
variant,
|
|
76
|
+
size
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
var itemMediaVariants = cva(
|
|
81
|
+
"flex shrink-0 items-center justify-center gap-2 group-has-data-[slot=item-description]/item:translate-y-0.5 group-has-data-[slot=item-description]/item:self-start [&_svg]:pointer-events-none",
|
|
82
|
+
{
|
|
83
|
+
variants: {
|
|
84
|
+
variant: {
|
|
85
|
+
default: "bg-transparent",
|
|
86
|
+
icon: "[&_svg:not([class*='size-'])]:size-4",
|
|
87
|
+
image: "size-10 overflow-hidden rounded-sm group-data-[size=sm]/item:size-8 group-data-[size=xs]/item:size-6 [&_img]:size-full [&_img]:object-cover"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
defaultVariants: {
|
|
91
|
+
variant: "default"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
function ItemMedia({
|
|
96
|
+
className,
|
|
97
|
+
variant = "default",
|
|
98
|
+
...props
|
|
99
|
+
}) {
|
|
100
|
+
return /* @__PURE__ */ jsx(
|
|
101
|
+
"div",
|
|
102
|
+
{
|
|
103
|
+
"data-slot": "item-media",
|
|
104
|
+
"data-variant": variant,
|
|
105
|
+
className: cn(itemMediaVariants({ variant, className })),
|
|
106
|
+
...props
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
function ItemContent({ className, ...props }) {
|
|
111
|
+
return /* @__PURE__ */ jsx(
|
|
112
|
+
"div",
|
|
113
|
+
{
|
|
114
|
+
"data-slot": "item-content",
|
|
115
|
+
className: cn(
|
|
116
|
+
"flex flex-1 flex-col gap-1 group-data-[size=xs]/item:gap-0 [&+[data-slot=item-content]]:flex-none",
|
|
117
|
+
className
|
|
118
|
+
),
|
|
119
|
+
...props
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
function ItemTitle({ className, ...props }) {
|
|
124
|
+
return /* @__PURE__ */ jsx(
|
|
125
|
+
"div",
|
|
126
|
+
{
|
|
127
|
+
"data-slot": "item-title",
|
|
128
|
+
className: cn(
|
|
129
|
+
"line-clamp-1 flex w-fit items-center gap-2 text-sm leading-snug font-medium underline-offset-4",
|
|
130
|
+
className
|
|
131
|
+
),
|
|
132
|
+
...props
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
function ItemDescription({ className, ...props }) {
|
|
137
|
+
return /* @__PURE__ */ jsx(
|
|
138
|
+
"p",
|
|
139
|
+
{
|
|
140
|
+
"data-slot": "item-description",
|
|
141
|
+
className: cn(
|
|
142
|
+
"line-clamp-2 text-left text-sm leading-normal font-normal text-muted-foreground group-data-[size=xs]/item:text-xs [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
|
|
143
|
+
className
|
|
144
|
+
),
|
|
145
|
+
...props
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
function ItemActions({ className, ...props }) {
|
|
150
|
+
return /* @__PURE__ */ jsx(
|
|
151
|
+
"div",
|
|
152
|
+
{
|
|
153
|
+
"data-slot": "item-actions",
|
|
154
|
+
className: cn("flex items-center gap-2", className),
|
|
155
|
+
...props
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
function ItemHeader({ className, ...props }) {
|
|
160
|
+
return /* @__PURE__ */ jsx(
|
|
161
|
+
"div",
|
|
162
|
+
{
|
|
163
|
+
"data-slot": "item-header",
|
|
164
|
+
className: cn(
|
|
165
|
+
"flex basis-full items-center justify-between gap-2",
|
|
166
|
+
className
|
|
167
|
+
),
|
|
168
|
+
...props
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
function ItemFooter({ className, ...props }) {
|
|
173
|
+
return /* @__PURE__ */ jsx(
|
|
174
|
+
"div",
|
|
175
|
+
{
|
|
176
|
+
"data-slot": "item-footer",
|
|
177
|
+
className: cn(
|
|
178
|
+
"flex basis-full items-center justify-between gap-2",
|
|
179
|
+
className
|
|
180
|
+
),
|
|
181
|
+
...props
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export { Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { buttonVariants } from './chunk-4IKPZU4X.js';
|
|
2
|
+
import { cn } from './chunk-U7N2A7A3.js';
|
|
3
|
+
import { Button as Button$1 } from '@base-ui/react/button';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
function Button({
|
|
7
|
+
className,
|
|
8
|
+
variant = "default",
|
|
9
|
+
size = "default",
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
Button$1,
|
|
14
|
+
{
|
|
15
|
+
"data-slot": "button",
|
|
16
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
17
|
+
...props
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { Button };
|