@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,157 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Props for the TextField component
|
|
4
|
+
*
|
|
5
|
+
* Extends standard HTML input properties while omitting 'id' to allow
|
|
6
|
+
* automatic ID generation for accessibility.
|
|
7
|
+
*/
|
|
8
|
+
export type TextFieldProps = Omit<React.ComponentProps<"input">, "id"> & {
|
|
9
|
+
/**
|
|
10
|
+
* Label text displayed above the input
|
|
11
|
+
*
|
|
12
|
+
* When provided, creates a semantic label-input relationship
|
|
13
|
+
* for improved accessibility and user experience.
|
|
14
|
+
*/
|
|
15
|
+
label?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Helper text displayed below the input
|
|
18
|
+
*
|
|
19
|
+
* Provides additional context or instructions to help users
|
|
20
|
+
* understand the expected input format or purpose.
|
|
21
|
+
*/
|
|
22
|
+
helperText?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Error message displayed below the input
|
|
25
|
+
*
|
|
26
|
+
* When provided, sets the input to an error state with
|
|
27
|
+
* destructive styling and proper ARIA attributes.
|
|
28
|
+
* Takes precedence over helperText when both are present.
|
|
29
|
+
*/
|
|
30
|
+
error?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the field is required
|
|
33
|
+
*
|
|
34
|
+
* Adds a visual asterisk (*) indicator to the label
|
|
35
|
+
* and semantic meaning for form validation.
|
|
36
|
+
*
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
required?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Custom ID for the input field
|
|
42
|
+
*
|
|
43
|
+
* If not provided, an automatic ID will be generated
|
|
44
|
+
* using React.useId() for accessibility compliance.
|
|
45
|
+
*/
|
|
46
|
+
id?: string;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* A complete form field component combining input, label, and descriptive text
|
|
50
|
+
*
|
|
51
|
+
* TextField provides a complete form field solution by composing the base Input
|
|
52
|
+
* and Label components with additional helper text and error handling. It automatically
|
|
53
|
+
* manages accessibility attributes, ID generation, and ARIA relationships to ensure
|
|
54
|
+
* forms are usable by all users including those using assistive technologies.
|
|
55
|
+
*
|
|
56
|
+
* This component follows form design patterns similar to those found in modern UI
|
|
57
|
+
* libraries while providing Neynar-specific styling and behavior. It supports all
|
|
58
|
+
* standard HTML input types and attributes while adding enhanced UX features.
|
|
59
|
+
*
|
|
60
|
+
* @example Basic usage
|
|
61
|
+
* ```tsx
|
|
62
|
+
* <TextField
|
|
63
|
+
* label="Email Address"
|
|
64
|
+
* type="email"
|
|
65
|
+
* placeholder="Enter your email"
|
|
66
|
+
* />
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* @example With helper text
|
|
70
|
+
* ```tsx
|
|
71
|
+
* <TextField
|
|
72
|
+
* label="Username"
|
|
73
|
+
* placeholder="@username"
|
|
74
|
+
* helperText="Choose a unique username (3-20 characters)"
|
|
75
|
+
* />
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* @example Error state
|
|
79
|
+
* ```tsx
|
|
80
|
+
* <TextField
|
|
81
|
+
* label="Password"
|
|
82
|
+
* type="password"
|
|
83
|
+
* required
|
|
84
|
+
* error="Password must be at least 8 characters"
|
|
85
|
+
* value={password}
|
|
86
|
+
* onChange={(e) => setPassword(e.target.value)}
|
|
87
|
+
* />
|
|
88
|
+
* ```
|
|
89
|
+
*
|
|
90
|
+
* @example Controlled component with validation
|
|
91
|
+
* ```tsx
|
|
92
|
+
* const [email, setEmail] = useState("");
|
|
93
|
+
* const [error, setError] = useState("");
|
|
94
|
+
*
|
|
95
|
+
* const validateEmail = (value: string) => {
|
|
96
|
+
* if (!value.includes("@")) {
|
|
97
|
+
* setError("Please enter a valid email");
|
|
98
|
+
* } else {
|
|
99
|
+
* setError("");
|
|
100
|
+
* }
|
|
101
|
+
* };
|
|
102
|
+
*
|
|
103
|
+
* <TextField
|
|
104
|
+
* label="Email"
|
|
105
|
+
* type="email"
|
|
106
|
+
* value={email}
|
|
107
|
+
* onChange={(e) => {
|
|
108
|
+
* setEmail(e.target.value);
|
|
109
|
+
* validateEmail(e.target.value);
|
|
110
|
+
* }}
|
|
111
|
+
* error={error}
|
|
112
|
+
* required
|
|
113
|
+
* />
|
|
114
|
+
* ```
|
|
115
|
+
*
|
|
116
|
+
* @example Form integration
|
|
117
|
+
* ```tsx
|
|
118
|
+
* <form onSubmit={handleSubmit}>
|
|
119
|
+
* <TextField
|
|
120
|
+
* label="Full Name"
|
|
121
|
+
* name="fullName"
|
|
122
|
+
* required
|
|
123
|
+
* helperText="First and last name"
|
|
124
|
+
* />
|
|
125
|
+
* <TextField
|
|
126
|
+
* label="API Key"
|
|
127
|
+
* type="password"
|
|
128
|
+
* name="apiKey"
|
|
129
|
+
* required
|
|
130
|
+
* helperText="Get your key from the Neynar dashboard"
|
|
131
|
+
* />
|
|
132
|
+
* </form>
|
|
133
|
+
* ```
|
|
134
|
+
*
|
|
135
|
+
* ## Accessibility Features
|
|
136
|
+
*
|
|
137
|
+
* - **Semantic HTML**: Uses proper label-input association via `htmlFor` attribute
|
|
138
|
+
* - **ARIA Support**: Implements `aria-invalid`, `aria-describedby`, and `aria-required`
|
|
139
|
+
* - **Focus Management**: Keyboard navigation and focus indicators work correctly
|
|
140
|
+
* - **Screen Readers**: Helper text and error messages are properly announced
|
|
141
|
+
* - **Required Fields**: Visual and semantic indication with asterisk and ARIA attributes
|
|
142
|
+
* - **Error States**: Clear visual and programmatic error indication
|
|
143
|
+
*
|
|
144
|
+
* ## Styling & Variants
|
|
145
|
+
*
|
|
146
|
+
* The component inherits styling from the base Input component and adds:
|
|
147
|
+
* - Error state styling with destructive colors
|
|
148
|
+
* - Consistent spacing with `space-y-2` utility
|
|
149
|
+
* - Muted foreground color for helper text
|
|
150
|
+
* - Required field indicator styling
|
|
151
|
+
*
|
|
152
|
+
* @see {@link Input} The underlying input component
|
|
153
|
+
* @see {@link Label} The label component used for field labels
|
|
154
|
+
* @since 1.0.0 */
|
|
155
|
+
declare const TextField: React.ForwardRefExoticComponent<Omit<TextFieldProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
156
|
+
export { TextField };
|
|
157
|
+
//# sourceMappingURL=text-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../../src/components/ui/text-field.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,GAAG;IACvE;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA0GkB;AAClB,QAAA,MAAM,SAAS,sGA0Cd,CAAC;AAIF,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* A multi-line text input control built on the native HTML textarea element
|
|
4
|
+
*
|
|
5
|
+
* The Textarea component provides a styled textarea for entering longer pieces
|
|
6
|
+
* of text that span multiple lines, such as comments, descriptions, or messages.
|
|
7
|
+
* Features automatic content-based resizing using CSS field-sizing when supported
|
|
8
|
+
* by the browser.
|
|
9
|
+
*
|
|
10
|
+
* Built following shadcn/ui design patterns with consistent styling and behavior
|
|
11
|
+
* across form elements.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* // Basic usage
|
|
16
|
+
* <Textarea placeholder="Type your message here." />
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* // With label and validation
|
|
22
|
+
* <div className="space-y-2">
|
|
23
|
+
* <Label htmlFor="description">Description</Label>
|
|
24
|
+
* <Textarea
|
|
25
|
+
* id="description"
|
|
26
|
+
* placeholder="Enter a description..."
|
|
27
|
+
* rows={4}
|
|
28
|
+
* />
|
|
29
|
+
* </div>
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* // Controlled with character limit
|
|
35
|
+
* const [bio, setBio] = useState("");
|
|
36
|
+
* const maxLength = 160;
|
|
37
|
+
*
|
|
38
|
+
* <div className="space-y-2">
|
|
39
|
+
* <Label htmlFor="bio">Bio</Label>
|
|
40
|
+
* <Textarea
|
|
41
|
+
* id="bio"
|
|
42
|
+
* value={bio}
|
|
43
|
+
* onChange={(e) => setBio(e.target.value)}
|
|
44
|
+
* placeholder="Tell us about yourself..."
|
|
45
|
+
* maxLength={maxLength}
|
|
46
|
+
* />
|
|
47
|
+
* <p className="text-sm text-muted-foreground">
|
|
48
|
+
* {bio.length}/{maxLength} characters
|
|
49
|
+
* </p>
|
|
50
|
+
* </div>
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```tsx
|
|
55
|
+
* // With error state
|
|
56
|
+
* <Textarea
|
|
57
|
+
* placeholder="Enter your feedback"
|
|
58
|
+
* aria-invalid="true"
|
|
59
|
+
* aria-describedby="feedback-error"
|
|
60
|
+
* className="border-destructive"
|
|
61
|
+
* />
|
|
62
|
+
* <p id="feedback-error" className="text-sm text-destructive">
|
|
63
|
+
* This field is required
|
|
64
|
+
* </p>
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @param className - Additional CSS classes to apply
|
|
68
|
+
* @param ...props - All standard HTML textarea attributes are supported
|
|
69
|
+
*
|
|
70
|
+
* @accessibility
|
|
71
|
+
* - Inherits all native textarea accessibility features
|
|
72
|
+
* - Supports keyboard navigation with visible focus indicators
|
|
73
|
+
* - Compatible with screen readers and assistive technologies
|
|
74
|
+
* - Properly handles aria-invalid for validation states
|
|
75
|
+
* - Works seamlessly with Label components via htmlFor/id association
|
|
76
|
+
* - Respects disabled and readonly states
|
|
77
|
+
* - Auto-resizing maintains proper focus and scroll behavior
|
|
78
|
+
*
|
|
79
|
+
* @see {@link https://ui.shadcn.com/docs/components/textarea} shadcn/ui Textarea documentation
|
|
80
|
+
* @since 1.0.0
|
|
81
|
+
*/
|
|
82
|
+
declare function Textarea({ className, ...props }: React.ComponentProps<"textarea">): import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
export { Textarea };
|
|
84
|
+
//# sourceMappingURL=textarea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../src/components/ui/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AACH,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,2CAW1E;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for the ThemeToggle component
|
|
3
|
+
*/
|
|
4
|
+
export type ThemeToggleProps = {
|
|
5
|
+
/** Visual style variant for the toggle button */
|
|
6
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link";
|
|
7
|
+
/** Size of the toggle button */
|
|
8
|
+
size?: "default" | "sm" | "lg" | "icon";
|
|
9
|
+
/** Additional CSS classes */
|
|
10
|
+
className?: string;
|
|
11
|
+
/** Whether to show text labels (only applies when size is not "icon") */
|
|
12
|
+
showLabel?: boolean;
|
|
13
|
+
/** Alignment of the dropdown menu */
|
|
14
|
+
align?: "start" | "center" | "end";
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* ThemeToggle - A zero-config theme switcher with system, light, and dark modes
|
|
18
|
+
*
|
|
19
|
+
* A self-contained theme toggle component that works without any provider setup.
|
|
20
|
+
* Provides an intuitive dropdown interface for switching between system preference,
|
|
21
|
+
* light mode, and dark mode. The component handles theme persistence using cookies
|
|
22
|
+
* for SSR compatibility and automatically detects system theme changes.
|
|
23
|
+
*
|
|
24
|
+
* Built as a custom Neynar component that extends the standard shadcn/ui patterns
|
|
25
|
+
* with enhanced theme management capabilities.
|
|
26
|
+
*
|
|
27
|
+
* @component
|
|
28
|
+
* @example Basic usage (icon button)
|
|
29
|
+
* ```tsx
|
|
30
|
+
* // Most common usage - just drop it in!
|
|
31
|
+
* <ThemeToggle />
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @example With text labels
|
|
35
|
+
* ```tsx
|
|
36
|
+
* // Show current theme name next to icon
|
|
37
|
+
* <ThemeToggle size="default" showLabel />
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @example Custom styling variants
|
|
41
|
+
* ```tsx
|
|
42
|
+
* // Ghost button for minimalist UI
|
|
43
|
+
* <ThemeToggle variant="ghost" />
|
|
44
|
+
*
|
|
45
|
+
* // Secondary style for subtlety
|
|
46
|
+
* <ThemeToggle variant="secondary" size="sm" />
|
|
47
|
+
*
|
|
48
|
+
* // Custom positioning
|
|
49
|
+
* <ThemeToggle align="start" className="border-2" />
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @example In navigation components
|
|
53
|
+
* ```tsx
|
|
54
|
+
* // Header navigation
|
|
55
|
+
* <header className="flex items-center justify-between p-4">
|
|
56
|
+
* <Logo />
|
|
57
|
+
* <div className="flex items-center gap-2">
|
|
58
|
+
* <Button variant="ghost">Settings</Button>
|
|
59
|
+
* <ThemeToggle />
|
|
60
|
+
* </div>
|
|
61
|
+
* </header>
|
|
62
|
+
*
|
|
63
|
+
* // Sidebar footer
|
|
64
|
+
* <SidebarFooter>
|
|
65
|
+
* <div className="flex items-center justify-between">
|
|
66
|
+
* <UserProfile />
|
|
67
|
+
* <ThemeToggle variant="ghost" size="sm" />
|
|
68
|
+
* </div>
|
|
69
|
+
* </SidebarFooter>
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* @param variant - Button style variant (inherits from Button component)
|
|
73
|
+
* @param size - Button size, defaults to "icon" for compact display
|
|
74
|
+
* @param className - Additional CSS classes for custom styling
|
|
75
|
+
* @param showLabel - Whether to show theme name text (auto-enabled for non-icon sizes)
|
|
76
|
+
* @param align - Dropdown menu alignment relative to trigger button
|
|
77
|
+
*
|
|
78
|
+
* @features
|
|
79
|
+
* - **Zero Configuration**: Works immediately without providers or setup
|
|
80
|
+
* - **System Detection**: Automatically follows OS dark/light preference
|
|
81
|
+
* - **SSR Compatible**: Uses cookies for theme persistence across server/client
|
|
82
|
+
* - **Smooth Transitions**: CSS-based theme switching with no flash
|
|
83
|
+
* - **Accessibility**: Full keyboard navigation and screen reader support
|
|
84
|
+
* - **Responsive**: Touch-friendly on mobile devices
|
|
85
|
+
*
|
|
86
|
+
* @accessibility
|
|
87
|
+
* - Screen reader label: "Toggle theme" for assistive technology
|
|
88
|
+
* - Keyboard navigation: Enter, Space, and Arrow keys for dropdown
|
|
89
|
+
* - Current selection indicated with checkmark and visual styling
|
|
90
|
+
* - High contrast support across all theme modes
|
|
91
|
+
* - Focus visible indicators for keyboard users
|
|
92
|
+
*
|
|
93
|
+
* @remarks
|
|
94
|
+
* This component uses the {@link useTheme} hook internally to manage theme state.
|
|
95
|
+
* Theme changes are persisted automatically and synchronized across browser tabs.
|
|
96
|
+
* The component is fully self-contained and doesn't interfere with existing
|
|
97
|
+
* theme systems in your application.
|
|
98
|
+
*
|
|
99
|
+
* @see {@link useTheme} - The underlying theme management hook
|
|
100
|
+
* @see {@link Button} - Base button component for styling options
|
|
101
|
+
* @see {@link DropdownMenu} - Menu component used for theme selection
|
|
102
|
+
* @since 1.0.0
|
|
103
|
+
*/
|
|
104
|
+
export declare function ThemeToggle({ variant, size, className, showLabel, align, }: ThemeToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
105
|
+
//# sourceMappingURL=theme-toggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-toggle.d.ts","sourceRoot":"","sources":["../../../src/components/ui/theme-toggle.tsx"],"names":[],"mappings":"AAaA;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,iDAAiD;IACjD,OAAO,CAAC,EACJ,SAAS,GACT,aAAa,GACb,SAAS,GACT,WAAW,GACX,OAAO,GACP,MAAM,CAAC;IAEX,gCAAgC;IAChC,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;IAExC,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,yEAAyE;IACzE,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,qCAAqC;IACrC,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;CACpC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuFG;AACH,wBAAgB,WAAW,CAAC,EAC1B,OAAmB,EACnB,IAAa,EACb,SAAS,EACT,SAA2B,EAC3B,KAAa,GACd,EAAE,gBAAgB,2CAmDlB"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme - Prevents flash of unstyled content (FOUC) during theme initialization
|
|
3
|
+
*
|
|
4
|
+
* A critical component that prevents the flash of incorrect theme styling by applying
|
|
5
|
+
* the user's preferred theme before the page renders. This component should be placed
|
|
6
|
+
* once at the root of your application, ideally in the document head or at the very
|
|
7
|
+
* beginning of the body.
|
|
8
|
+
*
|
|
9
|
+
* The component works by injecting a small inline script that:
|
|
10
|
+
* 1. Reads the stored theme preference from cookies
|
|
11
|
+
* 2. Detects system theme preference if set to "system"
|
|
12
|
+
* 3. Applies the appropriate theme class and color scheme immediately
|
|
13
|
+
* 4. Executes synchronously before first paint to prevent FOUC
|
|
14
|
+
*
|
|
15
|
+
* @component
|
|
16
|
+
* @example Basic usage in Next.js App Router
|
|
17
|
+
* ```tsx
|
|
18
|
+
* import { Theme } from "@neynar/ui";
|
|
19
|
+
*
|
|
20
|
+
* export default function RootLayout({ children }) {
|
|
21
|
+
* return (
|
|
22
|
+
* <html lang="en" suppressHydrationWarning>
|
|
23
|
+
* <head>
|
|
24
|
+
* <Theme />
|
|
25
|
+
* </head>
|
|
26
|
+
* <body>{children}</body>
|
|
27
|
+
* </html>
|
|
28
|
+
* );
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @example Usage in Vite/React
|
|
33
|
+
* ```tsx
|
|
34
|
+
* import { Theme } from "@neynar/ui";
|
|
35
|
+
*
|
|
36
|
+
* function App() {
|
|
37
|
+
* return (
|
|
38
|
+
* <>
|
|
39
|
+
* <Theme />
|
|
40
|
+
* <div className="app">
|
|
41
|
+
* App content here
|
|
42
|
+
* </div>
|
|
43
|
+
* </>
|
|
44
|
+
* );
|
|
45
|
+
* }
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @example Usage with Remix
|
|
49
|
+
* ```tsx
|
|
50
|
+
* import { Theme } from "@neynar/ui";
|
|
51
|
+
*
|
|
52
|
+
* export default function Root() {
|
|
53
|
+
* return (
|
|
54
|
+
* <html lang="en">
|
|
55
|
+
* <head>
|
|
56
|
+
* <Theme />
|
|
57
|
+
* <Meta />
|
|
58
|
+
* <Links />
|
|
59
|
+
* </head>
|
|
60
|
+
* <body>
|
|
61
|
+
* <Outlet />
|
|
62
|
+
* <ScrollRestoration />
|
|
63
|
+
* <Scripts />
|
|
64
|
+
* </body>
|
|
65
|
+
* </html>
|
|
66
|
+
* );
|
|
67
|
+
* }
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @features
|
|
71
|
+
* - **FOUC Prevention**: Applies theme before first paint
|
|
72
|
+
* - **Framework Agnostic**: Works with Next.js, Vite, Remix, and other React frameworks
|
|
73
|
+
* - **SSR Compatible**: Handles server-side rendering correctly
|
|
74
|
+
* - **System Detection**: Automatically follows OS dark/light preference
|
|
75
|
+
* - **Cookie Persistence**: Maintains theme across browser sessions
|
|
76
|
+
* - **Minimal Overhead**: Tiny inline script with no external dependencies
|
|
77
|
+
*
|
|
78
|
+
* @accessibility
|
|
79
|
+
* - Respects system preference for reduced motion
|
|
80
|
+
* - Maintains proper color contrast ratios
|
|
81
|
+
* - Works with screen readers and assistive technology
|
|
82
|
+
* - Follows WCAG guidelines for theme switching
|
|
83
|
+
*
|
|
84
|
+
* @performance
|
|
85
|
+
* - Executes before React hydration
|
|
86
|
+
* - No network requests or external dependencies
|
|
87
|
+
* - Minified inline script for optimal performance
|
|
88
|
+
* - Zero runtime overhead after initial execution
|
|
89
|
+
*
|
|
90
|
+
* @security
|
|
91
|
+
* - Uses dangerouslySetInnerHTML with known safe content
|
|
92
|
+
* - No external script sources or eval usage
|
|
93
|
+
* - Cookie reading with proper error handling
|
|
94
|
+
* - Graceful fallback on script execution errors
|
|
95
|
+
*
|
|
96
|
+
* @remarks
|
|
97
|
+
* This component must be used alongside the {@link useTheme} hook and
|
|
98
|
+
* {@link ThemeToggle} component for a complete theming solution. The script
|
|
99
|
+
* handles initial theme application, while the hook manages runtime theme changes.
|
|
100
|
+
*
|
|
101
|
+
* The component is designed to work with Tailwind CSS's dark mode strategy,
|
|
102
|
+
* specifically the 'dark' class approach. It applies the 'dark' class to the
|
|
103
|
+
* document root and sets the appropriate color-scheme CSS property.
|
|
104
|
+
*
|
|
105
|
+
* @see {@link useTheme} - Hook for managing theme state and preferences
|
|
106
|
+
* @see {@link ThemeToggle} - UI component for theme switching
|
|
107
|
+
* @since 1.0.0
|
|
108
|
+
*/
|
|
109
|
+
export declare function Theme(): import("react/jsx-runtime").JSX.Element;
|
|
110
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/components/ui/theme.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2GG;AACH,wBAAgB,KAAK,4CAuCpB"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
import { toggleVariants } from "@/components/ui/toggle";
|
|
5
|
+
/**
|
|
6
|
+
* Toggle Group - A group of toggle buttons with single or multiple selection
|
|
7
|
+
*
|
|
8
|
+
* ToggleGroup provides a way to group related toggle buttons together, allowing users
|
|
9
|
+
* to select from a set of mutually exclusive options (single selection) or independent
|
|
10
|
+
* options (multiple selection). Built on Radix UI Toggle Group primitive with support
|
|
11
|
+
* for keyboard navigation and accessibility features.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* // Single selection (like radio buttons)
|
|
16
|
+
* <ToggleGroup type="single" defaultValue="center">
|
|
17
|
+
* <ToggleGroupItem value="left" aria-label="Align left">
|
|
18
|
+
* <AlignLeft className="h-4 w-4" />
|
|
19
|
+
* </ToggleGroupItem>
|
|
20
|
+
* <ToggleGroupItem value="center" aria-label="Align center">
|
|
21
|
+
* <AlignCenter className="h-4 w-4" />
|
|
22
|
+
* </ToggleGroupItem>
|
|
23
|
+
* <ToggleGroupItem value="right" aria-label="Align right">
|
|
24
|
+
* <AlignRight className="h-4 w-4" />
|
|
25
|
+
* </ToggleGroupItem>
|
|
26
|
+
* </ToggleGroup>
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* // Multiple selection (like checkboxes)
|
|
32
|
+
* <ToggleGroup type="multiple" defaultValue={["bold", "italic"]}>
|
|
33
|
+
* <ToggleGroupItem value="bold" aria-label="Toggle bold">
|
|
34
|
+
* <Bold className="h-4 w-4" />
|
|
35
|
+
* </ToggleGroupItem>
|
|
36
|
+
* <ToggleGroupItem value="italic" aria-label="Toggle italic">
|
|
37
|
+
* <Italic className="h-4 w-4" />
|
|
38
|
+
* </ToggleGroupItem>
|
|
39
|
+
* <ToggleGroupItem value="underline" aria-label="Toggle underline">
|
|
40
|
+
* <Underline className="h-4 w-4" />
|
|
41
|
+
* </ToggleGroupItem>
|
|
42
|
+
* </ToggleGroup>
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* // Text-based options with variants
|
|
48
|
+
* <ToggleGroup type="single" variant="outline" size="sm">
|
|
49
|
+
* <ToggleGroupItem value="draft">Draft</ToggleGroupItem>
|
|
50
|
+
* <ToggleGroupItem value="published">Published</ToggleGroupItem>
|
|
51
|
+
* <ToggleGroupItem value="archived">Archived</ToggleGroupItem>
|
|
52
|
+
* </ToggleGroup>
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @param type - Selection mode: "single" for radio-like behavior, "multiple" for checkbox-like
|
|
56
|
+
* @param variant - Visual style: "default" (subtle) or "outline" (bordered)
|
|
57
|
+
* @param size - Size variant: "sm", "default", or "lg"
|
|
58
|
+
* @param disabled - Whether the entire group is disabled
|
|
59
|
+
* @param defaultValue - Initial selected value(s) - string for single, array for multiple
|
|
60
|
+
* @param value - Controlled selected value(s) - string for single, array for multiple
|
|
61
|
+
* @param onValueChange - Callback when selection changes
|
|
62
|
+
*
|
|
63
|
+
* @accessibility
|
|
64
|
+
* - Uses role="group" with appropriate ARIA attributes
|
|
65
|
+
* - Arrow keys navigate between items with roving tabindex
|
|
66
|
+
* - Space or Enter key toggles item selection
|
|
67
|
+
* - Home/End keys jump to first/last items
|
|
68
|
+
* - Supports disabled state for individual items or entire group
|
|
69
|
+
* - Screen readers announce selection state changes
|
|
70
|
+
*
|
|
71
|
+
* @see {@link ToggleGroupItem} - Individual toggle items within the group
|
|
72
|
+
* @see {@link Toggle} - Standalone toggle button component
|
|
73
|
+
* @see {@link https://ui.shadcn.com/docs/components/toggle-group} - Design system documentation
|
|
74
|
+
* @since 1.0.0
|
|
75
|
+
*/
|
|
76
|
+
declare function ToggleGroup({ className, variant, size, children, ...props }: React.ComponentProps<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants>): import("react/jsx-runtime").JSX.Element;
|
|
77
|
+
/**
|
|
78
|
+
* Toggle Group Item - Individual selectable item within a ToggleGroup
|
|
79
|
+
*
|
|
80
|
+
* Represents a single option within a ToggleGroup component. Automatically inherits
|
|
81
|
+
* variant and size styling from the parent ToggleGroup context, but these can be
|
|
82
|
+
* overridden for specific items if needed. Supports icons, text, or mixed content.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```tsx
|
|
86
|
+
* // Text-based item
|
|
87
|
+
* <ToggleGroupItem value="draft">Draft</ToggleGroupItem>
|
|
88
|
+
* ```
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```tsx
|
|
92
|
+
* // Icon-only item (requires aria-label)
|
|
93
|
+
* <ToggleGroupItem value="bold" aria-label="Toggle bold formatting">
|
|
94
|
+
* <Bold className="h-4 w-4" />
|
|
95
|
+
* </ToggleGroupItem>
|
|
96
|
+
* ```
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```tsx
|
|
100
|
+
* // Mixed content with icon and text
|
|
101
|
+
* <ToggleGroupItem value="bold">
|
|
102
|
+
* <Bold className="h-4 w-4" />
|
|
103
|
+
* Bold
|
|
104
|
+
* </ToggleGroupItem>
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```tsx
|
|
109
|
+
* // Override inherited styling
|
|
110
|
+
* <ToggleGroupItem value="special" variant="outline" size="lg">
|
|
111
|
+
* Special Option
|
|
112
|
+
* </ToggleGroupItem>
|
|
113
|
+
* ```
|
|
114
|
+
*
|
|
115
|
+
* @param value - Unique identifier for this item within the group (required)
|
|
116
|
+
* @param disabled - Whether this specific item is disabled
|
|
117
|
+
* @param variant - Override variant from parent ToggleGroup
|
|
118
|
+
* @param size - Override size from parent ToggleGroup
|
|
119
|
+
* @param children - Content to display (icons, text, or both)
|
|
120
|
+
*
|
|
121
|
+
* @accessibility
|
|
122
|
+
* - Participates in parent ToggleGroup's keyboard navigation
|
|
123
|
+
* - Uses aria-pressed to indicate selection state
|
|
124
|
+
* - Supports focus management with visible focus indicators
|
|
125
|
+
* - For icon-only items, always provide aria-label for screen readers
|
|
126
|
+
* - Disabled items are excluded from keyboard navigation
|
|
127
|
+
*
|
|
128
|
+
* @see {@link ToggleGroup} - Parent container component
|
|
129
|
+
* @see {@link Toggle} - Standalone toggle button
|
|
130
|
+
*/
|
|
131
|
+
declare function ToggleGroupItem({ className, children, variant, size, ...props }: React.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>): import("react/jsx-runtime").JSX.Element;
|
|
132
|
+
export { ToggleGroup, ToggleGroupItem };
|
|
133
|
+
//# sourceMappingURL=toggle-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-group.d.ts","sourceRoot":"","sources":["../../../src/components/ui/toggle-group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAG7D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AASxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AACH,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,GACvD,YAAY,CAAC,OAAO,cAAc,CAAC,2CAiBpC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,QAAQ,EACR,OAAO,EACP,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,GACvD,YAAY,CAAC,OAAO,cAAc,CAAC,2CAqBpC;AAED,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC"}
|