@neynar/ui 0.2.1 → 0.3.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/{llm-docs → .llm}/a.llm.md +2 -16
- package/{llm-docs → .llm}/badge.llm.md +16 -21
- package/{llm-docs → .llm}/blockquote.llm.md +1 -6
- package/.llm/button-group-separator.llm.md +53 -0
- package/.llm/button-group-text.llm.md +56 -0
- package/.llm/button-group.llm.md +81 -0
- package/{llm-docs → .llm}/button.llm.md +1 -1
- package/{llm-docs → .llm}/code.llm.md +1 -6
- package/.llm/empty-content.llm.md +103 -0
- package/.llm/empty-description.llm.md +70 -0
- package/.llm/empty-header.llm.md +64 -0
- package/.llm/empty-media.llm.md +81 -0
- package/.llm/empty-title.llm.md +54 -0
- package/.llm/empty.llm.md +158 -0
- package/.llm/field-content.llm.md +28 -0
- package/.llm/field-description.llm.md +28 -0
- package/.llm/field-error.llm.md +41 -0
- package/.llm/field-group.llm.md +84 -0
- package/.llm/field-label.llm.md +28 -0
- package/.llm/field-legend.llm.md +77 -0
- package/.llm/field-separator.llm.md +35 -0
- package/.llm/field-set.llm.md +80 -0
- package/.llm/field-title.llm.md +28 -0
- package/.llm/field.llm.md +35 -0
- package/{llm-docs → .llm}/h1.llm.md +2 -7
- package/{llm-docs → .llm}/h2.llm.md +2 -7
- package/{llm-docs → .llm}/h3.llm.md +2 -7
- package/{llm-docs → .llm}/h4.llm.md +2 -7
- package/{llm-docs → .llm}/h5.llm.md +2 -7
- package/{llm-docs → .llm}/h6.llm.md +1 -6
- package/.llm/input-group-addon.llm.md +91 -0
- package/.llm/input-group-button.llm.md +120 -0
- package/.llm/input-group-input.llm.md +145 -0
- package/.llm/input-group-text.llm.md +75 -0
- package/.llm/input-group-textarea.llm.md +157 -0
- package/.llm/input-group.llm.md +108 -0
- package/.llm/item-actions.llm.md +77 -0
- package/.llm/item-content.llm.md +73 -0
- package/.llm/item-description.llm.md +61 -0
- package/.llm/item-footer.llm.md +68 -0
- package/.llm/item-group.llm.md +73 -0
- package/.llm/item-header.llm.md +66 -0
- package/.llm/item-media.llm.md +75 -0
- package/.llm/item-separator.llm.md +80 -0
- package/.llm/item-title.llm.md +59 -0
- package/.llm/item.llm.md +115 -0
- package/.llm/kbd-group.llm.md +71 -0
- package/.llm/kbd.llm.md +71 -0
- package/{llm-docs → .llm}/lead.llm.md +1 -6
- package/{llm-docs → .llm}/p.llm.md +1 -6
- package/{llm-docs → .llm}/sdk-items-registry.json +390 -6
- package/{llm-docs → .llm}/small.llm.md +1 -6
- package/{llm-docs → .llm}/span.llm.md +2 -16
- package/.llm/spinner.llm.md +182 -0
- package/{llm-docs → .llm}/strong.llm.md +1 -6
- package/{llm-docs → .llm}/typography.llm.md +2 -16
- 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/scroll-area.d.ts +5 -5
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/spinner.d.ts +194 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/stack.d.ts.map +1 -1
- 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 +1 -2
- 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/theme-toggle.d.ts +0 -3
- package/dist/components/ui/theme-toggle.d.ts.map +1 -1
- package/dist/components/ui/theme.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 +4973 -2353
- 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 +7 -6
- 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/stack.tsx +3 -1
- 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/theme-toggle.tsx +1 -3
- package/src/components/ui/theme.tsx +6 -1
- package/src/components/ui/typography.tsx +29 -129
- package/src/index.ts +7 -0
- package/src/styles/globals.css +82 -94
- /package/{llm-docs → .llm}/accordion-content.llm.md +0 -0
- /package/{llm-docs → .llm}/accordion-item.llm.md +0 -0
- /package/{llm-docs → .llm}/accordion-trigger.llm.md +0 -0
- /package/{llm-docs → .llm}/accordion.llm.md +0 -0
- /package/{llm-docs → .llm}/alert-description.llm.md +0 -0
- /package/{llm-docs → .llm}/alert-dialog-action.llm.md +0 -0
- /package/{llm-docs → .llm}/alert-dialog-cancel.llm.md +0 -0
- /package/{llm-docs → .llm}/alert-dialog-content.llm.md +0 -0
- /package/{llm-docs → .llm}/alert-dialog-description.llm.md +0 -0
- /package/{llm-docs → .llm}/alert-dialog-footer.llm.md +0 -0
- /package/{llm-docs → .llm}/alert-dialog-header.llm.md +0 -0
- /package/{llm-docs → .llm}/alert-dialog-overlay.llm.md +0 -0
- /package/{llm-docs → .llm}/alert-dialog-portal.llm.md +0 -0
- /package/{llm-docs → .llm}/alert-dialog-title.llm.md +0 -0
- /package/{llm-docs → .llm}/alert-dialog-trigger.llm.md +0 -0
- /package/{llm-docs → .llm}/alert-dialog.llm.md +0 -0
- /package/{llm-docs → .llm}/alert-title.llm.md +0 -0
- /package/{llm-docs → .llm}/alert.llm.md +0 -0
- /package/{llm-docs → .llm}/aspect-ratio.llm.md +0 -0
- /package/{llm-docs → .llm}/avatar-fallback.llm.md +0 -0
- /package/{llm-docs → .llm}/avatar-image.llm.md +0 -0
- /package/{llm-docs → .llm}/avatar.llm.md +0 -0
- /package/{llm-docs → .llm}/breadcrumb-ellipsis.llm.md +0 -0
- /package/{llm-docs → .llm}/breadcrumb-item.llm.md +0 -0
- /package/{llm-docs → .llm}/breadcrumb-link.llm.md +0 -0
- /package/{llm-docs → .llm}/breadcrumb-list.llm.md +0 -0
- /package/{llm-docs → .llm}/breadcrumb-page.llm.md +0 -0
- /package/{llm-docs → .llm}/breadcrumb-separator.llm.md +0 -0
- /package/{llm-docs → .llm}/breadcrumb.llm.md +0 -0
- /package/{llm-docs → .llm}/calendar-day-button.llm.md +0 -0
- /package/{llm-docs → .llm}/calendar.llm.md +0 -0
- /package/{llm-docs → .llm}/card-action.llm.md +0 -0
- /package/{llm-docs → .llm}/card-content.llm.md +0 -0
- /package/{llm-docs → .llm}/card-description.llm.md +0 -0
- /package/{llm-docs → .llm}/card-footer.llm.md +0 -0
- /package/{llm-docs → .llm}/card-header.llm.md +0 -0
- /package/{llm-docs → .llm}/card-title.llm.md +0 -0
- /package/{llm-docs → .llm}/card.llm.md +0 -0
- /package/{llm-docs → .llm}/carousel-content.llm.md +0 -0
- /package/{llm-docs → .llm}/carousel-item.llm.md +0 -0
- /package/{llm-docs → .llm}/carousel-next.llm.md +0 -0
- /package/{llm-docs → .llm}/carousel-previous.llm.md +0 -0
- /package/{llm-docs → .llm}/carousel.llm.md +0 -0
- /package/{llm-docs → .llm}/chart-config.llm.md +0 -0
- /package/{llm-docs → .llm}/chart-container.llm.md +0 -0
- /package/{llm-docs → .llm}/chart-legend-content.llm.md +0 -0
- /package/{llm-docs → .llm}/chart-legend.llm.md +0 -0
- /package/{llm-docs → .llm}/chart-style.llm.md +0 -0
- /package/{llm-docs → .llm}/chart-tooltip-content.llm.md +0 -0
- /package/{llm-docs → .llm}/chart-tooltip.llm.md +0 -0
- /package/{llm-docs → .llm}/checkbox.llm.md +0 -0
- /package/{llm-docs → .llm}/cn.llm.md +0 -0
- /package/{llm-docs → .llm}/collapsible-content.llm.md +0 -0
- /package/{llm-docs → .llm}/collapsible-trigger.llm.md +0 -0
- /package/{llm-docs → .llm}/collapsible.llm.md +0 -0
- /package/{llm-docs → .llm}/combobox-option.llm.md +0 -0
- /package/{llm-docs → .llm}/combobox.llm.md +0 -0
- /package/{llm-docs → .llm}/command-dialog.llm.md +0 -0
- /package/{llm-docs → .llm}/command-empty.llm.md +0 -0
- /package/{llm-docs → .llm}/command-group.llm.md +0 -0
- /package/{llm-docs → .llm}/command-input.llm.md +0 -0
- /package/{llm-docs → .llm}/command-item.llm.md +0 -0
- /package/{llm-docs → .llm}/command-list.llm.md +0 -0
- /package/{llm-docs → .llm}/command-loading.llm.md +0 -0
- /package/{llm-docs → .llm}/command-separator.llm.md +0 -0
- /package/{llm-docs → .llm}/command-shortcut.llm.md +0 -0
- /package/{llm-docs → .llm}/command.llm.md +0 -0
- /package/{llm-docs → .llm}/container.llm.md +0 -0
- /package/{llm-docs → .llm}/context-menu-checkbox-item.llm.md +0 -0
- /package/{llm-docs → .llm}/context-menu-content.llm.md +0 -0
- /package/{llm-docs → .llm}/context-menu-group.llm.md +0 -0
- /package/{llm-docs → .llm}/context-menu-item.llm.md +0 -0
- /package/{llm-docs → .llm}/context-menu-label.llm.md +0 -0
- /package/{llm-docs → .llm}/context-menu-portal.llm.md +0 -0
- /package/{llm-docs → .llm}/context-menu-radio-group.llm.md +0 -0
- /package/{llm-docs → .llm}/context-menu-radio-item.llm.md +0 -0
- /package/{llm-docs → .llm}/context-menu-separator.llm.md +0 -0
- /package/{llm-docs → .llm}/context-menu-shortcut.llm.md +0 -0
- /package/{llm-docs → .llm}/context-menu-sub-content.llm.md +0 -0
- /package/{llm-docs → .llm}/context-menu-sub-trigger.llm.md +0 -0
- /package/{llm-docs → .llm}/context-menu-sub.llm.md +0 -0
- /package/{llm-docs → .llm}/context-menu-trigger.llm.md +0 -0
- /package/{llm-docs → .llm}/context-menu.llm.md +0 -0
- /package/{llm-docs → .llm}/date-picker.llm.md +0 -0
- /package/{llm-docs → .llm}/dialog-close.llm.md +0 -0
- /package/{llm-docs → .llm}/dialog-content.llm.md +0 -0
- /package/{llm-docs → .llm}/dialog-description.llm.md +0 -0
- /package/{llm-docs → .llm}/dialog-footer.llm.md +0 -0
- /package/{llm-docs → .llm}/dialog-header.llm.md +0 -0
- /package/{llm-docs → .llm}/dialog-overlay.llm.md +0 -0
- /package/{llm-docs → .llm}/dialog-portal.llm.md +0 -0
- /package/{llm-docs → .llm}/dialog-title.llm.md +0 -0
- /package/{llm-docs → .llm}/dialog-trigger.llm.md +0 -0
- /package/{llm-docs → .llm}/dialog.llm.md +0 -0
- /package/{llm-docs → .llm}/drawer-close.llm.md +0 -0
- /package/{llm-docs → .llm}/drawer-content.llm.md +0 -0
- /package/{llm-docs → .llm}/drawer-description.llm.md +0 -0
- /package/{llm-docs → .llm}/drawer-footer.llm.md +0 -0
- /package/{llm-docs → .llm}/drawer-header.llm.md +0 -0
- /package/{llm-docs → .llm}/drawer-overlay.llm.md +0 -0
- /package/{llm-docs → .llm}/drawer-portal.llm.md +0 -0
- /package/{llm-docs → .llm}/drawer-title.llm.md +0 -0
- /package/{llm-docs → .llm}/drawer-trigger.llm.md +0 -0
- /package/{llm-docs → .llm}/drawer.llm.md +0 -0
- /package/{llm-docs → .llm}/dropdown-menu-checkbox-item.llm.md +0 -0
- /package/{llm-docs → .llm}/dropdown-menu-content.llm.md +0 -0
- /package/{llm-docs → .llm}/dropdown-menu-group.llm.md +0 -0
- /package/{llm-docs → .llm}/dropdown-menu-item.llm.md +0 -0
- /package/{llm-docs → .llm}/dropdown-menu-label.llm.md +0 -0
- /package/{llm-docs → .llm}/dropdown-menu-portal.llm.md +0 -0
- /package/{llm-docs → .llm}/dropdown-menu-radio-group.llm.md +0 -0
- /package/{llm-docs → .llm}/dropdown-menu-radio-item.llm.md +0 -0
- /package/{llm-docs → .llm}/dropdown-menu-separator.llm.md +0 -0
- /package/{llm-docs → .llm}/dropdown-menu-shortcut.llm.md +0 -0
- /package/{llm-docs → .llm}/dropdown-menu-sub-content.llm.md +0 -0
- /package/{llm-docs → .llm}/dropdown-menu-sub-trigger.llm.md +0 -0
- /package/{llm-docs → .llm}/dropdown-menu-sub.llm.md +0 -0
- /package/{llm-docs → .llm}/dropdown-menu-trigger.llm.md +0 -0
- /package/{llm-docs → .llm}/dropdown-menu.llm.md +0 -0
- /package/{llm-docs → .llm}/empty-state.llm.md +0 -0
- /package/{llm-docs → .llm}/hover-card-content.llm.md +0 -0
- /package/{llm-docs → .llm}/hover-card-trigger.llm.md +0 -0
- /package/{llm-docs → .llm}/hover-card.llm.md +0 -0
- /package/{llm-docs → .llm}/input.llm.md +0 -0
- /package/{llm-docs → .llm}/label.llm.md +0 -0
- /package/{llm-docs → .llm}/menubar-checkbox-item.llm.md +0 -0
- /package/{llm-docs → .llm}/menubar-content.llm.md +0 -0
- /package/{llm-docs → .llm}/menubar-group.llm.md +0 -0
- /package/{llm-docs → .llm}/menubar-item.llm.md +0 -0
- /package/{llm-docs → .llm}/menubar-label.llm.md +0 -0
- /package/{llm-docs → .llm}/menubar-menu.llm.md +0 -0
- /package/{llm-docs → .llm}/menubar-portal.llm.md +0 -0
- /package/{llm-docs → .llm}/menubar-radio-group.llm.md +0 -0
- /package/{llm-docs → .llm}/menubar-radio-item.llm.md +0 -0
- /package/{llm-docs → .llm}/menubar-separator.llm.md +0 -0
- /package/{llm-docs → .llm}/menubar-shortcut.llm.md +0 -0
- /package/{llm-docs → .llm}/menubar-sub-content.llm.md +0 -0
- /package/{llm-docs → .llm}/menubar-sub-trigger.llm.md +0 -0
- /package/{llm-docs → .llm}/menubar-sub.llm.md +0 -0
- /package/{llm-docs → .llm}/menubar-trigger.llm.md +0 -0
- /package/{llm-docs → .llm}/menubar.llm.md +0 -0
- /package/{llm-docs → .llm}/navigation-menu-content.llm.md +0 -0
- /package/{llm-docs → .llm}/navigation-menu-indicator.llm.md +0 -0
- /package/{llm-docs → .llm}/navigation-menu-item.llm.md +0 -0
- /package/{llm-docs → .llm}/navigation-menu-link.llm.md +0 -0
- /package/{llm-docs → .llm}/navigation-menu-list.llm.md +0 -0
- /package/{llm-docs → .llm}/navigation-menu-trigger-style.llm.md +0 -0
- /package/{llm-docs → .llm}/navigation-menu-trigger.llm.md +0 -0
- /package/{llm-docs → .llm}/navigation-menu-viewport.llm.md +0 -0
- /package/{llm-docs → .llm}/navigation-menu.llm.md +0 -0
- /package/{llm-docs → .llm}/pagination-content.llm.md +0 -0
- /package/{llm-docs → .llm}/pagination-ellipsis.llm.md +0 -0
- /package/{llm-docs → .llm}/pagination-item.llm.md +0 -0
- /package/{llm-docs → .llm}/pagination-link.llm.md +0 -0
- /package/{llm-docs → .llm}/pagination-next.llm.md +0 -0
- /package/{llm-docs → .llm}/pagination-previous.llm.md +0 -0
- /package/{llm-docs → .llm}/pagination.llm.md +0 -0
- /package/{llm-docs → .llm}/popover-anchor.llm.md +0 -0
- /package/{llm-docs → .llm}/popover-content.llm.md +0 -0
- /package/{llm-docs → .llm}/popover-trigger.llm.md +0 -0
- /package/{llm-docs → .llm}/popover.llm.md +0 -0
- /package/{llm-docs → .llm}/progress.llm.md +0 -0
- /package/{llm-docs → .llm}/radio-group-indicator.llm.md +0 -0
- /package/{llm-docs → .llm}/radio-group-item.llm.md +0 -0
- /package/{llm-docs → .llm}/radio-group.llm.md +0 -0
- /package/{llm-docs → .llm}/resizable-handle.llm.md +0 -0
- /package/{llm-docs → .llm}/resizable-panel-group.llm.md +0 -0
- /package/{llm-docs → .llm}/resizable-panel.llm.md +0 -0
- /package/{llm-docs → .llm}/scroll-area-corner.llm.md +0 -0
- /package/{llm-docs → .llm}/scroll-area-thumb.llm.md +0 -0
- /package/{llm-docs → .llm}/scroll-area-viewport.llm.md +0 -0
- /package/{llm-docs → .llm}/scroll-area.llm.md +0 -0
- /package/{llm-docs → .llm}/scroll-bar.llm.md +0 -0
- /package/{llm-docs → .llm}/select-content.llm.md +0 -0
- /package/{llm-docs → .llm}/select-group.llm.md +0 -0
- /package/{llm-docs → .llm}/select-item.llm.md +0 -0
- /package/{llm-docs → .llm}/select-label.llm.md +0 -0
- /package/{llm-docs → .llm}/select-scroll-down-button.llm.md +0 -0
- /package/{llm-docs → .llm}/select-scroll-up-button.llm.md +0 -0
- /package/{llm-docs → .llm}/select-separator.llm.md +0 -0
- /package/{llm-docs → .llm}/select-trigger.llm.md +0 -0
- /package/{llm-docs → .llm}/select-value.llm.md +0 -0
- /package/{llm-docs → .llm}/select.llm.md +0 -0
- /package/{llm-docs → .llm}/separator.llm.md +0 -0
- /package/{llm-docs → .llm}/sheet-close.llm.md +0 -0
- /package/{llm-docs → .llm}/sheet-content.llm.md +0 -0
- /package/{llm-docs → .llm}/sheet-description.llm.md +0 -0
- /package/{llm-docs → .llm}/sheet-footer.llm.md +0 -0
- /package/{llm-docs → .llm}/sheet-header.llm.md +0 -0
- /package/{llm-docs → .llm}/sheet-title.llm.md +0 -0
- /package/{llm-docs → .llm}/sheet-trigger.llm.md +0 -0
- /package/{llm-docs → .llm}/sheet.llm.md +0 -0
- /package/{llm-docs → .llm}/sidebar-content.llm.md +0 -0
- /package/{llm-docs → .llm}/sidebar-footer.llm.md +0 -0
- /package/{llm-docs → .llm}/sidebar-group-action.llm.md +0 -0
- /package/{llm-docs → .llm}/sidebar-group-content.llm.md +0 -0
- /package/{llm-docs → .llm}/sidebar-group-label.llm.md +0 -0
- /package/{llm-docs → .llm}/sidebar-group.llm.md +0 -0
- /package/{llm-docs → .llm}/sidebar-header.llm.md +0 -0
- /package/{llm-docs → .llm}/sidebar-input.llm.md +0 -0
- /package/{llm-docs → .llm}/sidebar-inset.llm.md +0 -0
- /package/{llm-docs → .llm}/sidebar-menu-action.llm.md +0 -0
- /package/{llm-docs → .llm}/sidebar-menu-badge.llm.md +0 -0
- /package/{llm-docs → .llm}/sidebar-menu-button.llm.md +0 -0
- /package/{llm-docs → .llm}/sidebar-menu-item.llm.md +0 -0
- /package/{llm-docs → .llm}/sidebar-menu-skeleton.llm.md +0 -0
- /package/{llm-docs → .llm}/sidebar-menu-sub-button.llm.md +0 -0
- /package/{llm-docs → .llm}/sidebar-menu-sub-item.llm.md +0 -0
- /package/{llm-docs → .llm}/sidebar-menu-sub.llm.md +0 -0
- /package/{llm-docs → .llm}/sidebar-menu.llm.md +0 -0
- /package/{llm-docs → .llm}/sidebar-provider.llm.md +0 -0
- /package/{llm-docs → .llm}/sidebar-rail.llm.md +0 -0
- /package/{llm-docs → .llm}/sidebar-separator.llm.md +0 -0
- /package/{llm-docs → .llm}/sidebar-trigger.llm.md +0 -0
- /package/{llm-docs → .llm}/sidebar.llm.md +0 -0
- /package/{llm-docs → .llm}/skeleton.llm.md +0 -0
- /package/{llm-docs → .llm}/slider.llm.md +0 -0
- /package/{llm-docs → .llm}/stack.llm.md +0 -0
- /package/{llm-docs → .llm}/switch.llm.md +0 -0
- /package/{llm-docs → .llm}/table-body.llm.md +0 -0
- /package/{llm-docs → .llm}/table-caption.llm.md +0 -0
- /package/{llm-docs → .llm}/table-cell.llm.md +0 -0
- /package/{llm-docs → .llm}/table-footer.llm.md +0 -0
- /package/{llm-docs → .llm}/table-head.llm.md +0 -0
- /package/{llm-docs → .llm}/table-header.llm.md +0 -0
- /package/{llm-docs → .llm}/table-row.llm.md +0 -0
- /package/{llm-docs → .llm}/table.llm.md +0 -0
- /package/{llm-docs → .llm}/tabs-content.llm.md +0 -0
- /package/{llm-docs → .llm}/tabs-list.llm.md +0 -0
- /package/{llm-docs → .llm}/tabs-trigger.llm.md +0 -0
- /package/{llm-docs → .llm}/tabs.llm.md +0 -0
- /package/{llm-docs → .llm}/text-field.llm.md +0 -0
- /package/{llm-docs → .llm}/textarea.llm.md +0 -0
- /package/{llm-docs → .llm}/theme-preference.llm.md +0 -0
- /package/{llm-docs → .llm}/theme-toggle.llm.md +0 -0
- /package/{llm-docs → .llm}/theme.llm.md +0 -0
- /package/{llm-docs → .llm}/toast.llm.md +0 -0
- /package/{llm-docs → .llm}/toaster.llm.md +0 -0
- /package/{llm-docs → .llm}/toggle-group-item.llm.md +0 -0
- /package/{llm-docs → .llm}/toggle-group.llm.md +0 -0
- /package/{llm-docs → .llm}/toggle.llm.md +0 -0
- /package/{llm-docs → .llm}/tooltip-content.llm.md +0 -0
- /package/{llm-docs → .llm}/tooltip-provider.llm.md +0 -0
- /package/{llm-docs → .llm}/tooltip-trigger.llm.md +0 -0
- /package/{llm-docs → .llm}/tooltip.llm.md +0 -0
- /package/{llm-docs → .llm}/use-carousel.llm.md +0 -0
- /package/{llm-docs → .llm}/use-command-state.llm.md +0 -0
- /package/{llm-docs → .llm}/use-is-mobile.llm.md +0 -0
- /package/{llm-docs → .llm}/use-sidebar.llm.md +0 -0
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
import { useMemo } from "react"
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
import { Label } from "@/components/ui/label"
|
|
6
|
+
import { Separator } from "@/components/ui/separator"
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Props for FieldSet component (Documentation only - NOT used in component implementation)
|
|
10
|
+
*
|
|
11
|
+
* Container that renders a semantic fieldset element with spacing presets. Groups related
|
|
12
|
+
* form controls for improved keyboard navigation and assistive technology compatibility.
|
|
13
|
+
*/
|
|
14
|
+
type FieldSetDocsProps = {
|
|
15
|
+
/** Additional CSS classes to apply to the fieldset element */
|
|
16
|
+
className?: string
|
|
17
|
+
/** Child elements to render within the fieldset, typically FieldLegend and FieldGroup */
|
|
18
|
+
children?: React.ReactNode
|
|
19
|
+
} & React.ComponentProps<"fieldset">
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* FieldSet - Semantic form control grouping container
|
|
23
|
+
*
|
|
24
|
+
* A container that renders a native HTML `<fieldset>` element with optimized spacing
|
|
25
|
+
* and layout presets. It provides semantic grouping for related form controls, which
|
|
26
|
+
* improves accessibility by allowing assistive technologies to understand the
|
|
27
|
+
* relationship between form fields.
|
|
28
|
+
*
|
|
29
|
+
* The component automatically adjusts gap spacing when containing checkbox or radio
|
|
30
|
+
* groups, providing tighter spacing for these control types.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* Basic fieldset with legend and fields
|
|
34
|
+
* ```tsx
|
|
35
|
+
* <FieldSet>
|
|
36
|
+
* <FieldLegend>Delivery Information</FieldLegend>
|
|
37
|
+
* <FieldGroup>
|
|
38
|
+
* <Field>
|
|
39
|
+
* <FieldLabel htmlFor="address">Address</FieldLabel>
|
|
40
|
+
* <Input id="address" />
|
|
41
|
+
* </Field>
|
|
42
|
+
* </FieldGroup>
|
|
43
|
+
* </FieldSet>
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* Fieldset with radio group
|
|
48
|
+
* ```tsx
|
|
49
|
+
* <FieldSet>
|
|
50
|
+
* <FieldLegend>Shipping Method</FieldLegend>
|
|
51
|
+
* <FieldGroup data-slot="radio-group">
|
|
52
|
+
* <Field orientation="horizontal">
|
|
53
|
+
* <Radio id="standard" />
|
|
54
|
+
* <FieldLabel htmlFor="standard">Standard</FieldLabel>
|
|
55
|
+
* </Field>
|
|
56
|
+
* <Field orientation="horizontal">
|
|
57
|
+
* <Radio id="express" />
|
|
58
|
+
* <FieldLabel htmlFor="express">Express</FieldLabel>
|
|
59
|
+
* </Field>
|
|
60
|
+
* </FieldGroup>
|
|
61
|
+
* </FieldSet>
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* Nested fieldsets for complex forms
|
|
66
|
+
* ```tsx
|
|
67
|
+
* <FieldSet>
|
|
68
|
+
* <FieldLegend>Account Settings</FieldLegend>
|
|
69
|
+
* <FieldGroup>
|
|
70
|
+
* <FieldSet>
|
|
71
|
+
* <FieldLegend variant="label">Profile</FieldLegend>
|
|
72
|
+
* <FieldGroup>
|
|
73
|
+
* <Field>
|
|
74
|
+
* <FieldLabel htmlFor="username">Username</FieldLabel>
|
|
75
|
+
* <Input id="username" />
|
|
76
|
+
* </Field>
|
|
77
|
+
* </FieldGroup>
|
|
78
|
+
* </FieldSet>
|
|
79
|
+
* </FieldGroup>
|
|
80
|
+
* </FieldSet>
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
* @accessibility
|
|
84
|
+
* - Uses semantic `<fieldset>` element for proper form grouping
|
|
85
|
+
* - Automatically associates grouped controls for screen readers
|
|
86
|
+
* - Enables keyboard navigation across related form controls
|
|
87
|
+
* - Works with `<legend>` element (FieldLegend) for accessible group labeling
|
|
88
|
+
* - Supports disabled state propagation to all child controls
|
|
89
|
+
*
|
|
90
|
+
* @see {@link FieldLegend} for fieldset labeling
|
|
91
|
+
* @see {@link FieldGroup} for organizing multiple fields
|
|
92
|
+
* @see {@link Field} for individual form fields
|
|
93
|
+
* @since 1.0.0
|
|
94
|
+
*/
|
|
95
|
+
function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">) {
|
|
96
|
+
return (
|
|
97
|
+
<fieldset
|
|
98
|
+
data-slot="field-set"
|
|
99
|
+
className={cn(
|
|
100
|
+
"flex flex-col gap-6",
|
|
101
|
+
"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
|
|
102
|
+
className
|
|
103
|
+
)}
|
|
104
|
+
{...props}
|
|
105
|
+
/>
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Props for FieldLegend component (Documentation only - NOT used in component implementation)
|
|
111
|
+
*
|
|
112
|
+
* A legend element for a FieldSet that provides a caption describing the group of fields.
|
|
113
|
+
*/
|
|
114
|
+
type FieldLegendDocsProps = {
|
|
115
|
+
/** Additional CSS classes to apply to the legend element */
|
|
116
|
+
className?: string
|
|
117
|
+
/** Visual style variant - "legend" for standard size, "label" for smaller label-style text @default "legend" */
|
|
118
|
+
variant?: "legend" | "label"
|
|
119
|
+
/** Text content or elements to render as the legend */
|
|
120
|
+
children?: React.ReactNode
|
|
121
|
+
} & React.ComponentProps<"legend">
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* FieldLegend - Fieldset caption with size variants
|
|
125
|
+
*
|
|
126
|
+
* A caption element that provides a title or description for a group of related form
|
|
127
|
+
* fields within a FieldSet. Renders as a native HTML `<legend>` element with size
|
|
128
|
+
* variants to match different design contexts.
|
|
129
|
+
*
|
|
130
|
+
* The "legend" variant (default) uses standard text sizing for top-level fieldsets,
|
|
131
|
+
* while the "label" variant provides smaller text suitable for nested fieldsets or
|
|
132
|
+
* when you need the legend to visually match form labels.
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* Standard legend for top-level fieldset
|
|
136
|
+
* ```tsx
|
|
137
|
+
* <FieldSet>
|
|
138
|
+
* <FieldLegend>Personal Information</FieldLegend>
|
|
139
|
+
* <FieldGroup>
|
|
140
|
+
* <Field>
|
|
141
|
+
* <FieldLabel htmlFor="name">Full Name</FieldLabel>
|
|
142
|
+
* <Input id="name" />
|
|
143
|
+
* </Field>
|
|
144
|
+
* </FieldGroup>
|
|
145
|
+
* </FieldSet>
|
|
146
|
+
* ```
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* Label-sized legend for nested fieldset
|
|
150
|
+
* ```tsx
|
|
151
|
+
* <FieldSet>
|
|
152
|
+
* <FieldLegend variant="label">Notification Preferences</FieldLegend>
|
|
153
|
+
* <FieldGroup>
|
|
154
|
+
* <Field orientation="horizontal">
|
|
155
|
+
* <Switch id="email" />
|
|
156
|
+
* <FieldLabel htmlFor="email">Email notifications</FieldLabel>
|
|
157
|
+
* </Field>
|
|
158
|
+
* </FieldGroup>
|
|
159
|
+
* </FieldSet>
|
|
160
|
+
* ```
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* Legend with description
|
|
164
|
+
* ```tsx
|
|
165
|
+
* <FieldSet>
|
|
166
|
+
* <FieldLegend>Billing Address</FieldLegend>
|
|
167
|
+
* <FieldDescription>
|
|
168
|
+
* This address will appear on your invoices and receipts.
|
|
169
|
+
* </FieldDescription>
|
|
170
|
+
* <FieldGroup>
|
|
171
|
+
* // fields go here
|
|
172
|
+
* </FieldGroup>
|
|
173
|
+
* </FieldSet>
|
|
174
|
+
* ```
|
|
175
|
+
*
|
|
176
|
+
* @accessibility
|
|
177
|
+
* - Uses semantic `<legend>` element for proper fieldset labeling
|
|
178
|
+
* - Automatically announced by screen readers as the fieldset title
|
|
179
|
+
* - Provides context for all fields within the parent fieldset
|
|
180
|
+
* - First element read when entering a fieldset with assistive technology
|
|
181
|
+
*
|
|
182
|
+
* @see {@link FieldSet} for grouping related form controls
|
|
183
|
+
* @see {@link FieldDescription} for additional context text
|
|
184
|
+
* @since 1.0.0
|
|
185
|
+
*/
|
|
186
|
+
function FieldLegend({
|
|
187
|
+
className,
|
|
188
|
+
variant = "legend",
|
|
189
|
+
...props
|
|
190
|
+
}: React.ComponentProps<"legend"> & { variant?: "legend" | "label" }) {
|
|
191
|
+
return (
|
|
192
|
+
<legend
|
|
193
|
+
data-slot="field-legend"
|
|
194
|
+
data-variant={variant}
|
|
195
|
+
className={cn(
|
|
196
|
+
"mb-3 font-medium",
|
|
197
|
+
"data-[variant=legend]:text-base",
|
|
198
|
+
"data-[variant=label]:text-sm",
|
|
199
|
+
className
|
|
200
|
+
)}
|
|
201
|
+
{...props}
|
|
202
|
+
/>
|
|
203
|
+
)
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Props for FieldGroup component (Documentation only - NOT used in component implementation)
|
|
208
|
+
*
|
|
209
|
+
* Layout wrapper that stacks Field components and enables container queries for responsive orientations.
|
|
210
|
+
*/
|
|
211
|
+
type FieldGroupDocsProps = {
|
|
212
|
+
/** Additional CSS classes to apply to the group container */
|
|
213
|
+
className?: string
|
|
214
|
+
/** Field components to group together */
|
|
215
|
+
children?: React.ReactNode
|
|
216
|
+
} & React.ComponentProps<"div">
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* FieldGroup - Container for organizing multiple form fields
|
|
220
|
+
*
|
|
221
|
+
* A layout wrapper that vertically stacks Field components with optimized spacing.
|
|
222
|
+
* It provides container query support for responsive field orientations and automatically
|
|
223
|
+
* adjusts spacing for different control types (standard fields vs. checkbox/radio groups).
|
|
224
|
+
*
|
|
225
|
+
* The component uses CSS container queries (@container) which allows child Field
|
|
226
|
+
* components with `orientation="responsive"` to adapt their layout based on the
|
|
227
|
+
* FieldGroup's width rather than the viewport width.
|
|
228
|
+
*
|
|
229
|
+
* @example
|
|
230
|
+
* Basic field grouping
|
|
231
|
+
* ```tsx
|
|
232
|
+
* <FieldSet>
|
|
233
|
+
* <FieldLegend>Contact Information</FieldLegend>
|
|
234
|
+
* <FieldGroup>
|
|
235
|
+
* <Field>
|
|
236
|
+
* <FieldLabel htmlFor="email">Email</FieldLabel>
|
|
237
|
+
* <Input id="email" type="email" />
|
|
238
|
+
* </Field>
|
|
239
|
+
* <Field>
|
|
240
|
+
* <FieldLabel htmlFor="phone">Phone</FieldLabel>
|
|
241
|
+
* <Input id="phone" type="tel" />
|
|
242
|
+
* </Field>
|
|
243
|
+
* </FieldGroup>
|
|
244
|
+
* </FieldSet>
|
|
245
|
+
* ```
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* Responsive field orientations with container queries
|
|
249
|
+
* ```tsx
|
|
250
|
+
* <FieldGroup>
|
|
251
|
+
* <Field orientation="responsive">
|
|
252
|
+
* <FieldLabel htmlFor="name">Full Name</FieldLabel>
|
|
253
|
+
* <Input id="name" />
|
|
254
|
+
* <FieldDescription>As it appears on your ID</FieldDescription>
|
|
255
|
+
* </Field>
|
|
256
|
+
* <Field orientation="responsive">
|
|
257
|
+
* <FieldLabel htmlFor="company">Company</FieldLabel>
|
|
258
|
+
* <Input id="company" />
|
|
259
|
+
* </Field>
|
|
260
|
+
* </FieldGroup>
|
|
261
|
+
* ```
|
|
262
|
+
*
|
|
263
|
+
* @example
|
|
264
|
+
* Nested field groups for complex layouts
|
|
265
|
+
* ```tsx
|
|
266
|
+
* <FieldGroup>
|
|
267
|
+
* <Field>
|
|
268
|
+
* <FieldLabel htmlFor="street">Street Address</FieldLabel>
|
|
269
|
+
* <Input id="street" />
|
|
270
|
+
* </Field>
|
|
271
|
+
* <FieldGroup>
|
|
272
|
+
* <Field>
|
|
273
|
+
* <FieldLabel htmlFor="city">City</FieldLabel>
|
|
274
|
+
* <Input id="city" />
|
|
275
|
+
* </Field>
|
|
276
|
+
* <Field>
|
|
277
|
+
* <FieldLabel htmlFor="zip">Zip Code</FieldLabel>
|
|
278
|
+
* <Input id="zip" />
|
|
279
|
+
* </Field>
|
|
280
|
+
* </FieldGroup>
|
|
281
|
+
* </FieldGroup>
|
|
282
|
+
* ```
|
|
283
|
+
*
|
|
284
|
+
* @accessibility
|
|
285
|
+
* - Provides logical grouping of related form fields
|
|
286
|
+
* - Supports keyboard navigation between grouped fields
|
|
287
|
+
* - Works with FieldSet for semantic form sections
|
|
288
|
+
* - Maintains focus order for tab navigation
|
|
289
|
+
*
|
|
290
|
+
* @see {@link Field} for individual form fields
|
|
291
|
+
* @see {@link FieldSet} for semantic field grouping
|
|
292
|
+
* @since 1.0.0
|
|
293
|
+
*/
|
|
294
|
+
function FieldGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
295
|
+
return (
|
|
296
|
+
<div
|
|
297
|
+
data-slot="field-group"
|
|
298
|
+
className={cn(
|
|
299
|
+
"group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",
|
|
300
|
+
className
|
|
301
|
+
)}
|
|
302
|
+
{...props}
|
|
303
|
+
/>
|
|
304
|
+
)
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
const fieldVariants = cva(
|
|
308
|
+
"group/field flex w-full gap-3 data-[invalid=true]:text-destructive",
|
|
309
|
+
{
|
|
310
|
+
variants: {
|
|
311
|
+
orientation: {
|
|
312
|
+
vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
|
|
313
|
+
horizontal: [
|
|
314
|
+
"flex-row items-center",
|
|
315
|
+
"[&>[data-slot=field-label]]:flex-auto",
|
|
316
|
+
"has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
317
|
+
],
|
|
318
|
+
responsive: [
|
|
319
|
+
"flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto",
|
|
320
|
+
"@md/field-group:[&>[data-slot=field-label]]:flex-auto",
|
|
321
|
+
"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
322
|
+
],
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
defaultVariants: {
|
|
326
|
+
orientation: "vertical",
|
|
327
|
+
},
|
|
328
|
+
}
|
|
329
|
+
)
|
|
330
|
+
|
|
331
|
+
function Field({
|
|
332
|
+
className,
|
|
333
|
+
orientation = "vertical",
|
|
334
|
+
...props
|
|
335
|
+
}: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>) {
|
|
336
|
+
return (
|
|
337
|
+
<div
|
|
338
|
+
role="group"
|
|
339
|
+
data-slot="field"
|
|
340
|
+
data-orientation={orientation}
|
|
341
|
+
className={cn(fieldVariants({ orientation }), className)}
|
|
342
|
+
{...props}
|
|
343
|
+
/>
|
|
344
|
+
)
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
function FieldContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
348
|
+
return (
|
|
349
|
+
<div
|
|
350
|
+
data-slot="field-content"
|
|
351
|
+
className={cn(
|
|
352
|
+
"group/field-content flex flex-1 flex-col gap-1.5 leading-snug",
|
|
353
|
+
className
|
|
354
|
+
)}
|
|
355
|
+
{...props}
|
|
356
|
+
/>
|
|
357
|
+
)
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
function FieldLabel({
|
|
361
|
+
className,
|
|
362
|
+
...props
|
|
363
|
+
}: React.ComponentProps<typeof Label>) {
|
|
364
|
+
return (
|
|
365
|
+
<Label
|
|
366
|
+
data-slot="field-label"
|
|
367
|
+
className={cn(
|
|
368
|
+
"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50",
|
|
369
|
+
"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4",
|
|
370
|
+
"has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",
|
|
371
|
+
className
|
|
372
|
+
)}
|
|
373
|
+
{...props}
|
|
374
|
+
/>
|
|
375
|
+
)
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
function FieldTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
379
|
+
return (
|
|
380
|
+
<div
|
|
381
|
+
data-slot="field-label"
|
|
382
|
+
className={cn(
|
|
383
|
+
"flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50",
|
|
384
|
+
className
|
|
385
|
+
)}
|
|
386
|
+
{...props}
|
|
387
|
+
/>
|
|
388
|
+
)
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
function FieldDescription({ className, ...props }: React.ComponentProps<"p">) {
|
|
392
|
+
return (
|
|
393
|
+
<p
|
|
394
|
+
data-slot="field-description"
|
|
395
|
+
className={cn(
|
|
396
|
+
"text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance",
|
|
397
|
+
"last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",
|
|
398
|
+
"[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
|
|
399
|
+
className
|
|
400
|
+
)}
|
|
401
|
+
{...props}
|
|
402
|
+
/>
|
|
403
|
+
)
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
function FieldSeparator({
|
|
407
|
+
children,
|
|
408
|
+
className,
|
|
409
|
+
...props
|
|
410
|
+
}: React.ComponentProps<"div"> & {
|
|
411
|
+
children?: React.ReactNode
|
|
412
|
+
}) {
|
|
413
|
+
return (
|
|
414
|
+
<div
|
|
415
|
+
data-slot="field-separator"
|
|
416
|
+
data-content={!!children}
|
|
417
|
+
className={cn(
|
|
418
|
+
"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",
|
|
419
|
+
className
|
|
420
|
+
)}
|
|
421
|
+
{...props}
|
|
422
|
+
>
|
|
423
|
+
<Separator className="absolute inset-0 top-1/2" />
|
|
424
|
+
{children && (
|
|
425
|
+
<span
|
|
426
|
+
className="bg-background text-muted-foreground relative mx-auto block w-fit px-2"
|
|
427
|
+
data-slot="field-separator-content"
|
|
428
|
+
>
|
|
429
|
+
{children}
|
|
430
|
+
</span>
|
|
431
|
+
)}
|
|
432
|
+
</div>
|
|
433
|
+
)
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
function FieldError({
|
|
437
|
+
className,
|
|
438
|
+
children,
|
|
439
|
+
errors,
|
|
440
|
+
...props
|
|
441
|
+
}: React.ComponentProps<"div"> & {
|
|
442
|
+
errors?: Array<{ message?: string } | undefined>
|
|
443
|
+
}) {
|
|
444
|
+
const content = useMemo(() => {
|
|
445
|
+
if (children) {
|
|
446
|
+
return children
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
if (!errors) {
|
|
450
|
+
return null
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
if (errors?.length === 1 && errors[0]?.message) {
|
|
454
|
+
return errors[0].message
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
return (
|
|
458
|
+
<ul className="ml-4 flex list-disc flex-col gap-1">
|
|
459
|
+
{errors.map(
|
|
460
|
+
(error, index) =>
|
|
461
|
+
error?.message && <li key={index}>{error.message}</li>
|
|
462
|
+
)}
|
|
463
|
+
</ul>
|
|
464
|
+
)
|
|
465
|
+
}, [children, errors])
|
|
466
|
+
|
|
467
|
+
if (!content) {
|
|
468
|
+
return null
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
return (
|
|
472
|
+
<div
|
|
473
|
+
role="alert"
|
|
474
|
+
data-slot="field-error"
|
|
475
|
+
className={cn("text-destructive text-sm font-normal", className)}
|
|
476
|
+
{...props}
|
|
477
|
+
>
|
|
478
|
+
{content}
|
|
479
|
+
</div>
|
|
480
|
+
)
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
export {
|
|
484
|
+
Field,
|
|
485
|
+
FieldLabel,
|
|
486
|
+
FieldDescription,
|
|
487
|
+
FieldError,
|
|
488
|
+
FieldGroup,
|
|
489
|
+
FieldLegend,
|
|
490
|
+
FieldSeparator,
|
|
491
|
+
FieldSet,
|
|
492
|
+
FieldContent,
|
|
493
|
+
FieldTitle,
|
|
494
|
+
}
|