@codefast/ui 0.0.50 → 0.0.53

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 (279) hide show
  1. package/dist/{chunk-ZTEJNUH6.js → chunk-46W6RAYD.js} +1 -1
  2. package/dist/chunk-46W6RAYD.js.map +1 -0
  3. package/dist/{chunk-CERSQE5J.js → chunk-4JHGPRLG.js} +1 -1
  4. package/dist/chunk-4JHGPRLG.js.map +1 -0
  5. package/dist/{chunk-I6QCJDIF.mjs → chunk-5RENVAXH.mjs} +1 -1
  6. package/dist/chunk-5RENVAXH.mjs.map +1 -0
  7. package/dist/{chunk-47CSACCM.mjs → chunk-7ABWX5CF.mjs} +2 -2
  8. package/dist/chunk-7ABWX5CF.mjs.map +1 -0
  9. package/dist/{chunk-XHNT6PVI.mjs → chunk-BM5KYF6Y.mjs} +1 -1
  10. package/dist/chunk-BM5KYF6Y.mjs.map +1 -0
  11. package/dist/{chunk-P5AV3QU7.mjs → chunk-BNKSZEF2.mjs} +1 -1
  12. package/dist/chunk-BNKSZEF2.mjs.map +1 -0
  13. package/dist/{chunk-SDGUDONZ.js → chunk-DCDB56BO.js} +1 -1
  14. package/dist/chunk-DCDB56BO.js.map +1 -0
  15. package/dist/{chunk-6FL3EBDQ.mjs → chunk-HMD2ZU33.mjs} +1 -1
  16. package/dist/chunk-HMD2ZU33.mjs.map +1 -0
  17. package/dist/{chunk-JOBEKA4M.mjs → chunk-K63K4LTH.mjs} +2 -2
  18. package/dist/chunk-K63K4LTH.mjs.map +1 -0
  19. package/dist/{chunk-VXPAGNPJ.js → chunk-LJSD47ZL.js} +1 -1
  20. package/dist/chunk-LJSD47ZL.js.map +1 -0
  21. package/dist/{chunk-GDMHMSJ2.mjs → chunk-MFYACCZV.mjs} +1 -1
  22. package/dist/chunk-MFYACCZV.mjs.map +1 -0
  23. package/dist/{chunk-LG7ACTRE.js → chunk-PRCS3RWN.js} +1 -1
  24. package/dist/chunk-PRCS3RWN.js.map +1 -0
  25. package/dist/{chunk-OP6Q7VT5.js → chunk-RHFF4JNH.js} +1 -1
  26. package/dist/chunk-RHFF4JNH.js.map +1 -0
  27. package/dist/{chunk-SCPFGC2X.js → chunk-SCXRD727.js} +1 -1
  28. package/dist/chunk-SCXRD727.js.map +1 -0
  29. package/dist/{chunk-X3LRJQM3.js → chunk-VZVI3OHH.js} +2 -2
  30. package/dist/chunk-VZVI3OHH.js.map +1 -0
  31. package/dist/{chunk-UYRRHPPH.js → chunk-X4BEEJEW.js} +2 -2
  32. package/dist/chunk-X4BEEJEW.js.map +1 -0
  33. package/dist/{chunk-PWF46YXQ.mjs → chunk-Y2GMHG3Z.mjs} +1 -1
  34. package/dist/chunk-Y2GMHG3Z.mjs.map +1 -0
  35. package/dist/{chunk-MU2MZ434.mjs → chunk-ZIB4ZTST.mjs} +1 -1
  36. package/dist/chunk-ZIB4ZTST.mjs.map +1 -0
  37. package/dist/plugin/animate.plugin.js +1 -1
  38. package/dist/plugin/animate.plugin.mjs +1 -1
  39. package/dist/react/accordion.js.map +1 -1
  40. package/dist/react/accordion.mjs.map +1 -1
  41. package/dist/react/alert-dialog.js +1 -1
  42. package/dist/react/alert-dialog.js.map +1 -1
  43. package/dist/react/alert-dialog.mjs +1 -1
  44. package/dist/react/alert-dialog.mjs.map +1 -1
  45. package/dist/react/alert.js.map +1 -1
  46. package/dist/react/alert.mjs.map +1 -1
  47. package/dist/react/aspect-ratio.d.mts +1 -1
  48. package/dist/react/aspect-ratio.d.ts +1 -1
  49. package/dist/react/aspect-ratio.js.map +1 -1
  50. package/dist/react/aspect-ratio.mjs.map +1 -1
  51. package/dist/react/avatar.js.map +1 -1
  52. package/dist/react/avatar.mjs.map +1 -1
  53. package/dist/react/badge.js.map +1 -1
  54. package/dist/react/badge.mjs.map +1 -1
  55. package/dist/react/blockquote.js.map +1 -1
  56. package/dist/react/blockquote.mjs.map +1 -1
  57. package/dist/react/box.js.map +1 -1
  58. package/dist/react/box.mjs.map +1 -1
  59. package/dist/react/breadcrumb.js.map +1 -1
  60. package/dist/react/breadcrumb.mjs.map +1 -1
  61. package/dist/react/button.js +1 -1
  62. package/dist/react/button.mjs +1 -1
  63. package/dist/react/calendar.js +1 -1
  64. package/dist/react/calendar.js.map +1 -1
  65. package/dist/react/calendar.mjs +1 -1
  66. package/dist/react/calendar.mjs.map +1 -1
  67. package/dist/react/card.js.map +1 -1
  68. package/dist/react/card.mjs.map +1 -1
  69. package/dist/react/carousel.js +1 -1
  70. package/dist/react/carousel.js.map +1 -1
  71. package/dist/react/carousel.mjs +1 -1
  72. package/dist/react/carousel.mjs.map +1 -1
  73. package/dist/react/checkbox-cards.js +1 -1
  74. package/dist/react/checkbox-cards.js.map +1 -1
  75. package/dist/react/checkbox-cards.mjs +1 -1
  76. package/dist/react/checkbox-cards.mjs.map +1 -1
  77. package/dist/react/checkbox-group.js +1 -1
  78. package/dist/react/checkbox-group.js.map +1 -1
  79. package/dist/react/checkbox-group.mjs +1 -1
  80. package/dist/react/checkbox-group.mjs.map +1 -1
  81. package/dist/react/checkbox-group.primitive.js +1 -1
  82. package/dist/react/checkbox-group.primitive.mjs +1 -1
  83. package/dist/react/checkbox.js.map +1 -1
  84. package/dist/react/checkbox.mjs.map +1 -1
  85. package/dist/react/code.js.map +1 -1
  86. package/dist/react/code.mjs.map +1 -1
  87. package/dist/react/collapsible.js.map +1 -1
  88. package/dist/react/collapsible.mjs.map +1 -1
  89. package/dist/react/command.js +1 -1
  90. package/dist/react/command.js.map +1 -1
  91. package/dist/react/command.mjs +1 -1
  92. package/dist/react/command.mjs.map +1 -1
  93. package/dist/react/container.js.map +1 -1
  94. package/dist/react/container.mjs.map +1 -1
  95. package/dist/react/context-menu.js.map +1 -1
  96. package/dist/react/context-menu.mjs.map +1 -1
  97. package/dist/react/data-table.d.mts +1 -1
  98. package/dist/react/data-table.d.ts +1 -1
  99. package/dist/react/data-table.js +1 -1
  100. package/dist/react/data-table.js.map +1 -1
  101. package/dist/react/data-table.mjs +1 -1
  102. package/dist/react/data-table.mjs.map +1 -1
  103. package/dist/react/dialog.js +1 -1
  104. package/dist/react/dialog.mjs +1 -1
  105. package/dist/react/drawer.js.map +1 -1
  106. package/dist/react/drawer.mjs.map +1 -1
  107. package/dist/react/dropdown-menu.js +1 -1
  108. package/dist/react/dropdown-menu.mjs +1 -1
  109. package/dist/react/em.js.map +1 -1
  110. package/dist/react/em.mjs.map +1 -1
  111. package/dist/react/form.js +1 -1
  112. package/dist/react/form.js.map +1 -1
  113. package/dist/react/form.mjs +1 -1
  114. package/dist/react/form.mjs.map +1 -1
  115. package/dist/react/heading.js.map +1 -1
  116. package/dist/react/heading.mjs.map +1 -1
  117. package/dist/react/hover-card.js.map +1 -1
  118. package/dist/react/hover-card.mjs.map +1 -1
  119. package/dist/react/input-otp.js.map +1 -1
  120. package/dist/react/input-otp.mjs.map +1 -1
  121. package/dist/react/input.js.map +1 -1
  122. package/dist/react/input.mjs.map +1 -1
  123. package/dist/react/kbd.js.map +1 -1
  124. package/dist/react/kbd.mjs.map +1 -1
  125. package/dist/react/label.js +1 -1
  126. package/dist/react/label.mjs +1 -1
  127. package/dist/react/menubar.js.map +1 -1
  128. package/dist/react/menubar.mjs.map +1 -1
  129. package/dist/react/navigation-menu.js.map +1 -1
  130. package/dist/react/navigation-menu.mjs.map +1 -1
  131. package/dist/react/pagination.js +1 -1
  132. package/dist/react/pagination.js.map +1 -1
  133. package/dist/react/pagination.mjs +1 -1
  134. package/dist/react/pagination.mjs.map +1 -1
  135. package/dist/react/popover.js.map +1 -1
  136. package/dist/react/popover.mjs.map +1 -1
  137. package/dist/react/pre.js.map +1 -1
  138. package/dist/react/pre.mjs.map +1 -1
  139. package/dist/react/progress.js.map +1 -1
  140. package/dist/react/progress.mjs.map +1 -1
  141. package/dist/react/quote.js.map +1 -1
  142. package/dist/react/quote.mjs.map +1 -1
  143. package/dist/react/radio-cards.js.map +1 -1
  144. package/dist/react/radio-cards.mjs.map +1 -1
  145. package/dist/react/radio-group.js.map +1 -1
  146. package/dist/react/radio-group.mjs.map +1 -1
  147. package/dist/react/radio.js.map +1 -1
  148. package/dist/react/radio.mjs.map +1 -1
  149. package/dist/react/resizable.js.map +1 -1
  150. package/dist/react/resizable.mjs.map +1 -1
  151. package/dist/react/scroll-area.js.map +1 -1
  152. package/dist/react/scroll-area.mjs.map +1 -1
  153. package/dist/react/section.js.map +1 -1
  154. package/dist/react/section.mjs.map +1 -1
  155. package/dist/react/select.js +1 -1
  156. package/dist/react/select.mjs +1 -1
  157. package/dist/react/separator.js.map +1 -1
  158. package/dist/react/separator.mjs.map +1 -1
  159. package/dist/react/sheet.js +1 -1
  160. package/dist/react/sheet.js.map +1 -1
  161. package/dist/react/sheet.mjs +1 -1
  162. package/dist/react/sheet.mjs.map +1 -1
  163. package/dist/react/skeleton.js.map +1 -1
  164. package/dist/react/skeleton.mjs.map +1 -1
  165. package/dist/react/slider.js.map +1 -1
  166. package/dist/react/slider.mjs.map +1 -1
  167. package/dist/react/sonner.js.map +1 -1
  168. package/dist/react/sonner.mjs.map +1 -1
  169. package/dist/react/spinner.js +1 -1
  170. package/dist/react/spinner.mjs +1 -1
  171. package/dist/react/strong.js.map +1 -1
  172. package/dist/react/strong.mjs.map +1 -1
  173. package/dist/react/switch.js.map +1 -1
  174. package/dist/react/switch.mjs.map +1 -1
  175. package/dist/react/table.js.map +1 -1
  176. package/dist/react/table.mjs.map +1 -1
  177. package/dist/react/tabs.js.map +1 -1
  178. package/dist/react/tabs.mjs.map +1 -1
  179. package/dist/react/text.js.map +1 -1
  180. package/dist/react/text.mjs.map +1 -1
  181. package/dist/react/textarea.js.map +1 -1
  182. package/dist/react/textarea.mjs.map +1 -1
  183. package/dist/react/toggle-group.js +1 -1
  184. package/dist/react/toggle-group.js.map +1 -1
  185. package/dist/react/toggle-group.mjs +1 -1
  186. package/dist/react/toggle-group.mjs.map +1 -1
  187. package/dist/react/toggle.js +1 -1
  188. package/dist/react/toggle.mjs +1 -1
  189. package/dist/react/tooltip.js.map +1 -1
  190. package/dist/react/tooltip.mjs.map +1 -1
  191. package/dist/styles.css.map +1 -1
  192. package/dist/tailwind.config.js +1 -1
  193. package/dist/tailwind.config.js.map +1 -1
  194. package/dist/tailwind.config.mjs +1 -1
  195. package/dist/tailwind.config.mjs.map +1 -1
  196. package/package.json +5 -5
  197. package/plugin/animate.plugin.ts +2 -5
  198. package/src/react/accordion.tsx +36 -60
  199. package/src/react/alert-dialog.tsx +57 -125
  200. package/src/react/alert.tsx +16 -42
  201. package/src/react/aspect-ratio.tsx +2 -4
  202. package/src/react/avatar.tsx +15 -43
  203. package/src/react/badge.tsx +3 -8
  204. package/src/react/blockquote.tsx +5 -8
  205. package/src/react/box.tsx +4 -6
  206. package/src/react/breadcrumb.tsx +17 -50
  207. package/src/react/button.tsx +5 -20
  208. package/src/react/calendar.tsx +6 -22
  209. package/src/react/card.tsx +22 -56
  210. package/src/react/carousel.tsx +20 -76
  211. package/src/react/checkbox-cards.tsx +28 -55
  212. package/src/react/checkbox-group.primitive.tsx +24 -78
  213. package/src/react/checkbox-group.tsx +26 -49
  214. package/src/react/checkbox.tsx +15 -19
  215. package/src/react/code.tsx +4 -6
  216. package/src/react/collapsible.tsx +19 -29
  217. package/src/react/command.tsx +69 -134
  218. package/src/react/container.tsx +5 -9
  219. package/src/react/context-menu.tsx +146 -224
  220. package/src/react/data-table.tsx +16 -44
  221. package/src/react/dialog.tsx +45 -90
  222. package/src/react/drawer.tsx +44 -91
  223. package/src/react/dropdown-menu.tsx +126 -194
  224. package/src/react/em.tsx +4 -6
  225. package/src/react/form.tsx +49 -84
  226. package/src/react/heading.tsx +4 -6
  227. package/src/react/hover-card.tsx +22 -38
  228. package/src/react/input-otp.tsx +26 -37
  229. package/src/react/input.tsx +6 -16
  230. package/src/react/kbd.tsx +14 -16
  231. package/src/react/label.tsx +11 -12
  232. package/src/react/menubar.tsx +129 -208
  233. package/src/react/navigation-menu.tsx +105 -147
  234. package/src/react/pagination.tsx +18 -50
  235. package/src/react/popover.tsx +25 -40
  236. package/src/react/pre.tsx +4 -6
  237. package/src/react/progress.tsx +15 -22
  238. package/src/react/quote.tsx +4 -6
  239. package/src/react/radio-cards.tsx +7 -27
  240. package/src/react/radio-group.tsx +7 -27
  241. package/src/react/radio.tsx +14 -18
  242. package/src/react/resizable.tsx +2 -7
  243. package/src/react/scroll-area.tsx +30 -52
  244. package/src/react/section.tsx +4 -6
  245. package/src/react/select.tsx +108 -161
  246. package/src/react/separator.tsx +3 -12
  247. package/src/react/sheet.tsx +21 -71
  248. package/src/react/skeleton.tsx +1 -6
  249. package/src/react/slider.tsx +20 -27
  250. package/src/react/sonner.tsx +2 -4
  251. package/src/react/spinner.tsx +2 -7
  252. package/src/react/strong.tsx +4 -6
  253. package/src/react/switch.tsx +12 -14
  254. package/src/react/table.tsx +37 -82
  255. package/src/react/tabs.tsx +34 -44
  256. package/src/react/text.tsx +5 -8
  257. package/src/react/textarea.tsx +12 -14
  258. package/src/react/toggle-group.tsx +16 -57
  259. package/src/react/toggle.tsx +8 -15
  260. package/src/react/tooltip.tsx +24 -39
  261. package/tailwind.config.ts +2 -2
  262. package/dist/chunk-47CSACCM.mjs.map +0 -1
  263. package/dist/chunk-6FL3EBDQ.mjs.map +0 -1
  264. package/dist/chunk-CERSQE5J.js.map +0 -1
  265. package/dist/chunk-GDMHMSJ2.mjs.map +0 -1
  266. package/dist/chunk-I6QCJDIF.mjs.map +0 -1
  267. package/dist/chunk-JOBEKA4M.mjs.map +0 -1
  268. package/dist/chunk-LG7ACTRE.js.map +0 -1
  269. package/dist/chunk-MU2MZ434.mjs.map +0 -1
  270. package/dist/chunk-OP6Q7VT5.js.map +0 -1
  271. package/dist/chunk-P5AV3QU7.mjs.map +0 -1
  272. package/dist/chunk-PWF46YXQ.mjs.map +0 -1
  273. package/dist/chunk-SCPFGC2X.js.map +0 -1
  274. package/dist/chunk-SDGUDONZ.js.map +0 -1
  275. package/dist/chunk-UYRRHPPH.js.map +0 -1
  276. package/dist/chunk-VXPAGNPJ.js.map +0 -1
  277. package/dist/chunk-X3LRJQM3.js.map +0 -1
  278. package/dist/chunk-XHNT6PVI.mjs.map +0 -1
  279. package/dist/chunk-ZTEJNUH6.js.map +0 -1
