@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,114 +1,266 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
+
|
|
2
4
|
import { cn } from "@/lib/utils";
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
|
-
*
|
|
7
|
+
* Container variant configuration using class-variance-authority
|
|
8
|
+
*
|
|
9
|
+
* Defines responsive layout container with consistent horizontal centering and padding
|
|
10
|
+
* across different viewport sizes. Uses Tailwind CSS for responsive design patterns
|
|
11
|
+
* and maintains consistent spacing throughout the application.
|
|
6
12
|
*
|
|
7
|
-
* @
|
|
13
|
+
* @variant sm - Optimal reading width (48rem) for articles, blog posts, and long-form content
|
|
14
|
+
* @variant md - Medium container (64rem) suitable for forms, documentation, and structured layouts
|
|
15
|
+
* @variant lg - Large container (80rem) ideal for main application content, dashboards, and data tables
|
|
16
|
+
* @variant xl - Extra-large container with no max-width but maintains responsive padding for specialized layouts
|
|
17
|
+
* @variant full - Full-width container for edge-to-edge designs, hero sections, and complex grid layouts
|
|
18
|
+
*
|
|
19
|
+
* @see {@link https://cva.style/docs} - CVA documentation
|
|
20
|
+
* @see {@link https://tailwindcss.com/docs/container} - Tailwind CSS container documentation
|
|
21
|
+
* @since 1.0.0
|
|
8
22
|
*/
|
|
9
|
-
|
|
23
|
+
const containerVariants = cva("mx-auto w-full px-4 sm:px-6 lg:px-8", {
|
|
24
|
+
variants: {
|
|
25
|
+
size: {
|
|
26
|
+
sm: "max-w-3xl",
|
|
27
|
+
md: "max-w-5xl",
|
|
28
|
+
lg: "max-w-7xl",
|
|
29
|
+
xl: "max-w-none",
|
|
30
|
+
full: "max-w-full",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
defaultVariants: {
|
|
34
|
+
size: "lg",
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Props for Container (Documentation only - NOT used in component implementation)
|
|
40
|
+
* These types are for documentation generation and should not replace CVA inferred types
|
|
41
|
+
*/
|
|
42
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
43
|
+
type ContainerDocsProps = {
|
|
10
44
|
/**
|
|
11
|
-
*
|
|
45
|
+
* Container size variant that determines the maximum width and responsive behavior
|
|
12
46
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* - `lg`: max-w-7xl (80rem) - Default size, ideal for main application content and dashboards
|
|
16
|
-
* - `xl`: max-w-none - No max-width constraint but maintains responsive padding
|
|
17
|
-
* - `full`: max-w-full - Full width container for edge-to-edge designs
|
|
47
|
+
* Controls the container's max-width while maintaining consistent horizontal padding
|
|
48
|
+
* across all breakpoints. Each size is optimized for different content types and layouts.
|
|
18
49
|
*
|
|
19
50
|
* @default "lg"
|
|
20
51
|
*/
|
|
21
52
|
size?: "sm" | "md" | "lg" | "xl" | "full";
|
|
22
|
-
|
|
53
|
+
/** Content to display inside the container (text, components, or React elements) */
|
|
54
|
+
children?: React.ReactNode;
|
|
55
|
+
/** Additional CSS classes to apply to the container for custom styling */
|
|
56
|
+
className?: string;
|
|
57
|
+
/** Unique identifier for the container element */
|
|
58
|
+
id?: string;
|
|
59
|
+
/** ARIA role to define the semantic purpose of the container */
|
|
60
|
+
role?: string;
|
|
61
|
+
/** ARIA label for screen reader accessibility */
|
|
62
|
+
"aria-label"?: string;
|
|
63
|
+
/** Associates the container with elements that label it */
|
|
64
|
+
"aria-labelledby"?: string;
|
|
65
|
+
/** Associates the container with elements that describe it */
|
|
66
|
+
"aria-describedby"?: string;
|
|
67
|
+
/** Indicates if the container holds live content that should be announced to screen readers */
|
|
68
|
+
"aria-live"?: "off" | "polite" | "assertive";
|
|
69
|
+
/** Tab index for focus management @default undefined (not focusable) */
|
|
70
|
+
tabIndex?: number;
|
|
71
|
+
/** Click handler function called when the container is clicked */
|
|
72
|
+
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
73
|
+
/** Focus handler called when the container receives focus */
|
|
74
|
+
onFocus?: React.FocusEventHandler<HTMLDivElement>;
|
|
75
|
+
/** Blur handler called when the container loses focus */
|
|
76
|
+
onBlur?: React.FocusEventHandler<HTMLDivElement>;
|
|
77
|
+
/** Key down handler for keyboard interactions */
|
|
78
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
|
|
79
|
+
/** Mouse enter handler for hover interactions */
|
|
80
|
+
onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
|
|
81
|
+
/** Mouse leave handler for hover interactions */
|
|
82
|
+
onMouseLeave?: React.MouseEventHandler<HTMLDivElement>;
|
|
83
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
23
84
|
|
|
24
85
|
/**
|
|
25
|
-
* A responsive
|
|
86
|
+
* Container - A responsive layout wrapper with flexible width constraints and consistent padding
|
|
87
|
+
*
|
|
88
|
+
* A fundamental layout component built with class-variance-authority (CVA) that provides consistent
|
|
89
|
+
* horizontal centering, responsive padding, and flexible max-width constraints. Designed to be the
|
|
90
|
+
* primary content wrapper for pages, sections, and layout regions throughout the application.
|
|
26
91
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
92
|
+
* The component automatically applies responsive horizontal padding (px-4 on mobile, px-6 on small
|
|
93
|
+
* screens, px-8 on large screens) and centers content using mx-auto. Five size variants accommodate
|
|
94
|
+
* different content types from optimal reading widths to full-width layouts.
|
|
30
95
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* - Medium containers for forms and documentation
|
|
34
|
-
* - Large containers for application dashboards
|
|
35
|
-
* - Extra-large and full-width for specialized layouts
|
|
96
|
+
* Built following shadcn/ui and Tailwind UI patterns for maximum compatibility and consistency
|
|
97
|
+
* with modern React applications and design systems.
|
|
36
98
|
*
|
|
37
|
-
* @example
|
|
99
|
+
* @example
|
|
38
100
|
* ```tsx
|
|
101
|
+
* // Basic usage with default large size (80rem max-width)
|
|
39
102
|
* <Container>
|
|
40
|
-
* <h1>Dashboard
|
|
41
|
-
* <p>Main application content with
|
|
103
|
+
* <h1>Dashboard Overview</h1>
|
|
104
|
+
* <p>Main application content with balanced width constraints</p>
|
|
105
|
+
* <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
|
106
|
+
* <Card>Dashboard Widget</Card>
|
|
107
|
+
* <Card>Analytics Panel</Card>
|
|
108
|
+
* <Card>Recent Activity</Card>
|
|
109
|
+
* </div>
|
|
42
110
|
* </Container>
|
|
43
111
|
* ```
|
|
44
112
|
*
|
|
45
|
-
* @example
|
|
113
|
+
* @example
|
|
46
114
|
* ```tsx
|
|
115
|
+
* // Reading-optimized container for articles and blog posts
|
|
47
116
|
* <Container size="sm">
|
|
48
|
-
* <article>
|
|
49
|
-
* <h1>
|
|
50
|
-
* <p>
|
|
117
|
+
* <article className="prose prose-lg max-w-none">
|
|
118
|
+
* <h1>The Future of Web Development</h1>
|
|
119
|
+
* <p>
|
|
120
|
+
* Long-form content with line lengths optimized for readability
|
|
121
|
+
* and comfortable reading experience across all device sizes.
|
|
122
|
+
* </p>
|
|
123
|
+
* <p>
|
|
124
|
+
* The small container (48rem) provides the ideal measure for
|
|
125
|
+
* typography-focused content and sustained reading.
|
|
126
|
+
* </p>
|
|
51
127
|
* </article>
|
|
52
128
|
* </Container>
|
|
53
129
|
* ```
|
|
54
130
|
*
|
|
55
|
-
* @example
|
|
131
|
+
* @example
|
|
56
132
|
* ```tsx
|
|
133
|
+
* // Medium container for forms and structured layouts
|
|
134
|
+
* <Container size="md">
|
|
135
|
+
* <div className="space-y-8">
|
|
136
|
+
* <div className="text-center">
|
|
137
|
+
* <h2>Account Settings</h2>
|
|
138
|
+
* <p>Manage your account preferences and profile information</p>
|
|
139
|
+
* </div>
|
|
140
|
+
*
|
|
141
|
+
* <form className="space-y-6">
|
|
142
|
+
* <div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
143
|
+
* <Input label="First Name" />
|
|
144
|
+
* <Input label="Last Name" />
|
|
145
|
+
* </div>
|
|
146
|
+
* <Input label="Email Address" type="email" />
|
|
147
|
+
* <Button type="submit" className="w-full">Update Profile</Button>
|
|
148
|
+
* </form>
|
|
149
|
+
* </div>
|
|
150
|
+
* </Container>
|
|
151
|
+
* ```
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```tsx
|
|
155
|
+
* // Full-width container for complex layouts and hero sections
|
|
57
156
|
* <Container size="full">
|
|
58
|
-
* <div className="
|
|
59
|
-
* <
|
|
60
|
-
*
|
|
61
|
-
*
|
|
157
|
+
* <div className="bg-gradient-to-r from-blue-600 to-purple-600 text-white py-20">
|
|
158
|
+
* <div className="text-center space-y-6">
|
|
159
|
+
* <h1 className="text-4xl md:text-6xl font-bold">
|
|
160
|
+
* Welcome to Our Platform
|
|
161
|
+
* </h1>
|
|
162
|
+
* <p className="text-xl md:text-2xl opacity-90 max-w-3xl mx-auto">
|
|
163
|
+
* Edge-to-edge hero section with full viewport width
|
|
164
|
+
* </p>
|
|
165
|
+
* <Button size="lg" variant="secondary">
|
|
166
|
+
* Get Started
|
|
167
|
+
* </Button>
|
|
168
|
+
* </div>
|
|
169
|
+
* </div>
|
|
170
|
+
* </Container>
|
|
171
|
+
* ```
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* ```tsx
|
|
175
|
+
* // Extra-large container for data-heavy interfaces
|
|
176
|
+
* <Container size="xl" className="py-8">
|
|
177
|
+
* <div className="space-y-6">
|
|
178
|
+
* <div className="flex justify-between items-center">
|
|
179
|
+
* <h1 className="text-3xl font-bold">Analytics Dashboard</h1>
|
|
180
|
+
* <Button variant="outline">Export Data</Button>
|
|
181
|
+
* </div>
|
|
182
|
+
*
|
|
183
|
+
* // Wide data table that needs maximum available width
|
|
184
|
+
* <DataTable
|
|
185
|
+
* columns={analyticsColumns}
|
|
186
|
+
* data={analyticsData}
|
|
187
|
+
* className="min-w-[1200px]"
|
|
188
|
+
* />
|
|
189
|
+
*
|
|
190
|
+
* <div className="grid grid-cols-1 lg:grid-cols-4 gap-6">
|
|
191
|
+
* <MetricCard />
|
|
192
|
+
* <MetricCard />
|
|
193
|
+
* <MetricCard />
|
|
194
|
+
* <MetricCard />
|
|
195
|
+
* </div>
|
|
62
196
|
* </div>
|
|
63
197
|
* </Container>
|
|
64
198
|
* ```
|
|
65
199
|
*
|
|
66
|
-
* @example
|
|
200
|
+
* @example
|
|
67
201
|
* ```tsx
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
202
|
+
* // Advanced usage with custom styling and ARIA landmarks
|
|
203
|
+
* <Container
|
|
204
|
+
* size="lg"
|
|
205
|
+
* className="min-h-screen py-12 bg-gray-50 dark:bg-gray-900"
|
|
206
|
+
* role="main"
|
|
207
|
+
* aria-label="Application content"
|
|
208
|
+
* >
|
|
209
|
+
* <div className="space-y-10">
|
|
210
|
+
* <header className="text-center space-y-4">
|
|
211
|
+
* <Badge variant="secondary">New Feature</Badge>
|
|
212
|
+
* <h1 className="text-4xl font-bold tracking-tight">
|
|
213
|
+
* Product Announcement
|
|
214
|
+
* </h1>
|
|
215
|
+
* <p className="text-lg text-muted-foreground max-w-2xl mx-auto">
|
|
216
|
+
* Discover the latest improvements to our platform
|
|
217
|
+
* </p>
|
|
218
|
+
* </header>
|
|
219
|
+
*
|
|
220
|
+
* <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
|
221
|
+
* <FeatureCard />
|
|
222
|
+
* <FeatureCard />
|
|
223
|
+
* <FeatureCard />
|
|
224
|
+
* </div>
|
|
225
|
+
* </div>
|
|
74
226
|
* </Container>
|
|
75
227
|
* ```
|
|
76
228
|
*
|
|
77
229
|
* @accessibility
|
|
78
|
-
* - Uses semantic HTML `div` element
|
|
230
|
+
* - Uses semantic HTML `div` element with proper ARIA support
|
|
231
|
+
* - Supports all ARIA landmark roles (main, section, article, etc.)
|
|
79
232
|
* - Maintains proper focus management and keyboard navigation flow
|
|
80
|
-
* - Responsive design ensures content
|
|
233
|
+
* - Responsive design ensures content accessibility across all device sizes
|
|
81
234
|
* - Text content automatically reflows for optimal readability
|
|
82
|
-
* - Compatible with
|
|
235
|
+
* - Compatible with screen readers and assistive technologies
|
|
236
|
+
* - Supports high contrast themes and respects user preference settings
|
|
237
|
+
* - Browser zoom support up to 200% with maintained usability
|
|
238
|
+
* - Responsive padding prevents content from touching screen edges
|
|
239
|
+
* - Container centering provides consistent visual balance
|
|
83
240
|
*
|
|
241
|
+
* @variant sm - Small container (48rem max-width) for optimal reading and articles
|
|
242
|
+
* @variant md - Medium container (64rem max-width) for forms and documentation
|
|
243
|
+
* @variant lg - Large container (80rem max-width) for main app content and dashboards
|
|
244
|
+
* @variant xl - Extra-large container (no max-width) for data-heavy interfaces
|
|
245
|
+
* @variant full - Full-width container for hero sections and edge-to-edge layouts
|
|
246
|
+
*
|
|
247
|
+
* @see {@link containerVariants} CVA configuration with all styling variants
|
|
84
248
|
* @see {@link https://ui.shadcn.com/docs/components/sidebar} Sidebar component for app layouts
|
|
85
249
|
* @see {@link https://ui.shadcn.com/blocks} shadcn/ui blocks for complete layout examples
|
|
86
|
-
*
|
|
87
|
-
* @
|
|
250
|
+
* @see {@link https://tailwindcss.com/docs/container} Tailwind CSS container patterns
|
|
251
|
+
* @see {@link https://www.w3.org/WAI/ARIA/apg/patterns/landmarks/} ARIA Landmark Patterns
|
|
88
252
|
* @since 1.0.0
|
|
89
253
|
*/
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
"max-w-5xl": size === "md",
|
|
100
|
-
"max-w-7xl": size === "lg",
|
|
101
|
-
"max-w-none": size === "xl",
|
|
102
|
-
"max-w-full": size === "full",
|
|
103
|
-
},
|
|
104
|
-
className,
|
|
105
|
-
)}
|
|
106
|
-
{...props}
|
|
107
|
-
/>
|
|
108
|
-
);
|
|
109
|
-
},
|
|
110
|
-
);
|
|
254
|
+
function Container({
|
|
255
|
+
className,
|
|
256
|
+
size,
|
|
257
|
+
...props
|
|
258
|
+
}: React.ComponentProps<"div"> & VariantProps<typeof containerVariants>) {
|
|
259
|
+
return (
|
|
260
|
+
<div className={cn(containerVariants({ size, className }))} {...props} />
|
|
261
|
+
);
|
|
262
|
+
}
|
|
111
263
|
|
|
112
264
|
Container.displayName = "Container";
|
|
113
265
|
|
|
114
|
-
export { Container };
|
|
266
|
+
export { Container, containerVariants };
|