@foundrykit/primitives 2.0.6 → 2.0.7

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 (319) hide show
  1. package/.turbo/turbo-build.log +233 -108
  2. package/.turbo/turbo-type-check.log +1 -1
  3. package/CHANGELOG.md +10 -0
  4. package/README.md +39 -136
  5. package/dist/chunk-25N35Z5M.js +42 -0
  6. package/dist/chunk-2JOT4DV4.js +66 -0
  7. package/dist/chunk-2PXD7LAX.js +172 -0
  8. package/dist/{chunk-VSXKLSEP.js → chunk-3BAO7TAS.js} +2 -2
  9. package/dist/chunk-3MEIDBWZ.js +225 -0
  10. package/dist/{chunk-A3U73FA7.js → chunk-3UKWAM5M.js} +2 -2
  11. package/dist/chunk-44I6VK3H.js +105 -0
  12. package/dist/chunk-46UI3AUE.js +62 -0
  13. package/dist/{chunk-AADRFFPH.js → chunk-5OSYIETI.js} +4 -4
  14. package/dist/chunk-67UXTT4O.js +116 -0
  15. package/dist/{chunk-J57CV3VT.js → chunk-6DRII3XC.js} +2 -2
  16. package/dist/chunk-727ACUWN.js +82 -0
  17. package/dist/chunk-76APYFRN.js +29 -0
  18. package/dist/chunk-AJAAMJYH.js +12 -0
  19. package/dist/chunk-BIFBYERK.js +69 -0
  20. package/dist/{chunk-PHMEWMFS.js → chunk-D4X2ZO5T.js} +7 -7
  21. package/dist/{chunk-UZIMC7AQ.js → chunk-DFGLEAZI.js} +2 -2
  22. package/dist/chunk-DKBMAFIR.js +65 -0
  23. package/dist/{chunk-U2EIVYWP.js → chunk-DXZ4GUQO.js} +2 -2
  24. package/dist/chunk-ED6T7ZZN.js +130 -0
  25. package/dist/{chunk-J4CRGO2P.js → chunk-EDKSYP4L.js} +2 -2
  26. package/dist/chunk-EEAK2RWF.js +23 -0
  27. package/dist/{chunk-FYCANIVJ.js → chunk-FF5D53KL.js} +2 -2
  28. package/dist/chunk-FIRYLO5W.js +253 -0
  29. package/dist/chunk-GPEL656S.js +84 -0
  30. package/dist/chunk-JKKCRFYB.js +36 -0
  31. package/dist/chunk-JTSIBZS4.js +194 -0
  32. package/dist/{chunk-QL4XJD7Y.js → chunk-MCXSVXO4.js} +2 -2
  33. package/dist/chunk-MMZJQ7RW.js +33 -0
  34. package/dist/{chunk-4GPFVBO2.js → chunk-MYIUX3DT.js} +3 -3
  35. package/dist/chunk-PAO3DSEF.js +48 -0
  36. package/dist/chunk-PLLG76QJ.js +32 -0
  37. package/dist/chunk-R3IEOV2B.js +155 -0
  38. package/dist/{chunk-KZMSLRLW.js → chunk-RDQF3IQE.js} +2 -2
  39. package/dist/{chunk-XQAJQKO7.js → chunk-SUEPE6OX.js} +3 -3
  40. package/dist/chunk-TA23RNS4.js +162 -0
  41. package/dist/chunk-TRXU4SOJ.js +224 -0
  42. package/dist/chunk-VA4MKQN7.js +40 -0
  43. package/dist/chunk-VPBVKBZ7.js +25 -0
  44. package/dist/{chunk-I44GXEPN.js → chunk-XVIHRZGJ.js} +1 -1
  45. package/dist/chunk-YT2ZIMZI.js +16 -0
  46. package/dist/components/accordion/index.cjs +104 -0
  47. package/dist/components/accordion/index.d.cts +25 -0
  48. package/dist/components/accordion/index.d.ts +25 -0
  49. package/dist/components/accordion/index.js +13 -0
  50. package/dist/components/alert/index.cjs +96 -0
  51. package/dist/components/alert/index.d.cts +28 -0
  52. package/dist/components/alert/index.d.ts +28 -0
  53. package/dist/components/alert/index.js +12 -0
  54. package/dist/components/alert-dialog/index.cjs +200 -0
  55. package/dist/components/alert-dialog/index.d.cts +42 -0
  56. package/dist/components/alert-dialog/index.d.ts +42 -0
  57. package/dist/components/alert-dialog/index.js +27 -0
  58. package/dist/components/aspect-ratio/index.cjs +47 -0
  59. package/dist/components/aspect-ratio/index.d.cts +19 -0
  60. package/dist/components/aspect-ratio/index.d.ts +19 -0
  61. package/dist/components/aspect-ratio/index.js +7 -0
  62. package/dist/components/avatar/index.cjs +1 -1
  63. package/dist/components/avatar/index.d.cts +16 -1
  64. package/dist/components/avatar/index.d.ts +16 -1
  65. package/dist/components/avatar/index.js +1 -1
  66. package/dist/components/badge/index.cjs +5 -5
  67. package/dist/components/badge/index.d.cts +13 -2
  68. package/dist/components/badge/index.d.ts +13 -2
  69. package/dist/components/badge/index.js +1 -1
  70. package/dist/components/breadcrumb/index.cjs +2 -2
  71. package/dist/components/breadcrumb/index.d.cts +19 -0
  72. package/dist/components/breadcrumb/index.d.ts +19 -0
  73. package/dist/components/breadcrumb/index.js +1 -1
  74. package/dist/components/button/index.cjs +18 -8
  75. package/dist/components/button/index.d.cts +15 -2
  76. package/dist/components/button/index.d.ts +15 -2
  77. package/dist/components/button/index.js +1 -1
  78. package/dist/components/button-group/index.cjs +142 -0
  79. package/dist/components/button-group/index.d.cts +33 -0
  80. package/dist/components/button-group/index.d.ts +33 -0
  81. package/dist/components/button-group/index.js +13 -0
  82. package/dist/components/card/index.cjs +2 -2
  83. package/dist/components/card/index.d.cts +16 -0
  84. package/dist/components/card/index.d.ts +16 -0
  85. package/dist/components/card/index.js +1 -1
  86. package/dist/components/checkbox/index.cjs +2 -2
  87. package/dist/components/checkbox/index.d.cts +11 -1
  88. package/dist/components/checkbox/index.d.ts +11 -1
  89. package/dist/components/checkbox/index.js +1 -1
  90. package/dist/components/collapsible/index.cjs +73 -0
  91. package/dist/components/collapsible/index.d.cts +22 -0
  92. package/dist/components/collapsible/index.d.ts +22 -0
  93. package/dist/components/collapsible/index.js +11 -0
  94. package/dist/components/context-menu/index.cjs +274 -0
  95. package/dist/components/context-menu/index.d.cts +48 -0
  96. package/dist/components/context-menu/index.d.ts +48 -0
  97. package/dist/components/context-menu/index.js +35 -0
  98. package/dist/components/direction/index.cjs +39 -0
  99. package/dist/components/direction/index.d.cts +20 -0
  100. package/dist/components/direction/index.d.ts +20 -0
  101. package/dist/components/direction/index.js +9 -0
  102. package/dist/components/drawer/index.cjs +164 -0
  103. package/dist/components/drawer/index.d.cts +35 -0
  104. package/dist/components/drawer/index.d.ts +35 -0
  105. package/dist/components/drawer/index.js +25 -0
  106. package/dist/components/dropdown/index.cjs +7 -7
  107. package/dist/components/dropdown/index.d.cts +25 -1
  108. package/dist/components/dropdown/index.d.ts +25 -1
  109. package/dist/components/dropdown/index.js +1 -1
  110. package/dist/components/empty/index.cjs +135 -0
  111. package/dist/components/empty/index.d.cts +38 -0
  112. package/dist/components/empty/index.d.ts +38 -0
  113. package/dist/components/empty/index.js +18 -0
  114. package/dist/components/field/index.cjs +269 -0
  115. package/dist/components/field/index.d.cts +42 -0
  116. package/dist/components/field/index.d.ts +42 -0
  117. package/dist/components/field/index.js +27 -0
  118. package/dist/components/hover-card/index.cjs +77 -0
  119. package/dist/components/hover-card/index.d.cts +22 -0
  120. package/dist/components/hover-card/index.d.ts +22 -0
  121. package/dist/components/hover-card/index.js +11 -0
  122. package/dist/components/input/index.cjs +2 -2
  123. package/dist/components/input/index.d.cts +11 -2
  124. package/dist/components/input/index.d.ts +11 -2
  125. package/dist/components/input/index.js +1 -1
  126. package/dist/components/item/index.cjs +262 -0
  127. package/dist/components/item/index.d.cts +47 -0
  128. package/dist/components/item/index.d.ts +47 -0
  129. package/dist/components/item/index.js +29 -0
  130. package/dist/components/kbd/index.cjs +57 -0
  131. package/dist/components/kbd/index.d.cts +19 -0
  132. package/dist/components/kbd/index.d.ts +19 -0
  133. package/dist/components/kbd/index.js +8 -0
  134. package/dist/components/label/index.cjs +2 -2
  135. package/dist/components/label/index.d.cts +10 -1
  136. package/dist/components/label/index.d.ts +10 -1
  137. package/dist/components/label/index.js +1 -1
  138. package/dist/components/menubar/index.cjs +303 -0
  139. package/dist/components/menubar/index.d.cts +49 -0
  140. package/dist/components/menubar/index.d.ts +49 -0
  141. package/dist/components/menubar/index.js +37 -0
  142. package/dist/components/native-select/index.cjs +53 -0
  143. package/dist/components/native-select/index.d.cts +19 -0
  144. package/dist/components/native-select/index.d.ts +19 -0
  145. package/dist/components/native-select/index.js +6 -0
  146. package/dist/components/navigation-menu/index.cjs +215 -0
  147. package/dist/components/navigation-menu/index.d.cts +37 -0
  148. package/dist/components/navigation-menu/index.d.ts +37 -0
  149. package/dist/components/navigation-menu/index.js +23 -0
  150. package/dist/components/popover/index.cjs +2 -2
  151. package/dist/components/popover/index.d.cts +14 -1
  152. package/dist/components/popover/index.d.ts +14 -1
  153. package/dist/components/popover/index.js +1 -1
  154. package/dist/components/progress/index.cjs +68 -0
  155. package/dist/components/progress/index.d.cts +16 -0
  156. package/dist/components/progress/index.d.ts +16 -0
  157. package/dist/components/progress/index.js +7 -0
  158. package/dist/components/radio-group/index.cjs +3 -3
  159. package/dist/components/radio-group/index.d.cts +15 -1
  160. package/dist/components/radio-group/index.d.ts +15 -1
  161. package/dist/components/radio-group/index.js +1 -1
  162. package/dist/components/resizable/index.cjs +75 -0
  163. package/dist/components/resizable/index.d.cts +25 -0
  164. package/dist/components/resizable/index.d.ts +25 -0
  165. package/dist/components/resizable/index.js +11 -0
  166. package/dist/components/scroll-area/index.cjs +3 -3
  167. package/dist/components/scroll-area/index.d.cts +14 -1
  168. package/dist/components/scroll-area/index.d.ts +14 -1
  169. package/dist/components/scroll-area/index.js +1 -1
  170. package/dist/components/select/index.cjs +4 -4
  171. package/dist/components/select/index.d.cts +19 -1
  172. package/dist/components/select/index.d.ts +19 -1
  173. package/dist/components/select/index.js +1 -1
  174. package/dist/components/separator/index.cjs +2 -2
  175. package/dist/components/separator/index.d.cts +12 -1
  176. package/dist/components/separator/index.d.ts +12 -1
  177. package/dist/components/separator/index.js +1 -1
  178. package/dist/components/skeleton/index.d.cts +9 -0
  179. package/dist/components/skeleton/index.d.ts +9 -0
  180. package/dist/components/slider/index.cjs +100 -0
  181. package/dist/components/slider/index.d.cts +18 -0
  182. package/dist/components/slider/index.d.ts +18 -0
  183. package/dist/components/slider/index.js +7 -0
  184. package/dist/components/sonner/index.cjs +51 -0
  185. package/dist/components/sonner/index.d.cts +18 -0
  186. package/dist/components/sonner/index.d.ts +18 -0
  187. package/dist/components/sonner/index.js +9 -0
  188. package/dist/components/spinner/index.cjs +47 -0
  189. package/dist/components/spinner/index.d.cts +17 -0
  190. package/dist/components/spinner/index.d.ts +17 -0
  191. package/dist/components/spinner/index.js +6 -0
  192. package/dist/components/switch/index.cjs +2 -2
  193. package/dist/components/switch/index.d.cts +11 -1
  194. package/dist/components/switch/index.d.ts +11 -1
  195. package/dist/components/switch/index.js +1 -1
  196. package/dist/components/table/index.cjs +147 -0
  197. package/dist/components/table/index.d.cts +35 -0
  198. package/dist/components/table/index.d.ts +35 -0
  199. package/dist/components/table/index.js +20 -0
  200. package/dist/components/tabs/index.cjs +2 -2
  201. package/dist/components/tabs/index.d.cts +18 -1
  202. package/dist/components/tabs/index.d.ts +18 -1
  203. package/dist/components/tabs/index.js +1 -1
  204. package/dist/components/textarea/index.cjs +1 -1
  205. package/dist/components/textarea/index.d.cts +9 -0
  206. package/dist/components/textarea/index.d.ts +9 -0
  207. package/dist/components/textarea/index.js +1 -1
  208. package/dist/components/toggle-group/index.cjs +120 -0
  209. package/dist/components/toggle-group/index.d.cts +27 -0
  210. package/dist/components/toggle-group/index.d.ts +27 -0
  211. package/dist/components/toggle-group/index.js +9 -0
  212. package/dist/components/typography/index.cjs +197 -0
  213. package/dist/components/typography/index.d.cts +28 -0
  214. package/dist/components/typography/index.d.ts +28 -0
  215. package/dist/components/typography/index.js +28 -0
  216. package/dist/index.cjs +3272 -781
  217. package/dist/index.d.cts +128 -24
  218. package/dist/index.d.ts +128 -24
  219. package/dist/index.js +485 -144
  220. package/package.json +25 -8
  221. package/postcss.config.mjs +1 -1
  222. package/registry.json +18 -5
  223. package/src/components/accordion/config.ts +28 -0
  224. package/src/components/accordion/index.tsx +80 -0
  225. package/src/components/alert/config.ts +40 -0
  226. package/src/components/alert/index.tsx +80 -0
  227. package/src/components/alert-dialog/config.ts +28 -0
  228. package/src/components/alert-dialog/index.tsx +188 -0
  229. package/src/components/aspect-ratio/config.ts +27 -0
  230. package/src/components/aspect-ratio/index.tsx +24 -0
  231. package/src/components/avatar/config.ts +1 -1
  232. package/src/components/avatar/index.tsx +18 -4
  233. package/src/components/badge/config.ts +1 -1
  234. package/src/components/badge/index.tsx +17 -7
  235. package/src/components/breadcrumb/config.ts +1 -1
  236. package/src/components/breadcrumb/index.tsx +24 -6
  237. package/src/components/button/config.ts +21 -1
  238. package/src/components/button/index.tsx +33 -9
  239. package/src/components/button-group/config.ts +39 -0
  240. package/src/components/button-group/index.tsx +99 -0
  241. package/src/components/card/config.ts +1 -1
  242. package/src/components/card/index.tsx +21 -6
  243. package/src/components/checkbox/config.ts +1 -1
  244. package/src/components/checkbox/index.tsx +13 -4
  245. package/src/components/collapsible/config.ts +27 -0
  246. package/src/components/collapsible/index.tsx +47 -0
  247. package/src/components/context-menu/config.ts +28 -0
  248. package/src/components/context-menu/index.tsx +271 -0
  249. package/src/components/dialog/config.ts +1 -1
  250. package/src/components/dialog/index.tsx +25 -6
  251. package/src/components/direction/config.ts +28 -0
  252. package/src/components/direction/index.tsx +27 -0
  253. package/src/components/drawer/config.ts +28 -0
  254. package/src/components/drawer/index.tsx +153 -0
  255. package/src/components/dropdown/config.ts +1 -1
  256. package/src/components/dropdown/index.tsx +37 -14
  257. package/src/components/empty/config.ts +38 -0
  258. package/src/components/empty/index.tsx +127 -0
  259. package/src/components/field/config.ts +40 -0
  260. package/src/components/field/index.tsx +252 -0
  261. package/src/components/hover-card/config.ts +27 -0
  262. package/src/components/hover-card/index.tsx +56 -0
  263. package/src/components/input/config.ts +1 -1
  264. package/src/components/input/index.tsx +13 -5
  265. package/src/components/input-group/index.tsx +33 -12
  266. package/src/components/item/config.ts +52 -0
  267. package/src/components/item/index.tsx +215 -0
  268. package/src/components/kbd/config.ts +38 -0
  269. package/src/components/kbd/index.tsx +40 -0
  270. package/src/components/label/config.ts +1 -1
  271. package/src/components/label/index.tsx +12 -4
  272. package/src/components/menubar/config.ts +28 -0
  273. package/src/components/menubar/index.tsx +295 -0
  274. package/src/components/native-select/config.ts +40 -0
  275. package/src/components/native-select/index.tsx +40 -0
  276. package/src/components/navigation-menu/config.ts +32 -0
  277. package/src/components/navigation-menu/index.tsx +188 -0
  278. package/src/components/popover/config.ts +1 -1
  279. package/src/components/popover/index.tsx +17 -5
  280. package/src/components/progress/config.ts +42 -0
  281. package/src/components/progress/index.tsx +39 -0
  282. package/src/components/radio-group/config.ts +1 -1
  283. package/src/components/radio-group/index.tsx +18 -5
  284. package/src/components/resizable/config.ts +28 -0
  285. package/src/components/resizable/index.tsx +67 -0
  286. package/src/components/scroll-area/index.tsx +17 -5
  287. package/src/components/select/config.ts +1 -1
  288. package/src/components/select/index.tsx +23 -6
  289. package/src/components/separator/config.ts +1 -1
  290. package/src/components/separator/index.tsx +14 -4
  291. package/src/components/sheet/index.tsx +21 -7
  292. package/src/components/skeleton/config.ts +1 -1
  293. package/src/components/skeleton/index.tsx +9 -0
  294. package/src/components/slider/config.ts +46 -0
  295. package/src/components/slider/index.tsx +73 -0
  296. package/src/components/sonner/config.ts +27 -0
  297. package/src/components/sonner/index.tsx +37 -0
  298. package/src/components/spinner/config.ts +40 -0
  299. package/src/components/spinner/index.tsx +30 -0
  300. package/src/components/switch/config.ts +1 -1
  301. package/src/components/switch/index.tsx +13 -4
  302. package/src/components/table/config.ts +38 -0
  303. package/src/components/table/index.tsx +135 -0
  304. package/src/components/tabs/config.ts +1 -1
  305. package/src/components/tabs/index.tsx +21 -5
  306. package/src/components/textarea/config.ts +1 -1
  307. package/src/components/textarea/index.tsx +11 -3
  308. package/src/components/toggle/index.tsx +20 -8
  309. package/src/components/toggle-group/config.ts +46 -0
  310. package/src/components/toggle-group/index.tsx +106 -0
  311. package/src/components/tooltip/index.tsx +19 -5
  312. package/src/components/typography/config.ts +38 -0
  313. package/src/components/typography/index.tsx +172 -0
  314. package/src/index.ts +239 -53
  315. package/tsup.config.ts +25 -0
  316. package/dist/chunk-FUWID6MC.js +0 -42
  317. package/dist/chunk-YTUI6MCB.js +0 -52
  318. package/eslint.config.js +0 -4
  319. package/dist/{chunk-VVNIYCKH.js → chunk-3TZXV53R.js} +1 -1
