xiod-ui 1.0.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/LICENSE +73 -0
- package/README.md +167 -0
- package/dist/components/accordion.d.ts +9 -0
- package/dist/components/accordion.js +46 -0
- package/dist/components/agent-steps.d.ts +47 -0
- package/dist/components/agent-steps.js +223 -0
- package/dist/components/alert-dialog.d.ts +21 -0
- package/dist/components/alert-dialog.js +74 -0
- package/dist/components/alert.d.ts +12 -0
- package/dist/components/alert.js +45 -0
- package/dist/components/aspect-ratio.d.ts +9 -0
- package/dist/components/aspect-ratio.js +22 -0
- package/dist/components/autocomplete.d.ts +35 -0
- package/dist/components/autocomplete.js +160 -0
- package/dist/components/avatar.d.ts +17 -0
- package/dist/components/avatar.js +65 -0
- package/dist/components/badge.d.ts +15 -0
- package/dist/components/badge.js +46 -0
- package/dist/components/breadcrumb.d.ts +12 -0
- package/dist/components/breadcrumb.js +75 -0
- package/dist/components/button-group.d.ts +14 -0
- package/dist/components/button-group.js +45 -0
- package/dist/components/button-split.d.ts +19 -0
- package/dist/components/button-split.js +73 -0
- package/dist/components/button.d.ts +15 -0
- package/dist/components/button.js +54 -0
- package/dist/components/calendar.d.ts +63 -0
- package/dist/components/calendar.js +425 -0
- package/dist/components/card.d.ts +17 -0
- package/dist/components/card.js +139 -0
- package/dist/components/carousel.d.ts +59 -0
- package/dist/components/carousel.js +503 -0
- package/dist/components/checkbox.d.ts +16 -0
- package/dist/components/checkbox.js +86 -0
- package/dist/components/circular-progress.d.ts +28 -0
- package/dist/components/circular-progress.js +127 -0
- package/dist/components/collapsible.d.ts +8 -0
- package/dist/components/collapsible.js +27 -0
- package/dist/components/color-picker.d.ts +159 -0
- package/dist/components/color-picker.js +1589 -0
- package/dist/components/combobox.d.ts +46 -0
- package/dist/components/combobox.js +237 -0
- package/dist/components/command.d.ts +22 -0
- package/dist/components/command.js +129 -0
- package/dist/components/context-menu.d.ts +38 -0
- package/dist/components/context-menu.js +164 -0
- package/dist/components/copy-to-clipboard.d.ts +32 -0
- package/dist/components/copy-to-clipboard.js +83 -0
- package/dist/components/corner-badge.d.ts +22 -0
- package/dist/components/corner-badge.js +84 -0
- package/dist/components/dashboard-grid.d.ts +83 -0
- package/dist/components/dashboard-grid.js +486 -0
- package/dist/components/date-picker.d.ts +29 -0
- package/dist/components/date-picker.js +261 -0
- package/dist/components/dialog.d.ts +26 -0
- package/dist/components/dialog.js +97 -0
- package/dist/components/dot-matrix.d.ts +32 -0
- package/dist/components/dot-matrix.js +707 -0
- package/dist/components/draggable.d.ts +42 -0
- package/dist/components/draggable.js +346 -0
- package/dist/components/drawer.d.ts +66 -0
- package/dist/components/drawer.js +304 -0
- package/dist/components/empty.d.ts +14 -0
- package/dist/components/empty.js +75 -0
- package/dist/components/field.d.ts +12 -0
- package/dist/components/field.js +44 -0
- package/dist/components/fieldset.d.ts +7 -0
- package/dist/components/fieldset.js +21 -0
- package/dist/components/file-upload.d.ts +61 -0
- package/dist/components/file-upload.js +482 -0
- package/dist/components/form.d.ts +6 -0
- package/dist/components/form.js +14 -0
- package/dist/components/frame.d.ts +10 -0
- package/dist/components/frame.js +47 -0
- package/dist/components/gauge.d.ts +27 -0
- package/dist/components/gauge.js +74 -0
- package/dist/components/grid.d.ts +26 -0
- package/dist/components/grid.js +204 -0
- package/dist/components/group.d.ts +19 -0
- package/dist/components/group.js +45 -0
- package/dist/components/input-group.d.ts +15 -0
- package/dist/components/input-group.js +61 -0
- package/dist/components/input-otp.d.ts +24 -0
- package/dist/components/input-otp.js +50 -0
- package/dist/components/input-payment.d.ts +131 -0
- package/dist/components/input-payment.js +1140 -0
- package/dist/components/input-phone.d.ts +70 -0
- package/dist/components/input-phone.js +657 -0
- package/dist/components/input-sensitive.d.ts +12 -0
- package/dist/components/input-sensitive.js +169 -0
- package/dist/components/input.d.ts +13 -0
- package/dist/components/input.js +26 -0
- package/dist/components/kbd.d.ts +6 -0
- package/dist/components/kbd.js +19 -0
- package/dist/components/kinetic-click.d.ts +48 -0
- package/dist/components/kinetic-click.js +1184 -0
- package/dist/components/label.d.ts +6 -0
- package/dist/components/label.js +18 -0
- package/dist/components/list-box.d.ts +20 -0
- package/dist/components/list-box.js +148 -0
- package/dist/components/loader.d.ts +13 -0
- package/dist/components/loader.js +430 -0
- package/dist/components/marker.d.ts +15 -0
- package/dist/components/marker.js +59 -0
- package/dist/components/menu.d.ts +42 -0
- package/dist/components/menu.js +186 -0
- package/dist/components/menubar.d.ts +40 -0
- package/dist/components/menubar.js +107 -0
- package/dist/components/message.d.ts +33 -0
- package/dist/components/message.js +112 -0
- package/dist/components/meter.d.ts +10 -0
- package/dist/components/meter.js +42 -0
- package/dist/components/morphic-toast.d.ts +61 -0
- package/dist/components/morphic-toast.js +916 -0
- package/dist/components/navigation-menu.d.ts +26 -0
- package/dist/components/navigation-menu.js +116 -0
- package/dist/components/number-field.d.ts +15 -0
- package/dist/components/number-field.js +86 -0
- package/dist/components/option-picker.d.ts +18 -0
- package/dist/components/option-picker.js +89 -0
- package/dist/components/orb.d.ts +38 -0
- package/dist/components/orb.js +1413 -0
- package/dist/components/pagination.d.ts +25 -0
- package/dist/components/pagination.js +147 -0
- package/dist/components/popover.d.ts +22 -0
- package/dist/components/popover.js +79 -0
- package/dist/components/preview-card.d.ts +16 -0
- package/dist/components/preview-card.js +60 -0
- package/dist/components/progress.d.ts +21 -0
- package/dist/components/progress.js +139 -0
- package/dist/components/radio.d.ts +16 -0
- package/dist/components/radio.js +68 -0
- package/dist/components/resizable.d.ts +58 -0
- package/dist/components/resizable.js +964 -0
- package/dist/components/ruler-picker.d.ts +27 -0
- package/dist/components/ruler-picker.js +253 -0
- package/dist/components/scroll-area.d.ts +13 -0
- package/dist/components/scroll-area.js +34 -0
- package/dist/components/scroll-bar.d.ts +13 -0
- package/dist/components/scroll-bar.js +47 -0
- package/dist/components/select.d.ts +29 -0
- package/dist/components/select.js +140 -0
- package/dist/components/separator.d.ts +6 -0
- package/dist/components/separator.js +15 -0
- package/dist/components/sidebar.d.ts +65 -0
- package/dist/components/sidebar.js +408 -0
- package/dist/components/skeleton.d.ts +5 -0
- package/dist/components/skeleton.js +12 -0
- package/dist/components/slider.d.ts +12 -0
- package/dist/components/slider.js +96 -0
- package/dist/components/sortable.d.ts +44 -0
- package/dist/components/sortable.js +327 -0
- package/dist/components/switch.d.ts +15 -0
- package/dist/components/switch.js +63 -0
- package/dist/components/table.d.ts +12 -0
- package/dist/components/table.js +65 -0
- package/dist/components/tabs.d.ts +12 -0
- package/dist/components/tabs.js +39 -0
- package/dist/components/text.d.ts +14 -0
- package/dist/components/text.js +69 -0
- package/dist/components/textarea.d.ts +9 -0
- package/dist/components/textarea.js +20 -0
- package/dist/components/theme-provider.d.ts +52 -0
- package/dist/components/theme-provider.js +148 -0
- package/dist/components/timeline.d.ts +34 -0
- package/dist/components/timeline.js +147 -0
- package/dist/components/toast.d.ts +17 -0
- package/dist/components/toast.js +161 -0
- package/dist/components/toggle-group.d.ts +14 -0
- package/dist/components/toggle-group.js +53 -0
- package/dist/components/toggle.d.ts +11 -0
- package/dist/components/toggle.js +36 -0
- package/dist/components/toolbar.d.ts +11 -0
- package/dist/components/toolbar.js +49 -0
- package/dist/components/tooltip.d.ts +17 -0
- package/dist/components/tooltip.js +56 -0
- package/dist/components/waveform.d.ts +61 -0
- package/dist/components/waveform.js +500 -0
- package/dist/components/wheel-picker.d.ts +44 -0
- package/dist/components/wheel-picker.js +771 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts +9 -0
- package/dist/hooks/use-copy-to-clipboard.js +36 -0
- package/dist/hooks/use-media-query.d.ts +21 -0
- package/dist/hooks/use-media-query.js +58 -0
- package/dist/styles.css +202 -0
- package/dist/themes/afterglow.css +89 -0
- package/dist/themes/afterglow.scoped.css +90 -0
- package/dist/themes/blacklight.css +89 -0
- package/dist/themes/blacklight.scoped.css +90 -0
- package/dist/themes/cathode.css +89 -0
- package/dist/themes/cathode.scoped.css +90 -0
- package/dist/themes/cel.css +89 -0
- package/dist/themes/cel.scoped.css +90 -0
- package/dist/themes/cinder.css +89 -0
- package/dist/themes/cinder.scoped.css +90 -0
- package/dist/themes/clay.css +89 -0
- package/dist/themes/clay.scoped.css +90 -0
- package/dist/themes/cobalt.css +89 -0
- package/dist/themes/cobalt.scoped.css +90 -0
- package/dist/themes/crimson.css +89 -0
- package/dist/themes/crimson.scoped.css +90 -0
- package/dist/themes/ion.css +89 -0
- package/dist/themes/ion.scoped.css +90 -0
- package/dist/themes/iris.css +89 -0
- package/dist/themes/iris.scoped.css +90 -0
- package/dist/themes/lagoon.css +89 -0
- package/dist/themes/lagoon.scoped.css +90 -0
- package/dist/themes/mochi.css +89 -0
- package/dist/themes/mochi.scoped.css +90 -0
- package/dist/themes/riso.css +89 -0
- package/dist/themes/riso.scoped.css +90 -0
- package/dist/themes/roast.css +89 -0
- package/dist/themes/roast.scoped.css +90 -0
- package/dist/themes/sage.css +89 -0
- package/dist/themes/sage.scoped.css +90 -0
- package/dist/themes/sepia.css +89 -0
- package/dist/themes/sepia.scoped.css +90 -0
- package/dist/themes/sorbet.css +89 -0
- package/dist/themes/sorbet.scoped.css +90 -0
- package/dist/themes/taffy.css +89 -0
- package/dist/themes/taffy.scoped.css +90 -0
- package/dist/themes/toxin.css +89 -0
- package/dist/themes/toxin.scoped.css +90 -0
- package/package.json +140 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Button } from "./button.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
+
//#region src/components/pagination.d.ts
|
|
5
|
+
declare function Pagination({ className, ...props }: React$1.ComponentProps<"nav">): React$1.JSX.Element;
|
|
6
|
+
declare function PaginationContent({ className, ...props }: React$1.ComponentProps<"ul">): React$1.JSX.Element;
|
|
7
|
+
declare function PaginationItem({ ...props }: React$1.ComponentProps<"li">): React$1.JSX.Element;
|
|
8
|
+
type PaginationLinkProps = {
|
|
9
|
+
isActive?: boolean;
|
|
10
|
+
size?: React$1.ComponentProps<typeof Button>["size"];
|
|
11
|
+
} & useRender.ComponentProps<"a">;
|
|
12
|
+
declare function PaginationLink({ className, isActive, size, render, ...props }: PaginationLinkProps): React$1.ReactElement;
|
|
13
|
+
declare function PaginationFirst({ className, ...props }: React$1.ComponentProps<typeof PaginationLink>): React$1.JSX.Element;
|
|
14
|
+
declare function PaginationPrevious({ className, ...props }: React$1.ComponentProps<typeof PaginationLink>): React$1.JSX.Element;
|
|
15
|
+
declare function PaginationNext({ className, ...props }: React$1.ComponentProps<typeof PaginationLink>): React$1.JSX.Element;
|
|
16
|
+
declare function PaginationLast({ className, ...props }: React$1.ComponentProps<typeof PaginationLink>): React$1.JSX.Element;
|
|
17
|
+
declare function PaginationEllipsis({ className, ...props }: React$1.ComponentProps<"span">): React$1.JSX.Element;
|
|
18
|
+
export interface PaginationInputProps extends Omit<React$1.ComponentProps<"input">, "value" | "onChange"> {
|
|
19
|
+
value?: number;
|
|
20
|
+
onChange?: (page: number) => void;
|
|
21
|
+
totalPages?: number;
|
|
22
|
+
}
|
|
23
|
+
declare function PaginationInput({ className, value, onChange, totalPages, ...props }: PaginationInputProps): React$1.JSX.Element;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { Pagination, PaginationContent, PaginationEllipsis, PaginationFirst, PaginationInput, PaginationItem, PaginationLast, PaginationLink, PaginationNext, PaginationPrevious };
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { buttonVariants } from "./button.js";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import * as React$1 from "react";
|
|
6
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
7
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
8
|
+
import { ChevronRight } from "xiod-icons/icons/ChevronRight";
|
|
9
|
+
import { MoreHorizontal } from "xiod-icons/icons/MoreHorizontal";
|
|
10
|
+
import { ChevronLeft } from "xiod-icons/icons/ChevronLeft";
|
|
11
|
+
import { ChevronFirst } from "xiod-icons/icons/ChevronFirst";
|
|
12
|
+
import { ChevronLast } from "xiod-icons/icons/ChevronLast";
|
|
13
|
+
//#region src/components/pagination.tsx
|
|
14
|
+
function Pagination({ className, ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx("nav", {
|
|
16
|
+
"aria-label": "pagination",
|
|
17
|
+
className: cn("mx-auto flex w-full justify-center [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", className),
|
|
18
|
+
"data-slot": "pagination",
|
|
19
|
+
...props
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function PaginationContent({ className, ...props }) {
|
|
23
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
24
|
+
className: cn("flex flex-row items-center gap-1", className),
|
|
25
|
+
"data-slot": "pagination-content",
|
|
26
|
+
...props
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function PaginationItem({ ...props }) {
|
|
30
|
+
return /* @__PURE__ */ jsx("li", {
|
|
31
|
+
"data-slot": "pagination-item",
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function PaginationLink({ className, isActive, size = "icon", render, ...props }) {
|
|
36
|
+
const defaultProps = {
|
|
37
|
+
"aria-current": isActive ? "page" : void 0,
|
|
38
|
+
className: render ? className : cn(buttonVariants({
|
|
39
|
+
size,
|
|
40
|
+
variant: isActive ? "outline" : "ghost"
|
|
41
|
+
}), className),
|
|
42
|
+
"data-active": isActive,
|
|
43
|
+
"data-slot": "pagination-link"
|
|
44
|
+
};
|
|
45
|
+
return useRender({
|
|
46
|
+
defaultTagName: "a",
|
|
47
|
+
props: mergeProps(defaultProps, props),
|
|
48
|
+
render
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function PaginationFirst({ className, ...props }) {
|
|
52
|
+
return /* @__PURE__ */ jsxs(PaginationLink, {
|
|
53
|
+
"aria-label": "Go to first page",
|
|
54
|
+
className: cn("max-sm:aspect-square max-sm:p-0", className),
|
|
55
|
+
size: "default",
|
|
56
|
+
...props,
|
|
57
|
+
children: [/* @__PURE__ */ jsx(ChevronFirst, { className: "sm:-ms-1" }), /* @__PURE__ */ jsx("span", {
|
|
58
|
+
className: "max-sm:hidden",
|
|
59
|
+
children: "First"
|
|
60
|
+
})]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function PaginationPrevious({ className, ...props }) {
|
|
64
|
+
return /* @__PURE__ */ jsxs(PaginationLink, {
|
|
65
|
+
"aria-label": "Go to previous page",
|
|
66
|
+
className: cn("max-sm:aspect-square max-sm:p-0", className),
|
|
67
|
+
size: "default",
|
|
68
|
+
...props,
|
|
69
|
+
children: [/* @__PURE__ */ jsx(ChevronLeft, { className: "sm:-ms-1" }), /* @__PURE__ */ jsx("span", {
|
|
70
|
+
className: "max-sm:hidden",
|
|
71
|
+
children: "Previous"
|
|
72
|
+
})]
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function PaginationNext({ className, ...props }) {
|
|
76
|
+
return /* @__PURE__ */ jsxs(PaginationLink, {
|
|
77
|
+
"aria-label": "Go to next page",
|
|
78
|
+
className: cn("max-sm:aspect-square max-sm:p-0", className),
|
|
79
|
+
size: "default",
|
|
80
|
+
...props,
|
|
81
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
82
|
+
className: "max-sm:hidden",
|
|
83
|
+
children: "Next"
|
|
84
|
+
}), /* @__PURE__ */ jsx(ChevronRight, { className: "sm:-me-1" })]
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function PaginationLast({ className, ...props }) {
|
|
88
|
+
return /* @__PURE__ */ jsxs(PaginationLink, {
|
|
89
|
+
"aria-label": "Go to last page",
|
|
90
|
+
className: cn("max-sm:aspect-square max-sm:p-0", className),
|
|
91
|
+
size: "default",
|
|
92
|
+
...props,
|
|
93
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
94
|
+
className: "max-sm:hidden",
|
|
95
|
+
children: "Last"
|
|
96
|
+
}), /* @__PURE__ */ jsx(ChevronLast, { className: "sm:-me-1" })]
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function PaginationEllipsis({ className, ...props }) {
|
|
100
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
101
|
+
"aria-hidden": true,
|
|
102
|
+
className: cn("flex min-w-7 justify-center", className),
|
|
103
|
+
"data-slot": "pagination-ellipsis",
|
|
104
|
+
...props,
|
|
105
|
+
children: [/* @__PURE__ */ jsx(MoreHorizontal, { className: "size-5 sm:size-4" }), /* @__PURE__ */ jsx("span", {
|
|
106
|
+
className: "sr-only",
|
|
107
|
+
children: "More pages"
|
|
108
|
+
})]
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
function PaginationInput({ className, value, onChange, totalPages, ...props }) {
|
|
112
|
+
const [editingValue, setEditingValue] = React$1.useState(value ? value.toString() : "");
|
|
113
|
+
React$1.useEffect(() => {
|
|
114
|
+
setEditingValue(value ? value.toString() : "");
|
|
115
|
+
}, [value]);
|
|
116
|
+
const handleCommit = (val) => {
|
|
117
|
+
let num = Number.parseInt(val, 10);
|
|
118
|
+
if (Number.isNaN(num) || num < 1) num = 1;
|
|
119
|
+
if (totalPages && num > totalPages) num = totalPages;
|
|
120
|
+
setEditingValue(num.toString());
|
|
121
|
+
if (onChange) onChange(num);
|
|
122
|
+
};
|
|
123
|
+
return /* @__PURE__ */ jsx("div", {
|
|
124
|
+
className: cn("relative inline-flex w-12 rounded-lg border border-input bg-background not-dark:bg-clip-padding text-sm text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 has-aria-invalid:border-destructive/36 has-focus-visible:border-ring has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none has-focus-visible:ring-[3px] dark:bg-input/32 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]", className),
|
|
125
|
+
"data-slot": "pagination-input-wrapper",
|
|
126
|
+
children: /* @__PURE__ */ jsx("input", {
|
|
127
|
+
"aria-label": "Go to page",
|
|
128
|
+
type: "text",
|
|
129
|
+
inputMode: "numeric",
|
|
130
|
+
pattern: "[0-9]*",
|
|
131
|
+
className: "h-9 w-full rounded-[inherit] bg-transparent px-2 text-center text-sm outline-none sm:h-8",
|
|
132
|
+
value: editingValue,
|
|
133
|
+
onChange: (e) => setEditingValue(e.target.value),
|
|
134
|
+
onBlur: (e) => handleCommit(e.target.value),
|
|
135
|
+
onKeyDown: (e) => {
|
|
136
|
+
if (e.key === "Enter") {
|
|
137
|
+
e.preventDefault();
|
|
138
|
+
handleCommit(e.currentTarget.value);
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"data-slot": "pagination-input",
|
|
142
|
+
...props
|
|
143
|
+
})
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
//#endregion
|
|
147
|
+
export { Pagination, PaginationContent, PaginationEllipsis, PaginationFirst, PaginationInput, PaginationItem, PaginationLast, PaginationLink, PaginationNext, PaginationPrevious };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { Popover as Popover$1 } from "@base-ui/react/popover";
|
|
3
|
+
//#region src/components/popover.d.ts
|
|
4
|
+
declare const PopoverCreateHandle: typeof Popover$1.createHandle;
|
|
5
|
+
declare const Popover: typeof Popover$1.Root;
|
|
6
|
+
declare function PopoverTrigger({ className, children, ...props }: Popover$1.Trigger.Props): React$1.JSX.Element;
|
|
7
|
+
declare function PopoverPopup({ children, className, side, align, sideOffset, alignOffset, tooltipStyle, anchor, hideArrow, collisionAvoidance, ...props }: Popover$1.Popup.Props & {
|
|
8
|
+
side?: Popover$1.Positioner.Props["side"];
|
|
9
|
+
align?: Popover$1.Positioner.Props["align"];
|
|
10
|
+
sideOffset?: Popover$1.Positioner.Props["sideOffset"];
|
|
11
|
+
alignOffset?: Popover$1.Positioner.Props["alignOffset"];
|
|
12
|
+
tooltipStyle?: boolean;
|
|
13
|
+
anchor?: Popover$1.Positioner.Props["anchor"];
|
|
14
|
+
hideArrow?: boolean;
|
|
15
|
+
collisionAvoidance?: Popover$1.Positioner.Props["collisionAvoidance"];
|
|
16
|
+
}): React$1.JSX.Element;
|
|
17
|
+
declare function PopoverClose({ ...props }: Popover$1.Close.Props): React$1.JSX.Element;
|
|
18
|
+
declare function PopoverTitle({ className, ...props }: Popover$1.Title.Props): React$1.JSX.Element;
|
|
19
|
+
declare function PopoverDescription({ className, ...props }: Popover$1.Description.Props): React$1.JSX.Element;
|
|
20
|
+
declare const PopoverArrow: React$1.ForwardRefExoticComponent<Omit<import("@base-ui/react").PopoverArrowProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Popover, PopoverArrow, PopoverClose, PopoverPopup as PopoverContent, PopoverPopup, PopoverCreateHandle, PopoverDescription, PopoverTitle, PopoverTrigger };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Popover as Popover$1 } from "@base-ui/react/popover";
|
|
5
|
+
//#region src/components/popover.tsx
|
|
6
|
+
const PopoverCreateHandle = Popover$1.createHandle;
|
|
7
|
+
const Popover = Popover$1.Root;
|
|
8
|
+
function PopoverTrigger({ className, children, ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(Popover$1.Trigger, {
|
|
10
|
+
className: cn(className),
|
|
11
|
+
"data-slot": "popover-trigger",
|
|
12
|
+
...props,
|
|
13
|
+
children
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function PopoverPopup({ children, className, side = "bottom", align = "center", sideOffset = 8, alignOffset = 0, tooltipStyle = false, anchor, hideArrow = false, collisionAvoidance, ...props }) {
|
|
17
|
+
return /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */ jsx(Popover$1.Positioner, {
|
|
18
|
+
align,
|
|
19
|
+
alignOffset,
|
|
20
|
+
anchor,
|
|
21
|
+
className: "z-50 h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom,transform] data-instant:transition-none",
|
|
22
|
+
"data-slot": "popover-positioner",
|
|
23
|
+
side,
|
|
24
|
+
sideOffset,
|
|
25
|
+
collisionAvoidance,
|
|
26
|
+
children: /* @__PURE__ */ jsxs(Popover$1.Popup, {
|
|
27
|
+
className: cn("relative flex h-(--popup-height,auto) w-(--popup-width,auto) origin-(--transform-origin) rounded-lg border bg-popover not-dark:bg-clip-padding text-popover-foreground shadow-lg/5 outline-none transition-[width,height,scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] has-data-[slot=calendar]:rounded-xl has-data-[slot=calendar]:before:rounded-[calc(var(--radius-xl)-1px)] data-starting-style:scale-98 data-starting-style:opacity-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]", tooltipStyle && "w-fit text-balance rounded-md text-xs shadow-md/5 before:rounded-[calc(var(--radius-md)-1px)]", className),
|
|
28
|
+
"data-slot": "popover-popup",
|
|
29
|
+
...props,
|
|
30
|
+
children: [!hideArrow && /* @__PURE__ */ jsx(Popover$1.Arrow, {
|
|
31
|
+
className: "z-10 flex data-[side=bottom]:-top-[9px] data-[side=bottom]:rotate-0 data-[side=left]:right-[-14px] data-[side=left]:rotate-90 data-[side=right]:left-[-14px] data-[side=right]:-rotate-90 data-[side=top]:-bottom-[9px] data-[side=top]:rotate-180",
|
|
32
|
+
children: /* @__PURE__ */ jsx(ArrowSvg, {})
|
|
33
|
+
}), /* @__PURE__ */ jsx(Popover$1.Viewport, {
|
|
34
|
+
className: cn("relative size-full max-h-(--available-height) overflow-clip px-(--viewport-inline-padding) py-4 [--viewport-inline-padding:--spacing(4)] has-data-[slot=calendar]:p-2 data-instant:transition-none **:data-current:data-ending-style:opacity-0 **:data-current:data-starting-style:opacity-0 **:data-previous:data-ending-style:opacity-0 **:data-previous:data-starting-style:opacity-0 **:data-current:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-previous:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-current:opacity-100 **:data-previous:opacity-100 **:data-current:transition-opacity **:data-previous:transition-opacity", tooltipStyle ? "py-1 [--viewport-inline-padding:--spacing(2)]" : "not-data-transitioning:overflow-y-auto"),
|
|
35
|
+
"data-slot": "popover-viewport",
|
|
36
|
+
children
|
|
37
|
+
})]
|
|
38
|
+
})
|
|
39
|
+
}) });
|
|
40
|
+
}
|
|
41
|
+
function PopoverClose({ ...props }) {
|
|
42
|
+
return /* @__PURE__ */ jsx(Popover$1.Close, {
|
|
43
|
+
"data-slot": "popover-close",
|
|
44
|
+
...props
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function PopoverTitle({ className, ...props }) {
|
|
48
|
+
return /* @__PURE__ */ jsx(Popover$1.Title, {
|
|
49
|
+
className: cn("font-semibold text-lg leading-none", className),
|
|
50
|
+
"data-slot": "popover-title",
|
|
51
|
+
...props
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function PopoverDescription({ className, ...props }) {
|
|
55
|
+
return /* @__PURE__ */ jsx(Popover$1.Description, {
|
|
56
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
57
|
+
"data-slot": "popover-description",
|
|
58
|
+
...props
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function ArrowSvg(props) {
|
|
62
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
63
|
+
width: "20",
|
|
64
|
+
height: "10",
|
|
65
|
+
viewBox: "0 0 20 10",
|
|
66
|
+
fill: "none",
|
|
67
|
+
...props,
|
|
68
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
69
|
+
d: "M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z",
|
|
70
|
+
className: "fill-popover"
|
|
71
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
72
|
+
d: "M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z",
|
|
73
|
+
className: "fill-border"
|
|
74
|
+
})]
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
const PopoverArrow = Popover$1.Arrow;
|
|
78
|
+
//#endregion
|
|
79
|
+
export { Popover, PopoverArrow, PopoverClose, PopoverPopup as PopoverContent, PopoverPopup, PopoverCreateHandle, PopoverDescription, PopoverTitle, PopoverTrigger };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { PreviewCard as PreviewCard$1 } from "@base-ui/react/preview-card";
|
|
3
|
+
//#region src/components/preview-card.d.ts
|
|
4
|
+
declare const PreviewCard: <Payload>(props: PreviewCard$1.Root.Props<Payload>) => React$1.JSX.Element;
|
|
5
|
+
declare function PreviewCardTrigger({ className, ...props }: PreviewCard$1.Trigger.Props): React$1.JSX.Element;
|
|
6
|
+
declare function PreviewCardArrow({ className, children, ...props }: PreviewCard$1.Arrow.Props): React$1.JSX.Element;
|
|
7
|
+
declare function PreviewCardPopup({ className, children, align, alignOffset, hideArrow, side, sideOffset, anchor, ...props }: PreviewCard$1.Popup.Props & {
|
|
8
|
+
align?: PreviewCard$1.Positioner.Props["align"];
|
|
9
|
+
alignOffset?: PreviewCard$1.Positioner.Props["alignOffset"];
|
|
10
|
+
side?: PreviewCard$1.Positioner.Props["side"];
|
|
11
|
+
sideOffset?: PreviewCard$1.Positioner.Props["sideOffset"];
|
|
12
|
+
anchor?: PreviewCard$1.Positioner.Props["anchor"];
|
|
13
|
+
hideArrow?: boolean;
|
|
14
|
+
}): React$1.JSX.Element;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { PreviewCard as HoverCard, PreviewCard, PreviewCardArrow as HoverCardArrow, PreviewCardArrow, PreviewCardPopup as HoverCardContent, PreviewCardPopup, PreviewCardTrigger as HoverCardTrigger, PreviewCardTrigger };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { PreviewCard as PreviewCard$1 } from "@base-ui/react/preview-card";
|
|
5
|
+
//#region src/components/preview-card.tsx
|
|
6
|
+
const PreviewCard = PreviewCard$1.Root;
|
|
7
|
+
function PreviewCardTrigger({ className, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(PreviewCard$1.Trigger, {
|
|
9
|
+
className: cn(className),
|
|
10
|
+
"data-slot": "preview-card-trigger",
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function PreviewCardArrow({ className, children, ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx(PreviewCard$1.Arrow, {
|
|
16
|
+
className: cn("z-10 flex data-[side=bottom]:-top-[9px] data-[side=bottom]:rotate-0 data-[side=left]:right-[-14px] data-[side=left]:rotate-90 data-[side=right]:left-[-14px] data-[side=right]:-rotate-90 data-[side=top]:-bottom-[9px] data-[side=top]:rotate-180", className),
|
|
17
|
+
"data-slot": "preview-card-arrow",
|
|
18
|
+
...props,
|
|
19
|
+
children: children ?? /* @__PURE__ */ jsx(ArrowSvg, {})
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function PreviewCardPopup({ className, children, align = "center", alignOffset = 0, hideArrow = false, side = "bottom", sideOffset = 8, anchor, ...props }) {
|
|
23
|
+
return /* @__PURE__ */ jsx(PreviewCard$1.Portal, { children: /* @__PURE__ */ jsx(PreviewCard$1.Positioner, {
|
|
24
|
+
align,
|
|
25
|
+
alignOffset,
|
|
26
|
+
anchor,
|
|
27
|
+
className: "z-50 h-(--positioner-height) w-(--positioner-width) max-w-(--available-width)",
|
|
28
|
+
"data-slot": "preview-card-positioner",
|
|
29
|
+
side,
|
|
30
|
+
sideOffset,
|
|
31
|
+
children: /* @__PURE__ */ jsxs(PreviewCard$1.Popup, {
|
|
32
|
+
className: cn("relative flex h-(--popup-height,auto) w-(--popup-width,auto) max-w-(--available-width) origin-(--transform-origin) rounded-lg border bg-popover not-dark:bg-clip-padding text-balance text-popover-foreground text-sm shadow-lg/5 transition-[width,height,scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]", className),
|
|
33
|
+
"data-slot": "preview-card-popup",
|
|
34
|
+
...props,
|
|
35
|
+
children: [!hideArrow && /* @__PURE__ */ jsx(PreviewCardArrow, {}), /* @__PURE__ */ jsx("div", {
|
|
36
|
+
className: "relative flex min-w-64 max-w-full flex-col gap-4 p-4",
|
|
37
|
+
"data-slot": "preview-card-panel",
|
|
38
|
+
children
|
|
39
|
+
})]
|
|
40
|
+
})
|
|
41
|
+
}) });
|
|
42
|
+
}
|
|
43
|
+
function ArrowSvg(props) {
|
|
44
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
45
|
+
width: "20",
|
|
46
|
+
height: "10",
|
|
47
|
+
viewBox: "0 0 20 10",
|
|
48
|
+
fill: "none",
|
|
49
|
+
...props,
|
|
50
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
51
|
+
d: "M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z",
|
|
52
|
+
className: "fill-popover"
|
|
53
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
54
|
+
d: "M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z",
|
|
55
|
+
className: "fill-border"
|
|
56
|
+
})]
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { PreviewCard as HoverCard, PreviewCard, PreviewCardArrow as HoverCardArrow, PreviewCardArrow, PreviewCardPopup as HoverCardContent, PreviewCardPopup, PreviewCardTrigger as HoverCardTrigger, PreviewCardTrigger };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { Progress as Progress$1 } from "@base-ui/react/progress";
|
|
3
|
+
//#region src/components/progress.d.ts
|
|
4
|
+
export interface ProgressProps extends Progress$1.Root.Props {
|
|
5
|
+
variant?: "default" | "expressive";
|
|
6
|
+
size?: "sm" | "default" | "lg" | "xl" | "2xl";
|
|
7
|
+
}
|
|
8
|
+
declare function Progress({ className, variant, size, children, ...props }: ProgressProps): React$1.JSX.Element;
|
|
9
|
+
declare function ProgressLabel({ className, ...props }: Progress$1.Label.Props): React$1.JSX.Element;
|
|
10
|
+
export declare const progressTrackVariants: (props?: ({
|
|
11
|
+
variant?: "default" | "expressive" | null | undefined;
|
|
12
|
+
size?: "sm" | "lg" | "xl" | "2xl" | "default" | null | undefined;
|
|
13
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
|
+
declare function ProgressTrack({ className, ...props }: Progress$1.Track.Props): React$1.JSX.Element;
|
|
15
|
+
export declare const progressIndicatorVariants: (props?: ({
|
|
16
|
+
variant?: "default" | "expressive" | null | undefined;
|
|
17
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
18
|
+
declare function ProgressIndicator({ className, ...props }: Progress$1.Indicator.Props): React$1.JSX.Element;
|
|
19
|
+
declare function ProgressValue({ className, ...props }: Progress$1.Value.Props): React$1.JSX.Element;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue };
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import * as React$1 from "react";
|
|
6
|
+
import { Progress as Progress$1 } from "@base-ui/react/progress";
|
|
7
|
+
//#region src/components/progress.tsx
|
|
8
|
+
const ProgressContext = React$1.createContext({
|
|
9
|
+
variant: "default",
|
|
10
|
+
size: "default"
|
|
11
|
+
});
|
|
12
|
+
function Progress({ className, variant = "default", size = "default", children, ...props }) {
|
|
13
|
+
const contextValue = React$1.useMemo(() => ({
|
|
14
|
+
variant,
|
|
15
|
+
size
|
|
16
|
+
}), [variant, size]);
|
|
17
|
+
return /* @__PURE__ */ jsx(Progress$1.Root, {
|
|
18
|
+
className: cn("flex w-full flex-col gap-2", className),
|
|
19
|
+
"data-slot": "progress",
|
|
20
|
+
...props,
|
|
21
|
+
children: /* @__PURE__ */ jsx(ProgressContext.Provider, {
|
|
22
|
+
value: contextValue,
|
|
23
|
+
children: children ? children : /* @__PURE__ */ jsx(ProgressTrack, { children: /* @__PURE__ */ jsx(ProgressIndicator, {}) })
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function ProgressLabel({ className, ...props }) {
|
|
28
|
+
return /* @__PURE__ */ jsx(Progress$1.Label, {
|
|
29
|
+
className: cn("font-medium text-sm", className),
|
|
30
|
+
"data-slot": "progress-label",
|
|
31
|
+
...props
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
const progressTrackVariants = cva("block w-full overflow-hidden rounded-full", {
|
|
35
|
+
variants: {
|
|
36
|
+
variant: {
|
|
37
|
+
default: "bg-input inset-shadow-[0_1.5px_3px_var(--input)]",
|
|
38
|
+
expressive: "bg-input [mask-repeat:repeat-x] inset-shadow-[0_1.5px_3px_var(--input)]"
|
|
39
|
+
},
|
|
40
|
+
size: {
|
|
41
|
+
sm: "",
|
|
42
|
+
default: "",
|
|
43
|
+
lg: "",
|
|
44
|
+
xl: "",
|
|
45
|
+
"2xl": ""
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
compoundVariants: [
|
|
49
|
+
{
|
|
50
|
+
variant: "default",
|
|
51
|
+
size: "sm",
|
|
52
|
+
className: "h-1"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
variant: "default",
|
|
56
|
+
size: "default",
|
|
57
|
+
className: "h-1.5"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
variant: "default",
|
|
61
|
+
size: "lg",
|
|
62
|
+
className: "h-2"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
variant: "default",
|
|
66
|
+
size: "xl",
|
|
67
|
+
className: "h-2.5"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
variant: "default",
|
|
71
|
+
size: "2xl",
|
|
72
|
+
className: "h-3"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
variant: "expressive",
|
|
76
|
+
size: "sm",
|
|
77
|
+
className: "h-1.5 [mask-image:url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%228%22%20height=%226%22%20viewBox=%220%200%208%206%22%20preserveAspectRatio=%22none%22%3E%3Cpath%20d=%22M-4,3%20Q-2,6%200,3%20T4,3%20T8,3%20T12,3%22%20fill=%22none%22%20stroke=%22black%22%20stroke-width=%222%22%20/%3E%3C/svg%3E')] [mask-size:8px_100%]"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
variant: "expressive",
|
|
81
|
+
size: "default",
|
|
82
|
+
className: "h-2.5 [mask-image:url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%2212%22%20height=%2210%22%20viewBox=%220%200%2012%2010%22%20preserveAspectRatio=%22none%22%3E%3Cpath%20d=%22M-6,5%20Q-3,10%200,5%20T6,5%20T12,5%20T18,5%22%20fill=%22none%22%20stroke=%22black%22%20stroke-width=%223%22%20/%3E%3C/svg%3E')] [mask-size:12px_100%]"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
variant: "expressive",
|
|
86
|
+
size: "lg",
|
|
87
|
+
className: "h-3.5 [mask-image:url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%2216%22%20height=%2214%22%20viewBox=%220%200%2016%2014%22%20preserveAspectRatio=%22none%22%3E%3Cpath%20d=%22M-8,7%20Q-4,14%200,7%20T8,7%20T16,7%20T24,7%22%20fill=%22none%22%20stroke=%22black%22%20stroke-width=%224%22%20/%3E%3C/svg%3E')] [mask-size:16px_100%]"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
variant: "expressive",
|
|
91
|
+
size: "xl",
|
|
92
|
+
className: "h-5 [mask-image:url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%2224%22%20height=%2220%22%20viewBox=%220%200%2024%2020%22%20preserveAspectRatio=%22none%22%3E%3Cpath%20d=%22M-12,10%20Q-6,20%200,10%20T12,10%20T24,10%20T36,10%22%20fill=%22none%22%20stroke=%22black%22%20stroke-width=%225%22%20/%3E%3C/svg%3E')] [mask-size:24px_100%]"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
variant: "expressive",
|
|
96
|
+
size: "2xl",
|
|
97
|
+
className: "h-6 [mask-image:url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%2228%22%20height=%2224%22%20viewBox=%220%200%2028%2024%22%20preserveAspectRatio=%22none%22%3E%3Cpath%20d=%22M-14,12%20Q-7,24%200,12%20T14,12%20T28,12%20T42,12%22%20fill=%22none%22%20stroke=%22black%22%20stroke-width=%226%22%20/%3E%3C/svg%3E')] [mask-size:28px_100%]"
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
defaultVariants: {
|
|
101
|
+
variant: "default",
|
|
102
|
+
size: "default"
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
function ProgressTrack({ className, ...props }) {
|
|
106
|
+
const { variant, size } = React$1.useContext(ProgressContext);
|
|
107
|
+
return /* @__PURE__ */ jsx(Progress$1.Track, {
|
|
108
|
+
className: cn(progressTrackVariants({
|
|
109
|
+
variant,
|
|
110
|
+
size
|
|
111
|
+
}), className),
|
|
112
|
+
"data-slot": "progress-track",
|
|
113
|
+
...props
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
const progressIndicatorVariants = cva("bg-primary inset-shadow-[0_1px_--alpha(var(--primary-foreground)/16%)] transition-[width,transform] duration-500", {
|
|
117
|
+
variants: { variant: {
|
|
118
|
+
default: "size-full",
|
|
119
|
+
expressive: "size-full"
|
|
120
|
+
} },
|
|
121
|
+
defaultVariants: { variant: "default" }
|
|
122
|
+
});
|
|
123
|
+
function ProgressIndicator({ className, ...props }) {
|
|
124
|
+
const { variant } = React$1.useContext(ProgressContext);
|
|
125
|
+
return /* @__PURE__ */ jsx(Progress$1.Indicator, {
|
|
126
|
+
className: cn(progressIndicatorVariants({ variant }), className),
|
|
127
|
+
"data-slot": "progress-indicator",
|
|
128
|
+
...props
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
function ProgressValue({ className, ...props }) {
|
|
132
|
+
return /* @__PURE__ */ jsx(Progress$1.Value, {
|
|
133
|
+
className: cn("text-sm tabular-nums", className),
|
|
134
|
+
"data-slot": "progress-value",
|
|
135
|
+
...props
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
//#endregion
|
|
139
|
+
export { Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, progressIndicatorVariants, progressTrackVariants };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { Radio as Radio$1 } from "@base-ui/react/radio";
|
|
4
|
+
import { RadioGroup } from "@base-ui/react/radio-group";
|
|
5
|
+
//#region src/components/radio.d.ts
|
|
6
|
+
declare const radioItemVariants: (props?: ({
|
|
7
|
+
variant?: "default" | "diamond" | "expressive" | "sharp" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
declare const radioIndicatorVariants: (props?: ({
|
|
10
|
+
variant?: "default" | "diamond" | "expressive" | "sharp" | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
|
+
declare function Radio({ className, ...props }: RadioGroup.Props): React$1.JSX.Element;
|
|
13
|
+
interface RadioItemProps extends Radio$1.Root.Props, VariantProps<typeof radioItemVariants> {}
|
|
14
|
+
declare function RadioItem({ className, variant, ...props }: RadioItemProps): React$1.JSX.Element;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Radio, Radio as RadioGroup, RadioItem as RadioGroupItem, RadioItem, radioIndicatorVariants, radioItemVariants };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { Radio as Radio$1 } from "@base-ui/react/radio";
|
|
6
|
+
import { RadioGroup } from "@base-ui/react/radio-group";
|
|
7
|
+
//#region src/components/radio.tsx
|
|
8
|
+
const radioItemVariants = cva("relative inline-flex size-4.5 shrink-0 items-center justify-center border border-input bg-background not-dark:bg-clip-padding shadow-xs/5 outline-none ring-ring transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[inherit] before:shadow-[0_1px_var(--border)] not-data-checked:not-data-disabled:inset-shadow-[0_1.5px_3px_var(--input)] pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/48 data-disabled:pointer-events-none data-disabled:opacity-64 sm:size-4 dark:not-data-checked:bg-input/32 dark:aria-invalid:ring-destructive/24 [[data-disabled],[data-checked],[aria-invalid]]:shadow-none", {
|
|
9
|
+
variants: { variant: {
|
|
10
|
+
default: "rounded-full before:rounded-full",
|
|
11
|
+
diamond: "rotate-45 rounded-[.35rem] before:rounded-[5px]",
|
|
12
|
+
expressive: "rounded-full before:rounded-full",
|
|
13
|
+
sharp: "rounded-[.25rem] before:rounded-[3px]"
|
|
14
|
+
} },
|
|
15
|
+
defaultVariants: { variant: "default" }
|
|
16
|
+
});
|
|
17
|
+
const radioIndicatorVariants = cva("-inset-px absolute flex size-4.5 items-center justify-center text-primary-foreground transition-[transform,opacity] duration-205 ease-out data-unchecked:scale-50 data-unchecked:opacity-0 data-checked:scale-100 data-checked:opacity-100 data-checked:bg-primary data-checked:inset-shadow-[0_1px_--alpha(var(--primary-foreground)/16%)] data-checked:shadow-primary/24 data-checked:shadow-xs sm:size-4", {
|
|
18
|
+
variants: { variant: {
|
|
19
|
+
default: "rounded-full before:size-2 before:rounded-full before:bg-primary-foreground sm:before:size-1.5 before:transition-transform before:duration-200 before:ease-out data-unchecked:before:scale-0 data-checked:before:scale-100",
|
|
20
|
+
diamond: "rounded-[.35rem] before:size-2 before:rounded-[4px] before:bg-primary-foreground sm:before:size-1.5 before:transition-transform before:duration-200 before:ease-out data-unchecked:before:scale-0 data-checked:before:scale-100",
|
|
21
|
+
expressive: "rounded-full",
|
|
22
|
+
sharp: "rounded-[.25rem] before:size-2 before:rounded-[3px] before:bg-primary-foreground sm:before:size-1.5 before:transition-transform before:duration-200 before:ease-out data-unchecked:before:scale-0 data-checked:before:scale-100"
|
|
23
|
+
} },
|
|
24
|
+
defaultVariants: { variant: "default" }
|
|
25
|
+
});
|
|
26
|
+
function Radio({ className, ...props }) {
|
|
27
|
+
return /* @__PURE__ */ jsx(RadioGroup, {
|
|
28
|
+
className: cn("flex flex-col gap-3", className),
|
|
29
|
+
"data-slot": "radio-group",
|
|
30
|
+
...props
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function RadioItem({ className, variant, ...props }) {
|
|
34
|
+
return /* @__PURE__ */ jsx(Radio$1.Root, {
|
|
35
|
+
className: cn(radioItemVariants({ variant }), className),
|
|
36
|
+
"data-slot": "radio-item",
|
|
37
|
+
...props,
|
|
38
|
+
children: /* @__PURE__ */ jsx(Radio$1.Indicator, {
|
|
39
|
+
className: cn(radioIndicatorVariants({ variant })),
|
|
40
|
+
"data-slot": "radio-indicator",
|
|
41
|
+
keepMounted: true,
|
|
42
|
+
render: (indicatorProps, state) => /* @__PURE__ */ jsx("span", {
|
|
43
|
+
...indicatorProps,
|
|
44
|
+
children: variant === "expressive" && /* @__PURE__ */ jsx("svg", {
|
|
45
|
+
className: "size-3.5 sm:size-3",
|
|
46
|
+
fill: "none",
|
|
47
|
+
height: "24",
|
|
48
|
+
stroke: "currentColor",
|
|
49
|
+
strokeLinecap: "round",
|
|
50
|
+
strokeLinejoin: "round",
|
|
51
|
+
strokeWidth: "3",
|
|
52
|
+
viewBox: "0 0 24 24",
|
|
53
|
+
width: "24",
|
|
54
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
55
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
56
|
+
className: "transition-[stroke-dashoffset] duration-200 ease-out",
|
|
57
|
+
d: "M5.252 12.7 10.2 18.63 18.748 5.37",
|
|
58
|
+
strokeDasharray: "24",
|
|
59
|
+
strokeDashoffset: state.checked ? 0 : 24,
|
|
60
|
+
style: { transitionDelay: state.checked ? "50ms" : "0ms" }
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
})
|
|
64
|
+
})
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
export { Radio, Radio as RadioGroup, RadioItem as RadioGroupItem, RadioItem, radioIndicatorVariants, radioItemVariants };
|