@@ -1,12 +1,13 @@
1
1
  import * as React from 'react';
2
2
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
3
3
  import { createCheckboxScope } from '@radix-ui/react-checkbox';
4
- import { createContextScope, type Scope } from '@radix-ui/react-context';
4
+ import { createContextScope } from '@radix-ui/react-context';
5
5
  import * as RovingFocusGroup from '@radix-ui/react-roving-focus';
6
6
  import { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus';
7
7
  import { useControllableState } from '@radix-ui/react-use-controllable-state';
8
8
  import { useDirection } from '@radix-ui/react-direction';
9
9
  import { Primitive } from '@radix-ui/react-primitive';
10
+ import type { Scope } from '@radix-ui/react-context';
10
11
 
11
12
  /* -------------------------------------------------------------------------------------------------
12
13
  * Component: CheckboxGroup
@@ -16,11 +17,10 @@ const CHECKBOX_GROUP_NAME = 'CheckboxGroup';
16
17
 
17
18
  type ScopedProps<P> = P & { __scopeCheckboxGroup?: Scope };
18
19
 
19
- const [createCheckboxGroupContext, createCheckboxGroupScope] =
20
- createContextScope(CHECKBOX_GROUP_NAME, [
21
- createRovingFocusGroupScope,
22
- createCheckboxScope,
23
- ]);
20
+ const [createCheckboxGroupContext, createCheckboxGroupScope] = createContextScope(CHECKBOX_GROUP_NAME, [
21
+ createRovingFocusGroupScope,
22
+ createCheckboxScope,
23
+ ]);
24
24
 
25
25
  const useRovingFocusGroupScope = createRovingFocusGroupScope();
26
26
  const useCheckboxScope = createCheckboxScope();
@@ -39,15 +39,10 @@ const [CheckboxGroupProvider, useCheckboxGroupContext] =
39
39
 
40
40
  type CheckboxGroupElement = React.ElementRef<typeof Primitive.div>;
41
41
 
42
- interface CheckboxGroupProps
43
- extends React.ComponentPropsWithoutRef<typeof Primitive.div> {
42
+ interface CheckboxGroupProps extends React.ComponentPropsWithoutRef<typeof Primitive.div> {
44
43
  name?: CheckboxGroupContextValue['name'];
45
- required?: React.ComponentPropsWithoutRef<
46
- typeof CheckboxPrimitive.Root
47
- >['required'];
48
- disabled?: React.ComponentPropsWithoutRef<
49
- typeof CheckboxPrimitive.Root
50
- >['disabled'];
44
+ required?: React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>['required'];
45
+ disabled?: React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>['disabled'];
51
46
  dir?: RovingFocusGroup.RovingFocusGroupProps['dir'];
52
47
  orientation?: RovingFocusGroup.RovingFocusGroupProps['orientation'];
53
48
  loop?: RovingFocusGroup.RovingFocusGroupProps['loop'];
@@ -56,10 +51,7 @@ interface CheckboxGroupProps
56
51
  onValueChange?: (value: string[]) => void;
57
52
  }
58
53
 
59
- const CheckboxGroup = React.forwardRef<
60
- CheckboxGroupElement,
61
- CheckboxGroupProps
62
- >(
54
+ const CheckboxGroup = React.forwardRef<CheckboxGroupElement, CheckboxGroupProps>(
63
55
  (
64
56
  {
65
57
  __scopeCheckboxGroup,
@@ -76,8 +68,7 @@ const CheckboxGroup = React.forwardRef<
76
68
  }: ScopedProps<CheckboxGroupProps>,
77
69
  ref,
78
70
  ) => {
79
- const rovingFocusGroupScope =
80
- useRovingFocusGroupScope(__scopeCheckboxGroup);
71
+ const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeCheckboxGroup);
81
72
  const direction = useDirection(dir);
82
73
  const [value = [], setValue] = useControllableState({
83
74
  prop: valueProp,
@@ -94,9 +85,7 @@ const CheckboxGroup = React.forwardRef<
94
85
 
95
86
  const handleItemUncheck = React.useCallback(
96
87
  (itemValue: string) => {
97
- setValue((prevValue = []) =>
98
- prevValue.filter((val) => val !== itemValue),
99
- );
88
+ setValue((prevValue = []) => prevValue.filter((val) => val !== itemValue));
100
89
  },
101
90
  [setValue],
102
91
  );
@@ -111,21 +100,9 @@ const CheckboxGroup = React.forwardRef<
111
100
  onItemCheck={handleItemCheck}
112
101
  onItemUncheck={handleItemUncheck}
113
102
  >
114
- <RovingFocusGroup.Root
115
- asChild
116
- {...rovingFocusGroupScope}
117
- orientation={orientation}
118
- dir={direction}
119
- loop={loop}
120
- >
103
+ <RovingFocusGroup.Root asChild {...rovingFocusGroupScope} orientation={orientation} dir={direction} loop={loop}>
121
104
  {/* eslint-disable-next-line react/jsx-pascal-case -- radix-ui */}
