@neynar/ui 0.2.1 → 0.3.0
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/dist/components/ui/button-group.d.ts +448 -0
- package/dist/components/ui/button-group.d.ts.map +1 -0
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/empty-state.d.ts +1 -0
- package/dist/components/ui/empty-state.d.ts.map +1 -1
- package/dist/components/ui/empty.d.ts +630 -0
- package/dist/components/ui/empty.d.ts.map +1 -0
- package/dist/components/ui/field.d.ts +238 -0
- package/dist/components/ui/field.d.ts.map +1 -0
- package/dist/components/ui/input-group.d.ts +636 -0
- package/dist/components/ui/input-group.d.ts.map +1 -0
- package/dist/components/ui/item.d.ts +766 -0
- package/dist/components/ui/item.d.ts.map +1 -0
- package/dist/components/ui/kbd.d.ts +149 -0
- package/dist/components/ui/kbd.d.ts.map +1 -0
- package/dist/components/ui/spinner.d.ts +194 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/stories/accordion.stories.d.ts +0 -1
- package/dist/components/ui/stories/accordion.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/alert-dialog.stories.d.ts +0 -1
- package/dist/components/ui/stories/alert-dialog.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/alert.stories.d.ts +0 -1
- package/dist/components/ui/stories/alert.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/aspect-ratio.stories.d.ts +0 -1
- package/dist/components/ui/stories/aspect-ratio.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/avatar.stories.d.ts +0 -1
- package/dist/components/ui/stories/avatar.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/badge.stories.d.ts +0 -1
- package/dist/components/ui/stories/badge.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/breadcrumb.stories.d.ts +0 -1
- package/dist/components/ui/stories/breadcrumb.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/button-group.stories.d.ts +48 -0
- package/dist/components/ui/stories/button-group.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/button.stories.d.ts +0 -1
- package/dist/components/ui/stories/button.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/calendar.stories.d.ts +0 -1
- package/dist/components/ui/stories/calendar.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/card.stories.d.ts +0 -1
- package/dist/components/ui/stories/card.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/carousel.stories.d.ts +0 -1
- package/dist/components/ui/stories/carousel.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/chart.stories.d.ts +0 -1
- package/dist/components/ui/stories/chart.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/checkbox.stories.d.ts +0 -1
- package/dist/components/ui/stories/checkbox.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/cn.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/collapsible.stories.d.ts +0 -1
- package/dist/components/ui/stories/collapsible.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/colors.stories.d.ts +0 -1
- package/dist/components/ui/stories/colors.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/combobox.stories.d.ts +0 -1
- package/dist/components/ui/stories/combobox.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/command.stories.d.ts +0 -1
- package/dist/components/ui/stories/command.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/container.stories.d.ts +0 -1
- package/dist/components/ui/stories/container.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/context-menu.stories.d.ts +0 -1
- package/dist/components/ui/stories/context-menu.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/date-picker.stories.d.ts +0 -1
- package/dist/components/ui/stories/date-picker.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/dialog.stories.d.ts +0 -1
- package/dist/components/ui/stories/dialog.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/drawer.stories.d.ts +0 -1
- package/dist/components/ui/stories/drawer.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/dropdown-menu.stories.d.ts +0 -1
- package/dist/components/ui/stories/dropdown-menu.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/empty-state.stories.d.ts +0 -1
- package/dist/components/ui/stories/empty-state.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/empty.stories.d.ts +38 -0
- package/dist/components/ui/stories/empty.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/field.stories.d.ts +48 -0
- package/dist/components/ui/stories/field.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/hover-card.stories.d.ts +0 -1
- package/dist/components/ui/stories/hover-card.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/input-group.stories.d.ts +37 -0
- package/dist/components/ui/stories/input-group.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/input.stories.d.ts +0 -1
- package/dist/components/ui/stories/input.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/item.stories.d.ts +61 -0
- package/dist/components/ui/stories/item.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/kbd.stories.d.ts +37 -0
- package/dist/components/ui/stories/kbd.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/label.stories.d.ts +0 -1
- package/dist/components/ui/stories/label.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/menubar.stories.d.ts +0 -1
- package/dist/components/ui/stories/menubar.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/navigation-menu.stories.d.ts +0 -1
- package/dist/components/ui/stories/navigation-menu.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/pagination.stories.d.ts +0 -1
- package/dist/components/ui/stories/pagination.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/popover.stories.d.ts +0 -1
- package/dist/components/ui/stories/popover.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/progress.stories.d.ts +0 -1
- package/dist/components/ui/stories/progress.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/radio-group.stories.d.ts +0 -1
- package/dist/components/ui/stories/radio-group.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/resizable.stories.d.ts +0 -1
- package/dist/components/ui/stories/resizable.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/scroll-area.stories.d.ts +0 -1
- package/dist/components/ui/stories/scroll-area.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/select.stories.d.ts +0 -1
- package/dist/components/ui/stories/select.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/separator.stories.d.ts +0 -1
- package/dist/components/ui/stories/separator.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/sheet.stories.d.ts +0 -1
- package/dist/components/ui/stories/sheet.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/sidebar.stories.d.ts +0 -1
- package/dist/components/ui/stories/sidebar.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/skeleton.stories.d.ts +0 -1
- package/dist/components/ui/stories/skeleton.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/slider.stories.d.ts +0 -1
- package/dist/components/ui/stories/slider.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/sonner.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/spinner.stories.d.ts +37 -0
- package/dist/components/ui/stories/spinner.stories.d.ts.map +1 -0
- package/dist/components/ui/stories/stack.stories.d.ts +0 -1
- package/dist/components/ui/stories/stack.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/switch.stories.d.ts +0 -1
- package/dist/components/ui/stories/switch.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/table.stories.d.ts +0 -1
- package/dist/components/ui/stories/table.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/tabs.stories.d.ts +0 -1
- package/dist/components/ui/stories/tabs.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/text-field.stories.d.ts +0 -1
- package/dist/components/ui/stories/text-field.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/textarea.stories.d.ts +0 -1
- package/dist/components/ui/stories/textarea.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/theme-toggle.stories.d.ts +0 -1
- package/dist/components/ui/stories/theme-toggle.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/theme.stories.d.ts +0 -1
- package/dist/components/ui/stories/theme.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/toggle-group.stories.d.ts +0 -1
- package/dist/components/ui/stories/toggle-group.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/toggle.stories.d.ts +0 -1
- package/dist/components/ui/stories/toggle.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/tooltip.stories.d.ts +0 -1
- package/dist/components/ui/stories/tooltip.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/typography.stories.d.ts +0 -1
- package/dist/components/ui/stories/typography.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/use-mobile.stories.d.ts.map +1 -1
- package/dist/components/ui/stories/use-theme.stories.d.ts.map +1 -1
- package/dist/components/ui/typography.d.ts +12 -11
- package/dist/components/ui/typography.d.ts.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10391 -3107
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/llm/components/display.md +125 -0
- package/docs/llm/components/feedback.md +0 -14
- package/docs/llm/components/forms.md +94 -0
- package/docs/llm/components/layout.md +169 -0
- package/llms.txt +18 -12
- package/package.json +6 -5
- package/src/components/ui/button-group.tsx +525 -0
- package/src/components/ui/button.tsx +9 -12
- package/src/components/ui/empty-state.tsx +1 -0
- package/src/components/ui/empty.tsx +793 -0
- package/src/components/ui/field.tsx +494 -0
- package/src/components/ui/input-group.tsx +801 -0
- package/src/components/ui/item.tsx +955 -0
- package/src/components/ui/kbd.tsx +175 -0
- package/src/components/ui/skeleton.tsx +1 -1
- package/src/components/ui/spinner.tsx +211 -0
- package/src/components/ui/stories/accordion.stories.tsx +0 -1
- package/src/components/ui/stories/alert-dialog.stories.tsx +0 -1
- package/src/components/ui/stories/alert.stories.tsx +0 -1
- package/src/components/ui/stories/aspect-ratio.stories.tsx +0 -1
- package/src/components/ui/stories/avatar.stories.tsx +0 -1
- package/src/components/ui/stories/badge.stories.tsx +0 -1
- package/src/components/ui/stories/breadcrumb.stories.tsx +0 -1
- package/src/components/ui/stories/button-group.stories.tsx +300 -0
- package/src/components/ui/stories/button.stories.tsx +0 -1
- package/src/components/ui/stories/calendar.stories.tsx +0 -1
- package/src/components/ui/stories/card.stories.tsx +0 -1
- package/src/components/ui/stories/carousel.stories.tsx +0 -1
- package/src/components/ui/stories/chart.stories.tsx +0 -1
- package/src/components/ui/stories/checkbox.stories.tsx +0 -1
- package/src/components/ui/stories/cn.stories.tsx +0 -1
- package/src/components/ui/stories/collapsible.stories.tsx +0 -1
- package/src/components/ui/stories/colors.stories.tsx +0 -1
- package/src/components/ui/stories/combobox.stories.tsx +0 -1
- package/src/components/ui/stories/command.stories.tsx +0 -1
- package/src/components/ui/stories/container.stories.tsx +0 -1
- package/src/components/ui/stories/context-menu.stories.tsx +0 -1
- package/src/components/ui/stories/date-picker.stories.tsx +0 -1
- package/src/components/ui/stories/dialog.stories.tsx +0 -1
- package/src/components/ui/stories/drawer.stories.tsx +0 -1
- package/src/components/ui/stories/dropdown-menu.stories.tsx +0 -1
- package/src/components/ui/stories/empty-state.stories.tsx +0 -1
- package/src/components/ui/stories/empty.stories.tsx +293 -0
- package/src/components/ui/stories/field.stories.tsx +470 -0
- package/src/components/ui/stories/hover-card.stories.tsx +0 -1
- package/src/components/ui/stories/input-group.stories.tsx +444 -0
- package/src/components/ui/stories/input.stories.tsx +0 -1
- package/src/components/ui/stories/item.stories.tsx +601 -0
- package/src/components/ui/stories/kbd.stories.tsx +462 -0
- package/src/components/ui/stories/label.stories.tsx +0 -1
- package/src/components/ui/stories/menubar.stories.tsx +0 -1
- package/src/components/ui/stories/navigation-menu.stories.tsx +0 -1
- package/src/components/ui/stories/pagination.stories.tsx +0 -1
- package/src/components/ui/stories/popover.stories.tsx +0 -1
- package/src/components/ui/stories/progress.stories.tsx +0 -1
- package/src/components/ui/stories/radio-group.stories.tsx +0 -1
- package/src/components/ui/stories/resizable.stories.tsx +0 -1
- package/src/components/ui/stories/scroll-area.stories.tsx +0 -1
- package/src/components/ui/stories/select.stories.tsx +0 -1
- package/src/components/ui/stories/separator.stories.tsx +0 -1
- package/src/components/ui/stories/sheet.stories.tsx +0 -1
- package/src/components/ui/stories/sidebar.stories.tsx +0 -1
- package/src/components/ui/stories/skeleton.stories.tsx +0 -1
- package/src/components/ui/stories/slider.stories.tsx +0 -1
- package/src/components/ui/stories/sonner.stories.tsx +0 -1
- package/src/components/ui/stories/spinner.stories.tsx +356 -0
- package/src/components/ui/stories/stack.stories.tsx +0 -1
- package/src/components/ui/stories/switch.stories.tsx +0 -1
- package/src/components/ui/stories/table.stories.tsx +0 -1
- package/src/components/ui/stories/tabs.stories.tsx +0 -1
- package/src/components/ui/stories/text-field.stories.tsx +0 -1
- package/src/components/ui/stories/textarea.stories.tsx +0 -1
- package/src/components/ui/stories/theme-toggle.stories.tsx +0 -1
- package/src/components/ui/stories/theme.stories.tsx +0 -1
- package/src/components/ui/stories/toggle-group.stories.tsx +0 -1
- package/src/components/ui/stories/toggle.stories.tsx +0 -1
- package/src/components/ui/stories/tooltip.stories.tsx +0 -1
- package/src/components/ui/stories/typography.stories.tsx +5 -2
- package/src/components/ui/stories/use-mobile.stories.tsx +0 -1
- package/src/components/ui/stories/use-theme.stories.tsx +0 -1
- package/src/components/ui/tabs.tsx +1 -1
- package/src/components/ui/typography.tsx +29 -129
- package/src/index.ts +7 -0
- package/src/styles/globals.css +40 -24
- package/llm-docs/a.llm.md +0 -145
- package/llm-docs/accordion-content.llm.md +0 -67
- package/llm-docs/accordion-item.llm.md +0 -61
- package/llm-docs/accordion-trigger.llm.md +0 -69
- package/llm-docs/accordion.llm.md +0 -88
- package/llm-docs/alert-description.llm.md +0 -78
- package/llm-docs/alert-dialog-action.llm.md +0 -51
- package/llm-docs/alert-dialog-cancel.llm.md +0 -48
- package/llm-docs/alert-dialog-content.llm.md +0 -88
- package/llm-docs/alert-dialog-description.llm.md +0 -53
- package/llm-docs/alert-dialog-footer.llm.md +0 -41
- package/llm-docs/alert-dialog-header.llm.md +0 -39
- package/llm-docs/alert-dialog-overlay.llm.md +0 -44
- package/llm-docs/alert-dialog-portal.llm.md +0 -41
- package/llm-docs/alert-dialog-title.llm.md +0 -46
- package/llm-docs/alert-dialog-trigger.llm.md +0 -40
- package/llm-docs/alert-dialog.llm.md +0 -80
- package/llm-docs/alert-title.llm.md +0 -48
- package/llm-docs/alert.llm.md +0 -92
- package/llm-docs/aspect-ratio.llm.md +0 -41
- package/llm-docs/avatar-fallback.llm.md +0 -41
- package/llm-docs/avatar-image.llm.md +0 -48
- package/llm-docs/avatar.llm.md +0 -35
- package/llm-docs/badge.llm.md +0 -122
- package/llm-docs/blockquote.llm.md +0 -122
- package/llm-docs/breadcrumb-ellipsis.llm.md +0 -73
- package/llm-docs/breadcrumb-item.llm.md +0 -53
- package/llm-docs/breadcrumb-link.llm.md +0 -84
- package/llm-docs/breadcrumb-list.llm.md +0 -54
- package/llm-docs/breadcrumb-page.llm.md +0 -52
- package/llm-docs/breadcrumb-separator.llm.md +0 -60
- package/llm-docs/breadcrumb.llm.md +0 -110
- package/llm-docs/button.llm.md +0 -281
- package/llm-docs/calendar-day-button.llm.md +0 -57
- package/llm-docs/calendar.llm.md +0 -340
- package/llm-docs/card-action.llm.md +0 -64
- package/llm-docs/card-content.llm.md +0 -48
- package/llm-docs/card-description.llm.md +0 -46
- package/llm-docs/card-footer.llm.md +0 -56
- package/llm-docs/card-header.llm.md +0 -53
- package/llm-docs/card-title.llm.md +0 -43
- package/llm-docs/card.llm.md +0 -100
- package/llm-docs/carousel-content.llm.md +0 -77
- package/llm-docs/carousel-item.llm.md +0 -96
- package/llm-docs/carousel-next.llm.md +0 -95
- package/llm-docs/carousel-previous.llm.md +0 -95
- package/llm-docs/carousel.llm.md +0 -211
- package/llm-docs/chart-config.llm.md +0 -71
- package/llm-docs/chart-container.llm.md +0 -148
- package/llm-docs/chart-legend-content.llm.md +0 -85
- package/llm-docs/chart-legend.llm.md +0 -144
- package/llm-docs/chart-style.llm.md +0 -28
- package/llm-docs/chart-tooltip-content.llm.md +0 -149
- package/llm-docs/chart-tooltip.llm.md +0 -184
- package/llm-docs/checkbox.llm.md +0 -100
- package/llm-docs/cn.llm.md +0 -46
- package/llm-docs/code.llm.md +0 -108
- package/llm-docs/collapsible-content.llm.md +0 -109
- package/llm-docs/collapsible-trigger.llm.md +0 -75
- package/llm-docs/collapsible.llm.md +0 -109
- package/llm-docs/combobox-option.llm.md +0 -53
- package/llm-docs/combobox.llm.md +0 -208
- package/llm-docs/command-dialog.llm.md +0 -112
- package/llm-docs/command-empty.llm.md +0 -63
- package/llm-docs/command-group.llm.md +0 -83
- package/llm-docs/command-input.llm.md +0 -82
- package/llm-docs/command-item.llm.md +0 -97
- package/llm-docs/command-list.llm.md +0 -53
- package/llm-docs/command-loading.llm.md +0 -48
- package/llm-docs/command-separator.llm.md +0 -44
- package/llm-docs/command-shortcut.llm.md +0 -63
- package/llm-docs/command.llm.md +0 -147
- package/llm-docs/container.llm.md +0 -236
- package/llm-docs/context-menu-checkbox-item.llm.md +0 -97
- package/llm-docs/context-menu-content.llm.md +0 -91
- package/llm-docs/context-menu-group.llm.md +0 -61
- package/llm-docs/context-menu-item.llm.md +0 -94
- package/llm-docs/context-menu-label.llm.md +0 -60
- package/llm-docs/context-menu-portal.llm.md +0 -49
- package/llm-docs/context-menu-radio-group.llm.md +0 -66
- package/llm-docs/context-menu-radio-item.llm.md +0 -76
- package/llm-docs/context-menu-separator.llm.md +0 -51
- package/llm-docs/context-menu-shortcut.llm.md +0 -57
- package/llm-docs/context-menu-sub-content.llm.md +0 -90
- package/llm-docs/context-menu-sub-trigger.llm.md +0 -73
- package/llm-docs/context-menu-sub.llm.md +0 -61
- package/llm-docs/context-menu-trigger.llm.md +0 -53
- package/llm-docs/context-menu.llm.md +0 -103
- package/llm-docs/date-picker.llm.md +0 -90
- package/llm-docs/dialog-close.llm.md +0 -61
- package/llm-docs/dialog-content.llm.md +0 -128
- package/llm-docs/dialog-description.llm.md +0 -44
- package/llm-docs/dialog-footer.llm.md +0 -38
- package/llm-docs/dialog-header.llm.md +0 -40
- package/llm-docs/dialog-overlay.llm.md +0 -57
- package/llm-docs/dialog-portal.llm.md +0 -47
- package/llm-docs/dialog-title.llm.md +0 -41
- package/llm-docs/dialog-trigger.llm.md +0 -51
- package/llm-docs/dialog.llm.md +0 -113
- package/llm-docs/drawer-close.llm.md +0 -53
- package/llm-docs/drawer-content.llm.md +0 -58
- package/llm-docs/drawer-description.llm.md +0 -54
- package/llm-docs/drawer-footer.llm.md +0 -67
- package/llm-docs/drawer-header.llm.md +0 -60
- package/llm-docs/drawer-overlay.llm.md +0 -40
- package/llm-docs/drawer-portal.llm.md +0 -42
- package/llm-docs/drawer-title.llm.md +0 -51
- package/llm-docs/drawer-trigger.llm.md +0 -44
- package/llm-docs/drawer.llm.md +0 -194
- package/llm-docs/dropdown-menu-checkbox-item.llm.md +0 -111
- package/llm-docs/dropdown-menu-content.llm.md +0 -109
- package/llm-docs/dropdown-menu-group.llm.md +0 -38
- package/llm-docs/dropdown-menu-item.llm.md +0 -94
- package/llm-docs/dropdown-menu-label.llm.md +0 -66
- package/llm-docs/dropdown-menu-portal.llm.md +0 -32
- package/llm-docs/dropdown-menu-radio-group.llm.md +0 -73
- package/llm-docs/dropdown-menu-radio-item.llm.md +0 -92
- package/llm-docs/dropdown-menu-separator.llm.md +0 -55
- package/llm-docs/dropdown-menu-shortcut.llm.md +0 -74
- package/llm-docs/dropdown-menu-sub-content.llm.md +0 -80
- package/llm-docs/dropdown-menu-sub-trigger.llm.md +0 -84
- package/llm-docs/dropdown-menu-sub.llm.md +0 -74
- package/llm-docs/dropdown-menu-trigger.llm.md +0 -48
- package/llm-docs/dropdown-menu.llm.md +0 -120
- package/llm-docs/empty-state.llm.md +0 -174
- package/llm-docs/h1.llm.md +0 -113
- package/llm-docs/h2.llm.md +0 -113
- package/llm-docs/h3.llm.md +0 -111
- package/llm-docs/h4.llm.md +0 -109
- package/llm-docs/h5.llm.md +0 -110
- package/llm-docs/h6.llm.md +0 -110
- package/llm-docs/hover-card-content.llm.md +0 -167
- package/llm-docs/hover-card-trigger.llm.md +0 -65
- package/llm-docs/hover-card.llm.md +0 -121
- package/llm-docs/input.llm.md +0 -319
- package/llm-docs/label.llm.md +0 -145
- package/llm-docs/lead.llm.md +0 -119
- package/llm-docs/menubar-checkbox-item.llm.md +0 -66
- package/llm-docs/menubar-content.llm.md +0 -128
- package/llm-docs/menubar-group.llm.md +0 -40
- package/llm-docs/menubar-item.llm.md +0 -62
- package/llm-docs/menubar-label.llm.md +0 -40
- package/llm-docs/menubar-menu.llm.md +0 -32
- package/llm-docs/menubar-portal.llm.md +0 -38
- package/llm-docs/menubar-radio-group.llm.md +0 -39
- package/llm-docs/menubar-radio-item.llm.md +0 -59
- package/llm-docs/menubar-separator.llm.md +0 -35
- package/llm-docs/menubar-shortcut.llm.md +0 -37
- package/llm-docs/menubar-sub-content.llm.md +0 -127
- package/llm-docs/menubar-sub-trigger.llm.md +0 -51
- package/llm-docs/menubar-sub.llm.md +0 -53
- package/llm-docs/menubar-trigger.llm.md +0 -37
- package/llm-docs/menubar.llm.md +0 -115
- package/llm-docs/navigation-menu-content.llm.md +0 -116
- package/llm-docs/navigation-menu-indicator.llm.md +0 -68
- package/llm-docs/navigation-menu-item.llm.md +0 -62
- package/llm-docs/navigation-menu-link.llm.md +0 -109
- package/llm-docs/navigation-menu-list.llm.md +0 -52
- package/llm-docs/navigation-menu-trigger-style.llm.md +0 -22
- package/llm-docs/navigation-menu-trigger.llm.md +0 -57
- package/llm-docs/navigation-menu-viewport.llm.md +0 -51
- package/llm-docs/navigation-menu.llm.md +0 -184
- package/llm-docs/p.llm.md +0 -115
- package/llm-docs/pagination-content.llm.md +0 -60
- package/llm-docs/pagination-ellipsis.llm.md +0 -107
- package/llm-docs/pagination-item.llm.md +0 -59
- package/llm-docs/pagination-link.llm.md +0 -150
- package/llm-docs/pagination-next.llm.md +0 -115
- package/llm-docs/pagination-previous.llm.md +0 -115
- package/llm-docs/pagination.llm.md +0 -190
- package/llm-docs/popover-anchor.llm.md +0 -53
- package/llm-docs/popover-content.llm.md +0 -109
- package/llm-docs/popover-trigger.llm.md +0 -54
- package/llm-docs/popover.llm.md +0 -116
- package/llm-docs/progress.llm.md +0 -76
- package/llm-docs/radio-group-indicator.llm.md +0 -28
- package/llm-docs/radio-group-item.llm.md +0 -40
- package/llm-docs/radio-group.llm.md +0 -76
- package/llm-docs/resizable-handle.llm.md +0 -156
- package/llm-docs/resizable-panel-group.llm.md +0 -149
- package/llm-docs/resizable-panel.llm.md +0 -157
- package/llm-docs/scroll-area-corner.llm.md +0 -41
- package/llm-docs/scroll-area-thumb.llm.md +0 -39
- package/llm-docs/scroll-area-viewport.llm.md +0 -60
- package/llm-docs/scroll-area.llm.md +0 -125
- package/llm-docs/scroll-bar.llm.md +0 -78
- package/llm-docs/sdk-items-registry.json +0 -2638
- package/llm-docs/select-content.llm.md +0 -139
- package/llm-docs/select-group.llm.md +0 -60
- package/llm-docs/select-item.llm.md +0 -75
- package/llm-docs/select-label.llm.md +0 -62
- package/llm-docs/select-scroll-down-button.llm.md +0 -45
- package/llm-docs/select-scroll-up-button.llm.md +0 -45
- package/llm-docs/select-separator.llm.md +0 -59
- package/llm-docs/select-trigger.llm.md +0 -66
- package/llm-docs/select-value.llm.md +0 -67
- package/llm-docs/select.llm.md +0 -159
- package/llm-docs/separator.llm.md +0 -129
- package/llm-docs/sheet-close.llm.md +0 -49
- package/llm-docs/sheet-content.llm.md +0 -115
- package/llm-docs/sheet-description.llm.md +0 -62
- package/llm-docs/sheet-footer.llm.md +0 -64
- package/llm-docs/sheet-header.llm.md +0 -52
- package/llm-docs/sheet-title.llm.md +0 -53
- package/llm-docs/sheet-trigger.llm.md +0 -46
- package/llm-docs/sheet.llm.md +0 -126
- package/llm-docs/sidebar-content.llm.md +0 -63
- package/llm-docs/sidebar-footer.llm.md +0 -50
- package/llm-docs/sidebar-group-action.llm.md +0 -60
- package/llm-docs/sidebar-group-content.llm.md +0 -64
- package/llm-docs/sidebar-group-label.llm.md +0 -53
- package/llm-docs/sidebar-group.llm.md +0 -56
- package/llm-docs/sidebar-header.llm.md +0 -67
- package/llm-docs/sidebar-input.llm.md +0 -50
- package/llm-docs/sidebar-inset.llm.md +0 -52
- package/llm-docs/sidebar-menu-action.llm.md +0 -84
- package/llm-docs/sidebar-menu-badge.llm.md +0 -60
- package/llm-docs/sidebar-menu-button.llm.md +0 -103
- package/llm-docs/sidebar-menu-item.llm.md +0 -75
- package/llm-docs/sidebar-menu-skeleton.llm.md +0 -76
- package/llm-docs/sidebar-menu-sub-button.llm.md +0 -85
- package/llm-docs/sidebar-menu-sub-item.llm.md +0 -54
- package/llm-docs/sidebar-menu-sub.llm.md +0 -74
- package/llm-docs/sidebar-menu.llm.md +0 -65
- package/llm-docs/sidebar-provider.llm.md +0 -79
- package/llm-docs/sidebar-rail.llm.md +0 -34
- package/llm-docs/sidebar-separator.llm.md +0 -57
- package/llm-docs/sidebar-trigger.llm.md +0 -49
- package/llm-docs/sidebar.llm.md +0 -129
- package/llm-docs/skeleton.llm.md +0 -134
- package/llm-docs/slider.llm.md +0 -173
- package/llm-docs/small.llm.md +0 -115
- package/llm-docs/span.llm.md +0 -132
- package/llm-docs/stack.llm.md +0 -28
- package/llm-docs/strong.llm.md +0 -115
- package/llm-docs/switch.llm.md +0 -76
- package/llm-docs/table-body.llm.md +0 -36
- package/llm-docs/table-caption.llm.md +0 -48
- package/llm-docs/table-cell.llm.md +0 -53
- package/llm-docs/table-footer.llm.md +0 -41
- package/llm-docs/table-head.llm.md +0 -69
- package/llm-docs/table-header.llm.md +0 -41
- package/llm-docs/table-row.llm.md +0 -42
- package/llm-docs/table.llm.md +0 -123
- package/llm-docs/tabs-content.llm.md +0 -47
- package/llm-docs/tabs-list.llm.md +0 -41
- package/llm-docs/tabs-trigger.llm.md +0 -47
- package/llm-docs/tabs.llm.md +0 -71
- package/llm-docs/text-field.llm.md +0 -327
- package/llm-docs/textarea.llm.md +0 -311
- package/llm-docs/theme-preference.llm.md +0 -25
- package/llm-docs/theme-toggle.llm.md +0 -57
- package/llm-docs/theme.llm.md +0 -14
- package/llm-docs/toast.llm.md +0 -32
- package/llm-docs/toaster.llm.md +0 -193
- package/llm-docs/toggle-group-item.llm.md +0 -59
- package/llm-docs/toggle-group.llm.md +0 -101
- package/llm-docs/toggle.llm.md +0 -40
- package/llm-docs/tooltip-content.llm.md +0 -185
- package/llm-docs/tooltip-provider.llm.md +0 -68
- package/llm-docs/tooltip-trigger.llm.md +0 -70
- package/llm-docs/tooltip.llm.md +0 -129
- package/llm-docs/typography.llm.md +0 -175
- package/llm-docs/use-carousel.llm.md +0 -55
- package/llm-docs/use-command-state.llm.md +0 -32
- package/llm-docs/use-is-mobile.llm.md +0 -73
- package/llm-docs/use-sidebar.llm.md +0 -61
|
@@ -0,0 +1,801 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
import { Button } from "@/components/ui/button"
|
|
8
|
+
import { Input } from "@/components/ui/input"
|
|
9
|
+
import { Textarea } from "@/components/ui/textarea"
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Props for InputGroup component (Documentation only - NOT used in component implementation)
|
|
13
|
+
* These types are for documentation generation and should not replace inferred types
|
|
14
|
+
*/
|
|
15
|
+
type InputGroupDocsProps = {
|
|
16
|
+
/** Additional CSS classes for custom styling */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Child components (InputGroupInput, InputGroupTextarea, InputGroupAddon) */
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
/** Mark the entire input group as disabled with data-disabled="true" */
|
|
21
|
+
"data-disabled"?: "true" | "false";
|
|
22
|
+
} & Omit<React.HTMLAttributes<HTMLDivElement>, "children">;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* InputGroup - Container for inputs with integrated addons, buttons, and text
|
|
26
|
+
*
|
|
27
|
+
* A flexible container component that combines text inputs or textareas with decorative
|
|
28
|
+
* or functional elements like icons, buttons, labels, and keyboard shortcuts. Supports
|
|
29
|
+
* both inline (left/right) and block (top/bottom) addon positioning for diverse layout
|
|
30
|
+
* needs. Provides unified focus states, error handling, and disabled states across all
|
|
31
|
+
* child elements.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* // Search input with icon and keyboard shortcut
|
|
36
|
+
* <InputGroup>
|
|
37
|
+
* <InputGroupAddon align="inline-start">
|
|
38
|
+
* <Search className="size-4" />
|
|
39
|
+
* </InputGroupAddon>
|
|
40
|
+
* <InputGroupInput placeholder="Search..." />
|
|
41
|
+
* <InputGroupAddon align="inline-end">
|
|
42
|
+
* <Kbd>⌘K</Kbd>
|
|
43
|
+
* </InputGroupAddon>
|
|
44
|
+
* </InputGroup>
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```tsx
|
|
49
|
+
* // Email subscription form with submit button
|
|
50
|
+
* <InputGroup>
|
|
51
|
+
* <InputGroupAddon align="inline-start">
|
|
52
|
+
* <Mail className="size-4" />
|
|
53
|
+
* </InputGroupAddon>
|
|
54
|
+
* <InputGroupInput type="email" placeholder="Enter your email" />
|
|
55
|
+
* <InputGroupAddon align="inline-end">
|
|
56
|
+
* <InputGroupButton size="sm">Subscribe</InputGroupButton>
|
|
57
|
+
* </InputGroupAddon>
|
|
58
|
+
* </InputGroup>
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```tsx
|
|
63
|
+
* // Price input with currency indicators
|
|
64
|
+
* <InputGroup>
|
|
65
|
+
* <InputGroupAddon align="inline-start">
|
|
66
|
+
* <DollarSign className="size-4" />
|
|
67
|
+
* </InputGroupAddon>
|
|
68
|
+
* <InputGroupInput type="number" placeholder="0.00" />
|
|
69
|
+
* <InputGroupAddon align="inline-end">
|
|
70
|
+
* <InputGroupText>USD</InputGroupText>
|
|
71
|
+
* </InputGroupAddon>
|
|
72
|
+
* </InputGroup>
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```tsx
|
|
77
|
+
* // Comment textarea with block addons
|
|
78
|
+
* <InputGroup>
|
|
79
|
+
* <InputGroupAddon align="block-start">
|
|
80
|
+
* <InputGroupText>Your Comment</InputGroupText>
|
|
81
|
+
* </InputGroupAddon>
|
|
82
|
+
* <InputGroupTextarea placeholder="Write your comment..." rows={4} />
|
|
83
|
+
* <InputGroupAddon align="block-end">
|
|
84
|
+
* <InputGroupButton size="sm">
|
|
85
|
+
* <Send className="size-4" />
|
|
86
|
+
* Post
|
|
87
|
+
* </InputGroupButton>
|
|
88
|
+
* </InputGroupAddon>
|
|
89
|
+
* </InputGroup>
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```tsx
|
|
94
|
+
* // Error state with aria-invalid
|
|
95
|
+
* <InputGroup>
|
|
96
|
+
* <InputGroupAddon align="inline-start">
|
|
97
|
+
* <Mail className="size-4" />
|
|
98
|
+
* </InputGroupAddon>
|
|
99
|
+
* <InputGroupInput
|
|
100
|
+
* type="email"
|
|
101
|
+
* placeholder="Email"
|
|
102
|
+
* aria-invalid="true"
|
|
103
|
+
* defaultValue="invalid-email"
|
|
104
|
+
* />
|
|
105
|
+
* </InputGroup>
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* @accessibility
|
|
109
|
+
* - Container uses role="group" to associate related form elements
|
|
110
|
+
* - Focus states are unified across the input and all addons with visible ring
|
|
111
|
+
* - Error states automatically style container with destructive colors when aria-invalid="true"
|
|
112
|
+
* - Disabled state propagates to all children via data-disabled attribute
|
|
113
|
+
* - Click on addons automatically focuses the input for better UX
|
|
114
|
+
* - Keyboard navigation works naturally with native input focus behavior
|
|
115
|
+
*
|
|
116
|
+
* @see {@link InputGroupInput} Text input element within the group
|
|
117
|
+
* @see {@link InputGroupTextarea} Textarea element within the group
|
|
118
|
+
* @see {@link InputGroupAddon} Container for icons, text, buttons, or labels
|
|
119
|
+
* @see {@link InputGroupButton} Action button within an addon
|
|
120
|
+
* @see {@link InputGroupText} Static text or labels within an addon
|
|
121
|
+
* @since 1.0.0
|
|
122
|
+
*/
|
|
123
|
+
function InputGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
124
|
+
return (
|
|
125
|
+
<div
|
|
126
|
+
data-slot="input-group"
|
|
127
|
+
role="group"
|
|
128
|
+
className={cn(
|
|
129
|
+
"group/input-group border-input dark:bg-input/30 relative flex w-full items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none",
|
|
130
|
+
"h-9 min-w-0 has-[>textarea]:h-auto",
|
|
131
|
+
|
|
132
|
+
// Variants based on alignment.
|
|
133
|
+
"has-[>[data-align=inline-start]]:[&>input]:pl-2",
|
|
134
|
+
"has-[>[data-align=inline-end]]:[&>input]:pr-2",
|
|
135
|
+
"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3",
|
|
136
|
+
"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
|
|
137
|
+
|
|
138
|
+
// Focus state.
|
|
139
|
+
"has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]",
|
|
140
|
+
|
|
141
|
+
// Error state.
|
|
142
|
+
"has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",
|
|
143
|
+
|
|
144
|
+
className
|
|
145
|
+
)}
|
|
146
|
+
{...props}
|
|
147
|
+
/>
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* InputGroupAddon variant configuration for positioning addons around inputs
|
|
153
|
+
* @variant inline-start - Position addon to the left of the input (default)
|
|
154
|
+
* @variant inline-end - Position addon to the right of the input
|
|
155
|
+
* @variant block-start - Position addon above the input (full width)
|
|
156
|
+
* @variant block-end - Position addon below the input (full width)
|
|
157
|
+
*/
|
|
158
|
+
const inputGroupAddonVariants = cva(
|
|
159
|
+
"text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50",
|
|
160
|
+
{
|
|
161
|
+
variants: {
|
|
162
|
+
align: {
|
|
163
|
+
"inline-start":
|
|
164
|
+
"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
|
|
165
|
+
"inline-end":
|
|
166
|
+
"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
|
|
167
|
+
"block-start":
|
|
168
|
+
"order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5",
|
|
169
|
+
"block-end":
|
|
170
|
+
"order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5",
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
defaultVariants: {
|
|
174
|
+
align: "inline-start",
|
|
175
|
+
},
|
|
176
|
+
}
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Props for InputGroupAddon component (Documentation only - NOT used in component implementation)
|
|
181
|
+
* These types are for documentation generation and should not replace CVA inferred types
|
|
182
|
+
*/
|
|
183
|
+
type InputGroupAddonDocsProps = {
|
|
184
|
+
/** Position of the addon relative to the input element @default "inline-start" */
|
|
185
|
+
align?: "inline-start" | "inline-end" | "block-start" | "block-end";
|
|
186
|
+
/** Additional CSS classes for custom styling */
|
|
187
|
+
className?: string;
|
|
188
|
+
/** Child content (InputGroupText, InputGroupButton, icons, Kbd, etc.) */
|
|
189
|
+
children?: React.ReactNode;
|
|
190
|
+
} & Omit<React.HTMLAttributes<HTMLDivElement>, "children">;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* InputGroupAddon - Container for icons, buttons, text, or labels within an InputGroup
|
|
194
|
+
*
|
|
195
|
+
* A flexible addon container that can be positioned at any edge of the input (left, right,
|
|
196
|
+
* top, or bottom). Automatically adjusts layout and spacing based on alignment. Clicking
|
|
197
|
+
* the addon area focuses the associated input for improved usability. Supports icons,
|
|
198
|
+
* static text, buttons, keyboard shortcuts (Kbd), and custom content.
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* ```tsx
|
|
202
|
+
* // Icon addon on the left (inline-start)
|
|
203
|
+
* <InputGroup>
|
|
204
|
+
* <InputGroupAddon align="inline-start">
|
|
205
|
+
* <Search className="size-4" />
|
|
206
|
+
* </InputGroupAddon>
|
|
207
|
+
* <InputGroupInput placeholder="Search..." />
|
|
208
|
+
* </InputGroup>
|
|
209
|
+
* ```
|
|
210
|
+
*
|
|
211
|
+
* @example
|
|
212
|
+
* ```tsx
|
|
213
|
+
* // Text suffix on the right (inline-end)
|
|
214
|
+
* <InputGroup>
|
|
215
|
+
* <InputGroupInput placeholder="Enter amount" />
|
|
216
|
+
* <InputGroupAddon align="inline-end">
|
|
217
|
+
* <InputGroupText>USD</InputGroupText>
|
|
218
|
+
* </InputGroupAddon>
|
|
219
|
+
* </InputGroup>
|
|
220
|
+
* ```
|
|
221
|
+
*
|
|
222
|
+
* @example
|
|
223
|
+
* ```tsx
|
|
224
|
+
* // Button addon for action
|
|
225
|
+
* <InputGroup>
|
|
226
|
+
* <InputGroupInput placeholder="Enter coupon code" />
|
|
227
|
+
* <InputGroupAddon align="inline-end">
|
|
228
|
+
* <InputGroupButton size="sm">Apply</InputGroupButton>
|
|
229
|
+
* </InputGroupAddon>
|
|
230
|
+
* </InputGroup>
|
|
231
|
+
* ```
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* ```tsx
|
|
235
|
+
* // Keyboard shortcut indicator
|
|
236
|
+
* <InputGroup>
|
|
237
|
+
* <InputGroupInput placeholder="Quick search" />
|
|
238
|
+
* <InputGroupAddon align="inline-end">
|
|
239
|
+
* <Kbd>⌘K</Kbd>
|
|
240
|
+
* </InputGroupAddon>
|
|
241
|
+
* </InputGroup>
|
|
242
|
+
* ```
|
|
243
|
+
*
|
|
244
|
+
* @example
|
|
245
|
+
* ```tsx
|
|
246
|
+
* // Block addon with multiple elements (top position)
|
|
247
|
+
* <InputGroup>
|
|
248
|
+
* <InputGroupAddon align="block-start">
|
|
249
|
+
* <InputGroupText>Message</InputGroupText>
|
|
250
|
+
* <InputGroupButton size="icon-xs">
|
|
251
|
+
* <X className="size-4" />
|
|
252
|
+
* </InputGroupButton>
|
|
253
|
+
* </InputGroupAddon>
|
|
254
|
+
* <InputGroupTextarea placeholder="Type your message..." />
|
|
255
|
+
* </InputGroup>
|
|
256
|
+
* ```
|
|
257
|
+
*
|
|
258
|
+
* @accessibility
|
|
259
|
+
* - Uses role="group" to semantically group addon content
|
|
260
|
+
* - Clicking addon focuses the input (unless clicking a button)
|
|
261
|
+
* - Icons automatically sized with [&>svg:not([class*='size-'])]:size-4
|
|
262
|
+
* - Respects disabled state from parent InputGroup
|
|
263
|
+
* - Keyboard shortcuts (Kbd) properly styled and positioned
|
|
264
|
+
*
|
|
265
|
+
* @see {@link InputGroupText} For static text within the addon
|
|
266
|
+
* @see {@link InputGroupButton} For action buttons within the addon
|
|
267
|
+
* @since 1.0.0
|
|
268
|
+
*/
|
|
269
|
+
function InputGroupAddon({
|
|
270
|
+
className,
|
|
271
|
+
align = "inline-start",
|
|
272
|
+
...props
|
|
273
|
+
}: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>) {
|
|
274
|
+
return (
|
|
275
|
+
<div
|
|
276
|
+
role="group"
|
|
277
|
+
data-slot="input-group-addon"
|
|
278
|
+
data-align={align}
|
|
279
|
+
className={cn(inputGroupAddonVariants({ align }), className)}
|
|
280
|
+
onClick={(e) => {
|
|
281
|
+
if ((e.target as HTMLElement).closest("button")) {
|
|
282
|
+
return
|
|
283
|
+
}
|
|
284
|
+
e.currentTarget.parentElement?.querySelector("input")?.focus()
|
|
285
|
+
}}
|
|
286
|
+
{...props}
|
|
287
|
+
/>
|
|
288
|
+
)
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* InputGroupButton variant configuration for sizing buttons within addons
|
|
293
|
+
* @variant xs - Extra small button height (24px) for compact inline addons (default)
|
|
294
|
+
* @variant sm - Small button height (32px) for standard inline or block addons
|
|
295
|
+
* @variant icon-xs - Extra small icon-only button (24x24px) for compact addons
|
|
296
|
+
* @variant icon-sm - Small icon-only button (32x32px) for standard addons
|
|
297
|
+
*/
|
|
298
|
+
const inputGroupButtonVariants = cva(
|
|
299
|
+
"text-sm shadow-none flex gap-2 items-center",
|
|
300
|
+
{
|
|
301
|
+
variants: {
|
|
302
|
+
size: {
|
|
303
|
+
xs: "h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2",
|
|
304
|
+
sm: "h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5",
|
|
305
|
+
"icon-xs":
|
|
306
|
+
"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
|
307
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0",
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
defaultVariants: {
|
|
311
|
+
size: "xs",
|
|
312
|
+
},
|
|
313
|
+
}
|
|
314
|
+
)
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Props for InputGroupButton component (Documentation only - NOT used in component implementation)
|
|
318
|
+
* These types are for documentation generation and should not replace CVA inferred types
|
|
319
|
+
*/
|
|
320
|
+
type InputGroupButtonDocsProps = {
|
|
321
|
+
/** Button size variant optimized for input group layout @default "xs" */
|
|
322
|
+
size?: "xs" | "sm" | "icon-xs" | "icon-sm";
|
|
323
|
+
/** Button variant from Button component @default "ghost" */
|
|
324
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link";
|
|
325
|
+
/** Button type attribute @default "button" */
|
|
326
|
+
type?: "button" | "submit" | "reset";
|
|
327
|
+
/** Additional CSS classes for custom styling */
|
|
328
|
+
className?: string;
|
|
329
|
+
/** Button content (text, icons, or both) */
|
|
330
|
+
children?: React.ReactNode;
|
|
331
|
+
/** Click handler for the button action */
|
|
332
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
333
|
+
/** Whether the button is disabled */
|
|
334
|
+
disabled?: boolean;
|
|
335
|
+
} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "type" | "size">;
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* InputGroupButton - Action button within an InputGroupAddon
|
|
339
|
+
*
|
|
340
|
+
* A specialized button component optimized for use within input group addons. Styled with
|
|
341
|
+
* reduced shadows and compact sizing to integrate seamlessly with the input group container.
|
|
342
|
+
* Supports text buttons, icon buttons, and combination buttons with various size options.
|
|
343
|
+
* Uses ghost variant by default for subtle integration with the input group.
|
|
344
|
+
*
|
|
345
|
+
* @example
|
|
346
|
+
* ```tsx
|
|
347
|
+
* // Text button for action
|
|
348
|
+
* <InputGroup>
|
|
349
|
+
* <InputGroupInput placeholder="Enter coupon code" />
|
|
350
|
+
* <InputGroupAddon align="inline-end">
|
|
351
|
+
* <InputGroupButton size="sm">Apply</InputGroupButton>
|
|
352
|
+
* </InputGroupAddon>
|
|
353
|
+
* </InputGroup>
|
|
354
|
+
* ```
|
|
355
|
+
*
|
|
356
|
+
* @example
|
|
357
|
+
* ```tsx
|
|
358
|
+
* // Icon-only button for compact actions
|
|
359
|
+
* <InputGroup>
|
|
360
|
+
* <InputGroupInput readOnly value="API Key: sk_live_123..." />
|
|
361
|
+
* <InputGroupAddon align="inline-end">
|
|
362
|
+
* <InputGroupButton size="icon-xs">
|
|
363
|
+
* <Copy className="size-4" />
|
|
364
|
+
* </InputGroupButton>
|
|
365
|
+
* </InputGroupAddon>
|
|
366
|
+
* </InputGroup>
|
|
367
|
+
* ```
|
|
368
|
+
*
|
|
369
|
+
* @example
|
|
370
|
+
* ```tsx
|
|
371
|
+
* // Button with icon and text
|
|
372
|
+
* <InputGroup>
|
|
373
|
+
* <InputGroupInput type="email" placeholder="Enter email" />
|
|
374
|
+
* <InputGroupAddon align="inline-end">
|
|
375
|
+
* <InputGroupButton size="sm">
|
|
376
|
+
* <Send className="size-4" />
|
|
377
|
+
* Subscribe
|
|
378
|
+
* </InputGroupButton>
|
|
379
|
+
* </InputGroupAddon>
|
|
380
|
+
* </InputGroup>
|
|
381
|
+
* ```
|
|
382
|
+
*
|
|
383
|
+
* @example
|
|
384
|
+
* ```tsx
|
|
385
|
+
* // Submit button in block addon
|
|
386
|
+
* <InputGroup>
|
|
387
|
+
* <InputGroupTextarea placeholder="Write your message..." />
|
|
388
|
+
* <InputGroupAddon align="block-end">
|
|
389
|
+
* <InputGroupButton size="sm" variant="default" type="submit">
|
|
390
|
+
* Post Comment
|
|
391
|
+
* </InputGroupButton>
|
|
392
|
+
* </InputGroupAddon>
|
|
393
|
+
* </InputGroup>
|
|
394
|
+
* ```
|
|
395
|
+
*
|
|
396
|
+
* @example
|
|
397
|
+
* ```tsx
|
|
398
|
+
* // Multiple buttons with different variants
|
|
399
|
+
* <InputGroup>
|
|
400
|
+
* <InputGroupTextarea placeholder="Compose..." />
|
|
401
|
+
* <InputGroupAddon align="block-end">
|
|
402
|
+
* <InputGroupButton size="sm" variant="outline">Cancel</InputGroupButton>
|
|
403
|
+
* <InputGroupButton size="sm" variant="default">Send</InputGroupButton>
|
|
404
|
+
* </InputGroupAddon>
|
|
405
|
+
* </InputGroup>
|
|
406
|
+
* ```
|
|
407
|
+
*
|
|
408
|
+
* @accessibility
|
|
409
|
+
* - Inherits all Button accessibility features
|
|
410
|
+
* - Default type="button" prevents accidental form submission
|
|
411
|
+
* - Keyboard accessible with Enter and Space activation
|
|
412
|
+
* - Focus visible with proper focus ring styling
|
|
413
|
+
* - Disabled state properly communicated to assistive technologies
|
|
414
|
+
*
|
|
415
|
+
* @see {@link Button} Base button component with full variant options
|
|
416
|
+
* @see {@link InputGroupAddon} Container for this button
|
|
417
|
+
* @since 1.0.0
|
|
418
|
+
*/
|
|
419
|
+
function InputGroupButton({
|
|
420
|
+
className,
|
|
421
|
+
type = "button",
|
|
422
|
+
variant = "ghost",
|
|
423
|
+
size = "xs",
|
|
424
|
+
...props
|
|
425
|
+
}: Omit<React.ComponentProps<typeof Button>, "size"> &
|
|
426
|
+
VariantProps<typeof inputGroupButtonVariants>) {
|
|
427
|
+
return (
|
|
428
|
+
<Button
|
|
429
|
+
type={type}
|
|
430
|
+
data-size={size}
|
|
431
|
+
variant={variant}
|
|
432
|
+
className={cn(inputGroupButtonVariants({ size }), className)}
|
|
433
|
+
{...props}
|
|
434
|
+
/>
|
|
435
|
+
)
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* Props for InputGroupText component (Documentation only - NOT used in component implementation)
|
|
440
|
+
* These types are for documentation generation and should not replace inferred types
|
|
441
|
+
*/
|
|
442
|
+
type InputGroupTextDocsProps = {
|
|
443
|
+
/** Additional CSS classes for custom styling */
|
|
444
|
+
className?: string;
|
|
445
|
+
/** Text content, icons, or other inline elements */
|
|
446
|
+
children?: React.ReactNode;
|
|
447
|
+
} & React.HTMLAttributes<HTMLSpanElement>;
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* InputGroupText - Static text or label content within an InputGroupAddon
|
|
451
|
+
*
|
|
452
|
+
* A span element for displaying non-interactive text, labels, prefixes, suffixes, or icons
|
|
453
|
+
* within an input group addon. Styled with muted foreground colors and optimized spacing.
|
|
454
|
+
* Commonly used for currency symbols, units of measurement, URL protocols, or descriptive labels.
|
|
455
|
+
*
|
|
456
|
+
* @example
|
|
457
|
+
* ```tsx
|
|
458
|
+
* // Currency symbol prefix
|
|
459
|
+
* <InputGroup>
|
|
460
|
+
* <InputGroupAddon align="inline-start">
|
|
461
|
+
* <DollarSign className="size-4" />
|
|
462
|
+
* </InputGroupAddon>
|
|
463
|
+
* <InputGroupInput type="number" placeholder="0.00" />
|
|
464
|
+
* <InputGroupAddon align="inline-end">
|
|
465
|
+
* <InputGroupText>USD</InputGroupText>
|
|
466
|
+
* </InputGroupAddon>
|
|
467
|
+
* </InputGroup>
|
|
468
|
+
* ```
|
|
469
|
+
*
|
|
470
|
+
* @example
|
|
471
|
+
* ```tsx
|
|
472
|
+
* // URL protocol prefix
|
|
473
|
+
* <InputGroup>
|
|
474
|
+
* <InputGroupAddon align="inline-start">
|
|
475
|
+
* <InputGroupText>https://</InputGroupText>
|
|
476
|
+
* </InputGroupAddon>
|
|
477
|
+
* <InputGroupInput placeholder="example.com" />
|
|
478
|
+
* </InputGroup>
|
|
479
|
+
* ```
|
|
480
|
+
*
|
|
481
|
+
* @example
|
|
482
|
+
* ```tsx
|
|
483
|
+
* // Label for textarea
|
|
484
|
+
* <InputGroup>
|
|
485
|
+
* <InputGroupAddon align="block-start">
|
|
486
|
+
* <InputGroupText>Message</InputGroupText>
|
|
487
|
+
* </InputGroupAddon>
|
|
488
|
+
* <InputGroupTextarea placeholder="Type your message..." />
|
|
489
|
+
* </InputGroup>
|
|
490
|
+
* ```
|
|
491
|
+
*
|
|
492
|
+
* @example
|
|
493
|
+
* ```tsx
|
|
494
|
+
* // Character counter
|
|
495
|
+
* <InputGroup>
|
|
496
|
+
* <InputGroupTextarea placeholder="Comment..." />
|
|
497
|
+
* <InputGroupAddon align="block-end">
|
|
498
|
+
* <InputGroupText className="text-xs">250 characters</InputGroupText>
|
|
499
|
+
* </InputGroupAddon>
|
|
500
|
+
* </InputGroup>
|
|
501
|
+
* ```
|
|
502
|
+
*
|
|
503
|
+
* @accessibility
|
|
504
|
+
* - Non-interactive element that provides context to the input
|
|
505
|
+
* - Icons within are marked as pointer-events-none
|
|
506
|
+
* - Muted color indicates non-interactive nature
|
|
507
|
+
* - Can be used with aria-label on parent input for better screen reader support
|
|
508
|
+
*
|
|
509
|
+
* @see {@link InputGroupAddon} Container for this text element
|
|
510
|
+
* @since 1.0.0
|
|
511
|
+
*/
|
|
512
|
+
function InputGroupText({ className, ...props }: React.ComponentProps<"span">) {
|
|
513
|
+
return (
|
|
514
|
+
<span
|
|
515
|
+
className={cn(
|
|
516
|
+
"text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
517
|
+
className
|
|
518
|
+
)}
|
|
519
|
+
{...props}
|
|
520
|
+
/>
|
|
521
|
+
)
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Props for InputGroupInput component (Documentation only - NOT used in component implementation)
|
|
526
|
+
* These types are for documentation generation and should not replace inferred types
|
|
527
|
+
*/
|
|
528
|
+
type InputGroupInputDocsProps = {
|
|
529
|
+
/** Additional CSS classes for custom styling */
|
|
530
|
+
className?: string;
|
|
531
|
+
/** Input placeholder text */
|
|
532
|
+
placeholder?: string;
|
|
533
|
+
/** Input type (text, email, number, password, etc.) @default "text" */
|
|
534
|
+
type?: React.HTMLInputTypeAttribute;
|
|
535
|
+
/** Input value (controlled component) */
|
|
536
|
+
value?: string | number;
|
|
537
|
+
/** Default value (uncontrolled component) */
|
|
538
|
+
defaultValue?: string | number;
|
|
539
|
+
/** Change handler for controlled inputs */
|
|
540
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
541
|
+
/** Whether the input is disabled */
|
|
542
|
+
disabled?: boolean;
|
|
543
|
+
/** Whether the input is read-only */
|
|
544
|
+
readOnly?: boolean;
|
|
545
|
+
/** Marks the input as invalid for error state styling */
|
|
546
|
+
"aria-invalid"?: boolean | "true" | "false";
|
|
547
|
+
/** Name attribute for form submission */
|
|
548
|
+
name?: string;
|
|
549
|
+
/** ID for label association */
|
|
550
|
+
id?: string;
|
|
551
|
+
/** Whether the field is required */
|
|
552
|
+
required?: boolean;
|
|
553
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, "type">;
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* InputGroupInput - Text input element within an InputGroup
|
|
557
|
+
*
|
|
558
|
+
* A styled input component designed to work seamlessly within an InputGroup container.
|
|
559
|
+
* Inherits all standard HTML input props and removes default borders, shadows, and focus
|
|
560
|
+
* rings since the parent InputGroup handles visual states. Automatically flexes to fill
|
|
561
|
+
* available space between addons.
|
|
562
|
+
*
|
|
563
|
+
* @example
|
|
564
|
+
* ```tsx
|
|
565
|
+
* // Basic text input with icon
|
|
566
|
+
* <InputGroup>
|
|
567
|
+
* <InputGroupAddon align="inline-start">
|
|
568
|
+
* <Search className="size-4" />
|
|
569
|
+
* </InputGroupAddon>
|
|
570
|
+
* <InputGroupInput placeholder="Search..." />
|
|
571
|
+
* </InputGroup>
|
|
572
|
+
* ```
|
|
573
|
+
*
|
|
574
|
+
* @example
|
|
575
|
+
* ```tsx
|
|
576
|
+
* // Email input with validation
|
|
577
|
+
* <InputGroup>
|
|
578
|
+
* <InputGroupAddon align="inline-start">
|
|
579
|
+
* <Mail className="size-4" />
|
|
580
|
+
* </InputGroupAddon>
|
|
581
|
+
* <InputGroupInput
|
|
582
|
+
* type="email"
|
|
583
|
+
* placeholder="you@example.com"
|
|
584
|
+
* required
|
|
585
|
+
* aria-invalid={!isValid}
|
|
586
|
+
* />
|
|
587
|
+
* </InputGroup>
|
|
588
|
+
* ```
|
|
589
|
+
*
|
|
590
|
+
* @example
|
|
591
|
+
* ```tsx
|
|
592
|
+
* // Controlled number input
|
|
593
|
+
* const [amount, setAmount] = useState("");
|
|
594
|
+
* <InputGroup>
|
|
595
|
+
* <InputGroupAddon align="inline-start">
|
|
596
|
+
* <DollarSign className="size-4" />
|
|
597
|
+
* </InputGroupAddon>
|
|
598
|
+
* <InputGroupInput
|
|
599
|
+
* type="number"
|
|
600
|
+
* placeholder="0.00"
|
|
601
|
+
* value={amount}
|
|
602
|
+
* onChange={(e) => setAmount(e.target.value)}
|
|
603
|
+
* />
|
|
604
|
+
* <InputGroupAddon align="inline-end">
|
|
605
|
+
* <InputGroupText>USD</InputGroupText>
|
|
606
|
+
* </InputGroupAddon>
|
|
607
|
+
* </InputGroup>
|
|
608
|
+
* ```
|
|
609
|
+
*
|
|
610
|
+
* @example
|
|
611
|
+
* ```tsx
|
|
612
|
+
* // Read-only input for displaying values
|
|
613
|
+
* <InputGroup>
|
|
614
|
+
* <InputGroupInput
|
|
615
|
+
* readOnly
|
|
616
|
+
* value="API Key: sk_live_123456789"
|
|
617
|
+
* />
|
|
618
|
+
* <InputGroupAddon align="inline-end">
|
|
619
|
+
* <InputGroupButton size="icon-xs">
|
|
620
|
+
* <Copy className="size-4" />
|
|
621
|
+
* </InputGroupButton>
|
|
622
|
+
* </InputGroupAddon>
|
|
623
|
+
* </InputGroup>
|
|
624
|
+
* ```
|
|
625
|
+
*
|
|
626
|
+
* @accessibility
|
|
627
|
+
* - Inherits all native HTML input accessibility features
|
|
628
|
+
* - Focus management handled by parent InputGroup with visible focus ring
|
|
629
|
+
* - Error states indicated via aria-invalid attribute
|
|
630
|
+
* - Properly associates with labels using id and htmlFor
|
|
631
|
+
* - Keyboard accessible with standard input navigation
|
|
632
|
+
* - Supports all ARIA attributes for enhanced accessibility
|
|
633
|
+
*
|
|
634
|
+
* @see {@link Input} Base input component
|
|
635
|
+
* @see {@link InputGroup} Parent container component
|
|
636
|
+
* @since 1.0.0
|
|
637
|
+
*/
|
|
638
|
+
function InputGroupInput({
|
|
639
|
+
className,
|
|
640
|
+
...props
|
|
641
|
+
}: React.ComponentProps<"input">) {
|
|
642
|
+
return (
|
|
643
|
+
<Input
|
|
644
|
+
data-slot="input-group-control"
|
|
645
|
+
className={cn(
|
|
646
|
+
"flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",
|
|
647
|
+
className
|
|
648
|
+
)}
|
|
649
|
+
{...props}
|
|
650
|
+
/>
|
|
651
|
+
)
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* Props for InputGroupTextarea component (Documentation only - NOT used in component implementation)
|
|
656
|
+
* These types are for documentation generation and should not replace inferred types
|
|
657
|
+
*/
|
|
658
|
+
type InputGroupTextareaDocsProps = {
|
|
659
|
+
/** Additional CSS classes for custom styling */
|
|
660
|
+
className?: string;
|
|
661
|
+
/** Textarea placeholder text */
|
|
662
|
+
placeholder?: string;
|
|
663
|
+
/** Number of visible text rows @default 3 */
|
|
664
|
+
rows?: number;
|
|
665
|
+
/** Textarea value (controlled component) */
|
|
666
|
+
value?: string;
|
|
667
|
+
/** Default value (uncontrolled component) */
|
|
668
|
+
defaultValue?: string;
|
|
669
|
+
/** Change handler for controlled textareas */
|
|
670
|
+
onChange?: React.ChangeEventHandler<HTMLTextAreaElement>;
|
|
671
|
+
/** Whether the textarea is disabled */
|
|
672
|
+
disabled?: boolean;
|
|
673
|
+
/** Whether the textarea is read-only */
|
|
674
|
+
readOnly?: boolean;
|
|
675
|
+
/** Marks the textarea as invalid for error state styling */
|
|
676
|
+
"aria-invalid"?: boolean | "true" | "false";
|
|
677
|
+
/** Name attribute for form submission */
|
|
678
|
+
name?: string;
|
|
679
|
+
/** ID for label association */
|
|
680
|
+
id?: string;
|
|
681
|
+
/** Whether the field is required */
|
|
682
|
+
required?: boolean;
|
|
683
|
+
/** Maximum character length */
|
|
684
|
+
maxLength?: number;
|
|
685
|
+
} & React.TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* InputGroupTextarea - Multi-line textarea element within an InputGroup
|
|
689
|
+
*
|
|
690
|
+
* A styled textarea component designed to work with InputGroup, especially with block-aligned
|
|
691
|
+
* addons (top/bottom positioning). Removes default borders and shadows as the parent InputGroup
|
|
692
|
+
* handles visual states. Resizing is disabled by default to maintain consistent layout with
|
|
693
|
+
* the container. Automatically flexes to fill available space.
|
|
694
|
+
*
|
|
695
|
+
* @example
|
|
696
|
+
* ```tsx
|
|
697
|
+
* // Basic textarea with label addon
|
|
698
|
+
* <InputGroup>
|
|
699
|
+
* <InputGroupAddon align="block-start">
|
|
700
|
+
* <InputGroupText>Message</InputGroupText>
|
|
701
|
+
* </InputGroupAddon>
|
|
702
|
+
* <InputGroupTextarea placeholder="Type your message here..." />
|
|
703
|
+
* </InputGroup>
|
|
704
|
+
* ```
|
|
705
|
+
*
|
|
706
|
+
* @example
|
|
707
|
+
* ```tsx
|
|
708
|
+
* // Textarea with submit button below
|
|
709
|
+
* <InputGroup>
|
|
710
|
+
* <InputGroupTextarea placeholder="Write your comment..." rows={4} />
|
|
711
|
+
* <InputGroupAddon align="block-end">
|
|
712
|
+
* <InputGroupButton size="sm">
|
|
713
|
+
* <Send className="size-4" />
|
|
714
|
+
* Post
|
|
715
|
+
* </InputGroupButton>
|
|
716
|
+
* </InputGroupAddon>
|
|
717
|
+
* </InputGroup>
|
|
718
|
+
* ```
|
|
719
|
+
*
|
|
720
|
+
* @example
|
|
721
|
+
* ```tsx
|
|
722
|
+
* // Complete comment form with top and bottom addons
|
|
723
|
+
* <InputGroup>
|
|
724
|
+
* <InputGroupAddon align="block-start">
|
|
725
|
+
* <InputGroupText>Your Comment</InputGroupText>
|
|
726
|
+
* <InputGroupButton size="icon-xs">
|
|
727
|
+
* <X className="size-4" />
|
|
728
|
+
* </InputGroupButton>
|
|
729
|
+
* </InputGroupAddon>
|
|
730
|
+
* <InputGroupTextarea placeholder="Add a comment..." rows={3} />
|
|
731
|
+
* <InputGroupAddon align="block-end">
|
|
732
|
+
* <InputGroupButton size="sm" variant="default">
|
|
733
|
+
* Post Comment
|
|
734
|
+
* </InputGroupButton>
|
|
735
|
+
* </InputGroupAddon>
|
|
736
|
+
* </InputGroup>
|
|
737
|
+
* ```
|
|
738
|
+
*
|
|
739
|
+
* @example
|
|
740
|
+
* ```tsx
|
|
741
|
+
* // Textarea with character counter
|
|
742
|
+
* const [message, setMessage] = useState("");
|
|
743
|
+
* <InputGroup>
|
|
744
|
+
* <InputGroupTextarea
|
|
745
|
+
* placeholder="Compose your message..."
|
|
746
|
+
* value={message}
|
|
747
|
+
* onChange={(e) => setMessage(e.target.value)}
|
|
748
|
+
* rows={5}
|
|
749
|
+
* />
|
|
750
|
+
* <InputGroupAddon align="block-end">
|
|
751
|
+
* <InputGroupText className="text-xs">
|
|
752
|
+
* {message.length} characters
|
|
753
|
+
* </InputGroupText>
|
|
754
|
+
* <InputGroupButton size="sm">Send</InputGroupButton>
|
|
755
|
+
* </InputGroupAddon>
|
|
756
|
+
* </InputGroup>
|
|
757
|
+
* ```
|
|
758
|
+
*
|
|
759
|
+
* @accessibility
|
|
760
|
+
* - Inherits all native HTML textarea accessibility features
|
|
761
|
+
* - Focus management handled by parent InputGroup with visible focus ring
|
|
762
|
+
* - Error states indicated via aria-invalid attribute
|
|
763
|
+
* - Properly associates with labels using id and htmlFor
|
|
764
|
+
* - Keyboard accessible with standard textarea navigation
|
|
765
|
+
* - Supports all ARIA attributes including aria-describedby for character limits
|
|
766
|
+
*
|
|
767
|
+
* @see {@link Textarea} Base textarea component
|
|
768
|
+
* @see {@link InputGroup} Parent container component
|
|
769
|
+
* @see {@link InputGroupAddon} Use with align="block-start" or "block-end" for best layout
|
|
770
|
+
* @since 1.0.0
|
|
771
|
+
*/
|
|
772
|
+
function InputGroupTextarea({
|
|
773
|
+
className,
|
|
774
|
+
...props
|
|
775
|
+
}: React.ComponentProps<"textarea">) {
|
|
776
|
+
return (
|
|
777
|
+
<Textarea
|
|
778
|
+
data-slot="input-group-control"
|
|
779
|
+
className={cn(
|
|
780
|
+
"flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent",
|
|
781
|
+
className
|
|
782
|
+
)}
|
|
783
|
+
{...props}
|
|
784
|
+
/>
|
|
785
|
+
)
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
export {
|
|
789
|
+
InputGroup,
|
|
790
|
+
InputGroupAddon,
|
|
791
|
+
InputGroupButton,
|
|
792
|
+
InputGroupText,
|
|
793
|
+
InputGroupInput,
|
|
794
|
+
InputGroupTextarea,
|
|
795
|
+
type InputGroupDocsProps,
|
|
796
|
+
type InputGroupAddonDocsProps,
|
|
797
|
+
type InputGroupButtonDocsProps,
|
|
798
|
+
type InputGroupTextDocsProps,
|
|
799
|
+
type InputGroupInputDocsProps,
|
|
800
|
+
type InputGroupTextareaDocsProps,
|
|
801
|
+
}
|