@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.
- package/dist/components/ui/accordion.d.ts +1 -25
- package/dist/components/ui/accordion.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.d.ts +240 -46
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert.d.ts +73 -11
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/aspect-ratio.d.ts +44 -10
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -1
- package/dist/components/ui/avatar.d.ts +117 -33
- package/dist/components/ui/avatar.d.ts.map +1 -1
- package/dist/components/ui/badge.d.ts +50 -71
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb.d.ts +231 -49
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/button.d.ts +189 -71
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/calendar.d.ts +197 -40
- package/dist/components/ui/calendar.d.ts.map +1 -1
- package/dist/components/ui/card.d.ts +7 -22
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/carousel.d.ts +369 -99
- package/dist/components/ui/carousel.d.ts.map +1 -1
- package/dist/components/ui/chart.d.ts.map +1 -1
- package/dist/components/ui/checkbox.d.ts +110 -38
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/collapsible.d.ts +246 -61
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/combobox.d.ts +207 -159
- package/dist/components/ui/combobox.d.ts.map +1 -1
- package/dist/components/ui/command.d.ts +336 -67
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/container.d.ts +159 -64
- package/dist/components/ui/container.d.ts.map +1 -1
- package/dist/components/ui/context-menu.d.ts +321 -39
- package/dist/components/ui/context-menu.d.ts.map +1 -1
- package/dist/components/ui/date-picker.d.ts +113 -86
- package/dist/components/ui/date-picker.d.ts.map +1 -1
- package/dist/components/ui/dialog.d.ts +106 -25
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/drawer.d.ts +388 -59
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +521 -74
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/empty-state.d.ts +148 -76
- package/dist/components/ui/empty-state.d.ts.map +1 -1
- package/dist/components/ui/hover-card.d.ts +253 -34
- package/dist/components/ui/hover-card.d.ts.map +1 -1
- package/dist/components/ui/input.d.ts +143 -44
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/label.d.ts +0 -8
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/menubar.d.ts +288 -46
- package/dist/components/ui/menubar.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu.d.ts +444 -127
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/pagination.d.ts +342 -66
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/popover.d.ts +0 -8
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/progress.d.ts +88 -30
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/radio-group.d.ts +189 -45
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/resizable.d.ts +178 -62
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.d.ts +180 -21
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/select.d.ts +382 -60
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/separator.d.ts +52 -39
- package/dist/components/ui/separator.d.ts.map +1 -1
- package/dist/components/ui/sheet.d.ts +144 -27
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sidebar.d.ts +81 -31
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/skeleton.d.ts +94 -32
- package/dist/components/ui/skeleton.d.ts.map +1 -1
- package/dist/components/ui/slider.d.ts +37 -31
- package/dist/components/ui/slider.d.ts.map +1 -1
- package/dist/components/ui/sonner.d.ts +280 -46
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/components/ui/stack.d.ts +289 -148
- package/dist/components/ui/stack.d.ts.map +1 -1
- package/dist/components/ui/stories/aspect-ratio.stories.d.ts +1 -2
- package/dist/components/ui/stories/aspect-ratio.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/container.stories.d.ts +2 -3
- package/dist/components/ui/stories/container.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/empty-state.stories.d.ts +2 -2
- package/dist/components/ui/stories/scroll-area.stories.d.ts +1 -2
- package/dist/components/ui/stories/scroll-area.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/stack.stories.d.ts +1 -1
- package/dist/components/ui/stories/text-field.stories.d.ts +7 -1
- package/dist/components/ui/stories/text-field.stories.d.ts.map +1 -1
- package/dist/components/ui/switch.d.ts +44 -38
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/table.d.ts +33 -0
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/tabs.d.ts +4 -22
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/text-field.d.ts +170 -84
- package/dist/components/ui/text-field.d.ts.map +1 -1
- package/dist/components/ui/textarea.d.ts +106 -29
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/theme-toggle.d.ts +190 -65
- package/dist/components/ui/theme-toggle.d.ts.map +1 -1
- package/dist/components/ui/theme.d.ts +107 -23
- package/dist/components/ui/theme.d.ts.map +1 -1
- package/dist/components/ui/toggle-group.d.ts +143 -67
- package/dist/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/components/ui/toggle.d.ts +118 -30
- package/dist/components/ui/toggle.d.ts.map +1 -1
- package/dist/components/ui/tooltip.d.ts +152 -28
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/typography.d.ts +452 -134
- package/dist/components/ui/typography.d.ts.map +1 -1
- package/dist/index.js +9388 -8281
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/llms.txt +173 -3
- package/package.json +5 -2
- package/src/components/ui/accordion.tsx +112 -27
- package/src/components/ui/alert-dialog.tsx +401 -46
- package/src/components/ui/alert.tsx +114 -11
- package/src/components/ui/aspect-ratio.tsx +69 -14
- package/src/components/ui/avatar.tsx +179 -33
- package/src/components/ui/badge.tsx +74 -75
- package/src/components/ui/breadcrumb.tsx +335 -50
- package/src/components/ui/button.tsx +198 -90
- package/src/components/ui/calendar.tsx +867 -43
- package/src/components/ui/card.tsx +140 -33
- package/src/components/ui/carousel.tsx +529 -98
- package/src/components/ui/chart.tsx +222 -1
- package/src/components/ui/checkbox.tsx +176 -38
- package/src/components/ui/collapsible.tsx +321 -67
- package/src/components/ui/combobox.tsx +284 -83
- package/src/components/ui/command.tsx +527 -67
- package/src/components/ui/container.tsx +217 -65
- package/src/components/ui/context-menu.tsx +716 -51
- package/src/components/ui/date-picker.tsx +228 -38
- package/src/components/ui/dialog.tsx +270 -33
- package/src/components/ui/drawer.tsx +546 -67
- package/src/components/ui/dropdown-menu.tsx +657 -74
- package/src/components/ui/empty-state.tsx +241 -82
- package/src/components/ui/hover-card.tsx +328 -39
- package/src/components/ui/input.tsx +207 -44
- package/src/components/ui/label.tsx +98 -8
- package/src/components/ui/menubar.tsx +587 -54
- package/src/components/ui/navigation-menu.tsx +557 -128
- package/src/components/ui/pagination.tsx +561 -79
- package/src/components/ui/popover.tsx +119 -8
- package/src/components/ui/progress.tsx +131 -29
- package/src/components/ui/radio-group.tsx +260 -51
- package/src/components/ui/resizable.tsx +289 -63
- package/src/components/ui/scroll-area.tsx +377 -66
- package/src/components/ui/select.tsx +545 -60
- package/src/components/ui/separator.tsx +146 -40
- package/src/components/ui/sheet.tsx +348 -31
- package/src/components/ui/sidebar.tsx +471 -29
- package/src/components/ui/skeleton.tsx +114 -32
- package/src/components/ui/slider.tsx +77 -31
- package/src/components/ui/sonner.tsx +574 -46
- package/src/components/ui/stack.tsx +423 -101
- package/src/components/ui/switch.tsx +78 -39
- package/src/components/ui/table.tsx +170 -4
- package/src/components/ui/tabs.tsx +108 -22
- package/src/components/ui/text-field.tsx +226 -81
- package/src/components/ui/textarea.tsx +180 -29
- package/src/components/ui/theme-toggle.tsx +313 -65
- package/src/components/ui/theme.tsx +117 -23
- package/src/components/ui/toggle-group.tsx +280 -69
- package/src/components/ui/toggle.tsx +124 -35
- package/src/components/ui/tooltip.tsx +239 -29
- package/src/components/ui/typography.tsx +1115 -165
|
@@ -4,84 +4,190 @@ import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
|
4
4
|
import { cn } from "@/lib/utils";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Separator component
|
|
7
|
+
* Props for Separator component (Documentation only - NOT used in component implementation)
|
|
8
|
+
* These types are for documentation generation and should not replace Radix inferred types
|
|
8
9
|
*
|
|
9
|
-
*
|
|
10
|
+
* Extends all props from Radix UI Separator Root primitive with additional styling options.
|
|
11
|
+
* Built on top of Radix UI Separator primitive for full accessibility compliance with WAI-ARIA separator role.
|
|
12
|
+
*/
|
|
13
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
14
|
+
type SeparatorDocsProps = {
|
|
15
|
+
/** Additional CSS class names to apply to the separator element */
|
|
16
|
+
className?: string;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The orientation of the separator
|
|
20
|
+
*
|
|
21
|
+
* - "horizontal": Creates a horizontal divider (full width, minimal height)
|
|
22
|
+
* - "vertical": Creates a vertical divider (minimal width, full height)
|
|
23
|
+
*
|
|
24
|
+
* @default "horizontal"
|
|
25
|
+
*/
|
|
26
|
+
orientation?: "horizontal" | "vertical";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Whether the separator is purely decorative (visual only)
|
|
30
|
+
*
|
|
31
|
+
* When true, the separator is hidden from assistive technologies and serves only as a visual divider.
|
|
32
|
+
* When false, the separator is exposed to screen readers as a semantic boundary between content sections.
|
|
33
|
+
* Use false when the separator provides meaningful structure (e.g., between navigation sections).
|
|
34
|
+
*
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
37
|
+
decorative?: boolean;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Polymorphic composition - render as a different element
|
|
41
|
+
*
|
|
42
|
+
* When true, renders the separator as its child element instead of a div.
|
|
43
|
+
* Useful for rendering as semantic HTML elements like <hr> while maintaining Radix UI behavior.
|
|
44
|
+
*
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
47
|
+
asChild?: boolean;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* ARIA label for semantic separators
|
|
51
|
+
*
|
|
52
|
+
* Provides an accessible name for the separator when decorative=false.
|
|
53
|
+
* Required for non-decorative separators to ensure proper screen reader announcement.
|
|
54
|
+
*
|
|
55
|
+
* @example "Navigation separator" or "Content section divider"
|
|
56
|
+
*/
|
|
57
|
+
"aria-label"?: string;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* ARIA labelledby for semantic separators
|
|
61
|
+
*
|
|
62
|
+
* References another element's ID that provides the accessible name for this separator.
|
|
63
|
+
* Alternative to aria-label for non-decorative separators.
|
|
64
|
+
*/
|
|
65
|
+
"aria-labelledby"?: string;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Current value for interactive separators
|
|
69
|
+
*
|
|
70
|
+
* For focusable separators that can be moved (like split panes), this represents
|
|
71
|
+
* the current position value. Must be within the min/max range if specified.
|
|
72
|
+
*/
|
|
73
|
+
"aria-valuenow"?: number;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Minimum value for interactive separators
|
|
77
|
+
*
|
|
78
|
+
* The minimum position value for moveable separators.
|
|
79
|
+
* Only relevant for focusable separators with aria-valuenow.
|
|
80
|
+
*/
|
|
81
|
+
"aria-valuemin"?: number;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Maximum value for interactive separators
|
|
85
|
+
*
|
|
86
|
+
* The maximum position value for moveable separators.
|
|
87
|
+
* Only relevant for focusable separators with aria-valuenow.
|
|
88
|
+
*/
|
|
89
|
+
"aria-valuemax"?: number;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Text description of current value
|
|
93
|
+
*
|
|
94
|
+
* Human-readable description of the current value for interactive separators.
|
|
95
|
+
* Example: "50% split" or "200 pixels from left"
|
|
96
|
+
*/
|
|
97
|
+
"aria-valuetext"?: string;
|
|
98
|
+
} & Omit<React.ComponentProps<"div">, "role">;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Separator component for visually and semantically dividing content sections
|
|
102
|
+
*
|
|
103
|
+
* A flexible, accessible separator component built on Radix UI primitives that creates
|
|
10
104
|
* visual or semantic divisions between content sections. Supports both horizontal
|
|
11
105
|
* and vertical orientations with full accessibility features including decorative
|
|
12
|
-
* and semantic separator modes for screen reader compatibility.
|
|
106
|
+
* and semantic separator modes for optimal screen reader compatibility.
|
|
107
|
+
*
|
|
108
|
+
* Built on Radix UI Separator primitive which automatically handles:
|
|
109
|
+
* - WAI-ARIA separator role compliance
|
|
110
|
+
* - Proper orientation data attributes
|
|
111
|
+
* - Screen reader visibility control via decorative prop
|
|
112
|
+
* - Keyboard navigation support for interactive separators
|
|
113
|
+
* - Semantic HTML structure with proper ARIA attributes
|
|
13
114
|
*
|
|
14
115
|
* @example
|
|
15
116
|
* ```tsx
|
|
16
|
-
* // Basic horizontal separator
|
|
17
|
-
* <div>
|
|
18
|
-
* <p>
|
|
117
|
+
* // Basic horizontal separator - decorative divider
|
|
118
|
+
* <div className="space-y-4">
|
|
119
|
+
* <p>Content above</p>
|
|
19
120
|
* <Separator />
|
|
20
|
-
* <p>
|
|
121
|
+
* <p>Content below</p>
|
|
21
122
|
* </div>
|
|
22
123
|
* ```
|
|
23
124
|
*
|
|
24
125
|
* @example
|
|
25
126
|
* ```tsx
|
|
26
|
-
* // Vertical separator in
|
|
27
|
-
* <div className="flex items-center">
|
|
127
|
+
* // Vertical separator in toolbar layouts
|
|
128
|
+
* <div className="flex items-center space-x-2">
|
|
28
129
|
* <button>Bold</button>
|
|
29
|
-
* <Separator orientation="vertical" className="mx-2 h-6" />
|
|
30
130
|
* <button>Italic</button>
|
|
131
|
+
* <Separator orientation="vertical" className="h-4" />
|
|
132
|
+
* <button>Underline</button>
|
|
133
|
+
* <button>Strike</button>
|
|
31
134
|
* </div>
|
|
32
135
|
* ```
|
|
33
136
|
*
|
|
34
137
|
* @example
|
|
35
138
|
* ```tsx
|
|
36
|
-
* // Semantic separator
|
|
37
|
-
* <nav className="flex items-center">
|
|
38
|
-
* <a href="/
|
|
139
|
+
* // Semantic separator with screen reader support
|
|
140
|
+
* <nav className="flex items-center space-x-2">
|
|
141
|
+
* <a href="/dashboard">Dashboard</a>
|
|
39
142
|
* <Separator
|
|
40
143
|
* orientation="vertical"
|
|
41
144
|
* decorative={false}
|
|
42
145
|
* aria-label="Navigation separator"
|
|
43
|
-
* className="
|
|
146
|
+
* className="h-4"
|
|
44
147
|
* />
|
|
45
|
-
* <a href="/
|
|
148
|
+
* <a href="/settings">Settings</a>
|
|
46
149
|
* </nav>
|
|
47
150
|
* ```
|
|
48
151
|
*
|
|
49
152
|
* @example
|
|
50
153
|
* ```tsx
|
|
51
|
-
* // Custom styled separator
|
|
52
|
-
* <Separator className="my-
|
|
154
|
+
* // Custom styled separator with gradient
|
|
155
|
+
* <Separator className="my-8 h-px bg-gradient-to-r from-transparent via-border to-transparent" />
|
|
156
|
+
* ```
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```tsx
|
|
160
|
+
* // Polymorphic separator using semantic HTML
|
|
161
|
+
* <article>
|
|
162
|
+
* <section>First section content</section>
|
|
163
|
+
* <Separator asChild decorative={false} aria-label="Section divider">
|
|
164
|
+
* <hr className="my-6" />
|
|
165
|
+
* </Separator>
|
|
166
|
+
* <section>Second section content</section>
|
|
167
|
+
* </article>
|
|
53
168
|
* ```
|
|
54
169
|
*
|
|
170
|
+
* @accessibility
|
|
171
|
+
* - Implements WAI-ARIA separator role automatically
|
|
172
|
+
* - Supports both decorative (visual-only) and semantic modes
|
|
173
|
+
* - When decorative=false, separator is announced by screen readers
|
|
174
|
+
* - Proper ARIA labeling support via aria-label or aria-labelledby
|
|
175
|
+
* - Orientation communicated via data-orientation attribute
|
|
176
|
+
* - Supports interactive separators with ARIA value properties
|
|
177
|
+
* - Keyboard navigation ready for focusable separator implementations
|
|
178
|
+
*
|
|
179
|
+
* @see {@link Button} for related interactive elements
|
|
55
180
|
* @see {@link https://ui.shadcn.com/docs/components/separator} for design patterns
|
|
181
|
+
* @see {@link https://www.radix-ui.com/primitives/docs/components/separator} for Radix UI API
|
|
182
|
+
* @see {@link https://www.w3.org/WAI/ARIA/apg/patterns/separator/} for ARIA separator pattern
|
|
56
183
|
* @since 1.0.0
|
|
57
|
-
* @see {@link https://www.radix-ui.com/primitives/docs/components/separator} for API reference
|
|
58
|
-
*/
|
|
59
|
-
/**
|
|
60
|
-
* Props for the Separator component
|
|
61
|
-
*/
|
|
62
|
-
type SeparatorProps = React.ComponentProps<typeof SeparatorPrimitive.Root> & {
|
|
63
|
-
/** Additional CSS class names to apply to the separator */
|
|
64
|
-
className?: string;
|
|
65
|
-
/** The orientation of the separator. @default "horizontal" */
|
|
66
|
-
orientation?: "horizontal" | "vertical";
|
|
67
|
-
/** Whether the separator is purely decorative (hidden from screen readers). @default true */
|
|
68
|
-
decorative?: boolean;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Separator component implementation
|
|
73
|
-
*
|
|
74
|
-
* @param className - Additional CSS class names to apply
|
|
75
|
-
* @param orientation - The orientation of the separator ("horizontal" | "vertical")
|
|
76
|
-
* @param decorative - Whether the separator is decorative (hidden from screen readers)
|
|
77
|
-
* @param props - Additional props passed to the underlying Radix Separator primitive
|
|
78
184
|
*/
|
|
79
185
|
function Separator({
|
|
80
186
|
className,
|
|
81
187
|
orientation = "horizontal",
|
|
82
188
|
decorative = true,
|
|
83
189
|
...props
|
|
84
|
-
}:
|
|
190
|
+
}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
|
|
85
191
|
return (
|
|
86
192
|
<SeparatorPrimitive.Root
|
|
87
193
|
data-slot="separator"
|
|
@@ -98,4 +204,4 @@ function Separator({
|
|
|
98
204
|
|
|
99
205
|
Separator.displayName = "Separator";
|
|
100
206
|
|
|
101
|
-
export { Separator
|
|
207
|
+
export { Separator };
|