@neynar/ui 0.1.1
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/LICENSE +21 -0
- package/README.md +195 -0
- package/dist/components/ui/accordion.d.ts +229 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.d.ts +247 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert.d.ts +187 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/aspect-ratio.d.ts +94 -0
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/components/ui/avatar.d.ts +244 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/badge.d.ts +163 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb.d.ts +281 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/button.d.ts +129 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/calendar.d.ts +169 -0
- package/dist/components/ui/calendar.d.ts.map +1 -0
- package/dist/components/ui/card.d.ts +365 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/carousel.d.ts +369 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/chart.d.ts +442 -0
- package/dist/components/ui/chart.d.ts.map +1 -0
- package/dist/components/ui/checkbox.d.ts +88 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/collapsible.d.ts +182 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/combobox.d.ts +270 -0
- package/dist/components/ui/combobox.d.ts.map +1 -0
- package/dist/components/ui/command.d.ts +355 -0
- package/dist/components/ui/command.d.ts.map +1 -0
- package/dist/components/ui/container.d.ts +102 -0
- package/dist/components/ui/container.d.ts.map +1 -0
- package/dist/components/ui/context-menu.d.ts +339 -0
- package/dist/components/ui/context-menu.d.ts.map +1 -0
- package/dist/components/ui/date-picker.d.ts +145 -0
- package/dist/components/ui/date-picker.d.ts.map +1 -0
- package/dist/components/ui/dialog.d.ts +322 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/drawer.d.ts +154 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +349 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/empty-state.d.ts +133 -0
- package/dist/components/ui/empty-state.d.ts.map +1 -0
- package/dist/components/ui/hover-card.d.ts +109 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -0
- package/dist/components/ui/input.d.ts +89 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/label.d.ts +93 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/menubar.d.ts +306 -0
- package/dist/components/ui/menubar.d.ts.map +1 -0
- package/dist/components/ui/navigation-menu.d.ts +318 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/components/ui/pagination.d.ts +343 -0
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/popover.d.ts +178 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/progress.d.ts +64 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/radio-group.d.ts +144 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/resizable.d.ts +164 -0
- package/dist/components/ui/resizable.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +82 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/select.d.ts +316 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/separator.d.ts +80 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/sheet.d.ts +346 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sidebar.d.ts +1561 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -0
- package/dist/components/ui/skeleton.d.ts +66 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/slider.d.ts +95 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/sonner.d.ts +101 -0
- package/dist/components/ui/sonner.d.ts.map +1 -0
- package/dist/components/ui/stack.d.ts +192 -0
- package/dist/components/ui/stack.d.ts.map +1 -0
- package/dist/components/ui/stories/accordion.stories.d.ts +71 -0
- package/dist/components/ui/stories/accordion.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/alert-dialog.stories.d.ts +39 -0
- package/dist/components/ui/stories/alert-dialog.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/alert.stories.d.ts +48 -0
- package/dist/components/ui/stories/alert.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/aspect-ratio.stories.d.ts +53 -0
- package/dist/components/ui/stories/aspect-ratio.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/avatar.stories.d.ts +49 -0
- package/dist/components/ui/stories/avatar.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/badge.stories.d.ts +64 -0
- package/dist/components/ui/stories/badge.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/breadcrumb.stories.d.ts +27 -0
- package/dist/components/ui/stories/breadcrumb.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/button.stories.d.ts +92 -0
- package/dist/components/ui/stories/button.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/calendar.stories.d.ts +94 -0
- package/dist/components/ui/stories/calendar.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/card.stories.d.ts +29 -0
- package/dist/components/ui/stories/card.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/carousel.stories.d.ts +42 -0
- package/dist/components/ui/stories/carousel.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/chart.stories.d.ts +51 -0
- package/dist/components/ui/stories/chart.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/checkbox.stories.d.ts +72 -0
- package/dist/components/ui/stories/checkbox.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/cn.stories.d.ts +19 -0
- package/dist/components/ui/stories/cn.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/collapsible.stories.d.ts +51 -0
- package/dist/components/ui/stories/collapsible.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/colors.stories.d.ts +31 -0
- package/dist/components/ui/stories/colors.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/combobox.stories.d.ts +89 -0
- package/dist/components/ui/stories/combobox.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/command.stories.d.ts +69 -0
- package/dist/components/ui/stories/command.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/container.stories.d.ts +42 -0
- package/dist/components/ui/stories/container.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/context-menu.stories.d.ts +32 -0
- package/dist/components/ui/stories/context-menu.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/date-picker.stories.d.ts +67 -0
- package/dist/components/ui/stories/date-picker.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/dialog.stories.d.ts +48 -0
- package/dist/components/ui/stories/dialog.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/drawer.stories.d.ts +33 -0
- package/dist/components/ui/stories/drawer.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/dropdown-menu.stories.d.ts +31 -0
- package/dist/components/ui/stories/dropdown-menu.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/empty-state.stories.d.ts +74 -0
- package/dist/components/ui/stories/empty-state.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/hover-card.stories.d.ts +35 -0
- package/dist/components/ui/stories/hover-card.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/input.stories.d.ts +69 -0
- package/dist/components/ui/stories/input.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/label.stories.d.ts +47 -0
- package/dist/components/ui/stories/label.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/menubar.stories.d.ts +39 -0
- package/dist/components/ui/stories/menubar.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/navigation-menu.stories.d.ts +44 -0
- package/dist/components/ui/stories/navigation-menu.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/pagination.stories.d.ts +33 -0
- package/dist/components/ui/stories/pagination.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/popover.stories.d.ts +36 -0
- package/dist/components/ui/stories/popover.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/progress.stories.d.ts +38 -0
- package/dist/components/ui/stories/progress.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/radio-group.stories.d.ts +76 -0
- package/dist/components/ui/stories/radio-group.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/resizable.stories.d.ts +49 -0
- package/dist/components/ui/stories/resizable.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/scroll-area.stories.d.ts +35 -0
- package/dist/components/ui/stories/scroll-area.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/select.stories.d.ts +51 -0
- package/dist/components/ui/stories/select.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/separator.stories.d.ts +58 -0
- package/dist/components/ui/stories/separator.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/sheet.stories.d.ts +43 -0
- package/dist/components/ui/stories/sheet.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/sidebar.stories.d.ts +60 -0
- package/dist/components/ui/stories/sidebar.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/skeleton.stories.d.ts +42 -0
- package/dist/components/ui/stories/skeleton.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/slider.stories.d.ts +99 -0
- package/dist/components/ui/stories/slider.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/sonner.stories.d.ts +9 -0
- package/dist/components/ui/stories/sonner.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/stack.stories.d.ts +39 -0
- package/dist/components/ui/stories/stack.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/switch.stories.d.ts +71 -0
- package/dist/components/ui/stories/switch.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/table.stories.d.ts +40 -0
- package/dist/components/ui/stories/table.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/tabs.stories.d.ts +62 -0
- package/dist/components/ui/stories/tabs.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/text-field.stories.d.ts +78 -0
- package/dist/components/ui/stories/text-field.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/textarea.stories.d.ts +57 -0
- package/dist/components/ui/stories/textarea.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/theme-toggle.stories.d.ts +71 -0
- package/dist/components/ui/stories/theme-toggle.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/theme.stories.d.ts +51 -0
- package/dist/components/ui/stories/theme.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/toggle-group.stories.d.ts +71 -0
- package/dist/components/ui/stories/toggle-group.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/toggle.stories.d.ts +78 -0
- package/dist/components/ui/stories/toggle.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/tooltip.stories.d.ts +37 -0
- package/dist/components/ui/stories/tooltip.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/typography.stories.d.ts +137 -0
- package/dist/components/ui/stories/typography.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/use-mobile.stories.d.ts +20 -0
- package/dist/components/ui/stories/use-mobile.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/use-theme.stories.d.ts +23 -0
- package/dist/components/ui/stories/use-theme.stories.d.ts.map +1 -0
- package/dist/components/ui/switch.d.ts +84 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/table.d.ts +321 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/tabs.d.ts +260 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/text-field.d.ts +157 -0
- package/dist/components/ui/text-field.d.ts.map +1 -0
- package/dist/components/ui/textarea.d.ts +84 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/theme-toggle.d.ts +105 -0
- package/dist/components/ui/theme-toggle.d.ts.map +1 -0
- package/dist/components/ui/theme.d.ts +110 -0
- package/dist/components/ui/theme.d.ts.map +1 -0
- package/dist/components/ui/toggle-group.d.ts +133 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/components/ui/toggle.d.ts +84 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/components/ui/tooltip.d.ts +202 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/typography.d.ts +287 -0
- package/dist/components/ui/typography.d.ts.map +1 -0
- package/dist/hooks/use-mobile.d.ts +74 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-theme.d.ts +142 -0
- package/dist/hooks/use-theme.d.ts.map +1 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27498 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/utils.d.ts +43 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/docs/llm/colors.md +273 -0
- package/docs/llm/components/buttons.md +68 -0
- package/docs/llm/components/cards.md +53 -0
- package/docs/llm/components/display.md +134 -0
- package/docs/llm/components/feedback.md +96 -0
- package/docs/llm/components/forms.md +90 -0
- package/docs/llm/components/layout.md +59 -0
- package/docs/llm/components/menus.md +70 -0
- package/docs/llm/components/navigation.md +80 -0
- package/docs/llm/components/overlays.md +83 -0
- package/docs/llm/components/tables.md +73 -0
- package/docs/llm/components/typography.md +199 -0
- package/docs/llm/components/utilities.md +114 -0
- package/docs/llm/guide.md +165 -0
- package/llms.txt +122 -0
- package/package.json +104 -0
- package/src/components/ui/accordion.tsx +285 -0
- package/src/components/ui/alert-dialog.tsx +387 -0
- package/src/components/ui/alert.tsx +243 -0
- package/src/components/ui/aspect-ratio.tsx +99 -0
- package/src/components/ui/avatar.tsx +288 -0
- package/src/components/ui/badge.tsx +205 -0
- package/src/components/ui/breadcrumb.tsx +378 -0
- package/src/components/ui/button.tsx +195 -0
- package/src/components/ui/calendar.tsx +371 -0
- package/src/components/ui/card.tsx +447 -0
- package/src/components/ui/carousel.tsx +624 -0
- package/src/components/ui/chart.tsx +802 -0
- package/src/components/ui/checkbox.tsx +113 -0
- package/src/components/ui/collapsible.tsx +207 -0
- package/src/components/ui/combobox.tsx +373 -0
- package/src/components/ui/command.tsx +518 -0
- package/src/components/ui/container.tsx +114 -0
- package/src/components/ui/context-menu.tsx +563 -0
- package/src/components/ui/date-picker.tsx +213 -0
- package/src/components/ui/dialog.tsx +447 -0
- package/src/components/ui/drawer.tsx +273 -0
- package/src/components/ui/dropdown-menu.tsx +578 -0
- package/src/components/ui/empty-state.tsx +145 -0
- package/src/components/ui/hover-card.tsx +144 -0
- package/src/components/ui/input.tsx +106 -0
- package/src/components/ui/label.tsx +110 -0
- package/src/components/ui/menubar.tsx +553 -0
- package/src/components/ui/navigation-menu.tsx +471 -0
- package/src/components/ui/pagination.tsx +456 -0
- package/src/components/ui/popover.tsx +216 -0
- package/src/components/ui/progress.tsx +88 -0
- package/src/components/ui/radio-group.tsx +183 -0
- package/src/components/ui/resizable.tsx +209 -0
- package/src/components/ui/scroll-area.tsx +132 -0
- package/src/components/ui/select.tsx +485 -0
- package/src/components/ui/separator.tsx +101 -0
- package/src/components/ui/sheet.tsx +495 -0
- package/src/components/ui/sidebar.tsx +2211 -0
- package/src/components/ui/skeleton.tsx +76 -0
- package/src/components/ui/slider.tsx +147 -0
- package/src/components/ui/sonner.tsx +120 -0
- package/src/components/ui/stack.tsx +180 -0
- package/src/components/ui/stories/accordion.stories.tsx +429 -0
- package/src/components/ui/stories/alert-dialog.stories.tsx +519 -0
- package/src/components/ui/stories/alert.stories.tsx +228 -0
- package/src/components/ui/stories/aspect-ratio.stories.tsx +200 -0
- package/src/components/ui/stories/avatar.stories.tsx +317 -0
- package/src/components/ui/stories/badge.stories.tsx +260 -0
- package/src/components/ui/stories/breadcrumb.stories.tsx +482 -0
- package/src/components/ui/stories/button.stories.tsx +266 -0
- package/src/components/ui/stories/calendar.stories.tsx +375 -0
- package/src/components/ui/stories/card.stories.tsx +308 -0
- package/src/components/ui/stories/carousel.stories.tsx +328 -0
- package/src/components/ui/stories/chart.stories.tsx +430 -0
- package/src/components/ui/stories/checkbox.stories.tsx +297 -0
- package/src/components/ui/stories/cn.stories.tsx +433 -0
- package/src/components/ui/stories/collapsible.stories.tsx +256 -0
- package/src/components/ui/stories/colors.stories.tsx +502 -0
- package/src/components/ui/stories/combobox.stories.tsx +301 -0
- package/src/components/ui/stories/command.stories.tsx +632 -0
- package/src/components/ui/stories/container.stories.tsx +250 -0
- package/src/components/ui/stories/context-menu.stories.tsx +446 -0
- package/src/components/ui/stories/date-picker.stories.tsx +378 -0
- package/src/components/ui/stories/dialog.stories.tsx +535 -0
- package/src/components/ui/stories/drawer.stories.tsx +364 -0
- package/src/components/ui/stories/dropdown-menu.stories.tsx +374 -0
- package/src/components/ui/stories/empty-state.stories.tsx +244 -0
- package/src/components/ui/stories/hover-card.stories.tsx +355 -0
- package/src/components/ui/stories/input.stories.tsx +289 -0
- package/src/components/ui/stories/label.stories.tsx +294 -0
- package/src/components/ui/stories/menubar.stories.tsx +764 -0
- package/src/components/ui/stories/navigation-menu.stories.tsx +539 -0
- package/src/components/ui/stories/pagination.stories.tsx +604 -0
- package/src/components/ui/stories/popover.stories.tsx +392 -0
- package/src/components/ui/stories/progress.stories.tsx +218 -0
- package/src/components/ui/stories/radio-group.stories.tsx +400 -0
- package/src/components/ui/stories/resizable.stories.tsx +417 -0
- package/src/components/ui/stories/scroll-area.stories.tsx +180 -0
- package/src/components/ui/stories/select.stories.tsx +389 -0
- package/src/components/ui/stories/separator.stories.tsx +192 -0
- package/src/components/ui/stories/sheet.stories.tsx +468 -0
- package/src/components/ui/stories/sidebar.stories.tsx +731 -0
- package/src/components/ui/stories/skeleton.stories.tsx +216 -0
- package/src/components/ui/stories/slider.stories.tsx +321 -0
- package/src/components/ui/stories/sonner.stories.tsx +373 -0
- package/src/components/ui/stories/stack.stories.tsx +222 -0
- package/src/components/ui/stories/switch.stories.tsx +202 -0
- package/src/components/ui/stories/table.stories.tsx +541 -0
- package/src/components/ui/stories/tabs.stories.tsx +544 -0
- package/src/components/ui/stories/text-field.stories.tsx +280 -0
- package/src/components/ui/stories/textarea.stories.tsx +245 -0
- package/src/components/ui/stories/theme-toggle.stories.tsx +275 -0
- package/src/components/ui/stories/theme.stories.tsx +412 -0
- package/src/components/ui/stories/toggle-group.stories.tsx +337 -0
- package/src/components/ui/stories/toggle.stories.tsx +325 -0
- package/src/components/ui/stories/tooltip.stories.tsx +444 -0
- package/src/components/ui/stories/typography.stories.tsx +1586 -0
- package/src/components/ui/stories/use-mobile.stories.tsx +420 -0
- package/src/components/ui/stories/use-theme.stories.tsx +531 -0
- package/src/components/ui/switch.tsx +106 -0
- package/src/components/ui/table.tsx +424 -0
- package/src/components/ui/tabs.tsx +316 -0
- package/src/components/ui/text-field.tsx +206 -0
- package/src/components/ui/textarea.tsx +98 -0
- package/src/components/ui/theme-toggle.tsx +185 -0
- package/src/components/ui/theme.tsx +148 -0
- package/src/components/ui/toggle-group.tsx +196 -0
- package/src/components/ui/toggle.tsx +115 -0
- package/src/components/ui/tooltip.tsx +253 -0
- package/src/components/ui/typography.tsx +468 -0
- package/src/hooks/use-mobile.ts +91 -0
- package/src/hooks/use-theme.ts +319 -0
- package/src/index.ts +77 -0
- package/src/lib/utils.ts +57 -0
- package/src/styles/globals.css +160 -0
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
3
|
+
import { Dialog } from "@/components/ui/dialog";
|
|
4
|
+
/**
|
|
5
|
+
* Command - A fast, composable command menu for search and navigation
|
|
6
|
+
*
|
|
7
|
+
* Built on the cmdk primitive, this component provides a powerful command palette
|
|
8
|
+
* interface with search, filtering, and keyboard navigation. Perfect for creating
|
|
9
|
+
* search interfaces, command palettes, and action menus with full accessibility support.
|
|
10
|
+
*
|
|
11
|
+
* @component
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* // Basic command menu
|
|
15
|
+
* <Command>
|
|
16
|
+
* <CommandInput placeholder="Type a command or search..." />
|
|
17
|
+
* <CommandList>
|
|
18
|
+
* <CommandEmpty>No results found.</CommandEmpty>
|
|
19
|
+
* <CommandGroup heading="Suggestions">
|
|
20
|
+
* <CommandItem>Calendar</CommandItem>
|
|
21
|
+
* <CommandItem>Search Emoji</CommandItem>
|
|
22
|
+
* <CommandItem>Calculator</CommandItem>
|
|
23
|
+
* </CommandGroup>
|
|
24
|
+
* </CommandList>
|
|
25
|
+
* </Command>
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* // Command dialog with keyboard shortcut
|
|
31
|
+
* const [open, setOpen] = useState(false);
|
|
32
|
+
*
|
|
33
|
+
* useEffect(() => {
|
|
34
|
+
* const down = (e: KeyboardEvent) => {
|
|
35
|
+
* if (e.key === "k" && (e.metaKey || e.ctrlKey)) {
|
|
36
|
+
* e.preventDefault();
|
|
37
|
+
* setOpen((open) => !open);
|
|
38
|
+
* }
|
|
39
|
+
* };
|
|
40
|
+
* document.addEventListener("keydown", down);
|
|
41
|
+
* return () => document.removeEventListener("keydown", down);
|
|
42
|
+
* }, []);
|
|
43
|
+
*
|
|
44
|
+
* <CommandDialog open={open} onOpenChange={setOpen}>
|
|
45
|
+
* <CommandInput placeholder="Type a command..." />
|
|
46
|
+
* <CommandList>
|
|
47
|
+
* <CommandGroup heading="Actions">
|
|
48
|
+
* <CommandItem onSelect={() => console.log("New file")}>
|
|
49
|
+
* New File
|
|
50
|
+
* <CommandShortcut>⌘N</CommandShortcut>
|
|
51
|
+
* </CommandItem>
|
|
52
|
+
* </CommandGroup>
|
|
53
|
+
* </CommandList>
|
|
54
|
+
* </CommandDialog>
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @accessibility
|
|
58
|
+
* - Full keyboard navigation with arrow keys and Home/End
|
|
59
|
+
* - Type-ahead search and filtering
|
|
60
|
+
* - Enter key to select items, Escape to close dialogs
|
|
61
|
+
* - Screen reader announcements for filtered results
|
|
62
|
+
* - ARIA roles following command palette pattern
|
|
63
|
+
* - Focus management and trapping in dialog mode
|
|
64
|
+
*
|
|
65
|
+
* @see {@link https://ui.shadcn.com/docs/components/command} for design patterns
|
|
66
|
+
* @see {@link CommandDialog} - For modal command palette
|
|
67
|
+
* @see {@link CommandInput} - Search input component
|
|
68
|
+
* @see {@link CommandList} - Scrollable results container
|
|
69
|
+
* @since 1.0.0
|
|
70
|
+
*/
|
|
71
|
+
declare function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>): import("react/jsx-runtime").JSX.Element;
|
|
72
|
+
/**
|
|
73
|
+
* CommandDialog - Modal dialog wrapper for command menu
|
|
74
|
+
*
|
|
75
|
+
* Presents the command menu in a modal dialog overlay, perfect for application-wide
|
|
76
|
+
* command palettes triggered by keyboard shortcuts like Cmd+K. Includes proper
|
|
77
|
+
* focus management and accessibility features.
|
|
78
|
+
*
|
|
79
|
+
* @component
|
|
80
|
+
* @example
|
|
81
|
+
* ```tsx
|
|
82
|
+
* // Command palette dialog with keyboard shortcut
|
|
83
|
+
* const [open, setOpen] = useState(false);
|
|
84
|
+
*
|
|
85
|
+
* useEffect(() => {
|
|
86
|
+
* const down = (e: KeyboardEvent) => {
|
|
87
|
+
* if (e.key === "k" && (e.metaKey || e.ctrlKey)) {
|
|
88
|
+
* e.preventDefault();
|
|
89
|
+
* setOpen((open) => !open);
|
|
90
|
+
* }
|
|
91
|
+
* };
|
|
92
|
+
* document.addEventListener("keydown", down);
|
|
93
|
+
* return () => document.removeEventListener("keydown", down);
|
|
94
|
+
* }, []);
|
|
95
|
+
*
|
|
96
|
+
* <CommandDialog open={open} onOpenChange={setOpen}>
|
|
97
|
+
* <CommandInput placeholder="Type a command..." />
|
|
98
|
+
* <CommandList>
|
|
99
|
+
* <CommandGroup heading="Actions">
|
|
100
|
+
* <CommandItem>Create New File</CommandItem>
|
|
101
|
+
* <CommandItem>Open Settings</CommandItem>
|
|
102
|
+
* </CommandGroup>
|
|
103
|
+
* </CommandList>
|
|
104
|
+
* </CommandDialog>
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
* @param title - Screen reader title for the dialog
|
|
108
|
+
* @param description - Screen reader description for the dialog
|
|
109
|
+
* @param showCloseButton - Whether to show the close button
|
|
110
|
+
*
|
|
111
|
+
* @accessibility
|
|
112
|
+
* - Focus trapped within dialog when open
|
|
113
|
+
* - Escape key closes the dialog
|
|
114
|
+
* - Screen reader announcements with title and description
|
|
115
|
+
* - Preserves all command menu keyboard navigation
|
|
116
|
+
*
|
|
117
|
+
* @since 1.0.0
|
|
118
|
+
*/
|
|
119
|
+
declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: React.ComponentProps<typeof Dialog> & {
|
|
120
|
+
/**
|
|
121
|
+
* The title for screen readers
|
|
122
|
+
* @default "Command Palette"
|
|
123
|
+
*/
|
|
124
|
+
title?: string;
|
|
125
|
+
/**
|
|
126
|
+
* The description for screen readers
|
|
127
|
+
* @default "Search for a command to run..."
|
|
128
|
+
*/
|
|
129
|
+
description?: string;
|
|
130
|
+
/**
|
|
131
|
+
* Additional CSS classes
|
|
132
|
+
*/
|
|
133
|
+
className?: string;
|
|
134
|
+
/**
|
|
135
|
+
* Whether to show the close button
|
|
136
|
+
* @default true
|
|
137
|
+
*/
|
|
138
|
+
showCloseButton?: boolean;
|
|
139
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
140
|
+
/**
|
|
141
|
+
* CommandInput - Search input for command menu filtering
|
|
142
|
+
*
|
|
143
|
+
* Provides a search input with search icon for filtering command menu items.
|
|
144
|
+
* Automatically filters items as the user types and handles focus management.
|
|
145
|
+
*
|
|
146
|
+
* @component
|
|
147
|
+
* @example
|
|
148
|
+
* ```tsx
|
|
149
|
+
* <Command>
|
|
150
|
+
* <CommandInput placeholder="Search commands..." />
|
|
151
|
+
* <CommandList>...</CommandList>
|
|
152
|
+
* </Command>
|
|
153
|
+
* ```
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```tsx
|
|
157
|
+
* // Controlled input with state
|
|
158
|
+
* <CommandInput
|
|
159
|
+
* placeholder="Type a command or search..."
|
|
160
|
+
* value={searchValue}
|
|
161
|
+
* onValueChange={setSearchValue}
|
|
162
|
+
* />
|
|
163
|
+
* ```
|
|
164
|
+
*
|
|
165
|
+
* @accessibility
|
|
166
|
+
* - Auto-focuses when command menu opens
|
|
167
|
+
* - Live region announces result count to screen readers
|
|
168
|
+
* - Supports all standard input accessibility features
|
|
169
|
+
*
|
|
170
|
+
* @since 1.0.0
|
|
171
|
+
*/
|
|
172
|
+
declare function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): import("react/jsx-runtime").JSX.Element;
|
|
173
|
+
/**
|
|
174
|
+
* CommandList - Scrollable container for command items
|
|
175
|
+
*
|
|
176
|
+
* Contains and manages the list of command items with automatic scrolling
|
|
177
|
+
* and overflow handling. Manages keyboard navigation and selection state.
|
|
178
|
+
*
|
|
179
|
+
* @component
|
|
180
|
+
* @example
|
|
181
|
+
* ```tsx
|
|
182
|
+
* <CommandList>
|
|
183
|
+
* <CommandEmpty>No results found</CommandEmpty>
|
|
184
|
+
* <CommandGroup heading="Actions">
|
|
185
|
+
* <CommandItem>New File</CommandItem>
|
|
186
|
+
* <CommandItem>Open File</CommandItem>
|
|
187
|
+
* </CommandGroup>
|
|
188
|
+
* </CommandList>
|
|
189
|
+
* ```
|
|
190
|
+
*
|
|
191
|
+
* @accessibility
|
|
192
|
+
* - Scrollable with keyboard arrow navigation
|
|
193
|
+
* - Maintains focus within list boundaries
|
|
194
|
+
* - Supports Home/End key navigation
|
|
195
|
+
*
|
|
196
|
+
* @since 1.0.0
|
|
197
|
+
*/
|
|
198
|
+
declare function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>): import("react/jsx-runtime").JSX.Element;
|
|
199
|
+
/**
|
|
200
|
+
* CommandEmpty - Empty state message for command menu
|
|
201
|
+
*
|
|
202
|
+
* Displays when no command items match the current search query.
|
|
203
|
+
* Can contain custom content beyond simple text messages.
|
|
204
|
+
*
|
|
205
|
+
* @component
|
|
206
|
+
* @example
|
|
207
|
+
* ```tsx
|
|
208
|
+
* <CommandList>
|
|
209
|
+
* <CommandEmpty>No commands found.</CommandEmpty>
|
|
210
|
+
* </CommandList>
|
|
211
|
+
* ```
|
|
212
|
+
*
|
|
213
|
+
* @example
|
|
214
|
+
* ```tsx
|
|
215
|
+
* // Custom empty state with icon and helpful text
|
|
216
|
+
* <CommandEmpty>
|
|
217
|
+
* <div className="py-6 text-center">
|
|
218
|
+
* <SearchIcon className="mx-auto h-10 w-10 text-muted-foreground/50" />
|
|
219
|
+
* <h3 className="mt-2 text-sm font-medium">No results found</h3>
|
|
220
|
+
* <p className="mt-1 text-sm text-muted-foreground">
|
|
221
|
+
* Try adjusting your search terms.
|
|
222
|
+
* </p>
|
|
223
|
+
* </div>
|
|
224
|
+
* </CommandEmpty>
|
|
225
|
+
* ```
|
|
226
|
+
*
|
|
227
|
+
* @accessibility
|
|
228
|
+
* - Announced to screen readers when no results are found
|
|
229
|
+
* - Content is properly focusable if interactive
|
|
230
|
+
*
|
|
231
|
+
* @since 1.0.0
|
|
232
|
+
*/
|
|
233
|
+
declare function CommandEmpty({ ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>): import("react/jsx-runtime").JSX.Element;
|
|
234
|
+
/**
|
|
235
|
+
* CommandGroup - Groups related command items under a heading
|
|
236
|
+
*
|
|
237
|
+
* Organizes command items into labeled sections for better organization
|
|
238
|
+
* and navigation. Groups provide semantic structure for screen readers.
|
|
239
|
+
*
|
|
240
|
+
* @component
|
|
241
|
+
* @example
|
|
242
|
+
* ```tsx
|
|
243
|
+
* <CommandGroup heading="Recent Files">
|
|
244
|
+
* <CommandItem>document.pdf</CommandItem>
|
|
245
|
+
* <CommandItem>presentation.pptx</CommandItem>
|
|
246
|
+
* </CommandGroup>
|
|
247
|
+
* <CommandGroup heading="Actions">
|
|
248
|
+
* <CommandItem>New File</CommandItem>
|
|
249
|
+
* <CommandItem>Open File</CommandItem>
|
|
250
|
+
* </CommandGroup>
|
|
251
|
+
* ```
|
|
252
|
+
*
|
|
253
|
+
* @param heading - The group heading text displayed above items
|
|
254
|
+
*
|
|
255
|
+
* @accessibility
|
|
256
|
+
* - Group headings are announced to screen readers
|
|
257
|
+
* - Provides semantic grouping for better navigation
|
|
258
|
+
* - Maintains keyboard navigation flow between groups
|
|
259
|
+
*
|
|
260
|
+
* @since 1.0.0
|
|
261
|
+
*/
|
|
262
|
+
declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
263
|
+
/**
|
|
264
|
+
* CommandSeparator - Visual separator between command groups
|
|
265
|
+
*
|
|
266
|
+
* Provides visual separation between different sections of commands.
|
|
267
|
+
* Purely decorative element that improves visual organization.
|
|
268
|
+
*
|
|
269
|
+
* @component
|
|
270
|
+
* @example
|
|
271
|
+
* ```tsx
|
|
272
|
+
* <CommandGroup heading="Recent">...</CommandGroup>
|
|
273
|
+
* <CommandSeparator />
|
|
274
|
+
* <CommandGroup heading="Actions">...</CommandGroup>
|
|
275
|
+
* ```
|
|
276
|
+
*
|
|
277
|
+
* @accessibility
|
|
278
|
+
* - Decorative element, properly hidden from screen readers
|
|
279
|
+
* - Does not interfere with keyboard navigation
|
|
280
|
+
*
|
|
281
|
+
* @since 1.0.0
|
|
282
|
+
*/
|
|
283
|
+
declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
284
|
+
/**
|
|
285
|
+
* CommandItem - Individual selectable command item
|
|
286
|
+
*
|
|
287
|
+
* Represents a single command or action that can be selected via
|
|
288
|
+
* keyboard or mouse interaction. Supports icons, text, and shortcuts.
|
|
289
|
+
*
|
|
290
|
+
* @component
|
|
291
|
+
* @example
|
|
292
|
+
* ```tsx
|
|
293
|
+
* // Basic command item
|
|
294
|
+
* <CommandItem onSelect={() => console.log("File opened")}>
|
|
295
|
+
* Open File
|
|
296
|
+
* </CommandItem>
|
|
297
|
+
* ```
|
|
298
|
+
*
|
|
299
|
+
* @example
|
|
300
|
+
* ```tsx
|
|
301
|
+
* // Command item with icon and shortcut
|
|
302
|
+
* <CommandItem value="new-document" onSelect={handleCreateDocument}>
|
|
303
|
+
* <FileIcon className="mr-2 h-4 w-4" />
|
|
304
|
+
* New Document
|
|
305
|
+
* <CommandShortcut>⌘N</CommandShortcut>
|
|
306
|
+
* </CommandItem>
|
|
307
|
+
* ```
|
|
308
|
+
*
|
|
309
|
+
* @param value - Unique identifier for the item (used for filtering)
|
|
310
|
+
* @param onSelect - Callback when item is selected
|
|
311
|
+
* @param disabled - Whether the item is disabled
|
|
312
|
+
*
|
|
313
|
+
* @accessibility
|
|
314
|
+
* - Keyboard selectable with Enter key and arrow navigation
|
|
315
|
+
* - Visual highlight on focus and hover states
|
|
316
|
+
* - Supports disabled state with proper ARIA attributes
|
|
317
|
+
* - Screen reader announces item content and state
|
|
318
|
+
*
|
|
319
|
+
* @since 1.0.0
|
|
320
|
+
*/
|
|
321
|
+
declare function CommandItem({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
322
|
+
/**
|
|
323
|
+
* CommandShortcut - Displays keyboard shortcut for command items
|
|
324
|
+
*
|
|
325
|
+
* Shows the keyboard shortcut associated with a command item,
|
|
326
|
+
* typically displayed on the right side. Supports platform-specific shortcuts.
|
|
327
|
+
*
|
|
328
|
+
* @component
|
|
329
|
+
* @example
|
|
330
|
+
* ```tsx
|
|
331
|
+
* <CommandItem>
|
|
332
|
+
* Save File
|
|
333
|
+
* <CommandShortcut>⌘S</CommandShortcut>
|
|
334
|
+
* </CommandItem>
|
|
335
|
+
* ```
|
|
336
|
+
*
|
|
337
|
+
* @example
|
|
338
|
+
* ```tsx
|
|
339
|
+
* // Multi-key shortcuts
|
|
340
|
+
* <CommandItem>
|
|
341
|
+
* Redo
|
|
342
|
+
* <CommandShortcut>⇧⌘Z</CommandShortcut>
|
|
343
|
+
* </CommandItem>
|
|
344
|
+
* ```
|
|
345
|
+
*
|
|
346
|
+
* @accessibility
|
|
347
|
+
* - Semantically associated with its command item
|
|
348
|
+
* - Announced to screen readers as part of item description
|
|
349
|
+
* - Uses proper keyboard shortcut formatting
|
|
350
|
+
*
|
|
351
|
+
* @since 1.0.0
|
|
352
|
+
*/
|
|
353
|
+
declare function CommandShortcut({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
354
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
|
355
|
+
//# sourceMappingURL=command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/components/ui/command.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,MAAM,CAAC;AAInD,OAAO,EACL,MAAM,EAKP,MAAM,wBAAwB,CAAC;AAEhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,iBAAS,OAAO,CAAC,EACf,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,2CAW/C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,iBAAS,aAAa,CAAC,EACrB,KAAyB,EACzB,WAA8C,EAC9C,QAAQ,EACR,SAAS,EACT,eAAsB,EACtB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG;IACvC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,2CAiBA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,KAAK,CAAC,2CAiBrD;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,2CAWpD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,KAAK,CAAC,2CAQrD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,KAAK,CAAC,2CAWrD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,SAAS,CAAC,2CAQzD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,2CAWpD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,2CAW9B;AAED,OAAO,EACL,OAAO,EACP,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,gBAAgB,GACjB,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Props for the Container component
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export type ContainerProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
8
|
+
/**
|
|
9
|
+
* The maximum width size of the container
|
|
10
|
+
*
|
|
11
|
+
* - `sm`: max-w-3xl (48rem) - Optimal for reading content, articles, and blog posts
|
|
12
|
+
* - `md`: max-w-5xl (64rem) - Suitable for forms, documentation, and medium-width layouts
|
|
13
|
+
* - `lg`: max-w-7xl (80rem) - Default size, ideal for main application content and dashboards
|
|
14
|
+
* - `xl`: max-w-none - No max-width constraint but maintains responsive padding
|
|
15
|
+
* - `full`: max-w-full - Full width container for edge-to-edge designs
|
|
16
|
+
*
|
|
17
|
+
* @default "lg"
|
|
18
|
+
*/
|
|
19
|
+
size?: "sm" | "md" | "lg" | "xl" | "full";
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* A responsive content wrapper component that provides consistent max-width constraints and horizontal padding
|
|
23
|
+
*
|
|
24
|
+
* Container is inspired by layout patterns from shadcn/ui and Tailwind UI, offering a flexible foundation
|
|
25
|
+
* for page layouts. It automatically centers content horizontally and applies responsive padding that
|
|
26
|
+
* adapts gracefully across different screen sizes (px-4 on mobile, px-6 on small screens, px-8 on large screens).
|
|
27
|
+
*
|
|
28
|
+
* The component supports five size variants optimized for different content types:
|
|
29
|
+
* - Small containers for optimal reading experiences
|
|
30
|
+
* - Medium containers for forms and documentation
|
|
31
|
+
* - Large containers for application dashboards
|
|
32
|
+
* - Extra-large and full-width for specialized layouts
|
|
33
|
+
*
|
|
34
|
+
* @example Basic usage with default large size
|
|
35
|
+
* ```tsx
|
|
36
|
+
* <Container>
|
|
37
|
+
* <h1>Dashboard Title</h1>
|
|
38
|
+
* <p>Main application content with optimal width constraints</p>
|
|
39
|
+
* </Container>
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @example Reading-optimized container for articles
|
|
43
|
+
* ```tsx
|
|
44
|
+
* <Container size="sm">
|
|
45
|
+
* <article>
|
|
46
|
+
* <h1>Blog Post Title</h1>
|
|
47
|
+
* <p>Long-form content with line lengths optimized for readability</p>
|
|
48
|
+
* </article>
|
|
49
|
+
* </Container>
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @example Full-width layout for complex interfaces
|
|
53
|
+
* ```tsx
|
|
54
|
+
* <Container size="full">
|
|
55
|
+
* <div className="grid grid-cols-1 md:grid-cols-3 gap-6">
|
|
56
|
+
* <DashboardWidget />
|
|
57
|
+
* <DashboardWidget />
|
|
58
|
+
* <DashboardWidget />
|
|
59
|
+
* </div>
|
|
60
|
+
* </Container>
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @example Composing with other layout components
|
|
64
|
+
* ```tsx
|
|
65
|
+
* <Container size="lg" className="py-8">
|
|
66
|
+
* <Stack spacing="lg">
|
|
67
|
+
* <Heading size="xl">Section Title</Heading>
|
|
68
|
+
* <Text>Section description</Text>
|
|
69
|
+
* <Card>Content card</Card>
|
|
70
|
+
* </Stack>
|
|
71
|
+
* </Container>
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* @accessibility
|
|
75
|
+
* - Uses semantic HTML `div` element that works well with screen readers
|
|
76
|
+
* - Maintains proper focus management and keyboard navigation flow
|
|
77
|
+
* - Responsive design ensures content remains accessible across all device sizes
|
|
78
|
+
* - Text content automatically reflows for optimal readability
|
|
79
|
+
* - Compatible with high contrast themes and browser zoom levels up to 200%
|
|
80
|
+
*
|
|
81
|
+
* @see {@link https://ui.shadcn.com/docs/components/sidebar} Sidebar component for app layouts
|
|
82
|
+
* @see {@link https://ui.shadcn.com/blocks} shadcn/ui blocks for complete layout examples
|
|
83
|
+
*
|
|
84
|
+
* @public
|
|
85
|
+
* @since 1.0.0
|
|
86
|
+
*/
|
|
87
|
+
declare const Container: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
88
|
+
/**
|
|
89
|
+
* The maximum width size of the container
|
|
90
|
+
*
|
|
91
|
+
* - `sm`: max-w-3xl (48rem) - Optimal for reading content, articles, and blog posts
|
|
92
|
+
* - `md`: max-w-5xl (64rem) - Suitable for forms, documentation, and medium-width layouts
|
|
93
|
+
* - `lg`: max-w-7xl (80rem) - Default size, ideal for main application content and dashboards
|
|
94
|
+
* - `xl`: max-w-none - No max-width constraint but maintains responsive padding
|
|
95
|
+
* - `full`: max-w-full - Full width container for edge-to-edge designs
|
|
96
|
+
*
|
|
97
|
+
* @default "lg"
|
|
98
|
+
*/
|
|
99
|
+
size?: "sm" | "md" | "lg" | "xl" | "full";
|
|
100
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
101
|
+
export { Container };
|
|
102
|
+
//# sourceMappingURL=container.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../../src/components/ui/container.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG;IAClE;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;CAC3C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,QAAA,MAAM,SAAS;IAhFb;;;;;;;;;;OAUG;WACI,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM;wCAyF1C,CAAC;AAIF,OAAO,EAAE,SAAS,EAAE,CAAC"}
|