@codefast/ui 0.3.10 → 0.3.11-canary.1
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 +32 -0
- package/README.md +277 -167
- package/dist/components/accordion.d.ts +4 -4
- package/dist/components/accordion.js +5 -5
- package/dist/components/alert-dialog.d.ts +11 -11
- package/dist/components/alert-dialog.js +9 -9
- package/dist/components/alert.d.ts +5 -5
- package/dist/components/alert.js +5 -5
- package/dist/components/aspect-ratio.d.ts +2 -2
- package/dist/components/avatar.d.ts +2 -2
- package/dist/components/avatar.js +3 -3
- package/dist/components/badge.d.ts +3 -3
- package/dist/components/badge.js +7 -7
- package/dist/components/breadcrumb.d.ts +8 -8
- package/dist/components/breadcrumb.js +6 -8
- package/dist/components/button-group.d.ts +5 -5
- package/dist/components/button-group.js +8 -8
- package/dist/components/button.d.ts +6 -6
- package/dist/components/button.js +17 -17
- package/dist/components/calendar.d.ts +5 -5
- package/dist/components/calendar.js +35 -35
- package/dist/components/card.d.ts +8 -8
- package/dist/components/card.js +7 -7
- package/dist/components/carousel.d.ts +10 -10
- package/dist/components/carousel.js +20 -20
- package/dist/components/chart.d.ts +12 -11
- package/dist/components/chart.js +42 -42
- package/dist/components/checkbox-cards.d.ts +2 -2
- package/dist/components/checkbox-cards.js +2 -2
- package/dist/components/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox-group.js +2 -2
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.js +1 -1
- package/dist/components/collapsible.d.ts +2 -2
- package/dist/components/command.d.ts +4 -4
- package/dist/components/command.js +10 -10
- package/dist/components/context-menu.d.ts +4 -4
- package/dist/components/context-menu.js +10 -10
- package/dist/components/dialog.d.ts +10 -10
- package/dist/components/dialog.js +12 -12
- package/dist/components/drawer.d.ts +9 -9
- package/dist/components/drawer.js +9 -9
- package/dist/components/dropdown-menu.d.ts +4 -4
- package/dist/components/dropdown-menu.js +10 -10
- package/dist/components/empty.d.ts +9 -9
- package/dist/components/empty.js +10 -10
- package/dist/components/field.d.ts +14 -14
- package/dist/components/field.js +17 -17
- package/dist/components/form.d.ts +10 -10
- package/dist/components/form.js +8 -8
- package/dist/components/hover-card.d.ts +2 -2
- package/dist/components/hover-card.js +3 -3
- package/dist/components/input-group.d.ts +15 -15
- package/dist/components/input-group.js +20 -20
- package/dist/components/input-number.d.ts +2 -2
- package/dist/components/input-number.js +7 -7
- package/dist/components/input-otp.d.ts +6 -6
- package/dist/components/input-otp.js +4 -4
- package/dist/components/input-password.d.ts +3 -3
- package/dist/components/input-password.js +6 -6
- package/dist/components/input-search.d.ts +3 -3
- package/dist/components/input-search.js +4 -4
- package/dist/components/input.d.ts +2 -2
- package/dist/components/input.js +1 -1
- package/dist/components/item.d.ts +12 -12
- package/dist/components/item.js +23 -23
- package/dist/components/kbd.d.ts +3 -3
- package/dist/components/kbd.js +2 -2
- package/dist/components/label.d.ts +2 -2
- package/dist/components/label.js +1 -1
- package/dist/components/menubar.d.ts +4 -4
- package/dist/components/menubar.js +13 -13
- package/dist/components/native-select.d.ts +4 -4
- package/dist/components/native-select.js +2 -2
- package/dist/components/navigation-menu.d.ts +2 -2
- package/dist/components/navigation-menu.js +10 -10
- package/dist/components/pagination.d.ts +10 -10
- package/dist/components/pagination.js +6 -6
- package/dist/components/popover.d.ts +3 -3
- package/dist/components/popover.js +3 -3
- package/dist/components/progress-circle.d.ts +5 -5
- package/dist/components/progress-circle.js +22 -22
- package/dist/components/progress.d.ts +2 -2
- package/dist/components/progress.js +2 -2
- package/dist/components/radio-cards.d.ts +2 -2
- package/dist/components/radio-cards.js +3 -3
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +3 -3
- package/dist/components/radio.d.ts +2 -2
- package/dist/components/radio.js +1 -1
- package/dist/components/resizable.d.ts +2 -2
- package/dist/components/resizable.js +3 -3
- package/dist/components/scroll-area.d.ts +5 -5
- package/dist/components/scroll-area.js +31 -31
- package/dist/components/select.d.ts +5 -5
- package/dist/components/select.js +9 -9
- package/dist/components/separator.d.ts +5 -5
- package/dist/components/separator.js +9 -9
- package/dist/components/sheet.d.ts +9 -9
- package/dist/components/sheet.js +17 -17
- package/dist/components/sidebar.d.ts +31 -31
- package/dist/components/sidebar.js +65 -65
- package/dist/components/skeleton.d.ts +2 -2
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/slider.js +4 -4
- package/dist/components/sonner.d.ts +3 -3
- package/dist/components/sonner.js +4 -4
- package/dist/components/spinner.d.ts +2 -2
- package/dist/components/spinner.js +5 -5
- package/dist/components/switch.d.ts +2 -2
- package/dist/components/switch.js +2 -2
- package/dist/components/table.d.ts +9 -9
- package/dist/components/table.js +8 -8
- package/dist/components/tabs.d.ts +2 -2
- package/dist/components/tabs.js +4 -4
- package/dist/components/textarea.d.ts +2 -2
- package/dist/components/textarea.js +1 -1
- package/dist/components/toggle-group.d.ts +4 -4
- package/dist/components/toggle-group.js +5 -5
- package/dist/components/toggle.d.ts +3 -3
- package/dist/components/toggle.js +8 -8
- package/dist/components/tooltip.d.ts +3 -3
- package/dist/components/tooltip.js +2 -2
- package/dist/css/preset.css +4 -4
- package/dist/css/style.css +3 -3
- package/dist/hooks/use-copy-to-clipboard.d.ts +1 -1
- package/dist/hooks/use-copy-to-clipboard.js +1 -1
- package/dist/hooks/use-media-query.js +3 -3
- package/dist/hooks/use-mutation-observer.d.ts +1 -1
- package/dist/hooks/use-pagination.js +1 -1
- package/dist/index.d.ts +130 -130
- package/dist/primitives/checkbox-group.d.ts +11 -11
- package/dist/primitives/checkbox-group.js +3 -3
- package/dist/primitives/input-number.d.ts +8 -8
- package/dist/primitives/input-number.js +46 -46
- package/dist/primitives/input.d.ts +4 -4
- package/dist/primitives/input.js +7 -7
- package/dist/primitives/progress-circle.d.ts +7 -7
- package/dist/primitives/progress-circle.js +8 -8
- package/package.json +111 -189
- package/dist/components/accordion.cjs +0 -98
- package/dist/components/alert-dialog.cjs +0 -156
- package/dist/components/alert.cjs +0 -84
- package/dist/components/aspect-ratio.cjs +0 -44
- package/dist/components/avatar.cjs +0 -66
- package/dist/components/badge.cjs +0 -67
- package/dist/components/breadcrumb.cjs +0 -127
- package/dist/components/button-group.cjs +0 -87
- package/dist/components/button.cjs +0 -92
- package/dist/components/calendar.cjs +0 -151
- package/dist/components/card.cjs +0 -105
- package/dist/components/carousel.cjs +0 -211
- package/dist/components/chart.cjs +0 -251
- package/dist/components/checkbox-cards.cjs +0 -70
- package/dist/components/checkbox-group.cjs +0 -64
- package/dist/components/checkbox.cjs +0 -54
- package/dist/components/collapsible.cjs +0 -62
- package/dist/components/command.cjs +0 -168
- package/dist/components/context-menu.cjs +0 -219
- package/dist/components/dialog.cjs +0 -165
- package/dist/components/drawer.cjs +0 -144
- package/dist/components/dropdown-menu.cjs +0 -222
- package/dist/components/empty.cjs +0 -113
- package/dist/components/field.cjs +0 -194
- package/dist/components/form.cjs +0 -152
- package/dist/components/hover-card.cjs +0 -78
- package/dist/components/input-group.cjs +0 -156
- package/dist/components/input-number.cjs +0 -99
- package/dist/components/input-otp.cjs +0 -102
- package/dist/components/input-password.cjs +0 -72
- package/dist/components/input-search.cjs +0 -81
- package/dist/components/input.cjs +0 -46
- package/dist/components/item.cjs +0 -186
- package/dist/components/kbd.cjs +0 -54
- package/dist/components/label.cjs +0 -46
- package/dist/components/menubar.cjs +0 -233
- package/dist/components/native-select.cjs +0 -75
- package/dist/components/navigation-menu.cjs +0 -146
- package/dist/components/pagination.cjs +0 -138
- package/dist/components/popover.cjs +0 -87
- package/dist/components/progress-circle.cjs +0 -185
- package/dist/components/progress.cjs +0 -53
- package/dist/components/radio-cards.cjs +0 -67
- package/dist/components/radio-group.cjs +0 -60
- package/dist/components/radio.cjs +0 -48
- package/dist/components/resizable.cjs +0 -72
- package/dist/components/scroll-area.cjs +0 -141
- package/dist/components/select.cjs +0 -181
- package/dist/components/separator.cjs +0 -83
- package/dist/components/sheet.cjs +0 -185
- package/dist/components/sidebar.cjs +0 -507
- package/dist/components/skeleton.cjs +0 -44
- package/dist/components/slider.cjs +0 -80
- package/dist/components/sonner.cjs +0 -58
- package/dist/components/spinner.cjs +0 -76
- package/dist/components/switch.cjs +0 -50
- package/dist/components/table.cjs +0 -118
- package/dist/components/tabs.cjs +0 -76
- package/dist/components/textarea.cjs +0 -44
- package/dist/components/toggle-group.cjs +0 -91
- package/dist/components/toggle.cjs +0 -72
- package/dist/components/tooltip.cjs +0 -91
- package/dist/hooks/use-animated-value.cjs +0 -75
- package/dist/hooks/use-copy-to-clipboard.cjs +0 -58
- package/dist/hooks/use-is-mobile.cjs +0 -40
- package/dist/hooks/use-media-query.cjs +0 -57
- package/dist/hooks/use-mutation-observer.cjs +0 -57
- package/dist/hooks/use-pagination.cjs +0 -93
- package/dist/index.cjs +0 -1081
- package/dist/primitives/checkbox-group.cjs +0 -151
- package/dist/primitives/input-number.cjs +0 -439
- package/dist/primitives/input.cjs +0 -99
- package/dist/primitives/progress-circle.cjs +0 -199
|
@@ -6,33 +6,33 @@ import { useAnimatedValue } from "../hooks/use-animated-value.js";
|
|
|
6
6
|
import { Indicator, Provider, Root, SVG, Track, Value } from "../primitives/progress-circle.js";
|
|
7
7
|
const progressCircleVariants = tv({
|
|
8
8
|
defaultVariants: {
|
|
9
|
-
size:
|
|
10
|
-
thickness:
|
|
11
|
-
variant:
|
|
9
|
+
size: "md",
|
|
10
|
+
thickness: "regular",
|
|
11
|
+
variant: "default"
|
|
12
12
|
},
|
|
13
13
|
slots: {
|
|
14
|
-
indicator:
|
|
15
|
-
label:
|
|
16
|
-
root:
|
|
17
|
-
svg:
|
|
18
|
-
track:
|
|
14
|
+
indicator: "origin-center",
|
|
15
|
+
label: "absolute inset-0 flex items-center justify-center text-xs font-medium",
|
|
16
|
+
root: "relative inline-flex items-center justify-center",
|
|
17
|
+
svg: "size-full",
|
|
18
|
+
track: "origin-center"
|
|
19
19
|
},
|
|
20
20
|
variants: {
|
|
21
21
|
size: {
|
|
22
22
|
sm: {
|
|
23
|
-
label:
|
|
23
|
+
label: "text-[0.625rem]"
|
|
24
24
|
},
|
|
25
25
|
md: {
|
|
26
|
-
label:
|
|
26
|
+
label: "text-xs"
|
|
27
27
|
},
|
|
28
28
|
lg: {
|
|
29
|
-
label:
|
|
29
|
+
label: "text-sm"
|
|
30
30
|
},
|
|
31
31
|
xl: {
|
|
32
|
-
label:
|
|
32
|
+
label: "text-base"
|
|
33
33
|
},
|
|
34
|
-
|
|
35
|
-
label:
|
|
34
|
+
"2xl": {
|
|
35
|
+
label: "text-lg"
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
thickness: {
|
|
@@ -42,17 +42,17 @@ const progressCircleVariants = tv({
|
|
|
42
42
|
},
|
|
43
43
|
variant: {
|
|
44
44
|
default: {
|
|
45
|
-
indicator:
|
|
46
|
-
track:
|
|
45
|
+
indicator: "text-primary",
|
|
46
|
+
track: "text-primary/20"
|
|
47
47
|
},
|
|
48
48
|
destructive: {
|
|
49
|
-
indicator:
|
|
50
|
-
track:
|
|
49
|
+
indicator: "text-destructive",
|
|
50
|
+
track: "text-destructive/20"
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
|
-
function ProgressCircle({ animate = true, animationDuration = 1000, className, classNames, customLabel, showValue = false, size, sizeInPixels, strokeWidth, thickness =
|
|
55
|
+
function ProgressCircle({ animate = true, animationDuration = 1000, className, classNames, customLabel, showValue = false, size, sizeInPixels, strokeWidth, thickness = "regular", value = 0, variant = "default", ...props }) {
|
|
56
56
|
const displayValue = useAnimatedValue(value, animationDuration, animate);
|
|
57
57
|
const actualSize = useMemo(()=>sizeInPixels ?? getActualSize(size), [
|
|
58
58
|
sizeInPixels,
|
|
@@ -111,7 +111,7 @@ function ProgressCircle({ animate = true, animationDuration = 1000, className, c
|
|
|
111
111
|
}),
|
|
112
112
|
style: {
|
|
113
113
|
transitionDuration: `${animationDuration.toString()}ms`,
|
|
114
|
-
transitionProperty:
|
|
114
|
+
transitionProperty: "stroke-dashoffset"
|
|
115
115
|
}
|
|
116
116
|
})
|
|
117
117
|
]
|
|
@@ -126,10 +126,10 @@ function ProgressCircle({ animate = true, animationDuration = 1000, className, c
|
|
|
126
126
|
})
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
ProgressCircle.displayName =
|
|
129
|
+
ProgressCircle.displayName = "ProgressCircle";
|
|
130
130
|
const getActualSize = (size)=>{
|
|
131
131
|
const sizeMap = {
|
|
132
|
-
|
|
132
|
+
"2xl": 128,
|
|
133
133
|
lg: 64,
|
|
134
134
|
md: 48,
|
|
135
135
|
sm: 32,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import * as ProgressPrimitive from
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
3
3
|
type ProgressProps = ComponentProps<typeof ProgressPrimitive.Root>;
|
|
4
4
|
declare function Progress({ className, value, ...props }: ProgressProps): JSX.Element;
|
|
5
5
|
export { Progress };
|
|
@@ -4,11 +4,11 @@ import { cn } from "@codefast/tailwind-variants";
|
|
|
4
4
|
import { Indicator, Root } from "@radix-ui/react-progress";
|
|
5
5
|
function Progress({ className, value, ...props }) {
|
|
6
6
|
return /*#__PURE__*/ jsx(Root, {
|
|
7
|
-
className: cn(
|
|
7
|
+
className: cn("relative h-2 w-full overflow-hidden rounded-full bg-primary/20", className),
|
|
8
8
|
"data-slot": "progress",
|
|
9
9
|
...props,
|
|
10
10
|
children: /*#__PURE__*/ jsx(Indicator, {
|
|
11
|
-
className: "
|
|
11
|
+
className: "size-full flex-1 bg-primary transition-all",
|
|
12
12
|
"data-slot": "progress-indicator",
|
|
13
13
|
style: {
|
|
14
14
|
transform: `translateX(-${(100 - (value ?? 0)).toString()}%)`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import * as RadioGroupPrimitive from
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
3
3
|
type RadioCardsProps = ComponentProps<typeof RadioGroupPrimitive.Root>;
|
|
4
4
|
declare function RadioCards(props: RadioCardsProps): JSX.Element;
|
|
5
5
|
type RadioCardsItemProps = ComponentProps<typeof RadioGroupPrimitive.Item>;
|
|
@@ -11,15 +11,15 @@ function RadioCards(props) {
|
|
|
11
11
|
}
|
|
12
12
|
function RadioCardsItem({ children, className, ...props }) {
|
|
13
13
|
return /*#__PURE__*/ jsxs(Label, {
|
|
14
|
-
className: "border-input hover:not-has-disabled:not-has-aria-checked:bg-secondary has-
|
|
14
|
+
className: "flex items-start gap-3 rounded-lg border border-input p-3 transition hover:not-has-disabled:not-has-aria-checked:bg-secondary has-focus-visible:border-ring has-disabled:opacity-50 has-aria-checked:border-primary has-aria-checked:bg-primary/10",
|
|
15
15
|
"data-slot": "radio-card",
|
|
16
16
|
children: [
|
|
17
17
|
/*#__PURE__*/ jsx(Item, {
|
|
18
|
-
className: cn(
|
|
18
|
+
className: cn("peer flex size-4 shrink-0 items-center justify-center rounded-full border border-input text-primary-foreground shadow-xs outline-hidden transition focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:not-aria-checked:border-ring aria-checked:border-primary aria-checked:bg-primary focus-visible:aria-checked:ring-primary/20 dark:bg-input/30 dark:focus-visible:aria-checked:ring-primary/40", className),
|
|
19
19
|
"data-slot": "radio-card-item",
|
|
20
20
|
...props,
|
|
21
21
|
children: /*#__PURE__*/ jsx(Indicator, {
|
|
22
|
-
className: "
|
|
22
|
+
className: "size-1 rounded-full bg-background",
|
|
23
23
|
"data-slot": "radio-card-indicator"
|
|
24
24
|
})
|
|
25
25
|
}),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import * as RadioGroupPrimitive from
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
3
3
|
type RadioGroupProps = ComponentProps<typeof RadioGroupPrimitive.Root>;
|
|
4
4
|
declare function RadioGroup({ className, ...props }: RadioGroupProps): JSX.Element;
|
|
5
5
|
type RadioGroupItemProps = ComponentProps<typeof RadioGroupPrimitive.Item>;
|
|
@@ -4,18 +4,18 @@ import { cn } from "@codefast/tailwind-variants";
|
|
|
4
4
|
import { Indicator, Item, Root } from "@radix-ui/react-radio-group";
|
|
5
5
|
function RadioGroup({ className, ...props }) {
|
|
6
6
|
return /*#__PURE__*/ jsx(Root, {
|
|
7
|
-
className: cn(
|
|
7
|
+
className: cn("grid gap-2", className),
|
|
8
8
|
"data-slot": "radio-group",
|
|
9
9
|
...props
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
function RadioGroupItem({ className, ...props }) {
|
|
13
13
|
return /*#__PURE__*/ jsx(Item, {
|
|
14
|
-
className: cn(
|
|
14
|
+
className: cn("peer inline-flex size-4 shrink-0 items-center justify-center rounded-full border border-input shadow-xs outline-hidden transition hover:not-disabled:not-aria-checked:border-ring/60 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50 aria-checked:border-primary aria-checked:bg-primary focus-visible:aria-checked:ring-primary/20 aria-invalid:border-destructive aria-invalid:ring-destructive/20 hover:not-disabled:not-aria-checked:aria-invalid:border-destructive/60 aria-checked:aria-invalid:bg-destructive dark:bg-input/30 dark:focus-visible:aria-checked:ring-primary/40 dark:aria-invalid:ring-destructive/40", className),
|
|
15
15
|
"data-slot": "radio-group-item",
|
|
16
16
|
...props,
|
|
17
17
|
children: /*#__PURE__*/ jsx(Indicator, {
|
|
18
|
-
className: "
|
|
18
|
+
className: "size-1 rounded-full bg-background",
|
|
19
19
|
"data-slot": "radio-group-indicator"
|
|
20
20
|
})
|
|
21
21
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
interface RadioProps extends Omit<ComponentProps<
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
interface RadioProps extends Omit<ComponentProps<"input">, "type"> {
|
|
3
3
|
onValueChange?: (value: string) => void;
|
|
4
4
|
}
|
|
5
5
|
declare function Radio({ className, onChange, onValueChange, ...props }: RadioProps): JSX.Element;
|
package/dist/components/radio.js
CHANGED
|
@@ -4,7 +4,7 @@ import { cn } from "@codefast/tailwind-variants";
|
|
|
4
4
|
import { composeEventHandlers } from "@radix-ui/primitive";
|
|
5
5
|
function Radio({ className, onChange, onValueChange, ...props }) {
|
|
6
6
|
return /*#__PURE__*/ jsx("input", {
|
|
7
|
-
className: cn(
|
|
7
|
+
className: cn("peer inline-flex size-4 shrink-0 appearance-none items-center justify-center rounded-full border border-input shadow-xs outline-hidden after:size-full after:rounded-full after:bg-background after:transition-[width,height] checked:border-primary checked:bg-primary checked:after:size-1 hover:not-disabled:not-checked:border-ring/60 focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:not-checked:border-ring focus-visible:checked:ring-primary/20 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 checked:aria-invalid:bg-destructive hover:not-disabled:not-checked:aria-invalid:border-destructive/60 dark:not-checked:after:bg-input/30 dark:focus-visible:checked:ring-primary/40 dark:aria-invalid:ring-destructive/40", className),
|
|
8
8
|
"data-slot": "radio",
|
|
9
9
|
type: "radio",
|
|
10
10
|
onChange: composeEventHandlers(onChange, (event)=>onValueChange?.(event.currentTarget.value)),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import * as ResizablePrimitive from
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as ResizablePrimitive from "react-resizable-panels";
|
|
3
3
|
type ResizableGroupProps = ComponentProps<typeof ResizablePrimitive.Group>;
|
|
4
4
|
declare function ResizableGroup({ className, ...props }: ResizableGroupProps): JSX.Element;
|
|
5
5
|
type ResizablePanelProps = ComponentProps<typeof ResizablePrimitive.Panel>;
|
|
@@ -5,7 +5,7 @@ import { GripVerticalIcon } from "lucide-react";
|
|
|
5
5
|
import { Group, Panel, Separator } from "react-resizable-panels";
|
|
6
6
|
function ResizableGroup({ className, ...props }) {
|
|
7
7
|
return /*#__PURE__*/ jsx(Group, {
|
|
8
|
-
className: cn(
|
|
8
|
+
className: cn("flex size-full", className),
|
|
9
9
|
"data-slot": "resizable-group",
|
|
10
10
|
...props
|
|
11
11
|
});
|
|
@@ -18,11 +18,11 @@ function ResizablePanel({ ...props }) {
|
|
|
18
18
|
}
|
|
19
19
|
function ResizableSeparator({ className, withHandle, ...props }) {
|
|
20
20
|
return /*#__PURE__*/ jsx(Separator, {
|
|
21
|
-
className: cn(
|
|
21
|
+
className: cn("flex items-center justify-center bg-border outline-hidden focus-visible:bg-ring focus-visible:ring-3 focus-visible:ring-ring/50", "aria-[orientation=vertical]:w-px", "aria-[orientation=horizontal]:h-px", className),
|
|
22
22
|
"data-slot": "resizable-separator",
|
|
23
23
|
...props,
|
|
24
24
|
children: withHandle ? /*#__PURE__*/ jsx("div", {
|
|
25
|
-
className: "
|
|
25
|
+
className: "z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",
|
|
26
26
|
children: /*#__PURE__*/ jsx(GripVerticalIcon, {
|
|
27
27
|
className: "size-2.5"
|
|
28
28
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { VariantProps } from
|
|
2
|
-
import type { Scope } from
|
|
3
|
-
import type { ComponentProps, JSX } from
|
|
4
|
-
import * as ScrollAreaPrimitive from
|
|
1
|
+
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
2
|
+
import type { Scope } from "@radix-ui/react-context";
|
|
3
|
+
import type { ComponentProps, JSX } from "react";
|
|
4
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
5
5
|
declare const scrollAreaScrollbarVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
6
6
|
orientation: {
|
|
7
7
|
horizontal: string;
|
|
@@ -17,7 +17,7 @@ declare const scrollAreaScrollbarVariants: import("@codefast/tailwind-variants")
|
|
|
17
17
|
type ScopedProps<P> = P & {
|
|
18
18
|
__scopeScrollArea?: Scope;
|
|
19
19
|
};
|
|
20
|
-
type ScrollAreaContextValue = Pick<VariantProps<typeof scrollAreaScrollbarVariants>,
|
|
20
|
+
type ScrollAreaContextValue = Pick<VariantProps<typeof scrollAreaScrollbarVariants>, "size">;
|
|
21
21
|
type ScrollAreaProps = ScopedProps<ComponentProps<typeof ScrollAreaPrimitive.Root> & ScrollAreaContextValue>;
|
|
22
22
|
declare function ScrollArea({ __scopeScrollArea, children, className, size, ...props }: ScrollAreaProps): JSX.Element;
|
|
23
23
|
type ScrollAreaScrollbarProps = ScopedProps<ComponentProps<typeof ScrollAreaPrimitive.Scrollbar>>;
|
|
@@ -4,57 +4,57 @@ import { cn, tv } from "@codefast/tailwind-variants";
|
|
|
4
4
|
import { createContextScope } from "@radix-ui/react-context";
|
|
5
5
|
import { Corner, Root, ScrollAreaThumb, Scrollbar, Viewport } from "@radix-ui/react-scroll-area";
|
|
6
6
|
const scrollAreaScrollbarVariants = tv({
|
|
7
|
-
base:
|
|
7
|
+
base: "flex touch-none p-px transition-colors select-none",
|
|
8
8
|
compoundVariants: [
|
|
9
9
|
{
|
|
10
|
-
className:
|
|
11
|
-
orientation:
|
|
12
|
-
size:
|
|
10
|
+
className: "w-1.5",
|
|
11
|
+
orientation: "vertical",
|
|
12
|
+
size: "sm"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
|
-
className:
|
|
16
|
-
orientation:
|
|
17
|
-
size:
|
|
15
|
+
className: "w-2",
|
|
16
|
+
orientation: "vertical",
|
|
17
|
+
size: "md"
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
|
-
className:
|
|
21
|
-
orientation:
|
|
22
|
-
size:
|
|
20
|
+
className: "w-2.5",
|
|
21
|
+
orientation: "vertical",
|
|
22
|
+
size: "lg"
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
|
-
className:
|
|
26
|
-
orientation:
|
|
27
|
-
size:
|
|
25
|
+
className: "h-1.5",
|
|
26
|
+
orientation: "horizontal",
|
|
27
|
+
size: "sm"
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
|
-
className:
|
|
31
|
-
orientation:
|
|
32
|
-
size:
|
|
30
|
+
className: "h-2",
|
|
31
|
+
orientation: "horizontal",
|
|
32
|
+
size: "md"
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
|
-
className:
|
|
36
|
-
orientation:
|
|
37
|
-
size:
|
|
35
|
+
className: "h-2.5",
|
|
36
|
+
orientation: "horizontal",
|
|
37
|
+
size: "lg"
|
|
38
38
|
}
|
|
39
39
|
],
|
|
40
40
|
defaultVariants: {
|
|
41
|
-
orientation:
|
|
42
|
-
size:
|
|
41
|
+
orientation: "vertical",
|
|
42
|
+
size: "md"
|
|
43
43
|
},
|
|
44
44
|
variants: {
|
|
45
45
|
orientation: {
|
|
46
|
-
horizontal:
|
|
47
|
-
vertical:
|
|
46
|
+
horizontal: "w-full flex-col border-t border-t-transparent",
|
|
47
|
+
vertical: "h-full flex-row border-l border-l-transparent"
|
|
48
48
|
},
|
|
49
49
|
size: {
|
|
50
|
-
none:
|
|
51
|
-
sm:
|
|
52
|
-
md:
|
|
53
|
-
lg:
|
|
50
|
+
none: "",
|
|
51
|
+
sm: "",
|
|
52
|
+
md: "",
|
|
53
|
+
lg: ""
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
|
-
const SCROLL_AREA_NAME =
|
|
57
|
+
const SCROLL_AREA_NAME = "ScrollArea";
|
|
58
58
|
const [createScrollAreaContext] = createContextScope(SCROLL_AREA_NAME);
|
|
59
59
|
const [ScrollAreaContextProvider, useScrollAreaContext] = createScrollAreaContext(SCROLL_AREA_NAME);
|
|
60
60
|
function ScrollArea({ __scopeScrollArea, children, className, size, ...props }) {
|
|
@@ -62,12 +62,12 @@ function ScrollArea({ __scopeScrollArea, children, className, size, ...props })
|
|
|
62
62
|
scope: __scopeScrollArea,
|
|
63
63
|
size: size,
|
|
64
64
|
children: /*#__PURE__*/ jsxs(Root, {
|
|
65
|
-
className: cn(
|
|
65
|
+
className: cn("relative", className),
|
|
66
66
|
"data-slot": "scroll-area",
|
|
67
67
|
...props,
|
|
68
68
|
children: [
|
|
69
69
|
/*#__PURE__*/ jsx(Viewport, {
|
|
70
|
-
className: "
|
|
70
|
+
className: "size-full rounded-[inherit] ring-ring/50 outline-ring transition focus-visible:ring-4 focus-visible:outline-1",
|
|
71
71
|
"data-slot": "scroll-area-viewport",
|
|
72
72
|
children: children
|
|
73
73
|
}),
|
|
@@ -94,7 +94,7 @@ function ScrollAreaScrollbar({ __scopeScrollArea, className, orientation, ...pro
|
|
|
94
94
|
orientation: orientation,
|
|
95
95
|
...props,
|
|
96
96
|
children: /*#__PURE__*/ jsx(ScrollAreaThumb, {
|
|
97
|
-
className: "
|
|
97
|
+
className: "relative flex-1 rounded-full bg-border"
|
|
98
98
|
})
|
|
99
99
|
});
|
|
100
100
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { VariantProps } from
|
|
2
|
-
import type { ComponentProps, JSX } from
|
|
3
|
-
import * as SelectPrimitive from
|
|
4
|
-
import { buttonVariants } from
|
|
1
|
+
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
2
|
+
import type { ComponentProps, JSX } from "react";
|
|
3
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
4
|
+
import { buttonVariants } from "./button";
|
|
5
5
|
type SelectProps = ComponentProps<typeof SelectPrimitive.Root>;
|
|
6
6
|
declare function Select({ ...props }: SelectProps): JSX.Element;
|
|
7
7
|
type SelectGroupProps = ComponentProps<typeof SelectPrimitive.Group>;
|
|
@@ -9,7 +9,7 @@ declare function SelectGroup({ ...props }: SelectGroupProps): JSX.Element;
|
|
|
9
9
|
type SelectValueProps = ComponentProps<typeof SelectPrimitive.Value>;
|
|
10
10
|
declare function SelectValue({ ...props }: SelectValueProps): JSX.Element;
|
|
11
11
|
interface SelectTriggerProps extends ComponentProps<typeof SelectPrimitive.Trigger> {
|
|
12
|
-
size?: VariantProps<typeof buttonVariants>[
|
|
12
|
+
size?: VariantProps<typeof buttonVariants>["size"];
|
|
13
13
|
}
|
|
14
14
|
declare function SelectTrigger({ children, className, size, ...props }: SelectTriggerProps): JSX.Element;
|
|
15
15
|
type SelectScrollUpButtonProps = ComponentProps<typeof SelectPrimitive.ScrollUpButton>;
|
|
@@ -30,7 +30,7 @@ function SelectTrigger({ children, className, size, ...props }) {
|
|
|
30
30
|
className
|
|
31
31
|
],
|
|
32
32
|
size,
|
|
33
|
-
variant:
|
|
33
|
+
variant: "outline"
|
|
34
34
|
}),
|
|
35
35
|
"data-size": size,
|
|
36
36
|
"data-slot": "select-trigger",
|
|
@@ -47,7 +47,7 @@ function SelectTrigger({ children, className, size, ...props }) {
|
|
|
47
47
|
}
|
|
48
48
|
function SelectScrollUpButton({ className, ...props }) {
|
|
49
49
|
return /*#__PURE__*/ jsx(ScrollUpButton, {
|
|
50
|
-
className: cn(
|
|
50
|
+
className: cn("flex items-center justify-center py-1 text-muted-foreground", className),
|
|
51
51
|
"data-slot": "select-scroll-up-button",
|
|
52
52
|
...props,
|
|
53
53
|
children: /*#__PURE__*/ jsx(ChevronUpIcon, {
|
|
@@ -57,7 +57,7 @@ function SelectScrollUpButton({ className, ...props }) {
|
|
|
57
57
|
}
|
|
58
58
|
function SelectScrollDownButton({ className, ...props }) {
|
|
59
59
|
return /*#__PURE__*/ jsx(ScrollDownButton, {
|
|
60
|
-
className: cn(
|
|
60
|
+
className: cn("flex items-center justify-center py-1 text-muted-foreground", className),
|
|
61
61
|
"data-slot": "select-scroll-down-button",
|
|
62
62
|
...props,
|
|
63
63
|
children: /*#__PURE__*/ jsx(ChevronDownIcon, {
|
|
@@ -65,17 +65,17 @@ function SelectScrollDownButton({ className, ...props }) {
|
|
|
65
65
|
})
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
function SelectContent({ children, className, position =
|
|
68
|
+
function SelectContent({ children, className, position = "popper", ...props }) {
|
|
69
69
|
return /*#__PURE__*/ jsx(Portal, {
|
|
70
70
|
children: /*#__PURE__*/ jsxs(Content, {
|
|
71
|
-
className: cn(
|
|
71
|
+
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", "popper" === position && "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),
|
|
72
72
|
"data-slot": "select-content",
|
|
73
73
|
position: position,
|
|
74
74
|
...props,
|
|
75
75
|
children: [
|
|
76
76
|
/*#__PURE__*/ jsx(SelectScrollUpButton, {}),
|
|
77
77
|
/*#__PURE__*/ jsx(Viewport, {
|
|
78
|
-
className: cn(
|
|
78
|
+
className: cn("p-1", "popper" === position && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),
|
|
79
79
|
children: children
|
|
80
80
|
}),
|
|
81
81
|
/*#__PURE__*/ jsx(SelectScrollDownButton, {})
|
|
@@ -85,14 +85,14 @@ function SelectContent({ children, className, position = 'popper', ...props }) {
|
|
|
85
85
|
}
|
|
86
86
|
function SelectLabel({ className, ...props }) {
|
|
87
87
|
return /*#__PURE__*/ jsx(Label, {
|
|
88
|
-
className: cn(
|
|
88
|
+
className: cn("flex items-center gap-x-2 px-2 py-1.5 text-sm font-semibold", className),
|
|
89
89
|
"data-slot": "select-label",
|
|
90
90
|
...props
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
function SelectItem({ children, className, ...props }) {
|
|
94
94
|
return /*#__PURE__*/ jsxs(Item, {
|
|
95
|
-
className: cn("
|
|
95
|
+
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),
|
|
96
96
|
"data-slot": "select-item",
|
|
97
97
|
...props,
|
|
98
98
|
children: [
|
|
@@ -112,7 +112,7 @@ function SelectItem({ children, className, ...props }) {
|
|
|
112
112
|
}
|
|
113
113
|
function SelectSeparator({ className, ...props }) {
|
|
114
114
|
return /*#__PURE__*/ jsx(Separator, {
|
|
115
|
-
className: cn(
|
|
115
|
+
className: cn("mx-2 my-1 h-px bg-border", className),
|
|
116
116
|
"data-slot": "select-separator",
|
|
117
117
|
...props
|
|
118
118
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { VariantProps } from
|
|
2
|
-
import type { ComponentProps, JSX } from
|
|
3
|
-
import * as SeparatorPrimitive from
|
|
1
|
+
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
2
|
+
import type { ComponentProps, JSX } from "react";
|
|
3
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
4
4
|
declare const separatorVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
5
5
|
align: {
|
|
6
6
|
center: string;
|
|
@@ -12,10 +12,10 @@ declare const separatorVariants: import("@codefast/tailwind-variants").VariantFu
|
|
|
12
12
|
vertical: string;
|
|
13
13
|
};
|
|
14
14
|
}, Record<string, never>>;
|
|
15
|
-
interface SeparatorProps extends ComponentProps<typeof SeparatorPrimitive.Root>, Omit<VariantProps<typeof separatorVariants>,
|
|
15
|
+
interface SeparatorProps extends ComponentProps<typeof SeparatorPrimitive.Root>, Omit<VariantProps<typeof separatorVariants>, "orientation"> {
|
|
16
16
|
}
|
|
17
17
|
declare function Separator({ align, className, decorative, orientation, ...props }: SeparatorProps): JSX.Element;
|
|
18
|
-
type SeparatorItemProps = ComponentProps<
|
|
18
|
+
type SeparatorItemProps = ComponentProps<"div">;
|
|
19
19
|
declare function SeparatorItem({ className, ...props }: SeparatorItemProps): JSX.Element;
|
|
20
20
|
export { separatorVariants };
|
|
21
21
|
export { Separator, SeparatorItem };
|
|
@@ -3,20 +3,20 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { cn, tv } from "@codefast/tailwind-variants";
|
|
4
4
|
import { Root } from "@radix-ui/react-separator";
|
|
5
5
|
const separatorVariants = tv({
|
|
6
|
-
base:
|
|
6
|
+
base: "relative flex shrink-0 items-center bg-border",
|
|
7
7
|
defaultVariants: {
|
|
8
|
-
align:
|
|
9
|
-
orientation:
|
|
8
|
+
align: "center",
|
|
9
|
+
orientation: "horizontal"
|
|
10
10
|
},
|
|
11
11
|
variants: {
|
|
12
12
|
align: {
|
|
13
|
-
center:
|
|
14
|
-
end:
|
|
15
|
-
start:
|
|
13
|
+
center: "justify-center",
|
|
14
|
+
end: "justify-end",
|
|
15
|
+
start: "justify-start"
|
|
16
16
|
},
|
|
17
17
|
orientation: {
|
|
18
|
-
horizontal:
|
|
19
|
-
vertical:
|
|
18
|
+
horizontal: "h-px w-full",
|
|
19
|
+
vertical: "h-full w-px flex-col"
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
});
|
|
@@ -35,7 +35,7 @@ function Separator({ align, className, decorative = true, orientation, ...props
|
|
|
35
35
|
}
|
|
36
36
|
function SeparatorItem({ className, ...props }) {
|
|
37
37
|
return /*#__PURE__*/ jsx("div", {
|
|
38
|
-
className: cn(
|
|
38
|
+
className: cn("absolute mx-2 bg-background px-2 text-sm text-muted-foreground", className),
|
|
39
39
|
"data-slot": "separator-item",
|
|
40
40
|
...props
|
|
41
41
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { VariantProps } from
|
|
2
|
-
import type { ComponentProps, JSX } from
|
|
3
|
-
import * as SheetPrimitive from
|
|
4
|
-
import { buttonVariants } from
|
|
1
|
+
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
2
|
+
import type { ComponentProps, JSX } from "react";
|
|
3
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
4
|
+
import { buttonVariants } from "./button";
|
|
5
5
|
declare const sheetContentVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
6
6
|
side: {
|
|
7
7
|
bottom: string;
|
|
@@ -22,19 +22,19 @@ interface SheetContentProps extends ComponentProps<typeof SheetPrimitive.Content
|
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
declare function SheetContent({ children, className, classNames, side, ...props }: SheetContentProps): JSX.Element;
|
|
25
|
-
type SheetHeaderProps = ComponentProps<
|
|
25
|
+
type SheetHeaderProps = ComponentProps<"div">;
|
|
26
26
|
declare function SheetHeader({ className, ...props }: SheetHeaderProps): JSX.Element;
|
|
27
|
-
type SheetBodyProps = ComponentProps<
|
|
27
|
+
type SheetBodyProps = ComponentProps<"div">;
|
|
28
28
|
declare function SheetBody({ className, ...props }: SheetBodyProps): JSX.Element;
|
|
29
|
-
type SheetFooterProps = ComponentProps<
|
|
29
|
+
type SheetFooterProps = ComponentProps<"div">;
|
|
30
30
|
declare function SheetFooter({ className, ...props }: SheetFooterProps): JSX.Element;
|
|
31
31
|
type SheetTitleProps = ComponentProps<typeof SheetPrimitive.Title>;
|
|
32
32
|
declare function SheetTitle({ className, ...props }: SheetTitleProps): JSX.Element;
|
|
33
33
|
type SheetDescriptionProps = ComponentProps<typeof SheetPrimitive.Description>;
|
|
34
34
|
declare function SheetDescription({ className, ...props }: SheetDescriptionProps): JSX.Element;
|
|
35
35
|
interface SheetCloseProps extends ComponentProps<typeof SheetPrimitive.Close> {
|
|
36
|
-
size?: VariantProps<typeof buttonVariants>[
|
|
37
|
-
variant?: VariantProps<typeof buttonVariants>[
|
|
36
|
+
size?: VariantProps<typeof buttonVariants>["size"];
|
|
37
|
+
variant?: VariantProps<typeof buttonVariants>["variant"];
|
|
38
38
|
}
|
|
39
39
|
declare function SheetClose({ className, size, variant, ...props }: SheetCloseProps): JSX.Element;
|
|
40
40
|
export { sheetContentVariants };
|