@neynar/ui 0.1.1 → 0.1.2

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 (173) hide show
  1. package/dist/components/ui/accordion.d.ts +1 -25
  2. package/dist/components/ui/accordion.d.ts.map +1 -1
  3. package/dist/components/ui/alert-dialog.d.ts +240 -46
  4. package/dist/components/ui/alert-dialog.d.ts.map +1 -1
  5. package/dist/components/ui/alert.d.ts +73 -11
  6. package/dist/components/ui/alert.d.ts.map +1 -1
  7. package/dist/components/ui/aspect-ratio.d.ts +44 -10
  8. package/dist/components/ui/aspect-ratio.d.ts.map +1 -1
  9. package/dist/components/ui/avatar.d.ts +117 -33
  10. package/dist/components/ui/avatar.d.ts.map +1 -1
  11. package/dist/components/ui/badge.d.ts +50 -71
  12. package/dist/components/ui/badge.d.ts.map +1 -1
  13. package/dist/components/ui/breadcrumb.d.ts +231 -49
  14. package/dist/components/ui/breadcrumb.d.ts.map +1 -1
  15. package/dist/components/ui/button.d.ts +189 -71
  16. package/dist/components/ui/button.d.ts.map +1 -1
  17. package/dist/components/ui/calendar.d.ts +197 -40
  18. package/dist/components/ui/calendar.d.ts.map +1 -1
  19. package/dist/components/ui/card.d.ts +7 -22
  20. package/dist/components/ui/card.d.ts.map +1 -1
  21. package/dist/components/ui/carousel.d.ts +369 -99
  22. package/dist/components/ui/carousel.d.ts.map +1 -1
  23. package/dist/components/ui/chart.d.ts.map +1 -1
  24. package/dist/components/ui/checkbox.d.ts +110 -38
  25. package/dist/components/ui/checkbox.d.ts.map +1 -1
  26. package/dist/components/ui/collapsible.d.ts +246 -61
  27. package/dist/components/ui/collapsible.d.ts.map +1 -1
  28. package/dist/components/ui/combobox.d.ts +207 -159
  29. package/dist/components/ui/combobox.d.ts.map +1 -1
  30. package/dist/components/ui/command.d.ts +336 -67
  31. package/dist/components/ui/command.d.ts.map +1 -1
  32. package/dist/components/ui/container.d.ts +159 -64
  33. package/dist/components/ui/container.d.ts.map +1 -1
  34. package/dist/components/ui/context-menu.d.ts +321 -39
  35. package/dist/components/ui/context-menu.d.ts.map +1 -1
  36. package/dist/components/ui/date-picker.d.ts +113 -86
  37. package/dist/components/ui/date-picker.d.ts.map +1 -1
  38. package/dist/components/ui/dialog.d.ts +106 -25
  39. package/dist/components/ui/dialog.d.ts.map +1 -1
  40. package/dist/components/ui/drawer.d.ts +388 -59
  41. package/dist/components/ui/drawer.d.ts.map +1 -1
  42. package/dist/components/ui/dropdown-menu.d.ts +521 -74
  43. package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
  44. package/dist/components/ui/empty-state.d.ts +148 -76
  45. package/dist/components/ui/empty-state.d.ts.map +1 -1
  46. package/dist/components/ui/hover-card.d.ts +253 -34
  47. package/dist/components/ui/hover-card.d.ts.map +1 -1
  48. package/dist/components/ui/input.d.ts +143 -44
  49. package/dist/components/ui/input.d.ts.map +1 -1
  50. package/dist/components/ui/label.d.ts +0 -8
  51. package/dist/components/ui/label.d.ts.map +1 -1
  52. package/dist/components/ui/menubar.d.ts +288 -46
  53. package/dist/components/ui/menubar.d.ts.map +1 -1
  54. package/dist/components/ui/navigation-menu.d.ts +444 -127
  55. package/dist/components/ui/navigation-menu.d.ts.map +1 -1
  56. package/dist/components/ui/pagination.d.ts +342 -66
  57. package/dist/components/ui/pagination.d.ts.map +1 -1
  58. package/dist/components/ui/popover.d.ts +0 -8
  59. package/dist/components/ui/popover.d.ts.map +1 -1
  60. package/dist/components/ui/progress.d.ts +88 -30
  61. package/dist/components/ui/progress.d.ts.map +1 -1
  62. package/dist/components/ui/radio-group.d.ts +189 -45
  63. package/dist/components/ui/radio-group.d.ts.map +1 -1
  64. package/dist/components/ui/resizable.d.ts +178 -62
  65. package/dist/components/ui/resizable.d.ts.map +1 -1
  66. package/dist/components/ui/scroll-area.d.ts +180 -21
  67. package/dist/components/ui/scroll-area.d.ts.map +1 -1
  68. package/dist/components/ui/select.d.ts +382 -60
  69. package/dist/components/ui/select.d.ts.map +1 -1
  70. package/dist/components/ui/separator.d.ts +52 -39
  71. package/dist/components/ui/separator.d.ts.map +1 -1
  72. package/dist/components/ui/sheet.d.ts +144 -27
  73. package/dist/components/ui/sheet.d.ts.map +1 -1
  74. package/dist/components/ui/sidebar.d.ts +81 -31
  75. package/dist/components/ui/sidebar.d.ts.map +1 -1
  76. package/dist/components/ui/skeleton.d.ts +94 -32
  77. package/dist/components/ui/skeleton.d.ts.map +1 -1
  78. package/dist/components/ui/slider.d.ts +37 -31
  79. package/dist/components/ui/slider.d.ts.map +1 -1
  80. package/dist/components/ui/sonner.d.ts +280 -46
  81. package/dist/components/ui/sonner.d.ts.map +1 -1
  82. package/dist/components/ui/stack.d.ts +289 -148
  83. package/dist/components/ui/stack.d.ts.map +1 -1
  84. package/dist/components/ui/stories/aspect-ratio.stories.d.ts +1 -2
  85. package/dist/components/ui/stories/aspect-ratio.stories.d.ts.map +1 -1
  86. package/dist/components/ui/stories/container.stories.d.ts +2 -3
  87. package/dist/components/ui/stories/container.stories.d.ts.map +1 -1
  88. package/dist/components/ui/stories/empty-state.stories.d.ts +2 -2
  89. package/dist/components/ui/stories/scroll-area.stories.d.ts +1 -2
  90. package/dist/components/ui/stories/scroll-area.stories.d.ts.map +1 -1
  91. package/dist/components/ui/stories/stack.stories.d.ts +1 -1
  92. package/dist/components/ui/stories/text-field.stories.d.ts +7 -1
  93. package/dist/components/ui/stories/text-field.stories.d.ts.map +1 -1
  94. package/dist/components/ui/switch.d.ts +44 -38
  95. package/dist/components/ui/switch.d.ts.map +1 -1
  96. package/dist/components/ui/table.d.ts +33 -0
  97. package/dist/components/ui/table.d.ts.map +1 -1
  98. package/dist/components/ui/tabs.d.ts +4 -22
  99. package/dist/components/ui/tabs.d.ts.map +1 -1
  100. package/dist/components/ui/text-field.d.ts +170 -84
  101. package/dist/components/ui/text-field.d.ts.map +1 -1
  102. package/dist/components/ui/textarea.d.ts +106 -29
  103. package/dist/components/ui/textarea.d.ts.map +1 -1
  104. package/dist/components/ui/theme-toggle.d.ts +190 -65
  105. package/dist/components/ui/theme-toggle.d.ts.map +1 -1
  106. package/dist/components/ui/theme.d.ts +107 -23
  107. package/dist/components/ui/theme.d.ts.map +1 -1
  108. package/dist/components/ui/toggle-group.d.ts +143 -67
  109. package/dist/components/ui/toggle-group.d.ts.map +1 -1
  110. package/dist/components/ui/toggle.d.ts +118 -30
  111. package/dist/components/ui/toggle.d.ts.map +1 -1
  112. package/dist/components/ui/tooltip.d.ts +152 -28
  113. package/dist/components/ui/tooltip.d.ts.map +1 -1
  114. package/dist/components/ui/typography.d.ts +452 -134
  115. package/dist/components/ui/typography.d.ts.map +1 -1
  116. package/dist/index.js +9388 -8281
  117. package/dist/index.js.map +1 -1
  118. package/dist/tsconfig.tsbuildinfo +1 -1
  119. package/llms.txt +173 -3
  120. package/package.json +5 -2
  121. package/src/components/ui/accordion.tsx +112 -27
  122. package/src/components/ui/alert-dialog.tsx +401 -46
  123. package/src/components/ui/alert.tsx +114 -11
  124. package/src/components/ui/aspect-ratio.tsx +69 -14
  125. package/src/components/ui/avatar.tsx +179 -33
  126. package/src/components/ui/badge.tsx +74 -75
  127. package/src/components/ui/breadcrumb.tsx +335 -50
  128. package/src/components/ui/button.tsx +198 -90
  129. package/src/components/ui/calendar.tsx +867 -43
  130. package/src/components/ui/card.tsx +140 -33
  131. package/src/components/ui/carousel.tsx +529 -98
  132. package/src/components/ui/chart.tsx +222 -1
  133. package/src/components/ui/checkbox.tsx +176 -38
  134. package/src/components/ui/collapsible.tsx +321 -67
  135. package/src/components/ui/combobox.tsx +284 -83
  136. package/src/components/ui/command.tsx +527 -67
  137. package/src/components/ui/container.tsx +217 -65
  138. package/src/components/ui/context-menu.tsx +716 -51
  139. package/src/components/ui/date-picker.tsx +228 -38
  140. package/src/components/ui/dialog.tsx +270 -33
  141. package/src/components/ui/drawer.tsx +546 -67
  142. package/src/components/ui/dropdown-menu.tsx +657 -74
  143. package/src/components/ui/empty-state.tsx +241 -82
  144. package/src/components/ui/hover-card.tsx +328 -39
  145. package/src/components/ui/input.tsx +207 -44
  146. package/src/components/ui/label.tsx +98 -8
  147. package/src/components/ui/menubar.tsx +587 -54
  148. package/src/components/ui/navigation-menu.tsx +557 -128
  149. package/src/components/ui/pagination.tsx +561 -79
  150. package/src/components/ui/popover.tsx +119 -8
  151. package/src/components/ui/progress.tsx +131 -29
  152. package/src/components/ui/radio-group.tsx +260 -51
  153. package/src/components/ui/resizable.tsx +289 -63
  154. package/src/components/ui/scroll-area.tsx +377 -66
  155. package/src/components/ui/select.tsx +545 -60
  156. package/src/components/ui/separator.tsx +146 -40
  157. package/src/components/ui/sheet.tsx +348 -31
  158. package/src/components/ui/sidebar.tsx +471 -29
  159. package/src/components/ui/skeleton.tsx +114 -32
  160. package/src/components/ui/slider.tsx +77 -31
  161. package/src/components/ui/sonner.tsx +574 -46
  162. package/src/components/ui/stack.tsx +423 -101
  163. package/src/components/ui/switch.tsx +78 -39
  164. package/src/components/ui/table.tsx +170 -4
  165. package/src/components/ui/tabs.tsx +108 -22
  166. package/src/components/ui/text-field.tsx +226 -81
  167. package/src/components/ui/textarea.tsx +180 -29
  168. package/src/components/ui/theme-toggle.tsx +313 -65
  169. package/src/components/ui/theme.tsx +117 -23
  170. package/src/components/ui/toggle-group.tsx +280 -69
  171. package/src/components/ui/toggle.tsx +124 -35
  172. package/src/components/ui/tooltip.tsx +239 -29
  173. package/src/components/ui/typography.tsx +1115 -165
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { Slot } from "@radix-ui/react-slot";
3
- import { cva, type VariantProps } from "class-variance-authority";
3
+ import { cva } from "class-variance-authority";
4
4
 
