@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,244 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
3
|
+
/**
|
|
4
|
+
* Avatar - A flexible container for displaying user profile images with graceful fallback support
|
|
5
|
+
*
|
|
6
|
+
* The Avatar component is built on Radix UI's Avatar primitive and provides a robust solution
|
|
7
|
+
* for displaying user profile pictures throughout your application. It automatically handles
|
|
8
|
+
* image loading states and displays fallback content when images fail to load or are unavailable.
|
|
9
|
+
*
|
|
10
|
+
* This component follows the shadcn/ui design system principles and provides a consistent
|
|
11
|
+
* approach to user representation across all applications.
|
|
12
|
+
*
|
|
13
|
+
* ## Features
|
|
14
|
+
* - **Automatic loading states**: Seamlessly handles image loading and error states
|
|
15
|
+
* - **Graceful fallbacks**: Shows fallback content when images are unavailable
|
|
16
|
+
* - **Flexible sizing**: Easy customization through Tailwind CSS size utilities
|
|
17
|
+
* - **Shape variants**: Circular by default with support for rounded corners
|
|
18
|
+
* - **Accessibility first**: Built-in ARIA attributes and keyboard navigation
|
|
19
|
+
* - **Composable design**: Works with AvatarImage and AvatarFallback sub-components
|
|
20
|
+
*
|
|
21
|
+
* ## Common Use Cases
|
|
22
|
+
* - User profile displays in headers and navigation
|
|
23
|
+
* - Comment sections and author attribution
|
|
24
|
+
* - Team member listings and directories
|
|
25
|
+
* - Avatar groups with overlapping layouts
|
|
26
|
+
* - Organization logos and brand representation
|
|
27
|
+
* - Loading states and placeholder content
|
|
28
|
+
*
|
|
29
|
+
* ## Size Variants
|
|
30
|
+
* - `size-6` (24px) - Small avatars for dense layouts
|
|
31
|
+
* - `size-8` (32px) - Default size for most use cases
|
|
32
|
+
* - `size-10` (40px) - Medium avatars for lists
|
|
33
|
+
* - `size-12` (48px) - Large avatars for profiles
|
|
34
|
+
* - `size-16` (64px) - Extra large for main profile displays
|
|
35
|
+
*
|
|
36
|
+
* @example Basic avatar with image and fallback
|
|
37
|
+
* ```tsx
|
|
38
|
+
* <Avatar>
|
|
39
|
+
* <AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
|
|
40
|
+
* <AvatarFallback>CN</AvatarFallback>
|
|
41
|
+
* </Avatar>
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @example Custom sizing
|
|
45
|
+
* ```tsx
|
|
46
|
+
* <Avatar className="size-12">
|
|
47
|
+
* <AvatarImage src="/profile.jpg" alt="John Doe" />
|
|
48
|
+
* <AvatarFallback>JD</AvatarFallback>
|
|
49
|
+
* </Avatar>
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @example Avatar group with borders
|
|
53
|
+
* ```tsx
|
|
54
|
+
* <div className="flex -space-x-2">
|
|
55
|
+
* <Avatar className="border-2 border-background">
|
|
56
|
+
* <AvatarImage src="/user1.jpg" alt="User 1" />
|
|
57
|
+
* <AvatarFallback>U1</AvatarFallback>
|
|
58
|
+
* </Avatar>
|
|
59
|
+
* <Avatar className="border-2 border-background">
|
|
60
|
+
* <AvatarImage src="/user2.jpg" alt="User 2" />
|
|
61
|
+
* <AvatarFallback>U2</AvatarFallback>
|
|
62
|
+
* </Avatar>
|
|
63
|
+
* <Avatar className="border-2 border-background">
|
|
64
|
+
* <AvatarFallback>+3</AvatarFallback>
|
|
65
|
+
* </Avatar>
|
|
66
|
+
* </div>
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* @example Square avatar for logos
|
|
70
|
+
* ```tsx
|
|
71
|
+
* <Avatar className="rounded-lg">
|
|
72
|
+
* <AvatarImage src="/company-logo.png" alt="Company" />
|
|
73
|
+
* <AvatarFallback>CO</AvatarFallback>
|
|
74
|
+
* </Avatar>
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* @example With status indicator
|
|
78
|
+
* ```tsx
|
|
79
|
+
* <div className="relative">
|
|
80
|
+
* <Avatar>
|
|
81
|
+
* <AvatarImage src="/user.jpg" alt="Online user" />
|
|
82
|
+
* <AvatarFallback>OU</AvatarFallback>
|
|
83
|
+
* </Avatar>
|
|
84
|
+
* <div className="absolute bottom-0 right-0 size-3 bg-green-500 border-2 border-background rounded-full" />
|
|
85
|
+
* </div>
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* @param className Additional CSS classes for styling. Common patterns include size utilities (size-6, size-8, size-10, size-12, size-16) and border radius overrides (rounded-lg, rounded-md, rounded-none)
|
|
89
|
+
* @param children Should contain AvatarImage and AvatarFallback components for proper functionality
|
|
90
|
+
*
|
|
91
|
+
* @accessibility
|
|
92
|
+
* - Automatically manages focus and ARIA attributes through Radix UI
|
|
93
|
+
* - Always provide descriptive alt text for AvatarImage components
|
|
94
|
+
* - Fallback content should be meaningful (user initials, not generic placeholders)
|
|
95
|
+
* - Ensure sufficient color contrast for fallback text (minimum 4.5:1 ratio)
|
|
96
|
+
* - Component supports keyboard navigation and screen reader announcements
|
|
97
|
+
* - Status indicators should include appropriate ARIA labels
|
|
98
|
+
*
|
|
99
|
+
* @see {@link AvatarImage} The image component for displaying avatar pictures
|
|
100
|
+
* @see {@link AvatarFallback} The fallback component for displaying initials or icons when images fail
|
|
101
|
+
* @see {@link https://ui.shadcn.com/docs/components/avatar} shadcn/ui Avatar Documentation
|
|
102
|
+
* @see {@link https://www.radix-ui.com/docs/primitives/components/avatar} Radix UI Avatar Primitive
|
|
103
|
+
* @since 1.0.0
|
|
104
|
+
*/
|
|
105
|
+
declare function Avatar({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
106
|
+
/**
|
|
107
|
+
* AvatarImage - The image element component for displaying avatar pictures
|
|
108
|
+
*
|
|
109
|
+
* This component renders the actual avatar image and automatically handles loading states.
|
|
110
|
+
* It's built on Radix UI's Avatar.Image primitive which provides robust image loading
|
|
111
|
+
* behavior - when the image fails to load or is still loading, it remains hidden
|
|
112
|
+
* and the AvatarFallback will be displayed instead.
|
|
113
|
+
*
|
|
114
|
+
* ## Key Features
|
|
115
|
+
* - Automatic image loading state management
|
|
116
|
+
* - Graceful error handling for broken image URLs
|
|
117
|
+
* - Proper aspect ratio maintenance (square by default)
|
|
118
|
+
* - Inherits parent Avatar's size and border radius
|
|
119
|
+
* - Accessible image implementation
|
|
120
|
+
*
|
|
121
|
+
* @component
|
|
122
|
+
* @example
|
|
123
|
+
* ```tsx
|
|
124
|
+
* // Basic usage with remote image
|
|
125
|
+
* <Avatar>
|
|
126
|
+
* <AvatarImage
|
|
127
|
+
* src="https://github.com/username.png"
|
|
128
|
+
* alt="GitHub Profile Picture"
|
|
129
|
+
* />
|
|
130
|
+
* <AvatarFallback>GH</AvatarFallback>
|
|
131
|
+
* </Avatar>
|
|
132
|
+
* ```
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```tsx
|
|
136
|
+
* // Local image with descriptive alt text
|
|
137
|
+
* <Avatar>
|
|
138
|
+
* <AvatarImage
|
|
139
|
+
* src="/uploads/user-avatar.jpg"
|
|
140
|
+
* alt="John Doe's profile picture"
|
|
141
|
+
* />
|
|
142
|
+
* <AvatarFallback>JD</AvatarFallback>
|
|
143
|
+
* </Avatar>
|
|
144
|
+
* ```
|
|
145
|
+
*
|
|
146
|
+
* @param src - The URL of the image to display. Can be relative or absolute URL
|
|
147
|
+
* @param alt - Descriptive alternative text for the image. Should describe the person or entity, not just "avatar" or "profile picture"
|
|
148
|
+
* @param className - Additional CSS classes to apply to the image element
|
|
149
|
+
* @param onLoadingStatusChange - Optional callback fired when the loading status changes
|
|
150
|
+
*
|
|
151
|
+
* @accessibility
|
|
152
|
+
* - Always provide descriptive alt text that identifies the person or entity
|
|
153
|
+
* - The image is automatically hidden from assistive technologies when loading or failed
|
|
154
|
+
* - Use meaningful descriptions like "John Doe's profile picture" rather than generic terms
|
|
155
|
+
* - The component handles ARIA attributes automatically via Radix UI
|
|
156
|
+
*
|
|
157
|
+
* @see {@link Avatar} - The parent container component
|
|
158
|
+
* @see {@link AvatarFallback} - The fallback component shown when image is unavailable
|
|
159
|
+
* @since 1.0.0
|
|
160
|
+
*/
|
|
161
|
+
declare function AvatarImage({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>): import("react/jsx-runtime").JSX.Element;
|
|
162
|
+
/**
|
|
163
|
+
* AvatarFallback - Fallback content displayed when the avatar image is unavailable
|
|
164
|
+
*
|
|
165
|
+
* This component renders alternative content when the AvatarImage is loading, fails to load,
|
|
166
|
+
* or is not provided. It's built on Radix UI's Avatar.Fallback primitive and provides a
|
|
167
|
+
* visually appealing placeholder that maintains the avatar's design consistency.
|
|
168
|
+
*
|
|
169
|
+
* ## Common Use Cases
|
|
170
|
+
* - User initials (most common pattern)
|
|
171
|
+
* - Generic user icons
|
|
172
|
+
* - Company/brand initials for organization avatars
|
|
173
|
+
* - Loading states with animations
|
|
174
|
+
* - Placeholder content for new users
|
|
175
|
+
*
|
|
176
|
+
* ## Design Considerations
|
|
177
|
+
* - Uses muted background color for subtle appearance
|
|
178
|
+
* - Automatically centers content both horizontally and vertically
|
|
179
|
+
* - Inherits size and border radius from parent Avatar
|
|
180
|
+
* - Should complement the overall design system
|
|
181
|
+
*
|
|
182
|
+
* @component
|
|
183
|
+
* @example
|
|
184
|
+
* ```tsx
|
|
185
|
+
* // User initials (recommended pattern)
|
|
186
|
+
* <Avatar>
|
|
187
|
+
* <AvatarImage src="/avatar.jpg" alt="John Doe" />
|
|
188
|
+
* <AvatarFallback>JD</AvatarFallback>
|
|
189
|
+
* </Avatar>
|
|
190
|
+
* ```
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* ```tsx
|
|
194
|
+
* // Icon fallback for unknown users
|
|
195
|
+
* import { User } from "lucide-react";
|
|
196
|
+
*
|
|
197
|
+
* <Avatar>
|
|
198
|
+
* <AvatarImage src="/unknown-user.jpg" alt="Anonymous User" />
|
|
199
|
+
* <AvatarFallback>
|
|
200
|
+
* <User className="size-4 text-muted-foreground" />
|
|
201
|
+
* </AvatarFallback>
|
|
202
|
+
* </Avatar>
|
|
203
|
+
* ```
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* ```tsx
|
|
207
|
+
* // Custom colored fallback
|
|
208
|
+
* <Avatar>
|
|
209
|
+
* <AvatarImage src="/user.jpg" alt="Jane Smith" />
|
|
210
|
+
* <AvatarFallback className="bg-blue-500 text-white">
|
|
211
|
+
* JS
|
|
212
|
+
* </AvatarFallback>
|
|
213
|
+
* </Avatar>
|
|
214
|
+
* ```
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* ```tsx
|
|
218
|
+
* // Loading state with animation
|
|
219
|
+
* <Avatar>
|
|
220
|
+
* <AvatarImage src="/loading-image.jpg" alt="Loading" />
|
|
221
|
+
* <AvatarFallback className="animate-pulse">
|
|
222
|
+
* <User className="size-4 text-muted-foreground" />
|
|
223
|
+
* </AvatarFallback>
|
|
224
|
+
* </Avatar>
|
|
225
|
+
* ```
|
|
226
|
+
*
|
|
227
|
+
* @param children - The fallback content to display. Common patterns include user initials (2-3 characters), icons, or loading indicators
|
|
228
|
+
* @param className - Additional CSS classes. Use for custom background colors, text styling, or animations
|
|
229
|
+
* @param delayMs - Optional delay in milliseconds before showing the fallback (Radix UI feature)
|
|
230
|
+
*
|
|
231
|
+
* @accessibility
|
|
232
|
+
* - Content should be meaningful and descriptive
|
|
233
|
+
* - Ensure sufficient color contrast between text and background (minimum 4.5:1 ratio)
|
|
234
|
+
* - Keep text concise - typically 1-3 characters for initials
|
|
235
|
+
* - Icons should have appropriate sizing relative to the avatar
|
|
236
|
+
* - The component is automatically accessible via Radix UI implementation
|
|
237
|
+
*
|
|
238
|
+
* @see {@link Avatar} - The parent container component
|
|
239
|
+
* @see {@link AvatarImage} - The image component that this component provides fallback for
|
|
240
|
+
* @since 1.0.0
|
|
241
|
+
*/
|
|
242
|
+
declare function AvatarFallback({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Fallback>): import("react/jsx-runtime").JSX.Element;
|
|
243
|
+
export { Avatar, AvatarImage, AvatarFallback };
|
|
244
|
+
//# sourceMappingURL=avatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../src/components/ui/avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAI1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqGG;AACH,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,2CAWnD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAQpD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AACH,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,QAAQ,CAAC,2CAWvD;AAED,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
/**
|
|
4
|
+
* Badge variant styles using class-variance-authority (CVA).
|
|
5
|
+
*
|
|
6
|
+
* This function generates type-safe CSS classes for different badge variants.
|
|
7
|
+
* Each variant is designed with specific semantic meaning and appropriate
|
|
8
|
+
* color schemes for both light and dark themes.
|
|
9
|
+
*
|
|
10
|
+
* ## Base Styles
|
|
11
|
+
* - Inline flex layout with center alignment
|
|
12
|
+
* - Fixed height with responsive padding
|
|
13
|
+
* - Rounded corners and border
|
|
14
|
+
* - Typography: small, medium weight, no wrap
|
|
15
|
+
* - Icon support with consistent sizing
|
|
16
|
+
* - Accessibility features (focus rings, error states)
|
|
17
|
+
* - Smooth transitions for interactive states
|
|
18
|
+
*
|
|
19
|
+
* ## Variants
|
|
20
|
+
* - **default**: Primary brand color, high emphasis
|
|
21
|
+
* - **secondary**: Muted background, medium emphasis
|
|
22
|
+
* - **destructive**: Error/warning states, urgent attention
|
|
23
|
+
* - **outline**: Subtle border-only style, low emphasis
|
|
24
|
+
*
|
|
25
|
+
* @param props - Variant configuration object
|
|
26
|
+
* @param props.variant - The visual variant to apply
|
|
27
|
+
* @returns CSS class string for the specified variant
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* // Use directly with className
|
|
32
|
+
* <span className={badgeVariants({ variant: "destructive" })}>
|
|
33
|
+
* Error
|
|
34
|
+
* </span>
|
|
35
|
+
*
|
|
36
|
+
* // Combine with additional classes
|
|
37
|
+
* <span className={cn(badgeVariants({ variant: "outline" }), "custom-class")}>
|
|
38
|
+
* Custom Badge
|
|
39
|
+
* </span>
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare const badgeVariants: (props?: ({
|
|
43
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
|
|
44
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
45
|
+
/**
|
|
46
|
+
* A versatile badge component for displaying status indicators, labels, counts, and notifications.
|
|
47
|
+
*
|
|
48
|
+
* Badges are small status descriptors for UI elements. They provide visual feedback about the state,
|
|
49
|
+
* category, or importance of content. The component is built with accessibility in mind and supports
|
|
50
|
+
* multiple visual variants for different semantic meanings.
|
|
51
|
+
*
|
|
52
|
+
* ## Key Features
|
|
53
|
+
* - Multiple semantic variants (default, secondary, destructive, outline)
|
|
54
|
+
* - Icon support with proper sizing and spacing
|
|
55
|
+
* - Polymorphic rendering via `asChild` prop
|
|
56
|
+
* - Accessibility-first design with proper focus management
|
|
57
|
+
* - Support for interactive states (hover, focus, invalid)
|
|
58
|
+
* - Built-in responsive behavior
|
|
59
|
+
*
|
|
60
|
+
* ## When to Use
|
|
61
|
+
* - Status indicators (active, pending, error)
|
|
62
|
+
* - Notification counts and badges
|
|
63
|
+
* - Category labels and tags
|
|
64
|
+
* - Priority indicators
|
|
65
|
+
* - Quick action buttons (when used with asChild)
|
|
66
|
+
*
|
|
67
|
+
* ## Accessibility Features
|
|
68
|
+
* - Keyboard navigation support with focus-visible ring
|
|
69
|
+
* - High contrast colors for all variants
|
|
70
|
+
* - Support for `aria-invalid` state with visual feedback
|
|
71
|
+
* - Semantic color mapping (destructive = error, etc.)
|
|
72
|
+
* - Screen reader friendly content structure
|
|
73
|
+
*
|
|
74
|
+
* @component
|
|
75
|
+
* @example
|
|
76
|
+
* ```tsx
|
|
77
|
+
* // Basic status badge
|
|
78
|
+
* <Badge>New</Badge>
|
|
79
|
+
* <Badge variant="secondary">Draft</Badge>
|
|
80
|
+
* <Badge variant="destructive">Error</Badge>
|
|
81
|
+
* <Badge variant="outline">Pending</Badge>
|
|
82
|
+
* ```
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```tsx
|
|
86
|
+
* // Badge with icon
|
|
87
|
+
* import { Check, AlertTriangle } from "lucide-react";
|
|
88
|
+
*
|
|
89
|
+
* <Badge>
|
|
90
|
+
* <Check />
|
|
91
|
+
* Completed
|
|
92
|
+
* </Badge>
|
|
93
|
+
*
|
|
94
|
+
* <Badge variant="destructive">
|
|
95
|
+
* <AlertTriangle />
|
|
96
|
+
* Failed
|
|
97
|
+
* </Badge>
|
|
98
|
+
* ```
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```tsx
|
|
102
|
+
* // Notification count badge
|
|
103
|
+
* <div className="relative">
|
|
104
|
+
* <Bell />
|
|
105
|
+
* <Badge className="absolute -top-2 -right-2 size-5 p-0 text-xs">
|
|
106
|
+
* 3
|
|
107
|
+
* </Badge>
|
|
108
|
+
* </div>
|
|
109
|
+
* ```
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```tsx
|
|
113
|
+
* // Interactive badge as link
|
|
114
|
+
* import Link from "next/link";
|
|
115
|
+
*
|
|
116
|
+
* <Badge asChild>
|
|
117
|
+
* <Link href="/notifications">
|
|
118
|
+
* 3 new messages
|
|
119
|
+
* </Link>
|
|
120
|
+
* </Badge>
|
|
121
|
+
* ```
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```tsx
|
|
125
|
+
* // Removable tag badge
|
|
126
|
+
* <Badge className="pr-1">
|
|
127
|
+
* React
|
|
128
|
+
* <button className="ml-1 hover:bg-primary-foreground/20 rounded-full p-0.5">
|
|
129
|
+
* <X className="size-3" />
|
|
130
|
+
* </button>
|
|
131
|
+
* </Badge>
|
|
132
|
+
* ```
|
|
133
|
+
*
|
|
134
|
+
* @see {@link Button} - For primary actionable elements
|
|
135
|
+
* @see [shadcn/ui Badge Documentation](https://ui.shadcn.com/docs/components/badge)
|
|
136
|
+
* @since 1.0.0
|
|
137
|
+
*/
|
|
138
|
+
declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
|
139
|
+
/**
|
|
140
|
+
* If true, the badge will render its child element instead of a span element.
|
|
141
|
+
* Useful for creating badge-styled links, buttons, or other interactive elements.
|
|
142
|
+
*
|
|
143
|
+
* When true, you must provide exactly one child element that can receive props.
|
|
144
|
+
* The child element will receive all the badge styling and attributes.
|
|
145
|
+
*
|
|
146
|
+
* @default false
|
|
147
|
+
* @example
|
|
148
|
+
* ```tsx
|
|
149
|
+
* // Badge as a link
|
|
150
|
+
* <Badge asChild>
|
|
151
|
+
* <Link href="/profile">Profile</Link>
|
|
152
|
+
* </Badge>
|
|
153
|
+
*
|
|
154
|
+
* // Badge as a button
|
|
155
|
+
* <Badge asChild>
|
|
156
|
+
* <button onClick={handleClick}>Click me</button>
|
|
157
|
+
* </Badge>
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
asChild?: boolean;
|
|
161
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
162
|
+
export { Badge, badgeVariants };
|
|
163
|
+
//# sourceMappingURL=badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/components/ui/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,QAAA,MAAM,aAAa;;8EAuBlB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4FG;AACH,iBAAS,KAAK,CAAC,EACb,SAAS,EACT,OAAO,EACP,OAAe,EACf,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,GAC7B,YAAY,CAAC,OAAO,aAAa,CAAC,GAAG;IACnC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,2CAUF;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Breadcrumb navigation component that displays hierarchical page location
|
|
4
|
+
*
|
|
5
|
+
* A breadcrumb navigation component built on semantic HTML that shows the current page
|
|
6
|
+
* location within a navigational hierarchy. Provides users with contextual awareness
|
|
7
|
+
* of their position in the site structure and enables easy navigation to parent pages.
|
|
8
|
+
*
|
|
9
|
+
* Based on the shadcn/ui Breadcrumb component with accessibility features and
|
|
10
|
+
* support for composition patterns including custom separators, ellipsis for long
|
|
11
|
+
* paths, dropdown menus, and custom link components via the asChild prop.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* // Basic breadcrumb navigation
|
|
16
|
+
* <Breadcrumb>
|
|
17
|
+
* <BreadcrumbList>
|
|
18
|
+
* <BreadcrumbItem>
|
|
19
|
+
* <BreadcrumbLink href="/">Home</BreadcrumbLink>
|
|
20
|
+
* </BreadcrumbItem>
|
|
21
|
+
* <BreadcrumbSeparator />
|
|
22
|
+
* <BreadcrumbItem>
|
|
23
|
+
* <BreadcrumbLink href="/products">Products</BreadcrumbLink>
|
|
24
|
+
* </BreadcrumbItem>
|
|
25
|
+
* <BreadcrumbSeparator />
|
|
26
|
+
* <BreadcrumbItem>
|
|
27
|
+
* <BreadcrumbPage>Laptop</BreadcrumbPage>
|
|
28
|
+
* </BreadcrumbItem>
|
|
29
|
+
* </BreadcrumbList>
|
|
30
|
+
* </Breadcrumb>
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* // With ellipsis for long paths
|
|
36
|
+
* <Breadcrumb>
|
|
37
|
+
* <BreadcrumbList>
|
|
38
|
+
* <BreadcrumbItem>
|
|
39
|
+
* <BreadcrumbLink href="/">Home</BreadcrumbLink>
|
|
40
|
+
* </BreadcrumbItem>
|
|
41
|
+
* <BreadcrumbSeparator />
|
|
42
|
+
* <BreadcrumbItem>
|
|
43
|
+
* <BreadcrumbEllipsis />
|
|
44
|
+
* </BreadcrumbItem>
|
|
45
|
+
* <BreadcrumbSeparator />
|
|
46
|
+
* <BreadcrumbItem>
|
|
47
|
+
* <BreadcrumbLink href="/products/laptops">Laptops</BreadcrumbLink>
|
|
48
|
+
* </BreadcrumbItem>
|
|
49
|
+
* <BreadcrumbSeparator />
|
|
50
|
+
* <BreadcrumbItem>
|
|
51
|
+
* <BreadcrumbPage>Gaming Laptop</BreadcrumbPage>
|
|
52
|
+
* </BreadcrumbItem>
|
|
53
|
+
* </BreadcrumbList>
|
|
54
|
+
* </Breadcrumb>
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```tsx
|
|
59
|
+
* // With Next.js Link integration
|
|
60
|
+
* import { Link } from "next/link"
|
|
61
|
+
*
|
|
62
|
+
* <Breadcrumb>
|
|
63
|
+
* <BreadcrumbList>
|
|
64
|
+
* <BreadcrumbItem>
|
|
65
|
+
* <BreadcrumbLink asChild>
|
|
66
|
+
* <Link href="/">Home</Link>
|
|
67
|
+
* </BreadcrumbLink>
|
|
68
|
+
* </BreadcrumbItem>
|
|
69
|
+
* <BreadcrumbSeparator />
|
|
70
|
+
* <BreadcrumbItem>
|
|
71
|
+
* <BreadcrumbPage>Current Page</BreadcrumbPage>
|
|
72
|
+
* </BreadcrumbItem>
|
|
73
|
+
* </BreadcrumbList>
|
|
74
|
+
* </Breadcrumb>
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```tsx
|
|
79
|
+
* // With custom separator
|
|
80
|
+
* import { Slash } from "lucide-react"
|
|
81
|
+
*
|
|
82
|
+
* <Breadcrumb>
|
|
83
|
+
* <BreadcrumbList>
|
|
84
|
+
* <BreadcrumbItem>
|
|
85
|
+
* <BreadcrumbLink href="/">Home</BreadcrumbLink>
|
|
86
|
+
* </BreadcrumbItem>
|
|
87
|
+
* <BreadcrumbSeparator>
|
|
88
|
+
* <Slash />
|
|
89
|
+
* </BreadcrumbSeparator>
|
|
90
|
+
* <BreadcrumbItem>
|
|
91
|
+
* <BreadcrumbPage>Current Page</BreadcrumbPage>
|
|
92
|
+
* </BreadcrumbItem>
|
|
93
|
+
* </BreadcrumbList>
|
|
94
|
+
* </Breadcrumb>
|
|
95
|
+
* ```
|
|
96
|
+
*
|
|
97
|
+
* @accessibility
|
|
98
|
+
* - Uses semantic `nav` element with `aria-label="breadcrumb"`
|
|
99
|
+
* - Current page marked with `aria-current="page"`
|
|
100
|
+
* - Separators marked with `role="presentation"` and `aria-hidden="true"`
|
|
101
|
+
* - Screen reader friendly navigation structure
|
|
102
|
+
* - Supports keyboard navigation through links
|
|
103
|
+
*
|
|
104
|
+
* @see {@link https://ui.shadcn.com/docs/components/breadcrumb} for design patterns
|
|
105
|
+
* @see {@link BreadcrumbList} - Ordered list container for breadcrumb items
|
|
106
|
+
* @see {@link BreadcrumbItem} - Individual breadcrumb list item
|
|
107
|
+
* @see {@link BreadcrumbLink} - Navigable breadcrumb link with asChild support
|
|
108
|
+
* @see {@link BreadcrumbPage} - Current page indicator (non-clickable)
|
|
109
|
+
* @see {@link BreadcrumbSeparator} - Visual separator between items
|
|
110
|
+
* @see {@link BreadcrumbEllipsis} - Ellipsis indicator for collapsed items
|
|
111
|
+
* @since 1.0.0
|
|
112
|
+
*/
|
|
113
|
+
declare function Breadcrumb({ ...props }: React.ComponentProps<"nav">): import("react/jsx-runtime").JSX.Element;
|
|
114
|
+
/**
|
|
115
|
+
* Ordered list container for breadcrumb items
|
|
116
|
+
*
|
|
117
|
+
* Provides the structured list layout for breadcrumb navigation items with
|
|
118
|
+
* responsive spacing and text overflow handling. Uses semantic `ol` element
|
|
119
|
+
* for proper accessibility and screen reader navigation.
|
|
120
|
+
*
|
|
121
|
+
* @param className - Additional CSS classes to apply
|
|
122
|
+
* @param props - Standard HTML ordered list props
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```tsx
|
|
126
|
+
* <BreadcrumbList>
|
|
127
|
+
* <BreadcrumbItem>
|
|
128
|
+
* <BreadcrumbLink href="/">Home</BreadcrumbLink>
|
|
129
|
+
* </BreadcrumbItem>
|
|
130
|
+
* </BreadcrumbList>
|
|
131
|
+
* ```
|
|
132
|
+
*
|
|
133
|
+
* @since 1.0.0
|
|
134
|
+
*/
|
|
135
|
+
declare function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">): import("react/jsx-runtime").JSX.Element;
|
|
136
|
+
/**
|
|
137
|
+
* Individual breadcrumb list item container
|
|
138
|
+
*
|
|
139
|
+
* Wraps breadcrumb content (links, pages, separators) in a semantic list item.
|
|
140
|
+
* Provides consistent alignment and spacing for breadcrumb elements.
|
|
141
|
+
*
|
|
142
|
+
* @param className - Additional CSS classes to apply
|
|
143
|
+
* @param props - Standard HTML list item props
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```tsx
|
|
147
|
+
* <BreadcrumbItem>
|
|
148
|
+
* <BreadcrumbLink href="/products">Products</BreadcrumbLink>
|
|
149
|
+
* </BreadcrumbItem>
|
|
150
|
+
* ```
|
|
151
|
+
*
|
|
152
|
+
* @since 1.0.0
|
|
153
|
+
*/
|
|
154
|
+
declare function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">): import("react/jsx-runtime").JSX.Element;
|
|
155
|
+
/**
|
|
156
|
+
* Navigable link within breadcrumb trail
|
|
157
|
+
*
|
|
158
|
+
* Represents a clickable parent page in the breadcrumb hierarchy with hover
|
|
159
|
+
* effects and transition animations. Supports composition via the `asChild` prop
|
|
160
|
+
* for integration with routing libraries like Next.js Link or React Router.
|
|
161
|
+
*
|
|
162
|
+
* @param asChild - When true, renders children directly instead of an anchor element
|
|
163
|
+
* @param className - Additional CSS classes to apply
|
|
164
|
+
* @param props - Standard HTML anchor props when asChild is false
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* ```tsx
|
|
168
|
+
* // Standard link
|
|
169
|
+
* <BreadcrumbLink href="/products">Products</BreadcrumbLink>
|
|
170
|
+
* ```
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```tsx
|
|
174
|
+
* // With Next.js Link
|
|
175
|
+
* <BreadcrumbLink asChild>
|
|
176
|
+
* <Link href="/products">Products</Link>
|
|
177
|
+
* </BreadcrumbLink>
|
|
178
|
+
* ```
|
|
179
|
+
*
|
|
180
|
+
* @since 1.0.0
|
|
181
|
+
*/
|
|
182
|
+
declare function BreadcrumbLink({ asChild, className, ...props }: React.ComponentProps<"a"> & {
|
|
183
|
+
asChild?: boolean;
|
|
184
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
185
|
+
/**
|
|
186
|
+
* Current page indicator in breadcrumb trail
|
|
187
|
+
*
|
|
188
|
+
* Represents the current page (non-clickable) at the end of the breadcrumb trail.
|
|
189
|
+
* Styled with prominent text color and marked with accessibility attributes
|
|
190
|
+
* including `aria-current="page"` for screen reader identification.
|
|
191
|
+
*
|
|
192
|
+
* @param className - Additional CSS classes to apply
|
|
193
|
+
* @param props - Standard HTML span props
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* ```tsx
|
|
197
|
+
* <BreadcrumbPage>Current Page Name</BreadcrumbPage>
|
|
198
|
+
* ```
|
|
199
|
+
*
|
|
200
|
+
* @accessibility
|
|
201
|
+
* - Uses `role="link"` with `aria-disabled="true"` for semantic meaning
|
|
202
|
+
* - Marked with `aria-current="page"` to indicate current location
|
|
203
|
+
*
|
|
204
|
+
* @since 1.0.0
|
|
205
|
+
*/
|
|
206
|
+
declare function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
207
|
+
/**
|
|
208
|
+
* Visual separator between breadcrumb items
|
|
209
|
+
*
|
|
210
|
+
* Displays a separator icon (default: ChevronRight) between breadcrumb items.
|
|
211
|
+
* Supports custom separator icons by passing them as children. Hidden from
|
|
212
|
+
* screen readers with accessibility attributes for clean navigation experience.
|
|
213
|
+
*
|
|
214
|
+
* @param children - Custom separator icon to display instead of default ChevronRight
|
|
215
|
+
* @param className - Additional CSS classes to apply
|
|
216
|
+
* @param props - Standard HTML list item props
|
|
217
|
+
*
|
|
218
|
+
* @example
|
|
219
|
+
* ```tsx
|
|
220
|
+
* // Default separator
|
|
221
|
+
* <BreadcrumbSeparator />
|
|
222
|
+
* ```
|
|
223
|
+
*
|
|
224
|
+
* @example
|
|
225
|
+
* ```tsx
|
|
226
|
+
* // Custom separator
|
|
227
|
+
* import { Slash } from "lucide-react"
|
|
228
|
+
* <BreadcrumbSeparator>
|
|
229
|
+
* <Slash />
|
|
230
|
+
* </BreadcrumbSeparator>
|
|
231
|
+
* ```
|
|
232
|
+
*
|
|
233
|
+
* @accessibility
|
|
234
|
+
* - Uses `role="presentation"` to indicate decorative content
|
|
235
|
+
* - Hidden from screen readers with `aria-hidden="true"`
|
|
236
|
+
*
|
|
237
|
+
* @since 1.0.0
|
|
238
|
+
*/
|
|
239
|
+
declare function BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<"li">): import("react/jsx-runtime").JSX.Element;
|
|
240
|
+
/**
|
|
241
|
+
* Ellipsis indicator for collapsed breadcrumb items
|
|
242
|
+
*
|
|
243
|
+
* Shows a horizontal ellipsis icon (MoreHorizontal) to indicate hidden or
|
|
244
|
+
* collapsed middle items in a long breadcrumb trail. Useful for deep navigation
|
|
245
|
+
* hierarchies where space is limited. Often used in combination with dropdown
|
|
246
|
+
* menus to reveal the collapsed items.
|
|
247
|
+
*
|
|
248
|
+
* @param className - Additional CSS classes to apply
|
|
249
|
+
* @param props - Standard HTML span props
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
* ```tsx
|
|
253
|
+
* // Simple ellipsis
|
|
254
|
+
* <BreadcrumbEllipsis />
|
|
255
|
+
* ```
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* ```tsx
|
|
259
|
+
* // With dropdown menu for collapsed items
|
|
260
|
+
* <BreadcrumbItem>
|
|
261
|
+
* <DropdownMenu>
|
|
262
|
+
* <DropdownMenuTrigger>
|
|
263
|
+
* <BreadcrumbEllipsis />
|
|
264
|
+
* </DropdownMenuTrigger>
|
|
265
|
+
* <DropdownMenuContent>
|
|
266
|
+
* <DropdownMenuItem>Hidden Item 1</DropdownMenuItem>
|
|
267
|
+
* <DropdownMenuItem>Hidden Item 2</DropdownMenuItem>
|
|
268
|
+
* </DropdownMenuContent>
|
|
269
|
+
* </DropdownMenu>
|
|
270
|
+
* </BreadcrumbItem>
|
|
271
|
+
* ```
|
|
272
|
+
*
|
|
273
|
+
* @accessibility
|
|
274
|
+
* - Uses `role="presentation"` and `aria-hidden="true"` for decorative content
|
|
275
|
+
* - Includes screen reader text "More" for context
|
|
276
|
+
*
|
|
277
|
+
* @since 1.0.0
|
|
278
|
+
*/
|
|
279
|
+
declare function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
280
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
|
|
281
|
+
//# sourceMappingURL=breadcrumb.d.ts.map
|