@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,84 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
declare const toggleVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "outline" | null | undefined;
|
|
6
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
/**
|
|
9
|
+
* A two-state button that can be either on or off
|
|
10
|
+
*
|
|
11
|
+
* The Toggle component provides an accessible button with on/off state functionality.
|
|
12
|
+
* Built on Radix UI Toggle primitives with customizable variants and sizes.
|
|
13
|
+
* Ideal for text formatting controls, settings toggles, and any binary state controls.
|
|
14
|
+
*
|
|
15
|
+
* @example Basic usage with icon
|
|
16
|
+
* ```tsx
|
|
17
|
+
* import { Bold } from "lucide-react"
|
|
18
|
+
*
|
|
19
|
+
* <Toggle aria-label="Toggle bold">
|
|
20
|
+
* <Bold className="h-4 w-4" />
|
|
21
|
+
* </Toggle>
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example Controlled toggle with state management
|
|
25
|
+
* ```tsx
|
|
26
|
+
* const [isBold, setIsBold] = useState(false)
|
|
27
|
+
*
|
|
28
|
+
* <Toggle
|
|
29
|
+
* pressed={isBold}
|
|
30
|
+
* onPressedChange={setIsBold}
|
|
31
|
+
* aria-label="Toggle bold formatting"
|
|
32
|
+
* >
|
|
33
|
+
* <Bold className="h-4 w-4" />
|
|
34
|
+
* </Toggle>
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @example With text and outline variant
|
|
38
|
+
* ```tsx
|
|
39
|
+
* <Toggle variant="outline" size="lg">
|
|
40
|
+
* <Italic className="h-4 w-4" />
|
|
41
|
+
* Italic
|
|
42
|
+
* </Toggle>
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @example Text formatting toolbar
|
|
46
|
+
* ```tsx
|
|
47
|
+
* <div className="flex gap-1">
|
|
48
|
+
* <Toggle pressed={bold} onPressedChange={setBold}>
|
|
49
|
+
* <Bold className="h-4 w-4" />
|
|
50
|
+
* </Toggle>
|
|
51
|
+
* <Toggle pressed={italic} onPressedChange={setItalic}>
|
|
52
|
+
* <Italic className="h-4 w-4" />
|
|
53
|
+
* </Toggle>
|
|
54
|
+
* </div>
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @accessibility
|
|
58
|
+
* - Supports keyboard navigation (Space/Enter to toggle)
|
|
59
|
+
* - Automatically manages aria-pressed attribute
|
|
60
|
+
* - Requires aria-label for icon-only toggles
|
|
61
|
+
* - Focus management with visible focus indicators
|
|
62
|
+
* - Disabled state properly communicated to assistive technology
|
|
63
|
+
*
|
|
64
|
+
* @see {@link https://ui.shadcn.com/docs/components/toggle} shadcn/ui Toggle documentation
|
|
65
|
+
* @since 1.0.0
|
|
66
|
+
* @see {@link ToggleGroup} For mutually exclusive toggle groups
|
|
67
|
+
*/
|
|
68
|
+
/**
|
|
69
|
+
* Toggle component props
|
|
70
|
+
*
|
|
71
|
+
* @param className - Additional CSS classes to apply
|
|
72
|
+
* @param variant - Visual style variant ("default" | "outline")
|
|
73
|
+
* @param size - Size variant ("sm" | "default" | "lg")
|
|
74
|
+
* @param pressed - Controlled pressed state
|
|
75
|
+
* @param defaultPressed - Default pressed state for uncontrolled usage
|
|
76
|
+
* @param onPressedChange - Callback fired when pressed state changes
|
|
77
|
+
* @param disabled - Whether the toggle is disabled
|
|
78
|
+
* @param children - Toggle content (typically icons or text)
|
|
79
|
+
* @param ...props - Additional props passed to Radix Toggle primitive
|
|
80
|
+
*/
|
|
81
|
+
type ToggleProps = React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>;
|
|
82
|
+
declare function Toggle({ className, variant, size, ...props }: ToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
export { Toggle, toggleVariants };
|
|
84
|
+
//# sourceMappingURL=toggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../../src/components/ui/toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,QAAA,MAAM,cAAc;;;8EAoBnB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH;;;;;;;;;;;;GAYG;AACH,KAAK,WAAW,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,GAClE,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtC,iBAAS,MAAM,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,2CAQlE;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
3
|
+
/**
|
|
4
|
+
* TooltipProvider - Global context provider for tooltip functionality
|
|
5
|
+
*
|
|
6
|
+
* Wraps your application or component tree to enable tooltip functionality.
|
|
7
|
+
* Controls global tooltip behavior such as delay duration before showing tooltips.
|
|
8
|
+
* Required for tooltip components to function properly.
|
|
9
|
+
*
|
|
10
|
+
* @param delayDuration - Time in milliseconds to wait before showing tooltip (default: 0)
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* // Wrap your entire app
|
|
15
|
+
* <TooltipProvider>
|
|
16
|
+
* <App />
|
|
17
|
+
* </TooltipProvider>
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* // With custom delay
|
|
23
|
+
* <TooltipProvider delayDuration={700}>
|
|
24
|
+
* <MyComponent />
|
|
25
|
+
* </TooltipProvider>
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @see {@link https://ui.shadcn.com/docs/components/tooltip} for design patterns
|
|
29
|
+
* @since 1.0.0
|
|
30
|
+
*/
|
|
31
|
+
declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
/**
|
|
33
|
+
* Tooltip - Display contextual information on hover or focus
|
|
34
|
+
*
|
|
35
|
+
* A versatile tooltip component built on Radix UI primitives that provides
|
|
36
|
+
* contextual information when users hover over or focus on an element. Perfect
|
|
37
|
+
* for displaying help text, definitions, or additional context without cluttering
|
|
38
|
+
* the interface. Automatically wraps content in a TooltipProvider for convenience.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* // Basic tooltip
|
|
43
|
+
* <Tooltip>
|
|
44
|
+
* <TooltipTrigger asChild>
|
|
45
|
+
* <Button variant="outline">Hover me</Button>
|
|
46
|
+
* </TooltipTrigger>
|
|
47
|
+
* <TooltipContent>
|
|
48
|
+
* <p>This is a helpful tooltip</p>
|
|
49
|
+
* </TooltipContent>
|
|
50
|
+
* </Tooltip>
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```tsx
|
|
55
|
+
* // Icon button with tooltip
|
|
56
|
+
* import { Info } from "lucide-react"
|
|
57
|
+
*
|
|
58
|
+
* <Tooltip>
|
|
59
|
+
* <TooltipTrigger asChild>
|
|
60
|
+
* <Button variant="ghost" size="icon">
|
|
61
|
+
* <Info className="h-4 w-4" />
|
|
62
|
+
* </Button>
|
|
63
|
+
* </TooltipTrigger>
|
|
64
|
+
* <TooltipContent>
|
|
65
|
+
* <p>Additional information</p>
|
|
66
|
+
* </TooltipContent>
|
|
67
|
+
* </Tooltip>
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```tsx
|
|
72
|
+
* // Disabled element with tooltip
|
|
73
|
+
* <Tooltip>
|
|
74
|
+
* <TooltipTrigger asChild>
|
|
75
|
+
* <span>
|
|
76
|
+
* <Button disabled>Disabled Action</Button>
|
|
77
|
+
* </span>
|
|
78
|
+
* </TooltipTrigger>
|
|
79
|
+
* <TooltipContent>
|
|
80
|
+
* <p>You need to complete setup first</p>
|
|
81
|
+
* </TooltipContent>
|
|
82
|
+
* </Tooltip>
|
|
83
|
+
* ```
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```tsx
|
|
87
|
+
* // Positioned tooltip with rich content
|
|
88
|
+
* <Tooltip>
|
|
89
|
+
* <TooltipTrigger asChild>
|
|
90
|
+
* <Badge variant="secondary">API Key</Badge>
|
|
91
|
+
* </TooltipTrigger>
|
|
92
|
+
* <TooltipContent side="right" className="max-w-[250px]">
|
|
93
|
+
* <div className="space-y-1">
|
|
94
|
+
* <p className="font-medium">API Authentication</p>
|
|
95
|
+
* <p className="text-xs">Your key is used to authenticate requests</p>
|
|
96
|
+
* </div>
|
|
97
|
+
* </TooltipContent>
|
|
98
|
+
* </Tooltip>
|
|
99
|
+
* ```
|
|
100
|
+
*
|
|
101
|
+
* @accessibility
|
|
102
|
+
* - Fully keyboard accessible (shows on focus, hides on blur)
|
|
103
|
+
* - Screen reader compatible with proper ARIA attributes
|
|
104
|
+
* - Escape key dismisses tooltip
|
|
105
|
+
* - Automatic positioning with collision detection
|
|
106
|
+
* - Respects user's reduced motion preferences
|
|
107
|
+
* - Portal rendering prevents z-index issues
|
|
108
|
+
*
|
|
109
|
+
* @see {@link https://ui.shadcn.com/docs/components/tooltip} for design patterns
|
|
110
|
+
* @see {@link Popover} - For interactive floating content
|
|
111
|
+
* @see {@link HoverCard} - For rich content previews
|
|
112
|
+
* @since 1.0.0
|
|
113
|
+
*/
|
|
114
|
+
declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
115
|
+
/**
|
|
116
|
+
* TooltipTrigger - The element that triggers the tooltip display
|
|
117
|
+
*
|
|
118
|
+
* Wraps the element that will show the tooltip on hover or focus.
|
|
119
|
+
* Use the `asChild` prop to merge props with the child element rather
|
|
120
|
+
* than rendering an additional wrapper element.
|
|
121
|
+
*
|
|
122
|
+
* @param asChild - When true, merges props with the child element instead of rendering a wrapper
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```tsx
|
|
126
|
+
* // Basic trigger
|
|
127
|
+
* <TooltipTrigger asChild>
|
|
128
|
+
* <Button>Hover me</Button>
|
|
129
|
+
* </TooltipTrigger>
|
|
130
|
+
* ```
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```tsx
|
|
134
|
+
* // With disabled element (requires wrapper)
|
|
135
|
+
* <TooltipTrigger asChild>
|
|
136
|
+
* <span>
|
|
137
|
+
* <Button disabled>Disabled</Button>
|
|
138
|
+
* </span>
|
|
139
|
+
* </TooltipTrigger>
|
|
140
|
+
* ```
|
|
141
|
+
*
|
|
142
|
+
* @accessibility
|
|
143
|
+
* - Automatically handles hover, focus, and blur events
|
|
144
|
+
* - Preserves existing keyboard navigation patterns
|
|
145
|
+
* - Maintains semantic meaning of wrapped element
|
|
146
|
+
* - Works with disabled elements when properly wrapped
|
|
147
|
+
*
|
|
148
|
+
* @since 1.0.0
|
|
149
|
+
*/
|
|
150
|
+
declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
151
|
+
/**
|
|
152
|
+
* TooltipContent - The floating tooltip content container
|
|
153
|
+
*
|
|
154
|
+
* Contains the content displayed in the tooltip popup. Automatically positioned
|
|
155
|
+
* relative to the trigger element with intelligent collision detection to ensure
|
|
156
|
+
* the tooltip stays within the viewport. Includes smooth animations and an arrow
|
|
157
|
+
* pointer for visual connection to the trigger.
|
|
158
|
+
*
|
|
159
|
+
* @param side - Preferred side of the trigger to display on ("top" | "right" | "bottom" | "left")
|
|
160
|
+
* @param sideOffset - Distance in pixels from the trigger element (default: 0)
|
|
161
|
+
* @param className - Additional CSS classes for custom styling
|
|
162
|
+
* @param children - Content to display in the tooltip
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* ```tsx
|
|
166
|
+
* // Simple text tooltip
|
|
167
|
+
* <TooltipContent>
|
|
168
|
+
* <p>This is helpful information</p>
|
|
169
|
+
* </TooltipContent>
|
|
170
|
+
* ```
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```tsx
|
|
174
|
+
* // Positioned tooltip with offset
|
|
175
|
+
* <TooltipContent side="left" sideOffset={10}>
|
|
176
|
+
* <p>Appears on the left with spacing</p>
|
|
177
|
+
* </TooltipContent>
|
|
178
|
+
* ```
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* ```tsx
|
|
182
|
+
* // Rich content with custom width
|
|
183
|
+
* <TooltipContent className="max-w-[300px]">
|
|
184
|
+
* <div className="space-y-1">
|
|
185
|
+
* <p className="font-medium">Feature Name</p>
|
|
186
|
+
* <p className="text-xs">Detailed description here</p>
|
|
187
|
+
* </div>
|
|
188
|
+
* </TooltipContent>
|
|
189
|
+
* ```
|
|
190
|
+
*
|
|
191
|
+
* @accessibility
|
|
192
|
+
* - Rendered in a portal to avoid z-index stacking issues
|
|
193
|
+
* - Properly announced by screen readers with role="tooltip"
|
|
194
|
+
* - Smooth animations respect reduced motion preferences
|
|
195
|
+
* - Arrow provides visual connection to trigger element
|
|
196
|
+
* - Automatically dismisses when trigger loses focus
|
|
197
|
+
*
|
|
198
|
+
* @since 1.0.0
|
|
199
|
+
*/
|
|
200
|
+
declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
201
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
202
|
+
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/ui/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAI5D;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,iBAAS,eAAe,CAAC,EACvB,aAAiB,EACjB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,2CAQxD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiFG;AACH,iBAAS,OAAO,CAAC,EACf,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,2CAMpD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,iBAAS,cAAc,CAAC,EACtB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,2CAEvD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,UAAc,EACd,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,2CAiBvD;AAED,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
/**
|
|
4
|
+
* Typography variant configuration using class-variance-authority
|
|
5
|
+
*
|
|
6
|
+
* Defines all possible typography variants, sizes, and styling options.
|
|
7
|
+
* Uses Tailwind CSS 4 with custom CSS properties for theming.
|
|
8
|
+
*
|
|
9
|
+
* @see {@link https://cva.style/docs} - CVA documentation
|
|
10
|
+
* @see {@link https://ui.shadcn.com/docs/components/typography} - Typography component inspiration
|
|
11
|
+
* @since 1.0.0
|
|
12
|
+
*/
|
|
13
|
+
declare const typographyVariants: (props?: ({
|
|
14
|
+
variant?: "body" | "code" | "details" | "heading" | "subheading" | "bodyEmphasized" | "field" | "microcopy" | "tableCell" | "tableHeader" | null | undefined;
|
|
15
|
+
color?: "accent" | "default" | "destructive" | "muted" | "success" | "warning" | null | undefined;
|
|
16
|
+
align?: "left" | "right" | "center" | "justify" | null | undefined;
|
|
17
|
+
transform?: "capitalize" | "lowercase" | "uppercase" | null | undefined;
|
|
18
|
+
weight?: "bold" | "normal" | "medium" | "semibold" | null | undefined;
|
|
19
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
20
|
+
/**
|
|
21
|
+
* Props interface for the Typography component
|
|
22
|
+
*/
|
|
23
|
+
export interface TypographyProps extends Omit<React.HTMLAttributes<HTMLElement>, "color">, VariantProps<typeof typographyVariants> {
|
|
24
|
+
/**
|
|
25
|
+
* The HTML element or component to render as
|
|
26
|
+
* @default "p"
|
|
27
|
+
*/
|
|
28
|
+
as?: React.ElementType;
|
|
29
|
+
/**
|
|
30
|
+
* For label elements, the associated input ID
|
|
31
|
+
*/
|
|
32
|
+
htmlFor?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Whether to render as a Slot component for composition
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
asChild?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Whether the text should be italic
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
italic?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Whether the text should be underlined
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
47
|
+
underline?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Whether the text should be struck through
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
strikethrough?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Whether the text should have a truncated overflow with ellipsis
|
|
55
|
+
* @default false
|
|
56
|
+
*/
|
|
57
|
+
truncate?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Screen reader only text (visually hidden but accessible)
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
srOnly?: boolean;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Typography component for consistent text styling across the application
|
|
66
|
+
*
|
|
67
|
+
* Provides a comprehensive set of typography variants based on design system
|
|
68
|
+
* specifications. Supports semantic HTML elements, accessibility features,
|
|
69
|
+
* and flexible styling options.
|
|
70
|
+
*
|
|
71
|
+
* @component
|
|
72
|
+
* @example
|
|
73
|
+
* ```tsx
|
|
74
|
+
* // Basic heading
|
|
75
|
+
* <Typography variant="heading" as="h1">
|
|
76
|
+
* Welcome to Neynar
|
|
77
|
+
* </Typography>
|
|
78
|
+
*
|
|
79
|
+
* // Body text with color
|
|
80
|
+
* <Typography variant="body" color="muted">
|
|
81
|
+
* This is some body text with muted color.
|
|
82
|
+
* </Typography>
|
|
83
|
+
*
|
|
84
|
+
* // Code snippet
|
|
85
|
+
* <Typography variant="code" as="code">
|
|
86
|
+
* const message = "Hello, world!";
|
|
87
|
+
* </Typography>
|
|
88
|
+
*
|
|
89
|
+
* // Table header
|
|
90
|
+
* <Typography variant="tableHeader" as="th">
|
|
91
|
+
* Column Header
|
|
92
|
+
* </Typography>
|
|
93
|
+
* ```
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```tsx
|
|
97
|
+
* // With additional styling
|
|
98
|
+
* <Typography
|
|
99
|
+
* variant="subheading"
|
|
100
|
+
* color="accent"
|
|
101
|
+
* align="center"
|
|
102
|
+
* italic
|
|
103
|
+
* underline
|
|
104
|
+
* >
|
|
105
|
+
* Styled Subheading
|
|
106
|
+
* </Typography>
|
|
107
|
+
*
|
|
108
|
+
* // Truncated text
|
|
109
|
+
* <Typography variant="body" truncate className="max-w-xs">
|
|
110
|
+
* This is a very long text that will be truncated with ellipsis
|
|
111
|
+
* </Typography>
|
|
112
|
+
*
|
|
113
|
+
* // Screen reader only
|
|
114
|
+
* <Typography variant="details" srOnly>
|
|
115
|
+
* Additional context for screen readers
|
|
116
|
+
* </Typography>
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
119
|
+
* @param props - Typography component props
|
|
120
|
+
* @param props.variant - Typography variant for semantic styling
|
|
121
|
+
* @param props.color - Color variant for different semantic meanings
|
|
122
|
+
* @param props.align - Text alignment
|
|
123
|
+
* @param props.transform - Text transformation
|
|
124
|
+
* @param props.weight - Font weight override
|
|
125
|
+
* @param props.as - HTML element to render as
|
|
126
|
+
* @param props.asChild - Render as Slot for composition
|
|
127
|
+
* @param props.italic - Apply italic styling
|
|
128
|
+
* @param props.underline - Apply underline styling
|
|
129
|
+
* @param props.strikethrough - Apply strikethrough styling
|
|
130
|
+
* @param props.truncate - Apply text truncation with ellipsis
|
|
131
|
+
* @param props.srOnly - Hide visually but keep accessible
|
|
132
|
+
* @param props.className - Additional CSS classes
|
|
133
|
+
* @param props.children - Content to render
|
|
134
|
+
*
|
|
135
|
+
* @accessibility
|
|
136
|
+
* - Uses semantic HTML elements when specified via `as` prop
|
|
137
|
+
* - Supports screen reader only content with `srOnly` prop
|
|
138
|
+
* - Maintains proper color contrast ratios across all color variants
|
|
139
|
+
* - Respects user preferences for reduced motion and high contrast
|
|
140
|
+
*
|
|
141
|
+
* @since 1.0.0
|
|
142
|
+
*/
|
|
143
|
+
export declare function Typography({ className, variant, color, align, transform, weight, as: Element, asChild, italic, underline, strikethrough, truncate, srOnly, ...props }: TypographyProps): import("react/jsx-runtime").JSX.Element;
|
|
144
|
+
/**
|
|
145
|
+
* Individual semantic typography components with pre-configured defaults
|
|
146
|
+
*/
|
|
147
|
+
/**
|
|
148
|
+
* H1 heading component
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* ```tsx
|
|
152
|
+
* <H1>Main Page Title</H1>
|
|
153
|
+
* <H1 color="muted">Subtle heading</H1>
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
export declare function H1(props: Omit<TypographyProps, "as" | "variant">): import("react/jsx-runtime").JSX.Element;
|
|
157
|
+
/**
|
|
158
|
+
* H2 heading component
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* ```tsx
|
|
162
|
+
* <H2>Section Title</H2>
|
|
163
|
+
* <H2 color="accent">Highlighted section</H2>
|
|
164
|
+
* ```
|
|
165
|
+
*/
|
|
166
|
+
export declare function H2(props: Omit<TypographyProps, "as" | "variant">): import("react/jsx-runtime").JSX.Element;
|
|
167
|
+
/**
|
|
168
|
+
* H3 heading component
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* ```tsx
|
|
172
|
+
* <H3>Subsection Title</H3>
|
|
173
|
+
* ```
|
|
174
|
+
*/
|
|
175
|
+
export declare function H3(props: Omit<TypographyProps, "as" | "variant">): import("react/jsx-runtime").JSX.Element;
|
|
176
|
+
/**
|
|
177
|
+
* H4 heading component
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* ```tsx
|
|
181
|
+
* <H4>Minor Heading</H4>
|
|
182
|
+
* ```
|
|
183
|
+
*/
|
|
184
|
+
export declare function H4(props: Omit<TypographyProps, "as" | "variant">): import("react/jsx-runtime").JSX.Element;
|
|
185
|
+
/**
|
|
186
|
+
* H5 heading component
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* ```tsx
|
|
190
|
+
* <H5>Small Heading</H5>
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
export declare function H5(props: Omit<TypographyProps, "as" | "variant">): import("react/jsx-runtime").JSX.Element;
|
|
194
|
+
/**
|
|
195
|
+
* H6 heading component
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* ```tsx
|
|
199
|
+
* <H6>Smallest Heading</H6>
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
202
|
+
export declare function H6(props: Omit<TypographyProps, "as" | "variant">): import("react/jsx-runtime").JSX.Element;
|
|
203
|
+
/**
|
|
204
|
+
* Paragraph component for body text
|
|
205
|
+
*
|
|
206
|
+
* @example
|
|
207
|
+
* ```tsx
|
|
208
|
+
* <P>Standard paragraph text content.</P>
|
|
209
|
+
* <P color="muted">Secondary paragraph text.</P>
|
|
210
|
+
* <P className="mb-4">Paragraph with custom margin.</P>
|
|
211
|
+
* ```
|
|
212
|
+
*/
|
|
213
|
+
export declare function P(props: Omit<TypographyProps, "as" | "variant">): import("react/jsx-runtime").JSX.Element;
|
|
214
|
+
/**
|
|
215
|
+
* Span component for inline text
|
|
216
|
+
*
|
|
217
|
+
* @example
|
|
218
|
+
* ```tsx
|
|
219
|
+
* <span>Regular text with <Span color="accent">highlighted</Span> content</span>
|
|
220
|
+
* <Span variant="details">Small inline text</Span>
|
|
221
|
+
* ```
|
|
222
|
+
*/
|
|
223
|
+
export declare function Span(props: Omit<TypographyProps, "as">): import("react/jsx-runtime").JSX.Element;
|
|
224
|
+
/**
|
|
225
|
+
* Code component for inline code snippets
|
|
226
|
+
*
|
|
227
|
+
* @example
|
|
228
|
+
* ```tsx
|
|
229
|
+
* <Code>const hello = "world";</Code>
|
|
230
|
+
* <Code color="muted">npm install</Code>
|
|
231
|
+
* ```
|
|
232
|
+
*/
|
|
233
|
+
export declare function Code(props: Omit<TypographyProps, "as" | "variant">): import("react/jsx-runtime").JSX.Element;
|
|
234
|
+
/**
|
|
235
|
+
* Small component for fine print and microcopy
|
|
236
|
+
*
|
|
237
|
+
* @example
|
|
238
|
+
* ```tsx
|
|
239
|
+
* <Small>Terms and conditions apply</Small>
|
|
240
|
+
* <Small color="muted">Updated 2 minutes ago</Small>
|
|
241
|
+
* ```
|
|
242
|
+
*/
|
|
243
|
+
export declare function Small(props: Omit<TypographyProps, "as" | "variant">): import("react/jsx-runtime").JSX.Element;
|
|
244
|
+
/**
|
|
245
|
+
* Strong component for emphasized text
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* ```tsx
|
|
249
|
+
* <Strong>Important information</Strong>
|
|
250
|
+
* <Strong color="destructive">Critical warning</Strong>
|
|
251
|
+
* ```
|
|
252
|
+
*/
|
|
253
|
+
export declare function Strong(props: Omit<TypographyProps, "as" | "variant">): import("react/jsx-runtime").JSX.Element;
|
|
254
|
+
/**
|
|
255
|
+
* Lead component for introductory text
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* ```tsx
|
|
259
|
+
* <Lead>This is the introduction to the article...</Lead>
|
|
260
|
+
* ```
|
|
261
|
+
*/
|
|
262
|
+
export declare function Lead(props: Omit<TypographyProps, "as" | "variant">): import("react/jsx-runtime").JSX.Element;
|
|
263
|
+
/**
|
|
264
|
+
* Anchor/Link component for interactive text links
|
|
265
|
+
*
|
|
266
|
+
* @example
|
|
267
|
+
* ```tsx
|
|
268
|
+
* <A href="https://example.com">Visit our website</A>
|
|
269
|
+
* <A href="/about" color="accent">Learn more</A>
|
|
270
|
+
* <A asChild><Link href="/about">Learn more</Link></A>
|
|
271
|
+
* ```
|
|
272
|
+
*/
|
|
273
|
+
export declare function A({ href, asChild, className, ...props }: Omit<TypographyProps, "as" | "variant"> & React.AnchorHTMLAttributes<HTMLAnchorElement>): import("react/jsx-runtime").JSX.Element;
|
|
274
|
+
/**
|
|
275
|
+
* Blockquote component for quoted text
|
|
276
|
+
*
|
|
277
|
+
* @example
|
|
278
|
+
* ```tsx
|
|
279
|
+
* <Blockquote>"The best way to predict the future is to invent it."</Blockquote>
|
|
280
|
+
* ```
|
|
281
|
+
*/
|
|
282
|
+
export declare function Blockquote(props: Omit<TypographyProps, "as" | "variant">): import("react/jsx-runtime").JSX.Element;
|
|
283
|
+
/**
|
|
284
|
+
* Type export for external use
|
|
285
|
+
*/
|
|
286
|
+
export type { VariantProps as TypographyVariantProps } from "class-variance-authority";
|
|
287
|
+
//# sourceMappingURL=typography.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../../src/components/ui/typography.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook for detecting mobile viewport width based on Tailwind CSS breakpoints
|
|
3
|
+
*
|
|
4
|
+
* A React hook that monitors viewport width and returns true when the width
|
|
5
|
+
* is less than 768px (Tailwind's `md` breakpoint). This hook provides a
|
|
6
|
+
* consistent way to conditionally render mobile and desktop layouts, following
|
|
7
|
+
* the same responsive patterns used throughout the shadcn/ui ecosystem.
|
|
8
|
+
*
|
|
9
|
+
* The hook uses `window.matchMedia` for efficient viewport monitoring and
|
|
10
|
+
* properly handles server-side rendering by returning `false` initially,
|
|
11
|
+
* then updating on the client side.
|
|
12
|
+
*
|
|
13
|
+
* @returns `true` if viewport width is less than 768px, `false` otherwise
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* Basic responsive layout switching
|
|
17
|
+
* ```tsx
|
|
18
|
+
* function ResponsiveComponent() {
|
|
19
|
+
* const isMobile = useIsMobile();
|
|
20
|
+
*
|
|
21
|
+
* return (
|
|
22
|
+
* <div>
|
|
23
|
+
* {isMobile ? (
|
|
24
|
+
* <MobileLayout />
|
|
25
|
+
* ) : (
|
|
26
|
+
* <DesktopLayout />
|
|
27
|
+
* )}
|
|
28
|
+
* </div>
|
|
29
|
+
* );
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* Conditional navigation rendering
|
|
35
|
+
* ```tsx
|
|
36
|
+
* function Navigation() {
|
|
37
|
+
* const isMobile = useIsMobile();
|
|
38
|
+
*
|
|
39
|
+
* if (isMobile) {
|
|
40
|
+
* return <Sheet><MobileNavContent /></Sheet>;
|
|
41
|
+
* }
|
|
42
|
+
*
|
|
43
|
+
* return <NavigationMenu><DesktopNavContent /></NavigationMenu>;
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* Responsive component behavior within forms
|
|
49
|
+
* ```tsx
|
|
50
|
+
* function SearchDialog() {
|
|
51
|
+
* const isMobile = useIsMobile();
|
|
52
|
+
*
|
|
53
|
+
* if (isMobile) {
|
|
54
|
+
* return <Drawer><SearchForm /></Drawer>;
|
|
55
|
+
* }
|
|
56
|
+
*
|
|
57
|
+
* return <Dialog><SearchForm /></Dialog>;
|
|
58
|
+
* }
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* @remarks
|
|
62
|
+
* - Uses the standard 768px breakpoint matching Tailwind's `md` breakpoint
|
|
63
|
+
* - Similar pattern to `isMobile` property in shadcn/ui's `useSidebar` hook
|
|
64
|
+
* - Handles viewport resize events automatically
|
|
65
|
+
* - SSR-safe implementation prevents hydration mismatches
|
|
66
|
+
* - Respects user's browser zoom settings
|
|
67
|
+
*
|
|
68
|
+
* @see {@link https://tailwindcss.com/docs/responsive-design} Tailwind CSS responsive design
|
|
69
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia} MDN matchMedia documentation
|
|
70
|
+
*
|
|
71
|
+
* @since 1.0.0
|
|
72
|
+
*/
|
|
73
|
+
export declare function useIsMobile(): boolean;
|
|
74
|
+
//# sourceMappingURL=use-mobile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-mobile.d.ts","sourceRoot":"","sources":["../../src/hooks/use-mobile.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH,wBAAgB,WAAW,YAc1B"}
|