@codefast/ui 0.3.11 → 0.3.12-canary.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/CHANGELOG.md +15 -0
- package/README.md +4 -0
- package/dist/components/accordion.d.ts +11 -29
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +10 -37
- package/dist/components/alert-dialog.d.ts +25 -60
- package/dist/components/alert-dialog.d.ts.map +1 -0
- package/dist/components/alert-dialog.js +16 -69
- package/dist/components/alert.d.ts +16 -27
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +22 -30
- package/dist/components/aspect-ratio.d.ts +5 -8
- package/dist/components/aspect-ratio.d.ts.map +1 -0
- package/dist/components/aspect-ratio.js +5 -7
- package/dist/components/avatar.d.ts +7 -17
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +7 -18
- package/dist/components/badge.d.ts +15 -21
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +23 -20
- package/dist/components/breadcrumb.d.ts +13 -35
- package/dist/components/breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb.js +13 -49
- package/dist/components/button-group.d.ts +15 -29
- package/dist/components/button-group.d.ts.map +1 -0
- package/dist/components/button-group.js +22 -27
- package/dist/components/button.d.ts +26 -35
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +43 -51
- package/dist/components/calendar.d.ts +10 -24
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +75 -92
- package/dist/components/card.d.ts +11 -34
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +11 -39
- package/dist/components/carousel.d.ts +25 -55
- package/dist/components/carousel.d.ts.map +1 -0
- package/dist/components/carousel.js +82 -114
- package/dist/components/chart.d.ts +37 -72
- package/dist/components/chart.d.ts.map +1 -0
- package/dist/components/chart.js +161 -150
- package/dist/components/checkbox-cards.d.ts +9 -15
- package/dist/components/checkbox-cards.d.ts.map +1 -0
- package/dist/components/checkbox-cards.js +8 -22
- package/dist/components/checkbox-group.d.ts +9 -16
- package/dist/components/checkbox-group.d.ts.map +1 -0
- package/dist/components/checkbox-group.js +7 -19
- package/dist/components/checkbox.d.ts +5 -9
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +6 -14
- package/dist/components/collapsible.d.ts +7 -14
- package/dist/components/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible.js +7 -15
- package/dist/components/command.d.ts +24 -55
- package/dist/components/command.d.ts.map +1 -0
- package/dist/components/command.js +18 -69
- package/dist/components/context-menu.d.ts +23 -72
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu.js +21 -89
- package/dist/components/dialog.d.ts +23 -53
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +20 -72
- package/dist/components/drawer.d.ts +29 -60
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/drawer.js +16 -58
- package/dist/components/dropdown-menu.d.ts +23 -73
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu.js +21 -96
- package/dist/components/empty.d.ts +16 -37
- package/dist/components/empty.d.ts.map +1 -0
- package/dist/components/empty.js +24 -44
- package/dist/components/field.d.ts +26 -63
- package/dist/components/field.d.ts.map +1 -0
- package/dist/components/field.js +46 -89
- package/dist/components/form.d.ts +16 -37
- package/dist/components/form.d.ts.map +1 -0
- package/dist/components/form.js +50 -66
- package/dist/components/hover-card.d.ts +8 -21
- package/dist/components/hover-card.d.ts.map +1 -0
- package/dist/components/hover-card.js +8 -23
- package/dist/components/input-group.d.ts +29 -53
- package/dist/components/input-group.d.ts.map +1 -0
- package/dist/components/input-group.js +59 -66
- package/dist/components/input-number.d.ts +8 -28
- package/dist/components/input-number.d.ts.map +1 -0
- package/dist/components/input-number.js +14 -55
- package/dist/components/input-otp.d.ts +11 -24
- package/dist/components/input-otp.d.ts.map +1 -0
- package/dist/components/input-otp.js +13 -34
- package/dist/components/input-password.d.ts +6 -12
- package/dist/components/input-password.d.ts.map +1 -0
- package/dist/components/input-password.js +10 -31
- package/dist/components/input-search.d.ts +9 -18
- package/dist/components/input-search.d.ts.map +1 -0
- package/dist/components/input-search.js +16 -44
- package/dist/components/input.d.ts +5 -10
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +5 -9
- package/dist/components/item.d.ts +33 -69
- package/dist/components/item.d.ts.map +1 -0
- package/dist/components/item.js +47 -90
- package/dist/components/kbd.d.ts +6 -13
- package/dist/components/kbd.d.ts.map +1 -0
- package/dist/components/kbd.js +6 -13
- package/dist/components/label.d.ts +5 -9
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/label.js +5 -8
- package/dist/components/menubar.d.ts +24 -80
- package/dist/components/menubar.d.ts.map +1 -0
- package/dist/components/menubar.js +23 -99
- package/dist/components/native-select.d.ts +7 -16
- package/dist/components/native-select.d.ts.map +1 -0
- package/dist/components/native-select.js +7 -25
- package/dist/components/navigation-menu.d.ts +13 -36
- package/dist/components/navigation-menu.d.ts.map +1 -0
- package/dist/components/navigation-menu.js +25 -61
- package/dist/components/pagination.d.ts +15 -35
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/pagination.js +13 -55
- package/dist/components/popover.d.ts +9 -24
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +9 -27
- package/dist/components/progress-circle.d.ts +89 -106
- package/dist/components/progress-circle.d.ts.map +1 -0
- package/dist/components/progress-circle.js +70 -103
- package/dist/components/progress.d.ts +5 -10
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +7 -13
- package/dist/components/radio-cards.d.ts +5 -10
- package/dist/components/radio-cards.d.ts.map +1 -0
- package/dist/components/radio-cards.js +7 -21
- package/dist/components/radio-group.d.ts +6 -13
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +6 -17
- package/dist/components/radio.d.ts +6 -12
- package/dist/components/radio.d.ts.map +1 -0
- package/dist/components/radio.js +5 -10
- package/dist/components/resizable.d.ts +8 -18
- package/dist/components/resizable.d.ts.map +1 -0
- package/dist/components/resizable.js +7 -21
- package/dist/components/scroll-area.d.ts +21 -33
- package/dist/components/scroll-area.d.ts.map +1 -0
- package/dist/components/scroll-area.js +64 -84
- package/dist/components/select.d.ts +17 -50
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +26 -78
- package/dist/components/separator.d.ts +20 -29
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +27 -36
- package/dist/components/sheet.d.ts +30 -62
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sheet.js +36 -80
- package/dist/components/sidebar.d.ts +67 -160
- package/dist/components/sidebar.d.ts.map +1 -0
- package/dist/components/sidebar.js +166 -301
- package/dist/components/skeleton.d.ts +5 -9
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +5 -8
- package/dist/components/slider.d.ts +5 -13
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/slider.js +12 -34
- package/dist/components/sonner.d.ts +8 -10
- package/dist/components/sonner.d.ts.map +1 -0
- package/dist/components/sonner.js +13 -16
- package/dist/components/spinner.d.ts +6 -12
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/spinner.js +20 -33
- package/dist/components/switch.d.ts +5 -9
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +5 -12
- package/dist/components/table.d.ts +12 -37
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +12 -47
- package/dist/components/tabs.d.ts +8 -21
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +8 -23
- package/dist/components/textarea.d.ts +5 -9
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +5 -8
- package/dist/components/toggle-group.d.ts +10 -24
- package/dist/components/toggle-group.d.ts.map +1 -0
- package/dist/components/toggle-group.js +20 -38
- package/dist/components/toggle.d.ts +18 -25
- package/dist/components/toggle.d.ts.map +1 -0
- package/dist/components/toggle.js +24 -29
- package/dist/components/tooltip.d.ts +9 -24
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +9 -28
- package/dist/hooks/use-animated-value.d.ts +2 -4
- package/dist/hooks/use-animated-value.d.ts.map +1 -0
- package/dist/hooks/use-animated-value.js +67 -58
- package/dist/hooks/use-copy-to-clipboard.d.ts +6 -11
- package/dist/hooks/use-copy-to-clipboard.d.ts.map +1 -0
- package/dist/hooks/use-copy-to-clipboard.js +42 -39
- package/dist/hooks/use-is-mobile.d.ts +2 -4
- package/dist/hooks/use-is-mobile.d.ts.map +1 -0
- package/dist/hooks/use-is-mobile.js +20 -23
- package/dist/hooks/use-media-query.d.ts +2 -4
- package/dist/hooks/use-media-query.d.ts.map +1 -0
- package/dist/hooks/use-media-query.js +49 -46
- package/dist/hooks/use-mutation-observer.d.ts +3 -6
- package/dist/hooks/use-mutation-observer.d.ts.map +1 -0
- package/dist/hooks/use-mutation-observer.js +33 -34
- package/dist/hooks/use-pagination.d.ts +15 -22
- package/dist/hooks/use-pagination.d.ts.map +1 -0
- package/dist/hooks/use-pagination.js +99 -99
- package/dist/index.d.ts +131 -69
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +68 -69
- package/dist/primitives/checkbox-group.d.ts +84 -105
- package/dist/primitives/checkbox-group.d.ts.map +1 -0
- package/dist/primitives/checkbox-group.js +91 -105
- package/dist/primitives/input-number.d.ts +41 -51
- package/dist/primitives/input-number.d.ts.map +1 -0
- package/dist/primitives/input-number.js +417 -473
- package/dist/primitives/input.d.ts +43 -48
- package/dist/primitives/input.d.ts.map +1 -0
- package/dist/primitives/input.js +67 -66
- package/dist/primitives/progress-circle.d.ts +49 -79
- package/dist/primitives/progress-circle.d.ts.map +1 -0
- package/dist/primitives/progress-circle.js +134 -149
- package/package.json +17 -10
- package/{dist → src}/css/preset.css +1 -1
- /package/{dist → src}/css/amber.css +0 -0
- /package/{dist → src}/css/blue.css +0 -0
- /package/{dist → src}/css/cyan.css +0 -0
- /package/{dist → src}/css/emerald.css +0 -0
- /package/{dist → src}/css/fuchsia.css +0 -0
- /package/{dist → src}/css/gray.css +0 -0
- /package/{dist → src}/css/green.css +0 -0
- /package/{dist → src}/css/indigo.css +0 -0
- /package/{dist → src}/css/lime.css +0 -0
- /package/{dist → src}/css/neutral.css +0 -0
- /package/{dist → src}/css/orange.css +0 -0
- /package/{dist → src}/css/pink.css +0 -0
- /package/{dist → src}/css/purple.css +0 -0
- /package/{dist → src}/css/red.css +0 -0
- /package/{dist → src}/css/rose.css +0 -0
- /package/{dist → src}/css/sky.css +0 -0
- /package/{dist → src}/css/slate.css +0 -0
- /package/{dist → src}/css/stone.css +0 -0
- /package/{dist → src}/css/style.css +0 -0
- /package/{dist → src}/css/teal.css +0 -0
- /package/{dist → src}/css/violet.css +0 -0
- /package/{dist → src}/css/yellow.css +0 -0
- /package/{dist → src}/css/zinc.css +0 -0
|
@@ -1,116 +1,83 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { Indicator as ProgressCircleIndicator, ProgressCircle as ProgressCircle$1, ProgressCircleProvider, ProgressCircleSVG, ProgressCircleTrack, ProgressCircleValue } from "../primitives/progress-circle.js";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
3
|
import { tv } from "@codefast/tailwind-variants";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
4
|
import { useCallback, useMemo } from "react";
|
|
7
|
-
|
|
5
|
+
import { useAnimatedValue } from "#hooks/use-animated-value";
|
|
6
|
+
import * as ProgressCirclePrimitive from "#primitives/progress-circle";
|
|
7
|
+
/* -------------------------------------------------------------------------------------------------
|
|
8
|
+
* Variant: ProgressCircle
|
|
9
|
+
* ----------------------------------------------------------------------------------------------- */
|
|
8
10
|
const progressCircleVariants = tv({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
thick: {},
|
|
32
|
-
thin: {}
|
|
33
|
-
},
|
|
34
|
-
variant: {
|
|
35
|
-
default: {
|
|
36
|
-
indicator: "text-primary",
|
|
37
|
-
track: "text-primary/20"
|
|
38
|
-
},
|
|
39
|
-
destructive: {
|
|
40
|
-
indicator: "text-destructive",
|
|
41
|
-
track: "text-destructive/20"
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
11
|
+
defaultVariants: { size: "md", thickness: "regular", variant: "default" },
|
|
12
|
+
slots: {
|
|
13
|
+
indicator: "origin-center",
|
|
14
|
+
label: "absolute inset-0 flex items-center justify-center text-xs font-medium",
|
|
15
|
+
root: "relative inline-flex items-center justify-center",
|
|
16
|
+
svg: "size-full",
|
|
17
|
+
track: "origin-center",
|
|
18
|
+
},
|
|
19
|
+
variants: {
|
|
20
|
+
size: {
|
|
21
|
+
sm: { label: "text-[0.625rem]" },
|
|
22
|
+
md: { label: "text-xs" },
|
|
23
|
+
lg: { label: "text-sm" },
|
|
24
|
+
xl: { label: "text-base" },
|
|
25
|
+
"2xl": { label: "text-lg" },
|
|
26
|
+
},
|
|
27
|
+
thickness: { regular: {}, thick: {}, thin: {} },
|
|
28
|
+
variant: {
|
|
29
|
+
default: { indicator: "text-primary", track: "text-primary/20" },
|
|
30
|
+
destructive: { indicator: "text-destructive", track: "text-destructive/20" },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
45
33
|
});
|
|
46
|
-
function ProgressCircle({ animate = true, animationDuration =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
]);
|
|
63
|
-
const shouldShowLabel = showValue || Boolean(customLabel);
|
|
64
|
-
const renderLabel = useCallback(() => {
|
|
65
|
-
if (customLabel) return customLabel({ value: displayValue });
|
|
66
|
-
return `${displayValue.toString()}%`;
|
|
67
|
-
}, [customLabel, displayValue]);
|
|
68
|
-
return /* @__PURE__ */ jsx(ProgressCircleProvider, {
|
|
69
|
-
size: actualSize,
|
|
70
|
-
strokeWidth: actualThickness,
|
|
71
|
-
value,
|
|
72
|
-
...props,
|
|
73
|
-
children: /* @__PURE__ */ jsxs(ProgressCircle$1, {
|
|
74
|
-
className: slots.root({ className: [className, classNames?.root] }),
|
|
75
|
-
children: [/* @__PURE__ */ jsxs(ProgressCircleSVG, {
|
|
76
|
-
className: slots.svg({ className: classNames?.svg }),
|
|
77
|
-
children: [/* @__PURE__ */ jsx(ProgressCircleTrack, { className: slots.track({ className: classNames?.track }) }), /* @__PURE__ */ jsx(ProgressCircleIndicator, {
|
|
78
|
-
className: slots.indicator({ className: classNames?.indicator }),
|
|
79
|
-
style: {
|
|
80
|
-
transitionDuration: `${animationDuration.toString()}ms`,
|
|
81
|
-
transitionProperty: "stroke-dashoffset"
|
|
82
|
-
}
|
|
83
|
-
})]
|
|
84
|
-
}), shouldShowLabel ? /* @__PURE__ */ jsx(ProgressCircleValue, {
|
|
85
|
-
className: slots.label({ className: classNames?.label }),
|
|
86
|
-
children: renderLabel()
|
|
87
|
-
}) : null]
|
|
88
|
-
})
|
|
89
|
-
});
|
|
34
|
+
function ProgressCircle({ animate = true, animationDuration = 1000, className, classNames, customLabel, showValue = false, size, sizeInPixels, strokeWidth, thickness = "regular", value = 0, variant = "default", ...props }) {
|
|
35
|
+
const displayValue = useAnimatedValue(value, animationDuration, animate);
|
|
36
|
+
const actualSize = useMemo(() => sizeInPixels ?? getActualSize(size), [sizeInPixels, size]);
|
|
37
|
+
const actualThickness = useMemo(() => strokeWidth ?? getStrokeWidth(thickness, actualSize), [strokeWidth, thickness, actualSize]);
|
|
38
|
+
const slots = useMemo(() => progressCircleVariants({ size, thickness, variant }), [variant, size, thickness]);
|
|
39
|
+
const shouldShowLabel = showValue || Boolean(customLabel);
|
|
40
|
+
const renderLabel = useCallback(() => {
|
|
41
|
+
if (customLabel) {
|
|
42
|
+
return customLabel({ value: displayValue });
|
|
43
|
+
}
|
|
44
|
+
return `${displayValue.toString()}%`;
|
|
45
|
+
}, [customLabel, displayValue]);
|
|
46
|
+
return (_jsx(ProgressCirclePrimitive.Provider, { size: actualSize, strokeWidth: actualThickness, value: value, ...props, children: _jsxs(ProgressCirclePrimitive.Root, { className: slots.root({ className: [className, classNames?.root] }), children: [_jsxs(ProgressCirclePrimitive.SVG, { className: slots.svg({ className: classNames?.svg }), children: [_jsx(ProgressCirclePrimitive.Track, { className: slots.track({ className: classNames?.track }) }), _jsx(ProgressCirclePrimitive.Indicator, { className: slots.indicator({ className: classNames?.indicator }), style: {
|
|
47
|
+
transitionDuration: `${animationDuration.toString()}ms`,
|
|
48
|
+
transitionProperty: "stroke-dashoffset",
|
|
49
|
+
} })] }), shouldShowLabel ? (_jsx(ProgressCirclePrimitive.Value, { className: slots.label({ className: classNames?.label }), children: renderLabel() })) : null] }) }));
|
|
90
50
|
}
|
|
91
51
|
ProgressCircle.displayName = "ProgressCircle";
|
|
52
|
+
/* -----------------------------------------------------------------------------
|
|
53
|
+
* Helpers
|
|
54
|
+
* -------------------------------------------------------------------------- */
|
|
92
55
|
/**
|
|
93
|
-
* Maps size variants to actual pixel sizes
|
|
94
|
-
*/
|
|
56
|
+
* Maps size variants to actual pixel sizes
|
|
57
|
+
*/
|
|
95
58
|
const getActualSize = (size) => {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
59
|
+
const sizeMap = {
|
|
60
|
+
"2xl": 128,
|
|
61
|
+
lg: 64,
|
|
62
|
+
md: 48,
|
|
63
|
+
sm: 32,
|
|
64
|
+
xl: 96,
|
|
65
|
+
};
|
|
66
|
+
return size ? sizeMap[size] : 48;
|
|
103
67
|
};
|
|
104
68
|
/**
|
|
105
|
-
* Calculates stroke width based on thickness variant and circle size
|
|
106
|
-
*/
|
|
69
|
+
* Calculates stroke width based on thickness variant and circle size
|
|
70
|
+
*/
|
|
107
71
|
const getStrokeWidth = (thickness, size) => {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
72
|
+
const thicknessMap = {
|
|
73
|
+
regular: Math.max(3, size * 0.05),
|
|
74
|
+
thick: Math.max(4, size * 0.075),
|
|
75
|
+
thin: Math.max(2, size * 0.025),
|
|
76
|
+
};
|
|
77
|
+
return thickness ? thicknessMap[thickness] : Math.max(3, size * 0.05);
|
|
114
78
|
};
|
|
115
|
-
|
|
116
|
-
|
|
79
|
+
/* -----------------------------------------------------------------------------
|
|
80
|
+
* Exports
|
|
81
|
+
* -------------------------------------------------------------------------- */
|
|
82
|
+
export { progressCircleVariants };
|
|
83
|
+
export { ProgressCircle };
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import { ComponentProps, JSX } from "react";
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
2
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
3
|
-
|
|
4
|
-
//#region src/components/progress.d.ts
|
|
5
3
|
type ProgressProps = ComponentProps<typeof ProgressPrimitive.Root>;
|
|
6
|
-
declare function Progress({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}: ProgressProps): JSX.Element;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { Progress, type ProgressProps };
|
|
4
|
+
declare function Progress({ className, value, ...props }: ProgressProps): JSX.Element;
|
|
5
|
+
export { Progress };
|
|
6
|
+
export type { ProgressProps };
|
|
7
|
+
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/components/progress.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAM9D,KAAK,aAAa,GAAG,cAAc,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAC;AAEnE,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CAgB5E;AAMD,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import { cn } from "@codefast/tailwind-variants";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
5
|
-
//#region src/components/progress.tsx
|
|
6
5
|
function Progress({ className, value, ...props }) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
...props,
|
|
11
|
-
children: /* @__PURE__ */ jsx(ProgressPrimitive.Indicator, {
|
|
12
|
-
className: "size-full flex-1 bg-primary transition-all",
|
|
13
|
-
"data-slot": "progress-indicator",
|
|
14
|
-
style: { transform: `translateX(-${(100 - (value ?? 0)).toString()}%)` }
|
|
15
|
-
})
|
|
16
|
-
});
|
|
6
|
+
return (_jsx(ProgressPrimitive.Root, { className: cn("relative h-2 w-full overflow-hidden rounded-full bg-primary/20", className), "data-slot": "progress", ...props, children: _jsx(ProgressPrimitive.Indicator, { className: "size-full flex-1 bg-primary transition-all", "data-slot": "progress-indicator", style: {
|
|
7
|
+
transform: `translateX(-${(100 - (value ?? 0)).toString()}%)`,
|
|
8
|
+
} }) }));
|
|
17
9
|
}
|
|
18
|
-
|
|
10
|
+
/* -----------------------------------------------------------------------------
|
|
11
|
+
* Exports
|
|
12
|
+
* -------------------------------------------------------------------------- */
|
|
19
13
|
export { Progress };
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import { ComponentProps, JSX } from "react";
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
2
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
3
|
-
|
|
4
|
-
//#region src/components/radio-cards.d.ts
|
|
5
3
|
type RadioCardsProps = ComponentProps<typeof RadioGroupPrimitive.Root>;
|
|
6
4
|
declare function RadioCards(props: RadioCardsProps): JSX.Element;
|
|
7
5
|
type RadioCardsItemProps = ComponentProps<typeof RadioGroupPrimitive.Item>;
|
|
8
|
-
declare function RadioCardsItem({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}: RadioCardsItemProps): JSX.Element;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { RadioCards, RadioCardsItem, type RadioCardsItemProps, type RadioCardsProps };
|
|
6
|
+
declare function RadioCardsItem({ children, className, ...props }: RadioCardsItemProps): JSX.Element;
|
|
7
|
+
export { RadioCards, RadioCardsItem };
|
|
8
|
+
export type { RadioCardsItemProps, RadioCardsProps };
|
|
9
|
+
//# sourceMappingURL=radio-cards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-cards.d.ts","sourceRoot":"","sources":["../../src/components/radio-cards.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAC;AAQnE,KAAK,eAAe,GAAG,cAAc,CAAC,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;AAEvE,iBAAS,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,GAAG,CAAC,OAAO,CAEvD;AAMD,KAAK,mBAAmB,GAAG,cAAc,CAAC,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;AAE3E,iBAAS,cAAc,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,CAsB3F;AAMD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC;AACtC,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1,29 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cn } from "@codefast/tailwind-variants";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
4
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
6
|
-
|
|
5
|
+
import { Label } from "#components/label";
|
|
7
6
|
function RadioCards(props) {
|
|
8
|
-
|
|
9
|
-
"data-slot": "radio-cards",
|
|
10
|
-
...props
|
|
11
|
-
});
|
|
7
|
+
return _jsx(RadioGroupPrimitive.Root, { "data-slot": "radio-cards", ...props });
|
|
12
8
|
}
|
|
13
9
|
function RadioCardsItem({ children, className, ...props }) {
|
|
14
|
-
|
|
15
|
-
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",
|
|
16
|
-
"data-slot": "radio-card",
|
|
17
|
-
children: [/* @__PURE__ */ jsx(RadioGroupPrimitive.Item, {
|
|
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
|
-
"data-slot": "radio-card-item",
|
|
20
|
-
...props,
|
|
21
|
-
children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, {
|
|
22
|
-
className: "size-1 rounded-full bg-background",
|
|
23
|
-
"data-slot": "radio-card-indicator"
|
|
24
|
-
})
|
|
25
|
-
}), children]
|
|
26
|
-
});
|
|
10
|
+
return (_jsxs(Label, { 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", "data-slot": "radio-card", children: [_jsx(RadioGroupPrimitive.Item, { 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), "data-slot": "radio-card-item", ...props, children: _jsx(RadioGroupPrimitive.Indicator, { className: "size-1 rounded-full bg-background", "data-slot": "radio-card-indicator" }) }), children] }));
|
|
27
11
|
}
|
|
28
|
-
|
|
12
|
+
/* -----------------------------------------------------------------------------
|
|
13
|
+
* Exports
|
|
14
|
+
* -------------------------------------------------------------------------- */
|
|
29
15
|
export { RadioCards, RadioCardsItem };
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import { ComponentProps, JSX } from "react";
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
2
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
3
|
-
|
|
4
|
-
//#region src/components/radio-group.d.ts
|
|
5
3
|
type RadioGroupProps = ComponentProps<typeof RadioGroupPrimitive.Root>;
|
|
6
|
-
declare function RadioGroup({
|
|
7
|
-
className,
|
|
8
|
-
...props
|
|
9
|
-
}: RadioGroupProps): JSX.Element;
|
|
4
|
+
declare function RadioGroup({ className, ...props }: RadioGroupProps): JSX.Element;
|
|
10
5
|
type RadioGroupItemProps = ComponentProps<typeof RadioGroupPrimitive.Item>;
|
|
11
|
-
declare function RadioGroupItem({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
//#endregion
|
|
16
|
-
export { RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps };
|
|
6
|
+
declare function RadioGroupItem({ className, ...props }: RadioGroupItemProps): JSX.Element;
|
|
7
|
+
export { RadioGroup, RadioGroupItem };
|
|
8
|
+
export type { RadioGroupItemProps, RadioGroupProps };
|
|
9
|
+
//# sourceMappingURL=radio-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../../src/components/radio-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAC;AAMnE,KAAK,eAAe,GAAG,cAAc,CAAC,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;AAEvE,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,GAAG,GAAG,CAAC,OAAO,CAQzE;AAMD,KAAK,mBAAmB,GAAG,cAAc,CAAC,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;AAE3E,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,CAgBjF;AAMD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC;AACtC,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1,25 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import { cn } from "@codefast/tailwind-variants";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
5
|
-
//#region src/components/radio-group.tsx
|
|
6
5
|
function RadioGroup({ className, ...props }) {
|
|
7
|
-
|
|
8
|
-
className: cn("grid gap-2", className),
|
|
9
|
-
"data-slot": "radio-group",
|
|
10
|
-
...props
|
|
11
|
-
});
|
|
6
|
+
return (_jsx(RadioGroupPrimitive.Root, { className: cn("grid gap-2", className), "data-slot": "radio-group", ...props }));
|
|
12
7
|
}
|
|
13
8
|
function RadioGroupItem({ className, ...props }) {
|
|
14
|
-
|
|
15
|
-
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),
|
|
16
|
-
"data-slot": "radio-group-item",
|
|
17
|
-
...props,
|
|
18
|
-
children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, {
|
|
19
|
-
className: "size-1 rounded-full bg-background",
|
|
20
|
-
"data-slot": "radio-group-indicator"
|
|
21
|
-
})
|
|
22
|
-
});
|
|
9
|
+
return (_jsx(RadioGroupPrimitive.Item, { 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), "data-slot": "radio-group-item", ...props, children: _jsx(RadioGroupPrimitive.Indicator, { className: "size-1 rounded-full bg-background", "data-slot": "radio-group-indicator" }) }));
|
|
23
10
|
}
|
|
24
|
-
|
|
11
|
+
/* -----------------------------------------------------------------------------
|
|
12
|
+
* Exports
|
|
13
|
+
* -------------------------------------------------------------------------- */
|
|
25
14
|
export { RadioGroup, RadioGroupItem };
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import { ComponentProps, JSX } from "react";
|
|
2
|
-
|
|
3
|
-
//#region src/components/radio.d.ts
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
4
2
|
interface RadioProps extends Omit<ComponentProps<"input">, "type"> {
|
|
5
|
-
|
|
3
|
+
onValueChange?: (value: string) => void;
|
|
6
4
|
}
|
|
7
|
-
declare function Radio({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
...props
|
|
12
|
-
}: RadioProps): JSX.Element;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { Radio, type RadioProps };
|
|
5
|
+
declare function Radio({ className, onChange, onValueChange, ...props }: RadioProps): JSX.Element;
|
|
6
|
+
export { Radio };
|
|
7
|
+
export type { RadioProps };
|
|
8
|
+
//# sourceMappingURL=radio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../src/components/radio.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AASjD,UAAU,UAAW,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAChE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAED,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,GAAG,GAAG,CAAC,OAAO,CAexF;AAMD,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,YAAY,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/components/radio.js
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import { cn } from "@codefast/tailwind-variants";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { composeEventHandlers } from "@radix-ui/primitive";
|
|
5
|
-
//#region src/components/radio.tsx
|
|
6
5
|
function Radio({ className, onChange, onValueChange, ...props }) {
|
|
7
|
-
|
|
8
|
-
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),
|
|
9
|
-
"data-slot": "radio",
|
|
10
|
-
type: "radio",
|
|
11
|
-
onChange: composeEventHandlers(onChange, (event) => onValueChange?.(event.currentTarget.value)),
|
|
12
|
-
...props
|
|
13
|
-
});
|
|
6
|
+
return (_jsx("input", { 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), "data-slot": "radio", type: "radio", onChange: composeEventHandlers(onChange, (event) => onValueChange?.(event.currentTarget.value)), ...props }));
|
|
14
7
|
}
|
|
15
|
-
|
|
8
|
+
/* -----------------------------------------------------------------------------
|
|
9
|
+
* Exports
|
|
10
|
+
* -------------------------------------------------------------------------- */
|
|
16
11
|
export { Radio };
|
|
@@ -1,23 +1,13 @@
|
|
|
1
|
-
import { ComponentProps, JSX } from "react";
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
2
|
import * as ResizablePrimitive from "react-resizable-panels";
|
|
3
|
-
|
|
4
|
-
//#region src/components/resizable.d.ts
|
|
5
3
|
type ResizableGroupProps = ComponentProps<typeof ResizablePrimitive.Group>;
|
|
6
|
-
declare function ResizableGroup({
|
|
7
|
-
className,
|
|
8
|
-
...props
|
|
9
|
-
}: ResizableGroupProps): JSX.Element;
|
|
4
|
+
declare function ResizableGroup({ className, ...props }: ResizableGroupProps): JSX.Element;
|
|
10
5
|
type ResizablePanelProps = ComponentProps<typeof ResizablePrimitive.Panel>;
|
|
11
|
-
declare function ResizablePanel({
|
|
12
|
-
...props
|
|
13
|
-
}: ResizablePanelProps): JSX.Element;
|
|
6
|
+
declare function ResizablePanel({ ...props }: ResizablePanelProps): JSX.Element;
|
|
14
7
|
interface ResizableSeparatorProps extends ComponentProps<typeof ResizablePrimitive.Separator> {
|
|
15
|
-
|
|
8
|
+
withHandle?: boolean;
|
|
16
9
|
}
|
|
17
|
-
declare function ResizableSeparator({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}: ResizableSeparatorProps): JSX.Element;
|
|
22
|
-
//#endregion
|
|
23
|
-
export { ResizableGroup, type ResizableGroupProps, ResizablePanel, type ResizablePanelProps, ResizableSeparator, type ResizableSeparatorProps };
|
|
10
|
+
declare function ResizableSeparator({ className, withHandle, ...props }: ResizableSeparatorProps): JSX.Element;
|
|
11
|
+
export { ResizableGroup, ResizablePanel, ResizableSeparator };
|
|
12
|
+
export type { ResizableGroupProps, ResizablePanelProps, ResizableSeparatorProps };
|
|
13
|
+
//# sourceMappingURL=resizable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resizable.d.ts","sourceRoot":"","sources":["../../src/components/resizable.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAIjD,OAAO,KAAK,kBAAkB,MAAM,wBAAwB,CAAC;AAM7D,KAAK,mBAAmB,GAAG,cAAc,CAAC,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC;AAE3E,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,CAQjF;AAMD,KAAK,mBAAmB,GAAG,cAAc,CAAC,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC;AAE3E,iBAAS,cAAc,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,CAEtE;AAMD,UAAU,uBAAwB,SAAQ,cAAc,CAAC,OAAO,kBAAkB,CAAC,SAAS,CAAC;IAC3F,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,UAAU,EACV,GAAG,KAAK,EACT,EAAE,uBAAuB,GAAG,GAAG,CAAC,OAAO,CAmBvC;AAMD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC;AAC9D,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -1,32 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import { cn } from "@codefast/tailwind-variants";
|
|
3
4
|
import { GripVerticalIcon } from "lucide-react";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import * as ResizablePrimitive from "react-resizable-panels";
|
|
6
|
-
//#region src/components/resizable.tsx
|
|
7
6
|
function ResizableGroup({ className, ...props }) {
|
|
8
|
-
|
|
9
|
-
className: cn("flex size-full", className),
|
|
10
|
-
"data-slot": "resizable-group",
|
|
11
|
-
...props
|
|
12
|
-
});
|
|
7
|
+
return (_jsx(ResizablePrimitive.Group, { className: cn("flex size-full", className), "data-slot": "resizable-group", ...props }));
|
|
13
8
|
}
|
|
14
9
|
function ResizablePanel({ ...props }) {
|
|
15
|
-
|
|
16
|
-
"data-slot": "resizable-panel",
|
|
17
|
-
...props
|
|
18
|
-
});
|
|
10
|
+
return _jsx(ResizablePrimitive.Panel, { "data-slot": "resizable-panel", ...props });
|
|
19
11
|
}
|
|
20
12
|
function ResizableSeparator({ className, withHandle, ...props }) {
|
|
21
|
-
|
|
22
|
-
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),
|
|
23
|
-
"data-slot": "resizable-separator",
|
|
24
|
-
...props,
|
|
25
|
-
children: withHandle ? /* @__PURE__ */ jsx("div", {
|
|
26
|
-
className: "z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",
|
|
27
|
-
children: /* @__PURE__ */ jsx(GripVerticalIcon, { className: "size-2.5" })
|
|
28
|
-
}) : null
|
|
29
|
-
});
|
|
13
|
+
return (_jsx(ResizablePrimitive.Separator, { 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), "data-slot": "resizable-separator", ...props, children: withHandle ? (_jsx("div", { className: "z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border", children: _jsx(GripVerticalIcon, { className: "size-2.5" }) })) : null }));
|
|
30
14
|
}
|
|
31
|
-
|
|
15
|
+
/* -----------------------------------------------------------------------------
|
|
16
|
+
* Exports
|
|
17
|
+
* -------------------------------------------------------------------------- */
|
|
32
18
|
export { ResizableGroup, ResizablePanel, ResizableSeparator };
|
|
@@ -1,40 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { ComponentProps, JSX } from "react";
|
|
4
|
-
import { Scope } from "@radix-ui/react-context";
|
|
1
|
+
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
2
|
+
import type { Scope } from "@radix-ui/react-context";
|
|
3
|
+
import type { ComponentProps, JSX } from "react";
|
|
5
4
|
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
lg: string;
|
|
18
|
-
};
|
|
5
|
+
declare const scrollAreaScrollbarVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
6
|
+
orientation: {
|
|
7
|
+
horizontal: string;
|
|
8
|
+
vertical: string;
|
|
9
|
+
};
|
|
10
|
+
size: {
|
|
11
|
+
none: string;
|
|
12
|
+
sm: string;
|
|
13
|
+
md: string;
|
|
14
|
+
lg: string;
|
|
15
|
+
};
|
|
19
16
|
}, Record<string, never>>;
|
|
20
17
|
type ScopedProps<P> = P & {
|
|
21
|
-
|
|
18
|
+
__scopeScrollArea?: Scope;
|
|
22
19
|
};
|
|
23
20
|
type ScrollAreaContextValue = Pick<VariantProps<typeof scrollAreaScrollbarVariants>, "size">;
|
|
24
21
|
type ScrollAreaProps = ScopedProps<ComponentProps<typeof ScrollAreaPrimitive.Root> & ScrollAreaContextValue>;
|
|
25
|
-
declare function ScrollArea({
|
|
26
|
-
__scopeScrollArea,
|
|
27
|
-
children,
|
|
28
|
-
className,
|
|
29
|
-
size,
|
|
30
|
-
...props
|
|
31
|
-
}: ScrollAreaProps): JSX.Element;
|
|
22
|
+
declare function ScrollArea({ __scopeScrollArea, children, className, size, ...props }: ScrollAreaProps): JSX.Element;
|
|
32
23
|
type ScrollAreaScrollbarProps = ScopedProps<ComponentProps<typeof ScrollAreaPrimitive.Scrollbar>>;
|
|
33
|
-
declare function ScrollAreaScrollbar({
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}: ScrollAreaScrollbarProps): JSX.Element;
|
|
39
|
-
//#endregion
|
|
40
|
-
export { ScrollArea, type ScrollAreaProps, ScrollAreaScrollbar, type ScrollAreaScrollbarProps, scrollAreaScrollbarVariants };
|
|
24
|
+
declare function ScrollAreaScrollbar({ __scopeScrollArea, className, orientation, ...props }: ScrollAreaScrollbarProps): JSX.Element;
|
|
25
|
+
export { scrollAreaScrollbarVariants };
|
|
26
|
+
export { ScrollArea, ScrollAreaScrollbar };
|
|
27
|
+
export type { ScrollAreaProps, ScrollAreaScrollbarProps };
|
|
28
|
+
//# sourceMappingURL=scroll-area.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-area.d.ts","sourceRoot":"","sources":["../../src/components/scroll-area.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAIjD,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAC;AAMnE,QAAA,MAAM,2BAA2B;;;;;;;;;;;yBAqD/B,CAAC;AAQH,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,iBAAiB,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAIxD,KAAK,sBAAsB,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,2BAA2B,CAAC,EAAE,MAAM,CAAC,CAAC;AAS7F,KAAK,eAAe,GAAG,WAAW,CAChC,cAAc,CAAC,OAAO,mBAAmB,CAAC,IAAI,CAAC,GAAG,sBAAsB,CACzE,CAAC;AAEF,iBAAS,UAAU,CAAC,EAClB,iBAAiB,EACjB,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,eAAe,GAAG,GAAG,CAAC,OAAO,CAoB/B;AAMD,KAAK,wBAAwB,GAAG,WAAW,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC;AAElG,iBAAS,mBAAmB,CAAC,EAC3B,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,GAAG,KAAK,EACT,EAAE,wBAAwB,GAAG,GAAG,CAAC,OAAO,CAaxC;AAMD,OAAO,EAAE,2BAA2B,EAAE,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,CAAC;AAC3C,YAAY,EAAE,eAAe,EAAE,wBAAwB,EAAE,CAAC"}
|