@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,424 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@/lib/utils";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Table - A responsive data table component for displaying structured information
|
|
7
|
+
*
|
|
8
|
+
* Built on semantic HTML table elements with responsive scrolling and proper accessibility.
|
|
9
|
+
* Follows shadcn/ui patterns for data presentation and can be enhanced with TanStack Table
|
|
10
|
+
* for sorting, filtering, and pagination. Perfect for dashboards, data management, and
|
|
11
|
+
* structured content display.
|
|
12
|
+
*
|
|
13
|
+
* @component
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* // Basic table with Farcaster user data
|
|
17
|
+
* <Table>
|
|
18
|
+
* <TableCaption>Recent casts from your network</TableCaption>
|
|
19
|
+
* <TableHeader>
|
|
20
|
+
* <TableRow>
|
|
21
|
+
* <TableHead>User</TableHead>
|
|
22
|
+
* <TableHead>Channel</TableHead>
|
|
23
|
+
* <TableHead>Content</TableHead>
|
|
24
|
+
* <TableHead className="text-right">Reactions</TableHead>
|
|
25
|
+
* </TableRow>
|
|
26
|
+
* </TableHeader>
|
|
27
|
+
* <TableBody>
|
|
28
|
+
* <TableRow>
|
|
29
|
+
* <TableCell className="font-medium">@dwr.eth</TableCell>
|
|
30
|
+
* <TableCell>/farcaster</TableCell>
|
|
31
|
+
* <TableCell>Announcing Farcaster v2...</TableCell>
|
|
32
|
+
* <TableCell className="text-right">1,234</TableCell>
|
|
33
|
+
* </TableRow>
|
|
34
|
+
* </TableBody>
|
|
35
|
+
* </Table>
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```tsx
|
|
40
|
+
* // Table with selection and actions
|
|
41
|
+
* <Table>
|
|
42
|
+
* <TableHeader>
|
|
43
|
+
* <TableRow>
|
|
44
|
+
* <TableHead className="w-[50px]">
|
|
45
|
+
* <Checkbox />
|
|
46
|
+
* </TableHead>
|
|
47
|
+
* <TableHead>User</TableHead>
|
|
48
|
+
* <TableHead>FID</TableHead>
|
|
49
|
+
* <TableHead className="text-right">Actions</TableHead>
|
|
50
|
+
* </TableRow>
|
|
51
|
+
* </TableHeader>
|
|
52
|
+
* <TableBody>
|
|
53
|
+
* <TableRow data-state="selected">
|
|
54
|
+
* <TableCell><Checkbox checked /></TableCell>
|
|
55
|
+
* <TableCell>@vitalik.eth</TableCell>
|
|
56
|
+
* <TableCell>5650</TableCell>
|
|
57
|
+
* <TableCell className="text-right">
|
|
58
|
+
* <Button variant="ghost" size="sm">Edit</Button>
|
|
59
|
+
* </TableCell>
|
|
60
|
+
* </TableRow>
|
|
61
|
+
* </TableBody>
|
|
62
|
+
* </Table>
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```tsx
|
|
67
|
+
* // Table with footer totals
|
|
68
|
+
* <Table>
|
|
69
|
+
* <TableBody>
|
|
70
|
+
* <TableRow>
|
|
71
|
+
* <TableCell>/farcaster</TableCell>
|
|
72
|
+
* <TableCell className="text-right">5,234</TableCell>
|
|
73
|
+
* </TableRow>
|
|
74
|
+
* </TableBody>
|
|
75
|
+
* <TableFooter>
|
|
76
|
+
* <TableRow>
|
|
77
|
+
* <TableCell>Total</TableCell>
|
|
78
|
+
* <TableCell className="text-right">15,767</TableCell>
|
|
79
|
+
* </TableRow>
|
|
80
|
+
* </TableFooter>
|
|
81
|
+
* </Table>
|
|
82
|
+
* ```
|
|
83
|
+
*
|
|
84
|
+
* @accessibility
|
|
85
|
+
* - Semantic HTML table structure with thead, tbody, tfoot elements
|
|
86
|
+
* - Screen reader navigation with proper table headers and data relationships
|
|
87
|
+
* - Responsive horizontal scrolling container for mobile devices
|
|
88
|
+
* - Caption support for table descriptions and context
|
|
89
|
+
* - Selection states communicated via data-state attributes
|
|
90
|
+
* - Keyboard navigation support for interactive elements
|
|
91
|
+
*
|
|
92
|
+
* @see {@link https://ui.shadcn.com/docs/components/table} shadcn/ui Table documentation
|
|
93
|
+
* @see {@link https://ui.shadcn.com/docs/components/data-table} TanStack Table integration
|
|
94
|
+
* @see {@link TableHeader} Table header container component
|
|
95
|
+
* @see {@link TableBody} Table body container component
|
|
96
|
+
* @see {@link TableRow} Table row component with hover and selection states
|
|
97
|
+
* @see {@link TableCell} Table data cell component
|
|
98
|
+
* @see {@link TableHead} Table header cell component
|
|
99
|
+
* @since 1.0.0
|
|
100
|
+
*/
|
|
101
|
+
function Table({ className, ...props }: React.ComponentProps<"table">) {
|
|
102
|
+
return (
|
|
103
|
+
<div
|
|
104
|
+
data-slot="table-container"
|
|
105
|
+
className="relative w-full overflow-x-auto"
|
|
106
|
+
>
|
|
107
|
+
<table
|
|
108
|
+
data-slot="table"
|
|
109
|
+
className={cn("w-full caption-bottom text-sm", className)}
|
|
110
|
+
{...props}
|
|
111
|
+
/>
|
|
112
|
+
</div>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* TableHeader - Container for table header rows
|
|
118
|
+
*
|
|
119
|
+
* Groups header rows and applies consistent styling with bottom borders.
|
|
120
|
+
* Contains TableRow components with TableHead cells for column definitions.
|
|
121
|
+
* Essential for accessibility and proper table structure.
|
|
122
|
+
*
|
|
123
|
+
* @component
|
|
124
|
+
* @example
|
|
125
|
+
* ```tsx
|
|
126
|
+
* <TableHeader>
|
|
127
|
+
* <TableRow>
|
|
128
|
+
* <TableHead>Username</TableHead>
|
|
129
|
+
* <TableHead>FID</TableHead>
|
|
130
|
+
* <TableHead className="text-right">Actions</TableHead>
|
|
131
|
+
* </TableRow>
|
|
132
|
+
* </TableHeader>
|
|
133
|
+
* ```
|
|
134
|
+
*
|
|
135
|
+
* @accessibility
|
|
136
|
+
* - Semantic thead element for proper table structure
|
|
137
|
+
* - Screen readers identify this as the table header section
|
|
138
|
+
* - Provides context for data columns below
|
|
139
|
+
* @since 1.0.0
|
|
140
|
+
*/
|
|
141
|
+
function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
|
|
142
|
+
return (
|
|
143
|
+
<thead
|
|
144
|
+
data-slot="table-header"
|
|
145
|
+
className={cn("[&_tr]:border-b", className)}
|
|
146
|
+
{...props}
|
|
147
|
+
/>
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* TableBody - Container for table data rows
|
|
153
|
+
*
|
|
154
|
+
* Main content area of the table containing all data rows.
|
|
155
|
+
* Applies border styling where the last row has no bottom border.
|
|
156
|
+
* Contains TableRow components with TableCell elements.
|
|
157
|
+
*
|
|
158
|
+
* @component
|
|
159
|
+
* @example
|
|
160
|
+
* ```tsx
|
|
161
|
+
* <TableBody>
|
|
162
|
+
* <TableRow>
|
|
163
|
+
* <TableCell>@dwr.eth</TableCell>
|
|
164
|
+
* <TableCell>3</TableCell>
|
|
165
|
+
* <TableCell>45.2k followers</TableCell>
|
|
166
|
+
* </TableRow>
|
|
167
|
+
* <TableRow>
|
|
168
|
+
* <TableCell>@vitalik.eth</TableCell>
|
|
169
|
+
* <TableCell>5650</TableCell>
|
|
170
|
+
* <TableCell>112.3k followers</TableCell>
|
|
171
|
+
* </TableRow>
|
|
172
|
+
* </TableBody>
|
|
173
|
+
* ```
|
|
174
|
+
*
|
|
175
|
+
* @accessibility
|
|
176
|
+
* - Semantic tbody element for data rows
|
|
177
|
+
* - Supports keyboard navigation through rows
|
|
178
|
+
* - Screen readers navigate row by row through content
|
|
179
|
+
* @since 1.0.0
|
|
180
|
+
*/
|
|
181
|
+
function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
|
|
182
|
+
return (
|
|
183
|
+
<tbody
|
|
184
|
+
data-slot="table-body"
|
|
185
|
+
className={cn("[&_tr:last-child]:border-0", className)}
|
|
186
|
+
{...props}
|
|
187
|
+
/>
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* TableFooter - Container for table footer rows
|
|
193
|
+
*
|
|
194
|
+
* Used for summary rows, totals, or additional table information.
|
|
195
|
+
* Styled with a muted background and top border to distinguish from data rows.
|
|
196
|
+
* Typically contains aggregated data or table-wide information.
|
|
197
|
+
*
|
|
198
|
+
* @component
|
|
199
|
+
* @example
|
|
200
|
+
* ```tsx
|
|
201
|
+
* <TableFooter>
|
|
202
|
+
* <TableRow>
|
|
203
|
+
* <TableCell>Total Users</TableCell>
|
|
204
|
+
* <TableCell>15,767</TableCell>
|
|
205
|
+
* <TableCell className="text-right">+9.25%</TableCell>
|
|
206
|
+
* </TableRow>
|
|
207
|
+
* </TableFooter>
|
|
208
|
+
* ```
|
|
209
|
+
*
|
|
210
|
+
* @accessibility
|
|
211
|
+
* - Semantic tfoot element for summary data
|
|
212
|
+
* - Screen readers announce as table footer section
|
|
213
|
+
* - Distinguished visually and semantically from body content
|
|
214
|
+
* @since 1.0.0
|
|
215
|
+
*/
|
|
216
|
+
function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
|
|
217
|
+
return (
|
|
218
|
+
<tfoot
|
|
219
|
+
data-slot="table-footer"
|
|
220
|
+
className={cn(
|
|
221
|
+
"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",
|
|
222
|
+
className,
|
|
223
|
+
)}
|
|
224
|
+
{...props}
|
|
225
|
+
/>
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* TableRow - A table row component with interactive states
|
|
231
|
+
*
|
|
232
|
+
* Represents a single row in the table with hover effects and selection support.
|
|
233
|
+
* Supports data-state attributes for visual feedback and proper border styling.
|
|
234
|
+
* Essential building block for all table content areas.
|
|
235
|
+
*
|
|
236
|
+
* @component
|
|
237
|
+
* @example
|
|
238
|
+
* ```tsx
|
|
239
|
+
* // Basic row
|
|
240
|
+
* <TableRow>
|
|
241
|
+
* <TableCell>@dwr.eth</TableCell>
|
|
242
|
+
* <TableCell>/farcaster</TableCell>
|
|
243
|
+
* </TableRow>
|
|
244
|
+
*
|
|
245
|
+
* // Selected row
|
|
246
|
+
* <TableRow data-state="selected">
|
|
247
|
+
* <TableCell>@vitalik.eth</TableCell>
|
|
248
|
+
* <TableCell>/ethereum</TableCell>
|
|
249
|
+
* </TableRow>
|
|
250
|
+
* ```
|
|
251
|
+
*
|
|
252
|
+
* @accessibility
|
|
253
|
+
* - Supports data-state="selected" for selection indication
|
|
254
|
+
* - Hover state enhances interactivity and focus
|
|
255
|
+
* - Semantic tr element maintains table structure
|
|
256
|
+
* - Visual feedback for user interactions
|
|
257
|
+
* @since 1.0.0
|
|
258
|
+
*/
|
|
259
|
+
function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
|
|
260
|
+
return (
|
|
261
|
+
<tr
|
|
262
|
+
data-slot="table-row"
|
|
263
|
+
className={cn(
|
|
264
|
+
"hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",
|
|
265
|
+
className,
|
|
266
|
+
)}
|
|
267
|
+
{...props}
|
|
268
|
+
/>
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* TableHead - Table header cell component for column definitions
|
|
274
|
+
*
|
|
275
|
+
* Used for column headers with medium font weight and proper text alignment.
|
|
276
|
+
* Includes special styling for checkbox columns and interactive elements.
|
|
277
|
+
* Essential for screen reader navigation and table accessibility.
|
|
278
|
+
*
|
|
279
|
+
* @component
|
|
280
|
+
* @example
|
|
281
|
+
* ```tsx
|
|
282
|
+
* // Text headers
|
|
283
|
+
* <TableHead>Username</TableHead>
|
|
284
|
+
* <TableHead className="text-right">Followers</TableHead>
|
|
285
|
+
*
|
|
286
|
+
* // Checkbox header
|
|
287
|
+
* <TableHead className="w-[50px]">
|
|
288
|
+
* <Checkbox />
|
|
289
|
+
* </TableHead>
|
|
290
|
+
*
|
|
291
|
+
* // Sortable header
|
|
292
|
+
* <TableHead>
|
|
293
|
+
* <Button variant="ghost">FID ↕</Button>
|
|
294
|
+
* </TableHead>
|
|
295
|
+
* ```
|
|
296
|
+
*
|
|
297
|
+
* @accessibility
|
|
298
|
+
* - Semantic th element for column headers
|
|
299
|
+
* - Screen readers announce as column headers for navigation
|
|
300
|
+
* - Supports scope attribute for complex table relationships
|
|
301
|
+
* - Special checkbox styling maintains proper alignment
|
|
302
|
+
* @since 1.0.0
|
|
303
|
+
*/
|
|
304
|
+
function TableHead({ className, ...props }: React.ComponentProps<"th">) {
|
|
305
|
+
return (
|
|
306
|
+
<th
|
|
307
|
+
data-slot="table-head"
|
|
308
|
+
className={cn(
|
|
309
|
+
"text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
310
|
+
className,
|
|
311
|
+
)}
|
|
312
|
+
{...props}
|
|
313
|
+
/>
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* TableCell - Table data cell component for content display
|
|
319
|
+
*
|
|
320
|
+
* Used for data cells within table rows with consistent padding and alignment.
|
|
321
|
+
* Supports custom styling, truncation, and special handling for interactive elements
|
|
322
|
+
* like checkboxes and buttons.
|
|
323
|
+
*
|
|
324
|
+
* @component
|
|
325
|
+
* @example
|
|
326
|
+
* ```tsx
|
|
327
|
+
* // Basic data cells
|
|
328
|
+
* <TableCell>@dwr.eth</TableCell>
|
|
329
|
+
* <TableCell className="text-right">1,234</TableCell>
|
|
330
|
+
* <TableCell className="font-medium">Active</TableCell>
|
|
331
|
+
*
|
|
332
|
+
* // Cell with checkbox
|
|
333
|
+
* <TableCell>
|
|
334
|
+
* <Checkbox checked />
|
|
335
|
+
* </TableCell>
|
|
336
|
+
*
|
|
337
|
+
* // Cell with truncated content
|
|
338
|
+
* <TableCell className="max-w-[200px] truncate">
|
|
339
|
+
* This is a very long piece of content...
|
|
340
|
+
* </TableCell>
|
|
341
|
+
*
|
|
342
|
+
* // Cell spanning multiple columns
|
|
343
|
+
* <TableCell colSpan={3} className="text-center">
|
|
344
|
+
* No data available
|
|
345
|
+
* </TableCell>
|
|
346
|
+
* ```
|
|
347
|
+
*
|
|
348
|
+
* @accessibility
|
|
349
|
+
* - Semantic td element for data cells
|
|
350
|
+
* - Supports checkbox cells with proper alignment adjustments
|
|
351
|
+
* - Screen readers navigate cell by cell for data comprehension
|
|
352
|
+
* - ColSpan support for empty states and grouped content
|
|
353
|
+
* @since 1.0.0
|
|
354
|
+
*/
|
|
355
|
+
function TableCell({ className, ...props }: React.ComponentProps<"td">) {
|
|
356
|
+
return (
|
|
357
|
+
<td
|
|
358
|
+
data-slot="table-cell"
|
|
359
|
+
className={cn(
|
|
360
|
+
"p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
361
|
+
className,
|
|
362
|
+
)}
|
|
363
|
+
{...props}
|
|
364
|
+
/>
|
|
365
|
+
);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* TableCaption - Table caption for describing table content and context
|
|
370
|
+
*
|
|
371
|
+
* Provides a description, title, or additional context for the table.
|
|
372
|
+
* Displayed with muted styling and proper spacing. Essential for accessibility
|
|
373
|
+
* as screen readers announce the caption to provide table context.
|
|
374
|
+
*
|
|
375
|
+
* @component
|
|
376
|
+
* @example
|
|
377
|
+
* ```tsx
|
|
378
|
+
* <Table>
|
|
379
|
+
* <TableCaption>Recent casts from your network</TableCaption>
|
|
380
|
+
* <TableHeader>...</TableHeader>
|
|
381
|
+
* <TableBody>...</TableBody>
|
|
382
|
+
* </Table>
|
|
383
|
+
*
|
|
384
|
+
* // Caption with additional context
|
|
385
|
+
* <Table>
|
|
386
|
+
* <TableCaption>
|
|
387
|
+
* Channel analytics for the last 30 days.
|
|
388
|
+
* Data updated every hour.
|
|
389
|
+
* </TableCaption>
|
|
390
|
+
* <TableHeader>...</TableHeader>
|
|
391
|
+
* <TableBody>...</TableBody>
|
|
392
|
+
* </Table>
|
|
393
|
+
* ```
|
|
394
|
+
*
|
|
395
|
+
* @accessibility
|
|
396
|
+
* - Semantic caption element positioned according to HTML standards
|
|
397
|
+
* - Screen readers announce caption before table content
|
|
398
|
+
* - Provides essential context for understanding table data
|
|
399
|
+
* - Helps users understand table purpose and scope
|
|
400
|
+
* @since 1.0.0
|
|
401
|
+
*/
|
|
402
|
+
function TableCaption({
|
|
403
|
+
className,
|
|
404
|
+
...props
|
|
405
|
+
}: React.ComponentProps<"caption">) {
|
|
406
|
+
return (
|
|
407
|
+
<caption
|
|
408
|
+
data-slot="table-caption"
|
|
409
|
+
className={cn("text-muted-foreground mt-4 text-sm", className)}
|
|
410
|
+
{...props}
|
|
411
|
+
/>
|
|
412
|
+
);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
export {
|
|
416
|
+
Table,
|
|
417
|
+
TableHeader,
|
|
418
|
+
TableBody,
|
|
419
|
+
TableFooter,
|
|
420
|
+
TableHead,
|
|
421
|
+
TableRow,
|
|
422
|
+
TableCell,
|
|
423
|
+
TableCaption,
|
|
424
|
+
};
|