@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,247 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
3
|
+
/**
|
|
4
|
+
* Alert dialog component for critical confirmations and destructive actions
|
|
5
|
+
*
|
|
6
|
+
* A specialized modal dialog built on Radix UI Alert Dialog primitives that interrupts
|
|
7
|
+
* users with important information requiring immediate acknowledgment or decision.
|
|
8
|
+
* Unlike regular dialogs, alert dialogs cannot be dismissed by clicking outside and
|
|
9
|
+
* focus the action button by default for critical decisions.
|
|
10
|
+
*
|
|
11
|
+
* Based on the WAI-ARIA Alert Dialog design pattern, this component is specifically
|
|
12
|
+
* designed for destructive actions, confirmations, or critical warnings that need
|
|
13
|
+
* immediate attention before the user can continue.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* // Basic destructive confirmation
|
|
18
|
+
* <AlertDialog>
|
|
19
|
+
* <AlertDialogTrigger asChild>
|
|
20
|
+
* <Button variant="destructive">Delete Account</Button>
|
|
21
|
+
* </AlertDialogTrigger>
|
|
22
|
+
* <AlertDialogContent>
|
|
23
|
+
* <AlertDialogHeader>
|
|
24
|
+
* <AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
|
|
25
|
+
* <AlertDialogDescription>
|
|
26
|
+
* This action cannot be undone. This will permanently delete
|
|
27
|
+
* your account and remove your data from our servers.
|
|
28
|
+
* </AlertDialogDescription>
|
|
29
|
+
* </AlertDialogHeader>
|
|
30
|
+
* <AlertDialogFooter>
|
|
31
|
+
* <AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
32
|
+
* <AlertDialogAction>Delete Account</AlertDialogAction>
|
|
33
|
+
* </AlertDialogFooter>
|
|
34
|
+
* </AlertDialogContent>
|
|
35
|
+
* </AlertDialog>
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```tsx
|
|
40
|
+
* // Simple confirmation
|
|
41
|
+
* <AlertDialog>
|
|
42
|
+
* <AlertDialogTrigger asChild>
|
|
43
|
+
* <Button variant="outline">Sign Out</Button>
|
|
44
|
+
* </AlertDialogTrigger>
|
|
45
|
+
* <AlertDialogContent>
|
|
46
|
+
* <AlertDialogHeader>
|
|
47
|
+
* <AlertDialogTitle>Sign Out</AlertDialogTitle>
|
|
48
|
+
* <AlertDialogDescription>
|
|
49
|
+
* Are you sure you want to sign out of your account?
|
|
50
|
+
* </AlertDialogDescription>
|
|
51
|
+
* </AlertDialogHeader>
|
|
52
|
+
* <AlertDialogFooter>
|
|
53
|
+
* <AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
54
|
+
* <AlertDialogAction>Sign Out</AlertDialogAction>
|
|
55
|
+
* </AlertDialogFooter>
|
|
56
|
+
* </AlertDialogContent>
|
|
57
|
+
* </AlertDialog>
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* @accessibility
|
|
61
|
+
* - Follows WAI-ARIA Alert Dialog design pattern
|
|
62
|
+
* - Focus is trapped within the dialog when open
|
|
63
|
+
* - Cannot be dismissed by clicking outside (intentional for alerts)
|
|
64
|
+
* - Escape key closes the dialog (unless preventDefault is called)
|
|
65
|
+
* - Proper ARIA roles and attributes for screen readers
|
|
66
|
+
* - Focus returns to trigger element when closed
|
|
67
|
+
* - Action button receives initial focus by default
|
|
68
|
+
* - Supports keyboard navigation between focusable elements
|
|
69
|
+
*
|
|
70
|
+
* @see {@link https://ui.shadcn.com/docs/components/alert-dialog} shadcn/ui Alert Dialog docs
|
|
71
|
+
* @see {@link https://www.radix-ui.com/primitives/docs/components/alert-dialog} Radix UI Alert Dialog
|
|
72
|
+
* @see {@link Dialog} For general modal content that can be dismissed
|
|
73
|
+
* @see {@link Sheet} For side panel overlays
|
|
74
|
+
* @since 1.0.0
|
|
75
|
+
*/
|
|
76
|
+
/**
|
|
77
|
+
* Root component of the alert dialog
|
|
78
|
+
*
|
|
79
|
+
* Provides the context and state management for the entire alert dialog.
|
|
80
|
+
* Controls the open/closed state and manages focus behavior.
|
|
81
|
+
*
|
|
82
|
+
* @param props - All props are forwarded to the underlying Radix AlertDialog.Root
|
|
83
|
+
*/
|
|
84
|
+
declare function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
85
|
+
/**
|
|
86
|
+
* Trigger element that opens the alert dialog
|
|
87
|
+
*
|
|
88
|
+
* The element that opens the alert dialog when activated. Usually a button,
|
|
89
|
+
* but can be any interactive element. Use the `asChild` prop to compose
|
|
90
|
+
* with other components.
|
|
91
|
+
*
|
|
92
|
+
* @param props - All props are forwarded to the underlying Radix AlertDialog.Trigger
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```tsx
|
|
96
|
+
* <AlertDialogTrigger asChild>
|
|
97
|
+
* <Button variant="destructive">Delete</Button>
|
|
98
|
+
* </AlertDialogTrigger>
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
declare function AlertDialogTrigger({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
102
|
+
/**
|
|
103
|
+
* Portal component for rendering dialog outside normal DOM tree
|
|
104
|
+
*
|
|
105
|
+
* Renders the alert dialog content into a portal, typically at the end of the document body.
|
|
106
|
+
* This ensures the dialog appears above other content and is properly accessible.
|
|
107
|
+
* Usually not used directly - AlertDialogContent includes this automatically.
|
|
108
|
+
*
|
|
109
|
+
* @param props - All props are forwarded to the underlying Radix AlertDialog.Portal
|
|
110
|
+
*/
|
|
111
|
+
declare function AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
112
|
+
/**
|
|
113
|
+
* Overlay backdrop behind the alert dialog
|
|
114
|
+
*
|
|
115
|
+
* A semi-transparent backdrop that covers the entire viewport when the dialog is open.
|
|
116
|
+
* Provides visual separation and prevents interaction with background content.
|
|
117
|
+
* Includes fade in/out animations using data-state attributes.
|
|
118
|
+
*
|
|
119
|
+
* @param className - Additional CSS classes to apply
|
|
120
|
+
* @param props - All other props are forwarded to the underlying Radix AlertDialog.Overlay
|
|
121
|
+
*/
|
|
122
|
+
declare function AlertDialogOverlay({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
|
|
123
|
+
/**
|
|
124
|
+
* Main content container for the alert dialog
|
|
125
|
+
*
|
|
126
|
+
* The primary container that holds all alert dialog content. Automatically includes
|
|
127
|
+
* the portal and overlay, and provides default styling with responsive design.
|
|
128
|
+
* Centered on screen with fade and zoom animations.
|
|
129
|
+
*
|
|
130
|
+
* @param className - Additional CSS classes to apply to the content container
|
|
131
|
+
* @param props - All other props are forwarded to the underlying Radix AlertDialog.Content
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* ```tsx
|
|
135
|
+
* <AlertDialogContent>
|
|
136
|
+
* <AlertDialogHeader>
|
|
137
|
+
* <AlertDialogTitle>Confirm Action</AlertDialogTitle>
|
|
138
|
+
* <AlertDialogDescription>This action cannot be undone.</AlertDialogDescription>
|
|
139
|
+
* </AlertDialogHeader>
|
|
140
|
+
* <AlertDialogFooter>
|
|
141
|
+
* <AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
142
|
+
* <AlertDialogAction>Continue</AlertDialogAction>
|
|
143
|
+
* </AlertDialogFooter>
|
|
144
|
+
* </AlertDialogContent>
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
declare function AlertDialogContent({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
148
|
+
/**
|
|
149
|
+
* Header section of the alert dialog
|
|
150
|
+
*
|
|
151
|
+
* Contains the title and description of the alert dialog. Provides consistent
|
|
152
|
+
* spacing and alignment, with responsive text alignment (centered on mobile,
|
|
153
|
+
* left-aligned on larger screens).
|
|
154
|
+
*
|
|
155
|
+
* @param className - Additional CSS classes to apply
|
|
156
|
+
* @param props - All other props are forwarded to the underlying div element
|
|
157
|
+
*/
|
|
158
|
+
declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
159
|
+
/**
|
|
160
|
+
* Footer section of the alert dialog
|
|
161
|
+
*
|
|
162
|
+
* Contains the action buttons (cancel and confirm). Uses responsive layout
|
|
163
|
+
* with stacked buttons on mobile (cancel on top) and horizontal layout
|
|
164
|
+
* on larger screens (cancel on left, action on right).
|
|
165
|
+
*
|
|
166
|
+
* @param className - Additional CSS classes to apply
|
|
167
|
+
* @param props - All other props are forwarded to the underlying div element
|
|
168
|
+
*/
|
|
169
|
+
declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
170
|
+
/**
|
|
171
|
+
* Title heading of the alert dialog
|
|
172
|
+
*
|
|
173
|
+
* The main heading that describes the alert or action being confirmed.
|
|
174
|
+
* Automatically provides proper ARIA labeling for screen readers.
|
|
175
|
+
* Should be concise and clearly state what the dialog is asking.
|
|
176
|
+
*
|
|
177
|
+
* @param className - Additional CSS classes to apply
|
|
178
|
+
* @param props - All other props are forwarded to the underlying Radix AlertDialog.Title
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* ```tsx
|
|
182
|
+
* <AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
|
|
183
|
+
* <AlertDialogTitle>Delete Account</AlertDialogTitle>
|
|
184
|
+
* ```
|
|
185
|
+
*/
|
|
186
|
+
declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
187
|
+
/**
|
|
188
|
+
* Description text of the alert dialog
|
|
189
|
+
*
|
|
190
|
+
* Provides additional context and explanation for the alert or action.
|
|
191
|
+
* Should clearly explain the consequences of the action being confirmed.
|
|
192
|
+
* Automatically provides proper ARIA description for screen readers.
|
|
193
|
+
*
|
|
194
|
+
* @param className - Additional CSS classes to apply
|
|
195
|
+
* @param props - All other props are forwarded to the underlying Radix AlertDialog.Description
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* ```tsx
|
|
199
|
+
* <AlertDialogDescription>
|
|
200
|
+
* This action cannot be undone. This will permanently delete your
|
|
201
|
+
* account and remove your data from our servers.
|
|
202
|
+
* </AlertDialogDescription>
|
|
203
|
+
* ```
|
|
204
|
+
*/
|
|
205
|
+
declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
|
|
206
|
+
/**
|
|
207
|
+
* Primary action button of the alert dialog
|
|
208
|
+
*
|
|
209
|
+
* The button that confirms or executes the action being alerted about.
|
|
210
|
+
* Automatically receives focus when the dialog opens. Styled as a primary
|
|
211
|
+
* button by default, but can be customized for destructive actions.
|
|
212
|
+
* Closes the dialog when clicked.
|
|
213
|
+
*
|
|
214
|
+
* @param className - Additional CSS classes to apply (useful for destructive styling)
|
|
215
|
+
* @param props - All other props are forwarded to the underlying Radix AlertDialog.Action
|
|
216
|
+
*
|
|
217
|
+
* @example
|
|
218
|
+
* ```tsx
|
|
219
|
+
* // Default action
|
|
220
|
+
* <AlertDialogAction>Continue</AlertDialogAction>
|
|
221
|
+
*
|
|
222
|
+
* // Destructive action
|
|
223
|
+
* <AlertDialogAction className="bg-red-600 hover:bg-red-700">
|
|
224
|
+
* Delete Account
|
|
225
|
+
* </AlertDialogAction>
|
|
226
|
+
* ```
|
|
227
|
+
*/
|
|
228
|
+
declare function AlertDialogAction({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Action>): import("react/jsx-runtime").JSX.Element;
|
|
229
|
+
/**
|
|
230
|
+
* Cancel button of the alert dialog
|
|
231
|
+
*
|
|
232
|
+
* The button that dismisses the dialog without performing the action.
|
|
233
|
+
* Styled as an outline button by default to de-emphasize compared to
|
|
234
|
+
* the primary action. Closes the dialog when clicked.
|
|
235
|
+
*
|
|
236
|
+
* @param className - Additional CSS classes to apply
|
|
237
|
+
* @param props - All other props are forwarded to the underlying Radix AlertDialog.Cancel
|
|
238
|
+
*
|
|
239
|
+
* @example
|
|
240
|
+
* ```tsx
|
|
241
|
+
* <AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
242
|
+
* <AlertDialogCancel>No, keep it</AlertDialogCancel>
|
|
243
|
+
* ```
|
|
244
|
+
*/
|
|
245
|
+
declare function AlertDialogCancel({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>): import("react/jsx-runtime").JSX.Element;
|
|
246
|
+
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
|
|
247
|
+
//# sourceMappingURL=alert-dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/alert-dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;AAKrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AACH;;;;;;;GAOG;AACH,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,2CAExD;AAED;;;;;;;;;;;;;;;GAeG;AACH,iBAAS,kBAAkB,CAAC,EAC1B,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC,2CAI3D;AAED;;;;;;;;GAQG;AACH,iBAAS,iBAAiB,CAAC,EACzB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,2CAI1D;AAED;;;;;;;;;GASG;AACH,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC,2CAW3D;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC,2CAc3D;AAED;;;;;;;;;GASG;AACH,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQ7B;AAED;;;;;;;;;GASG;AACH,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAW7B;AAED;;;;;;;;;;;;;;;GAeG;AACH,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,KAAK,CAAC,2CAQzD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,WAAW,CAAC,2CAQ/D;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,2CAO1D;AAED;;;;;;;;;;;;;;;GAeG;AACH,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,2CAO1D;AAED,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,GAClB,CAAC"}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const alertVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
/**
|
|
7
|
+
* Alert - Display important messages and notifications to users
|
|
8
|
+
*
|
|
9
|
+
* A flexible alert component for displaying important messages, notifications, and status updates.
|
|
10
|
+
* Built with shadcn/ui design patterns and Tailwind CSS. Alerts are used to communicate
|
|
11
|
+
* critical information that requires user attention and potentially action.
|
|
12
|
+
*
|
|
13
|
+
* ## When to use
|
|
14
|
+
* - System-wide notifications and announcements
|
|
15
|
+
* - Form validation errors and success messages
|
|
16
|
+
* - Important warnings that need persistent visibility
|
|
17
|
+
* - Status updates that don't require immediate action
|
|
18
|
+
* - Progress indicators and completion messages
|
|
19
|
+
*
|
|
20
|
+
* ## Features
|
|
21
|
+
* - Two built-in variants: `default` and `destructive`
|
|
22
|
+
* - Automatic icon grid layout with proper spacing using CSS Grid
|
|
23
|
+
* - Semantic HTML with proper ARIA attributes (`role="alert"`)
|
|
24
|
+
* - Responsive design with consistent spacing
|
|
25
|
+
* - Dark mode support via CSS custom properties
|
|
26
|
+
* - Composition pattern with AlertTitle and AlertDescription
|
|
27
|
+
* - Support for custom styling through className prop
|
|
28
|
+
* - Icon-aware layout that adapts to presence of SVG icons
|
|
29
|
+
*
|
|
30
|
+
* ## Design Philosophy
|
|
31
|
+
* Follows the shadcn/ui principle of providing unstyled, accessible components that
|
|
32
|
+
* can be easily customized. The alert uses CSS Grid for intelligent layout that
|
|
33
|
+
* automatically adjusts based on whether an icon is present.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```tsx
|
|
37
|
+
* // Basic informational alert
|
|
38
|
+
* <Alert>
|
|
39
|
+
* <Info className="size-4" />
|
|
40
|
+
* <AlertTitle>Heads up!</AlertTitle>
|
|
41
|
+
* <AlertDescription>
|
|
42
|
+
* You can add components to your app using the cli.
|
|
43
|
+
* </AlertDescription>
|
|
44
|
+
* </Alert>
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```tsx
|
|
49
|
+
* // Destructive error alert
|
|
50
|
+
* import { AlertCircle } from "lucide-react";
|
|
51
|
+
*
|
|
52
|
+
* <Alert variant="destructive">
|
|
53
|
+
* <AlertCircle className="size-4" />
|
|
54
|
+
* <AlertTitle>Error</AlertTitle>
|
|
55
|
+
* <AlertDescription>
|
|
56
|
+
* Your session has expired. Please log in again.
|
|
57
|
+
* </AlertDescription>
|
|
58
|
+
* </Alert>
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```tsx
|
|
63
|
+
* // Custom styled success alert
|
|
64
|
+
* <Alert className="border-green-200 bg-green-50 text-green-800 dark:border-green-800 dark:bg-green-950 dark:text-green-200">
|
|
65
|
+
* <CheckCircle className="size-4" />
|
|
66
|
+
* <AlertTitle>Success</AlertTitle>
|
|
67
|
+
* <AlertDescription>
|
|
68
|
+
* Your changes have been saved successfully.
|
|
69
|
+
* </AlertDescription>
|
|
70
|
+
* </Alert>
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```tsx
|
|
75
|
+
* // Alert without icon
|
|
76
|
+
* <Alert>
|
|
77
|
+
* <AlertTitle>Simple Notice</AlertTitle>
|
|
78
|
+
* <AlertDescription>
|
|
79
|
+
* This alert doesn't use an icon.
|
|
80
|
+
* </AlertDescription>
|
|
81
|
+
* </Alert>
|
|
82
|
+
* ```
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```tsx
|
|
86
|
+
* // Alert with only description
|
|
87
|
+
* <Alert variant="destructive">
|
|
88
|
+
* <AlertCircle className="size-4" />
|
|
89
|
+
* <AlertDescription>
|
|
90
|
+
* Something went wrong. Please try again.
|
|
91
|
+
* </AlertDescription>
|
|
92
|
+
* </Alert>
|
|
93
|
+
* ```
|
|
94
|
+
*
|
|
95
|
+
* @param variant - Visual style variant determining colors and emphasis
|
|
96
|
+
* @param className - Additional CSS classes to merge with default styles
|
|
97
|
+
* @param children - Alert content including optional icon, title, and description
|
|
98
|
+
* @param props - Additional HTML div element props
|
|
99
|
+
*
|
|
100
|
+
* @accessibility
|
|
101
|
+
* - Uses `role="alert"` for immediate screen reader announcements
|
|
102
|
+
* - Supports keyboard navigation when containing interactive elements
|
|
103
|
+
* - WCAG AA color contrast compliance for all variants
|
|
104
|
+
* - Semantic HTML structure with proper heading hierarchy
|
|
105
|
+
* - Icon support with automatic grid layout and accessible sizing
|
|
106
|
+
* - Icons receive `text-current` color for proper contrast inheritance
|
|
107
|
+
*
|
|
108
|
+
* @see {@link AlertTitle} - Alert title component for headings
|
|
109
|
+
* @see {@link AlertDescription} - Alert description component for body text
|
|
110
|
+
* @see {@link https://ui.shadcn.com/docs/components/alert} - shadcn/ui Alert documentation
|
|
111
|
+
* @see {@link https://www.w3.org/WAI/ARIA/apg/patterns/alert/} - ARIA alert pattern
|
|
112
|
+
* @since 1.0.0
|
|
113
|
+
*/
|
|
114
|
+
declare function Alert({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>): import("react/jsx-runtime").JSX.Element;
|
|
115
|
+
/**
|
|
116
|
+
* AlertTitle - The title/heading component for alerts
|
|
117
|
+
*
|
|
118
|
+
* Provides a prominent title or heading for the alert message. Automatically styled
|
|
119
|
+
* with medium font weight, line clamping, and proper grid positioning. Used to
|
|
120
|
+
* give context and immediate recognition of the alert's purpose.
|
|
121
|
+
*
|
|
122
|
+
* ## Features
|
|
123
|
+
* - Medium font weight for visual hierarchy
|
|
124
|
+
* - Single line with overflow handling (line-clamp-1)
|
|
125
|
+
* - Consistent minimum height for layout stability
|
|
126
|
+
* - Proper grid positioning (col-start-2) for icon layout
|
|
127
|
+
* - Tight character spacing (tracking-tight) for readability
|
|
128
|
+
*
|
|
129
|
+
* @component
|
|
130
|
+
* @example
|
|
131
|
+
* ```tsx
|
|
132
|
+
* <Alert>
|
|
133
|
+
* <Info className="size-4" />
|
|
134
|
+
* <AlertTitle>Payment Successful</AlertTitle>
|
|
135
|
+
* <AlertDescription>Your payment has been processed.</AlertDescription>
|
|
136
|
+
* </Alert>
|
|
137
|
+
* ```
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```tsx
|
|
141
|
+
* // Title-only alert (no description)
|
|
142
|
+
* <Alert variant="destructive">
|
|
143
|
+
* <AlertCircle className="size-4" />
|
|
144
|
+
* <AlertTitle>Connection Failed</AlertTitle>
|
|
145
|
+
* </Alert>
|
|
146
|
+
* ```
|
|
147
|
+
*
|
|
148
|
+
* @param className - Additional CSS classes to apply
|
|
149
|
+
* @param children - Title text content
|
|
150
|
+
*
|
|
151
|
+
* @accessibility
|
|
152
|
+
* - Semantically associated with the alert container via DOM structure
|
|
153
|
+
* - Proper visual hierarchy with medium font weight
|
|
154
|
+
* - Readable character spacing and line height
|
|
155
|
+
* - Works with screen readers as part of alert announcement
|
|
156
|
+
*
|
|
157
|
+
* @see {@link Alert} - Parent alert container component
|
|
158
|
+
* @see {@link AlertDescription} - Companion description component
|
|
159
|
+
* @since 1.0.0
|
|
160
|
+
*/
|
|
161
|
+
declare function AlertTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
162
|
+
/**
|
|
163
|
+
* AlertDescription - Detailed description text for an alert
|
|
164
|
+
*
|
|
165
|
+
* Provides additional context or instructions related to the alert.
|
|
166
|
+
* Supports multiple paragraphs and rich text content.
|
|
167
|
+
*
|
|
168
|
+
* @component
|
|
169
|
+
* @example
|
|
170
|
+
* ```tsx
|
|
171
|
+
* <Alert>
|
|
172
|
+
* <AlertTitle>Note</AlertTitle>
|
|
173
|
+
* <AlertDescription>
|
|
174
|
+
* Your changes have been saved. You can continue editing or publish when ready.
|
|
175
|
+
* </AlertDescription>
|
|
176
|
+
* </Alert>
|
|
177
|
+
* ```
|
|
178
|
+
*
|
|
179
|
+
* @accessibility
|
|
180
|
+
* - Uses appropriate text color for readability
|
|
181
|
+
* - Supports paragraph spacing for long content
|
|
182
|
+
*
|
|
183
|
+
* @since 1.0.0
|
|
184
|
+
*/
|
|
185
|
+
declare function AlertDescription({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
186
|
+
export { Alert, AlertTitle, AlertDescription };
|
|
187
|
+
//# sourceMappingURL=alert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../src/components/ui/alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,QAAA,MAAM,aAAa;;8EAclB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2GG;AACH,iBAAS,KAAK,CAAC,EACb,SAAS,EACT,OAAO,EACP,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,2CASlE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWvE;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAW7B;AAED,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
|
|
2
|
+
/**
|
|
3
|
+
* AspectRatio component for maintaining consistent width-to-height ratios
|
|
4
|
+
*
|
|
5
|
+
* A foundational layout component that preserves specific aspect ratios regardless
|
|
6
|
+
* of container size. Essential for responsive images, videos, and media content that
|
|
7
|
+
* needs consistent proportions across different screen sizes. Built on Radix UI
|
|
8
|
+
* primitives with zero JavaScript runtime overhead.
|
|
9
|
+
*
|
|
10
|
+
* This component creates a CSS-based aspect ratio container using the modern
|
|
11
|
+
* `aspect-ratio` property, ensuring content maintains its intended proportions
|
|
12
|
+
* without layout shifts or JavaScript calculations.
|
|
13
|
+
*
|
|
14
|
+
* @example Basic image with 16:9 aspect ratio
|
|
15
|
+
* ```tsx
|
|
16
|
+
* <div className="w-[450px]">
|
|
17
|
+
* <AspectRatio ratio={16 / 9}>
|
|
18
|
+
* <img
|
|
19
|
+
* src="landscape.jpg"
|
|
20
|
+
* alt="Beautiful landscape"
|
|
21
|
+
* className="w-full h-full object-cover rounded-md"
|
|
22
|
+
* />
|
|
23
|
+
* </AspectRatio>
|
|
24
|
+
* </div>
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @example Square avatar container (1:1 ratio)
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <AspectRatio ratio={1}>
|
|
30
|
+
* <img
|
|
31
|
+
* src="avatar.jpg"
|
|
32
|
+
* alt="User profile"
|
|
33
|
+
* className="w-full h-full object-cover rounded-full"
|
|
34
|
+
* />
|
|
35
|
+
* </AspectRatio>
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @example Video player container
|
|
39
|
+
* ```tsx
|
|
40
|
+
* <div className="w-full max-w-2xl">
|
|
41
|
+
* <AspectRatio ratio={16 / 9}>
|
|
42
|
+
* <video
|
|
43
|
+
* src="video.mp4"
|
|
44
|
+
* controls
|
|
45
|
+
* className="w-full h-full object-cover rounded-lg"
|
|
46
|
+
* />
|
|
47
|
+
* </AspectRatio>
|
|
48
|
+
* </div>
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @example Responsive image gallery with portrait orientation
|
|
52
|
+
* ```tsx
|
|
53
|
+
* <div className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
|
54
|
+
* {images.map((image) => (
|
|
55
|
+
* <AspectRatio key={image.id} ratio={3 / 4}>
|
|
56
|
+
* <img
|
|
57
|
+
* src={image.src}
|
|
58
|
+
* alt={image.alt}
|
|
59
|
+
* className="w-full h-full object-cover rounded-md"
|
|
60
|
+
* />
|
|
61
|
+
* </AspectRatio>
|
|
62
|
+
* ))}
|
|
63
|
+
* </div>
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* @example Placeholder content for loading states
|
|
67
|
+
* ```tsx
|
|
68
|
+
* <AspectRatio ratio={16 / 9}>
|
|
69
|
+
* <div className="flex items-center justify-center bg-muted border-2 border-dashed border-muted-foreground/25 rounded-md">
|
|
70
|
+
* <div className="text-center text-muted-foreground">
|
|
71
|
+
* <ImageIcon className="h-12 w-12 mx-auto mb-2" />
|
|
72
|
+
* <p className="text-sm">Loading image...</p>
|
|
73
|
+
* </div>
|
|
74
|
+
* </div>
|
|
75
|
+
* </AspectRatio>
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* @param ratio - The desired aspect ratio as width/height (e.g., 16/9, 4/3, 1)
|
|
79
|
+
* @param children - Content to be constrained within the aspect ratio
|
|
80
|
+
* @param className - Additional CSS classes for styling
|
|
81
|
+
*
|
|
82
|
+
* @accessibility
|
|
83
|
+
* - Inherits all accessibility features from Radix UI AspectRatio primitive
|
|
84
|
+
* - Preserves semantic meaning of child content
|
|
85
|
+
* - Does not interfere with screen reader navigation
|
|
86
|
+
* - Maintains keyboard navigation for interactive child elements
|
|
87
|
+
*
|
|
88
|
+
* @see {@link https://ui.shadcn.com/docs/components/aspect-ratio} shadcn/ui documentation
|
|
89
|
+
* @since 1.0.0
|
|
90
|
+
* @see {@link https://www.radix-ui.com/primitives/docs/components/aspect-ratio} Radix UI AspectRatio
|
|
91
|
+
*/
|
|
92
|
+
declare function AspectRatio({ ...props }: React.ComponentProps<typeof AspectRatioPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
93
|
+
export { AspectRatio };
|
|
94
|
+
//# sourceMappingURL=aspect-ratio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aspect-ratio.d.ts","sourceRoot":"","sources":["../../../src/components/ui/aspect-ratio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AACH,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,2CAExD;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|