5
5
  import { cn } from "@/lib/utils";
6
6
 
@@ -8,25 +8,29 @@ import { cn } from "@/lib/utils";
8
8
  * Button variant configuration using class-variance-authority
9
9
  *
10
10
  * Defines all possible visual variants and sizes for the Button component.
11
- * Uses Tailwind CSS 4 with custom CSS properties for theming.
11
+ * Uses Tailwind CSS with custom CSS properties for theming and comprehensive
12
+ * accessibility features including focus management and ARIA support.
13
+ *
14
+ * @variant default - Primary action button with brand colors and elevated appearance
15
+ * @variant destructive - Dangerous/destructive actions (delete, remove, etc.) with red theming
16
+ * @variant outline - Secondary action with subtle border and background hover states
17
+ * @variant secondary - Alternative secondary styling with muted colors
18
+ * @variant ghost - Minimal styling with hover states, often used in toolbars or menus
19
+ * @variant link - Text-only button styled like a hyperlink with underline on hover
20
+ *
21
+ * @size default - Standard button height (36px) with balanced padding
22
+ * @size sm - Small button height (32px) for compact interfaces
23
+ * @size lg - Large button height (40px) for prominent actions
24
+ * @size icon - Square button (36px × 36px) optimized for icon-only usage
12
25
  *
