@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,632 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import {
|
|
4
|
+
Calculator,
|
|
5
|
+
Calendar,
|
|
6
|
+
CreditCard,
|
|
7
|
+
Settings,
|
|
8
|
+
Smile,
|
|
9
|
+
User,
|
|
10
|
+
Search,
|
|
11
|
+
FileText,
|
|
12
|
+
Mail,
|
|
13
|
+
Plus,
|
|
14
|
+
Star,
|
|
15
|
+
Edit,
|
|
16
|
+
Copy,
|
|
17
|
+
Download,
|
|
18
|
+
Share,
|
|
19
|
+
} from "lucide-react";
|
|
20
|
+
import {
|
|
21
|
+
Command,
|
|
22
|
+
CommandDialog,
|
|
23
|
+
CommandEmpty,
|
|
24
|
+
CommandGroup,
|
|
25
|
+
CommandInput,
|
|
26
|
+
CommandItem,
|
|
27
|
+
CommandList,
|
|
28
|
+
CommandSeparator,
|
|
29
|
+
CommandShortcut,
|
|
30
|
+
} from "../command";
|
|
31
|
+
import { Button } from "../button";
|
|
32
|
+
|
|
33
|
+
const meta = {
|
|
34
|
+
title: "Interactive Controls/Command",
|
|
35
|
+
component: Command,
|
|
36
|
+
parameters: {
|
|
37
|
+
layout: "centered",
|
|
38
|
+
docs: {
|
|
39
|
+
description: {
|
|
40
|
+
component:
|
|
41
|
+
"A fast, composable command menu built on cmdk that provides powerful search interfaces, command palettes, and autocomplete functionality with full keyboard navigation and accessibility support.",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
tags: ["autodocs"],
|
|
46
|
+
argTypes: {
|
|
47
|
+
className: {
|
|
48
|
+
control: "text",
|
|
49
|
+
description: "Additional CSS classes to apply to the command menu",
|
|
50
|
+
},
|
|
51
|
+
value: {
|
|
52
|
+
control: "text",
|
|
53
|
+
description: "The current search value (controlled)",
|
|
54
|
+
},
|
|
55
|
+
onValueChange: {
|
|
56
|
+
action: "valueChanged",
|
|
57
|
+
description: "Called when the search value changes",
|
|
58
|
+
},
|
|
59
|
+
filter: {
|
|
60
|
+
control: "boolean",
|
|
61
|
+
description: "Whether to enable filtering",
|
|
62
|
+
table: { defaultValue: { summary: "true" } },
|
|
63
|
+
},
|
|
64
|
+
shouldFilter: {
|
|
65
|
+
control: "boolean",
|
|
66
|
+
description: "Whether the built-in filter should be applied",
|
|
67
|
+
},
|
|
68
|
+
loop: {
|
|
69
|
+
control: "boolean",
|
|
70
|
+
description: "Whether to loop keyboard navigation",
|
|
71
|
+
table: { defaultValue: { summary: "false" } },
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
} satisfies Meta<typeof Command>;
|
|
75
|
+
|
|
76
|
+
export default meta;
|
|
77
|
+
type Story = StoryObj<typeof meta>;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Interactive playground to test all Command component features and props.
|
|
81
|
+
* Experiment with different configurations, search functionality, and keyboard navigation.
|
|
82
|
+
*/
|
|
83
|
+
export const Interactive: Story = {
|
|
84
|
+
render: function InteractiveCommand(args) {
|
|
85
|
+
const [value, setValue] = React.useState("");
|
|
86
|
+
const [selected, setSelected] = React.useState<string | null>(null);
|
|
87
|
+
const [dialogOpen, setDialogOpen] = React.useState(false);
|
|
88
|
+
|
|
89
|
+
React.useEffect(() => {
|
|
90
|
+
const down = (e: KeyboardEvent) => {
|
|
91
|
+
if (e.key === "k" && (e.metaKey || e.ctrlKey)) {
|
|
92
|
+
e.preventDefault();
|
|
93
|
+
setDialogOpen((open) => !open);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
document.addEventListener("keydown", down);
|
|
97
|
+
return () => document.removeEventListener("keydown", down);
|
|
98
|
+
}, []);
|
|
99
|
+
|
|
100
|
+
const handleSelect = (currentValue: string) => {
|
|
101
|
+
setSelected(currentValue);
|
|
102
|
+
setValue("");
|
|
103
|
+
console.log("Selected:", currentValue);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<div className="space-y-4">
|
|
108
|
+
<div className="flex gap-2">
|
|
109
|
+
<Button onClick={() => setDialogOpen(true)}>
|
|
110
|
+
Open Command Dialog
|
|
111
|
+
</Button>
|
|
112
|
+
<p className="text-sm text-muted-foreground flex items-center">
|
|
113
|
+
Or press{" "}
|
|
114
|
+
<kbd className="ml-1 pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground">
|
|
115
|
+
<span className="text-xs">⌘</span>K
|
|
116
|
+
</kbd>
|
|
117
|
+
</p>
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
{selected && (
|
|
121
|
+
<div className="text-sm p-2 bg-muted rounded">
|
|
122
|
+
<strong>Last selected:</strong> {selected}
|
|
123
|
+
</div>
|
|
124
|
+
)}
|
|
125
|
+
|
|
126
|
+
<Command
|
|
127
|
+
{...args}
|
|
128
|
+
className="rounded-lg border shadow-md max-w-[450px]"
|
|
129
|
+
value={value}
|
|
130
|
+
onValueChange={setValue}
|
|
131
|
+
>
|
|
132
|
+
<CommandInput placeholder="Type to search commands..." />
|
|
133
|
+
<CommandList>
|
|
134
|
+
<CommandEmpty>
|
|
135
|
+
No results found for "{value}"
|
|
136
|
+
</CommandEmpty>
|
|
137
|
+
<CommandGroup heading="Actions">
|
|
138
|
+
<CommandItem
|
|
139
|
+
value="create-new-document"
|
|
140
|
+
onSelect={() => handleSelect("Create New Document")}
|
|
141
|
+
>
|
|
142
|
+
<FileText className="mr-2 h-4 w-4" />
|
|
143
|
+
<span>Create New Document</span>
|
|
144
|
+
<CommandShortcut>⌘N</CommandShortcut>
|
|
145
|
+
</CommandItem>
|
|
146
|
+
<CommandItem
|
|
147
|
+
value="send-message"
|
|
148
|
+
onSelect={() => handleSelect("Send Message")}
|
|
149
|
+
>
|
|
150
|
+
<Mail className="mr-2 h-4 w-4" />
|
|
151
|
+
<span>Send Message</span>
|
|
152
|
+
<CommandShortcut>⌘M</CommandShortcut>
|
|
153
|
+
</CommandItem>
|
|
154
|
+
<CommandItem
|
|
155
|
+
value="schedule-meeting"
|
|
156
|
+
onSelect={() => handleSelect("Schedule Meeting")}
|
|
157
|
+
>
|
|
158
|
+
<Calendar className="mr-2 h-4 w-4" />
|
|
159
|
+
<span>Schedule Meeting</span>
|
|
160
|
+
<CommandShortcut>⌘E</CommandShortcut>
|
|
161
|
+
</CommandItem>
|
|
162
|
+
</CommandGroup>
|
|
163
|
+
<CommandSeparator />
|
|
164
|
+
<CommandGroup heading="Tools">
|
|
165
|
+
<CommandItem
|
|
166
|
+
value="open-calculator"
|
|
167
|
+
onSelect={() => handleSelect("Open Calculator")}
|
|
168
|
+
>
|
|
169
|
+
<Calculator className="mr-2 h-4 w-4" />
|
|
170
|
+
<span>Open Calculator</span>
|
|
171
|
+
</CommandItem>
|
|
172
|
+
<CommandItem
|
|
173
|
+
value="search-emojis"
|
|
174
|
+
onSelect={() => handleSelect("Search Emojis")}
|
|
175
|
+
>
|
|
176
|
+
<Smile className="mr-2 h-4 w-4" />
|
|
177
|
+
<span>Search Emojis</span>
|
|
178
|
+
</CommandItem>
|
|
179
|
+
<CommandItem
|
|
180
|
+
value="add-to-favorites"
|
|
181
|
+
onSelect={() => handleSelect("Add to Favorites")}
|
|
182
|
+
>
|
|
183
|
+
<Star className="mr-2 h-4 w-4" />
|
|
184
|
+
<span>Add to Favorites</span>
|
|
185
|
+
</CommandItem>
|
|
186
|
+
</CommandGroup>
|
|
187
|
+
<CommandSeparator />
|
|
188
|
+
<CommandGroup heading="Settings">
|
|
189
|
+
<CommandItem
|
|
190
|
+
value="user-profile"
|
|
191
|
+
onSelect={() => handleSelect("User Profile")}
|
|
192
|
+
>
|
|
193
|
+
<User className="mr-2 h-4 w-4" />
|
|
194
|
+
<span>Profile</span>
|
|
195
|
+
<CommandShortcut>⌘P</CommandShortcut>
|
|
196
|
+
</CommandItem>
|
|
197
|
+
<CommandItem
|
|
198
|
+
value="billing"
|
|
199
|
+
onSelect={() => handleSelect("Billing")}
|
|
200
|
+
>
|
|
201
|
+
<CreditCard className="mr-2 h-4 w-4" />
|
|
202
|
+
<span>Billing</span>
|
|
203
|
+
<CommandShortcut>⌘B</CommandShortcut>
|
|
204
|
+
</CommandItem>
|
|
205
|
+
<CommandItem
|
|
206
|
+
value="settings"
|
|
207
|
+
onSelect={() => handleSelect("Settings")}
|
|
208
|
+
>
|
|
209
|
+
<Settings className="mr-2 h-4 w-4" />
|
|
210
|
+
<span>Settings</span>
|
|
211
|
+
<CommandShortcut>⌘S</CommandShortcut>
|
|
212
|
+
</CommandItem>
|
|
213
|
+
</CommandGroup>
|
|
214
|
+
</CommandList>
|
|
215
|
+
</Command>
|
|
216
|
+
|
|
217
|
+
<CommandDialog open={dialogOpen} onOpenChange={setDialogOpen}>
|
|
218
|
+
<CommandInput placeholder="Type a command or search..." />
|
|
219
|
+
<CommandList>
|
|
220
|
+
<CommandEmpty>No results found.</CommandEmpty>
|
|
221
|
+
<CommandGroup heading="Quick Actions">
|
|
222
|
+
<CommandItem
|
|
223
|
+
onSelect={() => {
|
|
224
|
+
console.log("Calendar");
|
|
225
|
+
setDialogOpen(false);
|
|
226
|
+
}}
|
|
227
|
+
>
|
|
228
|
+
<Calendar className="mr-2 h-4 w-4" />
|
|
229
|
+
<span>Calendar</span>
|
|
230
|
+
</CommandItem>
|
|
231
|
+
<CommandItem
|
|
232
|
+
onSelect={() => {
|
|
233
|
+
console.log("Calculator");
|
|
234
|
+
setDialogOpen(false);
|
|
235
|
+
}}
|
|
236
|
+
>
|
|
237
|
+
<Calculator className="mr-2 h-4 w-4" />
|
|
238
|
+
<span>Calculator</span>
|
|
239
|
+
</CommandItem>
|
|
240
|
+
<CommandItem
|
|
241
|
+
onSelect={() => {
|
|
242
|
+
console.log("Search Emoji");
|
|
243
|
+
setDialogOpen(false);
|
|
244
|
+
}}
|
|
245
|
+
>
|
|
246
|
+
<Smile className="mr-2 h-4 w-4" />
|
|
247
|
+
<span>Search Emoji</span>
|
|
248
|
+
</CommandItem>
|
|
249
|
+
</CommandGroup>
|
|
250
|
+
</CommandList>
|
|
251
|
+
</CommandDialog>
|
|
252
|
+
</div>
|
|
253
|
+
);
|
|
254
|
+
},
|
|
255
|
+
args: {
|
|
256
|
+
loop: false,
|
|
257
|
+
},
|
|
258
|
+
parameters: {
|
|
259
|
+
docs: {
|
|
260
|
+
description: {
|
|
261
|
+
story:
|
|
262
|
+
"Interactive playground to test all Command features. Try searching, selecting items, keyboard navigation (arrow keys, Enter, Escape), and the dialog mode with ⌘K. Check the Actions panel to see selection events.",
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Showcase of all available component variants and configurations.
|
|
270
|
+
* Demonstrates different layouts, groupings, and feature combinations.
|
|
271
|
+
*/
|
|
272
|
+
export const Variants: Story = {
|
|
273
|
+
render: () => (
|
|
274
|
+
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6 w-full max-w-5xl">
|
|
275
|
+
{/* Basic Command Menu */}
|
|
276
|
+
<div className="space-y-2">
|
|
277
|
+
<h3 className="text-sm font-medium">Basic Command Menu</h3>
|
|
278
|
+
<Command className="rounded-lg border shadow-md">
|
|
279
|
+
<CommandInput placeholder="Type a command or search..." />
|
|
280
|
+
<CommandList>
|
|
281
|
+
<CommandEmpty>No results found.</CommandEmpty>
|
|
282
|
+
<CommandGroup heading="Suggestions">
|
|
283
|
+
<CommandItem>
|
|
284
|
+
<Calendar className="mr-2 h-4 w-4" />
|
|
285
|
+
<span>Calendar</span>
|
|
286
|
+
</CommandItem>
|
|
287
|
+
<CommandItem>
|
|
288
|
+
<Smile className="mr-2 h-4 w-4" />
|
|
289
|
+
<span>Search Emoji</span>
|
|
290
|
+
</CommandItem>
|
|
291
|
+
<CommandItem>
|
|
292
|
+
<Calculator className="mr-2 h-4 w-4" />
|
|
293
|
+
<span>Calculator</span>
|
|
294
|
+
</CommandItem>
|
|
295
|
+
</CommandGroup>
|
|
296
|
+
</CommandList>
|
|
297
|
+
</Command>
|
|
298
|
+
</div>
|
|
299
|
+
|
|
300
|
+
{/* With Shortcuts */}
|
|
301
|
+
<div className="space-y-2">
|
|
302
|
+
<h3 className="text-sm font-medium">With Keyboard Shortcuts</h3>
|
|
303
|
+
<Command className="rounded-lg border shadow-md">
|
|
304
|
+
<CommandInput placeholder="All commands have shortcuts..." />
|
|
305
|
+
<CommandList>
|
|
306
|
+
<CommandEmpty>No results found.</CommandEmpty>
|
|
307
|
+
<CommandGroup heading="File">
|
|
308
|
+
<CommandItem>
|
|
309
|
+
<FileText className="mr-2 h-4 w-4" />
|
|
310
|
+
<span>New File</span>
|
|
311
|
+
<CommandShortcut>⌘N</CommandShortcut>
|
|
312
|
+
</CommandItem>
|
|
313
|
+
<CommandItem>
|
|
314
|
+
<Download className="mr-2 h-4 w-4" />
|
|
315
|
+
<span>Save</span>
|
|
316
|
+
<CommandShortcut>⌘S</CommandShortcut>
|
|
317
|
+
</CommandItem>
|
|
318
|
+
</CommandGroup>
|
|
319
|
+
<CommandSeparator />
|
|
320
|
+
<CommandGroup heading="Edit">
|
|
321
|
+
<CommandItem>
|
|
322
|
+
<Copy className="mr-2 h-4 w-4" />
|
|
323
|
+
<span>Copy</span>
|
|
324
|
+
<CommandShortcut>⌘C</CommandShortcut>
|
|
325
|
+
</CommandItem>
|
|
326
|
+
<CommandItem>
|
|
327
|
+
<Edit className="mr-2 h-4 w-4" />
|
|
328
|
+
<span>Paste</span>
|
|
329
|
+
<CommandShortcut>⌘V</CommandShortcut>
|
|
330
|
+
</CommandItem>
|
|
331
|
+
</CommandGroup>
|
|
332
|
+
</CommandList>
|
|
333
|
+
</Command>
|
|
334
|
+
</div>
|
|
335
|
+
|
|
336
|
+
{/* Without Input */}
|
|
337
|
+
<div className="space-y-2">
|
|
338
|
+
<h3 className="text-sm font-medium">Menu Without Search</h3>
|
|
339
|
+
<Command className="rounded-lg border shadow-md">
|
|
340
|
+
<CommandList>
|
|
341
|
+
<CommandGroup heading="Quick Actions">
|
|
342
|
+
<CommandItem>
|
|
343
|
+
<Mail className="mr-2 h-4 w-4" />
|
|
344
|
+
<span>Send Email</span>
|
|
345
|
+
<CommandShortcut>⌘E</CommandShortcut>
|
|
346
|
+
</CommandItem>
|
|
347
|
+
<CommandItem>
|
|
348
|
+
<Calendar className="mr-2 h-4 w-4" />
|
|
349
|
+
<span>Schedule Meeting</span>
|
|
350
|
+
<CommandShortcut>⌘M</CommandShortcut>
|
|
351
|
+
</CommandItem>
|
|
352
|
+
<CommandItem>
|
|
353
|
+
<Star className="mr-2 h-4 w-4" />
|
|
354
|
+
<span>Add to Favorites</span>
|
|
355
|
+
<CommandShortcut>⌘F</CommandShortcut>
|
|
356
|
+
</CommandItem>
|
|
357
|
+
</CommandGroup>
|
|
358
|
+
</CommandList>
|
|
359
|
+
</Command>
|
|
360
|
+
</div>
|
|
361
|
+
|
|
362
|
+
{/* Custom Empty State */}
|
|
363
|
+
<div className="space-y-2">
|
|
364
|
+
<h3 className="text-sm font-medium">Custom Empty State</h3>
|
|
365
|
+
<Command className="rounded-lg border shadow-md">
|
|
366
|
+
<CommandInput placeholder="Search for something that doesn't exist..." />
|
|
367
|
+
<CommandList>
|
|
368
|
+
<CommandEmpty>
|
|
369
|
+
<div className="py-6 text-center">
|
|
370
|
+
<Search className="mx-auto h-10 w-10 text-muted-foreground/50" />
|
|
371
|
+
<h3 className="mt-2 text-sm font-medium">No results found</h3>
|
|
372
|
+
<p className="mt-1 text-sm text-muted-foreground">
|
|
373
|
+
Try adjusting your search terms.
|
|
374
|
+
</p>
|
|
375
|
+
</div>
|
|
376
|
+
</CommandEmpty>
|
|
377
|
+
</CommandList>
|
|
378
|
+
</Command>
|
|
379
|
+
</div>
|
|
380
|
+
</div>
|
|
381
|
+
),
|
|
382
|
+
parameters: {
|
|
383
|
+
layout: "centered",
|
|
384
|
+
docs: {
|
|
385
|
+
description: {
|
|
386
|
+
story:
|
|
387
|
+
"Comprehensive showcase of different Command component configurations including basic menus, keyboard shortcuts, menus without search input, and custom empty states.",
|
|
388
|
+
},
|
|
389
|
+
},
|
|
390
|
+
},
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Real-world usage example showing Command in a practical application context.
|
|
395
|
+
* Perfect for demonstrating to designers and business teams how the component works in production.
|
|
396
|
+
*/
|
|
397
|
+
export const InContext: Story = {
|
|
398
|
+
render: function CommandInApp() {
|
|
399
|
+
const [searchOpen, setSearchOpen] = React.useState(false);
|
|
400
|
+
const [quickActionsOpen, setQuickActionsOpen] = React.useState(false);
|
|
401
|
+
|
|
402
|
+
React.useEffect(() => {
|
|
403
|
+
const down = (e: KeyboardEvent) => {
|
|
404
|
+
if (e.key === "k" && (e.metaKey || e.ctrlKey)) {
|
|
405
|
+
e.preventDefault();
|
|
406
|
+
setSearchOpen(true);
|
|
407
|
+
}
|
|
408
|
+
if (e.key === "j" && (e.metaKey || e.ctrlKey)) {
|
|
409
|
+
e.preventDefault();
|
|
410
|
+
setQuickActionsOpen(true);
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
document.addEventListener("keydown", down);
|
|
414
|
+
return () => document.removeEventListener("keydown", down);
|
|
415
|
+
}, []);
|
|
416
|
+
|
|
417
|
+
return (
|
|
418
|
+
<div className="w-full max-w-4xl mx-auto">
|
|
419
|
+
{/* App Header */}
|
|
420
|
+
<div className="border-b bg-background px-6 py-4">
|
|
421
|
+
<div className="flex items-center justify-between">
|
|
422
|
+
<h1 className="text-xl font-semibold">Project Dashboard</h1>
|
|
423
|
+
<div className="flex items-center gap-3">
|
|
424
|
+
<Button
|
|
425
|
+
variant="outline"
|
|
426
|
+
size="sm"
|
|
427
|
+
onClick={() => setSearchOpen(true)}
|
|
428
|
+
className="relative"
|
|
429
|
+
>
|
|
430
|
+
<Search className="mr-2 h-4 w-4" />
|
|
431
|
+
Search...
|
|
432
|
+
<kbd className="pointer-events-none absolute right-2 top-2 hidden h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100 sm:flex">
|
|
433
|
+
<span className="text-xs">⌘</span>K
|
|
434
|
+
</kbd>
|
|
435
|
+
</Button>
|
|
436
|
+
<Button
|
|
437
|
+
variant="outline"
|
|
438
|
+
size="sm"
|
|
439
|
+
onClick={() => setQuickActionsOpen(true)}
|
|
440
|
+
>
|
|
441
|
+
<Plus className="mr-2 h-4 w-4" />
|
|
442
|
+
Quick Actions
|
|
443
|
+
<kbd className="pointer-events-none ml-2 hidden h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100 sm:flex">
|
|
444
|
+
<span className="text-xs">⌘</span>J
|
|
445
|
+
</kbd>
|
|
446
|
+
</Button>
|
|
447
|
+
</div>
|
|
448
|
+
</div>
|
|
449
|
+
</div>
|
|
450
|
+
|
|
451
|
+
{/* App Content */}
|
|
452
|
+
<div className="p-6">
|
|
453
|
+
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
|
|
454
|
+
<div className="space-y-3">
|
|
455
|
+
<h2 className="font-medium">Recent Files</h2>
|
|
456
|
+
<div className="space-y-2">
|
|
457
|
+
{["project-plan.md", "meeting-notes.md", "budget.xlsx"].map(
|
|
458
|
+
(file) => (
|
|
459
|
+
<div key={file} className="p-3 border rounded-lg">
|
|
460
|
+
<div className="flex items-center gap-2">
|
|
461
|
+
<FileText className="h-4 w-4" />
|
|
462
|
+
<span className="text-sm">{file}</span>
|
|
463
|
+
</div>
|
|
464
|
+
</div>
|
|
465
|
+
),
|
|
466
|
+
)}
|
|
467
|
+
</div>
|
|
468
|
+
</div>
|
|
469
|
+
<div className="space-y-3">
|
|
470
|
+
<h2 className="font-medium">Quick Stats</h2>
|
|
471
|
+
<div className="space-y-2">
|
|
472
|
+
<div className="p-3 border rounded-lg">
|
|
473
|
+
<div className="text-2xl font-bold">24</div>
|
|
474
|
+
<div className="text-sm text-muted-foreground">
|
|
475
|
+
Active Projects
|
|
476
|
+
</div>
|
|
477
|
+
</div>
|
|
478
|
+
<div className="p-3 border rounded-lg">
|
|
479
|
+
<div className="text-2xl font-bold">156</div>
|
|
480
|
+
<div className="text-sm text-muted-foreground">
|
|
481
|
+
Tasks Completed
|
|
482
|
+
</div>
|
|
483
|
+
</div>
|
|
484
|
+
</div>
|
|
485
|
+
</div>
|
|
486
|
+
<div className="space-y-3">
|
|
487
|
+
<h2 className="font-medium">Team Activity</h2>
|
|
488
|
+
<div className="space-y-2">
|
|
489
|
+
<div className="p-3 border rounded-lg text-sm">
|
|
490
|
+
<div className="font-medium">Sarah updated design files</div>
|
|
491
|
+
<div className="text-muted-foreground">2 hours ago</div>
|
|
492
|
+
</div>
|
|
493
|
+
<div className="p-3 border rounded-lg text-sm">
|
|
494
|
+
<div className="font-medium">Mike completed code review</div>
|
|
495
|
+
<div className="text-muted-foreground">4 hours ago</div>
|
|
496
|
+
</div>
|
|
497
|
+
</div>
|
|
498
|
+
</div>
|
|
499
|
+
</div>
|
|
500
|
+
</div>
|
|
501
|
+
|
|
502
|
+
{/* Global Search Command Dialog */}
|
|
503
|
+
<CommandDialog open={searchOpen} onOpenChange={setSearchOpen}>
|
|
504
|
+
<CommandInput placeholder="Search files, projects, people..." />
|
|
505
|
+
<CommandList>
|
|
506
|
+
<CommandEmpty>No results found.</CommandEmpty>
|
|
507
|
+
<CommandGroup heading="Recent Files">
|
|
508
|
+
<CommandItem onSelect={() => setSearchOpen(false)}>
|
|
509
|
+
<FileText className="mr-2 h-4 w-4" />
|
|
510
|
+
<span>project-plan.md</span>
|
|
511
|
+
<span className="ml-auto text-xs text-muted-foreground">
|
|
512
|
+
Project Alpha
|
|
513
|
+
</span>
|
|
514
|
+
</CommandItem>
|
|
515
|
+
<CommandItem onSelect={() => setSearchOpen(false)}>
|
|
516
|
+
<FileText className="mr-2 h-4 w-4" />
|
|
517
|
+
<span>meeting-notes.md</span>
|
|
518
|
+
<span className="ml-auto text-xs text-muted-foreground">
|
|
519
|
+
Today
|
|
520
|
+
</span>
|
|
521
|
+
</CommandItem>
|
|
522
|
+
</CommandGroup>
|
|
523
|
+
<CommandSeparator />
|
|
524
|
+
<CommandGroup heading="Projects">
|
|
525
|
+
<CommandItem onSelect={() => setSearchOpen(false)}>
|
|
526
|
+
<Star className="mr-2 h-4 w-4" />
|
|
527
|
+
<span>Project Alpha</span>
|
|
528
|
+
<span className="ml-auto text-xs text-muted-foreground">
|
|
529
|
+
24 tasks
|
|
530
|
+
</span>
|
|
531
|
+
</CommandItem>
|
|
532
|
+
<CommandItem onSelect={() => setSearchOpen(false)}>
|
|
533
|
+
<Star className="mr-2 h-4 w-4" />
|
|
534
|
+
<span>Beta Launch</span>
|
|
535
|
+
<span className="ml-auto text-xs text-muted-foreground">
|
|
536
|
+
12 tasks
|
|
537
|
+
</span>
|
|
538
|
+
</CommandItem>
|
|
539
|
+
</CommandGroup>
|
|
540
|
+
<CommandSeparator />
|
|
541
|
+
<CommandGroup heading="Team Members">
|
|
542
|
+
<CommandItem onSelect={() => setSearchOpen(false)}>
|
|
543
|
+
<User className="mr-2 h-4 w-4" />
|
|
544
|
+
<span>Sarah Johnson</span>
|
|
545
|
+
<span className="ml-auto text-xs text-muted-foreground">
|
|
546
|
+
Designer
|
|
547
|
+
</span>
|
|
548
|
+
</CommandItem>
|
|
549
|
+
<CommandItem onSelect={() => setSearchOpen(false)}>
|
|
550
|
+
<User className="mr-2 h-4 w-4" />
|
|
551
|
+
<span>Mike Chen</span>
|
|
552
|
+
<span className="ml-auto text-xs text-muted-foreground">
|
|
553
|
+
Developer
|
|
554
|
+
</span>
|
|
555
|
+
</CommandItem>
|
|
556
|
+
</CommandGroup>
|
|
557
|
+
</CommandList>
|
|
558
|
+
</CommandDialog>
|
|
559
|
+
|
|
560
|
+
{/* Quick Actions Command Dialog */}
|
|
561
|
+
<CommandDialog
|
|
562
|
+
open={quickActionsOpen}
|
|
563
|
+
onOpenChange={setQuickActionsOpen}
|
|
564
|
+
>
|
|
565
|
+
<CommandInput placeholder="What would you like to do?" />
|
|
566
|
+
<CommandList>
|
|
567
|
+
<CommandEmpty>No actions found.</CommandEmpty>
|
|
568
|
+
<CommandGroup heading="Create">
|
|
569
|
+
<CommandItem onSelect={() => setQuickActionsOpen(false)}>
|
|
570
|
+
<Plus className="mr-2 h-4 w-4" />
|
|
571
|
+
<span>New Project</span>
|
|
572
|
+
<CommandShortcut>⌘N</CommandShortcut>
|
|
573
|
+
</CommandItem>
|
|
574
|
+
<CommandItem onSelect={() => setQuickActionsOpen(false)}>
|
|
575
|
+
<FileText className="mr-2 h-4 w-4" />
|
|
576
|
+
<span>New Document</span>
|
|
577
|
+
<CommandShortcut>⌘⇧N</CommandShortcut>
|
|
578
|
+
</CommandItem>
|
|
579
|
+
<CommandItem onSelect={() => setQuickActionsOpen(false)}>
|
|
580
|
+
<Calendar className="mr-2 h-4 w-4" />
|
|
581
|
+
<span>Schedule Meeting</span>
|
|
582
|
+
<CommandShortcut>⌘M</CommandShortcut>
|
|
583
|
+
</CommandItem>
|
|
584
|
+
</CommandGroup>
|
|
585
|
+
<CommandSeparator />
|
|
586
|
+
<CommandGroup heading="Navigate">
|
|
587
|
+
<CommandItem onSelect={() => setQuickActionsOpen(false)}>
|
|
588
|
+
<Settings className="mr-2 h-4 w-4" />
|
|
589
|
+
<span>Project Settings</span>
|
|
590
|
+
<CommandShortcut>⌘,</CommandShortcut>
|
|
591
|
+
</CommandItem>
|
|
592
|
+
<CommandItem onSelect={() => setQuickActionsOpen(false)}>
|
|
593
|
+
<User className="mr-2 h-4 w-4" />
|
|
594
|
+
<span>Team Members</span>
|
|
595
|
+
<CommandShortcut>⌘T</CommandShortcut>
|
|
596
|
+
</CommandItem>
|
|
597
|
+
<CommandItem onSelect={() => setQuickActionsOpen(false)}>
|
|
598
|
+
<Mail className="mr-2 h-4 w-4" />
|
|
599
|
+
<span>Messages</span>
|
|
600
|
+
<CommandShortcut>⌘I</CommandShortcut>
|
|
601
|
+
</CommandItem>
|
|
602
|
+
</CommandGroup>
|
|
603
|
+
<CommandSeparator />
|
|
604
|
+
<CommandGroup heading="Tools">
|
|
605
|
+
<CommandItem onSelect={() => setQuickActionsOpen(false)}>
|
|
606
|
+
<Calculator className="mr-2 h-4 w-4" />
|
|
607
|
+
<span>Calculator</span>
|
|
608
|
+
</CommandItem>
|
|
609
|
+
<CommandItem onSelect={() => setQuickActionsOpen(false)}>
|
|
610
|
+
<Download className="mr-2 h-4 w-4" />
|
|
611
|
+
<span>Export Data</span>
|
|
612
|
+
</CommandItem>
|
|
613
|
+
<CommandItem onSelect={() => setQuickActionsOpen(false)}>
|
|
614
|
+
<Share className="mr-2 h-4 w-4" />
|
|
615
|
+
<span>Share Project</span>
|
|
616
|
+
</CommandItem>
|
|
617
|
+
</CommandGroup>
|
|
618
|
+
</CommandList>
|
|
619
|
+
</CommandDialog>
|
|
620
|
+
</div>
|
|
621
|
+
);
|
|
622
|
+
},
|
|
623
|
+
parameters: {
|
|
624
|
+
layout: "fullscreen",
|
|
625
|
+
docs: {
|
|
626
|
+
description: {
|
|
627
|
+
story:
|
|
628
|
+
"Real-world example of Command components in a project dashboard application. Shows global search (⌘K) and quick actions (⌘J) command palettes that provide powerful navigation and action capabilities. This demonstrates how command palettes enhance user productivity in modern applications.",
|
|
629
|
+
},
|
|
630
|
+
},
|
|
631
|
+
},
|
|
632
|
+
};
|