@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
@@ -20,11 +20,10 @@ import { cn } from "@/lib/utils";
20
20
  * - Accessibility features (focus rings, error states)
21
21
  * - Smooth transitions for interactive states
22
22
  *
23
- * ## Variants
24
- * - **default**: Primary brand color, high emphasis
25
- * - **secondary**: Muted background, medium emphasis
26
- * - **destructive**: Error/warning states, urgent attention
27
- * - **outline**: Subtle border-only style, low emphasis
23
+ * @variant default - Primary brand color badge for important status indicators and primary actions
24
+ * @variant secondary - Muted background badge for supplementary information and low-priority labels
25
+ * @variant destructive - Error/warning badge for critical states, failures, and urgent attention
26
+ * @variant outline - Subtle border-only badge for minimal emphasis and subtle labeling
28
27
  *
29
28
  * @param props - Variant configuration object
30
29
  * @param props.variant - The visual variant to apply
@@ -48,16 +47,12 @@ const badgeVariants = cva(
48
47
  {
49
48
  variants: {
50
49
  variant: {
51
- /** Primary badge with brand colors - use for important status or primary actions */
52
50
  default:
53
51
  "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
54
- /** Secondary badge with muted colors - use for supplementary information */
55
52
  secondary:
56
53
  "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
57
- /** Destructive badge for errors/warnings - use for critical states */
58
54
  destructive:
59
55
  "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
60
- /** Outline badge with border only - use for subtle labeling */
61
56
  outline:
62
57
  "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
63
58
  },
@@ -69,38 +64,39 @@ const badgeVariants = cva(
69
64
  );
70
65
 
71
66
  /**
72
- * A versatile badge component for displaying status indicators, labels, counts, and notifications.
73
- *
74
- * Badges are small status descriptors for UI elements. They provide visual feedback about the state,
75
- * category, or importance of content. The component is built with accessibility in mind and supports
76
- * multiple visual variants for different semantic meanings.
77
- *
78
- * ## Key Features
79
- * - Multiple semantic variants (default, secondary, destructive, outline)
80
- * - Icon support with proper sizing and spacing
81
- * - Polymorphic rendering via `asChild` prop
82
- * - Accessibility-first design with proper focus management
83
- * - Support for interactive states (hover, focus, invalid)
84
- * - Built-in responsive behavior
85
- *
86
- * ## When to Use
87
- * - Status indicators (active, pending, error)
88
- * - Notification counts and badges
89
- * - Category labels and tags
90
- * - Priority indicators
91
- * - Quick action buttons (when used with asChild)
92
- *
93
- * ## Accessibility Features
94
- * - Keyboard navigation support with focus-visible ring
95
- * - High contrast colors for all variants
96
- * - Support for `aria-invalid` state with visual feedback
97
- * - Semantic color mapping (destructive = error, etc.)
98
- * - Screen reader friendly content structure
99
- *
100
- * @component
67
+ * Props for Badge component (Documentation only - NOT used in component implementation)
68
+ * This type is for documentation generation and should not replace CVA/Radix inferred types
69
+ */
70
+ // eslint-disable-next-line unused-imports/no-unused-vars
71
+ type BadgeDocsProps = {
72
+ /** The visual variant of the badge that determines its color scheme and emphasis level */
73
+ variant?: "default" | "secondary" | "destructive" | "outline";
74
+ /** Additional CSS classes to apply to the badge for custom styling */
75
+ className?: string;
76
+ /** Content to display inside the badge (text, icons, or React components) */
77
+ children?: React.ReactNode;
78
+ /**
79
+ * Renders the badge as its child element instead of a span element.
80
+ * Enables polymorphic behavior for creating badge-styled links, buttons, or other interactive elements.
81
+ *
82
+ * When true, you must provide exactly one child element that can receive props.
83
+ * The child element will receive all badge styling and attributes via Radix UI Slot.
84
+ *
85
+ * @default false
86
+ */
87
+ asChild?: boolean;
88
+ } & Omit<React.HTMLAttributes<HTMLSpanElement>, "children">;
89
+
90
+ /**
91
+ * Badge - Versatile status indicator component for labels, counts, and notifications
92
+ *
93
+ * A small status descriptor component that provides visual feedback about state, category,
94
+ * or importance of content. Built on Radix UI Slot primitives with accessibility-first design
95
+ * and support for multiple semantic variants and interactive states.
96
+ *
101
97
  * @example
102
98
  * ```tsx
103
- * // Basic status badge
99
+ * // Basic status badges
104
100
  * <Badge>New</Badge>
105
101
  * <Badge variant="secondary">Draft</Badge>
106
102
  * <Badge variant="destructive">Error</Badge>
@@ -109,16 +105,16 @@ const badgeVariants = cva(
109
105
  *
110
106
  * @example
111
107
  * ```tsx
112
- * // Badge with icon
108
+ * // Badge with icon content
113
109
  * import { Check, AlertTriangle } from "lucide-react";
114
110
  *
115
111
  * <Badge>
116
- * <Check />
112
+ * <Check className="mr-1" />
117
113
  * Completed
118
114
  * </Badge>
119
115
  *
120
116
  * <Badge variant="destructive">
121
- * <AlertTriangle />
117
+ * <AlertTriangle className="mr-1" />
122
118
  * Failed
123
119
  * </Badge>
124
120
  * ```
@@ -126,9 +122,9 @@ const badgeVariants = cva(
126
122
  * @example
127
123
  * ```tsx
128
124
  * // Notification count badge
129
- * <div className="relative">
130
- * <Bell />
131
- * <Badge className="absolute -top-2 -right-2 size-5 p-0 text-xs">
125
+ * <div className="relative inline-block">
126
+ * <Bell className="h-6 w-6" />
127
+ * <Badge className="absolute -top-2 -right-2 h-5 w-5 p-0 text-xs flex items-center justify-center">
132
128
  * 3
133
129
  * </Badge>
134
130
  * </div>
@@ -136,11 +132,11 @@ const badgeVariants = cva(
136
132
  *
137
133
  * @example
138
134
  * ```tsx
139
- * // Interactive badge as link
135
+ * // Interactive badge as link using asChild
140
136
  * import Link from "next/link";
141
137
  *
142
138
  * <Badge asChild>
143
- * <Link href="/notifications">
139
+ * <Link href="/notifications" className="cursor-pointer">
144
140
  * 3 new messages
145
141
  * </Link>
146
142
  * </Badge>
@@ -148,17 +144,41 @@ const badgeVariants = cva(
148
144
  *
149
145
  * @example
150
146
  * ```tsx
151
- * // Removable tag badge
152
- * <Badge className="pr-1">
147
+ * // Interactive badge as button
148
+ * <Badge asChild>
149
+ * <button onClick={handleDismiss} className="cursor-pointer">
150
+ * Dismiss Alert
151
+ * </button>
152
+ * </Badge>
153
+ * ```
154
+ *
155
+ * @example
156
+ * ```tsx
157
+ * // Removable tag badge with close button
158
+ * <Badge className="pr-1 gap-1">
153
159
  * React
154
- * <button className="ml-1 hover:bg-primary-foreground/20 rounded-full p-0.5">
155
- * <X className="size-3" />
160
+ * <button
161
+ * onClick={handleRemove}
162
+ * className="ml-1 hover:bg-primary-foreground/20 rounded-full p-0.5"
163
+ * aria-label="Remove React tag"
164
+ * >
165
+ * <X className="h-3 w-3" />
156
166
  * </button>
157
167
  * </Badge>
158
168
  * ```
159
169
  *
160
- * @see {@link Button} - For primary actionable elements
161
- * @see [shadcn/ui Badge Documentation](https://ui.shadcn.com/docs/components/badge)
170
+ * @accessibility
171
+ * - Full keyboard navigation support with focus-visible ring indicators
172
+ * - High contrast colors across all variants for WCAG AA compliance
173
+ * - Support for aria-invalid state with visual feedback for form validation
174
+ * - Semantic color mapping (destructive variant indicates errors)
175
+ * - Screen reader friendly content structure and labeling
176
+ * - When used with asChild, inherits accessibility properties of child element
177
+ * - Focus management handled by underlying Radix UI Slot primitive
178
+ *
179
+ * @see {@link Button} For primary interactive elements and calls-to-action
180
+ * @see {@link https://ui.shadcn.com/docs/components/badge} shadcn/ui Badge Documentation
181
+ * @see {@link https://www.radix-ui.com/primitives/docs/utilities/slot} Radix UI Slot Documentation
162
182
  * @since 1.0.0
163
183
  */
164
184
  function Badge({
@@ -166,29 +186,8 @@ function Badge({
166
186
  variant,
167
187
  asChild = false,
168
188
  ...props
169
- }: React.ComponentProps<"span"> &
189
+ }: React.HTMLAttributes<HTMLSpanElement> &
170
190
  VariantProps<typeof badgeVariants> & {
171
- /**
172
- * If true, the badge will render its child element instead of a span element.
173
- * Useful for creating badge-styled links, buttons, or other interactive elements.
174
- *
175
- * When true, you must provide exactly one child element that can receive props.
176
- * The child element will receive all the badge styling and attributes.
177
- *
178
- * @default false
179
- * @example
180
- * ```tsx
181
- * // Badge as a link
182
- * <Badge asChild>
183
- * <Link href="/profile">Profile</Link>
184
- * </Badge>
185
- *
186
- * // Badge as a button
187
- * <Badge asChild>
188
- * <button onClick={handleClick}>Click me</button>
189
- * </Badge>
190
- * ```
191
- */
192
191
  asChild?: boolean;
193
192
  }) {
194
193
  const Comp = asChild ? Slot : "span";