@codefast/ui 0.3.11-canary.1 → 0.3.11
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/CHANGELOG.md +36 -0
- package/README.md +34 -14
- package/dist/components/accordion.d.ts +29 -10
- package/dist/components/accordion.js +38 -37
- package/dist/components/alert-dialog.d.ts +60 -24
- package/dist/components/alert-dialog.js +69 -72
- package/dist/components/alert.d.ts +27 -15
- package/dist/components/alert.js +29 -31
- package/dist/components/aspect-ratio.d.ts +8 -4
- package/dist/components/aspect-ratio.js +7 -5
- package/dist/components/avatar.d.ts +17 -6
- package/dist/components/avatar.js +19 -17
- package/dist/components/badge.d.ts +21 -14
- package/dist/components/badge.js +19 -22
- package/dist/components/breadcrumb.d.ts +35 -12
- package/dist/components/breadcrumb.js +48 -54
- package/dist/components/button-group.d.ts +29 -14
- package/dist/components/button-group.js +27 -32
- package/dist/components/button.d.ts +35 -25
- package/dist/components/button.js +50 -48
- package/dist/components/calendar.d.ts +24 -9
- package/dist/components/calendar.js +92 -98
- package/dist/components/card.d.ts +34 -10
- package/dist/components/card.js +39 -37
- package/dist/components/carousel.d.ts +55 -24
- package/dist/components/carousel.js +113 -130
- package/dist/components/chart.d.ts +72 -36
- package/dist/components/chart.js +154 -166
- package/dist/components/checkbox-cards.d.ts +15 -8
- package/dist/components/checkbox-cards.js +22 -25
- package/dist/components/checkbox-group.d.ts +16 -8
- package/dist/components/checkbox-group.js +19 -19
- package/dist/components/checkbox.d.ts +9 -4
- package/dist/components/checkbox.js +14 -14
- package/dist/components/collapsible.d.ts +14 -6
- package/dist/components/collapsible.js +18 -16
- package/dist/components/command.d.ts +55 -23
- package/dist/components/command.js +70 -85
- package/dist/components/context-menu.d.ts +72 -22
- package/dist/components/context-menu.js +88 -109
- package/dist/components/dialog.d.ts +53 -22
- package/dist/components/dialog.js +71 -85
- package/dist/components/drawer.d.ts +60 -28
- package/dist/components/drawer.js +59 -67
- package/dist/components/dropdown-menu.d.ts +73 -22
- package/dist/components/dropdown-menu.js +95 -112
- package/dist/components/empty.d.ts +37 -15
- package/dist/components/empty.js +43 -45
- package/dist/components/field.d.ts +63 -25
- package/dist/components/field.js +88 -104
- package/dist/components/form.d.ts +37 -15
- package/dist/components/form.js +65 -70
- package/dist/components/hover-card.d.ts +21 -7
- package/dist/components/hover-card.js +24 -24
- package/dist/components/input-group.d.ts +53 -28
- package/dist/components/input-group.js +63 -77
- package/dist/components/input-number.d.ts +28 -7
- package/dist/components/input-number.js +55 -59
- package/dist/components/input-otp.d.ts +24 -10
- package/dist/components/input-otp.js +33 -37
- package/dist/components/input-password.d.ts +12 -5
- package/dist/components/input-password.js +31 -32
- package/dist/components/input-search.d.ts +18 -8
- package/dist/components/input-search.js +43 -41
- package/dist/components/input.d.ts +10 -4
- package/dist/components/input.js +9 -7
- package/dist/components/item.d.ts +69 -32
- package/dist/components/item.js +89 -92
- package/dist/components/kbd.d.ts +13 -5
- package/dist/components/kbd.js +13 -11
- package/dist/components/label.d.ts +9 -4
- package/dist/components/label.js +9 -7
- package/dist/components/menubar.d.ts +80 -23
- package/dist/components/menubar.js +97 -118
- package/dist/components/native-select.d.ts +16 -6
- package/dist/components/native-select.js +25 -26
- package/dist/components/navigation-menu.d.ts +36 -12
- package/dist/components/navigation-menu.js +60 -75
- package/dist/components/pagination.d.ts +35 -14
- package/dist/components/pagination.js +54 -69
- package/dist/components/popover.d.ts +24 -8
- package/dist/components/popover.js +28 -28
- package/dist/components/progress-circle.d.ts +106 -88
- package/dist/components/progress-circle.js +106 -138
- package/dist/components/progress.d.ts +10 -4
- package/dist/components/progress.js +14 -14
- package/dist/components/radio-cards.d.ts +10 -4
- package/dist/components/radio-cards.js +22 -23
- package/dist/components/radio-group.d.ts +13 -5
- package/dist/components/radio-group.js +18 -16
- package/dist/components/radio.d.ts +12 -5
- package/dist/components/radio.js +10 -8
- package/dist/components/resizable.d.ts +18 -7
- package/dist/components/resizable.js +22 -22
- package/dist/components/scroll-area.d.ts +33 -20
- package/dist/components/scroll-area.js +84 -88
- package/dist/components/select.d.ts +50 -16
- package/dist/components/select.js +77 -96
- package/dist/components/separator.d.ts +29 -19
- package/dist/components/separator.js +36 -34
- package/dist/components/sheet.d.ts +62 -29
- package/dist/components/sheet.js +79 -100
- package/dist/components/sidebar.d.ts +160 -66
- package/dist/components/sidebar.js +294 -336
- package/dist/components/skeleton.d.ts +9 -4
- package/dist/components/skeleton.js +8 -6
- package/dist/components/slider.d.ts +13 -4
- package/dist/components/slider.js +34 -40
- package/dist/components/sonner.d.ts +10 -7
- package/dist/components/sonner.js +16 -14
- package/dist/components/spinner.d.ts +12 -5
- package/dist/components/spinner.js +33 -35
- package/dist/components/switch.d.ts +9 -4
- package/dist/components/switch.js +13 -11
- package/dist/components/table.d.ts +37 -11
- package/dist/components/table.js +47 -45
- package/dist/components/tabs.d.ts +21 -7
- package/dist/components/tabs.js +24 -22
- package/dist/components/textarea.d.ts +9 -4
- package/dist/components/textarea.js +8 -6
- package/dist/components/toggle-group.d.ts +24 -9
- package/dist/components/toggle-group.js +41 -42
- package/dist/components/toggle.d.ts +25 -17
- package/dist/components/toggle.js +30 -28
- package/dist/components/tooltip.d.ts +24 -8
- package/dist/components/tooltip.js +29 -32
- package/dist/hooks/use-animated-value.d.ts +4 -1
- package/dist/hooks/use-animated-value.js +57 -36
- package/dist/hooks/use-copy-to-clipboard.d.ts +11 -5
- package/dist/hooks/use-copy-to-clipboard.js +39 -20
- package/dist/hooks/use-is-mobile.d.ts +4 -1
- package/dist/hooks/use-is-mobile.js +21 -1
- package/dist/hooks/use-media-query.d.ts +4 -1
- package/dist/hooks/use-media-query.js +45 -18
- package/dist/hooks/use-mutation-observer.d.ts +6 -2
- package/dist/hooks/use-mutation-observer.js +34 -16
- package/dist/hooks/use-pagination.d.ts +22 -14
- package/dist/hooks/use-pagination.js +100 -49
- package/dist/index.d.ts +69 -130
- package/dist/index.js +11 -11
- package/dist/primitives/checkbox-group.d.ts +105 -83
- package/dist/primitives/checkbox-group.js +111 -84
- package/dist/primitives/input-number.d.ts +51 -40
- package/dist/primitives/input-number.js +483 -350
- package/dist/primitives/input.d.ts +48 -42
- package/dist/primitives/input.js +65 -43
- package/dist/primitives/progress-circle.d.ts +79 -48
- package/dist/primitives/progress-circle.js +154 -105
- package/package.json +6 -7
|
@@ -1,27 +1,40 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import * as _$_codefast_tailwind_variants0 from "@codefast/tailwind-variants";
|
|
2
|
+
import { VariantProps } from "@codefast/tailwind-variants";
|
|
3
|
+
import { ComponentProps, JSX } from "react";
|
|
4
|
+
import { Scope } from "@radix-ui/react-context";
|
|
4
5
|
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
|
|
7
|
+
//#region src/components/scroll-area.d.ts
|
|
8
|
+
declare const scrollAreaScrollbarVariants: _$_codefast_tailwind_variants0.VariantFunctionType<{
|
|
9
|
+
orientation: {
|
|
10
|
+
horizontal: string;
|
|
11
|
+
vertical: string;
|
|
12
|
+
};
|
|
13
|
+
size: {
|
|
14
|
+
none: string;
|
|
15
|
+
sm: string;
|
|
16
|
+
md: string;
|
|
17
|
+
lg: string;
|
|
18
|
+
};
|
|
16
19
|
}, Record<string, never>>;
|
|
17
20
|
type ScopedProps<P> = P & {
|
|
18
|
-
|
|
21
|
+
__scopeScrollArea?: Scope;
|
|
19
22
|
};
|
|
20
23
|
type ScrollAreaContextValue = Pick<VariantProps<typeof scrollAreaScrollbarVariants>, "size">;
|
|
21
24
|
type ScrollAreaProps = ScopedProps<ComponentProps<typeof ScrollAreaPrimitive.Root> & ScrollAreaContextValue>;
|
|
22
|
-
declare function ScrollArea({
|
|
25
|
+
declare function ScrollArea({
|
|
26
|
+
__scopeScrollArea,
|
|
27
|
+
children,
|
|
28
|
+
className,
|
|
29
|
+
size,
|
|
30
|
+
...props
|
|
31
|
+
}: ScrollAreaProps): JSX.Element;
|
|
23
32
|
type ScrollAreaScrollbarProps = ScopedProps<ComponentProps<typeof ScrollAreaPrimitive.Scrollbar>>;
|
|
24
|
-
declare function ScrollAreaScrollbar({
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
33
|
+
declare function ScrollAreaScrollbar({
|
|
34
|
+
__scopeScrollArea,
|
|
35
|
+
className,
|
|
36
|
+
orientation,
|
|
37
|
+
...props
|
|
38
|
+
}: ScrollAreaScrollbarProps): JSX.Element;
|
|
39
|
+
//#endregion
|
|
40
|
+
export { ScrollArea, type ScrollAreaProps, ScrollAreaScrollbar, type ScrollAreaScrollbarProps, scrollAreaScrollbarVariants };
|
|
@@ -1,101 +1,97 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
2
|
import { cn, tv } from "@codefast/tailwind-variants";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { createContextScope } from "@radix-ui/react-context";
|
|
5
|
-
import
|
|
5
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
6
|
+
//#region src/components/scroll-area.tsx
|
|
6
7
|
const scrollAreaScrollbarVariants = tv({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
8
|
+
base: "flex touch-none p-px transition-colors select-none",
|
|
9
|
+
compoundVariants: [
|
|
10
|
+
{
|
|
11
|
+
className: "w-1.5",
|
|
12
|
+
orientation: "vertical",
|
|
13
|
+
size: "sm"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
className: "w-2",
|
|
17
|
+
orientation: "vertical",
|
|
18
|
+
size: "md"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
className: "w-2.5",
|
|
22
|
+
orientation: "vertical",
|
|
23
|
+
size: "lg"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
className: "h-1.5",
|
|
27
|
+
orientation: "horizontal",
|
|
28
|
+
size: "sm"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
className: "h-2",
|
|
32
|
+
orientation: "horizontal",
|
|
33
|
+
size: "md"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
className: "h-2.5",
|
|
37
|
+
orientation: "horizontal",
|
|
38
|
+
size: "lg"
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
defaultVariants: {
|
|
42
|
+
orientation: "vertical",
|
|
43
|
+
size: "md"
|
|
44
|
+
},
|
|
45
|
+
variants: {
|
|
46
|
+
orientation: {
|
|
47
|
+
horizontal: "w-full flex-col border-t border-t-transparent",
|
|
48
|
+
vertical: "h-full flex-row border-l border-l-transparent"
|
|
49
|
+
},
|
|
50
|
+
size: {
|
|
51
|
+
none: "",
|
|
52
|
+
sm: "",
|
|
53
|
+
md: "",
|
|
54
|
+
lg: ""
|
|
55
|
+
}
|
|
56
|
+
}
|
|
56
57
|
});
|
|
57
58
|
const SCROLL_AREA_NAME = "ScrollArea";
|
|
58
59
|
const [createScrollAreaContext] = createContextScope(SCROLL_AREA_NAME);
|
|
59
60
|
const [ScrollAreaContextProvider, useScrollAreaContext] = createScrollAreaContext(SCROLL_AREA_NAME);
|
|
60
61
|
function ScrollArea({ __scopeScrollArea, children, className, size, ...props }) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
/*#__PURE__*/ jsx(Corner, {})
|
|
81
|
-
]
|
|
82
|
-
})
|
|
83
|
-
});
|
|
62
|
+
return /* @__PURE__ */ jsx(ScrollAreaContextProvider, {
|
|
63
|
+
scope: __scopeScrollArea,
|
|
64
|
+
size,
|
|
65
|
+
children: /* @__PURE__ */ jsxs(ScrollAreaPrimitive.Root, {
|
|
66
|
+
className: cn("relative", className),
|
|
67
|
+
"data-slot": "scroll-area",
|
|
68
|
+
...props,
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Viewport, {
|
|
71
|
+
className: "size-full rounded-[inherit] ring-ring/50 outline-ring transition focus-visible:ring-4 focus-visible:outline-1",
|
|
72
|
+
"data-slot": "scroll-area-viewport",
|
|
73
|
+
children
|
|
74
|
+
}),
|
|
75
|
+
/* @__PURE__ */ jsx(ScrollAreaScrollbar, { orientation: "vertical" }),
|
|
76
|
+
/* @__PURE__ */ jsx(ScrollAreaScrollbar, { orientation: "horizontal" }),
|
|
77
|
+
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Corner, {})
|
|
78
|
+
]
|
|
79
|
+
})
|
|
80
|
+
});
|
|
84
81
|
}
|
|
85
82
|
function ScrollAreaScrollbar({ __scopeScrollArea, className, orientation, ...props }) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
})
|
|
99
|
-
});
|
|
83
|
+
const { size } = useScrollAreaContext(SCROLL_AREA_NAME, __scopeScrollArea);
|
|
84
|
+
return /* @__PURE__ */ jsx(ScrollAreaPrimitive.Scrollbar, {
|
|
85
|
+
className: scrollAreaScrollbarVariants({
|
|
86
|
+
className,
|
|
87
|
+
orientation,
|
|
88
|
+
size
|
|
89
|
+
}),
|
|
90
|
+
"data-slot": "scroll-area-scrollbar",
|
|
91
|
+
orientation,
|
|
92
|
+
...props,
|
|
93
|
+
children: /* @__PURE__ */ jsx(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
|
|
94
|
+
});
|
|
100
95
|
}
|
|
96
|
+
//#endregion
|
|
101
97
|
export { ScrollArea, ScrollAreaScrollbar, scrollAreaScrollbarVariants };
|
|
@@ -1,28 +1,62 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { buttonVariants } from "./button.js";
|
|
2
|
+
import { VariantProps } from "@codefast/tailwind-variants";
|
|
3
|
+
import { ComponentProps, JSX } from "react";
|
|
3
4
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
4
|
-
|
|
5
|
+
|
|
6
|
+
//#region src/components/select.d.ts
|
|
5
7
|
type SelectProps = ComponentProps<typeof SelectPrimitive.Root>;
|
|
6
|
-
declare function Select({
|
|
8
|
+
declare function Select({
|
|
9
|
+
...props
|
|
10
|
+
}: SelectProps): JSX.Element;
|
|
7
11
|
type SelectGroupProps = ComponentProps<typeof SelectPrimitive.Group>;
|
|
8
|
-
declare function SelectGroup({
|
|
12
|
+
declare function SelectGroup({
|
|
13
|
+
...props
|
|
14
|
+
}: SelectGroupProps): JSX.Element;
|
|
9
15
|
type SelectValueProps = ComponentProps<typeof SelectPrimitive.Value>;
|
|
10
|
-
declare function SelectValue({
|
|
16
|
+
declare function SelectValue({
|
|
17
|
+
...props
|
|
18
|
+
}: SelectValueProps): JSX.Element;
|
|
11
19
|
interface SelectTriggerProps extends ComponentProps<typeof SelectPrimitive.Trigger> {
|
|
12
|
-
|
|
20
|
+
size?: VariantProps<typeof buttonVariants>["size"];
|
|
13
21
|
}
|
|
14
|
-
declare function SelectTrigger({
|
|
22
|
+
declare function SelectTrigger({
|
|
23
|
+
children,
|
|
24
|
+
className,
|
|
25
|
+
size,
|
|
26
|
+
...props
|
|
27
|
+
}: SelectTriggerProps): JSX.Element;
|
|
15
28
|
type SelectScrollUpButtonProps = ComponentProps<typeof SelectPrimitive.ScrollUpButton>;
|
|
16
|
-
declare function SelectScrollUpButton({
|
|
29
|
+
declare function SelectScrollUpButton({
|
|
30
|
+
className,
|
|
31
|
+
...props
|
|
32
|
+
}: SelectScrollUpButtonProps): JSX.Element;
|
|
17
33
|
type SelectScrollDownButtonProps = ComponentProps<typeof SelectPrimitive.ScrollDownButton>;
|
|
18
|
-
declare function SelectScrollDownButton({
|
|
34
|
+
declare function SelectScrollDownButton({
|
|
35
|
+
className,
|
|
36
|
+
...props
|
|
37
|
+
}: SelectScrollDownButtonProps): JSX.Element;
|
|
19
38
|
type SelectContentProps = ComponentProps<typeof SelectPrimitive.Content>;
|
|
20
|
-
declare function SelectContent({
|
|
39
|
+
declare function SelectContent({
|
|
40
|
+
children,
|
|
41
|
+
className,
|
|
42
|
+
position,
|
|
43
|
+
...props
|
|
44
|
+
}: SelectContentProps): JSX.Element;
|
|
21
45
|
type SelectLabelProps = ComponentProps<typeof SelectPrimitive.Label>;
|
|
22
|
-
declare function SelectLabel({
|
|
46
|
+
declare function SelectLabel({
|
|
47
|
+
className,
|
|
48
|
+
...props
|
|
49
|
+
}: SelectLabelProps): JSX.Element;
|
|
23
50
|
type SelectItemProps = ComponentProps<typeof SelectPrimitive.Item>;
|
|
24
|
-
declare function SelectItem({
|
|
51
|
+
declare function SelectItem({
|
|
52
|
+
children,
|
|
53
|
+
className,
|
|
54
|
+
...props
|
|
55
|
+
}: SelectItemProps): JSX.Element;
|
|
25
56
|
type SelectSeparatorProps = ComponentProps<typeof SelectPrimitive.Separator>;
|
|
26
|
-
declare function SelectSeparator({
|
|
27
|
-
|
|
28
|
-
|
|
57
|
+
declare function SelectSeparator({
|
|
58
|
+
className,
|
|
59
|
+
...props
|
|
60
|
+
}: SelectSeparatorProps): JSX.Element;
|
|
61
|
+
//#endregion
|
|
62
|
+
export { Select, SelectContent, type SelectContentProps, SelectGroup, type SelectGroupProps, SelectItem, type SelectItemProps, SelectLabel, type SelectLabelProps, type SelectProps, SelectScrollDownButton, type SelectScrollDownButtonProps, SelectScrollUpButton, type SelectScrollUpButtonProps, SelectSeparator, type SelectSeparatorProps, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps };
|
|
@@ -1,120 +1,101 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { buttonVariants } from "./button.js";
|
|
3
3
|
import { cn } from "@codefast/tailwind-variants";
|
|
4
|
-
import { Content, Group, Icon, Item, ItemIndicator, ItemText, Label, Portal, Root, ScrollDownButton, ScrollUpButton, Separator, Trigger, Value, Viewport } from "@radix-ui/react-select";
|
|
5
4
|
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
6
|
-
import {
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
7
|
+
//#region src/components/select.tsx
|
|
7
8
|
function Select({ ...props }) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Root, {
|
|
10
|
+
"data-slot": "select",
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
12
13
|
}
|
|
13
14
|
function SelectGroup({ ...props }) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Group, {
|
|
16
|
+
"data-slot": "select-group",
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
18
19
|
}
|
|
19
20
|
function SelectValue({ ...props }) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Value, {
|
|
22
|
+
"data-slot": "select-value",
|
|
23
|
+
...props
|
|
24
|
+
});
|
|
24
25
|
}
|
|
25
26
|
function SelectTrigger({ children, className, size, ...props }) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
asChild: true,
|
|
42
|
-
className: "size-4 shrink-0 opacity-50",
|
|
43
|
-
children: /*#__PURE__*/ jsx(ChevronDownIcon, {})
|
|
44
|
-
})
|
|
45
|
-
]
|
|
46
|
-
});
|
|
27
|
+
return /* @__PURE__ */ jsxs(SelectPrimitive.Trigger, {
|
|
28
|
+
className: buttonVariants({
|
|
29
|
+
className: ["[&_svg:not([class*='text-'])]:text-muted-foreground focus:ring-ring/50 focus:border-ring w-fit justify-between px-3 font-normal focus:ring-3 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 *:data-[slot=select-value]:truncate", className],
|
|
30
|
+
size,
|
|
31
|
+
variant: "outline"
|
|
32
|
+
}),
|
|
33
|
+
"data-size": size,
|
|
34
|
+
"data-slot": "select-trigger",
|
|
35
|
+
...props,
|
|
36
|
+
children: [children, /* @__PURE__ */ jsx(SelectPrimitive.Icon, {
|
|
37
|
+
asChild: true,
|
|
38
|
+
className: "size-4 shrink-0 opacity-50",
|
|
39
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, {})
|
|
40
|
+
})]
|
|
41
|
+
});
|
|
47
42
|
}
|
|
48
43
|
function SelectScrollUpButton({ className, ...props }) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
})
|
|
56
|
-
});
|
|
44
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.ScrollUpButton, {
|
|
45
|
+
className: cn("flex items-center justify-center py-1 text-muted-foreground", className),
|
|
46
|
+
"data-slot": "select-scroll-up-button",
|
|
47
|
+
...props,
|
|
48
|
+
children: /* @__PURE__ */ jsx(ChevronUpIcon, { size: 16 })
|
|
49
|
+
});
|
|
57
50
|
}
|
|
58
51
|
function SelectScrollDownButton({ className, ...props }) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
})
|
|
66
|
-
});
|
|
52
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.ScrollDownButton, {
|
|
53
|
+
className: cn("flex items-center justify-center py-1 text-muted-foreground", className),
|
|
54
|
+
"data-slot": "select-scroll-down-button",
|
|
55
|
+
...props,
|
|
56
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, { size: 16 })
|
|
57
|
+
});
|
|
67
58
|
}
|
|
68
59
|
function SelectContent({ children, className, position = "popper", ...props }) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
})
|
|
84
|
-
});
|
|
60
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(SelectPrimitive.Content, {
|
|
61
|
+
className: cn("relative z-50 max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-hidden rounded-lg border bg-popover text-popover-foreground shadow-lg ease-ui data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
|
|
62
|
+
"data-slot": "select-content",
|
|
63
|
+
position,
|
|
64
|
+
...props,
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
67
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Viewport, {
|
|
68
|
+
className: cn("p-1", position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),
|
|
69
|
+
children
|
|
70
|
+
}),
|
|
71
|
+
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
72
|
+
]
|
|
73
|
+
}) });
|
|
85
74
|
}
|
|
86
75
|
function SelectLabel({ className, ...props }) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
76
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Label, {
|
|
77
|
+
className: cn("flex items-center gap-x-2 px-2 py-1.5 text-sm font-semibold", className),
|
|
78
|
+
"data-slot": "select-label",
|
|
79
|
+
...props
|
|
80
|
+
});
|
|
92
81
|
}
|
|
93
82
|
function SelectItem({ children, className, ...props }) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
className: "size-4"
|
|
104
|
-
})
|
|
105
|
-
})
|
|
106
|
-
}),
|
|
107
|
-
/*#__PURE__*/ jsx(ItemText, {
|
|
108
|
-
children: children
|
|
109
|
-
})
|
|
110
|
-
]
|
|
111
|
-
});
|
|
83
|
+
return /* @__PURE__ */ jsxs(SelectPrimitive.Item, {
|
|
84
|
+
className: cn("relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground aria-disabled:opacity-50 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:[&_svg:not([class*='text-'])]:text-destructive/80 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
|
|
85
|
+
"data-slot": "select-item",
|
|
86
|
+
...props,
|
|
87
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
88
|
+
className: "absolute right-2 flex items-center justify-center",
|
|
89
|
+
children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) })
|
|
90
|
+
}), /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })]
|
|
91
|
+
});
|
|
112
92
|
}
|
|
113
93
|
function SelectSeparator({ className, ...props }) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
94
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Separator, {
|
|
95
|
+
className: cn("mx-2 my-1 h-px bg-border", className),
|
|
96
|
+
"data-slot": "select-separator",
|
|
97
|
+
...props
|
|
98
|
+
});
|
|
119
99
|
}
|
|
100
|
+
//#endregion
|
|
120
101
|
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue };
|
|
@@ -1,22 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import * as _$_codefast_tailwind_variants0 from "@codefast/tailwind-variants";
|
|
2
|
+
import { VariantProps } from "@codefast/tailwind-variants";
|
|
3
3
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
import { ComponentProps, JSX } from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/components/separator.d.ts
|
|
7
|
+
declare const separatorVariants: _$_codefast_tailwind_variants0.VariantFunctionType<{
|
|
8
|
+
align: {
|
|
9
|
+
center: string;
|
|
10
|
+
end: string;
|
|
11
|
+
start: string;
|
|
12
|
+
};
|
|
13
|
+
orientation: {
|
|
14
|
+
horizontal: string;
|
|
15
|
+
vertical: string;
|
|
16
|
+
};
|
|
14
17
|
}, Record<string, never>>;
|
|
15
|
-
interface SeparatorProps extends ComponentProps<typeof SeparatorPrimitive.Root>, Omit<VariantProps<typeof separatorVariants>, "orientation"> {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
interface SeparatorProps extends ComponentProps<typeof SeparatorPrimitive.Root>, Omit<VariantProps<typeof separatorVariants>, "orientation"> {}
|
|
19
|
+
declare function Separator({
|
|
20
|
+
align,
|
|
21
|
+
className,
|
|
22
|
+
decorative,
|
|
23
|
+
orientation,
|
|
24
|
+
...props
|
|
25
|
+
}: SeparatorProps): JSX.Element;
|
|
18
26
|
type SeparatorItemProps = ComponentProps<"div">;
|
|
19
|
-
declare function SeparatorItem({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
declare function SeparatorItem({
|
|
28
|
+
className,
|
|
29
|
+
...props
|
|
30
|
+
}: SeparatorItemProps): JSX.Element;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { Separator, SeparatorItem, type SeparatorItemProps, type SeparatorProps, separatorVariants };
|