@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,90 @@
|
|
|
1
|
+
# Form Components
|
|
2
|
+
|
|
3
|
+
Essential form components for building interactive user interfaces with proper TypeScript support.
|
|
4
|
+
|
|
5
|
+
## Basic Input Components
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { Input, Label, Textarea, TextField } from "@neynar/ui"
|
|
9
|
+
|
|
10
|
+
// Basic input with label
|
|
11
|
+
<div className="space-y-2">
|
|
12
|
+
<Label htmlFor="email">Email</Label>
|
|
13
|
+
<Input id="email" type="email" placeholder="Enter your email" />
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
// Textarea for longer content
|
|
17
|
+
<Textarea placeholder="Enter your message" rows={4} />
|
|
18
|
+
|
|
19
|
+
// Combined text field (input + label)
|
|
20
|
+
<TextField label="Username" placeholder="Enter username" required />
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Selection Components
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@neynar/ui"
|
|
27
|
+
import { Checkbox, Switch, RadioGroup, RadioGroupItem } from "@neynar/ui"
|
|
28
|
+
|
|
29
|
+
// Select dropdown
|
|
30
|
+
<Select>
|
|
31
|
+
<SelectTrigger>
|
|
32
|
+
<SelectValue placeholder="Select option" />
|
|
33
|
+
</SelectTrigger>
|
|
34
|
+
<SelectContent>
|
|
35
|
+
<SelectItem value="option1">Option 1</SelectItem>
|
|
36
|
+
<SelectItem value="option2">Option 2</SelectItem>
|
|
37
|
+
</SelectContent>
|
|
38
|
+
</Select>
|
|
39
|
+
|
|
40
|
+
// Checkbox with label
|
|
41
|
+
<div className="flex items-center space-x-2">
|
|
42
|
+
<Checkbox id="terms" />
|
|
43
|
+
<Label htmlFor="terms">Accept terms</Label>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
// Switch toggle
|
|
47
|
+
<Switch defaultChecked />
|
|
48
|
+
|
|
49
|
+
// Radio group
|
|
50
|
+
<RadioGroup defaultValue="option1">
|
|
51
|
+
<div className="flex items-center space-x-2">
|
|
52
|
+
<RadioGroupItem value="option1" id="r1" />
|
|
53
|
+
<Label htmlFor="r1">Option 1</Label>
|
|
54
|
+
</div>
|
|
55
|
+
</RadioGroup>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Advanced Components
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
import { Slider, Calendar, DatePicker, Combobox } from "@neynar/ui"
|
|
62
|
+
|
|
63
|
+
// Range slider
|
|
64
|
+
<Slider defaultValue={[50]} max={100} step={1} />
|
|
65
|
+
|
|
66
|
+
// Date picker
|
|
67
|
+
<DatePicker placeholder="Pick a date" />
|
|
68
|
+
|
|
69
|
+
// Combobox with search
|
|
70
|
+
<Combobox
|
|
71
|
+
options={[
|
|
72
|
+
{ value: "react", label: "React" },
|
|
73
|
+
{ value: "vue", label: "Vue" }
|
|
74
|
+
]}
|
|
75
|
+
placeholder="Select framework"
|
|
76
|
+
/>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## TypeScript Types
|
|
80
|
+
|
|
81
|
+
```tsx
|
|
82
|
+
type FormData = {
|
|
83
|
+
email: string
|
|
84
|
+
message: string
|
|
85
|
+
category: string
|
|
86
|
+
notifications: boolean
|
|
87
|
+
priority: "low" | "medium" | "high"
|
|
88
|
+
deadline: Date
|
|
89
|
+
}
|
|
90
|
+
```
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Layout Components
|
|
2
|
+
|
|
3
|
+
## Container
|
|
4
|
+
Responsive container with max-width constraints and padding.
|
|
5
|
+
|
|
6
|
+
```tsx
|
|
7
|
+
import { Container } from "@neynar/ui";
|
|
8
|
+
|
|
9
|
+
<Container size="sm">Content</Container>
|
|
10
|
+
<Container size="md" className="py-8">Main content area</Container>
|
|
11
|
+
<Container size="lg">Wide layout</Container>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Stack
|
|
15
|
+
Vertical and horizontal spacing utility for consistent layouts.
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { Stack } from "@neynar/ui";
|
|
19
|
+
|
|
20
|
+
<Stack direction="vertical" spacing="md">
|
|
21
|
+
<div>Item 1</div>
|
|
22
|
+
<div>Item 2</div>
|
|
23
|
+
</Stack>
|
|
24
|
+
|
|
25
|
+
<Stack direction="horizontal" spacing="sm" align="center">
|
|
26
|
+
<button>Action</button>
|
|
27
|
+
<span>Label</span>
|
|
28
|
+
</Stack>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Separator
|
|
32
|
+
Visual divider for content sections.
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import { Separator } from "@neynar/ui";
|
|
36
|
+
|
|
37
|
+
<div>
|
|
38
|
+
<p>Section 1</p>
|
|
39
|
+
<Separator className="my-4" />
|
|
40
|
+
<p>Section 2</p>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<Separator orientation="vertical" className="h-6 mx-2" />
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## AspectRatio
|
|
47
|
+
Maintain consistent aspect ratios for media and containers.
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
import { AspectRatio } from "@neynar/ui";
|
|
51
|
+
|
|
52
|
+
<AspectRatio ratio={16 / 9}>
|
|
53
|
+
<img src="/image.jpg" alt="Video thumbnail" className="object-cover" />
|
|
54
|
+
</AspectRatio>
|
|
55
|
+
|
|
56
|
+
<AspectRatio ratio={1} className="bg-muted">
|
|
57
|
+
<div className="flex items-center justify-center">1:1 Square</div>
|
|
58
|
+
</AspectRatio>
|
|
59
|
+
```
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Menu Components
|
|
2
|
+
|
|
3
|
+
Menu components for dropdown actions, context menus, menubars, and command palettes.
|
|
4
|
+
|
|
5
|
+
## DropdownMenu
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { Button } from "@neynar/ui"
|
|
9
|
+
import {
|
|
10
|
+
DropdownMenu,
|
|
11
|
+
DropdownMenuContent,
|
|
12
|
+
DropdownMenuItem,
|
|
13
|
+
DropdownMenuTrigger,
|
|
14
|
+
} from "@neynar/ui"
|
|
15
|
+
|
|
16
|
+
<DropdownMenu>
|
|
17
|
+
<DropdownMenuTrigger asChild>
|
|
18
|
+
<Button variant="outline">Actions</Button>
|
|
19
|
+
</DropdownMenuTrigger>
|
|
20
|
+
<DropdownMenuContent>
|
|
21
|
+
<DropdownMenuItem>Edit</DropdownMenuItem>
|
|
22
|
+
<DropdownMenuItem>Delete</DropdownMenuItem>
|
|
23
|
+
</DropdownMenuContent>
|
|
24
|
+
</DropdownMenu>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## ContextMenu
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuTrigger } from "@neynar/ui"
|
|
31
|
+
|
|
32
|
+
<ContextMenu>
|
|
33
|
+
<ContextMenuTrigger>Right-click me</ContextMenuTrigger>
|
|
34
|
+
<ContextMenuContent>
|
|
35
|
+
<ContextMenuItem>Copy</ContextMenuItem>
|
|
36
|
+
<ContextMenuItem>Paste</ContextMenuItem>
|
|
37
|
+
</ContextMenuContent>
|
|
38
|
+
</ContextMenu>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Menubar
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
import { Menubar, MenubarContent, MenubarItem, MenubarMenu, MenubarTrigger } from "@neynar/ui"
|
|
45
|
+
|
|
46
|
+
<Menubar>
|
|
47
|
+
<MenubarMenu>
|
|
48
|
+
<MenubarTrigger>File</MenubarTrigger>
|
|
49
|
+
<MenubarContent>
|
|
50
|
+
<MenubarItem>New File</MenubarItem>
|
|
51
|
+
<MenubarItem>Open</MenubarItem>
|
|
52
|
+
</MenubarContent>
|
|
53
|
+
</MenubarMenu>
|
|
54
|
+
</Menubar>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Command
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem } from "@neynar/ui"
|
|
61
|
+
|
|
62
|
+
<Command>
|
|
63
|
+
<CommandInput placeholder="Search..." />
|
|
64
|
+
<CommandEmpty>No results found.</CommandEmpty>
|
|
65
|
+
<CommandGroup heading="Actions">
|
|
66
|
+
<CommandItem>Profile</CommandItem>
|
|
67
|
+
<CommandItem>Settings</CommandItem>
|
|
68
|
+
</CommandGroup>
|
|
69
|
+
</Command>
|
|
70
|
+
```
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Navigation Components
|
|
2
|
+
|
|
3
|
+
Navigation components for building intuitive user interfaces with clear hierarchy and wayfinding.
|
|
4
|
+
|
|
5
|
+
## NavigationMenu
|
|
6
|
+
|
|
7
|
+
Main navigation with dropdowns and multi-level support.
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger } from "@neynar/ui"
|
|
11
|
+
|
|
12
|
+
export function AppNavigation() {
|
|
13
|
+
return (
|
|
14
|
+
<NavigationMenu>
|
|
15
|
+
<NavigationMenuList>
|
|
16
|
+
<NavigationMenuItem>
|
|
17
|
+
<NavigationMenuTrigger>Products</NavigationMenuTrigger>
|
|
18
|
+
<NavigationMenuContent>
|
|
19
|
+
<NavigationMenuLink href="/analytics">Analytics</NavigationMenuLink>
|
|
20
|
+
<NavigationMenuLink href="/api">API</NavigationMenuLink>
|
|
21
|
+
</NavigationMenuContent>
|
|
22
|
+
</NavigationMenuItem>
|
|
23
|
+
<NavigationMenuItem>
|
|
24
|
+
<NavigationMenuLink href="/docs">Documentation</NavigationMenuLink>
|
|
25
|
+
</NavigationMenuItem>
|
|
26
|
+
</NavigationMenuList>
|
|
27
|
+
</NavigationMenu>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Tabs
|
|
33
|
+
|
|
34
|
+
Content organization with horizontal navigation.
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@neynar/ui"
|
|
38
|
+
|
|
39
|
+
export function SettingsTabs() {
|
|
40
|
+
return (
|
|
41
|
+
<Tabs defaultValue="profile">
|
|
42
|
+
<TabsList>
|
|
43
|
+
<TabsTrigger value="profile">Profile</TabsTrigger>
|
|
44
|
+
<TabsTrigger value="security">Security</TabsTrigger>
|
|
45
|
+
<TabsTrigger value="notifications">Notifications</TabsTrigger>
|
|
46
|
+
</TabsList>
|
|
47
|
+
<TabsContent value="profile">Profile settings content</TabsContent>
|
|
48
|
+
<TabsContent value="security">Security settings content</TabsContent>
|
|
49
|
+
</Tabs>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Breadcrumb
|
|
55
|
+
|
|
56
|
+
Hierarchical navigation showing current location.
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "@neynar/ui"
|
|
60
|
+
|
|
61
|
+
export function PageBreadcrumb() {
|
|
62
|
+
return (
|
|
63
|
+
<Breadcrumb>
|
|
64
|
+
<BreadcrumbList>
|
|
65
|
+
<BreadcrumbItem>
|
|
66
|
+
<BreadcrumbLink href="/">Home</BreadcrumbLink>
|
|
67
|
+
</BreadcrumbItem>
|
|
68
|
+
<BreadcrumbSeparator />
|
|
69
|
+
<BreadcrumbItem>
|
|
70
|
+
<BreadcrumbLink href="/products">Products</BreadcrumbLink>
|
|
71
|
+
</BreadcrumbItem>
|
|
72
|
+
<BreadcrumbSeparator />
|
|
73
|
+
<BreadcrumbItem>
|
|
74
|
+
<BreadcrumbPage>Analytics Dashboard</BreadcrumbPage>
|
|
75
|
+
</BreadcrumbItem>
|
|
76
|
+
</BreadcrumbList>
|
|
77
|
+
</Breadcrumb>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
```
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Overlay Components
|
|
2
|
+
|
|
3
|
+
Overlay components create layered interfaces and contextual information displays.
|
|
4
|
+
|
|
5
|
+
## Dialog
|
|
6
|
+
|
|
7
|
+
Modal dialogs for important actions and forms.
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger } from "@neynar/ui";
|
|
11
|
+
|
|
12
|
+
// Basic controlled dialog
|
|
13
|
+
function UserSettingsDialog() {
|
|
14
|
+
const [open, setOpen] = useState(false);
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<Dialog open={open} onOpenChange={setOpen}>
|
|
18
|
+
<DialogTrigger asChild>
|
|
19
|
+
<Button>Settings</Button>
|
|
20
|
+
</DialogTrigger>
|
|
21
|
+
<DialogContent>
|
|
22
|
+
<DialogHeader>
|
|
23
|
+
<DialogTitle>User Settings</DialogTitle>
|
|
24
|
+
<DialogDescription>Update your preferences</DialogDescription>
|
|
25
|
+
</DialogHeader>
|
|
26
|
+
{/* Form content */}
|
|
27
|
+
</DialogContent>
|
|
28
|
+
</Dialog>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## AlertDialog
|
|
34
|
+
|
|
35
|
+
Confirmation dialogs for destructive actions.
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "@neynar/ui";
|
|
39
|
+
|
|
40
|
+
function DeleteConfirmation({ onConfirm }: { onConfirm: () => void }) {
|
|
41
|
+
return (
|
|
42
|
+
<AlertDialog>
|
|
43
|
+
<AlertDialogTrigger asChild>
|
|
44
|
+
<Button variant="destructive">Delete</Button>
|
|
45
|
+
</AlertDialogTrigger>
|
|
46
|
+
<AlertDialogContent>
|
|
47
|
+
<AlertDialogHeader>
|
|
48
|
+
<AlertDialogTitle>Are you sure?</AlertDialogTitle>
|
|
49
|
+
<AlertDialogDescription>This action cannot be undone.</AlertDialogDescription>
|
|
50
|
+
</AlertDialogHeader>
|
|
51
|
+
<AlertDialogFooter>
|
|
52
|
+
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
53
|
+
<AlertDialogAction onClick={onConfirm}>Delete</AlertDialogAction>
|
|
54
|
+
</AlertDialogFooter>
|
|
55
|
+
</AlertDialogContent>
|
|
56
|
+
</AlertDialog>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Sheet
|
|
62
|
+
|
|
63
|
+
Side panels for navigation or supplementary content.
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, SheetTrigger } from "@neynar/ui";
|
|
67
|
+
|
|
68
|
+
function MobileMenu() {
|
|
69
|
+
return (
|
|
70
|
+
<Sheet>
|
|
71
|
+
<SheetTrigger asChild>
|
|
72
|
+
<Button variant="ghost" size="sm">Menu</Button>
|
|
73
|
+
</SheetTrigger>
|
|
74
|
+
<SheetContent side="left">
|
|
75
|
+
<SheetHeader>
|
|
76
|
+
<SheetTitle>Navigation</SheetTitle>
|
|
77
|
+
</SheetHeader>
|
|
78
|
+
{/* Navigation items */}
|
|
79
|
+
</SheetContent>
|
|
80
|
+
</Sheet>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
```
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Tables
|
|
2
|
+
|
|
3
|
+
Flexible table components for displaying structured data with proper accessibility.
|
|
4
|
+
|
|
5
|
+
## Components
|
|
6
|
+
|
|
7
|
+
- `Table` - Root container with proper table styling
|
|
8
|
+
- `TableHeader` - Groups header content
|
|
9
|
+
- `TableBody` - Contains table rows
|
|
10
|
+
- `TableRow` - Individual table row
|
|
11
|
+
- `TableHead` - Header cell with proper semantics
|
|
12
|
+
- `TableCell` - Data cell with consistent styling
|
|
13
|
+
- `TableCaption` - Accessible table description
|
|
14
|
+
|
|
15
|
+
## Basic Table
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@neynar/ui"
|
|
19
|
+
|
|
20
|
+
export function UsersTable() {
|
|
21
|
+
return (
|
|
22
|
+
<Table>
|
|
23
|
+
<TableHeader>
|
|
24
|
+
<TableRow>
|
|
25
|
+
<TableHead>Name</TableHead>
|
|
26
|
+
<TableHead>Email</TableHead>
|
|
27
|
+
<TableHead>Role</TableHead>
|
|
28
|
+
</TableRow>
|
|
29
|
+
</TableHeader>
|
|
30
|
+
<TableBody>
|
|
31
|
+
<TableRow>
|
|
32
|
+
<TableCell>John Doe</TableCell>
|
|
33
|
+
<TableCell>john@example.com</TableCell>
|
|
34
|
+
<TableCell>Admin</TableCell>
|
|
35
|
+
</TableRow>
|
|
36
|
+
</TableBody>
|
|
37
|
+
</Table>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Table with Actions
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Button } from "@neynar/ui"
|
|
46
|
+
|
|
47
|
+
export function CastsTable({ casts }) {
|
|
48
|
+
return (
|
|
49
|
+
<Table>
|
|
50
|
+
<TableHeader>
|
|
51
|
+
<TableRow>
|
|
52
|
+
<TableHead>Author</TableHead>
|
|
53
|
+
<TableHead>Content</TableHead>
|
|
54
|
+
<TableHead>Likes</TableHead>
|
|
55
|
+
<TableHead className="text-right">Actions</TableHead>
|
|
56
|
+
</TableRow>
|
|
57
|
+
</TableHeader>
|
|
58
|
+
<TableBody>
|
|
59
|
+
{casts.map((cast) => (
|
|
60
|
+
<TableRow key={cast.hash}>
|
|
61
|
+
<TableCell>{cast.author.display_name}</TableCell>
|
|
62
|
+
<TableCell className="max-w-md truncate">{cast.text}</TableCell>
|
|
63
|
+
<TableCell>{cast.reactions.likes.length}</TableCell>
|
|
64
|
+
<TableCell className="text-right">
|
|
65
|
+
<Button variant="ghost" size="sm">View</Button>
|
|
66
|
+
</TableCell>
|
|
67
|
+
</TableRow>
|
|
68
|
+
))}
|
|
69
|
+
</TableBody>
|
|
70
|
+
</Table>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
```
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# Typography Components
|
|
2
|
+
|
|
3
|
+
## Typography
|
|
4
|
+
Consistent text styling with semantic variants and accessibility features.
|
|
5
|
+
|
|
6
|
+
```tsx
|
|
7
|
+
import { Typography } from "@neynar/ui"
|
|
8
|
+
|
|
9
|
+
// Basic usage with semantic variants
|
|
10
|
+
<Typography variant="heading" as="h1">
|
|
11
|
+
Main Page Title
|
|
12
|
+
</Typography>
|
|
13
|
+
|
|
14
|
+
<Typography variant="subheading" as="h2">
|
|
15
|
+
Section Header
|
|
16
|
+
</Typography>
|
|
17
|
+
|
|
18
|
+
<Typography variant="body">
|
|
19
|
+
Standard paragraph text content with proper line height and spacing.
|
|
20
|
+
</Typography>
|
|
21
|
+
|
|
22
|
+
<Typography variant="bodyEmphasized">
|
|
23
|
+
Emphasized text for important information.
|
|
24
|
+
</Typography>
|
|
25
|
+
|
|
26
|
+
// Color and styling options
|
|
27
|
+
<Typography variant="body" color="muted">
|
|
28
|
+
Secondary information in muted color
|
|
29
|
+
</Typography>
|
|
30
|
+
|
|
31
|
+
<Typography variant="details" color="destructive">
|
|
32
|
+
Error or warning text
|
|
33
|
+
</Typography>
|
|
34
|
+
|
|
35
|
+
// Form field labels
|
|
36
|
+
<Typography variant="field" as="label" htmlFor="email">
|
|
37
|
+
Email Address
|
|
38
|
+
</Typography>
|
|
39
|
+
|
|
40
|
+
// Code snippets
|
|
41
|
+
<Typography variant="code" as="code">
|
|
42
|
+
const example = "Hello, world!";
|
|
43
|
+
</Typography>
|
|
44
|
+
|
|
45
|
+
// Table content
|
|
46
|
+
<Typography variant="tableHeader" as="th">
|
|
47
|
+
Column Header
|
|
48
|
+
</Typography>
|
|
49
|
+
|
|
50
|
+
<Typography variant="tableCell" as="td">
|
|
51
|
+
Cell content
|
|
52
|
+
</Typography>
|
|
53
|
+
|
|
54
|
+
// Microcopy for fine print
|
|
55
|
+
<Typography variant="microcopy" color="muted">
|
|
56
|
+
Terms and conditions apply
|
|
57
|
+
</Typography>
|
|
58
|
+
|
|
59
|
+
// Advanced styling
|
|
60
|
+
<Typography
|
|
61
|
+
variant="body"
|
|
62
|
+
color="accent"
|
|
63
|
+
italic
|
|
64
|
+
underline
|
|
65
|
+
align="center"
|
|
66
|
+
>
|
|
67
|
+
Styled text with multiple options
|
|
68
|
+
</Typography>
|
|
69
|
+
|
|
70
|
+
// Truncated text
|
|
71
|
+
<Typography variant="body" truncate className="max-w-xs">
|
|
72
|
+
Long text that will be truncated with ellipsis
|
|
73
|
+
</Typography>
|
|
74
|
+
|
|
75
|
+
// Screen reader only content
|
|
76
|
+
<Typography variant="details" srOnly>
|
|
77
|
+
Additional context for accessibility
|
|
78
|
+
</Typography>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Typography Design System
|
|
82
|
+
|
|
83
|
+
The Typography component uses a carefully designed font scale that maps to your design system:
|
|
84
|
+
|
|
85
|
+
- **heading** (20px) - Main page and section titles
|
|
86
|
+
- **subheading** (17px) - Secondary headings for subsections
|
|
87
|
+
- **body** (14px) - Standard content text
|
|
88
|
+
- **bodyEmphasized** (14px) - Important content with medium weight
|
|
89
|
+
- **details** (12px) - Smaller text for descriptions
|
|
90
|
+
- **field** (17px) - Form field labels
|
|
91
|
+
- **code** (17px) - Monospace text for code
|
|
92
|
+
- **microcopy** (10px) - Fine print and captions
|
|
93
|
+
- **tableCell** (17px) - Table cell content
|
|
94
|
+
- **tableHeader** (17px) - Table headers with emphasis
|
|
95
|
+
|
|
96
|
+
### Accessibility Features
|
|
97
|
+
|
|
98
|
+
- Uses semantic HTML elements when specified via `as` prop
|
|
99
|
+
- Supports screen reader only content with `srOnly` prop
|
|
100
|
+
- Maintains proper color contrast ratios across all color variants
|
|
101
|
+
- Respects user preferences for reduced motion and high contrast
|
|
102
|
+
- Full keyboard navigation support where applicable
|
|
103
|
+
|
|
104
|
+
## Semantic Components
|
|
105
|
+
|
|
106
|
+
The Typography system includes semantic HTML components for better accessibility and developer experience:
|
|
107
|
+
|
|
108
|
+
### H1-H6 (Headings)
|
|
109
|
+
```tsx
|
|
110
|
+
import { H1, H2, H3, H4, H5, H6 } from "@neynar/ui"
|
|
111
|
+
|
|
112
|
+
<H1>Main Page Title</H1>
|
|
113
|
+
<H2>Section Heading</H2>
|
|
114
|
+
<H3>Subsection</H3>
|
|
115
|
+
// H4, H5, H6 follow similar patterns
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### P (Paragraph)
|
|
119
|
+
```tsx
|
|
120
|
+
import { P } from "@neynar/ui"
|
|
121
|
+
|
|
122
|
+
<P>Standard paragraph text with proper spacing and line height.</P>
|
|
123
|
+
<P color="muted">Secondary paragraph text.</P>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### A (Anchor/Link)
|
|
127
|
+
```tsx
|
|
128
|
+
import { A } from "@neynar/ui"
|
|
129
|
+
|
|
130
|
+
// Basic links
|
|
131
|
+
<A href="https://example.com">External Link</A>
|
|
132
|
+
|
|
133
|
+
// With styling options
|
|
134
|
+
<A href="/about" color="accent" variant="subheading">
|
|
135
|
+
Styled Internal Link
|
|
136
|
+
</A>
|
|
137
|
+
|
|
138
|
+
// Integration with routing libraries (Next.js example)
|
|
139
|
+
<A asChild>
|
|
140
|
+
<Link href="/dashboard">Dashboard</Link>
|
|
141
|
+
</A>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Other Semantic Elements
|
|
145
|
+
```tsx
|
|
146
|
+
import { Span, Code, Small, Strong, Lead, Blockquote } from "@neynar/ui"
|
|
147
|
+
|
|
148
|
+
<Span variant="details">Inline text with details styling</Span>
|
|
149
|
+
<Code>const hello = "world";</Code>
|
|
150
|
+
<Small>Fine print and disclaimers</Small>
|
|
151
|
+
<Strong>Important emphasized text</Strong>
|
|
152
|
+
<Lead>Introduction paragraph text</Lead>
|
|
153
|
+
<Blockquote>"Quoted content with proper styling"</Blockquote>
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Framework Integration
|
|
157
|
+
|
|
158
|
+
### Next.js Link Integration
|
|
159
|
+
```tsx
|
|
160
|
+
// Create a custom Link component
|
|
161
|
+
import Link from "next/link";
|
|
162
|
+
import { A } from "@neynar/ui";
|
|
163
|
+
|
|
164
|
+
function AppLink({ href, children, ...props }) {
|
|
165
|
+
return (
|
|
166
|
+
<A asChild {...props}>
|
|
167
|
+
<Link href={href}>{children}</Link>
|
|
168
|
+
</A>
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Usage
|
|
173
|
+
<AppLink href="/about" variant="subheading">About Us</AppLink>
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### React Router Integration
|
|
177
|
+
```tsx
|
|
178
|
+
// Custom Link for React Router
|
|
179
|
+
import { Link } from "react-router-dom";
|
|
180
|
+
import { A } from "@neynar/ui";
|
|
181
|
+
|
|
182
|
+
function AppLink({ to, children, ...props }) {
|
|
183
|
+
return (
|
|
184
|
+
<A asChild {...props}>
|
|
185
|
+
<Link to={to}>{children}</Link>
|
|
186
|
+
</A>
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// Usage
|
|
191
|
+
<AppLink to="/contact" color="accent">Contact</AppLink>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Performance Notes
|
|
195
|
+
|
|
196
|
+
- Uses CSS custom properties for consistent theming
|
|
197
|
+
- Leverages Tailwind's default font scale for optimal bundle size
|
|
198
|
+
- Supports tree-shaking when used with selective imports
|
|
199
|
+
- Semantic components improve SEO and accessibility
|