@codefast/ui 0.3.11 → 0.3.12-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.
Files changed (249) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/README.md +4 -0
  3. package/dist/components/accordion.d.ts +11 -29
  4. package/dist/components/accordion.d.ts.map +1 -0
  5. package/dist/components/accordion.js +11 -38
  6. package/dist/components/alert-dialog.d.ts +25 -60
  7. package/dist/components/alert-dialog.d.ts.map +1 -0
  8. package/dist/components/alert-dialog.js +17 -70
  9. package/dist/components/alert.d.ts +16 -27
  10. package/dist/components/alert.d.ts.map +1 -0
  11. package/dist/components/alert.js +33 -31
  12. package/dist/components/aspect-ratio.d.ts +5 -8
  13. package/dist/components/aspect-ratio.d.ts.map +1 -0
  14. package/dist/components/aspect-ratio.js +5 -7
  15. package/dist/components/avatar.d.ts +7 -17
  16. package/dist/components/avatar.d.ts.map +1 -0
  17. package/dist/components/avatar.js +8 -19
  18. package/dist/components/badge.d.ts +15 -21
  19. package/dist/components/badge.d.ts.map +1 -0
  20. package/dist/components/badge.js +53 -21
  21. package/dist/components/breadcrumb.d.ts +13 -35
  22. package/dist/components/breadcrumb.d.ts.map +1 -0
  23. package/dist/components/breadcrumb.js +14 -50
  24. package/dist/components/button-group.d.ts +15 -29
  25. package/dist/components/button-group.d.ts.map +1 -0
  26. package/dist/components/button-group.js +37 -28
  27. package/dist/components/button.d.ts +26 -35
  28. package/dist/components/button.d.ts.map +1 -0
  29. package/dist/components/button.js +87 -52
  30. package/dist/components/calendar.d.ts +10 -24
  31. package/dist/components/calendar.d.ts.map +1 -0
  32. package/dist/components/calendar.js +88 -93
  33. package/dist/components/card.d.ts +11 -34
  34. package/dist/components/card.d.ts.map +1 -0
  35. package/dist/components/card.js +12 -40
  36. package/dist/components/carousel.d.ts +25 -55
  37. package/dist/components/carousel.d.ts.map +1 -0
  38. package/dist/components/carousel.js +83 -115
  39. package/dist/components/chart.d.ts +37 -72
  40. package/dist/components/chart.d.ts.map +1 -0
  41. package/dist/components/chart.js +162 -151
  42. package/dist/components/checkbox-cards.d.ts +9 -15
  43. package/dist/components/checkbox-cards.d.ts.map +1 -0
  44. package/dist/components/checkbox-cards.js +9 -23
  45. package/dist/components/checkbox-group.d.ts +9 -16
  46. package/dist/components/checkbox-group.d.ts.map +1 -0
  47. package/dist/components/checkbox-group.js +8 -20
  48. package/dist/components/checkbox.d.ts +5 -9
  49. package/dist/components/checkbox.d.ts.map +1 -0
  50. package/dist/components/checkbox.js +7 -15
  51. package/dist/components/collapsible.d.ts +7 -14
  52. package/dist/components/collapsible.d.ts.map +1 -0
  53. package/dist/components/collapsible.js +7 -15
  54. package/dist/components/command.d.ts +24 -55
  55. package/dist/components/command.d.ts.map +1 -0
  56. package/dist/components/command.js +19 -70
  57. package/dist/components/context-menu.d.ts +23 -72
  58. package/dist/components/context-menu.d.ts.map +1 -0
  59. package/dist/components/context-menu.js +22 -90
  60. package/dist/components/dialog.d.ts +23 -53
  61. package/dist/components/dialog.d.ts.map +1 -0
  62. package/dist/components/dialog.js +21 -73
  63. package/dist/components/drawer.d.ts +29 -60
  64. package/dist/components/drawer.d.ts.map +1 -0
  65. package/dist/components/drawer.js +17 -59
  66. package/dist/components/dropdown-menu.d.ts +23 -73
  67. package/dist/components/dropdown-menu.d.ts.map +1 -0
  68. package/dist/components/dropdown-menu.js +22 -97
  69. package/dist/components/empty.d.ts +16 -37
  70. package/dist/components/empty.d.ts.map +1 -0
  71. package/dist/components/empty.js +33 -45
  72. package/dist/components/field.d.ts +26 -63
  73. package/dist/components/field.d.ts.map +1 -0
  74. package/dist/components/field.js +61 -90
  75. package/dist/components/form.d.ts +16 -37
  76. package/dist/components/form.d.ts.map +1 -0
  77. package/dist/components/form.js +51 -67
  78. package/dist/components/hover-card.d.ts +8 -21
  79. package/dist/components/hover-card.d.ts.map +1 -0
  80. package/dist/components/hover-card.js +9 -24
  81. package/dist/components/input-group.d.ts +29 -53
  82. package/dist/components/input-group.d.ts.map +1 -0
  83. package/dist/components/input-group.js +110 -67
  84. package/dist/components/input-number.d.ts +8 -28
  85. package/dist/components/input-number.d.ts.map +1 -0
  86. package/dist/components/input-number.js +15 -56
  87. package/dist/components/input-otp.d.ts +11 -24
  88. package/dist/components/input-otp.d.ts.map +1 -0
  89. package/dist/components/input-otp.js +14 -35
  90. package/dist/components/input-password.d.ts +6 -12
  91. package/dist/components/input-password.d.ts.map +1 -0
  92. package/dist/components/input-password.js +11 -31
  93. package/dist/components/input-search.d.ts +9 -18
  94. package/dist/components/input-search.d.ts.map +1 -0
  95. package/dist/components/input-search.js +17 -44
  96. package/dist/components/input.d.ts +5 -10
  97. package/dist/components/input.d.ts.map +1 -0
  98. package/dist/components/input.js +6 -10
  99. package/dist/components/item.d.ts +33 -69
  100. package/dist/components/item.d.ts.map +1 -0
  101. package/dist/components/item.js +69 -91
  102. package/dist/components/kbd.d.ts +6 -13
  103. package/dist/components/kbd.d.ts.map +1 -0
  104. package/dist/components/kbd.js +7 -14
  105. package/dist/components/label.d.ts +5 -9
  106. package/dist/components/label.d.ts.map +1 -0
  107. package/dist/components/label.js +6 -9
  108. package/dist/components/menubar.d.ts +24 -80
  109. package/dist/components/menubar.d.ts.map +1 -0
  110. package/dist/components/menubar.js +24 -100
  111. package/dist/components/native-select.d.ts +7 -16
  112. package/dist/components/native-select.d.ts.map +1 -0
  113. package/dist/components/native-select.js +8 -26
  114. package/dist/components/navigation-menu.d.ts +13 -36
  115. package/dist/components/navigation-menu.d.ts.map +1 -0
  116. package/dist/components/navigation-menu.js +26 -62
  117. package/dist/components/pagination.d.ts +15 -35
  118. package/dist/components/pagination.d.ts.map +1 -0
  119. package/dist/components/pagination.js +14 -56
  120. package/dist/components/popover.d.ts +9 -24
  121. package/dist/components/popover.d.ts.map +1 -0
  122. package/dist/components/popover.js +10 -28
  123. package/dist/components/progress-circle.d.ts +89 -106
  124. package/dist/components/progress-circle.d.ts.map +1 -0
  125. package/dist/components/progress-circle.js +71 -104
  126. package/dist/components/progress.d.ts +5 -10
  127. package/dist/components/progress.d.ts.map +1 -0
  128. package/dist/components/progress.js +8 -14
  129. package/dist/components/radio-cards.d.ts +5 -10
  130. package/dist/components/radio-cards.d.ts.map +1 -0
  131. package/dist/components/radio-cards.js +8 -22
  132. package/dist/components/radio-group.d.ts +6 -13
  133. package/dist/components/radio-group.d.ts.map +1 -0
  134. package/dist/components/radio-group.js +7 -18
  135. package/dist/components/radio.d.ts +6 -12
  136. package/dist/components/radio.d.ts.map +1 -0
  137. package/dist/components/radio.js +6 -11
  138. package/dist/components/resizable.d.ts +8 -18
  139. package/dist/components/resizable.d.ts.map +1 -0
  140. package/dist/components/resizable.js +8 -22
  141. package/dist/components/scroll-area.d.ts +21 -33
  142. package/dist/components/scroll-area.d.ts.map +1 -0
  143. package/dist/components/scroll-area.js +65 -85
  144. package/dist/components/select.d.ts +17 -50
  145. package/dist/components/select.d.ts.map +1 -0
  146. package/dist/components/select.js +27 -79
  147. package/dist/components/separator.d.ts +20 -29
  148. package/dist/components/separator.d.ts.map +1 -0
  149. package/dist/components/separator.js +28 -37
  150. package/dist/components/sheet.d.ts +30 -62
  151. package/dist/components/sheet.d.ts.map +1 -0
  152. package/dist/components/sheet.js +68 -81
  153. package/dist/components/sidebar.d.ts +67 -160
  154. package/dist/components/sidebar.d.ts.map +1 -0
  155. package/dist/components/sidebar.js +184 -302
  156. package/dist/components/skeleton.d.ts +5 -9
  157. package/dist/components/skeleton.d.ts.map +1 -0
  158. package/dist/components/skeleton.js +6 -9
  159. package/dist/components/slider.d.ts +5 -13
  160. package/dist/components/slider.d.ts.map +1 -0
  161. package/dist/components/slider.js +13 -35
  162. package/dist/components/sonner.d.ts +8 -10
  163. package/dist/components/sonner.d.ts.map +1 -0
  164. package/dist/components/sonner.js +14 -16
  165. package/dist/components/spinner.d.ts +6 -12
  166. package/dist/components/spinner.d.ts.map +1 -0
  167. package/dist/components/spinner.js +21 -34
  168. package/dist/components/switch.d.ts +5 -9
  169. package/dist/components/switch.d.ts.map +1 -0
  170. package/dist/components/switch.js +6 -13
  171. package/dist/components/table.d.ts +12 -37
  172. package/dist/components/table.d.ts.map +1 -0
  173. package/dist/components/table.js +13 -48
  174. package/dist/components/tabs.d.ts +8 -21
  175. package/dist/components/tabs.d.ts.map +1 -0
  176. package/dist/components/tabs.js +9 -24
  177. package/dist/components/textarea.d.ts +5 -9
  178. package/dist/components/textarea.d.ts.map +1 -0
  179. package/dist/components/textarea.js +6 -9
  180. package/dist/components/toggle-group.d.ts +10 -24
  181. package/dist/components/toggle-group.d.ts.map +1 -0
  182. package/dist/components/toggle-group.js +21 -39
  183. package/dist/components/toggle.d.ts +18 -25
  184. package/dist/components/toggle.d.ts.map +1 -0
  185. package/dist/components/toggle.js +42 -30
  186. package/dist/components/tooltip.d.ts +9 -24
  187. package/dist/components/tooltip.d.ts.map +1 -0
  188. package/dist/components/tooltip.js +10 -29
  189. package/dist/hooks/use-animated-value.d.ts +2 -4
  190. package/dist/hooks/use-animated-value.d.ts.map +1 -0
  191. package/dist/hooks/use-animated-value.js +67 -58
  192. package/dist/hooks/use-copy-to-clipboard.d.ts +6 -11
  193. package/dist/hooks/use-copy-to-clipboard.d.ts.map +1 -0
  194. package/dist/hooks/use-copy-to-clipboard.js +42 -39
  195. package/dist/hooks/use-is-mobile.d.ts +2 -4
  196. package/dist/hooks/use-is-mobile.d.ts.map +1 -0
  197. package/dist/hooks/use-is-mobile.js +20 -23
  198. package/dist/hooks/use-media-query.d.ts +2 -4
  199. package/dist/hooks/use-media-query.d.ts.map +1 -0
  200. package/dist/hooks/use-media-query.js +49 -46
  201. package/dist/hooks/use-mutation-observer.d.ts +3 -6
  202. package/dist/hooks/use-mutation-observer.d.ts.map +1 -0
  203. package/dist/hooks/use-mutation-observer.js +33 -34
  204. package/dist/hooks/use-pagination.d.ts +15 -22
  205. package/dist/hooks/use-pagination.d.ts.map +1 -0
  206. package/dist/hooks/use-pagination.js +99 -99
  207. package/dist/index.d.ts +131 -69
  208. package/dist/index.d.ts.map +1 -0
  209. package/dist/index.js +68 -69
  210. package/dist/lib/utils.d.ts +10 -0
  211. package/dist/lib/utils.d.ts.map +1 -0
  212. package/dist/lib/utils.js +10 -0
  213. package/dist/primitives/checkbox-group.d.ts +84 -105
  214. package/dist/primitives/checkbox-group.d.ts.map +1 -0
  215. package/dist/primitives/checkbox-group.js +91 -105
  216. package/dist/primitives/input-number.d.ts +41 -51
  217. package/dist/primitives/input-number.d.ts.map +1 -0
  218. package/dist/primitives/input-number.js +417 -473
  219. package/dist/primitives/input.d.ts +43 -48
  220. package/dist/primitives/input.d.ts.map +1 -0
  221. package/dist/primitives/input.js +67 -66
  222. package/dist/primitives/progress-circle.d.ts +49 -79
  223. package/dist/primitives/progress-circle.d.ts.map +1 -0
  224. package/dist/primitives/progress-circle.js +134 -149
  225. package/package.json +33 -16
  226. package/{dist → src}/css/preset.css +86 -9
  227. /package/{dist → src}/css/amber.css +0 -0
  228. /package/{dist → src}/css/blue.css +0 -0
  229. /package/{dist → src}/css/cyan.css +0 -0
  230. /package/{dist → src}/css/emerald.css +0 -0
  231. /package/{dist → src}/css/fuchsia.css +0 -0
  232. /package/{dist → src}/css/gray.css +0 -0
  233. /package/{dist → src}/css/green.css +0 -0
  234. /package/{dist → src}/css/indigo.css +0 -0
  235. /package/{dist → src}/css/lime.css +0 -0
  236. /package/{dist → src}/css/neutral.css +0 -0
  237. /package/{dist → src}/css/orange.css +0 -0
  238. /package/{dist → src}/css/pink.css +0 -0
  239. /package/{dist → src}/css/purple.css +0 -0
  240. /package/{dist → src}/css/red.css +0 -0
  241. /package/{dist → src}/css/rose.css +0 -0
  242. /package/{dist → src}/css/sky.css +0 -0
  243. /package/{dist → src}/css/slate.css +0 -0
  244. /package/{dist → src}/css/stone.css +0 -0
  245. /package/{dist → src}/css/style.css +0 -0
  246. /package/{dist → src}/css/teal.css +0 -0
  247. /package/{dist → src}/css/violet.css +0 -0
  248. /package/{dist → src}/css/yellow.css +0 -0
  249. /package/{dist → src}/css/zinc.css +0 -0
