@codefast/ui 0.3.9 → 0.3.11-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 +30 -0
- package/README.md +277 -167
- package/dist/components/accordion.cjs +97 -1
- package/dist/components/accordion.js +51 -1
- package/dist/components/alert-dialog.cjs +155 -1
- package/dist/components/alert-dialog.d.ts +2 -2
- package/dist/components/alert-dialog.js +94 -1
- package/dist/components/alert.cjs +84 -1
- package/dist/components/alert.d.ts +1 -1
- package/dist/components/alert.js +41 -1
- package/dist/components/aspect-ratio.cjs +43 -1
- package/dist/components/aspect-ratio.js +9 -1
- package/dist/components/avatar.cjs +65 -1
- package/dist/components/avatar.js +25 -1
- package/dist/components/badge.cjs +66 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/badge.js +29 -1
- package/dist/components/breadcrumb.cjs +124 -1
- package/dist/components/breadcrumb.js +72 -1
- package/dist/components/button-group.cjs +86 -1
- package/dist/components/button-group.d.ts +1 -1
- package/dist/components/button-group.js +43 -1
- package/dist/components/button.cjs +92 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/button.js +55 -1
- package/dist/components/calendar.cjs +150 -1
- package/dist/components/calendar.d.ts +11 -18
- package/dist/components/calendar.js +113 -1
- package/dist/components/card.cjs +105 -1
- package/dist/components/card.js +53 -1
- package/dist/components/carousel.cjs +210 -1
- package/dist/components/carousel.d.ts +1 -1
- package/dist/components/carousel.js +151 -1
- package/dist/components/chart.cjs +250 -3
- package/dist/components/chart.d.ts +5 -4
- package/dist/components/chart.js +198 -3
- package/dist/components/checkbox-cards.cjs +69 -1
- package/dist/components/checkbox-cards.js +32 -1
- package/dist/components/checkbox-group.cjs +63 -1
- package/dist/components/checkbox-group.js +26 -1
- package/dist/components/checkbox.cjs +53 -1
- package/dist/components/checkbox.js +19 -1
- package/dist/components/collapsible.cjs +61 -1
- package/dist/components/collapsible.js +21 -1
- package/dist/components/command.cjs +167 -1
- package/dist/components/command.js +106 -1
- package/dist/components/context-menu.cjs +218 -1
- package/dist/components/context-menu.js +142 -1
- package/dist/components/dialog.cjs +164 -1
- package/dist/components/dialog.d.ts +2 -2
- package/dist/components/dialog.js +106 -1
- package/dist/components/drawer.cjs +143 -1
- package/dist/components/drawer.d.ts +1 -1
- package/dist/components/drawer.js +85 -1
- package/dist/components/dropdown-menu.cjs +221 -1
- package/dist/components/dropdown-menu.js +145 -1
- package/dist/components/empty.cjs +113 -1
- package/dist/components/empty.d.ts +1 -1
- package/dist/components/empty.js +61 -1
- package/dist/components/field.cjs +193 -1
- package/dist/components/field.d.ts +1 -1
- package/dist/components/field.js +129 -1
- package/dist/components/form.cjs +151 -1
- package/dist/components/form.d.ts +3 -3
- package/dist/components/form.js +96 -1
- package/dist/components/hover-card.cjs +77 -1
- package/dist/components/hover-card.js +34 -1
- package/dist/components/input-group.cjs +155 -1
- package/dist/components/input-group.d.ts +1 -1
- package/dist/components/input-group.js +97 -1
- package/dist/components/input-number.cjs +98 -1
- package/dist/components/input-number.js +64 -1
- package/dist/components/input-otp.cjs +101 -1
- package/dist/components/input-otp.js +49 -1
- package/dist/components/input-password.cjs +71 -1
- package/dist/components/input-password.js +37 -1
- package/dist/components/input-search.cjs +80 -1
- package/dist/components/input-search.js +46 -1
- package/dist/components/input.cjs +45 -1
- package/dist/components/input.js +11 -1
- package/dist/components/item.cjs +186 -1
- package/dist/components/item.d.ts +1 -1
- package/dist/components/item.js +119 -1
- package/dist/components/kbd.cjs +54 -1
- package/dist/components/kbd.js +17 -1
- package/dist/components/label.cjs +45 -1
- package/dist/components/label.js +11 -1
- package/dist/components/menubar.cjs +232 -1
- package/dist/components/menubar.js +153 -1
- package/dist/components/native-select.cjs +75 -1
- package/dist/components/native-select.js +35 -1
- package/dist/components/navigation-menu.cjs +146 -2
- package/dist/components/navigation-menu.js +94 -2
- package/dist/components/pagination.cjs +138 -1
- package/dist/components/pagination.d.ts +1 -1
- package/dist/components/pagination.js +86 -1
- package/dist/components/popover.cjs +86 -1
- package/dist/components/popover.js +40 -1
- package/dist/components/progress-circle.cjs +184 -1
- package/dist/components/progress-circle.d.ts +1 -1
- package/dist/components/progress-circle.js +147 -1
- package/dist/components/progress.cjs +52 -1
- package/dist/components/progress.js +18 -1
- package/dist/components/radio-cards.cjs +66 -1
- package/dist/components/radio-cards.js +29 -1
- package/dist/components/radio-group.cjs +59 -1
- package/dist/components/radio-group.js +22 -1
- package/dist/components/radio.cjs +47 -1
- package/dist/components/radio.js +13 -1
- package/dist/components/resizable.cjs +71 -1
- package/dist/components/resizable.d.ts +6 -6
- package/dist/components/resizable.js +31 -1
- package/dist/components/scroll-area.cjs +140 -1
- package/dist/components/scroll-area.d.ts +1 -1
- package/dist/components/scroll-area.js +100 -1
- package/dist/components/select.cjs +180 -1
- package/dist/components/select.d.ts +2 -2
- package/dist/components/select.js +119 -1
- package/dist/components/separator.cjs +82 -1
- package/dist/components/separator.d.ts +1 -1
- package/dist/components/separator.js +42 -1
- package/dist/components/sheet.cjs +184 -1
- package/dist/components/sheet.d.ts +2 -2
- package/dist/components/sheet.js +123 -1
- package/dist/components/sidebar.cjs +506 -1
- package/dist/components/sidebar.d.ts +1 -1
- package/dist/components/sidebar.js +400 -1
- package/dist/components/skeleton.cjs +44 -1
- package/dist/components/skeleton.js +10 -1
- package/dist/components/slider.cjs +79 -1
- package/dist/components/slider.js +45 -1
- package/dist/components/sonner.cjs +57 -1
- package/dist/components/sonner.js +17 -1
- package/dist/components/spinner.cjs +75 -1
- package/dist/components/spinner.js +41 -1
- package/dist/components/switch.cjs +49 -1
- package/dist/components/switch.js +15 -1
- package/dist/components/table.cjs +118 -1
- package/dist/components/table.js +63 -1
- package/dist/components/tabs.cjs +75 -1
- package/dist/components/tabs.d.ts +1 -1
- package/dist/components/tabs.js +32 -1
- package/dist/components/textarea.cjs +44 -1
- package/dist/components/textarea.js +10 -1
- package/dist/components/toggle-group.cjs +90 -1
- package/dist/components/toggle-group.d.ts +8 -10
- package/dist/components/toggle-group.js +53 -1
- package/dist/components/toggle.cjs +71 -1
- package/dist/components/toggle.d.ts +8 -10
- package/dist/components/toggle.js +34 -1
- package/dist/components/tooltip.cjs +90 -1
- package/dist/components/tooltip.js +44 -1
- package/dist/css/amber.css +95 -1
- package/dist/css/blue.css +95 -1
- package/dist/css/cyan.css +95 -1
- package/dist/css/emerald.css +95 -1
- package/dist/css/fuchsia.css +95 -1
- package/dist/css/gray.css +95 -1
- package/dist/css/green.css +95 -1
- package/dist/css/indigo.css +95 -1
- package/dist/css/lime.css +95 -1
- package/dist/css/neutral.css +95 -1
- package/dist/css/orange.css +95 -1
- package/dist/css/pink.css +95 -1
- package/dist/css/preset.css +118 -1
- package/dist/css/purple.css +95 -1
- package/dist/css/red.css +95 -1
- package/dist/css/rose.css +95 -1
- package/dist/css/sky.css +95 -1
- package/dist/css/slate.css +95 -1
- package/dist/css/stone.css +95 -1
- package/dist/css/style.css +3 -1
- package/dist/css/teal.css +95 -1
- package/dist/css/violet.css +95 -1
- package/dist/css/yellow.css +95 -1
- package/dist/css/zinc.css +95 -1
- package/dist/hooks/use-animated-value.cjs +74 -1
- package/dist/hooks/use-animated-value.d.ts +9 -10
- package/dist/hooks/use-animated-value.js +40 -1
- package/dist/hooks/use-copy-to-clipboard.cjs +57 -1
- package/dist/hooks/use-copy-to-clipboard.d.ts +17 -0
- package/dist/hooks/use-copy-to-clipboard.js +23 -1
- package/dist/hooks/use-is-mobile.cjs +39 -1
- package/dist/hooks/use-is-mobile.d.ts +15 -6
- package/dist/hooks/use-is-mobile.js +5 -1
- package/dist/hooks/use-media-query.cjs +56 -1
- package/dist/hooks/use-media-query.d.ts +11 -3
- package/dist/hooks/use-media-query.js +22 -1
- package/dist/hooks/use-mutation-observer.cjs +56 -1
- package/dist/hooks/use-mutation-observer.d.ts +7 -11
- package/dist/hooks/use-mutation-observer.js +22 -1
- package/dist/hooks/use-pagination.cjs +92 -1
- package/dist/hooks/use-pagination.d.ts +12 -10
- package/dist/hooks/use-pagination.js +55 -1
- package/dist/index.cjs +1081 -1
- package/dist/index.d.ts +4 -5
- package/dist/index.js +69 -1
- package/dist/primitives/checkbox-group.cjs +151 -1
- package/dist/primitives/checkbox-group.d.ts +1 -1
- package/dist/primitives/checkbox-group.js +99 -1
- package/dist/primitives/input-number.cjs +439 -1
- package/dist/primitives/input-number.d.ts +1 -1
- package/dist/primitives/input-number.js +381 -1
- package/dist/primitives/input.cjs +99 -1
- package/dist/primitives/input.d.ts +1 -1
- package/dist/primitives/input.js +53 -1
- package/dist/primitives/progress-circle.cjs +198 -1
- package/dist/primitives/progress-circle.d.ts +1 -1
- package/dist/primitives/progress-circle.js +128 -1
- package/package.json +405 -62
|
@@ -1,2 +1,148 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{jsx
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { tv } from "@codefast/tailwind-variants";
|
|
4
|
+
import { useCallback, useMemo } from "react";
|
|
5
|
+
import { useAnimatedValue } from "../hooks/use-animated-value.js";
|
|
6
|
+
import { Indicator, Provider, Root, SVG, Track, Value } from "../primitives/progress-circle.js";
|
|
7
|
+
const progressCircleVariants = tv({
|
|
8
|
+
defaultVariants: {
|
|
9
|
+
size: "md",
|
|
10
|
+
thickness: "regular",
|
|
11
|
+
variant: "default"
|
|
12
|
+
},
|
|
13
|
+
slots: {
|
|
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
|
+
},
|
|
20
|
+
variants: {
|
|
21
|
+
size: {
|
|
22
|
+
sm: {
|
|
23
|
+
label: "text-[0.625rem]"
|
|
24
|
+
},
|
|
25
|
+
md: {
|
|
26
|
+
label: "text-xs"
|
|
27
|
+
},
|
|
28
|
+
lg: {
|
|
29
|
+
label: "text-sm"
|
|
30
|
+
},
|
|
31
|
+
xl: {
|
|
32
|
+
label: "text-base"
|
|
33
|
+
},
|
|
34
|
+
"2xl": {
|
|
35
|
+
label: "text-lg"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
thickness: {
|
|
39
|
+
regular: {},
|
|
40
|
+
thick: {},
|
|
41
|
+
thin: {}
|
|
42
|
+
},
|
|
43
|
+
variant: {
|
|
44
|
+
default: {
|
|
45
|
+
indicator: "text-primary",
|
|
46
|
+
track: "text-primary/20"
|
|
47
|
+
},
|
|
48
|
+
destructive: {
|
|
49
|
+
indicator: "text-destructive",
|
|
50
|
+
track: "text-destructive/20"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
function ProgressCircle({ animate = true, animationDuration = 1000, className, classNames, customLabel, showValue = false, size, sizeInPixels, strokeWidth, thickness = "regular", value = 0, variant = "default", ...props }) {
|
|
56
|
+
const displayValue = useAnimatedValue(value, animationDuration, animate);
|
|
57
|
+
const actualSize = useMemo(()=>sizeInPixels ?? getActualSize(size), [
|
|
58
|
+
sizeInPixels,
|
|
59
|
+
size
|
|
60
|
+
]);
|
|
61
|
+
const actualThickness = useMemo(()=>strokeWidth ?? getStrokeWidth(thickness, actualSize), [
|
|
62
|
+
strokeWidth,
|
|
63
|
+
thickness,
|
|
64
|
+
actualSize
|
|
65
|
+
]);
|
|
66
|
+
const slots = useMemo(()=>progressCircleVariants({
|
|
67
|
+
size,
|
|
68
|
+
thickness,
|
|
69
|
+
variant
|
|
70
|
+
}), [
|
|
71
|
+
variant,
|
|
72
|
+
size,
|
|
73
|
+
thickness
|
|
74
|
+
]);
|
|
75
|
+
const shouldShowLabel = showValue || Boolean(customLabel);
|
|
76
|
+
const renderLabel = useCallback(()=>{
|
|
77
|
+
if (customLabel) return customLabel({
|
|
78
|
+
value: displayValue
|
|
79
|
+
});
|
|
80
|
+
return `${displayValue.toString()}%`;
|
|
81
|
+
}, [
|
|
82
|
+
customLabel,
|
|
83
|
+
displayValue
|
|
84
|
+
]);
|
|
85
|
+
return /*#__PURE__*/ jsx(Provider, {
|
|
86
|
+
size: actualSize,
|
|
87
|
+
strokeWidth: actualThickness,
|
|
88
|
+
value: value,
|
|
89
|
+
...props,
|
|
90
|
+
children: /*#__PURE__*/ jsxs(Root, {
|
|
91
|
+
className: slots.root({
|
|
92
|
+
className: [
|
|
93
|
+
className,
|
|
94
|
+
classNames?.root
|
|
95
|
+
]
|
|
96
|
+
}),
|
|
97
|
+
children: [
|
|
98
|
+
/*#__PURE__*/ jsxs(SVG, {
|
|
99
|
+
className: slots.svg({
|
|
100
|
+
className: classNames?.svg
|
|
101
|
+
}),
|
|
102
|
+
children: [
|
|
103
|
+
/*#__PURE__*/ jsx(Track, {
|
|
104
|
+
className: slots.track({
|
|
105
|
+
className: classNames?.track
|
|
106
|
+
})
|
|
107
|
+
}),
|
|
108
|
+
/*#__PURE__*/ jsx(Indicator, {
|
|
109
|
+
className: slots.indicator({
|
|
110
|
+
className: classNames?.indicator
|
|
111
|
+
}),
|
|
112
|
+
style: {
|
|
113
|
+
transitionDuration: `${animationDuration.toString()}ms`,
|
|
114
|
+
transitionProperty: "stroke-dashoffset"
|
|
115
|
+
}
|
|
116
|
+
})
|
|
117
|
+
]
|
|
118
|
+
}),
|
|
119
|
+
shouldShowLabel ? /*#__PURE__*/ jsx(Value, {
|
|
120
|
+
className: slots.label({
|
|
121
|
+
className: classNames?.label
|
|
122
|
+
}),
|
|
123
|
+
children: renderLabel()
|
|
124
|
+
}) : null
|
|
125
|
+
]
|
|
126
|
+
})
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
ProgressCircle.displayName = "ProgressCircle";
|
|
130
|
+
const getActualSize = (size)=>{
|
|
131
|
+
const sizeMap = {
|
|
132
|
+
"2xl": 128,
|
|
133
|
+
lg: 64,
|
|
134
|
+
md: 48,
|
|
135
|
+
sm: 32,
|
|
136
|
+
xl: 96
|
|
137
|
+
};
|
|
138
|
+
return size ? sizeMap[size] : 48;
|
|
139
|
+
};
|
|
140
|
+
const getStrokeWidth = (thickness, size)=>{
|
|
141
|
+
const thicknessMap = {
|
|
142
|
+
regular: Math.max(3, 0.05 * size),
|
|
143
|
+
thick: Math.max(4, 0.075 * size),
|
|
144
|
+
thin: Math.max(2, 0.025 * size)
|
|
145
|
+
};
|
|
146
|
+
return thickness ? thicknessMap[thickness] : Math.max(3, 0.05 * size);
|
|
147
|
+
};
|
|
148
|
+
export { ProgressCircle, progressCircleVariants };
|
|
@@ -1,2 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
"use client";
|
|
2
|
-
|
|
3
|
+
var __webpack_require__ = {};
|
|
4
|
+
(()=>{
|
|
5
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
6
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: definition[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.r = (exports1)=>{
|
|
17
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
18
|
+
value: 'Module'
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
21
|
+
value: true
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
})();
|
|
25
|
+
var __webpack_exports__ = {};
|
|
26
|
+
__webpack_require__.r(__webpack_exports__);
|
|
27
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
+
Progress: ()=>Progress
|
|
29
|
+
});
|
|
30
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
+
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
32
|
+
const react_progress_namespaceObject = require("@radix-ui/react-progress");
|
|
33
|
+
function Progress({ className, value, ...props }) {
|
|
34
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_progress_namespaceObject.Root, {
|
|
35
|
+
className: (0, tailwind_variants_namespaceObject.cn)("relative h-2 w-full overflow-hidden rounded-full bg-primary/20", className),
|
|
36
|
+
"data-slot": "progress",
|
|
37
|
+
...props,
|
|
38
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_progress_namespaceObject.Indicator, {
|
|
39
|
+
className: "size-full flex-1 bg-primary transition-all",
|
|
40
|
+
"data-slot": "progress-indicator",
|
|
41
|
+
style: {
|
|
42
|
+
transform: `translateX(-${(100 - (value ?? 0)).toString()}%)`
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
exports.Progress = __webpack_exports__.Progress;
|
|
48
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
49
|
+
"Progress"
|
|
50
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
51
|
+
Object.defineProperty(exports, '__esModule', {
|
|
52
|
+
value: true
|
|
53
|
+
});
|
|
@@ -1,2 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{jsx
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@codefast/tailwind-variants";
|
|
4
|
+
import { Indicator, Root } from "@radix-ui/react-progress";
|
|
5
|
+
function Progress({ className, value, ...props }) {
|
|
6
|
+
return /*#__PURE__*/ jsx(Root, {
|
|
7
|
+
className: cn("relative h-2 w-full overflow-hidden rounded-full bg-primary/20", className),
|
|
8
|
+
"data-slot": "progress",
|
|
9
|
+
...props,
|
|
10
|
+
children: /*#__PURE__*/ jsx(Indicator, {
|
|
11
|
+
className: "size-full flex-1 bg-primary transition-all",
|
|
12
|
+
"data-slot": "progress-indicator",
|
|
13
|
+
style: {
|
|
14
|
+
transform: `translateX(-${(100 - (value ?? 0)).toString()}%)`
|
|
15
|
+
}
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export { Progress };
|
|
@@ -1,2 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
"use client";
|
|
2
|
-
|
|
3
|
+
var __webpack_require__ = {};
|
|
4
|
+
(()=>{
|
|
5
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
6
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: definition[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.r = (exports1)=>{
|
|
17
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
18
|
+
value: 'Module'
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
21
|
+
value: true
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
})();
|
|
25
|
+
var __webpack_exports__ = {};
|
|
26
|
+
__webpack_require__.r(__webpack_exports__);
|
|
27
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
+
RadioCardsItem: ()=>RadioCardsItem,
|
|
29
|
+
RadioCards: ()=>RadioCards
|
|
30
|
+
});
|
|
31
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
32
|
+
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
33
|
+
const react_radio_group_namespaceObject = require("@radix-ui/react-radio-group");
|
|
34
|
+
const external_label_cjs_namespaceObject = require("./label.cjs");
|
|
35
|
+
function RadioCards(props) {
|
|
36
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_radio_group_namespaceObject.Root, {
|
|
37
|
+
"data-slot": "radio-cards",
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function RadioCardsItem({ children, className, ...props }) {
|
|
42
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_label_cjs_namespaceObject.Label, {
|
|
43
|
+
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",
|
|
44
|
+
"data-slot": "radio-card",
|
|
45
|
+
children: [
|
|
46
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_radio_group_namespaceObject.Item, {
|
|
47
|
+
className: (0, tailwind_variants_namespaceObject.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),
|
|
48
|
+
"data-slot": "radio-card-item",
|
|
49
|
+
...props,
|
|
50
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_radio_group_namespaceObject.Indicator, {
|
|
51
|
+
className: "size-1 rounded-full bg-background",
|
|
52
|
+
"data-slot": "radio-card-indicator"
|
|
53
|
+
})
|
|
54
|
+
}),
|
|
55
|
+
children
|
|
56
|
+
]
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
exports.RadioCards = __webpack_exports__.RadioCards;
|
|
60
|
+
exports.RadioCardsItem = __webpack_exports__.RadioCardsItem;
|
|
61
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
62
|
+
"RadioCards",
|
|
63
|
+
"RadioCardsItem"
|
|
64
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
65
|
+
Object.defineProperty(exports, '__esModule', {
|
|
66
|
+
value: true
|
|
67
|
+
});
|
|
@@ -1,2 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{jsx
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@codefast/tailwind-variants";
|
|
4
|
+
import { Indicator, Item, Root } from "@radix-ui/react-radio-group";
|
|
5
|
+
import { Label } from "./label.js";
|
|
6
|
+
function RadioCards(props) {
|
|
7
|
+
return /*#__PURE__*/ jsx(Root, {
|
|
8
|
+
"data-slot": "radio-cards",
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function RadioCardsItem({ children, className, ...props }) {
|
|
13
|
+
return /*#__PURE__*/ jsxs(Label, {
|
|
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
|
+
"data-slot": "radio-card",
|
|
16
|
+
children: [
|
|
17
|
+
/*#__PURE__*/ jsx(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(Indicator, {
|
|
22
|
+
className: "size-1 rounded-full bg-background",
|
|
23
|
+
"data-slot": "radio-card-indicator"
|
|
24
|
+
})
|
|
25
|
+
}),
|
|
26
|
+
children
|
|
27
|
+
]
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
export { RadioCards, RadioCardsItem };
|
|
@@ -1,2 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
"use client";
|
|
2
|
-
|
|
3
|
+
var __webpack_require__ = {};
|
|
4
|
+
(()=>{
|
|
5
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
6
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: definition[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.r = (exports1)=>{
|
|
17
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
18
|
+
value: 'Module'
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
21
|
+
value: true
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
})();
|
|
25
|
+
var __webpack_exports__ = {};
|
|
26
|
+
__webpack_require__.r(__webpack_exports__);
|
|
27
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
+
RadioGroupItem: ()=>RadioGroupItem,
|
|
29
|
+
RadioGroup: ()=>RadioGroup
|
|
30
|
+
});
|
|
31
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
32
|
+
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
33
|
+
const react_radio_group_namespaceObject = require("@radix-ui/react-radio-group");
|
|
34
|
+
function RadioGroup({ className, ...props }) {
|
|
35
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_radio_group_namespaceObject.Root, {
|
|
36
|
+
className: (0, tailwind_variants_namespaceObject.cn)("grid gap-2", className),
|
|
37
|
+
"data-slot": "radio-group",
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function RadioGroupItem({ className, ...props }) {
|
|
42
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_radio_group_namespaceObject.Item, {
|
|
43
|
+
className: (0, tailwind_variants_namespaceObject.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),
|
|
44
|
+
"data-slot": "radio-group-item",
|
|
45
|
+
...props,
|
|
46
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_radio_group_namespaceObject.Indicator, {
|
|
47
|
+
className: "size-1 rounded-full bg-background",
|
|
48
|
+
"data-slot": "radio-group-indicator"
|
|
49
|
+
})
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
exports.RadioGroup = __webpack_exports__.RadioGroup;
|
|
53
|
+
exports.RadioGroupItem = __webpack_exports__.RadioGroupItem;
|
|
54
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
55
|
+
"RadioGroup",
|
|
56
|
+
"RadioGroupItem"
|
|
57
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
58
|
+
Object.defineProperty(exports, '__esModule', {
|
|
59
|
+
value: true
|
|
60
|
+
});
|
|
@@ -1,2 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{jsx
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@codefast/tailwind-variants";
|
|
4
|
+
import { Indicator, Item, Root } from "@radix-ui/react-radio-group";
|
|
5
|
+
function RadioGroup({ className, ...props }) {
|
|
6
|
+
return /*#__PURE__*/ jsx(Root, {
|
|
7
|
+
className: cn("grid gap-2", className),
|
|
8
|
+
"data-slot": "radio-group",
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function RadioGroupItem({ className, ...props }) {
|
|
13
|
+
return /*#__PURE__*/ jsx(Item, {
|
|
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
|
+
"data-slot": "radio-group-item",
|
|
16
|
+
...props,
|
|
17
|
+
children: /*#__PURE__*/ jsx(Indicator, {
|
|
18
|
+
className: "size-1 rounded-full bg-background",
|
|
19
|
+
"data-slot": "radio-group-indicator"
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -1,2 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
"use client";
|
|
2
|
-
|
|
3
|
+
var __webpack_require__ = {};
|
|
4
|
+
(()=>{
|
|
5
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
6
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: definition[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.r = (exports1)=>{
|
|
17
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
18
|
+
value: 'Module'
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
21
|
+
value: true
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
})();
|
|
25
|
+
var __webpack_exports__ = {};
|
|
26
|
+
__webpack_require__.r(__webpack_exports__);
|
|
27
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
+
Radio: ()=>Radio
|
|
29
|
+
});
|
|
30
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
+
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
32
|
+
const primitive_namespaceObject = require("@radix-ui/primitive");
|
|
33
|
+
function Radio({ className, onChange, onValueChange, ...props }) {
|
|
34
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("input", {
|
|
35
|
+
className: (0, tailwind_variants_namespaceObject.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),
|
|
36
|
+
"data-slot": "radio",
|
|
37
|
+
type: "radio",
|
|
38
|
+
onChange: (0, primitive_namespaceObject.composeEventHandlers)(onChange, (event)=>onValueChange?.(event.currentTarget.value)),
|
|
39
|
+
...props
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
exports.Radio = __webpack_exports__.Radio;
|
|
43
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
44
|
+
"Radio"
|
|
45
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
46
|
+
Object.defineProperty(exports, '__esModule', {
|
|
47
|
+
value: true
|
|
48
|
+
});
|
package/dist/components/radio.js
CHANGED
|
@@ -1,2 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{jsx
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@codefast/tailwind-variants";
|
|
4
|
+
import { composeEventHandlers } from "@radix-ui/primitive";
|
|
5
|
+
function Radio({ className, onChange, onValueChange, ...props }) {
|
|
6
|
+
return /*#__PURE__*/ jsx("input", {
|
|
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
|
+
"data-slot": "radio",
|
|
9
|
+
type: "radio",
|
|
10
|
+
onChange: composeEventHandlers(onChange, (event)=>onValueChange?.(event.currentTarget.value)),
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export { Radio };
|
|
@@ -1,2 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
"use client";
|
|
2
|
-
|
|
3
|
+
var __webpack_require__ = {};
|
|
4
|
+
(()=>{
|
|
5
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
6
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: definition[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.r = (exports1)=>{
|
|
17
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
18
|
+
value: 'Module'
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
21
|
+
value: true
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
})();
|
|
25
|
+
var __webpack_exports__ = {};
|
|
26
|
+
__webpack_require__.r(__webpack_exports__);
|
|
27
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
+
ResizableGroup: ()=>ResizableGroup,
|
|
29
|
+
ResizablePanel: ()=>ResizablePanel,
|
|
30
|
+
ResizableSeparator: ()=>ResizableSeparator
|
|
31
|
+
});
|
|
32
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
33
|
+
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
34
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
35
|
+
const external_react_resizable_panels_namespaceObject = require("react-resizable-panels");
|
|
36
|
+
function ResizableGroup({ className, ...props }) {
|
|
37
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_react_resizable_panels_namespaceObject.Group, {
|
|
38
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex size-full", className),
|
|
39
|
+
"data-slot": "resizable-group",
|
|
40
|
+
...props
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function ResizablePanel({ ...props }) {
|
|
44
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_react_resizable_panels_namespaceObject.Panel, {
|
|
45
|
+
"data-slot": "resizable-panel",
|
|
46
|
+
...props
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function ResizableSeparator({ className, withHandle, ...props }) {
|
|
50
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_react_resizable_panels_namespaceObject.Separator, {
|
|
51
|
+
className: (0, tailwind_variants_namespaceObject.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),
|
|
52
|
+
"data-slot": "resizable-separator",
|
|
53
|
+
...props,
|
|
54
|
+
children: withHandle ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
55
|
+
className: "z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",
|
|
56
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.GripVerticalIcon, {
|
|
57
|
+
className: "size-2.5"
|
|
58
|
+
})
|
|
59
|
+
}) : null
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
exports.ResizableGroup = __webpack_exports__.ResizableGroup;
|
|
63
|
+
exports.ResizablePanel = __webpack_exports__.ResizablePanel;
|
|
64
|
+
exports.ResizableSeparator = __webpack_exports__.ResizableSeparator;
|
|
65
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
66
|
+
"ResizableGroup",
|
|
67
|
+
"ResizablePanel",
|
|
68
|
+
"ResizableSeparator"
|
|
69
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
70
|
+
Object.defineProperty(exports, '__esModule', {
|
|
71
|
+
value: true
|
|
72
|
+
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { ComponentProps, JSX } from "react";
|
|
2
2
|
import * as ResizablePrimitive from "react-resizable-panels";
|
|
3
|
-
type
|
|
4
|
-
declare function
|
|
3
|
+
type ResizableGroupProps = ComponentProps<typeof ResizablePrimitive.Group>;
|
|
4
|
+
declare function ResizableGroup({ className, ...props }: ResizableGroupProps): JSX.Element;
|
|
5
5
|
type ResizablePanelProps = ComponentProps<typeof ResizablePrimitive.Panel>;
|
|
6
6
|
declare function ResizablePanel({ ...props }: ResizablePanelProps): JSX.Element;
|
|
7
|
-
interface
|
|
7
|
+
interface ResizableSeparatorProps extends ComponentProps<typeof ResizablePrimitive.Separator> {
|
|
8
8
|
withHandle?: boolean;
|
|
9
9
|
}
|
|
10
|
-
declare function
|
|
11
|
-
export {
|
|
12
|
-
export type {
|
|
10
|
+
declare function ResizableSeparator({ className, withHandle, ...props }: ResizableSeparatorProps): JSX.Element;
|
|
11
|
+
export { ResizableGroup, ResizablePanel, ResizableSeparator };
|
|
12
|
+
export type { ResizableGroupProps, ResizablePanelProps, ResizableSeparatorProps };
|