@@ -1,17 +1,25 @@
1
- import * as React from 'react';
2
-
3
1
  import { cn } from '@foundrykit/utils';
2
+ import * as React from 'react';
4
3
 
5
- export interface InputProps
6
- extends React.InputHTMLAttributes<HTMLInputElement> {}
4
+ export type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
7
5
 
6
+ /**
7
+ * Styled text input wrapping the native `<input>`; forwards its ref and accepts
8
+ * all standard input attributes (including `type`). Includes focus-ring and
9
+ * disabled styling.
10
+ *
11
+ * @example
12
+ * ```tsx
13
+ * <Input type="email" placeholder="you@example.com" />
14
+ * ```
15
+ */
8
16
  const Input = React.forwardRef<HTMLInputElement, InputProps>(
9
17
  ({ className, type, ...props }, ref) => {
10
18
  return (
11
19
  <input
12
20
  type={type}
13
21
  className={cn(
14
- 'border-input file:text-foreground placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 w-full rounded-md border bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50',
22
+ 'border-input file:text-foreground placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 w-full rounded-md border bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50',
15
23
  className
16
24
  )}
17
25
  ref={ref}
@@ -1,20 +1,32 @@
1
1
  'use client';
2
2
 
3
- import type * as React from 'react';
4
- import { cva, type VariantProps } from 'class-variance-authority';
5
-
3
+ import { Button, Input, Textarea } from '@foundrykit/primitives';
6
4
  import { cn } from '@foundrykit/utils';
7
- import { Button } from '@foundrykit/primitives';
8
- import { Input } from '@foundrykit/primitives';
9
- import { Textarea } from '@foundrykit/primitives';
5
+ import { cva, type VariantProps } from 'class-variance-authority';
6
+ import type * as React from 'react';
10
7
 
8
+ /**
9
+ * Container that groups a control with addons in a single bordered field,
10
+ * managing shared focus/invalid/disabled styling. Compose with
11
+ * {@link InputGroupInput} or {@link InputGroupTextarea} as the control and
12
+ * {@link InputGroupAddon} (holding {@link InputGroupText} or
13
+ * {@link InputGroupButton}) for leading/trailing content.
14
+ *
15
+ * @example
16
+ * ```tsx
17
+ * <InputGroup>
18
+ * <InputGroupAddon><SearchIcon /></InputGroupAddon>
19
+ * <InputGroupInput placeholder="Search" />
20
+ * </InputGroup>
21
+ * ```
22
+ */
11
23
  function InputGroup({ className, ...props }: React.ComponentProps<'div'>) {
12
24
  return (
13
25
  <div
14
26
  data-slot='input-group'
15
27
  role='group'
16
28
  className={cn(
17
- 'group/input-group border-input in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 relative flex h-8 w-full min-w-0 items-center rounded-lg border outline-none transition-colors has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-start]]:h-auto has-[>textarea]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5',
29
+ 'group/input-group border-input has-disabled:bg-input/50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 relative flex h-8 w-full min-w-0 items-center rounded-lg border transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:opacity-50 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-3 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5',
18
30
  className
19
31
  )}
20
32
  {...props}
@@ -23,7 +35,7 @@ function InputGroup({ className, ...props }: React.ComponentProps<'div'>) {
23
35
  }
24
36
 
25
37
  const inputGroupAddonVariants = cva(
26
- "flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",
38
+ "text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",
27
39
  {
28
40
  variants: {
29
41
  align: {
@@ -43,6 +55,11 @@ const inputGroupAddonVariants = cva(
43
55
  }
44
56
  );
45
57
 
58
+ /**
59
+ * Slot for icons, text or buttons alongside the control. The `align` variant
60
+ * (`inline-start`/`inline-end`/`block-start`/`block-end`) positions it; clicking
61
+ * empty addon space focuses the group's input.
62
+ */
46
63
  function InputGroupAddon({
47
64
  className,
48
65
  align = 'inline-start',
@@ -83,6 +100,10 @@ const inputGroupButtonVariants = cva(
83
100
  }
84
101
  );
85
102
 
103
+ /**
104
+ * {@link Button} preset for use inside an addon: defaults to `type="button"`,
105
+ * `variant="ghost"` and a compact `size` (`xs`, `sm`, `icon-xs`, `icon-sm`).
106
+ */
86
107
  function InputGroupButton({
87
108
  className,
88
109
  type = 'button',
@@ -106,7 +127,7 @@ function InputGroupText({ className, ...props }: React.ComponentProps<'span'>) {
106
127
  return (
107
128
  <span
108
129
  className={cn(
109
- "text-muted-foreground flex items-center gap-2 text-sm [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none",
130
+ "text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
110
131
  className
111
132
  )}
112
133
  {...props}
@@ -122,7 +143,7 @@ function InputGroupInput({
122
143
  <Input
123
144
  data-slot='input-group-control'
124
145
  className={cn(
125
- 'aria-invalid:ring-0 flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent dark:bg-transparent dark:disabled:bg-transparent',
146
+ 'flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent',
126
147
  className
127
148
  )}
128
149
  {...props}
@@ -138,7 +159,7 @@ function InputGroupTextarea({
138
159
  <Textarea
139
160
  data-slot='input-group-control'
140
161
  className={cn(
141
- 'aria-invalid:ring-0 flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent dark:bg-transparent dark:disabled:bg-transparent',
162
+ 'flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent',
142
163
  className
143
164
  )}
144
165
  {...props}
@@ -150,7 +171,7 @@ export {
150
171
  InputGroup,
151
172
  InputGroupAddon,
152
173
  InputGroupButton,
153
- InputGroupText,
154
174
  InputGroupInput,
175
+ InputGroupText,
155
176
  InputGroupTextarea,
156
177
  };
@@ -0,0 +1,52 @@
1
+ import type { ComponentConfig } from '@foundrykit/types';
2
+
3
+ export const ItemConfig: ComponentConfig = {
4
+ name: 'Item',
5
+ description:
6
+ 'A flexible row for lists of content with media, text and actions.',
7
+ category: 'primitives',
8
+ tags: ['item', 'list', 'layout'],
9
+ preview: {
10
+ type: 'static',
11
+ html: '<div class="flex h-12 w-full items-center gap-3 rounded-md border border-gray-300 bg-gray-100 px-3"><div class="h-6 w-6 rounded bg-gray-300"></div><div class="flex flex-col gap-1"><div class="h-2 w-20 rounded bg-gray-400"></div><div class="h-2 w-28 rounded bg-gray-300"></div></div></div>',
12
+ },
13
+ variants: [
14
+ {
15
+ name: 'Default',
16
+ description: 'Default item',
17
+ code: '<Item><ItemContent><ItemTitle>Title</ItemTitle></ItemContent></Item>',
18
+ preview: {
19
+ type: 'component',
20
+ component: 'Item',
21
+ props: {},
22
+ },
23
+ },
24
+ {
25
+ name: 'Outline',
26
+ description: 'Item with an outline border',
27
+ code: '<Item variant="outline">...</Item>',
28
+ preview: {
29
+ type: 'component',
30
+ component: 'Item',
31
+ props: {
32
+ variant: 'outline',
33
+ },
34
+ },
35
+ },
36
+ {
37
+ name: 'Muted',
38
+ description: 'Item with a muted background',
39
+ code: '<Item variant="muted">...</Item>',
40
+ preview: {
41
+ type: 'component',
42
+ component: 'Item',
43
+ props: {
44
+ variant: 'muted',
45
+ },
46
+ },
47
+ },
48
+ ],
49
+ dependencies: ['utils', 'separator'],
50
+ packageDependencies: ['@radix-ui/react-slot', 'class-variance-authority'],
51
+ files: ['components/primitives/item/index.tsx'],
52
+ };
@@ -0,0 +1,215 @@
1
+ import { cn } from '@foundrykit/utils';
2
+ import { Slot } from '@radix-ui/react-slot';
3
+ import { cva, type VariantProps } from 'class-variance-authority';
4
+ import type * as React from 'react';
5
+ import { Separator } from '../separator/index.js';
6
+
7
+ function ItemGroup({ className, ...props }: React.ComponentProps<'div'>) {
8
+ return (
9
+ <div
10
+ role='list'
11
+ data-slot='item-group'
12
+ className={cn('group/item-group flex flex-col', className)}
13
+ {...props}
14
+ />
15
+ );
16
+ }
17
+
18
+ function ItemSeparator({
19
+ className,
20
+ ...props
21
+ }: React.ComponentProps<typeof Separator>) {
22
+ return (
23
+ <Separator
24
+ data-slot='item-separator'
25
+ orientation='horizontal'
26
+ className={cn('my-0', className)}
27
+ {...props}
28
+ />
29
+ );
30
+ }
31
+
32
+ const itemVariants = cva(
33
+ 'group/item focus-visible:border-ring focus-visible:ring-ring/50 [a]:hover:bg-accent/50 flex flex-wrap items-center rounded-md border border-transparent text-sm transition-colors duration-100 outline-none focus-visible:ring-[3px] [a]:transition-colors',
34
+ {
35
+ variants: {
36
+ variant: {
37
+ default: 'bg-transparent',
38
+ outline: 'border-border',
39
+ muted: 'bg-muted/50',
40
+ },
41
+ size: {
42
+ default: 'gap-4 p-4',
43
+ sm: 'gap-2.5 px-4 py-3',
44
+ },
45
+ },
46
+ defaultVariants: {
47
+ variant: 'default',
48
+ size: 'default',
49
+ },
50
+ }
51
+ );
52
+
53
+ /**
54
+ * Flexible row for lists of content: a leading {@link ItemMedia}, a stacked
55
+ * {@link ItemContent} (with {@link ItemTitle}/{@link ItemDescription}) and
56
+ * trailing {@link ItemActions}. Styled via {@link itemVariants} with `variant`
57
+ * (default, outline, muted) and `size`; set `asChild` to render as a link.
58
+ *
59
+ * @example
60
+ * ```tsx
61
+ * <Item variant="outline">
62
+ * <ItemMedia variant="icon"><StarIcon /></ItemMedia>
63
+ * <ItemContent>
64
+ * <ItemTitle>Favorites</ItemTitle>
65
+ * <ItemDescription>Your starred items</ItemDescription>
66
+ * </ItemContent>
67
+ * <ItemActions><ChevronRightIcon /></ItemActions>
68
+ * </Item>
69
+ * ```
70
+ */
71
+ function Item({
72
+ className,
73
+ variant,
74
+ size,
75
+ asChild = false,
76
+ ...props
77
+ }: React.ComponentProps<'div'> &
78
+ VariantProps<typeof itemVariants> & {
79
+ asChild?: boolean;
80
+ }) {
81
+ const Comp = asChild ? Slot : 'div';
82
+ return (
83
+ <Comp
84
+ data-slot='item'
85
+ data-variant={variant}
86
+ data-size={size}
87
+ className={cn(itemVariants({ variant, size, className }))}
88
+ {...props}
89
+ />
90
+ );
91
+ }
92
+
93
+ const itemMediaVariants = cva(
94
+ 'flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:translate-y-0.5 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none',
95
+ {
96
+ variants: {
97
+ variant: {
98
+ default: 'bg-transparent',
99
+ icon: "bg-muted size-8 rounded-sm border [&_svg:not([class*='size-'])]:size-4",
100
+ image:
101
+ 'size-10 overflow-hidden rounded-sm [&_img]:size-full [&_img]:object-cover',
102
+ },
103
+ },
104
+ defaultVariants: {
105
+ variant: 'default',
106
+ },
107
+ }
108
+ );
109
+
110
+ /** Leading media slot for icons (`variant="icon"`), images (`variant="image"`) or arbitrary content. */
111
+ function ItemMedia({
112
+ className,
113
+ variant,
114
+ ...props
115
+ }: React.ComponentProps<'div'> & VariantProps<typeof itemMediaVariants>) {
116
+ return (
117
+ <div
118
+ data-slot='item-media'
119
+ data-variant={variant}
120
+ className={cn(itemMediaVariants({ variant, className }))}
121
+ {...props}
122
+ />
123
+ );
124
+ }
125
+
126
+ function ItemContent({ className, ...props }: React.ComponentProps<'div'>) {
127
+ return (
128
+ <div
129
+ data-slot='item-content'
130
+ className={cn(
131
+ 'flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none',
132
+ className
133
+ )}
134
+ {...props}
135
+ />
136
+ );
137
+ }
138
+
139
+ function ItemTitle({ className, ...props }: React.ComponentProps<'div'>) {
140
+ return (
141
+ <div
142
+ data-slot='item-title'
143
+ className={cn(
144
+ 'flex w-fit items-center gap-2 text-sm leading-snug font-medium',
145
+ className
146
+ )}
147
+ {...props}
148
+ />
149
+ );
150
+ }
151
+
152
+ function ItemDescription({ className, ...props }: React.ComponentProps<'p'>) {
153
+ return (
154
+ <p
155
+ data-slot='item-description'
156
+ className={cn(
157
+ 'text-muted-foreground line-clamp-2 text-sm leading-normal font-normal text-balance',
158
+ '[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',
159
+ className
160
+ )}
161
+ {...props}
162
+ />
163
+ );
164
+ }
165
+
166
+ function ItemActions({ className, ...props }: React.ComponentProps<'div'>) {
167
+ return (
168
+ <div
169
+ data-slot='item-actions'
170
+ className={cn('flex items-center gap-2', className)}
171
+ {...props}
172
+ />
173
+ );
174
+ }
175
+
176
+ function ItemHeader({ className, ...props }: React.ComponentProps<'div'>) {
177
+ return (
178
+ <div
179
+ data-slot='item-header'
180
+ className={cn(
181
+ 'flex basis-full items-center justify-between gap-2',
182
+ className
183
+ )}
184
+ {...props}
185
+ />
186
+ );
187
+ }
188
+
189
+ function ItemFooter({ className, ...props }: React.ComponentProps<'div'>) {
190
+ return (
191
+ <div
192
+ data-slot='item-footer'
193
+ className={cn(
194
+ 'flex basis-full items-center justify-between gap-2',
195
+ className
196
+ )}
197
+ {...props}
198
+ />
199
+ );
200
+ }
201
+
202
+ export {
203
+ Item,
204
+ ItemActions,
205
+ ItemContent,
206
+ ItemDescription,
207
+ ItemFooter,
208
+ ItemGroup,
209
+ ItemHeader,
210
+ ItemMedia,
211
+ ItemSeparator,
212
+ ItemTitle,
213
+ itemMediaVariants,
214
+ itemVariants,
215
+ };
@@ -0,0 +1,38 @@
1
+ import type { ComponentConfig } from '@foundrykit/types';
2
+
3
+ export const KbdConfig: ComponentConfig = {
4
+ name: 'Kbd',
5
+ description:
6
+ 'Displays keyboard keys and shortcuts, groupable into full key combinations.',
7
+ category: 'primitives',
8
+ tags: ['kbd', 'keyboard', 'shortcut'],
9
+ preview: {
10
+ type: 'static',
11
+ html: '<div class="flex h-12 w-full items-center justify-center gap-1 rounded-md border border-gray-300 bg-gray-100"><span class="inline-flex h-5 min-w-5 items-center justify-center rounded-sm bg-gray-300 px-1 text-xs text-gray-600">⌘</span><span class="inline-flex h-5 min-w-5 items-center justify-center rounded-sm bg-gray-300 px-1 text-xs text-gray-600">K</span></div>',
12
+ },
13
+ variants: [
14
+ {
15
+ name: 'Default',
16
+ description: 'Default keyboard key',
17
+ code: '<Kbd>⌘</Kbd>',
18
+ preview: {
19
+ type: 'component',
20
+ component: 'Kbd',
21
+ props: {},
22
+ },
23
+ },
24
+ {
25
+ name: 'Group',
26
+ description: 'A group of keys forming a shortcut',
27
+ code: '<KbdGroup><Kbd>⌘</Kbd><Kbd>K</Kbd></KbdGroup>',
28
+ preview: {
29
+ type: 'component',
30
+ component: 'Kbd',
31
+ props: {},
32
+ },
33
+ },
34
+ ],
35
+ dependencies: ['utils'],
36
+ packageDependencies: [],
37
+ files: ['components/primitives/kbd/index.tsx'],
38
+ };
@@ -0,0 +1,40 @@
1
+ import { cn } from '@foundrykit/utils';
2
+ import type * as React from 'react';
3
+
4
+ /**
5
+ * Renders a keyboard key or shortcut token. Group several keys together with
6
+ * {@link KbdGroup} to display a full key combination.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * <KbdGroup>
11
+ * <Kbd>⌘</Kbd>
12
+ * <Kbd>K</Kbd>
13
+ * </KbdGroup>
14
+ * ```
15
+ */
16
+ function Kbd({ className, ...props }: React.ComponentProps<'kbd'>) {
17
+ return (
18
+ <kbd
19
+ data-slot='kbd'
20
+ className={cn(
21
+ "bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none [&_svg:not([class*='size-'])]:size-3",
22
+ '[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10',
23
+ className
24
+ )}
25
+ {...props}
26
+ />
27
+ );
28
+ }
29
+
30
+ function KbdGroup({ className, ...props }: React.ComponentProps<'kbd'>) {
31
+ return (
32
+ <kbd
33
+ data-slot='kbd-group'
34
+ className={cn('inline-flex items-center gap-1', className)}
35
+ {...props}
36
+ />
37
+ );
38
+ }
39
+
40
+ export { Kbd, KbdGroup };
@@ -1,4 +1,4 @@
1
- import { ComponentConfig } from '@foundrykit/types';
1
+ import type { ComponentConfig } from '@foundrykit/types';
2
2
 
3
3
  export const labelConfig: ComponentConfig = {
4
4
  name: 'Label',
@@ -1,10 +1,18 @@
1
1
  'use client';
2
2
 
3
- import * as React from 'react';
4
- import * as LabelPrimitive from '@radix-ui/react-label';
5
-
6
3
  import { cn } from '@foundrykit/utils';
4
+ import * as LabelPrimitive from '@radix-ui/react-label';
5
+ import type * as React from 'react';
7
6
 
7
+ /**
8
+ * Form label built on Radix `Label.Root`. Associate it with a control via
9
+ * `htmlFor`; automatically dims when a peer or group is disabled.
10
+ *
11
+ * @example
12
+ * ```tsx
13
+ * <Label htmlFor="email">Email</Label>
14
+ * ```
15
+ */
8
16
  function Label({
9
17
  className,
10
18
  ...props
@@ -13,7 +21,7 @@ function Label({
13
21
  <LabelPrimitive.Root
14
22
  data-slot='label'
15
23
  className={cn(
16
- 'flex select-none items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50 group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50',
24
+ 'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',
17
25
  className
18
26
  )}
19
27
  {...props}
@@ -0,0 +1,28 @@
1
+ import type { ComponentConfig } from '@foundrykit/types';
2
+
3
+ export const MenubarConfig: ComponentConfig = {
4
+ name: 'Menubar',
5
+ description:
6
+ 'A horizontal menu bar with a set of dropdown menus, commonly used for application-level navigation.',
7
+ category: 'primitives',
8
+ tags: ['menubar', 'menu', 'navigation'],
9
+ preview: {
10
+ type: 'static',
11
+ html: '<div class="flex h-9 w-full items-center gap-1 rounded-md border border-gray-300 bg-gray-100 px-1"><span class="rounded-sm px-2 py-1 text-sm text-gray-600">File</span><span class="rounded-sm px-2 py-1 text-sm text-gray-600">Edit</span><span class="rounded-sm px-2 py-1 text-sm text-gray-600">View</span></div>',
12
+ },
13
+ variants: [
14
+ {
15
+ name: 'Default',
16
+ description: 'Default menubar',
17
+ code: '<Menubar><MenubarMenu><MenubarTrigger>File</MenubarTrigger></MenubarMenu></Menubar>',
18
+ preview: {
19
+ type: 'component',
20
+ component: 'Menubar',
21
+ props: {},
22
+ },
23
+ },
24
+ ],
25
+ dependencies: ['utils'],
26
+ packageDependencies: ['@radix-ui/react-menubar', 'lucide-react'],
27
+ files: ['components/primitives/menubar/index.tsx'],
28
+ };