@@ -1,124 +1,107 @@
1
- import { ProgressCircleProvider } from "../primitives/progress-circle.js";
2
- import * as _$_codefast_tailwind_variants0 from "@codefast/tailwind-variants";
3
- import { VariantProps } from "@codefast/tailwind-variants";
4
- import { ComponentProps, JSX } from "react";
5
-
6
- //#region src/components/progress-circle.d.ts
7
- declare const progressCircleVariants: _$_codefast_tailwind_variants0.VariantFunctionType<{
8
- size: {
9
- sm: {
10
- label: string;
1
+ import type { VariantProps } from "#lib/utils";
2
+ import type { ComponentProps, JSX } from "react";
3
+ import * as ProgressCirclePrimitive from "#primitives/progress-circle";
4
+ declare const progressCircleVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
5
+ size: {
6
+ sm: {
7
+ label: string;
8
+ };
9
+ md: {
10
+ label: string;
11
+ };
12
+ lg: {
13
+ label: string;
14
+ };
15
+ xl: {
16
+ label: string;
17
+ };
18
+ "2xl": {
19
+ label: string;
20
+ };
11
21
  };
12
- md: {
13
- label: string;
22
+ thickness: {
23
+ regular: {};
24
+ thick: {};
25
+ thin: {};
14
26
  };
15
- lg: {
16
- label: string;
27
+ variant: {
28
+ default: {
29
+ indicator: string;
30
+ track: string;
31
+ };
32
+ destructive: {
33
+ indicator: string;
34
+ track: string;
35
+ };
17
36
  };
18
- xl: {
19
- label: string;
20
- };
21
- "2xl": {
22
- label: string;
23
- };
24
- };
25
- thickness: {
26
- regular: {};
27
- thick: {};
28
- thin: {};
29
- };
30
- variant: {
31
- default: {
32
- indicator: string;
33
- track: string;
34
- };
35
- destructive: {
36
- indicator: string;
37
- track: string;
38
- };
39
- };
40
37
  }, {
41
- indicator: string;
42
- label: string;
43
- root: string;
44
- svg: string;
45
- track: string;
38
+ indicator: string;
39
+ label: string[];
40
+ root: string;
41
+ svg: string;
42
+ track: string;
46
43
  }>;
47
- interface ProgressCircleProps extends Omit<ComponentProps<typeof ProgressCircleProvider>, "children" | "size">, VariantProps<typeof progressCircleVariants> {
48
- /**
49
- * Enables animation effect when value changes
50
- */
51
- animate?: boolean;
52
- /**
53
- * Duration of the animation in milliseconds
54
- */
55
- animationDuration?: number;
56
- /**
57
- * CSS class to customize the entire component
58
- */
59
- className?: string;
60
- /**
61
- * CSS classes to customize specific parts of the component
62
- */
63
- classNames?: {
44
+ interface ProgressCircleProps extends Omit<ComponentProps<typeof ProgressCirclePrimitive.Provider>, "children" | "size">, VariantProps<typeof progressCircleVariants> {
64
45
  /**
65
- * Class for the progress indicator
46
+ * Enables animation effect when value changes
66
47
  */
67
- indicator?: string;
48
+ animate?: boolean;
68
49
  /**
69
- * Class for the label in the center of the circle
50
+ * Duration of the animation in milliseconds
70
51
  */
71
- label?: string;
52
+ animationDuration?: number;
53
+ /**
54
+ * CSS class to customize the entire component
55
+ */
56
+ className?: string;
57
+ /**
58
+ * CSS classes to customize specific parts of the component
59
+ */
60
+ classNames?: {
61
+ /**
62
+ * Class for the progress indicator
63
+ */
64
+ indicator?: string;
65
+ /**
66
+ * Class for the label in the center of the circle
67
+ */
68
+ label?: string;
69
+ /**
70
+ * Class for the root element of the component
71
+ */
72
+ root?: string;
73
+ /**
74
+ * Class for the SVG element
75
+ */
76
+ svg?: string;
77
+ /**
78
+ * Class for the circle track
79
+ */
80
+ track?: string;
81
+ };
72
82
  /**
73
- * Class for the root element of the component
83
+ * Custom function to render content in the center of the circle
84
+ * @param value - Current value of the component
85
+ * @returns React element to display in the center of the circle
74
86
  */
75
- root?: string;
87
+ customLabel?: ({ value }: {
88
+ value: number;
89
+ }) => JSX.Element;
76
90
  /**
77
- * Class for the SVG element
91
+ * Display the numeric value in the center of the circle
78
92
  */
79
- svg?: string;
93
+ showValue?: boolean;
80
94
  /**
81
- * Class for the circle track
95
+ * Custom size in pixels
96
+ * When provided, this value overrides the size variant option
82
97
  */
83
- track?: string;
84
- };
85
- /**
86
- * Custom function to render content in the center of the circle
87
- * @param value - Current value of the component
88
- * @returns React element to display in the center of the circle
89
- */
90
- customLabel?: ({
91
- value
92
- }: {
93
- value: number;
94
- }) => JSX.Element;
95
- /**
96
- * Display the numeric value in the center of the circle
97
- */
98
- showValue?: boolean;
99
- /**
100
- * Custom size in pixels
101
- * When provided, this value overrides the size variant option
102
- */
103
- sizeInPixels?: number;
98
+ sizeInPixels?: number;
104
99
  }
105
- declare function ProgressCircle({
106
- animate,
107
- animationDuration,
108
- className,
109
- classNames,
110
- customLabel,
111
- showValue,
112
- size,
113
- sizeInPixels,
114
- strokeWidth,
115
- thickness,
116
- value,
117
- variant,
118
- ...props
119
- }: ProgressCircleProps): JSX.Element;
100
+ declare function ProgressCircle({ animate, animationDuration, className, classNames, customLabel, showValue, size, sizeInPixels, strokeWidth, thickness, value, variant, ...props }: ProgressCircleProps): JSX.Element;
120
101
  declare namespace ProgressCircle {
121
- var displayName: string;
102
+ var displayName: string;
122
103
  }
123
- //#endregion
124
- export { ProgressCircle, type ProgressCircleProps, progressCircleVariants };
104
+ export { progressCircleVariants };
105
+ export { ProgressCircle };
106
+ export type { ProgressCircleProps };
107
+ //# sourceMappingURL=progress-circle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress-circle.d.ts","sourceRoot":"","sources":["../../src/components/progress-circle.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAiB,GAAG,EAAE,MAAM,OAAO,CAAC;AAMhE,OAAO,KAAK,uBAAuB,MAAM,6BAA6B,CAAC;AAMvE,QAAA,MAAM,sBAAsB;;QAWtB,EAAE;YAAI,KAAK;;QAEX,EAAE;YAAI,KAAK;;QAEX,EAAE;YAAI,KAAK;;QAEX,EAAE;YAAI,KAAK;;QAEX,KAAK;YAAI,KAAK;;;;QAEH,OAAO;QAAM,KAAK;QAAM,IAAI;;;QAEvC,OAAO;YAAI,SAAS;YAAkB,KAAK;;QAC3C,WAAW;YAAI,SAAS;YAAsB,KAAK;;;;;;;;;EAGvD,CAAC;AAMH,UAAU,mBACR,SACE,IAAI,CAAC,cAAc,CAAC,OAAO,uBAAuB,CAAC,QAAQ,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC,EAClF,YAAY,CAAC,OAAO,sBAAsB,CAAC;IAC7C;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,CAAC,EAAE;QACX;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,GAAG,CAAC,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,GAAG,CAAC,OAAO,CAAC;IAE5D;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,iBAAS,cAAc,CAAC,EACtB,OAAc,EACd,iBAAwB,EACxB,SAAS,EACT,UAAU,EACV,WAAW,EACX,SAAiB,EACjB,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,SAAqB,EACrB,KAAS,EACT,OAAmB,EACnB,GAAG,KAAK,EACT,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,CAyDnC;;;;AA2CD,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,YAAY,EAAE,mBAAmB,EAAE,CAAC"}
@@ -1,116 +1,83 @@
1
1
  "use client";
2
- import { useAnimatedValue } from "../hooks/use-animated-value.js";
3
- import { Indicator as ProgressCircleIndicator, ProgressCircle as ProgressCircle$1, ProgressCircleProvider, ProgressCircleSVG, ProgressCircleTrack, ProgressCircleValue } from "../primitives/progress-circle.js";
4
- import { tv } from "@codefast/tailwind-variants";
5
- import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { tv } from "#lib/utils";
6
4
  import { useCallback, useMemo } from "react";
7
- //#region src/components/progress-circle.tsx
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
- defaultVariants: {
10
- size: "md",
11
- thickness: "regular",
12
- variant: "default"
13
- },
14
- slots: {
15
- indicator: "origin-center",
16
- label: "absolute inset-0 flex items-center justify-center text-xs font-medium",
17
- root: "relative inline-flex items-center justify-center",
18
- svg: "size-full",
19
- track: "origin-center"
20
- },
21
- variants: {
22
- size: {
23
- sm: { label: "text-[0.625rem]" },
24
- md: { label: "text-xs" },
25
- lg: { label: "text-sm" },
26
- xl: { label: "text-base" },
27
- "2xl": { label: "text-lg" }
28
- },
29
- thickness: {
30
- regular: {},
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 flex items-center justify-center", "inset-0", "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 = 1e3, className, classNames, customLabel, showValue = false, size, sizeInPixels, strokeWidth, thickness = "regular", value = 0, variant = "default", ...props }) {
47
- const displayValue = useAnimatedValue(value, animationDuration, animate);
48
- const actualSize = useMemo(() => sizeInPixels ?? getActualSize(size), [sizeInPixels, size]);
49
- const actualThickness = useMemo(() => strokeWidth ?? getStrokeWidth(thickness, actualSize), [
50
- strokeWidth,
51
- thickness,
52
- actualSize
53
- ]);
54
- const slots = useMemo(() => progressCircleVariants({
55
- size,
56
- thickness,
57
- variant
58
- }), [
59
- variant,
60
- size,
61
- thickness
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
- return size ? {
97
- "2xl": 128,
98
- lg: 64,
99
- md: 48,
100
- sm: 32,
101
- xl: 96
102
- }[size] : 48;
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
- const thicknessMap = {
109
- regular: Math.max(3, size * .05),
110
- thick: Math.max(4, size * .075),
111
- thin: Math.max(2, size * .025)
112
- };
113
- return thickness ? thicknessMap[thickness] : Math.max(3, size * .05);
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
- //#endregion
116
- export { ProgressCircle, progressCircleVariants };
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
- className,
8
- value,
9
- ...props
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,CAsB5E;AAMD,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,CAAC"}
@@ -1,19 +1,13 @@
1
1
  "use client";
2
- import { cn } from "@codefast/tailwind-variants";
3
- import { jsx } from "react/jsx-runtime";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { cn } from "#lib/utils";
4
4
  import * as ProgressPrimitive from "@radix-ui/react-progress";
5
- //#region src/components/progress.tsx
6
5
  function Progress({ className, value, ...props }) {
7
- return /* @__PURE__ */ jsx(ProgressPrimitive.Root, {
8
- className: cn("relative h-2 w-full overflow-hidden rounded-full bg-primary/20", className),
9
- "data-slot": "progress",
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: cn("size-full flex-1", "bg-primary", "transition-all"), "data-slot": "progress-indicator", style: {
7
+ transform: `translateX(-${(100 - (value ?? 0)).toString()}%)`,
8
+ } }) }));
17
9
  }
18
- //#endregion
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
- children,
10
- className,
11
- ...props
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,CAwC3F;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 { Label } from "./label.js";
3
- import { cn } from "@codefast/tailwind-variants";
4
- import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cn } from "#lib/utils";
5
4
  import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
6
- //#region src/components/radio-cards.tsx
5
+ import { Label } from "#components/label";
7
6
  function RadioCards(props) {
8
- return /* @__PURE__ */ jsx(RadioGroupPrimitive.Root, {
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
- return /* @__PURE__ */ jsxs(Label, {
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: cn("flex items-start gap-3", "p-3", "rounded-lg border border-input", "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 shadow-xs outline-hidden", "text-primary-foreground", "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: cn("size-1", "rounded-full", "bg-background"), "data-slot": "radio-card-indicator" }) }), children] }));
27
11
  }
28
- //#endregion
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
- className,
13
- ...props
14
- }: RadioGroupItemProps): JSX.Element;
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,CA6BjF;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 { cn } from "@codefast/tailwind-variants";
3
- import { jsx } from "react/jsx-runtime";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { cn } from "#lib/utils";
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
- return /* @__PURE__ */ jsx(RadioGroupPrimitive.Root, {
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
- return /* @__PURE__ */ jsx(RadioGroupPrimitive.Item, {
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: cn("size-1", "rounded-full", "bg-background"), "data-slot": "radio-group-indicator" }) }));
23
10
  }
24
- //#endregion
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
- onValueChange?: (value: string) => void;
3
+ onValueChange?: (value: string) => void;
6
4
  }
7
- declare function Radio({
8
- className,
9
- onChange,
10
- onValueChange,
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,CA+BxF;AAMD,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,YAAY,EAAE,UAAU,EAAE,CAAC"}
@@ -1,16 +1,11 @@
1
1
  "use client";
2
- import { cn } from "@codefast/tailwind-variants";
3
- import { jsx } from "react/jsx-runtime";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { cn } from "#lib/utils";
4
4
  import { composeEventHandlers } from "@radix-ui/primitive";
5
- //#region src/components/radio.tsx
6
5
  function Radio({ className, onChange, onValueChange, ...props }) {
7
- return /* @__PURE__ */ jsx("input", {
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 items-center justify-center", "rounded-full border border-input shadow-xs outline-hidden", "appearance-none", "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
- //#endregion
8
+ /* -----------------------------------------------------------------------------
9
+ * Exports
10
+ * -------------------------------------------------------------------------- */
16
11
  export { Radio };