@foundrykit/primitives 2.0.8 → 2.0.10

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 (175) hide show
  1. package/dist/{chunk-D4X2ZO5T.js → chunk-2SBGU5XA.js} +2 -2
  2. package/dist/chunk-3NQR7JZR.js +128 -0
  3. package/dist/{chunk-3MEIDBWZ.js → chunk-3QUMCM5K.js} +2 -2
  4. package/dist/chunk-B5YCE3UP.js +57 -0
  5. package/dist/chunk-F2TEA6ER.js +138 -0
  6. package/dist/{chunk-5OSYIETI.js → chunk-FRIOQFPE.js} +1 -1
  7. package/dist/{chunk-EDKSYP4L.js → chunk-G2YBCHWR.js} +1 -1
  8. package/dist/{chunk-DKBMAFIR.js → chunk-GKCBSG2W.js} +2 -0
  9. package/dist/chunk-HS46TIMU.js +75 -0
  10. package/dist/{chunk-R3IEOV2B.js → chunk-P5KEJOBH.js} +1 -1
  11. package/dist/{chunk-FIRYLO5W.js → chunk-SDYKJVXX.js} +2 -2
  12. package/dist/chunk-SIQHWNPH.js +45 -0
  13. package/dist/{chunk-2PXD7LAX.js → chunk-U7JIOR7A.js} +3 -3
  14. package/dist/{chunk-VA4MKQN7.js → chunk-W4XY3SNY.js} +1 -1
  15. package/dist/chunk-XCPGTXEJ.js +23 -0
  16. package/dist/components/alert-dialog/index.cjs +1 -1
  17. package/dist/components/alert-dialog/index.js +1 -1
  18. package/dist/components/card/index.cjs +63 -61
  19. package/dist/components/card/index.d.cts +8 -7
  20. package/dist/components/card/index.d.ts +8 -7
  21. package/dist/components/card/index.js +1 -1
  22. package/dist/components/context-menu/index.cjs +2 -2
  23. package/dist/components/context-menu/index.js +1 -1
  24. package/dist/components/dialog/index.cjs +182 -0
  25. package/dist/components/dialog/index.d.cts +38 -0
  26. package/dist/components/dialog/index.d.ts +38 -0
  27. package/dist/components/dialog/index.js +25 -0
  28. package/dist/components/dropdown/index.cjs +2 -2
  29. package/dist/components/dropdown/index.js +1 -1
  30. package/dist/components/hover-card/index.cjs +1 -1
  31. package/dist/components/hover-card/index.js +1 -1
  32. package/dist/components/input/index.cjs +16 -28
  33. package/dist/components/input/index.d.cts +6 -5
  34. package/dist/components/input/index.d.ts +6 -5
  35. package/dist/components/input/index.js +1 -1
  36. package/dist/components/input-group/index.cjs +270 -0
  37. package/dist/components/input-group/index.d.cts +44 -0
  38. package/dist/components/input-group/index.d.ts +44 -0
  39. package/dist/components/input-group/index.js +153 -0
  40. package/dist/components/menubar/index.cjs +2 -2
  41. package/dist/components/menubar/index.js +1 -1
  42. package/dist/components/navigation-menu/index.cjs +3 -3
  43. package/dist/components/navigation-menu/index.js +1 -1
  44. package/dist/components/popover/index.cjs +1 -1
  45. package/dist/components/popover/index.js +1 -1
  46. package/dist/components/select/index.cjs +1 -1
  47. package/dist/components/select/index.js +1 -1
  48. package/dist/components/sheet/index.cjs +170 -0
  49. package/dist/components/sheet/index.d.cts +31 -0
  50. package/dist/components/sheet/index.d.ts +31 -0
  51. package/dist/components/sheet/index.js +21 -0
  52. package/dist/components/slider/index.cjs +2 -0
  53. package/dist/components/slider/index.d.cts +3 -2
  54. package/dist/components/slider/index.d.ts +3 -2
  55. package/dist/components/slider/index.js +1 -1
  56. package/dist/components/toggle/index.cjs +81 -0
  57. package/dist/components/toggle/index.d.cts +26 -0
  58. package/dist/components/toggle/index.d.ts +26 -0
  59. package/dist/components/toggle/index.js +9 -0
  60. package/dist/components/tooltip/index.cjs +95 -0
  61. package/dist/components/tooltip/index.d.cts +25 -0
  62. package/dist/components/tooltip/index.d.ts +25 -0
  63. package/dist/components/tooltip/index.js +13 -0
  64. package/dist/index.cjs +107 -95
  65. package/dist/index.d.cts +11 -105
  66. package/dist/index.d.ts +11 -105
  67. package/dist/index.js +108 -414
  68. package/package.json +200 -8
  69. package/.turbo/turbo-build.log +0 -235
  70. package/.turbo/turbo-type-check.log +0 -4
  71. package/CHANGELOG.md +0 -224
  72. package/dist/chunk-DFGLEAZI.js +0 -63
  73. package/dist/chunk-RDQF3IQE.js +0 -25
  74. package/postcss.config.mjs +0 -6
  75. package/registry.json +0 -64
  76. package/src/components/accordion/config.ts +0 -28
  77. package/src/components/accordion/index.tsx +0 -80
  78. package/src/components/alert/config.ts +0 -40
  79. package/src/components/alert/index.tsx +0 -80
  80. package/src/components/alert-dialog/config.ts +0 -28
  81. package/src/components/alert-dialog/index.tsx +0 -188
  82. package/src/components/aspect-ratio/config.ts +0 -27
  83. package/src/components/aspect-ratio/index.tsx +0 -24
  84. package/src/components/avatar/config.ts +0 -46
  85. package/src/components/avatar/index.tsx +0 -67
  86. package/src/components/badge/config.ts +0 -56
  87. package/src/components/badge/index.tsx +0 -56
  88. package/src/components/breadcrumb/config.ts +0 -121
  89. package/src/components/breadcrumb/index.tsx +0 -127
  90. package/src/components/button/config.ts +0 -97
  91. package/src/components/button/index.tsx +0 -86
  92. package/src/components/button-group/config.ts +0 -39
  93. package/src/components/button-group/index.tsx +0 -99
  94. package/src/components/card/config.ts +0 -89
  95. package/src/components/card/index.tsx +0 -98
  96. package/src/components/checkbox/config.ts +0 -46
  97. package/src/components/checkbox/index.tsx +0 -41
  98. package/src/components/collapsible/config.ts +0 -27
  99. package/src/components/collapsible/index.tsx +0 -47
  100. package/src/components/context-menu/config.ts +0 -28
  101. package/src/components/context-menu/index.tsx +0 -271
  102. package/src/components/dialog/config.ts +0 -582
  103. package/src/components/dialog/index.tsx +0 -162
  104. package/src/components/direction/config.ts +0 -28
  105. package/src/components/direction/index.tsx +0 -27
  106. package/src/components/drawer/config.ts +0 -28
  107. package/src/components/drawer/index.tsx +0 -153
  108. package/src/components/dropdown/config.ts +0 -262
  109. package/src/components/dropdown/index.tsx +0 -280
  110. package/src/components/empty/config.ts +0 -38
  111. package/src/components/empty/index.tsx +0 -127
  112. package/src/components/field/config.ts +0 -40
  113. package/src/components/field/index.tsx +0 -252
  114. package/src/components/hover-card/config.ts +0 -27
  115. package/src/components/hover-card/index.tsx +0 -56
  116. package/src/components/input/config.ts +0 -64
  117. package/src/components/input/index.tsx +0 -33
  118. package/src/components/input-group/config.ts +0 -209
  119. package/src/components/input-group/index.tsx +0 -177
  120. package/src/components/item/config.ts +0 -52
  121. package/src/components/item/index.tsx +0 -215
  122. package/src/components/kbd/config.ts +0 -38
  123. package/src/components/kbd/index.tsx +0 -40
  124. package/src/components/label/config.ts +0 -72
  125. package/src/components/label/index.tsx +0 -32
  126. package/src/components/menubar/config.ts +0 -28
  127. package/src/components/menubar/index.tsx +0 -295
  128. package/src/components/native-select/config.ts +0 -40
  129. package/src/components/native-select/index.tsx +0 -40
  130. package/src/components/navigation-menu/config.ts +0 -32
  131. package/src/components/navigation-menu/index.tsx +0 -188
  132. package/src/components/popover/config.ts +0 -222
  133. package/src/components/popover/index.tsx +0 -60
  134. package/src/components/progress/config.ts +0 -42
  135. package/src/components/progress/index.tsx +0 -39
  136. package/src/components/radio-group/config.ts +0 -303
  137. package/src/components/radio-group/index.tsx +0 -58
  138. package/src/components/resizable/config.ts +0 -28
  139. package/src/components/resizable/index.tsx +0 -67
  140. package/src/components/scroll-area/config.ts +0 -17
  141. package/src/components/scroll-area/index.tsx +0 -70
  142. package/src/components/select/config.ts +0 -277
  143. package/src/components/select/index.tsx +0 -202
  144. package/src/components/separator/config.ts +0 -63
  145. package/src/components/separator/index.tsx +0 -38
  146. package/src/components/sheet/config.ts +0 -16
  147. package/src/components/sheet/index.tsx +0 -153
  148. package/src/components/skeleton/config.ts +0 -77
  149. package/src/components/skeleton/index.tsx +0 -22
  150. package/src/components/slider/config.ts +0 -46
  151. package/src/components/slider/index.tsx +0 -73
  152. package/src/components/sonner/config.ts +0 -27
  153. package/src/components/sonner/index.tsx +0 -37
  154. package/src/components/spinner/config.ts +0 -40
  155. package/src/components/spinner/index.tsx +0 -30
  156. package/src/components/switch/config.ts +0 -171
  157. package/src/components/switch/index.tsx +0 -40
  158. package/src/components/table/config.ts +0 -38
  159. package/src/components/table/index.tsx +0 -135
  160. package/src/components/tabs/config.ts +0 -335
  161. package/src/components/tabs/index.tsx +0 -82
  162. package/src/components/textarea/config.ts +0 -117
  163. package/src/components/textarea/index.tsx +0 -26
  164. package/src/components/toggle/config.ts +0 -67
  165. package/src/components/toggle/index.tsx +0 -59
  166. package/src/components/toggle-group/config.ts +0 -46
  167. package/src/components/toggle-group/index.tsx +0 -106
  168. package/src/components/tooltip/config.ts +0 -16
  169. package/src/components/tooltip/index.tsx +0 -75
  170. package/src/components/typography/config.ts +0 -38
  171. package/src/components/typography/index.tsx +0 -172
  172. package/src/index.ts +0 -291
  173. package/tsconfig.json +0 -9
  174. package/tsconfig.lint.json +0 -8
  175. package/tsup.config.ts +0 -55
