@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
|
@@ -1,192 +1,333 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Spacing options for Stack component using Tailwind CSS spacing scale
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* Maps to Tailwind spacing utilities:
|
|
6
|
+
* - 1 = 0.25rem (4px) - Ultra-tight spacing for dense layouts
|
|
7
|
+
* - 2 = 0.5rem (8px) - Tight spacing for compact components
|
|
8
|
+
* - 3 = 0.75rem (12px) - Close spacing for related items
|
|
9
|
+
* - 4 = 1rem (16px) - Default spacing for general layouts
|
|
10
|
+
* - 6 = 1.5rem (24px) - Loose spacing for section separation
|
|
11
|
+
* - 8 = 2rem (32px) - Wide spacing for distinct content areas
|
|
12
|
+
* - 12 = 3rem (48px) - Extra-wide spacing for major layout divisions
|
|
6
13
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* @example
|
|
16
|
-
* ```tsx
|
|
17
|
-
* // Tight spacing for compact layouts
|
|
18
|
-
* <Stack spacing={2}>
|
|
19
|
-
* <Button>Save</Button>
|
|
20
|
-
* <Button>Cancel</Button>
|
|
21
|
-
* </Stack>
|
|
22
|
-
*
|
|
23
|
-
* // Generous spacing for section separation
|
|
24
|
-
* <Stack spacing={8}>
|
|
25
|
-
* <section>First section</section>
|
|
26
|
-
* <section>Second section</section>
|
|
27
|
-
* </Stack>
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
spacing?: 1 | 2 | 3 | 4 | 6 | 8 | 12;
|
|
31
|
-
/**
|
|
32
|
-
* The layout direction of the stack
|
|
33
|
-
*
|
|
34
|
-
* - `"vertical"` - Arranges children in a column with vertical spacing
|
|
35
|
-
* - `"horizontal"` - Arranges children in a row with horizontal spacing
|
|
36
|
-
*
|
|
37
|
-
* @defaultValue "vertical"
|
|
38
|
-
* @example
|
|
39
|
-
* ```tsx
|
|
40
|
-
* // Vertical stack (default)
|
|
41
|
-
* <Stack>
|
|
42
|
-
* <Card>Item 1</Card>
|
|
43
|
-
* <Card>Item 2</Card>
|
|
44
|
-
* </Stack>
|
|
45
|
-
*
|
|
46
|
-
* // Horizontal stack for action buttons
|
|
47
|
-
* <Stack direction="horizontal">
|
|
48
|
-
* <Button>Primary</Button>
|
|
49
|
-
* <Button variant="outline">Secondary</Button>
|
|
50
|
-
* </Stack>
|
|
51
|
-
* ```
|
|
52
|
-
*/
|
|
53
|
-
direction?: "vertical" | "horizontal";
|
|
54
|
-
};
|
|
14
|
+
type StackSpacing = 1 | 2 | 3 | 4 | 6 | 8 | 12;
|
|
15
|
+
/**
|
|
16
|
+
* Layout direction options for Stack component
|
|
17
|
+
*
|
|
18
|
+
* - "vertical" - Flex column layout with space-y-* utilities
|
|
19
|
+
* - "horizontal" - Flex row layout with space-x-* utilities
|
|
20
|
+
*/
|
|
21
|
+
type StackDirection = "vertical" | "horizontal";
|
|
55
22
|
/**
|
|
56
23
|
* Stack - A flexible layout component for consistent spacing between elements
|
|
57
24
|
*
|
|
58
25
|
* Stack is a fundamental layout primitive that arranges child elements in either
|
|
59
26
|
* vertical or horizontal direction with consistent spacing. Built on flexbox principles,
|
|
60
|
-
* it provides a clean API for common layout patterns without requiring
|
|
27
|
+
* it provides a clean, declarative API for common layout patterns without requiring
|
|
28
|
+
* custom CSS or complex flex configurations.
|
|
29
|
+
*
|
|
30
|
+
* **Core Features:**
|
|
31
|
+
* - Consistent spacing using Tailwind's design system
|
|
32
|
+
* - Flexible direction control (vertical/horizontal)
|
|
33
|
+
* - Zero-config flexbox layouts with predictable behavior
|
|
34
|
+
* - Composable with other UI components and layout utilities
|
|
35
|
+
* - Full accessibility support with semantic HTML structure
|
|
36
|
+
* - TypeScript-first with comprehensive prop validation
|
|
61
37
|
*
|
|
62
|
-
*
|
|
38
|
+
* **Common Use Cases:**
|
|
63
39
|
* - Form layouts with consistent field spacing
|
|
64
40
|
* - Button groups and action bars
|
|
65
41
|
* - Content sections with uniform gaps
|
|
66
|
-
* - Navigation lists and
|
|
67
|
-
* - Card layouts and
|
|
42
|
+
* - Navigation lists and menu structures
|
|
43
|
+
* - Card layouts and dashboard grids
|
|
44
|
+
* - Page sections and content hierarchy
|
|
45
|
+
* - Responsive component layouts
|
|
68
46
|
*
|
|
69
|
-
*
|
|
47
|
+
* **Design System Integration:**
|
|
48
|
+
* Stack integrates seamlessly with design systems by providing consistent
|
|
49
|
+
* spacing that aligns with Tailwind's spacing scale. This ensures visual
|
|
50
|
+
* harmony across your application and reduces the need for custom spacing
|
|
51
|
+
* utilities in most common layout scenarios.
|
|
52
|
+
*
|
|
53
|
+
* @example Basic vertical content layout (default behavior)
|
|
70
54
|
* ```tsx
|
|
71
55
|
* <Stack>
|
|
72
|
-
* <
|
|
73
|
-
* <Card>
|
|
74
|
-
*
|
|
56
|
+
* <h1>Dashboard</h1>
|
|
57
|
+
* <Card>
|
|
58
|
+
* <CardHeader>Profile Information</CardHeader>
|
|
59
|
+
* <CardContent>User profile details</CardContent>
|
|
60
|
+
* </Card>
|
|
61
|
+
* <Card>
|
|
62
|
+
* <CardHeader>Account Settings</CardHeader>
|
|
63
|
+
* <CardContent>Account configuration options</CardContent>
|
|
64
|
+
* </Card>
|
|
65
|
+
* <Card>
|
|
66
|
+
* <CardHeader>Privacy Controls</CardHeader>
|
|
67
|
+
* <CardContent>Privacy and security settings</CardContent>
|
|
68
|
+
* </Card>
|
|
75
69
|
* </Stack>
|
|
76
70
|
* ```
|
|
77
71
|
*
|
|
78
|
-
* @example Horizontal action bar
|
|
72
|
+
* @example Horizontal action button bar
|
|
79
73
|
* ```tsx
|
|
80
|
-
* <Stack direction="horizontal" spacing={3}>
|
|
81
|
-
* <Button>
|
|
82
|
-
* <Button variant="outline">
|
|
83
|
-
* <Button
|
|
74
|
+
* <Stack direction="horizontal" spacing={3} className="justify-end">
|
|
75
|
+
* <Button variant="ghost">Cancel</Button>
|
|
76
|
+
* <Button variant="outline">Save Draft</Button>
|
|
77
|
+
* <Button>Publish</Button>
|
|
84
78
|
* </Stack>
|
|
85
79
|
* ```
|
|
86
80
|
*
|
|
87
|
-
* @example
|
|
81
|
+
* @example Complex form layout with nested stacks
|
|
88
82
|
* ```tsx
|
|
89
|
-
* <
|
|
90
|
-
* <
|
|
91
|
-
*
|
|
92
|
-
* <
|
|
93
|
-
* <
|
|
94
|
-
* <
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
83
|
+
* <form>
|
|
84
|
+
* <Stack spacing={6}>
|
|
85
|
+
* // Personal Information Section
|
|
86
|
+
* <fieldset>
|
|
87
|
+
* <legend className="text-lg font-semibold mb-4">Personal Information</legend>
|
|
88
|
+
* <Stack spacing={3}>
|
|
89
|
+
* <Stack spacing={1}>
|
|
90
|
+
* <Label htmlFor="fullName">Full Name</Label>
|
|
91
|
+
* <Input id="fullName" placeholder="Enter your full name" />
|
|
92
|
+
* </Stack>
|
|
93
|
+
* <Stack spacing={1}>
|
|
94
|
+
* <Label htmlFor="email">Email Address</Label>
|
|
95
|
+
* <Input id="email" type="email" placeholder="you@example.com" />
|
|
96
|
+
* </Stack>
|
|
97
|
+
* </Stack>
|
|
98
|
+
* </fieldset>
|
|
99
|
+
*
|
|
100
|
+
* // Preferences Section
|
|
101
|
+
* <fieldset>
|
|
102
|
+
* <legend className="text-lg font-semibold mb-4">Preferences</legend>
|
|
103
|
+
* <Stack spacing={2}>
|
|
104
|
+
* <div className="flex items-center space-x-2">
|
|
105
|
+
* <Checkbox id="emailNotifications" />
|
|
106
|
+
* <Label htmlFor="emailNotifications">Email notifications</Label>
|
|
107
|
+
* </div>
|
|
108
|
+
* <div className="flex items-center space-x-2">
|
|
109
|
+
* <Checkbox id="marketingUpdates" />
|
|
110
|
+
* <Label htmlFor="marketingUpdates">Marketing updates</Label>
|
|
111
|
+
* </div>
|
|
112
|
+
* </Stack>
|
|
113
|
+
* </fieldset>
|
|
114
|
+
*
|
|
115
|
+
* // Form Actions
|
|
116
|
+
* <Stack direction="horizontal" spacing={2} className="justify-end">
|
|
117
|
+
* <Button type="button" variant="outline">Reset</Button>
|
|
118
|
+
* <Button type="submit">Save Changes</Button>
|
|
102
119
|
* </Stack>
|
|
103
|
-
* </
|
|
104
|
-
* </
|
|
120
|
+
* </Stack>
|
|
121
|
+
* </form>
|
|
105
122
|
* ```
|
|
106
123
|
*
|
|
107
|
-
* @example Responsive
|
|
124
|
+
* @example Responsive navigation with adaptive direction
|
|
108
125
|
* ```tsx
|
|
109
126
|
* <Stack
|
|
110
|
-
*
|
|
111
|
-
*
|
|
127
|
+
* direction="horizontal"
|
|
128
|
+
* spacing={1}
|
|
129
|
+
* className="flex-col sm:flex-row overflow-x-auto sm:overflow-visible"
|
|
112
130
|
* >
|
|
113
|
-
* <
|
|
114
|
-
* <
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
* </Stack>
|
|
131
|
+
* <Button variant="ghost" className="w-full sm:w-auto">Dashboard</Button>
|
|
132
|
+
* <Button variant="ghost" className="w-full sm:w-auto">Analytics</Button>
|
|
133
|
+
* <Button variant="ghost" className="w-full sm:w-auto">Settings</Button>
|
|
134
|
+
* <Button variant="ghost" className="w-full sm:w-auto">Help</Button>
|
|
118
135
|
* </Stack>
|
|
119
136
|
* ```
|
|
120
137
|
*
|
|
138
|
+
* @example Dashboard layout with mixed content types
|
|
139
|
+
* ```tsx
|
|
140
|
+
* <div className="container mx-auto p-6">
|
|
141
|
+
* <Stack spacing={8}>
|
|
142
|
+
* // Page Header
|
|
143
|
+
* <Stack spacing={2}>
|
|
144
|
+
* <h1 className="text-3xl font-bold">Analytics Dashboard</h1>
|
|
145
|
+
* <p className="text-muted-foreground">Overview of your application metrics</p>
|
|
146
|
+
* </Stack>
|
|
147
|
+
*
|
|
148
|
+
* // Stats Cards
|
|
149
|
+
* <Stack direction="horizontal" spacing={4} className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
|
150
|
+
* <Card>
|
|
151
|
+
* <CardHeader>
|
|
152
|
+
* <CardTitle>Total Users</CardTitle>
|
|
153
|
+
* </CardHeader>
|
|
154
|
+
* <CardContent>
|
|
155
|
+
* <div className="text-2xl font-bold">2,543</div>
|
|
156
|
+
* </CardContent>
|
|
157
|
+
* </Card>
|
|
158
|
+
* <Card>
|
|
159
|
+
* <CardHeader>
|
|
160
|
+
* <CardTitle>Revenue</CardTitle>
|
|
161
|
+
* </CardHeader>
|
|
162
|
+
* <CardContent>
|
|
163
|
+
* <div className="text-2xl font-bold">$12,543</div>
|
|
164
|
+
* </CardContent>
|
|
165
|
+
* </Card>
|
|
166
|
+
* <Card>
|
|
167
|
+
* <CardHeader>
|
|
168
|
+
* <CardTitle>Growth</CardTitle>
|
|
169
|
+
* </CardHeader>
|
|
170
|
+
* <CardContent>
|
|
171
|
+
* <div className="text-2xl font-bold text-green-600">+12.5%</div>
|
|
172
|
+
* </CardContent>
|
|
173
|
+
* </Card>
|
|
174
|
+
* </Stack>
|
|
175
|
+
*
|
|
176
|
+
* // Content Sections
|
|
177
|
+
* <Stack spacing={6}>
|
|
178
|
+
* <Card>
|
|
179
|
+
* <CardHeader>
|
|
180
|
+
* <CardTitle>Recent Activity</CardTitle>
|
|
181
|
+
* </CardHeader>
|
|
182
|
+
* <CardContent>Activity timeline content</CardContent>
|
|
183
|
+
* </Card>
|
|
184
|
+
* <Card>
|
|
185
|
+
* <CardHeader>
|
|
186
|
+
* <CardTitle>Performance Metrics</CardTitle>
|
|
187
|
+
* </CardHeader>
|
|
188
|
+
* <CardContent>Charts and graphs</CardContent>
|
|
189
|
+
* </Card>
|
|
190
|
+
* </Stack>
|
|
191
|
+
* </Stack>
|
|
192
|
+
* </div>
|
|
193
|
+
* ```
|
|
194
|
+
*
|
|
195
|
+
* @example Advanced usage with custom styling and semantic elements
|
|
196
|
+
* ```tsx
|
|
197
|
+
* <article className="prose max-w-none">
|
|
198
|
+
* <Stack spacing={6}>
|
|
199
|
+
* <header>
|
|
200
|
+
* <Stack spacing={2}>
|
|
201
|
+
* <h1>The Future of Web Development</h1>
|
|
202
|
+
* <Stack direction="horizontal" spacing={4} className="text-sm text-muted-foreground">
|
|
203
|
+
* <time dateTime="2024-01-15">January 15, 2024</time>
|
|
204
|
+
* <address className="not-italic">By Jane Developer</address>
|
|
205
|
+
* <span>5 min read</span>
|
|
206
|
+
* </Stack>
|
|
207
|
+
* </Stack>
|
|
208
|
+
* </header>
|
|
209
|
+
*
|
|
210
|
+
* <main>
|
|
211
|
+
* <Stack spacing={4}>
|
|
212
|
+
* <p>Introduction paragraph with key concepts...</p>
|
|
213
|
+
* <section>
|
|
214
|
+
* <h2>Key Technologies</h2>
|
|
215
|
+
* <Stack spacing={3}>
|
|
216
|
+
* <p>Discussion of modern web technologies...</p>
|
|
217
|
+
* <ul>
|
|
218
|
+
* <li>React and component architecture</li>
|
|
219
|
+
* <li>Server-side rendering with Next.js</li>
|
|
220
|
+
* <li>Type-safe development with TypeScript</li>
|
|
221
|
+
* </ul>
|
|
222
|
+
* </Stack>
|
|
223
|
+
* </section>
|
|
224
|
+
* <section>
|
|
225
|
+
* <h2>Best Practices</h2>
|
|
226
|
+
* <p>Guidelines for effective development...</p>
|
|
227
|
+
* </section>
|
|
228
|
+
* </Stack>
|
|
229
|
+
* </main>
|
|
230
|
+
*
|
|
231
|
+
* <footer>
|
|
232
|
+
* <Stack direction="horizontal" spacing={2} className="justify-between items-center">
|
|
233
|
+
* <Stack direction="horizontal" spacing={1}>
|
|
234
|
+
* <Badge variant="secondary">React</Badge>
|
|
235
|
+
* <Badge variant="secondary">TypeScript</Badge>
|
|
236
|
+
* <Badge variant="secondary">Next.js</Badge>
|
|
237
|
+
* </Stack>
|
|
238
|
+
* <Stack direction="horizontal" spacing={2}>
|
|
239
|
+
* <Button variant="outline" size="sm">Share</Button>
|
|
240
|
+
* <Button variant="outline" size="sm">Save</Button>
|
|
241
|
+
* </Stack>
|
|
242
|
+
* </Stack>
|
|
243
|
+
* </footer>
|
|
244
|
+
* </Stack>
|
|
245
|
+
* </article>
|
|
246
|
+
* ```
|
|
247
|
+
*
|
|
121
248
|
* @remarks
|
|
122
249
|
* **Design Philosophy:**
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
* **
|
|
129
|
-
* -
|
|
130
|
-
* -
|
|
131
|
-
* -
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
* -
|
|
137
|
-
* -
|
|
250
|
+
* Stack follows the principle of consistent spacing throughout the UI, using Tailwind's
|
|
251
|
+
* carefully crafted spacing scale to create visual hierarchy and rhythm. The component
|
|
252
|
+
* prioritizes composability, allowing complex layouts to be built from simple, predictable
|
|
253
|
+
* building blocks while maintaining semantic HTML structure.
|
|
254
|
+
*
|
|
255
|
+
* **Technical Implementation:**
|
|
256
|
+
* - Uses CSS Flexbox for reliable cross-browser layout behavior
|
|
257
|
+
* - Leverages Tailwind's space-* utilities for optimal performance
|
|
258
|
+
* - Applies margins only to children (not first child) for clean edge handling
|
|
259
|
+
* - Compatible with Tailwind's JIT compilation for minimal bundle size
|
|
260
|
+
* - Supports all standard HTML div attributes for maximum flexibility
|
|
261
|
+
*
|
|
262
|
+
* **Performance Considerations:**
|
|
263
|
+
* - Zero JavaScript runtime overhead - pure CSS-based layout
|
|
264
|
+
* - Optimized for Tailwind's purging and JIT compilation
|
|
265
|
+
* - Efficient rendering with no layout calculation overhead
|
|
266
|
+
* - Scales well with large numbers of child elements
|
|
267
|
+
* - Memory-efficient with minimal DOM structure impact
|
|
268
|
+
*
|
|
269
|
+
* **Responsive Design Integration:**
|
|
270
|
+
* Stack works seamlessly with Tailwind's responsive utilities. You can easily
|
|
271
|
+
* create adaptive layouts that change direction, spacing, or additional styling
|
|
272
|
+
* based on screen size breakpoints.
|
|
273
|
+
*
|
|
274
|
+
* **Common Patterns:**
|
|
275
|
+
* - **Form Layouts**: Use nested stacks for sections, fields, and actions
|
|
276
|
+
* - **Content Hierarchies**: Vary spacing to create visual importance levels
|
|
277
|
+
* - **Component Composition**: Combine with Cards, Buttons, and other components
|
|
278
|
+
* - **Responsive Grids**: Use with CSS Grid classes for complex layouts
|
|
279
|
+
* - **Navigation Patterns**: Create horizontal and vertical navigation structures
|
|
280
|
+
*
|
|
281
|
+
* @accessibility
|
|
282
|
+
* **Keyboard Navigation:**
|
|
283
|
+
* - Preserves natural document flow and tab order
|
|
284
|
+
* - Does not interfere with focus management of child components
|
|
285
|
+
* - Maintains logical reading order for screen readers
|
|
286
|
+
* - Supports all standard keyboard navigation patterns
|
|
287
|
+
*
|
|
288
|
+
* **Screen Reader Support:**
|
|
289
|
+
* - Uses semantic HTML div element with no interference
|
|
290
|
+
* - Preserves natural content structure and hierarchy
|
|
291
|
+
* - Compatible with all ARIA attributes on child elements
|
|
292
|
+
* - Supports landmark roles when used with semantic HTML
|
|
293
|
+
* - Maintains proper heading structure and content relationships
|
|
294
|
+
*
|
|
295
|
+
* **ARIA Compatibility:**
|
|
296
|
+
* - Accepts all ARIA attributes for enhanced accessibility
|
|
297
|
+
* - Does not modify or interfere with child component ARIA properties
|
|
298
|
+
* - Supports role attributes for semantic meaning
|
|
299
|
+
* - Compatible with aria-label, aria-describedby, and other ARIA properties
|
|
300
|
+
*
|
|
301
|
+
* **Focus Management:**
|
|
302
|
+
* - Transparent to focus behavior - delegates to child components
|
|
303
|
+
* - Supports tabIndex for custom focus control when needed
|
|
304
|
+
* - Does not trap or redirect focus automatically
|
|
305
|
+
* - Maintains predictable focus flow in both directions
|
|
306
|
+
*
|
|
307
|
+
* @performance
|
|
308
|
+
* **Bundle Impact:**
|
|
309
|
+
* - Minimal JavaScript bundle size (primarily TypeScript types)
|
|
310
|
+
* - CSS-only layout solution with no runtime calculations
|
|
311
|
+
* - Leverages Tailwind's tree-shaking for optimal CSS output
|
|
312
|
+
* - No external dependencies beyond React and utility functions
|
|
313
|
+
*
|
|
314
|
+
* **Runtime Performance:**
|
|
315
|
+
* - Zero-cost abstraction over native flexbox
|
|
316
|
+
* - No re-renders triggered by prop changes (style-based)
|
|
317
|
+
* - Efficient DOM structure with single wrapper element
|
|
318
|
+
* - Compatible with React's concurrent features and optimizations
|
|
138
319
|
*
|
|
139
320
|
* @public
|
|
140
321
|
* @since 1.0.0
|
|
322
|
+
* @see {@link Button} For action elements commonly used in horizontal stacks
|
|
323
|
+
* @see {@link Card} For content containers commonly arranged in stacks
|
|
141
324
|
* @see {@link https://tailwindcss.com/docs/space} Tailwind CSS spacing utilities
|
|
325
|
+
* @see {@link https://tailwindcss.com/docs/flexbox-direction} Tailwind CSS flex direction
|
|
326
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout} MDN CSS Flexbox Guide
|
|
142
327
|
*/
|
|
143
328
|
declare const Stack: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
*
|
|
147
|
-
* Controls the gap between child elements using Tailwind's space utilities.
|
|
148
|
-
* Each value corresponds to a Tailwind spacing unit (1 = 0.25rem, 4 = 1rem, etc.)
|
|
149
|
-
*
|
|
150
|
-
* @defaultValue 4
|
|
151
|
-
* @example
|
|
152
|
-
* ```tsx
|
|
153
|
-
* // Tight spacing for compact layouts
|
|
154
|
-
* <Stack spacing={2}>
|
|
155
|
-
* <Button>Save</Button>
|
|
156
|
-
* <Button>Cancel</Button>
|
|
157
|
-
* </Stack>
|
|
158
|
-
*
|
|
159
|
-
* // Generous spacing for section separation
|
|
160
|
-
* <Stack spacing={8}>
|
|
161
|
-
* <section>First section</section>
|
|
162
|
-
* <section>Second section</section>
|
|
163
|
-
* </Stack>
|
|
164
|
-
* ```
|
|
165
|
-
*/
|
|
166
|
-
spacing?: 1 | 2 | 3 | 4 | 6 | 8 | 12;
|
|
167
|
-
/**
|
|
168
|
-
* The layout direction of the stack
|
|
169
|
-
*
|
|
170
|
-
* - `"vertical"` - Arranges children in a column with vertical spacing
|
|
171
|
-
* - `"horizontal"` - Arranges children in a row with horizontal spacing
|
|
172
|
-
*
|
|
173
|
-
* @defaultValue "vertical"
|
|
174
|
-
* @example
|
|
175
|
-
* ```tsx
|
|
176
|
-
* // Vertical stack (default)
|
|
177
|
-
* <Stack>
|
|
178
|
-
* <Card>Item 1</Card>
|
|
179
|
-
* <Card>Item 2</Card>
|
|
180
|
-
* </Stack>
|
|
181
|
-
*
|
|
182
|
-
* // Horizontal stack for action buttons
|
|
183
|
-
* <Stack direction="horizontal">
|
|
184
|
-
* <Button>Primary</Button>
|
|
185
|
-
* <Button variant="outline">Secondary</Button>
|
|
186
|
-
* </Stack>
|
|
187
|
-
* ```
|
|
188
|
-
*/
|
|
189
|
-
direction?: "vertical" | "horizontal";
|
|
329
|
+
spacing?: StackSpacing;
|
|
330
|
+
direction?: StackDirection;
|
|
190
331
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
191
332
|
export { Stack };
|
|
192
333
|
//# sourceMappingURL=stack.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../../../src/components/ui/stack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B
|
|
1
|
+
{"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../../../src/components/ui/stack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B;;;;;;;;;;;GAWG;AACH,KAAK,YAAY,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;AAE/C;;;;;GAKG;AACH,KAAK,cAAc,GAAG,UAAU,GAAG,YAAY,CAAC;AAuIhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiTG;AACH,QAAA,MAAM,KAAK;cAGG,YAAY;gBACV,cAAc;wCA6B5B,CAAC;AAIH,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import { AspectRatio } from "../aspect-ratio";
|
|
3
2
|
declare const meta: {
|
|
4
3
|
title: string;
|
|
5
|
-
component:
|
|
4
|
+
component: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-aspect-ratio").AspectRatioProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
5
|
parameters: {
|
|
7
6
|
layout: string;
|
|
8
7
|
docs: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aspect-ratio.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/stories/aspect-ratio.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"aspect-ratio.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/stories/aspect-ratio.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAG5D,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0B0B,CAAC;AAErC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KAoBzB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,KAgDtB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,KAiFvB,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Container } from "../container";
|
|
2
3
|
declare const meta: {
|
|
3
4
|
title: string;
|
|
4
|
-
component:
|
|
5
|
-
size?: "sm" | "md" | "lg" | "xl" | "full";
|
|
6
|
-
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
component: typeof Container;
|
|
7
6
|
parameters: {
|
|
8
7
|
layout: string;
|
|
9
8
|
docs: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/stories/container.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"container.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/stories/container.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BwB,CAAC;AAEnC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,WAAW,EAAE,KA6BzB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KA+DtB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAmHvB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { StoryObj } from "@storybook/react-vite";
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
component: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
5
5
|
title: string;
|
|
6
6
|
description?: string;
|
|
7
7
|
icon?: React.ReactNode;
|
|
@@ -9,7 +9,7 @@ declare const meta: {
|
|
|
9
9
|
label: string;
|
|
10
10
|
onClick: () => void;
|
|
11
11
|
};
|
|
12
|
-
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
|
+
}, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
13
|
parameters: {
|
|
14
14
|
layout: string;
|
|
15
15
|
docs: {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import { ScrollArea } from "../scroll-area";
|
|
3
2
|
declare const meta: {
|
|
4
3
|
title: string;
|
|
5
|
-
component:
|
|
4
|
+
component: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-scroll-area").ScrollAreaProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
5
|
parameters: {
|
|
7
6
|
layout: string;
|
|
8
7
|
docs: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-area.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/stories/scroll-area.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"scroll-area.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/stories/scroll-area.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAG5D,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;CAuByB,CAAC;AAEpC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,WAAW,EAAE,KA8BzB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAoDtB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KA8DvB,CAAC"}
|
|
@@ -3,7 +3,7 @@ declare const meta: {
|
|
|
3
3
|
title: string;
|
|
4
4
|
component: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & {
|
|
5
5
|
spacing?: 1 | 2 | 3 | 4 | 6 | 8 | 12;
|
|
6
|
-
direction?: "
|
|
6
|
+
direction?: "horizontal" | "vertical";
|
|
7
7
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
8
|
parameters: {
|
|
9
9
|
layout: string;
|
|
@@ -2,7 +2,13 @@ import type { StoryObj } from "@storybook/react-vite";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: React.ForwardRefExoticComponent<Omit<
|
|
5
|
+
component: React.ForwardRefExoticComponent<Omit<{
|
|
6
|
+
label?: string;
|
|
7
|
+
helperText?: string;
|
|
8
|
+
error?: string;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
} & Omit<React.ClassAttributes<HTMLInputElement> & React.InputHTMLAttributes<HTMLInputElement>, "className">, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
6
12
|
parameters: {
|
|
7
13
|
layout: string;
|
|
8
14
|
docs: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/stories/text-field.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,QAAA,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"text-field.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/stories/text-field.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4CwB,CAAC;AAEnC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KAczB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,KAiFtB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,KAiHvB,CAAC"}
|