122
- <Primitive.div
123
- ref={ref}
124
- role="group"
125
- data-disabled={disabled ? '' : undefined}
126
- dir={direction}
127
- {...props}
128
- />
105
+ <Primitive.div ref={ref} role="group" data-disabled={disabled ? '' : undefined} dir={direction} {...props} />
129
106
  </RovingFocusGroup.Root>
130
107
  </CheckboxGroupProvider>
131
108
  );
@@ -150,32 +127,16 @@ interface CheckboxGroupItemProps
150
127
  value: string;
151
128
  }
152
129
 
153
- const CheckboxGroupItem = React.forwardRef<
154
- CheckboxGroupItemElement,
155
- CheckboxGroupItemProps
156
- >(
157
- (
158
- {
159
- __scopeCheckboxGroup,
160
- disabled,
161
- ...props
162
- }: ScopedProps<CheckboxGroupItemProps>,
163
- ref,
164
- ) => {
130
+ const CheckboxGroupItem = React.forwardRef<CheckboxGroupItemElement, CheckboxGroupItemProps>(
131
+ ({ __scopeCheckboxGroup, disabled, ...props }: ScopedProps<CheckboxGroupItemProps>, ref) => {
165
132
  const context = useCheckboxGroupContext(ITEM_NAME, __scopeCheckboxGroup);
166
133
  const isDisabled = context.disabled || disabled;
167
- const rovingFocusGroupScope =
168
- useRovingFocusGroupScope(__scopeCheckboxGroup);
134
+ const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeCheckboxGroup);
169
135
  const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);
170
136
  const checked = context.value?.includes(props.value);
171
137
 
172
138
  return (
173
- <RovingFocusGroup.Item
174
- asChild
175
- {...rovingFocusGroupScope}
176
- focusable={!isDisabled}
177
- active={checked}
178
- >
139
+ <RovingFocusGroup.Item asChild {...rovingFocusGroupScope} focusable={!isDisabled} active={checked}>
179
140
  <CheckboxPrimitive.Root
180
141
  ref={ref}
181
142
  name={context.name}
@@ -205,29 +166,14 @@ CheckboxGroupItem.displayName = ITEM_NAME;
205
166
 
206
167
  const INDICATOR_NAME = `${CHECKBOX_GROUP_NAME}Indicator`;
207
168
 
208
- type CheckboxGroupIndicatorElement = React.ElementRef<
209
- typeof CheckboxPrimitive.Indicator
210
- >;
211
- type CheckboxGroupIndicatorProps = React.ComponentPropsWithoutRef<
212
- typeof CheckboxPrimitive.Indicator
213
- >;
214
-
215
- const CheckboxGroupIndicator = React.forwardRef<
216
- CheckboxGroupIndicatorElement,
217
- CheckboxGroupIndicatorProps
218
- >(
219
- (
220
- {
221
- __scopeCheckboxGroup,
222
- ...props
223
- }: ScopedProps<CheckboxGroupIndicatorProps>,
224
- ref,
225
- ) => {
169
+ type CheckboxGroupIndicatorElement = React.ElementRef<typeof CheckboxPrimitive.Indicator>;
170
+ type CheckboxGroupIndicatorProps = React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Indicator>;
171
+
172
+ const CheckboxGroupIndicator = React.forwardRef<CheckboxGroupIndicatorElement, CheckboxGroupIndicatorProps>(
173
+ ({ __scopeCheckboxGroup, ...props }: ScopedProps<CheckboxGroupIndicatorProps>, ref) => {
226
174
  const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);
227
175
 
228
- return (
229
- <CheckboxPrimitive.Indicator ref={ref} {...checkboxScope} {...props} />
230
- );
176
+ return <CheckboxPrimitive.Indicator ref={ref} {...checkboxScope} {...props} />;
231
177
  },
232
178
  );
233
179
 
@@ -9,24 +9,11 @@ import * as CheckboxGroupPrimitive from './checkbox-group.primitive';
9
9
  * Component: CheckboxGroup
10
10
  * -------------------------------------------------------------------------- */
11
11
 
12
- type CheckboxGroupElement = React.ElementRef<
13
- typeof CheckboxGroupPrimitive.Root
14
- >;
15
- type CheckboxGroupProps = React.ComponentPropsWithoutRef<
16
- typeof CheckboxGroupPrimitive.Root
17
- >;
12
+ type CheckboxGroupElement = React.ElementRef<typeof CheckboxGroupPrimitive.Root>;
13
+ type CheckboxGroupProps = React.ComponentPropsWithoutRef<typeof CheckboxGroupPrimitive.Root>;
18
14
 
19
- const CheckboxGroup = React.forwardRef<
20
- CheckboxGroupElement,
21
- CheckboxGroupProps
22
- >(({ className, ...props }, ref) => {
23
- return (
24
- <CheckboxGroupPrimitive.Root
25
- ref={ref}
26
- className={cn('grid gap-2', className)}
27
- {...props}
28
- />
29
- );
15
+ const CheckboxGroup = React.forwardRef<CheckboxGroupElement, CheckboxGroupProps>(({ className, ...props }, ref) => {
16
+ return <CheckboxGroupPrimitive.Root ref={ref} className={cn('grid gap-2', className)} {...props} />;
30
17
  });
31
18
 
32
19
  CheckboxGroup.displayName = 'CheckboxGroup';
@@ -35,32 +22,27 @@ CheckboxGroup.displayName = 'CheckboxGroup';
35
22
  * Component: CheckboxGroupItem
36
23
  * -------------------------------------------------------------------------- */
37
24
 
38
- type CheckboxGroupItemElement = React.ElementRef<
39
- typeof CheckboxGroupPrimitive.Item
40
- >;
41
- type CheckboxGroupItemProps = React.ComponentPropsWithoutRef<
42
- typeof CheckboxGroupPrimitive.Item
43
- >;
44
-
45
- const CheckboxGroupItem = React.forwardRef<
46
- CheckboxGroupItemElement,
47
- CheckboxGroupItemProps
48
- >(({ className, ...props }, ref) => {
49
- return (
50
- <CheckboxGroupPrimitive.Item
51
- ref={ref}
52
- className={cn(
53
- 'border-input hover:border-primary aria-checked:border-primary aria-checked:bg-primary aria-checked:text-primary-foreground peer flex size-4 shrink-0 rounded-sm border shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none disabled:opacity-50',
54
- className,
55
- )}
56
- {...props}
57
- >
58
- <CheckboxGroupPrimitive.CheckboxGroupIndicator className="flex size-full items-center justify-center text-current">
59
- <CheckIcon className="size-3.5" />
60
- </CheckboxGroupPrimitive.CheckboxGroupIndicator>
61
- </CheckboxGroupPrimitive.Item>
62
- );
63
- });
25
+ type CheckboxGroupItemElement = React.ElementRef<typeof CheckboxGroupPrimitive.Item>;
26
+ type CheckboxGroupItemProps = React.ComponentPropsWithoutRef<typeof CheckboxGroupPrimitive.Item>;
27
+
28
+ const CheckboxGroupItem = React.forwardRef<CheckboxGroupItemElement, CheckboxGroupItemProps>(
29
+ ({ className, ...props }, ref) => {
30
+ return (
31
+ <CheckboxGroupPrimitive.Item
32
+ ref={ref}
33
+ className={cn(
34
+ 'border-input hover:border-primary aria-checked:border-primary aria-checked:bg-primary aria-checked:text-primary-foreground peer flex size-4 shrink-0 rounded-sm border shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none disabled:opacity-50',
35
+ className,
36
+ )}
37
+ {...props}
38
+ >
39
+ <CheckboxGroupPrimitive.CheckboxGroupIndicator className="flex size-full items-center justify-center text-current">
40
+ <CheckIcon className="size-3.5" />
41
+ </CheckboxGroupPrimitive.CheckboxGroupIndicator>
42
+ </CheckboxGroupPrimitive.Item>
43
+ );
44
+ },
45
+ );
64
46
 
65
47
  CheckboxGroupItem.displayName = 'CheckboxGroupItem';
66
48
 
@@ -68,9 +50,4 @@ CheckboxGroupItem.displayName = 'CheckboxGroupItem';
68
50
  * Exports
69
51
  * -------------------------------------------------------------------------- */
70
52
 
71
- export {
72
- CheckboxGroup,
73
- CheckboxGroupItem,
74
- type CheckboxGroupProps,
75
- type CheckboxGroupItemProps,
76
- };
53
+ export { CheckboxGroup, CheckboxGroupItem, type CheckboxGroupProps, type CheckboxGroupItemProps };
@@ -10,26 +10,22 @@ import { cn } from '../lib/utils';
10
10
  * -------------------------------------------------------------------------- */
11
11
 
12
12
  type CheckboxElement = React.ElementRef<typeof CheckboxPrimitive.Root>;
13
- type CheckboxProps = React.ComponentPropsWithoutRef<
14
- typeof CheckboxPrimitive.Root
15
- >;
13
+ type CheckboxProps = React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>;
16
14
 
17
- const Checkbox = React.forwardRef<CheckboxElement, CheckboxProps>(
18
- ({ className, ...props }, ref) => (
19
- <CheckboxPrimitive.Root
20
- ref={ref}
21
- className={cn(
22
- 'border-input hover:border-primary aria-checked:border-primary aria-checked:bg-primary aria-checked:text-primary-foreground peer flex size-4 shrink-0 rounded-sm border shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
23
- className,
24
- )}
25
- {...props}
26
- >
27
- <CheckboxPrimitive.Indicator className="flex size-full items-center justify-center text-current">
28
- <CheckIcon className="size-3.5" />
29
- </CheckboxPrimitive.Indicator>
30
- </CheckboxPrimitive.Root>
31
- ),
32
- );
15
+ const Checkbox = React.forwardRef<CheckboxElement, CheckboxProps>(({ className, ...props }, ref) => (
16
+ <CheckboxPrimitive.Root
17
+ ref={ref}
18
+ className={cn(
19
+ 'border-input hover:border-primary aria-checked:border-primary aria-checked:bg-primary aria-checked:text-primary-foreground peer flex size-4 shrink-0 rounded-sm border shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
20
+ className,
21
+ )}
22
+ {...props}
23
+ >
24
+ <CheckboxPrimitive.Indicator className="flex size-full items-center justify-center text-current">
25
+ <CheckIcon className="size-3.5" />
26
+ </CheckboxPrimitive.Indicator>
27
+ </CheckboxPrimitive.Root>
28
+ ));
33
29
 
34
30
  Checkbox.displayName = CheckboxPrimitive.Root.displayName;
35
31
 
@@ -11,13 +11,11 @@ interface CodeProps extends React.HTMLAttributes<HTMLElement> {
11
11
  asChild?: boolean;
12
12
  }
13
13
 
14
- const Code = React.forwardRef<CodeElement, CodeProps>(
15
- ({ asChild, ...props }, ref) => {
16
- const Component = asChild ? Slot : 'code';
14
+ const Code = React.forwardRef<CodeElement, CodeProps>(({ asChild, ...props }, ref) => {
15
+ const Component = asChild ? Slot : 'code';
17
16
 
18
- return <Component ref={ref} {...props} />;
19
- },
20
- );
17
+ return <Component ref={ref} {...props} />;
18
+ });
21
19
 
22
20
  Code.displayName = 'Code';
23
21
 
@@ -8,47 +8,37 @@ import { cn } from '../lib/utils';
8
8
  * Component: Collapsible
9
9
  * -------------------------------------------------------------------------- */
10
10
 
11
- type CollapsibleProps = React.ComponentPropsWithoutRef<
12
- typeof CollapsiblePrimitive.Root
13
- >;
11
+ type CollapsibleProps = React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Root>;
14
12
  const Collapsible = CollapsiblePrimitive.Root;
15
13
 
16
14
  /* -----------------------------------------------------------------------------
17
15
  * Component: CollapsibleTrigger
18
16
  * -------------------------------------------------------------------------- */
19
17
 
20
- type CollapsibleTriggerProps = React.ComponentPropsWithoutRef<
21
- typeof CollapsiblePrimitive.CollapsibleTrigger
22
- >;
18
+ type CollapsibleTriggerProps = React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.CollapsibleTrigger>;
23
19
  const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
24
20
 
25
21
  /* -----------------------------------------------------------------------------
26
22
  * Component: CollapsibleContent
27
23
  * -------------------------------------------------------------------------- */
28
24
 
29
- type CollapsibleContentElement = React.ElementRef<
30
- typeof CollapsiblePrimitive.CollapsibleContent
31
- >;
32
- type CollapsibleContentProps = React.ComponentPropsWithoutRef<
33
- typeof CollapsiblePrimitive.CollapsibleContent
34
- >;
35
-
36
- const CollapsibleContent = React.forwardRef<
37
- CollapsibleContentElement,
38
- CollapsibleContentProps
39
- >(({ className, ...props }, ref) => (
40
- <CollapsiblePrimitive.CollapsibleContent
41
- ref={ref}
42
- className={cn(
43
- 'data-[state=open]:animate-collapsible-open data-[state=closed]:animate-collapsible-closed overflow-hidden',
44
- className,
45
- )}
46
- {...props}
47
- />
48
- ));
49
-
50
- CollapsibleContent.displayName =
51
- CollapsiblePrimitive.CollapsibleContent.displayName;
25
+ type CollapsibleContentElement = React.ElementRef<typeof CollapsiblePrimitive.CollapsibleContent>;
26
+ type CollapsibleContentProps = React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.CollapsibleContent>;
27
+
28
+ const CollapsibleContent = React.forwardRef<CollapsibleContentElement, CollapsibleContentProps>(
29
+ ({ className, ...props }, ref) => (
30
+ <CollapsiblePrimitive.CollapsibleContent
31
+ ref={ref}
32
+ className={cn(
33
+ 'data-[state=open]:animate-collapsible-open data-[state=closed]:animate-collapsible-closed overflow-hidden',
34
+ className,
35
+ )}
36
+ {...props}
37
+ />
38
+ ),
39
+ );
40
+
41
+ CollapsibleContent.displayName = CollapsiblePrimitive.CollapsibleContent.displayName;
52
42
 
53
43
  /* -----------------------------------------------------------------------------
54
44
  * Exports