@music-vine/cadence 0.1.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/README.md +146 -0
- package/dist/components/accordion.d.ts +35 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +95 -0
- package/dist/components/accordion.js.map +7 -0
- package/dist/components/badge.d.ts +14 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +78 -0
- package/dist/components/badge.js.map +7 -0
- package/dist/components/breadcrumb.d.ts +20 -0
- package/dist/components/breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb.js +98 -0
- package/dist/components/breadcrumb.js.map +7 -0
- package/dist/components/button.d.ts +47 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +295 -0
- package/dist/components/button.js.map +7 -0
- package/dist/components/card.d.ts +9 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +65 -0
- package/dist/components/card.js.map +7 -0
- package/dist/components/carousel-dots.d.ts +9 -0
- package/dist/components/carousel-dots.d.ts.map +1 -0
- package/dist/components/carousel-dots.js +55 -0
- package/dist/components/carousel-dots.js.map +7 -0
- package/dist/components/carousel.d.ts +33 -0
- package/dist/components/carousel.d.ts.map +1 -0
- package/dist/components/carousel.js +217 -0
- package/dist/components/carousel.js.map +7 -0
- package/dist/components/checkbox.d.ts +13 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +57 -0
- package/dist/components/checkbox.js.map +7 -0
- package/dist/components/context-menu.d.ts +28 -0
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu.js +154 -0
- package/dist/components/context-menu.js.map +7 -0
- package/dist/components/dialog.d.ts +20 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +98 -0
- package/dist/components/dialog.js.map +7 -0
- package/dist/components/drawer.d.ts +26 -0
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/drawer.js +133 -0
- package/dist/components/drawer.js.map +7 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +277 -0
- package/dist/components/index.js.map +7 -0
- package/dist/components/input.d.ts +20 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +174 -0
- package/dist/components/input.js.map +7 -0
- package/dist/components/label.d.ts +6 -0
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/label.js +21 -0
- package/dist/components/label.js.map +7 -0
- package/dist/components/popover.d.ts +8 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +38 -0
- package/dist/components/popover.js.map +7 -0
- package/dist/components/price-tag.d.ts +11 -0
- package/dist/components/price-tag.d.ts.map +1 -0
- package/dist/components/price-tag.js +31 -0
- package/dist/components/price-tag.js.map +7 -0
- package/dist/components/radio-group.d.ts +6 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +84 -0
- package/dist/components/radio-group.js.map +7 -0
- package/dist/components/scroll-area.d.ts +15 -0
- package/dist/components/scroll-area.d.ts.map +1 -0
- package/dist/components/scroll-area.js +132 -0
- package/dist/components/scroll-area.js.map +7 -0
- package/dist/components/select.d.ts +59 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +210 -0
- package/dist/components/select.js.map +7 -0
- package/dist/components/separator.d.ts +5 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +25 -0
- package/dist/components/separator.js.map +7 -0
- package/dist/components/skeleton.d.ts +10 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +29 -0
- package/dist/components/skeleton.js.map +7 -0
- package/dist/components/slider.d.ts +15 -0
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/slider.js +95 -0
- package/dist/components/slider.js.map +7 -0
- package/dist/components/stacking-card.d.ts +54 -0
- package/dist/components/stacking-card.d.ts.map +1 -0
- package/dist/components/stacking-card.js +636 -0
- package/dist/components/stacking-card.js.map +7 -0
- package/dist/components/tabs.d.ts +8 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +48 -0
- package/dist/components/tabs.js.map +7 -0
- package/dist/components/textarea.d.ts +11 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +43 -0
- package/dist/components/textarea.js.map +7 -0
- package/dist/components/toast.d.ts +7 -0
- package/dist/components/toast.d.ts.map +1 -0
- package/dist/components/toast.js +53 -0
- package/dist/components/toast.js.map +7 -0
- package/dist/components/toggle-button.d.ts +20 -0
- package/dist/components/toggle-button.d.ts.map +1 -0
- package/dist/components/toggle-button.js +56 -0
- package/dist/components/toggle-button.js.map +7 -0
- package/dist/components/typography/heading.d.ts +18 -0
- package/dist/components/typography/heading.d.ts.map +1 -0
- package/dist/components/typography/heading.js +105 -0
- package/dist/components/typography/heading.js.map +7 -0
- package/dist/components/typography/index.d.ts +5 -0
- package/dist/components/typography/index.d.ts.map +1 -0
- package/dist/components/typography/index.js +36 -0
- package/dist/components/typography/index.js.map +7 -0
- package/dist/components/typography/list.d.ts +17 -0
- package/dist/components/typography/list.d.ts.map +1 -0
- package/dist/components/typography/list.js +73 -0
- package/dist/components/typography/list.js.map +7 -0
- package/dist/components/typography/prose.d.ts +5 -0
- package/dist/components/typography/prose.d.ts.map +1 -0
- package/dist/components/typography/prose.js +50 -0
- package/dist/components/typography/prose.js.map +7 -0
- package/dist/components/typography/text.d.ts +11 -0
- package/dist/components/typography/text.d.ts.map +1 -0
- package/dist/components/typography/text.js +38 -0
- package/dist/components/typography/text.js.map +7 -0
- package/dist/icons/custom/boards-indicator.d.ts +7 -0
- package/dist/icons/custom/boards-indicator.d.ts.map +1 -0
- package/dist/icons/custom/boards-indicator.js +70 -0
- package/dist/icons/custom/boards-indicator.js.map +7 -0
- package/dist/icons/custom/download-history.d.ts +6 -0
- package/dist/icons/custom/download-history.d.ts.map +1 -0
- package/dist/icons/custom/download-history.js +19 -0
- package/dist/icons/custom/download-history.js.map +7 -0
- package/dist/icons/custom/exclamation-mark-in-octagon.d.ts +6 -0
- package/dist/icons/custom/exclamation-mark-in-octagon.d.ts.map +1 -0
- package/dist/icons/custom/exclamation-mark-in-octagon.js +57 -0
- package/dist/icons/custom/exclamation-mark-in-octagon.js.map +7 -0
- package/dist/icons/custom/pin.d.ts +6 -0
- package/dist/icons/custom/pin.d.ts.map +1 -0
- package/dist/icons/custom/pin.js +28 -0
- package/dist/icons/custom/pin.js.map +7 -0
- package/dist/icons/custom/premium-star.d.ts +10 -0
- package/dist/icons/custom/premium-star.d.ts.map +1 -0
- package/dist/icons/custom/premium-star.js +191 -0
- package/dist/icons/custom/premium-star.js.map +7 -0
- package/dist/icons/custom/social/discord.d.ts +6 -0
- package/dist/icons/custom/social/discord.d.ts.map +1 -0
- package/dist/icons/custom/social/discord.js +27 -0
- package/dist/icons/custom/social/discord.js.map +7 -0
- package/dist/icons/custom/social/index.d.ts +4 -0
- package/dist/icons/custom/social/index.d.ts.map +1 -0
- package/dist/icons/custom/social/index.js +4 -0
- package/dist/icons/custom/social/index.js.map +7 -0
- package/dist/icons/custom/social/tiktok.d.ts +6 -0
- package/dist/icons/custom/social/tiktok.d.ts.map +1 -0
- package/dist/icons/custom/social/tiktok.js +27 -0
- package/dist/icons/custom/social/tiktok.js.map +7 -0
- package/dist/icons/custom/social/twitter-x.d.ts +6 -0
- package/dist/icons/custom/social/twitter-x.d.ts.map +1 -0
- package/dist/icons/custom/social/twitter-x.js +29 -0
- package/dist/icons/custom/social/twitter-x.js.map +7 -0
- package/dist/icons/custom/tick-in-circle.d.ts +7 -0
- package/dist/icons/custom/tick-in-circle.d.ts.map +1 -0
- package/dist/icons/custom/tick-in-circle.js +32 -0
- package/dist/icons/custom/tick-in-circle.js.map +7 -0
- package/dist/icons/custom/tick-small.d.ts +6 -0
- package/dist/icons/custom/tick-small.d.ts.map +1 -0
- package/dist/icons/custom/tick-small.js +16 -0
- package/dist/icons/custom/tick-small.js.map +7 -0
- package/dist/icons/custom/tick.d.ts +3 -0
- package/dist/icons/custom/tick.d.ts.map +1 -0
- package/dist/icons/custom/tick.js +31 -0
- package/dist/icons/custom/tick.js.map +7 -0
- package/dist/icons/custom/uppbeat-credit.d.ts +4 -0
- package/dist/icons/custom/uppbeat-credit.d.ts.map +1 -0
- package/dist/icons/custom/uppbeat-credit.js +55 -0
- package/dist/icons/custom/uppbeat-credit.js.map +7 -0
- package/dist/icons/index.d.ts +20 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/icons/index.js +15 -0
- package/dist/icons/index.js.map +7 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +7 -0
- package/dist/lib/utils.d.ts +7 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +9 -0
- package/dist/lib/utils.js.map +7 -0
- package/dist/styles/index.css +3 -0
- package/dist/styles/storybook.css +14 -0
- package/package.json +107 -0
- package/tailwind.config.ts +299 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import useEmblaCarousel from "embla-carousel-react";
|
|
3
|
+
import { ArrowLeft, ArrowRight } from "lucide-react";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { useMemo } from "react";
|
|
6
|
+
import { cn } from "../lib/utils";
|
|
7
|
+
import { Button } from "./button";
|
|
8
|
+
const 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
|
+
const Carousel = React.forwardRef(
|
|
17
|
+
({
|
|
18
|
+
orientation = "horizontal",
|
|
19
|
+
opts,
|
|
20
|
+
setApi,
|
|
21
|
+
plugins,
|
|
22
|
+
className,
|
|
23
|
+
children,
|
|
24
|
+
...props
|
|
25
|
+
}, ref) => {
|
|
26
|
+
const [carouselRef, api] = useEmblaCarousel(
|
|
27
|
+
{
|
|
28
|
+
...opts,
|
|
29
|
+
axis: orientation === "horizontal" ? "x" : "y"
|
|
30
|
+
},
|
|
31
|
+
plugins
|
|
32
|
+
);
|
|
33
|
+
const [canScrollPrev, setCanScrollPrev] = React.useState(false);
|
|
34
|
+
const [canScrollNext, setCanScrollNext] = React.useState(false);
|
|
35
|
+
const onSelect = React.useCallback((carouselApi) => {
|
|
36
|
+
if (!carouselApi) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
setCanScrollPrev(carouselApi.canScrollPrev());
|
|
40
|
+
setCanScrollNext(carouselApi.canScrollNext());
|
|
41
|
+
}, []);
|
|
42
|
+
const scrollPrev = React.useCallback(() => {
|
|
43
|
+
api?.scrollPrev();
|
|
44
|
+
}, [api]);
|
|
45
|
+
const scrollNext = React.useCallback(() => {
|
|
46
|
+
api?.scrollNext();
|
|
47
|
+
}, [api]);
|
|
48
|
+
const handleKeyDown = React.useCallback(
|
|
49
|
+
(event) => {
|
|
50
|
+
if (event.key === "ArrowLeft") {
|
|
51
|
+
event.preventDefault();
|
|
52
|
+
scrollPrev();
|
|
53
|
+
} else if (event.key === "ArrowRight") {
|
|
54
|
+
event.preventDefault();
|
|
55
|
+
scrollNext();
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
[scrollPrev, scrollNext]
|
|
59
|
+
);
|
|
60
|
+
const carouselContextValue = useMemo(
|
|
61
|
+
() => ({
|
|
62
|
+
carouselRef,
|
|
63
|
+
api,
|
|
64
|
+
opts,
|
|
65
|
+
orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
|
|
66
|
+
scrollPrev,
|
|
67
|
+
scrollNext,
|
|
68
|
+
canScrollPrev,
|
|
69
|
+
canScrollNext
|
|
70
|
+
}),
|
|
71
|
+
[
|
|
72
|
+
api,
|
|
73
|
+
canScrollNext,
|
|
74
|
+
canScrollPrev,
|
|
75
|
+
carouselRef,
|
|
76
|
+
opts,
|
|
77
|
+
orientation,
|
|
78
|
+
scrollNext,
|
|
79
|
+
scrollPrev
|
|
80
|
+
]
|
|
81
|
+
);
|
|
82
|
+
React.useEffect(() => {
|
|
83
|
+
if (!(api && setApi)) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
setApi(api);
|
|
87
|
+
}, [api, setApi]);
|
|
88
|
+
React.useEffect(() => {
|
|
89
|
+
if (!api) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
onSelect(api);
|
|
93
|
+
api.on("reInit", onSelect);
|
|
94
|
+
api.on("select", onSelect);
|
|
95
|
+
return () => {
|
|
96
|
+
api?.off("select", onSelect);
|
|
97
|
+
};
|
|
98
|
+
}, [api, onSelect]);
|
|
99
|
+
return /* @__PURE__ */ jsx(CarouselContext.Provider, { value: carouselContextValue, children: /* @__PURE__ */ jsx(
|
|
100
|
+
"div",
|
|
101
|
+
{
|
|
102
|
+
"aria-roledescription": "carousel",
|
|
103
|
+
className: cn("relative", className),
|
|
104
|
+
onKeyDownCapture: handleKeyDown,
|
|
105
|
+
ref,
|
|
106
|
+
role: "region",
|
|
107
|
+
...props,
|
|
108
|
+
children
|
|
109
|
+
}
|
|
110
|
+
) });
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
Carousel.displayName = "Carousel";
|
|
114
|
+
const CarouselContent = React.forwardRef(({ className, containerClassName, ...props }, ref) => {
|
|
115
|
+
const { carouselRef, orientation } = useCarousel();
|
|
116
|
+
return /* @__PURE__ */ jsx(
|
|
117
|
+
"div",
|
|
118
|
+
{
|
|
119
|
+
className: cn("overflow-hidden", containerClassName),
|
|
120
|
+
ref: carouselRef,
|
|
121
|
+
children: /* @__PURE__ */ jsx(
|
|
122
|
+
"div",
|
|
123
|
+
{
|
|
124
|
+
className: cn(
|
|
125
|
+
"flex",
|
|
126
|
+
orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
|
|
127
|
+
className
|
|
128
|
+
),
|
|
129
|
+
ref,
|
|
130
|
+
...props
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
});
|
|
136
|
+
CarouselContent.displayName = "CarouselContent";
|
|
137
|
+
const CarouselItem = React.forwardRef(
|
|
138
|
+
({ className, useCustomStyles, ...props }, ref) => {
|
|
139
|
+
const { orientation } = useCarousel();
|
|
140
|
+
return /* @__PURE__ */ jsx(
|
|
141
|
+
"div",
|
|
142
|
+
{
|
|
143
|
+
"aria-roledescription": "slide",
|
|
144
|
+
className: cn(
|
|
145
|
+
useCustomStyles ? "min-w-0 shrink-0 grow-0 @[1150px]:basis-1/6 @[1400px]:basis-[14.28%] @[1580px]:basis-[12.5%] @[540px]:basis-1/4 @[900px]:basis-1/5 basis-1/3 overflow-hidden px-0 pr-2" : cn(
|
|
146
|
+
"min-w-0 shrink-0 grow-0 basis-full",
|
|
147
|
+
orientation === "horizontal" ? "pl-4" : "pt-4"
|
|
148
|
+
),
|
|
149
|
+
className
|
|
150
|
+
),
|
|
151
|
+
ref,
|
|
152
|
+
role: "group",
|
|
153
|
+
...props
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
CarouselItem.displayName = "CarouselItem";
|
|
159
|
+
const CarouselPrevious = React.forwardRef(({ className, variant = "subtle", size = "icon", ...props }, ref) => {
|
|
160
|
+
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
161
|
+
return /* @__PURE__ */ jsxs(
|
|
162
|
+
Button,
|
|
163
|
+
{
|
|
164
|
+
className: cn(
|
|
165
|
+
"absolute h-8 w-8 rounded-full",
|
|
166
|
+
orientation === "horizontal" ? "top-1/2 -left-12 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
167
|
+
!canScrollPrev && "!cursor-default",
|
|
168
|
+
className
|
|
169
|
+
),
|
|
170
|
+
disabled: !canScrollPrev,
|
|
171
|
+
onClick: scrollPrev,
|
|
172
|
+
ref,
|
|
173
|
+
size,
|
|
174
|
+
variant,
|
|
175
|
+
...props,
|
|
176
|
+
children: [
|
|
177
|
+
/* @__PURE__ */ jsx(ArrowLeft, { className: "h-4 w-4 fill-none" }),
|
|
178
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Previous slide" })
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
});
|
|
183
|
+
CarouselPrevious.displayName = "CarouselPrevious";
|
|
184
|
+
const CarouselNext = React.forwardRef(({ className, variant = "subtle", size = "icon", ...props }, ref) => {
|
|
185
|
+
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
186
|
+
return /* @__PURE__ */ jsxs(
|
|
187
|
+
Button,
|
|
188
|
+
{
|
|
189
|
+
className: cn(
|
|
190
|
+
"absolute h-8 w-8 rounded-full",
|
|
191
|
+
orientation === "horizontal" ? "top-1/2 -right-12 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
192
|
+
!canScrollNext && "!cursor-default",
|
|
193
|
+
className
|
|
194
|
+
),
|
|
195
|
+
disabled: !canScrollNext,
|
|
196
|
+
onClick: scrollNext,
|
|
197
|
+
ref,
|
|
198
|
+
size,
|
|
199
|
+
variant,
|
|
200
|
+
...props,
|
|
201
|
+
children: [
|
|
202
|
+
/* @__PURE__ */ jsx(ArrowRight, { className: "h-4 w-4 fill-none" }),
|
|
203
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Next slide" })
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
);
|
|
207
|
+
});
|
|
208
|
+
CarouselNext.displayName = "CarouselNext";
|
|
209
|
+
export {
|
|
210
|
+
Carousel,
|
|
211
|
+
CarouselContent,
|
|
212
|
+
CarouselItem,
|
|
213
|
+
CarouselNext,
|
|
214
|
+
CarouselPrevious,
|
|
215
|
+
useCarousel
|
|
216
|
+
};
|
|
217
|
+
//# sourceMappingURL=carousel.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/carousel.tsx"],
|
|
4
|
+
"sourcesContent": ["import useEmblaCarousel, {\n type UseEmblaCarouselType,\n} from \"embla-carousel-react\";\nimport { ArrowLeft, ArrowRight } from \"lucide-react\";\nimport * as React from \"react\";\nimport { useMemo } from \"react\";\n\nimport { cn } from \"../lib/utils\";\nimport { Button } from \"./button\";\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ninterface CarouselProps {\n opts?: CarouselOptions;\n plugins?: CarouselPlugin;\n orientation?: \"horizontal\" | \"vertical\";\n setApi?: (api: CarouselApi) => void;\n}\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nexport function useCarousel() {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error(\"useCarousel must be used within a <Carousel />\");\n }\n\n return context;\n}\n\nconst Carousel = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & CarouselProps\n>(\n (\n {\n orientation = \"horizontal\",\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n },\n ref\n ) => {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === \"horizontal\" ? \"x\" : \"y\",\n },\n plugins\n );\n\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((carouselApi: CarouselApi) => {\n if (!carouselApi) {\n return;\n }\n\n setCanScrollPrev(carouselApi.canScrollPrev());\n setCanScrollNext(carouselApi.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext]\n );\n\n const carouselContextValue = useMemo(\n () => ({\n carouselRef,\n api,\n opts,\n orientation:\n orientation || (opts?.axis === \"y\" ? \"vertical\" : \"horizontal\"),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }),\n [\n api,\n canScrollNext,\n canScrollPrev,\n carouselRef,\n opts,\n orientation,\n scrollNext,\n scrollPrev,\n ]\n );\n\n React.useEffect(() => {\n if (!(api && setApi)) {\n return;\n }\n\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) {\n return;\n }\n\n onSelect(api);\n api.on(\"reInit\", onSelect);\n api.on(\"select\", onSelect);\n\n return () => {\n api?.off(\"select\", onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider value={carouselContextValue}>\n <div\n aria-roledescription=\"carousel\"\n className={cn(\"relative\", className)}\n onKeyDownCapture={handleKeyDown}\n ref={ref}\n role=\"region\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n }\n);\n\nCarousel.displayName = \"Carousel\";\n\nconst CarouselContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & {\n containerClassName?: string;\n }\n>(({ className, containerClassName, ...props }, ref) => {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div\n className={cn(\"overflow-hidden\", containerClassName)}\n ref={carouselRef}\n >\n <div\n className={cn(\n \"flex\",\n orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\",\n className\n )}\n ref={ref}\n {...props}\n />\n </div>\n );\n});\n\nCarouselContent.displayName = \"CarouselContent\";\n\ninterface CarouselItemProps extends React.HTMLAttributes<HTMLDivElement> {\n useCustomStyles?: boolean;\n}\n\nconst CarouselItem = React.forwardRef<HTMLDivElement, CarouselItemProps>(\n ({ className, useCustomStyles, ...props }, ref) => {\n const { orientation } = useCarousel();\n\n return (\n <div\n aria-roledescription=\"slide\"\n className={cn(\n useCustomStyles\n ? \"min-w-0 shrink-0 grow-0 @[1150px]:basis-1/6 @[1400px]:basis-[14.28%] @[1580px]:basis-[12.5%] @[540px]:basis-1/4 @[900px]:basis-1/5 basis-1/3 overflow-hidden px-0 pr-2\"\n : cn(\n \"min-w-0 shrink-0 grow-0 basis-full\",\n orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\"\n ),\n className\n )}\n ref={ref}\n role=\"group\"\n {...props}\n />\n );\n }\n);\n\nCarouselItem.displayName = \"CarouselItem\";\n\nconst CarouselPrevious = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<typeof Button>\n>(({ className, variant = \"subtle\", size = \"icon\", ...props }, ref) => {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n className={cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"top-1/2 -left-12 -translate-y-1/2\"\n : \"-top-12 left-1/2 -translate-x-1/2 rotate-90\",\n !canScrollPrev && \"!cursor-default\",\n className\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n ref={ref}\n size={size}\n variant={variant}\n {...props}\n >\n <ArrowLeft className=\"h-4 w-4 fill-none\" />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n});\n\nCarouselPrevious.displayName = \"CarouselPrevious\";\n\nconst CarouselNext = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<typeof Button>\n>(({ className, variant = \"subtle\", size = \"icon\", ...props }, ref) => {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n className={cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"top-1/2 -right-12 -translate-y-1/2\"\n : \"-bottom-12 left-1/2 -translate-x-1/2 rotate-90\",\n !canScrollNext && \"!cursor-default\",\n className\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n ref={ref}\n size={size}\n variant={variant}\n {...props}\n >\n <ArrowRight className=\"h-4 w-4 fill-none\" />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n});\n\nCarouselNext.displayName = \"CarouselNext\";\n\nexport {\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselNext,\n CarouselPrevious,\n type CarouselApi,\n type CarouselProps,\n};\n"],
|
|
5
|
+
"mappings": "AAoJQ,cAkFJ,YAlFI;AApJR,OAAO,sBAEA;AACP,SAAS,WAAW,kBAAkB;AACtC,YAAY,WAAW;AACvB,SAAS,eAAe;AAExB,SAAS,UAAU;AACnB,SAAS,cAAc;AAuBvB,MAAM,kBAAkB,MAAM,cAA2C,IAAI;AAEtE,SAAS,cAAc;AAC5B,QAAM,UAAU,MAAM,WAAW,eAAe;AAEhD,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,gDAAgD;AAAA,EAClE;AAEA,SAAO;AACT;AAEA,MAAM,WAAW,MAAM;AAAA,EAIrB,CACE;AAAA,IACE,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,QACG;AACH,UAAM,CAAC,aAAa,GAAG,IAAI;AAAA,MACzB;AAAA,QACE,GAAG;AAAA,QACH,MAAM,gBAAgB,eAAe,MAAM;AAAA,MAC7C;AAAA,MACA;AAAA,IACF;AAEA,UAAM,CAAC,eAAe,gBAAgB,IAAI,MAAM,SAAS,KAAK;AAC9D,UAAM,CAAC,eAAe,gBAAgB,IAAI,MAAM,SAAS,KAAK;AAE9D,UA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AACrE,QAAM,EAAE,aAAa,YAAY,cAAc,IAAI,YAAY;AAE/D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,gBAAgB,eACZ,sCACA;AAAA,QACJ,CAAC,iBAAiB;AAAA,QAClB;AAAA,MACF;AAAA,MACA,UAAU,CAAC;AAAA,MACX,SAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,4BAAC,aAAU,WAAU,qBAAoB;AAAA,QACzC,oBAAC,UAAK,WAAU,WAAU,4BAAc;AAAA;AAAA;AAAA,EAC1C;AAEJ,CAAC;AAED,iBAAiB,cAAc;AAE/B,MAAM,eAAe,MAAM,WAGzB,CAAC,EAAE,WAAW,UAAU,UAAU,OAAO,QAAQ,GAAG,MAAM,GAAG,QAAQ;AACrE,QAAM,EAAE,aAAa,YAAY,cAAc,IAAI,YAAY;AAE/D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,gBAAgB,eACZ,uCACA;AAAA,QACJ,CAAC,iBAAiB;AAAA,QAClB;AAAA,MACF;AAAA,MACA,UAAU,CAAC;AAAA,MACX,SAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,4BAAC,cAAW,WAAU,qBAAoB;AAAA,QAC1C,oBAAC,UAAK,WAAU,WAAU,wBAAU;AAAA;AAAA;AAAA,EACtC;AAEJ,CAAC;AAED,aAAa,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Checkbox as CheckboxPrimitive } from "radix-ui";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
interface CheckboxProps extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> {
|
|
4
|
+
variant?: "default" | "rounded";
|
|
5
|
+
}
|
|
6
|
+
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
interface DummyCheckboxProps extends React.ComponentPropsWithoutRef<"div"> {
|
|
8
|
+
variant?: "default" | "rounded";
|
|
9
|
+
checked?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const DummyCheckbox: React.ForwardRefExoticComponent<DummyCheckboxProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export { Checkbox, DummyCheckbox, type CheckboxProps };
|
|
13
|
+
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/components/checkbox.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAiB/B,UAAU,aACR,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC;IACrE,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACjC;AAED,QAAA,MAAM,QAAQ,yFAeZ,CAAC;AAIH,UAAU,kBAAmB,SAAQ,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC;IACxE,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAGD,QAAA,MAAM,aAAa,2FAkBjB,CAAC;AAIH,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { Check } from "lucide-react";
|
|
4
|
+
import { Checkbox as CheckboxPrimitive } from "radix-ui";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { cn } from "../lib/utils";
|
|
7
|
+
const checkboxVariants = cva(
|
|
8
|
+
"peer h-4 w-4 shrink-0 rounded border border-gray-200 border-solid ring-offset-white hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-pink-500 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-pink-500 data-[state=checked]:text-white data-[state=checked]:hover:bg-pink-600 dark:border-gray-800 dark:ring-offset-gray-950 dark:data-[state=checked]:bg-pink-500 dark:data-[state=checked]:text-white dark:focus-visible:ring-pink-500 dark:hover:bg-gray-900 dark:data-[state=checked]:hover:bg-pink-600",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "",
|
|
13
|
+
rounded: "rounded-full dark:border-gray-500 [&[data-state='checked']]:border-pink-500 [&[data-state='checked']]:bg-pink-500 dark:[&[data-state='checked']]:border-pink-500 dark:[&[data-state='checked']]:bg-pink-500"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
const Checkbox = React.forwardRef(({ className, variant = "default", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
19
|
+
CheckboxPrimitive.Root,
|
|
20
|
+
{
|
|
21
|
+
className: cn(checkboxVariants({ variant }), className),
|
|
22
|
+
ref,
|
|
23
|
+
...props,
|
|
24
|
+
children: /* @__PURE__ */ jsx(
|
|
25
|
+
CheckboxPrimitive.Indicator,
|
|
26
|
+
{
|
|
27
|
+
className: cn("flex items-center justify-center text-current"),
|
|
28
|
+
children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4 fill-none" })
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
));
|
|
33
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
34
|
+
const DummyCheckbox = React.forwardRef(({ className, variant = "default", checked, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
className: cn(checkboxVariants({ variant }), className),
|
|
38
|
+
"data-state": checked ? "checked" : "unchecked",
|
|
39
|
+
ref,
|
|
40
|
+
...props,
|
|
41
|
+
children: /* @__PURE__ */ jsx(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
className: cn(
|
|
45
|
+
checked ? "flex items-center justify-center text-current" : "hidden"
|
|
46
|
+
),
|
|
47
|
+
children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4 fill-none" })
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
));
|
|
52
|
+
DummyCheckbox.displayName = "DummyCheckbox";
|
|
53
|
+
export {
|
|
54
|
+
Checkbox,
|
|
55
|
+
DummyCheckbox
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=checkbox.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/checkbox.tsx"],
|
|
4
|
+
"sourcesContent": ["import { cva } from \"class-variance-authority\";\nimport { Check } from \"lucide-react\";\nimport { Checkbox as CheckboxPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { cn } from \"../lib/utils\";\n\nconst checkboxVariants = cva(\n \"peer h-4 w-4 shrink-0 rounded border border-gray-200 border-solid ring-offset-white hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-pink-500 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-pink-500 data-[state=checked]:text-white data-[state=checked]:hover:bg-pink-600 dark:border-gray-800 dark:ring-offset-gray-950 dark:data-[state=checked]:bg-pink-500 dark:data-[state=checked]:text-white dark:focus-visible:ring-pink-500 dark:hover:bg-gray-900 dark:data-[state=checked]:hover:bg-pink-600\",\n {\n variants: {\n variant: {\n default: \"\",\n rounded:\n \"rounded-full dark:border-gray-500 [&[data-state='checked']]:border-pink-500 [&[data-state='checked']]:bg-pink-500 dark:[&[data-state='checked']]:border-pink-500 dark:[&[data-state='checked']]:bg-pink-500\",\n },\n },\n }\n);\n\ninterface CheckboxProps\n extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> {\n variant?: \"default\" | \"rounded\";\n}\n\nconst Checkbox = React.forwardRef<\n React.ElementRef<typeof CheckboxPrimitive.Root>,\n CheckboxProps\n>(({ className, variant = \"default\", ...props }, ref) => (\n <CheckboxPrimitive.Root\n className={cn(checkboxVariants({ variant }), className)}\n ref={ref}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n className={cn(\"flex items-center justify-center text-current\")}\n >\n <Check className=\"h-4 w-4 fill-none\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n));\n\nCheckbox.displayName = CheckboxPrimitive.Root.displayName;\n\ninterface DummyCheckboxProps extends React.ComponentPropsWithoutRef<\"div\"> {\n variant?: \"default\" | \"rounded\";\n checked?: boolean;\n}\n\n// Looks like the Checkbox component, but doesn't have any functionality\nconst DummyCheckbox = React.forwardRef<\n React.ElementRef<\"div\">,\n DummyCheckboxProps\n>(({ className, variant = \"default\", checked, ...props }, ref) => (\n <div\n className={cn(checkboxVariants({ variant }), className)}\n data-state={checked ? \"checked\" : \"unchecked\"}\n ref={ref}\n {...props}\n >\n <div\n className={cn(\n checked ? \"flex items-center justify-center text-current\" : \"hidden\"\n )}\n >\n <Check className=\"h-4 w-4 fill-none\" />\n </div>\n </div>\n));\n\nDummyCheckbox.displayName = \"DummyCheckbox\";\n\nexport { Checkbox, DummyCheckbox, type CheckboxProps };\n"],
|
|
5
|
+
"mappings": "AAqCM;AArCN,SAAS,WAAW;AACpB,SAAS,aAAa;AACtB,SAAS,YAAY,yBAAyB;AAC9C,YAAY,WAAW;AAEvB,SAAS,UAAU;AAEnB,MAAM,mBAAmB;AAAA,EACvB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,SACE;AAAA,MACJ;AAAA,IACF;AAAA,EACF;AACF;AAOA,MAAM,WAAW,MAAM,WAGrB,CAAC,EAAE,WAAW,UAAU,WAAW,GAAG,MAAM,GAAG,QAC/C;AAAA,EAAC,kBAAkB;AAAA,EAAlB;AAAA,IACC,WAAW,GAAG,iBAAiB,EAAE,QAAQ,CAAC,GAAG,SAAS;AAAA,IACtD;AAAA,IACC,GAAG;AAAA,IAEJ;AAAA,MAAC,kBAAkB;AAAA,MAAlB;AAAA,QACC,WAAW,GAAG,+CAA+C;AAAA,QAE7D,8BAAC,SAAM,WAAU,qBAAoB;AAAA;AAAA,IACvC;AAAA;AACF,CACD;AAED,SAAS,cAAc,kBAAkB,KAAK;AAQ9C,MAAM,gBAAgB,MAAM,WAG1B,CAAC,EAAE,WAAW,UAAU,WAAW,SAAS,GAAG,MAAM,GAAG,QACxD;AAAA,EAAC;AAAA;AAAA,IACC,WAAW,GAAG,iBAAiB,EAAE,QAAQ,CAAC,GAAG,SAAS;AAAA,IACtD,cAAY,UAAU,YAAY;AAAA,IAClC;AAAA,IACC,GAAG;AAAA,IAEJ;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,UACT,UAAU,kDAAkD;AAAA,QAC9D;AAAA,QAEA,8BAAC,SAAM,WAAU,qBAAoB;AAAA;AAAA,IACvC;AAAA;AACF,CACD;AAED,cAAc,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const ContextMenu: React.FC<ContextMenuPrimitive.ContextMenuProps>;
|
|
4
|
+
declare const ContextMenuTrigger: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuTriggerProps & React.RefAttributes<HTMLSpanElement>>;
|
|
5
|
+
declare const ContextMenuGroup: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const ContextMenuPortal: React.FC<ContextMenuPrimitive.ContextMenuPortalProps>;
|
|
7
|
+
declare const ContextMenuSub: React.FC<ContextMenuPrimitive.ContextMenuSubProps>;
|
|
8
|
+
declare const ContextMenuRadioGroup: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const ContextMenuSubTrigger: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
10
|
+
inset?: boolean;
|
|
11
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const ContextMenuSubContent: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const ContextMenuContent: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
declare const ContextMenuItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
15
|
+
inset?: boolean;
|
|
16
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const ContextMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const ContextMenuRadioItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const ContextMenuLabel: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
20
|
+
inset?: boolean;
|
|
21
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
declare const ContextMenuSeparator: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
declare const ContextMenuShortcut: {
|
|
24
|
+
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
export { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, };
|
|
28
|
+
//# sourceMappingURL=context-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../src/components/context-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;AAErE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,QAAA,MAAM,WAAW,iDAA4B,CAAC;AAE9C,QAAA,MAAM,kBAAkB,sHAA+B,CAAC;AAExD,QAAA,MAAM,gBAAgB,mHAA6B,CAAC;AAEpD,QAAA,MAAM,iBAAiB,uDAA8B,CAAC;AAEtD,QAAA,MAAM,cAAc,oDAA2B,CAAC;AAEhD,QAAA,MAAM,qBAAqB,wHAAkC,CAAC;AAE9D,QAAA,MAAM,qBAAqB;YAGf,OAAO;wCAejB,CAAC;AAGH,QAAA,MAAM,qBAAqB,2KAYzB,CAAC;AAGH,QAAA,MAAM,kBAAkB,wKAetB,CAAC;AAGH,QAAA,MAAM,eAAe;YAGT,OAAO;wCAajB,CAAC;AAGH,QAAA,MAAM,uBAAuB,6KAoB3B,CAAC;AAIH,QAAA,MAAM,oBAAoB,0KAmBxB,CAAC;AAGH,QAAA,MAAM,gBAAgB;YAGV,OAAO;wCAYjB,CAAC;AAGH,QAAA,MAAM,oBAAoB,0KASxB,CAAC;AAGH,QAAA,MAAM,mBAAmB;8BAGtB,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;;CAQvC,CAAC;AAGF,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,GACnB,CAAC"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
3
|
+
import { Check, ChevronRight, Circle } from "lucide-react";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
|
+
const ContextMenu = ContextMenuPrimitive.Root;
|
|
7
|
+
const ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
8
|
+
const ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
9
|
+
const ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
10
|
+
const ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
11
|
+
const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
12
|
+
const ContextMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
13
|
+
ContextMenuPrimitive.SubTrigger,
|
|
14
|
+
{
|
|
15
|
+
className: cn(
|
|
16
|
+
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-gray-50 focus:text-gray-950 data-[state=open]:bg-gray-50 data-[state=open]:text-gray-950 dark:data-[state=open]:bg-gray-900 dark:data-[state=open]:text-white dark:focus:bg-gray-900 dark:focus:text-white",
|
|
17
|
+
inset && "pl-8",
|
|
18
|
+
className
|
|
19
|
+
),
|
|
20
|
+
ref,
|
|
21
|
+
...props,
|
|
22
|
+
children: [
|
|
23
|
+
children,
|
|
24
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto h-4 w-4" })
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
));
|
|
28
|
+
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
29
|
+
const ContextMenuSubContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
30
|
+
ContextMenuPrimitive.SubContent,
|
|
31
|
+
{
|
|
32
|
+
className: cn(
|
|
33
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-[--radix-context-menu-content-transform-origin] overflow-hidden rounded-md border border-gray-150 bg-white p-1 text-gray-950 shadow-md data-[state=open]:animate-in dark:border-gray-800 dark:bg-gray-950 dark:text-gray-50",
|
|
34
|
+
className
|
|
35
|
+
),
|
|
36
|
+
ref,
|
|
37
|
+
...props
|
|
38
|
+
}
|
|
39
|
+
));
|
|
40
|
+
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
|
|
41
|
+
const ContextMenuContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
42
|
+
ContextMenuPrimitive.Content,
|
|
43
|
+
{
|
|
44
|
+
className: cn(
|
|
45
|
+
// Browser-style context menu styling - slim and clean
|
|
46
|
+
"data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1 z-50 min-w-[8rem] origin-[--radix-context-menu-content-transform-origin] overflow-hidden rounded-lg border border-gray-150 border-solid bg-white p-2 text-gray-950 shadow-lg outline-none data-[state=open]:animate-in data-[state=closed]:opacity-0 data-[state=open]:opacity-100 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-50",
|
|
47
|
+
className
|
|
48
|
+
),
|
|
49
|
+
ref,
|
|
50
|
+
...props
|
|
51
|
+
}
|
|
52
|
+
) }));
|
|
53
|
+
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
|
54
|
+
const ContextMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
55
|
+
ContextMenuPrimitive.Item,
|
|
56
|
+
{
|
|
57
|
+
className: cn(
|
|
58
|
+
// Browser-style menu item - slim padding, subtle hover
|
|
59
|
+
"relative flex cursor-default select-none items-center rounded px-2 py-1 text-sm outline-none transition-colors hover:bg-gray-50 focus:bg-gray-50 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-gray-800 dark:hover:bg-gray-800",
|
|
60
|
+
inset && "pl-8",
|
|
61
|
+
className
|
|
62
|
+
),
|
|
63
|
+
ref,
|
|
64
|
+
...props
|
|
65
|
+
}
|
|
66
|
+
));
|
|
67
|
+
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
|
68
|
+
const ContextMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
69
|
+
ContextMenuPrimitive.CheckboxItem,
|
|
70
|
+
{
|
|
71
|
+
checked,
|
|
72
|
+
className: cn(
|
|
73
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none focus:bg-gray-50 focus:text-gray-950 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-gray-900 dark:focus:text-white",
|
|
74
|
+
className
|
|
75
|
+
),
|
|
76
|
+
ref,
|
|
77
|
+
...props,
|
|
78
|
+
children: [
|
|
79
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }) }),
|
|
80
|
+
children
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
));
|
|
84
|
+
ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
|
|
85
|
+
const ContextMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
86
|
+
ContextMenuPrimitive.RadioItem,
|
|
87
|
+
{
|
|
88
|
+
className: cn(
|
|
89
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none focus:bg-gray-50 focus:text-gray-950 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-gray-900 dark:focus:text-white",
|
|
90
|
+
className
|
|
91
|
+
),
|
|
92
|
+
ref,
|
|
93
|
+
...props,
|
|
94
|
+
children: [
|
|
95
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Circle, { className: "h-2 w-2 fill-current" }) }) }),
|
|
96
|
+
children
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
));
|
|
100
|
+
ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
|
|
101
|
+
const ContextMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
102
|
+
ContextMenuPrimitive.Label,
|
|
103
|
+
{
|
|
104
|
+
className: cn(
|
|
105
|
+
"px-2 py-1.5 font-semibold text-gray-950 text-sm dark:text-gray-50",
|
|
106
|
+
inset && "pl-8",
|
|
107
|
+
className
|
|
108
|
+
),
|
|
109
|
+
ref,
|
|
110
|
+
...props
|
|
111
|
+
}
|
|
112
|
+
));
|
|
113
|
+
ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
|
|
114
|
+
const ContextMenuSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
115
|
+
ContextMenuPrimitive.Separator,
|
|
116
|
+
{
|
|
117
|
+
className: cn("-mx-1 my-1 h-px bg-gray-150 dark:bg-gray-800", className),
|
|
118
|
+
ref,
|
|
119
|
+
...props
|
|
120
|
+
}
|
|
121
|
+
));
|
|
122
|
+
ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
|
|
123
|
+
const ContextMenuShortcut = ({
|
|
124
|
+
className,
|
|
125
|
+
...props
|
|
126
|
+
}) => /* @__PURE__ */ jsx(
|
|
127
|
+
"span",
|
|
128
|
+
{
|
|
129
|
+
className: cn(
|
|
130
|
+
"ml-auto text-gray-600 text-xs tracking-widest dark:text-gray-500",
|
|
131
|
+
className
|
|
132
|
+
),
|
|
133
|
+
...props
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
ContextMenuShortcut.displayName = "ContextMenuShortcut";
|
|
137
|
+
export {
|
|
138
|
+
ContextMenu,
|
|
139
|
+
ContextMenuCheckboxItem,
|
|
140
|
+
ContextMenuContent,
|
|
141
|
+
ContextMenuGroup,
|
|
142
|
+
ContextMenuItem,
|
|
143
|
+
ContextMenuLabel,
|
|
144
|
+
ContextMenuPortal,
|
|
145
|
+
ContextMenuRadioGroup,
|
|
146
|
+
ContextMenuRadioItem,
|
|
147
|
+
ContextMenuSeparator,
|
|
148
|
+
ContextMenuShortcut,
|
|
149
|
+
ContextMenuSub,
|
|
150
|
+
ContextMenuSubContent,
|
|
151
|
+
ContextMenuSubTrigger,
|
|
152
|
+
ContextMenuTrigger
|
|
153
|
+
};
|
|
154
|
+
//# sourceMappingURL=context-menu.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/context-menu.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\nimport { Check, ChevronRight, Circle } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { cn } from \"../lib/utils\";\n\nconst ContextMenu = ContextMenuPrimitive.Root;\n\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\n\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\n\nconst ContextMenuPortal = ContextMenuPrimitive.Portal;\n\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\n\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\n\nconst ContextMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <ContextMenuPrimitive.SubTrigger\n className={cn(\n \"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-gray-50 focus:text-gray-950 data-[state=open]:bg-gray-50 data-[state=open]:text-gray-950 dark:data-[state=open]:bg-gray-900 dark:data-[state=open]:text-white dark:focus:bg-gray-900 dark:focus:text-white\",\n inset && \"pl-8\",\n className\n )}\n ref={ref}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto h-4 w-4\" />\n </ContextMenuPrimitive.SubTrigger>\n));\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\n\nconst ContextMenuSubContent = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.SubContent\n className={cn(\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-[--radix-context-menu-content-transform-origin] overflow-hidden rounded-md border border-gray-150 bg-white p-1 text-gray-950 shadow-md data-[state=open]:animate-in dark:border-gray-800 dark:bg-gray-950 dark:text-gray-50\",\n className\n )}\n ref={ref}\n {...props}\n />\n));\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\n\nconst ContextMenuContent = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n className={cn(\n // Browser-style context menu styling - slim and clean\n \"data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1 z-50 min-w-[8rem] origin-[--radix-context-menu-content-transform-origin] overflow-hidden rounded-lg border border-gray-150 border-solid bg-white p-2 text-gray-950 shadow-lg outline-none data-[state=open]:animate-in data-[state=closed]:opacity-0 data-[state=open]:opacity-100 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-50\",\n className\n )}\n ref={ref}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n));\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\n\nconst ContextMenuItem = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Item\n className={cn(\n // Browser-style menu item - slim padding, subtle hover\n \"relative flex cursor-default select-none items-center rounded px-2 py-1 text-sm outline-none transition-colors hover:bg-gray-50 focus:bg-gray-50 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-gray-800 dark:hover:bg-gray-800\",\n inset && \"pl-8\",\n className\n )}\n ref={ref}\n {...props}\n />\n));\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\n\nconst ContextMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <ContextMenuPrimitive.CheckboxItem\n checked={checked}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none focus:bg-gray-50 focus:text-gray-950 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-gray-900 dark:focus:text-white\",\n className\n )}\n ref={ref}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n));\nContextMenuCheckboxItem.displayName =\n ContextMenuPrimitive.CheckboxItem.displayName;\n\nconst ContextMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <ContextMenuPrimitive.RadioItem\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none focus:bg-gray-50 focus:text-gray-950 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-gray-900 dark:focus:text-white\",\n className\n )}\n ref={ref}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n));\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\n\nconst ContextMenuLabel = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Label\n className={cn(\n \"px-2 py-1.5 font-semibold text-gray-950 text-sm dark:text-gray-50\",\n inset && \"pl-8\",\n className\n )}\n ref={ref}\n {...props}\n />\n));\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\n\nconst ContextMenuSeparator = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Separator\n className={cn(\"-mx-1 my-1 h-px bg-gray-150 dark:bg-gray-800\", className)}\n ref={ref}\n {...props}\n />\n));\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\n\nconst ContextMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span\n className={cn(\n \"ml-auto text-gray-600 text-xs tracking-widest dark:text-gray-500\",\n className\n )}\n {...props}\n />\n);\nContextMenuShortcut.displayName = \"ContextMenuShortcut\";\n\nexport {\n ContextMenu,\n ContextMenuCheckboxItem,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuItem,\n ContextMenuLabel,\n ContextMenuPortal,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuTrigger,\n};\n"],
|
|
5
|
+
"mappings": "AAwBE,SAUE,KAVF;AAxBF,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,EAAC,qBAAqB;AAAA,EAArB;AAAA,IACC,WAAW,GAAG,gDAAgD,SAAS;AAAA,IACvE;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,qBAAqB,cAAc,qBAAqB,UAAU;AAElE,MAAM,sBAAsB,CAAC;AAAA,EAC3B;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA;AAAA,IACC,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN;AAEF,oBAAoB,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
4
|
+
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
6
|
+
declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const DialogHeader: {
|
|
10
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
declare const DialogFooter: {
|
|
14
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
displayName: string;
|
|
16
|
+
};
|
|
17
|
+
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
18
|
+
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
19
|
+
export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
|
|
20
|
+
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/components/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,QAAA,MAAM,MAAM,uCAAuB,CAAC;AAEpC,QAAA,MAAM,aAAa,8GAA0B,CAAC;AAE9C,QAAA,MAAM,YAAY,6CAAyB,CAAC;AAE5C,QAAA,MAAM,WAAW,4GAAwB,CAAC;AAE1C,QAAA,MAAM,aAAa,8JAYjB,CAAC;AAGH,QAAA,MAAM,aAAa,8JA0BjB,CAAC;AAGH,QAAA,MAAM,YAAY;8BAGf,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;CAQtC,CAAC;AAGF,QAAA,MAAM,YAAY;8BAGf,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;CAQtC,CAAC;AAGF,QAAA,MAAM,WAAW,oKAOf,CAAC;AAGH,QAAA,MAAM,iBAAiB,8KAOrB,CAAC;AAGH,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,CAAC"}
|