@prototyperco/ui 0.5.0-alpha.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion.cjs +154 -0
- package/dist/components/accordion.cjs.map +1 -0
- package/dist/components/accordion.d.cts +14 -0
- package/dist/components/accordion.d.ts +14 -0
- package/dist/components/accordion.js +127 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert-dialog.cjs +324 -0
- package/dist/components/alert-dialog.cjs.map +1 -0
- package/dist/components/alert-dialog.d.cts +30 -0
- package/dist/components/alert-dialog.d.ts +30 -0
- package/dist/components/alert-dialog.js +289 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert.cjs +105 -0
- package/dist/components/alert.cjs.map +1 -0
- package/dist/components/alert.d.cts +17 -0
- package/dist/components/alert.d.ts +17 -0
- package/dist/components/alert.js +78 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/autocomplete.cjs +512 -0
- package/dist/components/autocomplete.cjs.map +1 -0
- package/dist/components/autocomplete.d.cts +31 -0
- package/dist/components/autocomplete.d.ts +31 -0
- package/dist/components/autocomplete.js +472 -0
- package/dist/components/autocomplete.js.map +1 -0
- package/dist/components/avatar.cjs +144 -0
- package/dist/components/avatar.cjs.map +1 -0
- package/dist/components/avatar.d.cts +18 -0
- package/dist/components/avatar.d.ts +18 -0
- package/dist/components/avatar.js +115 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.cjs +81 -0
- package/dist/components/badge.cjs.map +1 -0
- package/dist/components/badge.d.cts +13 -0
- package/dist/components/badge.d.ts +13 -0
- package/dist/components/badge.js +56 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/breadcrumb.cjs +142 -0
- package/dist/components/breadcrumb.cjs.map +1 -0
- package/dist/components/breadcrumb.d.cts +20 -0
- package/dist/components/breadcrumb.d.ts +20 -0
- package/dist/components/breadcrumb.js +112 -0
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/button.cjs +145 -0
- package/dist/components/button.cjs.map +1 -0
- package/dist/components/button.d.cts +16 -0
- package/dist/components/button.d.ts +16 -0
- package/dist/components/button.js +120 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/card.cjs +141 -0
- package/dist/components/card.cjs.map +1 -0
- package/dist/components/card.d.cts +23 -0
- package/dist/components/card.d.ts +23 -0
- package/dist/components/card.js +111 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/checkbox-group.cjs +56 -0
- package/dist/components/checkbox-group.cjs.map +1 -0
- package/dist/components/checkbox-group.d.cts +8 -0
- package/dist/components/checkbox-group.d.ts +8 -0
- package/dist/components/checkbox-group.js +32 -0
- package/dist/components/checkbox-group.js.map +1 -0
- package/dist/components/checkbox.cjs +152 -0
- package/dist/components/checkbox.cjs.map +1 -0
- package/dist/components/checkbox.d.cts +12 -0
- package/dist/components/checkbox.d.ts +12 -0
- package/dist/components/checkbox.js +126 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/collapsible.cjs +89 -0
- package/dist/components/collapsible.cjs.map +1 -0
- package/dist/components/collapsible.d.cts +12 -0
- package/dist/components/collapsible.d.ts +12 -0
- package/dist/components/collapsible.js +63 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/color-picker.cjs +983 -0
- package/dist/components/color-picker.cjs.map +1 -0
- package/dist/components/color-picker.d.cts +41 -0
- package/dist/components/color-picker.d.ts +41 -0
- package/dist/components/color-picker.js +939 -0
- package/dist/components/color-picker.js.map +1 -0
- package/dist/components/columns.cjs +163 -0
- package/dist/components/columns.cjs.map +1 -0
- package/dist/components/columns.d.cts +16 -0
- package/dist/components/columns.d.ts +16 -0
- package/dist/components/columns.js +136 -0
- package/dist/components/columns.js.map +1 -0
- package/dist/components/combobox.cjs +633 -0
- package/dist/components/combobox.cjs.map +1 -0
- package/dist/components/combobox.d.cts +40 -0
- package/dist/components/combobox.d.ts +40 -0
- package/dist/components/combobox.js +576 -0
- package/dist/components/combobox.js.map +1 -0
- package/dist/components/command-palette.cjs +370 -0
- package/dist/components/command-palette.cjs.map +1 -0
- package/dist/components/command-palette.d.cts +42 -0
- package/dist/components/command-palette.d.ts +42 -0
- package/dist/components/command-palette.js +329 -0
- package/dist/components/command-palette.js.map +1 -0
- package/dist/components/container.cjs +80 -0
- package/dist/components/container.cjs.map +1 -0
- package/dist/components/container.d.cts +27 -0
- package/dist/components/container.d.ts +27 -0
- package/dist/components/container.js +54 -0
- package/dist/components/container.js.map +1 -0
- package/dist/components/context-menu.cjs +309 -0
- package/dist/components/context-menu.cjs.map +1 -0
- package/dist/components/context-menu.d.cts +37 -0
- package/dist/components/context-menu.d.ts +37 -0
- package/dist/components/context-menu.js +271 -0
- package/dist/components/context-menu.js.map +1 -0
- package/dist/components/dialog.cjs +319 -0
- package/dist/components/dialog.cjs.map +1 -0
- package/dist/components/dialog.d.cts +32 -0
- package/dist/components/dialog.d.ts +32 -0
- package/dist/components/dialog.js +285 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/drawer.cjs +185 -0
- package/dist/components/drawer.cjs.map +1 -0
- package/dist/components/drawer.d.cts +32 -0
- package/dist/components/drawer.d.ts +32 -0
- package/dist/components/drawer.js +151 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/field.cjs +334 -0
- package/dist/components/field.cjs.map +1 -0
- package/dist/components/field.d.cts +39 -0
- package/dist/components/field.d.ts +39 -0
- package/dist/components/field.js +299 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/fieldset.cjs +75 -0
- package/dist/components/fieldset.cjs.map +1 -0
- package/dist/components/fieldset.d.cts +12 -0
- package/dist/components/fieldset.d.ts +12 -0
- package/dist/components/fieldset.js +50 -0
- package/dist/components/fieldset.js.map +1 -0
- package/dist/components/form.cjs +52 -0
- package/dist/components/form.cjs.map +1 -0
- package/dist/components/form.d.cts +8 -0
- package/dist/components/form.d.ts +8 -0
- package/dist/components/form.js +28 -0
- package/dist/components/form.js.map +1 -0
- package/dist/components/input-group.cjs +338 -0
- package/dist/components/input-group.cjs.map +1 -0
- package/dist/components/input-group.d.cts +27 -0
- package/dist/components/input-group.d.ts +27 -0
- package/dist/components/input-group.js +307 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input.cjs +63 -0
- package/dist/components/input.cjs.map +1 -0
- package/dist/components/input.d.cts +8 -0
- package/dist/components/input.d.ts +8 -0
- package/dist/components/input.js +39 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/label.cjs +54 -0
- package/dist/components/label.cjs.map +1 -0
- package/dist/components/label.d.cts +8 -0
- package/dist/components/label.d.ts +8 -0
- package/dist/components/label.js +28 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/menu.cjs +305 -0
- package/dist/components/menu.cjs.map +1 -0
- package/dist/components/menu.d.cts +37 -0
- package/dist/components/menu.d.ts +37 -0
- package/dist/components/menu.js +267 -0
- package/dist/components/menu.js.map +1 -0
- package/dist/components/menubar.cjs +503 -0
- package/dist/components/menubar.cjs.map +1 -0
- package/dist/components/menubar.d.cts +37 -0
- package/dist/components/menubar.d.ts +37 -0
- package/dist/components/menubar.js +464 -0
- package/dist/components/menubar.js.map +1 -0
- package/dist/components/meter.cjs +152 -0
- package/dist/components/meter.cjs.map +1 -0
- package/dist/components/meter.d.cts +23 -0
- package/dist/components/meter.d.ts +23 -0
- package/dist/components/meter.js +122 -0
- package/dist/components/meter.js.map +1 -0
- package/dist/components/navigation-menu.cjs +315 -0
- package/dist/components/navigation-menu.cjs.map +1 -0
- package/dist/components/navigation-menu.d.cts +22 -0
- package/dist/components/navigation-menu.d.ts +22 -0
- package/dist/components/navigation-menu.js +283 -0
- package/dist/components/navigation-menu.js.map +1 -0
- package/dist/components/number-field.cjs +217 -0
- package/dist/components/number-field.cjs.map +1 -0
- package/dist/components/number-field.d.cts +23 -0
- package/dist/components/number-field.d.ts +23 -0
- package/dist/components/number-field.js +185 -0
- package/dist/components/number-field.js.map +1 -0
- package/dist/components/popover.cjs +125 -0
- package/dist/components/popover.cjs.map +1 -0
- package/dist/components/popover.d.cts +16 -0
- package/dist/components/popover.d.ts +16 -0
- package/dist/components/popover.js +96 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/preview-card.cjs +86 -0
- package/dist/components/preview-card.cjs.map +1 -0
- package/dist/components/preview-card.d.cts +12 -0
- package/dist/components/preview-card.d.ts +12 -0
- package/dist/components/preview-card.js +60 -0
- package/dist/components/preview-card.js.map +1 -0
- package/dist/components/progress.cjs +167 -0
- package/dist/components/progress.cjs.map +1 -0
- package/dist/components/progress.d.cts +23 -0
- package/dist/components/progress.d.ts +23 -0
- package/dist/components/progress.js +137 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-group.cjs +98 -0
- package/dist/components/radio-group.cjs.map +1 -0
- package/dist/components/radio-group.d.cts +11 -0
- package/dist/components/radio-group.d.ts +11 -0
- package/dist/components/radio-group.js +73 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/resizable-panel.cjs +91 -0
- package/dist/components/resizable-panel.cjs.map +1 -0
- package/dist/components/resizable-panel.d.cts +14 -0
- package/dist/components/resizable-panel.d.ts +14 -0
- package/dist/components/resizable-panel.js +69 -0
- package/dist/components/resizable-panel.js.map +1 -0
- package/dist/components/row.cjs +94 -0
- package/dist/components/row.cjs.map +1 -0
- package/dist/components/row.d.cts +27 -0
- package/dist/components/row.d.ts +27 -0
- package/dist/components/row.js +68 -0
- package/dist/components/row.js.map +1 -0
- package/dist/components/scroll-area.cjs +96 -0
- package/dist/components/scroll-area.cjs.map +1 -0
- package/dist/components/scroll-area.d.cts +10 -0
- package/dist/components/scroll-area.d.ts +10 -0
- package/dist/components/scroll-area.js +71 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/section.cjs +104 -0
- package/dist/components/section.cjs.map +1 -0
- package/dist/components/section.d.cts +26 -0
- package/dist/components/section.d.ts +26 -0
- package/dist/components/section.js +79 -0
- package/dist/components/section.js.map +1 -0
- package/dist/components/segmented-control.cjs +117 -0
- package/dist/components/segmented-control.cjs.map +1 -0
- package/dist/components/segmented-control.d.cts +16 -0
- package/dist/components/segmented-control.d.ts +16 -0
- package/dist/components/segmented-control.js +91 -0
- package/dist/components/segmented-control.js.map +1 -0
- package/dist/components/select.cjs +273 -0
- package/dist/components/select.cjs.map +1 -0
- package/dist/components/select.d.cts +26 -0
- package/dist/components/select.d.ts +26 -0
- package/dist/components/select.js +239 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.cjs +60 -0
- package/dist/components/separator.cjs.map +1 -0
- package/dist/components/separator.d.cts +8 -0
- package/dist/components/separator.d.ts +8 -0
- package/dist/components/separator.js +36 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/skeleton.cjs +54 -0
- package/dist/components/skeleton.cjs.map +1 -0
- package/dist/components/skeleton.d.cts +8 -0
- package/dist/components/skeleton.d.ts +8 -0
- package/dist/components/skeleton.js +28 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/slider.cjs +221 -0
- package/dist/components/slider.cjs.map +1 -0
- package/dist/components/slider.d.cts +16 -0
- package/dist/components/slider.d.ts +16 -0
- package/dist/components/slider.js +182 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/spinner.cjs +97 -0
- package/dist/components/spinner.cjs.map +1 -0
- package/dist/components/spinner.d.cts +13 -0
- package/dist/components/spinner.d.ts +13 -0
- package/dist/components/spinner.js +72 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/switch.cjs +177 -0
- package/dist/components/switch.cjs.map +1 -0
- package/dist/components/switch.d.cts +22 -0
- package/dist/components/switch.d.ts +22 -0
- package/dist/components/switch.js +139 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/tabs.cjs +123 -0
- package/dist/components/tabs.cjs.map +1 -0
- package/dist/components/tabs.d.cts +19 -0
- package/dist/components/tabs.d.ts +19 -0
- package/dist/components/tabs.js +95 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/text-field.cjs +290 -0
- package/dist/components/text-field.cjs.map +1 -0
- package/dist/components/text-field.d.cts +27 -0
- package/dist/components/text-field.d.ts +27 -0
- package/dist/components/text-field.js +262 -0
- package/dist/components/text-field.js.map +1 -0
- package/dist/components/textarea.cjs +60 -0
- package/dist/components/textarea.cjs.map +1 -0
- package/dist/components/textarea.d.cts +8 -0
- package/dist/components/textarea.d.ts +8 -0
- package/dist/components/textarea.js +34 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/toast.cjs +167 -0
- package/dist/components/toast.cjs.map +1 -0
- package/dist/components/toast.d.cts +28 -0
- package/dist/components/toast.d.ts +28 -0
- package/dist/components/toast.js +147 -0
- package/dist/components/toast.js.map +1 -0
- package/dist/components/toggle-group.cjs +171 -0
- package/dist/components/toggle-group.cjs.map +1 -0
- package/dist/components/toggle-group.d.cts +18 -0
- package/dist/components/toggle-group.d.ts +18 -0
- package/dist/components/toggle-group.js +136 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.cjs +92 -0
- package/dist/components/toggle.cjs.map +1 -0
- package/dist/components/toggle.d.cts +14 -0
- package/dist/components/toggle.d.ts +14 -0
- package/dist/components/toggle.js +67 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/toolbar.cjs +160 -0
- package/dist/components/toolbar.cjs.map +1 -0
- package/dist/components/toolbar.d.cts +14 -0
- package/dist/components/toolbar.d.ts +14 -0
- package/dist/components/toolbar.js +131 -0
- package/dist/components/toolbar.js.map +1 -0
- package/dist/components/tooltip.cjs +116 -0
- package/dist/components/tooltip.cjs.map +1 -0
- package/dist/components/tooltip.d.cts +13 -0
- package/dist/components/tooltip.d.ts +13 -0
- package/dist/components/tooltip.js +89 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/components/tree-view.cjs +472 -0
- package/dist/components/tree-view.cjs.map +1 -0
- package/dist/components/tree-view.d.cts +33 -0
- package/dist/components/tree-view.d.ts +33 -0
- package/dist/components/tree-view.js +435 -0
- package/dist/components/tree-view.js.map +1 -0
- package/dist/index.cjs +11 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +101 -903
- package/dist/index.d.ts +101 -903
- package/dist/index.js +4 -6
- package/dist/index.js.map +1 -1
- package/dist/lib/color-utils.cjs +315 -0
- package/dist/lib/color-utils.cjs.map +1 -0
- package/dist/lib/color-utils.d.cts +24 -0
- package/dist/lib/color-utils.d.ts +24 -0
- package/dist/lib/color-utils.js +280 -0
- package/dist/lib/color-utils.js.map +1 -0
- package/dist/lib/utils.cjs +35 -0
- package/dist/lib/utils.cjs.map +1 -0
- package/dist/lib/utils.d.cts +5 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.js +10 -0
- package/dist/lib/utils.js.map +1 -0
- package/package.json +24 -5
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/preview-card.tsx
|
|
4
|
+
import { PreviewCard as PreviewCardPrimitive } from "@base-ui/react/preview-card";
|
|
5
|
+
|
|
6
|
+
// src/lib/utils.ts
|
|
7
|
+
import { clsx } from "clsx";
|
|
8
|
+
import { twMerge } from "tailwind-merge";
|
|
9
|
+
function cn(...inputs) {
|
|
10
|
+
return twMerge(clsx(inputs));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// src/components/preview-card.tsx
|
|
14
|
+
import { jsx } from "react/jsx-runtime";
|
|
15
|
+
function HoverCard({ ...props }) {
|
|
16
|
+
return /* @__PURE__ */ jsx(PreviewCardPrimitive.Root, { "data-slot": "hover-card", ...props });
|
|
17
|
+
}
|
|
18
|
+
function HoverCardTrigger({ ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(PreviewCardPrimitive.Trigger, { "data-slot": "hover-card-trigger", ...props });
|
|
20
|
+
}
|
|
21
|
+
function HoverCardContent({
|
|
22
|
+
className,
|
|
23
|
+
side = "bottom",
|
|
24
|
+
sideOffset = 4,
|
|
25
|
+
align = "center",
|
|
26
|
+
alignOffset = 4,
|
|
27
|
+
...props
|
|
28
|
+
}) {
|
|
29
|
+
return /* @__PURE__ */ jsx(PreviewCardPrimitive.Portal, { "data-slot": "hover-card-portal", children: /* @__PURE__ */ jsx(
|
|
30
|
+
PreviewCardPrimitive.Positioner,
|
|
31
|
+
{
|
|
32
|
+
align,
|
|
33
|
+
alignOffset,
|
|
34
|
+
side,
|
|
35
|
+
sideOffset,
|
|
36
|
+
className: "isolate z-50",
|
|
37
|
+
children: /* @__PURE__ */ jsx(
|
|
38
|
+
PreviewCardPrimitive.Popup,
|
|
39
|
+
{
|
|
40
|
+
"data-slot": "hover-card-content",
|
|
41
|
+
className: cn(
|
|
42
|
+
"w-64 origin-(--transform-origin) rounded-lg bg-overlay p-4 text-sm text-overlay-foreground shadow-overlay outline-hidden",
|
|
43
|
+
"data-open:animate-in data-open:duration-100 data-open:[animation-timing-function:var(--ease-out-fluid)] data-closed:animate-out data-closed:duration-100 data-closed:[animation-timing-function:var(--ease-in-quart)] data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95",
|
|
44
|
+
"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 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2",
|
|
45
|
+
"data-entering:will-change-[opacity,transform] data-exiting:will-change-[opacity,transform]",
|
|
46
|
+
"motion-reduce:animate-none motion-reduce:transition-none",
|
|
47
|
+
className
|
|
48
|
+
),
|
|
49
|
+
...props
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
) });
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
HoverCard,
|
|
57
|
+
HoverCardContent,
|
|
58
|
+
HoverCardTrigger
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=preview-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/preview-card.tsx","../../src/lib/utils.ts"],"sourcesContent":["\"use client\";\n\nimport { PreviewCard as PreviewCardPrimitive } from \"@base-ui/react/preview-card\";\n\nimport { cn } from \"../lib/utils\";\n\nfunction HoverCard({ ...props }: PreviewCardPrimitive.Root.Props) {\n return <PreviewCardPrimitive.Root data-slot=\"hover-card\" {...props} />;\n}\n\nfunction HoverCardTrigger({ ...props }: PreviewCardPrimitive.Trigger.Props) {\n return (\n <PreviewCardPrimitive.Trigger data-slot=\"hover-card-trigger\" {...props} />\n );\n}\n\nfunction HoverCardContent({\n className,\n side = \"bottom\",\n sideOffset = 4,\n align = \"center\",\n alignOffset = 4,\n ...props\n}: PreviewCardPrimitive.Popup.Props &\n Pick<\n PreviewCardPrimitive.Positioner.Props,\n \"align\" | \"alignOffset\" | \"side\" | \"sideOffset\"\n >) {\n return (\n <PreviewCardPrimitive.Portal data-slot=\"hover-card-portal\">\n <PreviewCardPrimitive.Positioner\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n className=\"isolate z-50\"\n >\n <PreviewCardPrimitive.Popup\n data-slot=\"hover-card-content\"\n className={cn(\n \"w-64 origin-(--transform-origin) rounded-lg bg-overlay p-4 text-sm text-overlay-foreground shadow-overlay outline-hidden\",\n \"data-open:animate-in data-open:duration-100 data-open:[animation-timing-function:var(--ease-out-fluid)] data-closed:animate-out data-closed:duration-100 data-closed:[animation-timing-function:var(--ease-in-quart)] data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95\",\n \"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 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2\",\n \"data-entering:will-change-[opacity,transform] data-exiting:will-change-[opacity,transform]\",\n \"motion-reduce:animate-none motion-reduce:transition-none\",\n className,\n )}\n {...props}\n />\n </PreviewCardPrimitive.Positioner>\n </PreviewCardPrimitive.Portal>\n );\n}\n\nexport { HoverCard, HoverCardTrigger, HoverCardContent };\n\nexport type HoverCardProps = React.ComponentProps<typeof HoverCard>;\nexport type HoverCardContentProps = React.ComponentProps<\n typeof HoverCardContent\n>;\nexport type HoverCardTriggerProps = React.ComponentProps<\n typeof HoverCardTrigger\n>;\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";;;AAEA,SAAS,eAAe,4BAA4B;;;ACFpD,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADES;AADT,SAAS,UAAU,EAAE,GAAG,MAAM,GAAoC;AAChE,SAAO,oBAAC,qBAAqB,MAArB,EAA0B,aAAU,cAAc,GAAG,OAAO;AACtE;AAEA,SAAS,iBAAiB,EAAE,GAAG,MAAM,GAAuC;AAC1E,SACE,oBAAC,qBAAqB,SAArB,EAA6B,aAAU,sBAAsB,GAAG,OAAO;AAE5E;AAEA,SAAS,iBAAiB;AAAA,EACxB;AAAA,EACA,OAAO;AAAA,EACP,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,GAAG;AACL,GAIK;AACH,SACE,oBAAC,qBAAqB,QAArB,EAA4B,aAAU,qBACrC;AAAA,IAAC,qBAAqB;AAAA,IAArB;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAU;AAAA,MAEV;AAAA,QAAC,qBAAqB;AAAA,QAArB;AAAA,UACC,aAAU;AAAA,UACV,WAAW;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,UACC,GAAG;AAAA;AAAA,MACN;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/components/progress.tsx
|
|
22
|
+
var progress_exports = {};
|
|
23
|
+
__export(progress_exports, {
|
|
24
|
+
Progress: () => Progress,
|
|
25
|
+
ProgressIndicator: () => ProgressIndicator,
|
|
26
|
+
ProgressLabel: () => ProgressLabel,
|
|
27
|
+
ProgressTrack: () => ProgressTrack,
|
|
28
|
+
ProgressValue: () => ProgressValue,
|
|
29
|
+
progressIndicatorVariants: () => progressIndicatorVariants,
|
|
30
|
+
progressTrackVariants: () => progressTrackVariants
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(progress_exports);
|
|
33
|
+
var import_progress = require("@base-ui/react/progress");
|
|
34
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
35
|
+
|
|
36
|
+
// src/lib/utils.ts
|
|
37
|
+
var import_clsx = require("clsx");
|
|
38
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
39
|
+
function cn(...inputs) {
|
|
40
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// src/components/progress.tsx
|
|
44
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
45
|
+
var progressTrackVariants = (0, import_class_variance_authority.cva)(
|
|
46
|
+
"relative w-full overflow-hidden rounded-full",
|
|
47
|
+
{
|
|
48
|
+
variants: {
|
|
49
|
+
color: {
|
|
50
|
+
default: "bg-primary/20",
|
|
51
|
+
success: "bg-success/20",
|
|
52
|
+
warning: "bg-warning/20",
|
|
53
|
+
destructive: "bg-destructive/20",
|
|
54
|
+
info: "bg-info/20"
|
|
55
|
+
},
|
|
56
|
+
size: {
|
|
57
|
+
sm: "h-1",
|
|
58
|
+
md: "h-2",
|
|
59
|
+
lg: "h-3",
|
|
60
|
+
xl: "h-4"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
defaultVariants: {
|
|
64
|
+
color: "default",
|
|
65
|
+
size: "md"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
var progressIndicatorVariants = (0, import_class_variance_authority.cva)(
|
|
70
|
+
"h-full rounded-full transition-[width,background-color] duration-250 ease-smooth motion-reduce:transition-none data-[indeterminate]:w-full data-[indeterminate]:[transform-origin:left] data-[indeterminate]:animate-progress-indeterminate motion-reduce:animate-none",
|
|
71
|
+
{
|
|
72
|
+
variants: {
|
|
73
|
+
color: {
|
|
74
|
+
default: "bg-primary data-[complete]:bg-success",
|
|
75
|
+
success: "bg-success data-[complete]:bg-success",
|
|
76
|
+
warning: "bg-warning data-[complete]:bg-success",
|
|
77
|
+
destructive: "bg-destructive data-[complete]:bg-success",
|
|
78
|
+
info: "bg-info data-[complete]:bg-success"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
defaultVariants: {
|
|
82
|
+
color: "default"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
function Progress({
|
|
87
|
+
className,
|
|
88
|
+
children,
|
|
89
|
+
value,
|
|
90
|
+
color,
|
|
91
|
+
size,
|
|
92
|
+
...props
|
|
93
|
+
}) {
|
|
94
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
95
|
+
import_progress.Progress.Root,
|
|
96
|
+
{
|
|
97
|
+
value,
|
|
98
|
+
"data-slot": "progress",
|
|
99
|
+
className: cn("relative w-full", className),
|
|
100
|
+
...props,
|
|
101
|
+
children: [
|
|
102
|
+
children,
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProgressTrack, { color, size, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProgressIndicator, { color }) })
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
function ProgressTrack({
|
|
109
|
+
className,
|
|
110
|
+
color,
|
|
111
|
+
size,
|
|
112
|
+
...props
|
|
113
|
+
}) {
|
|
114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
115
|
+
import_progress.Progress.Track,
|
|
116
|
+
{
|
|
117
|
+
className: cn(progressTrackVariants({ color, size }), className),
|
|
118
|
+
"data-slot": "progress-track",
|
|
119
|
+
...props
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
function ProgressIndicator({
|
|
124
|
+
className,
|
|
125
|
+
color,
|
|
126
|
+
...props
|
|
127
|
+
}) {
|
|
128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
129
|
+
import_progress.Progress.Indicator,
|
|
130
|
+
{
|
|
131
|
+
"data-slot": "progress-indicator",
|
|
132
|
+
className: cn(progressIndicatorVariants({ color }), className),
|
|
133
|
+
...props
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
function ProgressLabel({ className, ...props }) {
|
|
138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
139
|
+
import_progress.Progress.Label,
|
|
140
|
+
{
|
|
141
|
+
className: cn("text-sm font-medium leading-none", className),
|
|
142
|
+
"data-slot": "progress-label",
|
|
143
|
+
...props
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
function ProgressValue({ className, ...props }) {
|
|
148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
149
|
+
import_progress.Progress.Value,
|
|
150
|
+
{
|
|
151
|
+
className: cn("text-sm tabular-nums text-muted-foreground", className),
|
|
152
|
+
"data-slot": "progress-value",
|
|
153
|
+
...props
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
158
|
+
0 && (module.exports = {
|
|
159
|
+
Progress,
|
|
160
|
+
ProgressIndicator,
|
|
161
|
+
ProgressLabel,
|
|
162
|
+
ProgressTrack,
|
|
163
|
+
ProgressValue,
|
|
164
|
+
progressIndicatorVariants,
|
|
165
|
+
progressTrackVariants
|
|
166
|
+
});
|
|
167
|
+
//# sourceMappingURL=progress.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/progress.tsx","../../src/lib/utils.ts"],"sourcesContent":["\"use client\";\n\nimport { Progress as ProgressPrimitive } from \"@base-ui/react/progress\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../lib/utils\";\n\nconst progressTrackVariants = cva(\n \"relative w-full overflow-hidden rounded-full\",\n {\n variants: {\n color: {\n default: \"bg-primary/20\",\n success: \"bg-success/20\",\n warning: \"bg-warning/20\",\n destructive: \"bg-destructive/20\",\n info: \"bg-info/20\",\n },\n size: {\n sm: \"h-1\",\n md: \"h-2\",\n lg: \"h-3\",\n xl: \"h-4\",\n },\n },\n defaultVariants: {\n color: \"default\",\n size: \"md\",\n },\n },\n);\n\nconst progressIndicatorVariants = cva(\n \"h-full rounded-full transition-[width,background-color] duration-250 ease-smooth motion-reduce:transition-none data-[indeterminate]:w-full data-[indeterminate]:[transform-origin:left] data-[indeterminate]:animate-progress-indeterminate motion-reduce:animate-none\",\n {\n variants: {\n color: {\n default: \"bg-primary data-[complete]:bg-success\",\n success: \"bg-success data-[complete]:bg-success\",\n warning: \"bg-warning data-[complete]:bg-success\",\n destructive: \"bg-destructive data-[complete]:bg-success\",\n info: \"bg-info data-[complete]:bg-success\",\n },\n },\n defaultVariants: {\n color: \"default\",\n },\n },\n);\n\nfunction Progress({\n className,\n children,\n value,\n color,\n size,\n ...props\n}: ProgressPrimitive.Root.Props &\n VariantProps<typeof progressIndicatorVariants> &\n VariantProps<typeof progressTrackVariants>) {\n return (\n <ProgressPrimitive.Root\n value={value}\n data-slot=\"progress\"\n className={cn(\"relative w-full\", className)}\n {...props}\n >\n {children}\n <ProgressTrack color={color} size={size}>\n <ProgressIndicator color={color} />\n </ProgressTrack>\n </ProgressPrimitive.Root>\n );\n}\n\nfunction ProgressTrack({\n className,\n color,\n size,\n ...props\n}: ProgressPrimitive.Track.Props & VariantProps<typeof progressTrackVariants>) {\n return (\n <ProgressPrimitive.Track\n className={cn(progressTrackVariants({ color, size }), className)}\n data-slot=\"progress-track\"\n {...props}\n />\n );\n}\n\nfunction ProgressIndicator({\n className,\n color,\n ...props\n}: ProgressPrimitive.Indicator.Props &\n VariantProps<typeof progressIndicatorVariants>) {\n return (\n <ProgressPrimitive.Indicator\n data-slot=\"progress-indicator\"\n className={cn(progressIndicatorVariants({ color }), className)}\n {...props}\n />\n );\n}\n\nfunction ProgressLabel({ className, ...props }: ProgressPrimitive.Label.Props) {\n return (\n <ProgressPrimitive.Label\n className={cn(\"text-sm font-medium leading-none\", className)}\n data-slot=\"progress-label\"\n {...props}\n />\n );\n}\n\nfunction ProgressValue({ className, ...props }: ProgressPrimitive.Value.Props) {\n return (\n <ProgressPrimitive.Value\n className={cn(\"text-sm tabular-nums text-muted-foreground\", className)}\n data-slot=\"progress-value\"\n {...props}\n />\n );\n}\n\nexport {\n Progress,\n ProgressTrack,\n ProgressIndicator,\n ProgressLabel,\n ProgressValue,\n progressIndicatorVariants,\n progressTrackVariants,\n};\n\nexport type ProgressProps = React.ComponentProps<typeof Progress>;\nexport type ProgressTrackProps = React.ComponentProps<typeof ProgressTrack>;\nexport type ProgressIndicatorProps = React.ComponentProps<\n typeof ProgressIndicator\n>;\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,sBAA8C;AAC9C,sCAAuC;;;ACHvC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADwDI;AAtDJ,IAAM,4BAAwB;AAAA,EAC5B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,SAAS;AAAA,QACT,SAAS;AAAA,QACT,SAAS;AAAA,QACT,aAAa;AAAA,QACb,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,OAAO;AAAA,MACP,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAEA,IAAM,gCAA4B;AAAA,EAChC;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,SAAS;AAAA,QACT,SAAS;AAAA,QACT,SAAS;AAAA,QACT,aAAa;AAAA,QACb,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,OAAO;AAAA,IACT;AAAA,EACF;AACF;AAEA,SAAS,SAAS;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAE8C;AAC5C,SACE;AAAA,IAAC,gBAAAA,SAAkB;AAAA,IAAlB;AAAA,MACC;AAAA,MACA,aAAU;AAAA,MACV,WAAW,GAAG,mBAAmB,SAAS;AAAA,MACzC,GAAG;AAAA,MAEH;AAAA;AAAA,QACD,4CAAC,iBAAc,OAAc,MAC3B,sDAAC,qBAAkB,OAAc,GACnC;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,SAAS,cAAc;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAA+E;AAC7E,SACE;AAAA,IAAC,gBAAAA,SAAkB;AAAA,IAAlB;AAAA,MACC,WAAW,GAAG,sBAAsB,EAAE,OAAO,KAAK,CAAC,GAAG,SAAS;AAAA,MAC/D,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,kBAAkB;AAAA,EACzB;AAAA,EACA;AAAA,EACA,GAAG;AACL,GACkD;AAChD,SACE;AAAA,IAAC,gBAAAA,SAAkB;AAAA,IAAlB;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,0BAA0B,EAAE,MAAM,CAAC,GAAG,SAAS;AAAA,MAC5D,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,cAAc,EAAE,WAAW,GAAG,MAAM,GAAkC;AAC7E,SACE;AAAA,IAAC,gBAAAA,SAAkB;AAAA,IAAlB;AAAA,MACC,WAAW,GAAG,oCAAoC,SAAS;AAAA,MAC3D,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,cAAc,EAAE,WAAW,GAAG,MAAM,GAAkC;AAC7E,SACE;AAAA,IAAC,gBAAAA,SAAkB;AAAA,IAAlB;AAAA,MACC,WAAW,GAAG,8CAA8C,SAAS;AAAA,MACrE,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACN;AAEJ;","names":["ProgressPrimitive"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
+
import { Progress as Progress$1 } from '@base-ui/react/progress';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
declare const progressTrackVariants: (props?: ({
|
|
7
|
+
color?: "default" | "destructive" | "success" | "warning" | "info" | null | undefined;
|
|
8
|
+
size?: "sm" | "lg" | "md" | "xl" | null | undefined;
|
|
9
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
|
+
declare const progressIndicatorVariants: (props?: ({
|
|
11
|
+
color?: "default" | "destructive" | "success" | "warning" | "info" | null | undefined;
|
|
12
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
13
|
+
declare function Progress({ className, children, value, color, size, ...props }: Progress$1.Root.Props & VariantProps<typeof progressIndicatorVariants> & VariantProps<typeof progressTrackVariants>): react_jsx_runtime.JSX.Element;
|
|
14
|
+
declare function ProgressTrack({ className, color, size, ...props }: Progress$1.Track.Props & VariantProps<typeof progressTrackVariants>): react_jsx_runtime.JSX.Element;
|
|
15
|
+
declare function ProgressIndicator({ className, color, ...props }: Progress$1.Indicator.Props & VariantProps<typeof progressIndicatorVariants>): react_jsx_runtime.JSX.Element;
|
|
16
|
+
declare function ProgressLabel({ className, ...props }: Progress$1.Label.Props): react_jsx_runtime.JSX.Element;
|
|
17
|
+
declare function ProgressValue({ className, ...props }: Progress$1.Value.Props): react_jsx_runtime.JSX.Element;
|
|
18
|
+
|
|
19
|
+
type ProgressProps = React.ComponentProps<typeof Progress>;
|
|
20
|
+
type ProgressTrackProps = React.ComponentProps<typeof ProgressTrack>;
|
|
21
|
+
type ProgressIndicatorProps = React.ComponentProps<typeof ProgressIndicator>;
|
|
22
|
+
|
|
23
|
+
export { Progress, ProgressIndicator, type ProgressIndicatorProps, ProgressLabel, type ProgressProps, ProgressTrack, type ProgressTrackProps, ProgressValue, progressIndicatorVariants, progressTrackVariants };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
+
import { Progress as Progress$1 } from '@base-ui/react/progress';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
declare const progressTrackVariants: (props?: ({
|
|
7
|
+
color?: "default" | "destructive" | "success" | "warning" | "info" | null | undefined;
|
|
8
|
+
size?: "sm" | "lg" | "md" | "xl" | null | undefined;
|
|
9
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
|
+
declare const progressIndicatorVariants: (props?: ({
|
|
11
|
+
color?: "default" | "destructive" | "success" | "warning" | "info" | null | undefined;
|
|
12
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
13
|
+
declare function Progress({ className, children, value, color, size, ...props }: Progress$1.Root.Props & VariantProps<typeof progressIndicatorVariants> & VariantProps<typeof progressTrackVariants>): react_jsx_runtime.JSX.Element;
|
|
14
|
+
declare function ProgressTrack({ className, color, size, ...props }: Progress$1.Track.Props & VariantProps<typeof progressTrackVariants>): react_jsx_runtime.JSX.Element;
|
|
15
|
+
declare function ProgressIndicator({ className, color, ...props }: Progress$1.Indicator.Props & VariantProps<typeof progressIndicatorVariants>): react_jsx_runtime.JSX.Element;
|
|
16
|
+
declare function ProgressLabel({ className, ...props }: Progress$1.Label.Props): react_jsx_runtime.JSX.Element;
|
|
17
|
+
declare function ProgressValue({ className, ...props }: Progress$1.Value.Props): react_jsx_runtime.JSX.Element;
|
|
18
|
+
|
|
19
|
+
type ProgressProps = React.ComponentProps<typeof Progress>;
|
|
20
|
+
type ProgressTrackProps = React.ComponentProps<typeof ProgressTrack>;
|
|
21
|
+
type ProgressIndicatorProps = React.ComponentProps<typeof ProgressIndicator>;
|
|
22
|
+
|
|
23
|
+
export { Progress, ProgressIndicator, type ProgressIndicatorProps, ProgressLabel, type ProgressProps, ProgressTrack, type ProgressTrackProps, ProgressValue, progressIndicatorVariants, progressTrackVariants };
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/progress.tsx
|
|
4
|
+
import { Progress as ProgressPrimitive } from "@base-ui/react/progress";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
|
|
7
|
+
// src/lib/utils.ts
|
|
8
|
+
import { clsx } from "clsx";
|
|
9
|
+
import { twMerge } from "tailwind-merge";
|
|
10
|
+
function cn(...inputs) {
|
|
11
|
+
return twMerge(clsx(inputs));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// src/components/progress.tsx
|
|
15
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
var progressTrackVariants = cva(
|
|
17
|
+
"relative w-full overflow-hidden rounded-full",
|
|
18
|
+
{
|
|
19
|
+
variants: {
|
|
20
|
+
color: {
|
|
21
|
+
default: "bg-primary/20",
|
|
22
|
+
success: "bg-success/20",
|
|
23
|
+
warning: "bg-warning/20",
|
|
24
|
+
destructive: "bg-destructive/20",
|
|
25
|
+
info: "bg-info/20"
|
|
26
|
+
},
|
|
27
|
+
size: {
|
|
28
|
+
sm: "h-1",
|
|
29
|
+
md: "h-2",
|
|
30
|
+
lg: "h-3",
|
|
31
|
+
xl: "h-4"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: {
|
|
35
|
+
color: "default",
|
|
36
|
+
size: "md"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
var progressIndicatorVariants = cva(
|
|
41
|
+
"h-full rounded-full transition-[width,background-color] duration-250 ease-smooth motion-reduce:transition-none data-[indeterminate]:w-full data-[indeterminate]:[transform-origin:left] data-[indeterminate]:animate-progress-indeterminate motion-reduce:animate-none",
|
|
42
|
+
{
|
|
43
|
+
variants: {
|
|
44
|
+
color: {
|
|
45
|
+
default: "bg-primary data-[complete]:bg-success",
|
|
46
|
+
success: "bg-success data-[complete]:bg-success",
|
|
47
|
+
warning: "bg-warning data-[complete]:bg-success",
|
|
48
|
+
destructive: "bg-destructive data-[complete]:bg-success",
|
|
49
|
+
info: "bg-info data-[complete]:bg-success"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
defaultVariants: {
|
|
53
|
+
color: "default"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
function Progress({
|
|
58
|
+
className,
|
|
59
|
+
children,
|
|
60
|
+
value,
|
|
61
|
+
color,
|
|
62
|
+
size,
|
|
63
|
+
...props
|
|
64
|
+
}) {
|
|
65
|
+
return /* @__PURE__ */ jsxs(
|
|
66
|
+
ProgressPrimitive.Root,
|
|
67
|
+
{
|
|
68
|
+
value,
|
|
69
|
+
"data-slot": "progress",
|
|
70
|
+
className: cn("relative w-full", className),
|
|
71
|
+
...props,
|
|
72
|
+
children: [
|
|
73
|
+
children,
|
|
74
|
+
/* @__PURE__ */ jsx(ProgressTrack, { color, size, children: /* @__PURE__ */ jsx(ProgressIndicator, { color }) })
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
function ProgressTrack({
|
|
80
|
+
className,
|
|
81
|
+
color,
|
|
82
|
+
size,
|
|
83
|
+
...props
|
|
84
|
+
}) {
|
|
85
|
+
return /* @__PURE__ */ jsx(
|
|
86
|
+
ProgressPrimitive.Track,
|
|
87
|
+
{
|
|
88
|
+
className: cn(progressTrackVariants({ color, size }), className),
|
|
89
|
+
"data-slot": "progress-track",
|
|
90
|
+
...props
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
function ProgressIndicator({
|
|
95
|
+
className,
|
|
96
|
+
color,
|
|
97
|
+
...props
|
|
98
|
+
}) {
|
|
99
|
+
return /* @__PURE__ */ jsx(
|
|
100
|
+
ProgressPrimitive.Indicator,
|
|
101
|
+
{
|
|
102
|
+
"data-slot": "progress-indicator",
|
|
103
|
+
className: cn(progressIndicatorVariants({ color }), className),
|
|
104
|
+
...props
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
function ProgressLabel({ className, ...props }) {
|
|
109
|
+
return /* @__PURE__ */ jsx(
|
|
110
|
+
ProgressPrimitive.Label,
|
|
111
|
+
{
|
|
112
|
+
className: cn("text-sm font-medium leading-none", className),
|
|
113
|
+
"data-slot": "progress-label",
|
|
114
|
+
...props
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
function ProgressValue({ className, ...props }) {
|
|
119
|
+
return /* @__PURE__ */ jsx(
|
|
120
|
+
ProgressPrimitive.Value,
|
|
121
|
+
{
|
|
122
|
+
className: cn("text-sm tabular-nums text-muted-foreground", className),
|
|
123
|
+
"data-slot": "progress-value",
|
|
124
|
+
...props
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
export {
|
|
129
|
+
Progress,
|
|
130
|
+
ProgressIndicator,
|
|
131
|
+
ProgressLabel,
|
|
132
|
+
ProgressTrack,
|
|
133
|
+
ProgressValue,
|
|
134
|
+
progressIndicatorVariants,
|
|
135
|
+
progressTrackVariants
|
|
136
|
+
};
|
|
137
|
+
//# sourceMappingURL=progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/progress.tsx","../../src/lib/utils.ts"],"sourcesContent":["\"use client\";\n\nimport { Progress as ProgressPrimitive } from \"@base-ui/react/progress\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../lib/utils\";\n\nconst progressTrackVariants = cva(\n \"relative w-full overflow-hidden rounded-full\",\n {\n variants: {\n color: {\n default: \"bg-primary/20\",\n success: \"bg-success/20\",\n warning: \"bg-warning/20\",\n destructive: \"bg-destructive/20\",\n info: \"bg-info/20\",\n },\n size: {\n sm: \"h-1\",\n md: \"h-2\",\n lg: \"h-3\",\n xl: \"h-4\",\n },\n },\n defaultVariants: {\n color: \"default\",\n size: \"md\",\n },\n },\n);\n\nconst progressIndicatorVariants = cva(\n \"h-full rounded-full transition-[width,background-color] duration-250 ease-smooth motion-reduce:transition-none data-[indeterminate]:w-full data-[indeterminate]:[transform-origin:left] data-[indeterminate]:animate-progress-indeterminate motion-reduce:animate-none\",\n {\n variants: {\n color: {\n default: \"bg-primary data-[complete]:bg-success\",\n success: \"bg-success data-[complete]:bg-success\",\n warning: \"bg-warning data-[complete]:bg-success\",\n destructive: \"bg-destructive data-[complete]:bg-success\",\n info: \"bg-info data-[complete]:bg-success\",\n },\n },\n defaultVariants: {\n color: \"default\",\n },\n },\n);\n\nfunction Progress({\n className,\n children,\n value,\n color,\n size,\n ...props\n}: ProgressPrimitive.Root.Props &\n VariantProps<typeof progressIndicatorVariants> &\n VariantProps<typeof progressTrackVariants>) {\n return (\n <ProgressPrimitive.Root\n value={value}\n data-slot=\"progress\"\n className={cn(\"relative w-full\", className)}\n {...props}\n >\n {children}\n <ProgressTrack color={color} size={size}>\n <ProgressIndicator color={color} />\n </ProgressTrack>\n </ProgressPrimitive.Root>\n );\n}\n\nfunction ProgressTrack({\n className,\n color,\n size,\n ...props\n}: ProgressPrimitive.Track.Props & VariantProps<typeof progressTrackVariants>) {\n return (\n <ProgressPrimitive.Track\n className={cn(progressTrackVariants({ color, size }), className)}\n data-slot=\"progress-track\"\n {...props}\n />\n );\n}\n\nfunction ProgressIndicator({\n className,\n color,\n ...props\n}: ProgressPrimitive.Indicator.Props &\n VariantProps<typeof progressIndicatorVariants>) {\n return (\n <ProgressPrimitive.Indicator\n data-slot=\"progress-indicator\"\n className={cn(progressIndicatorVariants({ color }), className)}\n {...props}\n />\n );\n}\n\nfunction ProgressLabel({ className, ...props }: ProgressPrimitive.Label.Props) {\n return (\n <ProgressPrimitive.Label\n className={cn(\"text-sm font-medium leading-none\", className)}\n data-slot=\"progress-label\"\n {...props}\n />\n );\n}\n\nfunction ProgressValue({ className, ...props }: ProgressPrimitive.Value.Props) {\n return (\n <ProgressPrimitive.Value\n className={cn(\"text-sm tabular-nums text-muted-foreground\", className)}\n data-slot=\"progress-value\"\n {...props}\n />\n );\n}\n\nexport {\n Progress,\n ProgressTrack,\n ProgressIndicator,\n ProgressLabel,\n ProgressValue,\n progressIndicatorVariants,\n progressTrackVariants,\n};\n\nexport type ProgressProps = React.ComponentProps<typeof Progress>;\nexport type ProgressTrackProps = React.ComponentProps<typeof ProgressTrack>;\nexport type ProgressIndicatorProps = React.ComponentProps<\n typeof ProgressIndicator\n>;\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";;;AAEA,SAAS,YAAY,yBAAyB;AAC9C,SAAS,WAA8B;;;ACHvC,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADwDI,SAQI,KARJ;AAtDJ,IAAM,wBAAwB;AAAA,EAC5B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,SAAS;AAAA,QACT,SAAS;AAAA,QACT,SAAS;AAAA,QACT,aAAa;AAAA,QACb,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,OAAO;AAAA,MACP,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAEA,IAAM,4BAA4B;AAAA,EAChC;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,SAAS;AAAA,QACT,SAAS;AAAA,QACT,SAAS;AAAA,QACT,aAAa;AAAA,QACb,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,OAAO;AAAA,IACT;AAAA,EACF;AACF;AAEA,SAAS,SAAS;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAE8C;AAC5C,SACE;AAAA,IAAC,kBAAkB;AAAA,IAAlB;AAAA,MACC;AAAA,MACA,aAAU;AAAA,MACV,WAAW,GAAG,mBAAmB,SAAS;AAAA,MACzC,GAAG;AAAA,MAEH;AAAA;AAAA,QACD,oBAAC,iBAAc,OAAc,MAC3B,8BAAC,qBAAkB,OAAc,GACnC;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,SAAS,cAAc;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAA+E;AAC7E,SACE;AAAA,IAAC,kBAAkB;AAAA,IAAlB;AAAA,MACC,WAAW,GAAG,sBAAsB,EAAE,OAAO,KAAK,CAAC,GAAG,SAAS;AAAA,MAC/D,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,kBAAkB;AAAA,EACzB;AAAA,EACA;AAAA,EACA,GAAG;AACL,GACkD;AAChD,SACE;AAAA,IAAC,kBAAkB;AAAA,IAAlB;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,0BAA0B,EAAE,MAAM,CAAC,GAAG,SAAS;AAAA,MAC5D,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,cAAc,EAAE,WAAW,GAAG,MAAM,GAAkC;AAC7E,SACE;AAAA,IAAC,kBAAkB;AAAA,IAAlB;AAAA,MACC,WAAW,GAAG,oCAAoC,SAAS;AAAA,MAC3D,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,cAAc,EAAE,WAAW,GAAG,MAAM,GAAkC;AAC7E,SACE;AAAA,IAAC,kBAAkB;AAAA,IAAlB;AAAA,MACC,WAAW,GAAG,8CAA8C,SAAS;AAAA,MACrE,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/components/radio-group.tsx
|
|
22
|
+
var radio_group_exports = {};
|
|
23
|
+
__export(radio_group_exports, {
|
|
24
|
+
RadioGroup: () => RadioGroup,
|
|
25
|
+
RadioGroupItem: () => RadioGroupItem
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(radio_group_exports);
|
|
28
|
+
var import_radio = require("@base-ui/react/radio");
|
|
29
|
+
var import_radio_group = require("@base-ui/react/radio-group");
|
|
30
|
+
|
|
31
|
+
// src/lib/utils.ts
|
|
32
|
+
var import_clsx = require("clsx");
|
|
33
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
34
|
+
function cn(...inputs) {
|
|
35
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// src/components/radio-group.tsx
|
|
39
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
40
|
+
function RadioGroup({ className, ...props }) {
|
|
41
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
42
|
+
import_radio_group.RadioGroup,
|
|
43
|
+
{
|
|
44
|
+
"data-slot": "radio-group",
|
|
45
|
+
className: cn(
|
|
46
|
+
"flex flex-col gap-2",
|
|
47
|
+
"data-[orientation=horizontal]:flex-row data-[orientation=horizontal]:gap-4",
|
|
48
|
+
className
|
|
49
|
+
),
|
|
50
|
+
...props
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
function RadioGroupItem({ className, ...props }) {
|
|
55
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56
|
+
import_radio.Radio.Root,
|
|
57
|
+
{
|
|
58
|
+
"data-slot": "radio-group-item",
|
|
59
|
+
className: cn(
|
|
60
|
+
"group relative flex aspect-square size-4 shrink-0 cursor-pointer items-center justify-center rounded-full border border-field-border bg-field-background text-primary shadow-field select-none no-highlight",
|
|
61
|
+
"data-checked:bg-primary data-checked:text-primary-foreground data-checked:border-transparent",
|
|
62
|
+
/* Hover */
|
|
63
|
+
"hover-only:hover:border-field-border-hover",
|
|
64
|
+
/* Focus Visible */
|
|
65
|
+
"focus-visible:focus-ring",
|
|
66
|
+
/* Disabled */
|
|
67
|
+
"data-disabled:status-disabled",
|
|
68
|
+
/* Invalid */
|
|
69
|
+
"data-[invalid]:border-field-border-invalid",
|
|
70
|
+
"data-[invalid]:data-checked:bg-destructive data-[invalid]:data-checked:border-transparent",
|
|
71
|
+
/* Press */
|
|
72
|
+
"motion-safe:active:scale-[0.95]",
|
|
73
|
+
/* Transition */
|
|
74
|
+
"transition-[color,background-color,border-color,box-shadow,opacity,transform] duration-150 ease-smooth",
|
|
75
|
+
/* Motion Reduce */
|
|
76
|
+
"motion-reduce:transition-none",
|
|
77
|
+
className
|
|
78
|
+
),
|
|
79
|
+
...props,
|
|
80
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
81
|
+
import_radio.Radio.Indicator,
|
|
82
|
+
{
|
|
83
|
+
"data-slot": "radio-group-indicator",
|
|
84
|
+
"aria-hidden": "true",
|
|
85
|
+
className: "absolute inset-0 flex items-center justify-center",
|
|
86
|
+
keepMounted: true,
|
|
87
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "size-2 scale-0 rounded-full bg-primary-foreground transition-transform duration-150 ease-out-fluid group-data-checked:scale-100 motion-reduce:transition-none" })
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
94
|
+
0 && (module.exports = {
|
|
95
|
+
RadioGroup,
|
|
96
|
+
RadioGroupItem
|
|
97
|
+
});
|
|
98
|
+
//# sourceMappingURL=radio-group.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/radio-group.tsx","../../src/lib/utils.ts"],"sourcesContent":["\"use client\";\n\nimport { Radio as RadioPrimitive } from \"@base-ui/react/radio\";\nimport { RadioGroup as RadioGroupPrimitive } from \"@base-ui/react/radio-group\";\nimport { cn } from \"../lib/utils\";\n\nfunction RadioGroup({ className, ...props }: RadioGroupPrimitive.Props) {\n return (\n <RadioGroupPrimitive\n data-slot=\"radio-group\"\n className={cn(\n \"flex flex-col gap-2\",\n \"data-[orientation=horizontal]:flex-row data-[orientation=horizontal]:gap-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction RadioGroupItem({ className, ...props }: RadioPrimitive.Root.Props) {\n return (\n <RadioPrimitive.Root\n data-slot=\"radio-group-item\"\n className={cn(\n \"group relative flex aspect-square size-4 shrink-0 cursor-pointer items-center justify-center rounded-full border border-field-border bg-field-background text-primary shadow-field select-none no-highlight\",\n \"data-checked:bg-primary data-checked:text-primary-foreground data-checked:border-transparent\",\n /* Hover */\n \"hover-only:hover:border-field-border-hover\",\n /* Focus Visible */\n \"focus-visible:focus-ring\",\n /* Disabled */\n \"data-disabled:status-disabled\",\n /* Invalid */\n \"data-[invalid]:border-field-border-invalid\",\n \"data-[invalid]:data-checked:bg-destructive data-[invalid]:data-checked:border-transparent\",\n /* Press */\n \"motion-safe:active:scale-[0.95]\",\n /* Transition */\n \"transition-[color,background-color,border-color,box-shadow,opacity,transform] duration-150 ease-smooth\",\n /* Motion Reduce */\n \"motion-reduce:transition-none\",\n className,\n )}\n {...props}\n >\n <RadioPrimitive.Indicator\n data-slot=\"radio-group-indicator\"\n aria-hidden=\"true\"\n className=\"absolute inset-0 flex items-center justify-center\"\n keepMounted\n >\n <span className=\"size-2 scale-0 rounded-full bg-primary-foreground transition-transform duration-150 ease-out-fluid group-data-checked:scale-100 motion-reduce:transition-none\" />\n </RadioPrimitive.Indicator>\n </RadioPrimitive.Root>\n );\n}\n\nexport { RadioGroup, RadioGroupItem };\n\nexport type RadioGroupProps = React.ComponentProps<typeof RadioGroup>;\nexport type RadioGroupItemProps = React.ComponentProps<typeof RadioGroupItem>;\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAwC;AACxC,yBAAkD;;;ACHlD,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADGI;AAFJ,SAAS,WAAW,EAAE,WAAW,GAAG,MAAM,GAA8B;AACtE,SACE;AAAA,IAAC,mBAAAA;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,eAAe,EAAE,WAAW,GAAG,MAAM,GAA8B;AAC1E,SACE;AAAA,IAAC,aAAAC,MAAe;AAAA,IAAf;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA;AAAA,QAEA;AAAA;AAAA,QAEA;AAAA;AAAA,QAEA;AAAA;AAAA,QAEA;AAAA,QACA;AAAA;AAAA,QAEA;AAAA;AAAA,QAEA;AAAA;AAAA,QAEA;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,QAAC,aAAAA,MAAe;AAAA,QAAf;AAAA,UACC,aAAU;AAAA,UACV,eAAY;AAAA,UACZ,WAAU;AAAA,UACV,aAAW;AAAA,UAEX,sDAAC,UAAK,WAAU,iKAAgK;AAAA;AAAA,MAClL;AAAA;AAAA,EACF;AAEJ;","names":["RadioGroupPrimitive","RadioPrimitive"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Radio } from '@base-ui/react/radio';
|
|
3
|
+
import { RadioGroup as RadioGroup$1 } from '@base-ui/react/radio-group';
|
|
4
|
+
|
|
5
|
+
declare function RadioGroup({ className, ...props }: RadioGroup$1.Props): react_jsx_runtime.JSX.Element;
|
|
6
|
+
declare function RadioGroupItem({ className, ...props }: Radio.Root.Props): react_jsx_runtime.JSX.Element;
|
|
7
|
+
|
|
8
|
+
type RadioGroupProps = React.ComponentProps<typeof RadioGroup>;
|
|
9
|
+
type RadioGroupItemProps = React.ComponentProps<typeof RadioGroupItem>;
|
|
10
|
+
|
|
11
|
+
export { RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Radio } from '@base-ui/react/radio';
|
|
3
|
+
import { RadioGroup as RadioGroup$1 } from '@base-ui/react/radio-group';
|
|
4
|
+
|
|
5
|
+
declare function RadioGroup({ className, ...props }: RadioGroup$1.Props): react_jsx_runtime.JSX.Element;
|
|
6
|
+
declare function RadioGroupItem({ className, ...props }: Radio.Root.Props): react_jsx_runtime.JSX.Element;
|
|
7
|
+
|
|
8
|
+
type RadioGroupProps = React.ComponentProps<typeof RadioGroup>;
|
|
9
|
+
type RadioGroupItemProps = React.ComponentProps<typeof RadioGroupItem>;
|
|
10
|
+
|
|
11
|
+
export { RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/radio-group.tsx
|
|
4
|
+
import { Radio as RadioPrimitive } from "@base-ui/react/radio";
|
|
5
|
+
import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group";
|
|
6
|
+
|
|
7
|
+
// src/lib/utils.ts
|
|
8
|
+
import { clsx } from "clsx";
|
|
9
|
+
import { twMerge } from "tailwind-merge";
|
|
10
|
+
function cn(...inputs) {
|
|
11
|
+
return twMerge(clsx(inputs));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// src/components/radio-group.tsx
|
|
15
|
+
import { jsx } from "react/jsx-runtime";
|
|
16
|
+
function RadioGroup({ className, ...props }) {
|
|
17
|
+
return /* @__PURE__ */ jsx(
|
|
18
|
+
RadioGroupPrimitive,
|
|
19
|
+
{
|
|
20
|
+
"data-slot": "radio-group",
|
|
21
|
+
className: cn(
|
|
22
|
+
"flex flex-col gap-2",
|
|
23
|
+
"data-[orientation=horizontal]:flex-row data-[orientation=horizontal]:gap-4",
|
|
24
|
+
className
|
|
25
|
+
),
|
|
26
|
+
...props
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
function RadioGroupItem({ className, ...props }) {
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
RadioPrimitive.Root,
|
|
33
|
+
{
|
|
34
|
+
"data-slot": "radio-group-item",
|
|
35
|
+
className: cn(
|
|
36
|
+
"group relative flex aspect-square size-4 shrink-0 cursor-pointer items-center justify-center rounded-full border border-field-border bg-field-background text-primary shadow-field select-none no-highlight",
|
|
37
|
+
"data-checked:bg-primary data-checked:text-primary-foreground data-checked:border-transparent",
|
|
38
|
+
/* Hover */
|
|
39
|
+
"hover-only:hover:border-field-border-hover",
|
|
40
|
+
/* Focus Visible */
|
|
41
|
+
"focus-visible:focus-ring",
|
|
42
|
+
/* Disabled */
|
|
43
|
+
"data-disabled:status-disabled",
|
|
44
|
+
/* Invalid */
|
|
45
|
+
"data-[invalid]:border-field-border-invalid",
|
|
46
|
+
"data-[invalid]:data-checked:bg-destructive data-[invalid]:data-checked:border-transparent",
|
|
47
|
+
/* Press */
|
|
48
|
+
"motion-safe:active:scale-[0.95]",
|
|
49
|
+
/* Transition */
|
|
50
|
+
"transition-[color,background-color,border-color,box-shadow,opacity,transform] duration-150 ease-smooth",
|
|
51
|
+
/* Motion Reduce */
|
|
52
|
+
"motion-reduce:transition-none",
|
|
53
|
+
className
|
|
54
|
+
),
|
|
55
|
+
...props,
|
|
56
|
+
children: /* @__PURE__ */ jsx(
|
|
57
|
+
RadioPrimitive.Indicator,
|
|
58
|
+
{
|
|
59
|
+
"data-slot": "radio-group-indicator",
|
|
60
|
+
"aria-hidden": "true",
|
|
61
|
+
className: "absolute inset-0 flex items-center justify-center",
|
|
62
|
+
keepMounted: true,
|
|
63
|
+
children: /* @__PURE__ */ jsx("span", { className: "size-2 scale-0 rounded-full bg-primary-foreground transition-transform duration-150 ease-out-fluid group-data-checked:scale-100 motion-reduce:transition-none" })
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
RadioGroup,
|
|
71
|
+
RadioGroupItem
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=radio-group.js.map
|