13
26
  * @see {@link https://cva.style/docs} - CVA documentation
27
+ * @see {@link https://ui.shadcn.com/docs/components/button} - shadcn/ui button documentation
14
28
  * @since 1.0.0
15
29
  */
16
30
  const buttonVariants = cva(
17
31
  "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
18
32
  {
19
33
  variants: {
20
- /**
21
- * Visual style variants for the button
22
- *
23
- * @variant default - Primary action button with brand colors
24
- * @variant destructive - Dangerous actions (delete, remove, etc.)
25
- * @variant outline - Secondary action with border
26
- * @variant secondary - Alternative secondary styling
27
- * @variant ghost - Minimal styling, often used in toolbars
28
- * @variant link - Text-only button that looks like a link
29
- */
30
34
  variant: {
31
35
  default:
32
36
  "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
@@ -40,14 +44,6 @@ const buttonVariants = cva(
40
44
  "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
41
45
  link: "text-primary underline-offset-4 hover:underline",
42
46
  },
43
- /**
44
- * Size variants for the button
45
- *
46
- * @size default - Standard button height (36px)
47
- * @size sm - Small button height (32px)
48
- * @size lg - Large button height (40px)
49
- * @size icon - Square button for icons only (36px × 36px)
50
- */
51
47
  size: {
52
48
  default: "h-9 px-4 py-2 has-[>svg]:px-3",
53
49
  sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
@@ -63,60 +59,145 @@ const buttonVariants = cva(
63
59
  );
64
60
 
65
61
  /**
66
- * Button - A versatile button component with multiple style variants and sizes
62
+ * Props for Button component (Documentation only - NOT used in component implementation)
63
+ * These types are for documentation generation and should not replace CVA/Radix inferred types
64
+ */
65
+
66
+ type ButtonDocsProps = {
67
+ /** Visual style variant that determines the button's appearance and semantic meaning */
68
+ variant?:
69
+ | "default"
70
+ | "destructive"
71
+ | "outline"
72
+ | "secondary"
73
+ | "ghost"
74
+ | "link";
75
+ /** Size variant that controls the button's dimensions and padding */
76
+ size?: "default" | "sm" | "lg" | "icon";
77
+ /**
78
+ * Render the button as its child element instead of a button element.
79
+ * Enables composition patterns for creating button-styled links or other elements.
80
+ * When true, all props are forwarded to the child element via Radix UI Slot.
81
+ *
82
+ * @example
83
+ * ```tsx
84
+ * <Button asChild>
85
+ * <Link href="/dashboard">Dashboard</Link>
86
+ * </Button>
87
+ * ```
88
+ *
89
+ * @default false
90
+ */
91
+ asChild?: boolean;
92
+ /** Content to display inside the button (text, icons, or React components) */
93
+ children?: React.ReactNode;
94
+ /** Additional CSS classes to apply to the button for custom styling */
95
+ className?: string;
96
+ /** Whether the button is disabled and cannot be interacted with @default false */
97
+ disabled?: boolean;
98
+ /** Button type for form submission behavior @default "button" */
99
+ type?: "button" | "submit" | "reset";
100
+ /** Click handler function called when the button is activated */
101
+ onClick?: React.MouseEventHandler<HTMLButtonElement>;
102
+ /** Focus handler called when the button receives focus */
103
+ onFocus?: React.FocusEventHandler<HTMLButtonElement>;
104
+ /** Blur handler called when the button loses focus */
105
+ onBlur?: React.FocusEventHandler<HTMLButtonElement>;
106
+ /** Mouse enter handler for hover interactions */
107
+ onMouseEnter?: React.MouseEventHandler<HTMLButtonElement>;
108
+ /** Mouse leave handler for hover interactions */
109
+ onMouseLeave?: React.MouseEventHandler<HTMLButtonElement>;
110
+ /** Accessible label for screen readers (required for icon-only buttons) */
111
+ "aria-label"?: string;
112
+ /** Describes the button for screen readers */
113
+ "aria-describedby"?: string;
114
+ /** Indicates invalid state for form validation */
115
+ "aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling";
116
+ /** Indicates expanded state for disclosure buttons */
117
+ "aria-expanded"?: React.AriaAttributes['aria-expanded'];
118
+ /** Associates button with elements it controls */
119
+ "aria-controls"?: string;
120
+ /** Indicates pressed state for toggle buttons */
121
+ "aria-pressed"?: boolean | "false" | "true" | "mixed";
122
+ /** Tab index for focus management @default 0 */
123
+ tabIndex?: number;
124
+ /** Auto focus the button when component mounts @default false */
125
+ autoFocus?: boolean;
126
+ /** Form attribute to associate button with a form element */
127
+ form?: string;
128
+ /** Form action URL or function for submit buttons */
129
+ formAction?: string | ((formData: FormData) => void | Promise<void>);
130
+ /** Form encoding type for submit buttons */
131
+ formEncType?: string;
132
+ /** Form method for submit buttons */
133
+ formMethod?: string;
134
+ /** Form validation bypass for submit buttons @default false */
135
+ formNoValidate?: boolean;
136
+ /** Form target for submit buttons */
137
+ formTarget?: string;
138
+ /** Button name for form submission */
139
+ name?: string;
140
+ /** Button value for form submission */
141
+ value?: string | ReadonlyArray<string> | number;
142
+ } & React.ButtonHTMLAttributes<HTMLButtonElement> & {
143
+ /** Ref to access the button element */
144
+ ref?: React.Ref<HTMLButtonElement>;
145
+ };
146
+
147
+ /**
148
+ * Button - A versatile, accessible button component with multiple style variants
67
149
  *
68
- * The Button component is a fundamental UI element used to trigger actions or navigate
69
- * through the application. Built on Radix UI's Slot primitive, it supports multiple
70
- * visual variants, sizes, and can be composed with other components using the asChild
71
- * prop for maximum flexibility. Icons placed within the button are automatically
72
- * styled with proper spacing and sizing.
150
+ * A fundamental UI element built on Radix UI's Slot primitive that supports extensive
151
+ * customization through variants, composition patterns, and comprehensive accessibility
152
+ * features. The component automatically handles icon styling, focus management, form
153
+ * integration, and can be rendered as other elements using the asChild pattern.
73
154
  *
74
- * @component
75
155
  * @example
76
156
  * ```tsx
77
- * // Basic usage
78
- * <Button>Click me</Button>
157
+ * // Basic usage with different variants
158
+ * <Button>Default Button</Button>
159
+ * <Button variant="destructive">Delete Item</Button>
160
+ * <Button variant="outline" size="lg">Large Outline</Button>
161
+ * <Button variant="ghost" size="sm">Small Ghost</Button>
162
+ * <Button variant="link">Link Button</Button>
79
163
  * ```
80
164
  *
81
165
  * @example
82
166
  * ```tsx
83
- * // With variants and sizes
84
- * <Button variant="outline" size="lg">Large Outline Button</Button>
85
- * <Button variant="destructive" size="sm">Delete</Button>
86
- * <Button variant="ghost">Ghost Button</Button>
87
- * ```
88
- *
89
- * @example
90
- * ```tsx
91
- * // With icons (automatically styled)
92
- * import { Download, ArrowRight, Plus } from "lucide-react";
167
+ * // Icon usage (automatically styled with proper spacing)
168
+ * import { Download, ArrowRight, Plus, Trash2 } from "lucide-react";
93
169
  *
94
170
  * <Button>
95
- * <Download /> Download File
171
+ * <Download className="mr-2" /> Download File
96
172
  * </Button>
97
173
  *
98
- * <Button>
99
- * Continue <ArrowRight />
174
+ * <Button variant="outline">
175
+ * Continue <ArrowRight className="ml-2" />
100
176
  * </Button>
101
177
  *
102
- * // Icon-only button
103
- * <Button size="icon" aria-label="Add item">
178
+ * // Icon-only button (always include aria-label)
179
+ * <Button size="icon" aria-label="Add new item">
104
180
  * <Plus />
105
181
  * </Button>
182
+ *
183
+ * <Button size="icon" variant="destructive" aria-label="Delete item">
184
+ * <Trash2 />
185
+ * </Button>
106
186
  * ```
107
187
  *
108
188
  * @example
109
189
  * ```tsx
110
- * // As other elements using asChild (composition pattern)
190
+ * // Composition with asChild (render as different elements)
111
191
  * import Link from "next/link";
192
+ * import { ExternalLink } from "lucide-react";
112
193
  *
113
194
  * <Button asChild>
114
195
  * <Link href="/dashboard">Go to Dashboard</Link>
115
196
  * </Button>
116
197
  *
117
198
  * <Button asChild variant="outline">
118
- * <a href="https://example.com" target="_blank" rel="noopener">
119
- * External Link
199
+ * <a href="https://example.com" target="_blank" rel="noopener noreferrer">
200
+ * External Link <ExternalLink className="ml-2 h-4 w-4" />
120
201
  * </a>
121
202
  * </Button>
122
203
  * ```
@@ -124,53 +205,80 @@ const buttonVariants = cva(
124
205
  * @example
125
206
  * ```tsx
126
207
  * // Form integration and states
127
- * <Button disabled>Loading...</Button>
128
- * <Button type="submit">Submit Form</Button>
129
- * <Button aria-invalid={hasError}>Validate</Button>
130
- *
131
- * // Loading state with spinner
132
- * <Button disabled>
133
- * <LoadingSpinner className="size-4" />
134
- * Processing...
208
+ * <Button type="submit" disabled={isSubmitting}>
209
+ * {isSubmitting ? "Submitting..." : "Submit Form"}
210
+ * </Button>
211
+ *
212
+ * <Button
213
+ * variant="destructive"
214
+ * onClick={() => handleDelete()}
215
+ * aria-describedby="delete-warning"
216
+ * >
217
+ * Delete Account
218
+ * </Button>
219
+ * <p id="delete-warning" className="sr-only">
220
+ * This action cannot be undone
221
+ * </p>
222
+ *
223
+ * // Toggle button with pressed state
224
+ * <Button
225
+ * variant="outline"
226
+ * aria-pressed={isToggled}
227
+ * onClick={() => setIsToggled(!isToggled)}
228
+ * >
229
+ * {isToggled ? "Enabled" : "Disabled"}
230
+ * </Button>
231
+ * ```
232
+ *
233
+ * @example
234
+ * ```tsx
235
+ * // Loading states and advanced usage
236
+ * import { Loader2, Save } from "lucide-react";
237
+ *
238
+ * <Button disabled={isLoading}>
239
+ * {isLoading && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
240
+ * {isLoading ? "Saving..." : "Save Changes"}
241
+ * </Button>
242
+ *
243
+ * // With custom styling
244
+ * <Button
245
+ * className="bg-gradient-to-r from-purple-500 to-pink-500 hover:from-purple-600 hover:to-pink-600"
246
+ * size="lg"
247
+ * >
248
+ * Gradient Button
135
249
  * </Button>
136
250
  * ```
137
251
  *
138
252
  * @accessibility
139
- * - Supports keyboard navigation (Enter/Space to activate)
140
- * - Properly handles disabled state with pointer-events-none and opacity
141
- * - Focus visible ring (3px ring-ring/50) for keyboard navigation
142
- * - Supports aria-invalid for form validation states with destructive ring
143
- * - Icons are automatically marked as non-interactive (pointer-events-none)
144
- * - Screen reader friendly with proper semantic button element
145
- * - When used with asChild, preserves accessibility of child element
146
- * - Icon-only buttons should include aria-label for screen readers
147
- *
148
- * @see {@link buttonVariants} - For all available style variants and sizes
149
- * @see {@link https://ui.shadcn.com/docs/components/button} - shadcn/ui button documentation
150
- * @since 1.0.0
151
- */
152
- /**
153
- * Button component props type
253
+ * - Full keyboard support (Enter/Space activation, Tab navigation)
254
+ * - ARIA attributes for screen readers (role="button" implicit)
255
+ * - Focus management with visible focus indicators (3px ring)
256
+ * - Disabled state properly communicated to assistive technologies
257
+ * - Support for ARIA states (pressed, expanded, invalid, controls)
258
+ * - Icon-only buttons require aria-label for screen reader users
259
+ * - Form integration with proper submit/reset behavior
260
+ * - High contrast focus indicators that meet WCAG 2.1 AA standards
261
+ * - Respects user's reduced motion preferences in transitions
262
+ * - When using asChild, accessibility is inherited from the child element
263
+ *
264
+ * @variant default - Primary action button with brand colors and subtle shadow
265
+ * @variant destructive - For dangerous actions (delete, remove) with red theming
266
+ * @variant outline - Secondary actions with border and subtle background on hover
267
+ * @variant secondary - Alternative styling with muted background colors
268
+ * @variant ghost - Minimal appearance with hover states, ideal for toolbars
269
+ * @variant link - Appears as a text link with underline on hover
154
270
  *
155
- * Extends all standard HTML button attributes with additional variant and composition props.
271
+ * @size default - Standard height (36px) suitable for most interfaces
272
+ * @size sm - Compact height (32px) for dense layouts or secondary actions
273
+ * @size lg - Large height (40px) for prominent primary actions
274
+ * @size icon - Square (36px × 36px) optimized for single icons
275
+ *
276
+ * @see {@link buttonVariants} CVA configuration with all styling variants
277
+ * @see {@link https://ui.shadcn.com/docs/components/button} shadcn/ui Button documentation
278
+ * @see {@link https://www.radix-ui.com/primitives/docs/utilities/slot} Radix UI Slot for composition patterns
279
+ * @see {@link https://www.w3.org/WAI/ARIA/apg/patterns/button/} WAI-ARIA Button Pattern
280
+ * @since 1.0.0
156
281
  */
157
- type ButtonProps = React.ComponentProps<"button"> &
158
- VariantProps<typeof buttonVariants> & {
159
- /**
160
- * If true, the button will render its child element instead of a button element.
161
- * This enables composition patterns like turning links into buttons.
162
- *
163
- * @example
164
- * ```tsx
165
- * <Button asChild>
166
- * <Link href="/dashboard">Dashboard</Link>
167
- * </Button>
168
- * ```
169
- *
170
- * @default false
171
- */
172
- asChild?: boolean;
173
- };
174
282
 
175
283
  function Button({
176
284
  className,
@@ -178,7 +286,7 @@ function Button({
178
286
  size,
179
287
  asChild = false,
180
288
  ...props
181
- }: ButtonProps) {
289
+ }: ButtonDocsProps) {
182
290
  const Comp = asChild ? Slot : "button";
183
291
 
184
292
  return (
@@ -192,4 +300,4 @@ function Button({
192
300
 
193
301
  Button.displayName = "Button";
194
302
 
195
- export { Button, buttonVariants, type ButtonProps };
303
+ export { Button, buttonVariants };