@@ -1,188 +0,0 @@
1
- 'use client';
2
-
3
- import { cn } from '@foundrykit/utils';
4
- import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
5
- import type * as React from 'react';
6
-
7
- /**
8
- * Modal confirmation dialog built on Radix `AlertDialog.Root` that interrupts
9
- * the user with important content and expects a response. Compose with
10
- * {@link AlertDialogTrigger}, {@link AlertDialogContent},
11
- * {@link AlertDialogHeader}, {@link AlertDialogFooter},
12
- * {@link AlertDialogTitle}, {@link AlertDialogDescription},
13
- * {@link AlertDialogAction} and {@link AlertDialogCancel}.
14
- *
15
- * @example
16
- * ```tsx
17
- * <AlertDialog>
18
- * <AlertDialogTrigger>Delete</AlertDialogTrigger>
19
- * <AlertDialogContent>
20
- * <AlertDialogHeader>
21
- * <AlertDialogTitle>Are you sure?</AlertDialogTitle>
22
- * <AlertDialogDescription>This cannot be undone.</AlertDialogDescription>
23
- * </AlertDialogHeader>
24
- * <AlertDialogFooter>
25
- * <AlertDialogCancel>Cancel</AlertDialogCancel>
26
- * <AlertDialogAction>Continue</AlertDialogAction>
27
- * </AlertDialogFooter>
28
- * </AlertDialogContent>
29
- * </AlertDialog>
30
- * ```
31
- */
32
- function AlertDialog({
33
- ...props
34
- }: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
35
- return <AlertDialogPrimitive.Root data-slot='alert-dialog' {...props} />;
36
- }
37
-
38
- function AlertDialogTrigger({
39
- ...props
40
- }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {
41
- return (
42
- <AlertDialogPrimitive.Trigger data-slot='alert-dialog-trigger' {...props} />
43
- );
44
- }
45
-
46
- function AlertDialogPortal({
47
- ...props
48
- }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
49
- return (
50
- <AlertDialogPrimitive.Portal data-slot='alert-dialog-portal' {...props} />
51
- );
52
- }
53
-
54
- function AlertDialogOverlay({
55
- className,
56
- ...props
57
- }: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {
58
- return (
59
- <AlertDialogPrimitive.Overlay
60
- data-slot='alert-dialog-overlay'
61
- className={cn(
62
- 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',
63
- className
64
- )}
65
- {...props}
66
- />
67
- );
68
- }
69
-
70
- function AlertDialogContent({
71
- className,
72
- ...props
73
- }: React.ComponentProps<typeof AlertDialogPrimitive.Content>) {
74
- return (
75
- <AlertDialogPortal>
76
- <AlertDialogOverlay />
77
- <AlertDialogPrimitive.Content
78
- data-slot='alert-dialog-content'
79
- className={cn(
80
- 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg',
81
- className
82
- )}
83
- {...props}
84
- />
85
- </AlertDialogPortal>
86
- );
87
- }
88
-
89
- function AlertDialogHeader({
90
- className,
91
- ...props
92
- }: React.ComponentProps<'div'>) {
93
- return (
94
- <div
95
- data-slot='alert-dialog-header'
96
- className={cn('flex flex-col gap-2 text-center sm:text-left', className)}
97
- {...props}
98
- />
99
- );
100
- }
101
-
102
- function AlertDialogFooter({
103
- className,
104
- ...props
105
- }: React.ComponentProps<'div'>) {
106
- return (
107
- <div
108
- data-slot='alert-dialog-footer'
109
- className={cn(
110
- 'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',
111
- className
112
- )}
113
- {...props}
114
- />
115
- );
116
- }
117
-
118
- function AlertDialogTitle({
119
- className,
120
- ...props
121
- }: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
122
- return (
123
- <AlertDialogPrimitive.Title
124
- data-slot='alert-dialog-title'
125
- className={cn('text-lg font-semibold', className)}
126
- {...props}
127
- />
128
- );
129
- }
130
-
131
- function AlertDialogDescription({
132
- className,
133
- ...props
134
- }: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
135
- return (
136
- <AlertDialogPrimitive.Description
137
- data-slot='alert-dialog-description'
138
- className={cn('text-muted-foreground text-sm', className)}
139
- {...props}
140
- />
141
- );
142
- }
143
-
144
- function AlertDialogAction({
145
- className,
146
- ...props
147
- }: React.ComponentProps<typeof AlertDialogPrimitive.Action>) {
148
- return (
149
- <AlertDialogPrimitive.Action
150
- data-slot='alert-dialog-action'
151
- className={cn(
152
- "bg-primary text-primary-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:bg-primary/90 inline-flex h-9 shrink-0 items-center justify-center gap-2 rounded-md px-4 py-2 text-sm font-medium whitespace-nowrap shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 has-[>svg]:px-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
153
- className
154
- )}
155
- {...props}
156
- />
157
- );
158
- }
159
-
160
- function AlertDialogCancel({
161
- className,
162
- ...props
163
- }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>) {
164
- return (
165
- <AlertDialogPrimitive.Cancel
166
- data-slot='alert-dialog-cancel'
167
- className={cn(
168
- "bg-background focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:border-input dark:hover:bg-input/50 hover:bg-accent hover:text-accent-foreground inline-flex h-9 shrink-0 items-center justify-center gap-2 rounded-md border px-4 py-2 text-sm font-medium whitespace-nowrap shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 has-[>svg]:px-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
169
- className
170
- )}
171
- {...props}
172
- />
173
- );
174
- }
175
-
176
- export {
177
- AlertDialog,
178
- AlertDialogAction,
179
- AlertDialogCancel,
180
- AlertDialogContent,
181
- AlertDialogDescription,
182
- AlertDialogFooter,
183
- AlertDialogHeader,
184
- AlertDialogOverlay,
185
- AlertDialogPortal,
186
- AlertDialogTitle,
187
- AlertDialogTrigger,
188
- };
@@ -1,27 +0,0 @@
1
- import type { ComponentConfig } from '@foundrykit/types';
2
-
3
- export const AspectRatioConfig: ComponentConfig = {
4
- name: 'Aspect Ratio',
5
- description: 'Constrains content to a desired width-to-height ratio.',
6
- category: 'primitives',
7
- tags: ['aspect-ratio', 'media', 'layout'],
8
- preview: {
9
- type: 'static',
10
- html: '<div class="flex h-12 w-full items-center rounded-md border border-gray-300 bg-gray-100 px-3"><span class="text-sm text-gray-600">Aspect Ratio</span></div>',
11
- },
12
- variants: [
13
- {
14
- name: 'Default',
15
- description: 'Sixteen-by-nine aspect ratio',
16
- code: '<AspectRatio ratio={16 / 9}>...</AspectRatio>',
17
- preview: {
18
- type: 'component',
19
- component: 'AspectRatio',
20
- props: {},
21
- },
22
- },
23
- ],
24
- dependencies: ['utils'],
25
- packageDependencies: ['@radix-ui/react-aspect-ratio'],
26
- files: ['components/primitives/aspect-ratio/index.tsx'],
27
- };
@@ -1,24 +0,0 @@
1
- 'use client';
2
-
3
- import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
4
- import type * as React from 'react';
5
-
6
- /**
7
- * Constrains its content to a given width-to-height `ratio`, built on Radix
8
- * `AspectRatio.Root`. Handy for images, video embeds and media placeholders
9
- * that must keep a consistent shape as they scale.
10
- *
11
- * @example
12
- * ```tsx
13
- * <AspectRatio ratio={16 / 9}>
14
- * <img src="/cover.jpg" alt="Cover" className="h-full w-full object-cover" />
15
- * </AspectRatio>
16
- * ```
17
- */
18
- function AspectRatio({
19
- ...props
20
- }: React.ComponentProps<typeof AspectRatioPrimitive.Root>) {
21
- return <AspectRatioPrimitive.Root data-slot='aspect-ratio' {...props} />;
22
- }
23
-
24
- export { AspectRatio };
@@ -1,46 +0,0 @@
1
- import type { ComponentConfig } from '@foundrykit/types';
2
-
3
- export const avatarConfig: ComponentConfig = {
4
- name: 'Avatar',
5
- description: 'User avatar component with image fallback and initials',
6
- category: 'primitives',
7
- tags: ['user', 'profile', 'image'],
8
- preview: {
9
- type: 'static',
10
- html: '<div class="flex h-12 w-full items-center justify-center rounded-md bg-gray-200"><div class="flex h-8 w-8 items-center justify-center rounded-full bg-gray-300"><div class="h-4 w-4 rounded-full bg-gray-600"></div></div></div>',
11
- },
12
- variants: [
13
- {
14
- name: 'Default',
15
- description: 'Default avatar with fallback',
16
- code: '<Avatar>JD</Avatar>',
17
- preview: {
18
- type: 'component',
19
- component: 'Avatar',
20
- props: { children: 'JD' },
21
- },
22
- },
23
- {
24
- name: 'With Image',
25
- description: 'Avatar with user image',
26
- code: '<Avatar src="/user.jpg" alt="User" />',
27
- preview: {
28
- type: 'component',
29
- component: 'Avatar',
30
- props: { src: '/user.jpg', alt: 'User' },
31
- },
32
- },
33
- {
34
- name: 'Large',
35
- description: 'Large avatar size',
36
- code: '<Avatar size="lg">JD</Avatar>',
37
- preview: {
38
- type: 'component',
39
- component: 'Avatar',
40
- props: { size: 'lg', children: 'JD' },
41
- },
42
- },
43
- ],
44
- dependencies: ['utils'],
45
- files: ['components/primitives/avatar/index.tsx'],
46
- };
@@ -1,67 +0,0 @@
1
- 'use client';
2
-
3
- import { cn } from '@foundrykit/utils';
4
- import * as AvatarPrimitive from '@radix-ui/react-avatar';
5
- import type * as React from 'react';
6
-
7
- /**
8
- * Circular avatar container built on Radix `Avatar.Root`. Compose with
9
- * {@link AvatarImage} and {@link AvatarFallback}; the fallback shows while the
10
- * image is loading or unavailable. Defaults to a `size-8` rounded shape.
11
- *
12
- * @example
13
- * ```tsx
14
- * <Avatar>
15
- * <AvatarImage src="/user.png" alt="Jane" />
16
- * <AvatarFallback>JD</AvatarFallback>
17
- * </Avatar>
18
- * ```
19
- */
20
- function Avatar({
21
- className,
22
- ...props
23
- }: React.ComponentProps<typeof AvatarPrimitive.Root>) {
24
- return (
25
- <AvatarPrimitive.Root
26
- data-slot='avatar'
27
- className={cn(
28
- 'relative flex size-8 shrink-0 overflow-hidden rounded-full',
29
- className
30
- )}
31
- {...props}
32
- />
33
- );
34
- }
35
-
36
- /** Image element (Radix `Avatar.Image`) rendered inside an {@link Avatar}. */
37
- function AvatarImage({
38
- className,
39
- ...props
40
- }: React.ComponentProps<typeof AvatarPrimitive.Image>) {
41
- return (
42
- <AvatarPrimitive.Image
43
- data-slot='avatar-image'
44
- className={cn('aspect-square size-full', className)}
45
- {...props}
46
- />
47
- );
48
- }
49
-
50
- /** Fallback (Radix `Avatar.Fallback`) shown when the image cannot be displayed. */
51
- function AvatarFallback({
52
- className,
53
- ...props
54
- }: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {
55
- return (
56
- <AvatarPrimitive.Fallback
57
- data-slot='avatar-fallback'
58
- className={cn(
59
- 'bg-muted flex size-full items-center justify-center rounded-full',
60
- className
61
- )}
62
- {...props}
63
- />
64
- );
65
- }
66
-
67
- export { Avatar, AvatarFallback, AvatarImage };
@@ -1,56 +0,0 @@
1
- import type { ComponentConfig } from '@foundrykit/types';
2
-
3
- export const badgeConfig: ComponentConfig = {
4
- name: 'Badge',
5
- description: 'Small status indicators and labels',
6
- category: 'primitives',
7
- tags: ['status', 'label', 'indicator'],
8
- preview: {
9
- type: 'static',
10
- html: '<div class="flex h-12 w-full items-center justify-center rounded-md bg-gray-200"><div class="flex h-6 w-16 items-center justify-center rounded-full bg-gray-300"><div class="mr-1 h-2 w-2 rounded-full bg-gray-600"></div><div class="h-1 w-6 rounded bg-gray-600"></div></div></div>',
11
- },
12
- variants: [
13
- {
14
- name: 'Default',
15
- description: 'Default badge styling',
16
- code: '<Badge>Default</Badge>',
17
- preview: {
18
- type: 'component',
19
- component: 'Badge',
20
- props: { children: 'Default' },
21
- },
22
- },
23
- {
24
- name: 'Secondary',
25
- description: 'Secondary badge variant',
26
- code: '<Badge variant="secondary">Secondary</Badge>',
27
- preview: {
28
- type: 'component',
29
- component: 'Badge',
30
- props: { variant: 'secondary', children: 'Secondary' },
31
- },
32
- },
33
- {
34
- name: 'Destructive',
35
- description: 'Destructive badge variant',
36
- code: '<Badge variant="destructive">Error</Badge>',
37
- preview: {
38
- type: 'component',
39
- component: 'Badge',
40
- props: { variant: 'destructive', children: 'Error' },
41
- },
42
- },
43
- {
44
- name: 'Outline',
45
- description: 'Outline badge variant',
46
- code: '<Badge variant="outline">Outline</Badge>',
47
- preview: {
48
- type: 'component',
49
- component: 'Badge',
50
- props: { variant: 'outline', children: 'Outline' },
51
- },
52
- },
53
- ],
54
- dependencies: ['utils'],
55
- files: ['components/primitives/badge/index.tsx'],
56
- };
@@ -1,56 +0,0 @@
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
-
6
- const badgeVariants = cva(
7
- 'focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-md border px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] [&>svg]:pointer-events-none [&>svg]:size-3',
8
- {
9
- variants: {
10
- variant: {
11
- default:
12
- 'bg-primary text-primary-foreground [a&]:hover:bg-primary/90 border-transparent',
13
- secondary:
14
- 'bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90 border-transparent',
15
- destructive:
16
- 'bg-destructive [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 border-transparent text-white',
17
- outline:
18
- 'text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',
19
- },
20
- },
21
- defaultVariants: {
22
- variant: 'default',
23
- },
24
- }
25
- );
26
-
27
- /**
28
- * Small inline label/status indicator styled via {@link badgeVariants} with a
29
- * `variant` (default, secondary, destructive, outline). Renders a `<span>` by
30
- * default; pass `asChild` to render another element (e.g. a link) via Radix
31
- * `Slot` while keeping the badge styling.
32
- *
33
- * @example
34
- * ```tsx
35
- * <Badge variant="secondary">Beta</Badge>
36
- * ```
37
- */
38
- function Badge({
39
- className,
40
- variant,
41
- asChild = false,
42
- ...props
43
- }: React.ComponentProps<'span'> &
44
- VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
45
- const Comp = asChild ? Slot : 'span';
46
-
47
- return (
48
- <Comp
49
- data-slot='badge'
50
- className={cn(badgeVariants({ variant }), className)}
51
- {...props}
52
- />
53
- );
54
- }
55
-
56
- export { Badge, badgeVariants };
@@ -1,121 +0,0 @@
1
- import type { ComponentConfig } from '@foundrykit/types';
2
-
3
- export const breadcrumbConfig: ComponentConfig = {
4
- name: 'Breadcrumb',
5
- description: 'Navigation breadcrumb component',
6
- category: 'primitives',
7
- tags: ['navigation', 'breadcrumb', 'menu'],
8
- preview: {
9
- type: 'static',
10
- html: '<div class="flex h-12 w-full items-center justify-center rounded-md bg-gray-200"><div class="flex items-center space-x-1"><div class="h-3 w-3 rounded bg-gray-400"></div><div class="h-2 w-2 rotate-45 bg-gray-300"></div><div class="h-1 w-8 rounded bg-gray-400"></div><div class="h-2 w-2 rotate-45 bg-gray-300"></div><div class="h-1 w-6 rounded bg-gray-400"></div></div></div>',
11
- },
12
- variants: [
13
- {
14
- name: 'Default',
15
- description: 'Default breadcrumb navigation',
16
- code: '<Breadcrumb items={[{ label: "Home", href: "/" }, { label: "Products", href: "/products" }, { label: "Current" }]} />',
17
- preview: {
18
- type: 'component',
19
- component: 'Breadcrumb',
20
- props: {
21
- children: {
22
- component: 'BreadcrumbList',
23
- props: {
24
- children: [
25
- {
26
- component: 'BreadcrumbItem',
27
- props: {
28
- children: {
29
- component: 'BreadcrumbLink',
30
- props: { href: '/', children: 'Home' },
31
- },
32
- },
33
- },
34
- {
35
- component: 'BreadcrumbSeparator',
36
- props: {},
37
- },
38
- {
39
- component: 'BreadcrumbItem',
40
- props: {
41
- children: {
42
- component: 'BreadcrumbLink',
43
- props: { href: '/products', children: 'Products' },
44
- },
45
- },
46
- },
47
- {
48
- component: 'BreadcrumbSeparator',
49
- props: {},
50
- },
51
- {
52
- component: 'BreadcrumbItem',
53
- props: {
54
- children: {
55
- component: 'BreadcrumbPage',
56
- props: { children: 'Current' },
57
- },
58
- },
59
- },
60
- ],
61
- },
62
- },
63
- },
64
- },
65
- },
66
- {
67
- name: 'With Icons',
68
- description: 'Breadcrumb with custom icons',
69
- code: '<Breadcrumb items={[{ label: "Home", href: "/", icon: HomeIcon }, { label: "Settings", href: "/settings", icon: SettingsIcon }]} />',
70
- preview: {
71
- type: 'component',
72
- component: 'Breadcrumb',
73
- props: {
74
- children: {
75
- component: 'BreadcrumbList',
76
- props: {
77
- children: [
78
- {
79
- component: 'BreadcrumbItem',
80
- props: {
81
- children: [
82
- {
83
- component: 'Home',
84
- props: { className: 'h-4 w-4' },
85
- },
86
- {
87
- component: 'BreadcrumbLink',
88
- props: { href: '/', children: 'Home' },
89
- },
90
- ],
91
- },
92
- },
93
- {
94
- component: 'BreadcrumbSeparator',
95
- props: {},
96
- },
97
- {
98
- component: 'BreadcrumbItem',
99
- props: {
100
- children: [
101
- {
102
- component: 'Settings',
103
- props: { className: 'h-4 w-4' },
104
- },
105
- {
106
- component: 'BreadcrumbLink',
107
- props: { href: '/settings', children: 'Settings' },
108
- },
109
- ],
110
- },
111
- },
112
- ],
113
- },
114
- },
115
- },
116
- },
117
- },
118
- ],
119
- dependencies: ['utils'],
120
- files: ['components/primitives/breadcrumb/index.tsx'],
121
- };