gladvn 0.2.14
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/README.md +112 -0
- package/bin/cli.js +326 -0
- package/dist/components/macro/accordion-preset.d.ts +14 -0
- package/dist/components/macro/accordion-preset.d.ts.map +1 -0
- package/dist/components/macro/alert-dialog-preset.d.ts +26 -0
- package/dist/components/macro/alert-dialog-preset.d.ts.map +1 -0
- package/dist/components/macro/alert-preset.d.ts +14 -0
- package/dist/components/macro/alert-preset.d.ts.map +1 -0
- package/dist/components/macro/avatar-preset.d.ts +11 -0
- package/dist/components/macro/avatar-preset.d.ts.map +1 -0
- package/dist/components/macro/breadcrumb-preset.d.ts +12 -0
- package/dist/components/macro/breadcrumb-preset.d.ts.map +1 -0
- package/dist/components/macro/card-preset.d.ts +10 -0
- package/dist/components/macro/card-preset.d.ts.map +1 -0
- package/dist/components/macro/carousel-preset.d.ts +18 -0
- package/dist/components/macro/carousel-preset.d.ts.map +1 -0
- package/dist/components/macro/checkbox-preset.d.ts +14 -0
- package/dist/components/macro/checkbox-preset.d.ts.map +1 -0
- package/dist/components/macro/combobox-preset.d.ts +27 -0
- package/dist/components/macro/combobox-preset.d.ts.map +1 -0
- package/dist/components/macro/command-preset.d.ts +16 -0
- package/dist/components/macro/command-preset.d.ts.map +1 -0
- package/dist/components/macro/date-picker.d.ts +62 -0
- package/dist/components/macro/date-picker.d.ts.map +1 -0
- package/dist/components/macro/dialog-preset.d.ts +24 -0
- package/dist/components/macro/dialog-preset.d.ts.map +1 -0
- package/dist/components/macro/empty-preset.d.ts +15 -0
- package/dist/components/macro/empty-preset.d.ts.map +1 -0
- package/dist/components/macro/field-preset.d.ts +15 -0
- package/dist/components/macro/field-preset.d.ts.map +1 -0
- package/dist/components/macro/index.d.ts +22 -0
- package/dist/components/macro/index.d.ts.map +1 -0
- package/dist/components/macro/input-otp-preset.d.ts +13 -0
- package/dist/components/macro/input-otp-preset.d.ts.map +1 -0
- package/dist/components/macro/input-preset.d.ts +21 -0
- package/dist/components/macro/input-preset.d.ts.map +1 -0
- package/dist/components/macro/pagination-preset.d.ts +13 -0
- package/dist/components/macro/pagination-preset.d.ts.map +1 -0
- package/dist/components/macro/progress-preset.d.ts +10 -0
- package/dist/components/macro/progress-preset.d.ts.map +1 -0
- package/dist/components/macro/radio-group-preset.d.ts +22 -0
- package/dist/components/macro/radio-group-preset.d.ts.map +1 -0
- package/dist/components/macro/select-preset.d.ts +42 -0
- package/dist/components/macro/select-preset.d.ts.map +1 -0
- package/dist/components/macro/slider-preset.d.ts +12 -0
- package/dist/components/macro/slider-preset.d.ts.map +1 -0
- package/dist/components/macro/switch-preset.d.ts +12 -0
- package/dist/components/macro/switch-preset.d.ts.map +1 -0
- package/dist/components/macro/tabs-preset.d.ts +17 -0
- package/dist/components/macro/tabs-preset.d.ts.map +1 -0
- package/dist/components/macro/textarea-preset.d.ts +17 -0
- package/dist/components/macro/textarea-preset.d.ts.map +1 -0
- package/dist/components/micro/accordion.d.ts +8 -0
- package/dist/components/micro/accordion.d.ts.map +1 -0
- package/dist/components/micro/alert-dialog.d.ts +33 -0
- package/dist/components/micro/alert-dialog.d.ts.map +1 -0
- package/dist/components/micro/alert.d.ts +28 -0
- package/dist/components/micro/alert.d.ts.map +1 -0
- package/dist/components/micro/aspect-ratio.d.ts +13 -0
- package/dist/components/micro/aspect-ratio.d.ts.map +1 -0
- package/dist/components/micro/avatar.d.ts +23 -0
- package/dist/components/micro/avatar.d.ts.map +1 -0
- package/dist/components/micro/badge.d.ts +16 -0
- package/dist/components/micro/badge.d.ts.map +1 -0
- package/dist/components/micro/breadcrumb.d.ts +24 -0
- package/dist/components/micro/breadcrumb.d.ts.map +1 -0
- package/dist/components/micro/button.d.ts +39 -0
- package/dist/components/micro/button.d.ts.map +1 -0
- package/dist/components/micro/calendar.d.ts +28 -0
- package/dist/components/micro/calendar.d.ts.map +1 -0
- package/dist/components/micro/card.d.ts +28 -0
- package/dist/components/micro/card.d.ts.map +1 -0
- package/dist/components/micro/carousel.d.ts +29 -0
- package/dist/components/micro/carousel.d.ts.map +1 -0
- package/dist/components/micro/chart.d.ts +49 -0
- package/dist/components/micro/chart.d.ts.map +1 -0
- package/dist/components/micro/checkbox.d.ts +17 -0
- package/dist/components/micro/checkbox.d.ts.map +1 -0
- package/dist/components/micro/collapsible.d.ts +15 -0
- package/dist/components/micro/collapsible.d.ts.map +1 -0
- package/dist/components/micro/combobox.d.ts +33 -0
- package/dist/components/micro/combobox.d.ts.map +1 -0
- package/dist/components/micro/command.d.ts +79 -0
- package/dist/components/micro/command.d.ts.map +1 -0
- package/dist/components/micro/context-menu.d.ts +60 -0
- package/dist/components/micro/context-menu.d.ts.map +1 -0
- package/dist/components/micro/dialog.d.ts +14 -0
- package/dist/components/micro/dialog.d.ts.map +1 -0
- package/dist/components/micro/direction.d.ts +2 -0
- package/dist/components/micro/direction.d.ts.map +1 -0
- package/dist/components/micro/drawer.d.ts +17 -0
- package/dist/components/micro/drawer.d.ts.map +1 -0
- package/dist/components/micro/dropdown-menu.d.ts +37 -0
- package/dist/components/micro/dropdown-menu.d.ts.map +1 -0
- package/dist/components/micro/empty.d.ts +23 -0
- package/dist/components/micro/empty.d.ts.map +1 -0
- package/dist/components/micro/field.d.ts +29 -0
- package/dist/components/micro/field.d.ts.map +1 -0
- package/dist/components/micro/hover-card.d.ts +17 -0
- package/dist/components/micro/hover-card.d.ts.map +1 -0
- package/dist/components/micro/input-group.d.ts +17 -0
- package/dist/components/micro/input-group.d.ts.map +1 -0
- package/dist/components/micro/input-otp.d.ts +44 -0
- package/dist/components/micro/input-otp.d.ts.map +1 -0
- package/dist/components/micro/input.d.ts +22 -0
- package/dist/components/micro/input.d.ts.map +1 -0
- package/dist/components/micro/item.d.ts +31 -0
- package/dist/components/micro/item.d.ts.map +1 -0
- package/dist/components/micro/kbd.d.ts +9 -0
- package/dist/components/micro/kbd.d.ts.map +1 -0
- package/dist/components/micro/label.d.ts +15 -0
- package/dist/components/micro/label.d.ts.map +1 -0
- package/dist/components/micro/menubar.d.ts +41 -0
- package/dist/components/micro/menubar.d.ts.map +1 -0
- package/dist/components/micro/navigation-menu.d.ts +18 -0
- package/dist/components/micro/navigation-menu.d.ts.map +1 -0
- package/dist/components/micro/pagination.d.ts +33 -0
- package/dist/components/micro/pagination.d.ts.map +1 -0
- package/dist/components/micro/popover.d.ts +23 -0
- package/dist/components/micro/popover.d.ts.map +1 -0
- package/dist/components/micro/progress.d.ts +19 -0
- package/dist/components/micro/progress.d.ts.map +1 -0
- package/dist/components/micro/radio-group.d.ts +13 -0
- package/dist/components/micro/radio-group.d.ts.map +1 -0
- package/dist/components/micro/resizable.d.ts +12 -0
- package/dist/components/micro/resizable.d.ts.map +1 -0
- package/dist/components/micro/scroll-area.d.ts +12 -0
- package/dist/components/micro/scroll-area.d.ts.map +1 -0
- package/dist/components/micro/select.d.ts +21 -0
- package/dist/components/micro/select.d.ts.map +1 -0
- package/dist/components/micro/separator.d.ts +9 -0
- package/dist/components/micro/separator.d.ts.map +1 -0
- package/dist/components/micro/sheet.d.ts +17 -0
- package/dist/components/micro/sheet.d.ts.map +1 -0
- package/dist/components/micro/sidebar.d.ts +28 -0
- package/dist/components/micro/sidebar.d.ts.map +1 -0
- package/dist/components/micro/skeleton.d.ts +9 -0
- package/dist/components/micro/skeleton.d.ts.map +1 -0
- package/dist/components/micro/slider.d.ts +14 -0
- package/dist/components/micro/slider.d.ts.map +1 -0
- package/dist/components/micro/sonner.d.ts +5 -0
- package/dist/components/micro/sonner.d.ts.map +1 -0
- package/dist/components/micro/spinner.d.ts +21 -0
- package/dist/components/micro/spinner.d.ts.map +1 -0
- package/dist/components/micro/switch.d.ts +13 -0
- package/dist/components/micro/switch.d.ts.map +1 -0
- package/dist/components/micro/table.d.ts +17 -0
- package/dist/components/micro/table.d.ts.map +1 -0
- package/dist/components/micro/tabs.d.ts +13 -0
- package/dist/components/micro/tabs.d.ts.map +1 -0
- package/dist/components/micro/textarea.d.ts +17 -0
- package/dist/components/micro/textarea.d.ts.map +1 -0
- package/dist/components/micro/theme-provider.d.ts +76 -0
- package/dist/components/micro/theme-provider.d.ts.map +1 -0
- package/dist/components/micro/toggle-group.d.ts +22 -0
- package/dist/components/micro/toggle-group.d.ts.map +1 -0
- package/dist/components/micro/toggle.d.ts +16 -0
- package/dist/components/micro/toggle.d.ts.map +1 -0
- package/dist/components/micro/tooltip.d.ts +20 -0
- package/dist/components/micro/tooltip.d.ts.map +1 -0
- package/dist/dev/App.d.ts +3 -0
- package/dist/dev/App.d.ts.map +1 -0
- package/dist/dev/components/GladcnLogo.d.ts +10 -0
- package/dist/dev/components/GladcnLogo.d.ts.map +1 -0
- package/dist/dev/components/code-highlighter.d.ts +5 -0
- package/dist/dev/components/code-highlighter.d.ts.map +1 -0
- package/dist/dev/components/dev-context.d.ts +12 -0
- package/dist/dev/components/dev-context.d.ts.map +1 -0
- package/dist/dev/components/showcase.d.ts +72 -0
- package/dist/dev/components/showcase.d.ts.map +1 -0
- package/dist/dev/data.d.ts +68 -0
- package/dist/dev/data.d.ts.map +1 -0
- package/dist/dev/main.d.ts +1 -0
- package/dist/dev/main.d.ts.map +1 -0
- package/dist/dev/sections/buttons.d.ts +2 -0
- package/dist/dev/sections/buttons.d.ts.map +1 -0
- package/dist/dev/sections/display.d.ts +2 -0
- package/dist/dev/sections/display.d.ts.map +1 -0
- package/dist/dev/sections/feedback.d.ts +2 -0
- package/dist/dev/sections/feedback.d.ts.map +1 -0
- package/dist/dev/sections/forms.d.ts +2 -0
- package/dist/dev/sections/forms.d.ts.map +1 -0
- package/dist/dev/sections/interactive.d.ts +2 -0
- package/dist/dev/sections/interactive.d.ts.map +1 -0
- package/dist/dev/sections/overview.d.ts +2 -0
- package/dist/dev/sections/overview.d.ts.map +1 -0
- package/dist/dev/showcase/accordion.d.ts +2 -0
- package/dist/dev/showcase/accordion.d.ts.map +1 -0
- package/dist/dev/showcase/alert-dialog.d.ts +2 -0
- package/dist/dev/showcase/alert-dialog.d.ts.map +1 -0
- package/dist/dev/showcase/alert.d.ts +2 -0
- package/dist/dev/showcase/alert.d.ts.map +1 -0
- package/dist/dev/showcase/aspect-ratio.d.ts +2 -0
- package/dist/dev/showcase/aspect-ratio.d.ts.map +1 -0
- package/dist/dev/showcase/avatar.d.ts +2 -0
- package/dist/dev/showcase/avatar.d.ts.map +1 -0
- package/dist/dev/showcase/badge.d.ts +2 -0
- package/dist/dev/showcase/badge.d.ts.map +1 -0
- package/dist/dev/showcase/breadcrumb.d.ts +2 -0
- package/dist/dev/showcase/breadcrumb.d.ts.map +1 -0
- package/dist/dev/showcase/button.d.ts +2 -0
- package/dist/dev/showcase/button.d.ts.map +1 -0
- package/dist/dev/showcase/calendar.d.ts +2 -0
- package/dist/dev/showcase/calendar.d.ts.map +1 -0
- package/dist/dev/showcase/card.d.ts +2 -0
- package/dist/dev/showcase/card.d.ts.map +1 -0
- package/dist/dev/showcase/carousel.d.ts +2 -0
- package/dist/dev/showcase/carousel.d.ts.map +1 -0
- package/dist/dev/showcase/chart.d.ts +2 -0
- package/dist/dev/showcase/chart.d.ts.map +1 -0
- package/dist/dev/showcase/checkbox.d.ts +2 -0
- package/dist/dev/showcase/checkbox.d.ts.map +1 -0
- package/dist/dev/showcase/collapsible.d.ts +3 -0
- package/dist/dev/showcase/collapsible.d.ts.map +1 -0
- package/dist/dev/showcase/combobox.d.ts +2 -0
- package/dist/dev/showcase/combobox.d.ts.map +1 -0
- package/dist/dev/showcase/command.d.ts +2 -0
- package/dist/dev/showcase/command.d.ts.map +1 -0
- package/dist/dev/showcase/context-menu.d.ts +2 -0
- package/dist/dev/showcase/context-menu.d.ts.map +1 -0
- package/dist/dev/showcase/dialog.d.ts +2 -0
- package/dist/dev/showcase/dialog.d.ts.map +1 -0
- package/dist/dev/showcase/drawer.d.ts +2 -0
- package/dist/dev/showcase/drawer.d.ts.map +1 -0
- package/dist/dev/showcase/dropdown-menu.d.ts +2 -0
- package/dist/dev/showcase/dropdown-menu.d.ts.map +1 -0
- package/dist/dev/showcase/empty.d.ts +2 -0
- package/dist/dev/showcase/empty.d.ts.map +1 -0
- package/dist/dev/showcase/hover-card.d.ts +2 -0
- package/dist/dev/showcase/hover-card.d.ts.map +1 -0
- package/dist/dev/showcase/input-group.d.ts +2 -0
- package/dist/dev/showcase/input-group.d.ts.map +1 -0
- package/dist/dev/showcase/input-otp.d.ts +2 -0
- package/dist/dev/showcase/input-otp.d.ts.map +1 -0
- package/dist/dev/showcase/input.d.ts +2 -0
- package/dist/dev/showcase/input.d.ts.map +1 -0
- package/dist/dev/showcase/item.d.ts +2 -0
- package/dist/dev/showcase/item.d.ts.map +1 -0
- package/dist/dev/showcase/kbd.d.ts +2 -0
- package/dist/dev/showcase/kbd.d.ts.map +1 -0
- package/dist/dev/showcase/label.d.ts +2 -0
- package/dist/dev/showcase/label.d.ts.map +1 -0
- package/dist/dev/showcase/menubar.d.ts +2 -0
- package/dist/dev/showcase/menubar.d.ts.map +1 -0
- package/dist/dev/showcase/navigation-menu.d.ts +3 -0
- package/dist/dev/showcase/navigation-menu.d.ts.map +1 -0
- package/dist/dev/showcase/overview.d.ts +2 -0
- package/dist/dev/showcase/overview.d.ts.map +1 -0
- package/dist/dev/showcase/pagination.d.ts +2 -0
- package/dist/dev/showcase/pagination.d.ts.map +1 -0
- package/dist/dev/showcase/popover.d.ts +2 -0
- package/dist/dev/showcase/popover.d.ts.map +1 -0
- package/dist/dev/showcase/progress.d.ts +2 -0
- package/dist/dev/showcase/progress.d.ts.map +1 -0
- package/dist/dev/showcase/radio-group.d.ts +2 -0
- package/dist/dev/showcase/radio-group.d.ts.map +1 -0
- package/dist/dev/showcase/resizable.d.ts +2 -0
- package/dist/dev/showcase/resizable.d.ts.map +1 -0
- package/dist/dev/showcase/scroll-area.d.ts +2 -0
- package/dist/dev/showcase/scroll-area.d.ts.map +1 -0
- package/dist/dev/showcase/select.d.ts +2 -0
- package/dist/dev/showcase/select.d.ts.map +1 -0
- package/dist/dev/showcase/separator.d.ts +2 -0
- package/dist/dev/showcase/separator.d.ts.map +1 -0
- package/dist/dev/showcase/sheet.d.ts +2 -0
- package/dist/dev/showcase/sheet.d.ts.map +1 -0
- package/dist/dev/showcase/sidebar.d.ts +2 -0
- package/dist/dev/showcase/sidebar.d.ts.map +1 -0
- package/dist/dev/showcase/skeleton.d.ts +2 -0
- package/dist/dev/showcase/skeleton.d.ts.map +1 -0
- package/dist/dev/showcase/slider.d.ts +2 -0
- package/dist/dev/showcase/slider.d.ts.map +1 -0
- package/dist/dev/showcase/sonner.d.ts +2 -0
- package/dist/dev/showcase/sonner.d.ts.map +1 -0
- package/dist/dev/showcase/spinner.d.ts +2 -0
- package/dist/dev/showcase/spinner.d.ts.map +1 -0
- package/dist/dev/showcase/switch.d.ts +2 -0
- package/dist/dev/showcase/switch.d.ts.map +1 -0
- package/dist/dev/showcase/table.d.ts +2 -0
- package/dist/dev/showcase/table.d.ts.map +1 -0
- package/dist/dev/showcase/tabs.d.ts +2 -0
- package/dist/dev/showcase/tabs.d.ts.map +1 -0
- package/dist/dev/showcase/textarea.d.ts +2 -0
- package/dist/dev/showcase/textarea.d.ts.map +1 -0
- package/dist/dev/showcase/theme-provider.d.ts +2 -0
- package/dist/dev/showcase/theme-provider.d.ts.map +1 -0
- package/dist/dev/showcase/toast.d.ts +2 -0
- package/dist/dev/showcase/toast.d.ts.map +1 -0
- package/dist/dev/showcase/toggle-group.d.ts +2 -0
- package/dist/dev/showcase/toggle-group.d.ts.map +1 -0
- package/dist/dev/showcase/toggle.d.ts +2 -0
- package/dist/dev/showcase/toggle.d.ts.map +1 -0
- package/dist/dev/showcase/tooltip.d.ts +2 -0
- package/dist/dev/showcase/tooltip.d.ts.map +1 -0
- package/dist/hooks/use-controllable-state.d.ts +14 -0
- package/dist/hooks/use-controllable-state.d.ts.map +1 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/index.cjs +5099 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4740 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/types.d.ts +4 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/preset.d.ts +18 -0
- package/dist/preset.d.ts.map +1 -0
- package/dist/test/setup.d.ts +1 -0
- package/dist/test/setup.d.ts.map +1 -0
- package/llms.txt +74 -0
- package/package.json +117 -0
- package/scripts/add-icononly-prop.ts +84 -0
- package/scripts/audit-best-practices.ts +114 -0
- package/scripts/audit-showcase.ts +262 -0
- package/scripts/audit-showcases.ts +83 -0
- package/scripts/clean-imports.ts +21 -0
- package/scripts/count_missing.ts +24 -0
- package/scripts/find-css-vars.ts +62 -0
- package/scripts/fix-portals.ts +90 -0
- package/scripts/full-audit.ts +89 -0
- package/scripts/merge-components.cjs +65 -0
- package/scripts/merge-components.js +64 -0
- package/scripts/optimize-barrel.ts +116 -0
- package/scripts/postinstall.cjs +228 -0
- package/scripts/refactor_divs.ts +39 -0
- package/scripts/remove_div_wrappers.ts +17 -0
- package/scripts/update-gaps.ts +83 -0
- package/scripts/update_showcase_codestrings.ts +87 -0
- package/src/components/macro/accordion-preset.test.tsx +37 -0
- package/src/components/macro/accordion-preset.tsx +41 -0
- package/src/components/macro/alert-dialog-preset.tsx +116 -0
- package/src/components/macro/alert-preset.tsx +94 -0
- package/src/components/macro/avatar-preset.tsx +54 -0
- package/src/components/macro/breadcrumb-preset.tsx +50 -0
- package/src/components/macro/card-preset.tsx +44 -0
- package/src/components/macro/carousel-preset.tsx +150 -0
- package/src/components/macro/checkbox-preset.test.tsx +49 -0
- package/src/components/macro/checkbox-preset.tsx +84 -0
- package/src/components/macro/combobox-preset.tsx +171 -0
- package/src/components/macro/command-preset.tsx +74 -0
- package/src/components/macro/date-picker.tsx +289 -0
- package/src/components/macro/dialog-preset.tsx +105 -0
- package/src/components/macro/empty-preset.tsx +46 -0
- package/src/components/macro/field-preset.test.tsx +69 -0
- package/src/components/macro/field-preset.tsx +65 -0
- package/src/components/macro/index.ts +21 -0
- package/src/components/macro/input-otp-preset.tsx +98 -0
- package/src/components/macro/input-preset.test.tsx +52 -0
- package/src/components/macro/input-preset.tsx +139 -0
- package/src/components/macro/pagination-preset.tsx +153 -0
- package/src/components/macro/progress-preset.test.tsx +65 -0
- package/src/components/macro/progress-preset.tsx +45 -0
- package/src/components/macro/radio-group-preset.tsx +115 -0
- package/src/components/macro/select-preset.tsx +168 -0
- package/src/components/macro/slider-preset.test.tsx +43 -0
- package/src/components/macro/slider-preset.tsx +86 -0
- package/src/components/macro/switch-preset.test.tsx +53 -0
- package/src/components/macro/switch-preset.tsx +70 -0
- package/src/components/macro/tabs-preset.test.tsx +31 -0
- package/src/components/macro/tabs-preset.tsx +51 -0
- package/src/components/macro/textarea-preset.test.tsx +39 -0
- package/src/components/macro/textarea-preset.tsx +55 -0
- package/src/components/micro/accordion.tsx +76 -0
- package/src/components/micro/alert-dialog.tsx +213 -0
- package/src/components/micro/alert.tsx +146 -0
- package/src/components/micro/aspect-ratio.tsx +38 -0
- package/src/components/micro/avatar.tsx +143 -0
- package/src/components/micro/badge.tsx +207 -0
- package/src/components/micro/breadcrumb.tsx +162 -0
- package/src/components/micro/button.test.tsx +25 -0
- package/src/components/micro/button.tsx +361 -0
- package/src/components/micro/calendar.tsx +383 -0
- package/src/components/micro/card.tsx +112 -0
- package/src/components/micro/carousel.tsx +341 -0
- package/src/components/micro/chart.tsx +392 -0
- package/src/components/micro/checkbox.tsx +74 -0
- package/src/components/micro/collapsible.tsx +65 -0
- package/src/components/micro/combobox.tsx +349 -0
- package/src/components/micro/command.tsx +238 -0
- package/src/components/micro/context-menu.tsx +285 -0
- package/src/components/micro/dialog.tsx +143 -0
- package/src/components/micro/direction.tsx +13 -0
- package/src/components/micro/drawer.tsx +149 -0
- package/src/components/micro/dropdown-menu.tsx +305 -0
- package/src/components/micro/empty.tsx +144 -0
- package/src/components/micro/field.tsx +311 -0
- package/src/components/micro/hover-card.tsx +86 -0
- package/src/components/micro/input-group.tsx +269 -0
- package/src/components/micro/input-otp.tsx +130 -0
- package/src/components/micro/input.tsx +56 -0
- package/src/components/micro/item.tsx +206 -0
- package/src/components/micro/kbd.tsx +38 -0
- package/src/components/micro/label.tsx +48 -0
- package/src/components/micro/menubar.tsx +302 -0
- package/src/components/micro/navigation-menu.tsx +197 -0
- package/src/components/micro/pagination.tsx +162 -0
- package/src/components/micro/popover.tsx +131 -0
- package/src/components/micro/progress.tsx +144 -0
- package/src/components/micro/radio-group.tsx +73 -0
- package/src/components/micro/resizable.tsx +64 -0
- package/src/components/micro/scroll-area.tsx +68 -0
- package/src/components/micro/select.tsx +234 -0
- package/src/components/micro/separator.tsx +37 -0
- package/src/components/micro/sheet.tsx +144 -0
- package/src/components/micro/sidebar.tsx +238 -0
- package/src/components/micro/skeleton.tsx +29 -0
- package/src/components/micro/slider.tsx +135 -0
- package/src/components/micro/sonner.tsx +85 -0
- package/src/components/micro/spinner.tsx +44 -0
- package/src/components/micro/switch.tsx +70 -0
- package/src/components/micro/table.tsx +210 -0
- package/src/components/micro/tabs.tsx +100 -0
- package/src/components/micro/textarea.tsx +53 -0
- package/src/components/micro/theme-provider.tsx +163 -0
- package/src/components/micro/toggle-group.tsx +121 -0
- package/src/components/micro/toggle.tsx +55 -0
- package/src/components/micro/tooltip.tsx +105 -0
- package/src/dev/App.tsx +322 -0
- package/src/dev/_debug_select.html +29 -0
- package/src/dev/components/GladcnLogo.tsx +80 -0
- package/src/dev/components/code-highlighter.tsx +67 -0
- package/src/dev/components/dev-context.tsx +31 -0
- package/src/dev/components/showcase.tsx +413 -0
- package/src/dev/data.ts +341 -0
- package/src/dev/index.css +55 -0
- package/src/dev/main.tsx +30 -0
- package/src/dev/sections/buttons.tsx +303 -0
- package/src/dev/sections/display.tsx +270 -0
- package/src/dev/sections/feedback.tsx +371 -0
- package/src/dev/sections/forms.tsx +652 -0
- package/src/dev/sections/interactive.tsx +51 -0
- package/src/dev/sections/overview.tsx +396 -0
- package/src/dev/showcase/accordion.tsx +947 -0
- package/src/dev/showcase/alert-dialog.tsx +1056 -0
- package/src/dev/showcase/alert.tsx +756 -0
- package/src/dev/showcase/aspect-ratio.tsx +339 -0
- package/src/dev/showcase/avatar.tsx +470 -0
- package/src/dev/showcase/badge.tsx +227 -0
- package/src/dev/showcase/breadcrumb.tsx +269 -0
- package/src/dev/showcase/button.tsx +309 -0
- package/src/dev/showcase/calendar.tsx +380 -0
- package/src/dev/showcase/card.tsx +448 -0
- package/src/dev/showcase/carousel.tsx +562 -0
- package/src/dev/showcase/chart.tsx +130 -0
- package/src/dev/showcase/checkbox.tsx +611 -0
- package/src/dev/showcase/collapsible.tsx +298 -0
- package/src/dev/showcase/combobox.tsx +777 -0
- package/src/dev/showcase/command.tsx +245 -0
- package/src/dev/showcase/context-menu.tsx +239 -0
- package/src/dev/showcase/dialog.tsx +1141 -0
- package/src/dev/showcase/drawer.tsx +392 -0
- package/src/dev/showcase/dropdown-menu.tsx +420 -0
- package/src/dev/showcase/empty.tsx +493 -0
- package/src/dev/showcase/hover-card.tsx +336 -0
- package/src/dev/showcase/input-group.tsx +511 -0
- package/src/dev/showcase/input-otp.tsx +404 -0
- package/src/dev/showcase/input.tsx +530 -0
- package/src/dev/showcase/item.tsx +295 -0
- package/src/dev/showcase/kbd.tsx +276 -0
- package/src/dev/showcase/label.tsx +121 -0
- package/src/dev/showcase/menubar.tsx +392 -0
- package/src/dev/showcase/navigation-menu.tsx +304 -0
- package/src/dev/showcase/overview.tsx +1106 -0
- package/src/dev/showcase/pagination.tsx +312 -0
- package/src/dev/showcase/popover.tsx +374 -0
- package/src/dev/showcase/progress.tsx +299 -0
- package/src/dev/showcase/radio-group.tsx +612 -0
- package/src/dev/showcase/resizable.tsx +237 -0
- package/src/dev/showcase/scroll-area.tsx +157 -0
- package/src/dev/showcase/select.tsx +628 -0
- package/src/dev/showcase/separator.tsx +126 -0
- package/src/dev/showcase/sheet.tsx +566 -0
- package/src/dev/showcase/sidebar.tsx +120 -0
- package/src/dev/showcase/skeleton.tsx +213 -0
- package/src/dev/showcase/slider.tsx +506 -0
- package/src/dev/showcase/sonner.tsx +376 -0
- package/src/dev/showcase/spinner.tsx +124 -0
- package/src/dev/showcase/switch.tsx +602 -0
- package/src/dev/showcase/table.tsx +196 -0
- package/src/dev/showcase/tabs.tsx +662 -0
- package/src/dev/showcase/textarea.tsx +498 -0
- package/src/dev/showcase/theme-provider.tsx +894 -0
- package/src/dev/showcase/toast.tsx +119 -0
- package/src/dev/showcase/toggle-group.tsx +223 -0
- package/src/dev/showcase/toggle.tsx +171 -0
- package/src/dev/showcase/tooltip.tsx +372 -0
- package/src/hooks/use-controllable-state.ts +87 -0
- package/src/hooks/use-mobile.ts +21 -0
- package/src/index.ts +62 -0
- package/src/lib/types.ts +14 -0
- package/src/lib/utils.test.ts +14 -0
- package/src/lib/utils.ts +6 -0
- package/src/preset.ts +17 -0
- package/src/styles/gladcn.css +116 -0
- package/src/styles/tokens.css +213 -0
- package/src/test/setup.ts +8 -0
- package/src/vite-env.d.ts +1 -0
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
import { useDevContext } from "../../dev/components/dev-context";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
DocsCode,
|
|
6
|
+
DocsH3,
|
|
7
|
+
DocsLi,
|
|
8
|
+
DocsP,
|
|
9
|
+
DocsUl,
|
|
10
|
+
ExampleGrid,
|
|
11
|
+
ExampleSection,
|
|
12
|
+
Showcase,
|
|
13
|
+
ShowcaseDocs,
|
|
14
|
+
} from "../../dev/components/showcase";
|
|
15
|
+
import {
|
|
16
|
+
DollarSignIcon,
|
|
17
|
+
EyeIcon,
|
|
18
|
+
EyeOffIcon,
|
|
19
|
+
GlobeIcon,
|
|
20
|
+
MinusIcon,
|
|
21
|
+
PlusIcon,
|
|
22
|
+
SearchIcon,
|
|
23
|
+
XIcon,
|
|
24
|
+
} from "lucide-react";
|
|
25
|
+
|
|
26
|
+
import {
|
|
27
|
+
InputGroup,
|
|
28
|
+
InputGroupAddon,
|
|
29
|
+
InputGroupButton,
|
|
30
|
+
InputGroupInput,
|
|
31
|
+
InputGroupText,
|
|
32
|
+
InputGroupTextarea,
|
|
33
|
+
} from "../../components/micro/input-group";
|
|
34
|
+
import { type Size } from "../../lib/types";
|
|
35
|
+
|
|
36
|
+
function InputGroupMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
37
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
38
|
+
const [clearValue, setClearValue] = useState("Hello world");
|
|
39
|
+
const [count, setCount] = useState(0);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div className="space-y-10 mt-6">
|
|
43
|
+
{/* ── Text / Icon Addons ─────────────────────────────── */}
|
|
44
|
+
<ExampleGrid>
|
|
45
|
+
<ExampleSection
|
|
46
|
+
label="Text Prefix & Suffix"
|
|
47
|
+
description="InputGroupAddon với văn bản — click addon để focus input."
|
|
48
|
+
codeString={`<InputGroup size="md">
|
|
49
|
+
<InputGroupAddon>
|
|
50
|
+
<InputGroupText>https://</InputGroupText>
|
|
51
|
+
</InputGroupAddon>
|
|
52
|
+
<InputGroupInput id="url-input" placeholder="example.com" />
|
|
53
|
+
<InputGroupAddon align="end">
|
|
54
|
+
<InputGroupText>.vn</InputGroupText>
|
|
55
|
+
</InputGroupAddon>
|
|
56
|
+
</InputGroup>`}
|
|
57
|
+
>
|
|
58
|
+
<InputGroup size={globalSize} className="w-full">
|
|
59
|
+
<InputGroupAddon>
|
|
60
|
+
<InputGroupText>https://</InputGroupText>
|
|
61
|
+
</InputGroupAddon>
|
|
62
|
+
<InputGroupInput id="ig-url" placeholder="example.com" />
|
|
63
|
+
<InputGroupAddon align="end">
|
|
64
|
+
<InputGroupText>.vn</InputGroupText>
|
|
65
|
+
</InputGroupAddon>
|
|
66
|
+
</InputGroup>
|
|
67
|
+
</ExampleSection>
|
|
68
|
+
|
|
69
|
+
<ExampleSection
|
|
70
|
+
label="Icon Prefix & Text Suffix"
|
|
71
|
+
description="InputGroupAddon với icon — thường dùng cho tiền tệ, số lượng."
|
|
72
|
+
codeString={`<InputGroup size="md">
|
|
73
|
+
<InputGroupAddon>
|
|
74
|
+
<InputGroupText>
|
|
75
|
+
<DollarSignIcon aria-hidden="true" />
|
|
76
|
+
</InputGroupText>
|
|
77
|
+
</InputGroupAddon>
|
|
78
|
+
<InputGroupInput id="price-input" placeholder="0.00" />
|
|
79
|
+
<InputGroupAddon align="end">
|
|
80
|
+
<InputGroupText>USD</InputGroupText>
|
|
81
|
+
</InputGroupAddon>
|
|
82
|
+
</InputGroup>`}
|
|
83
|
+
>
|
|
84
|
+
<InputGroup size={globalSize} className="w-full">
|
|
85
|
+
<InputGroupAddon>
|
|
86
|
+
<InputGroupText>
|
|
87
|
+
<DollarSignIcon aria-hidden="true" />
|
|
88
|
+
</InputGroupText>
|
|
89
|
+
</InputGroupAddon>
|
|
90
|
+
<InputGroupInput id="ig-price" placeholder="0.00" />
|
|
91
|
+
<InputGroupAddon align="end">
|
|
92
|
+
<InputGroupText>USD</InputGroupText>
|
|
93
|
+
</InputGroupAddon>
|
|
94
|
+
</InputGroup>
|
|
95
|
+
</ExampleSection>
|
|
96
|
+
</ExampleGrid>
|
|
97
|
+
|
|
98
|
+
{/* ── Icon Buttons (utility) ─────────────────────────── */}
|
|
99
|
+
<ExampleGrid>
|
|
100
|
+
<ExampleSection
|
|
101
|
+
label="Password Toggle"
|
|
102
|
+
description="InputGroupButton icon đặt trực tiếp trong InputGroup — tự có border-l border-l-border phân tách."
|
|
103
|
+
codeString={`const [show, setShow] = useState(false);
|
|
104
|
+
|
|
105
|
+
<InputGroup size="md">
|
|
106
|
+
<InputGroupInput
|
|
107
|
+
id="password-input"
|
|
108
|
+
type={show ? "text" : "password"}
|
|
109
|
+
placeholder="••••••••"
|
|
110
|
+
/>
|
|
111
|
+
<InputGroupButton
|
|
112
|
+
icon
|
|
113
|
+
aria-label={show ? "Hide password" : "Show password"}
|
|
114
|
+
onClick={() => setShow((p) => !p)}
|
|
115
|
+
>
|
|
116
|
+
{show ? <EyeOffIcon aria-hidden="true" /> : <EyeIcon aria-hidden="true" />}
|
|
117
|
+
</InputGroupButton>
|
|
118
|
+
</InputGroup>`}
|
|
119
|
+
>
|
|
120
|
+
<InputGroup size={globalSize} className="w-full">
|
|
121
|
+
<InputGroupInput
|
|
122
|
+
id="ig-password"
|
|
123
|
+
type={showPassword ? "text" : "password"}
|
|
124
|
+
placeholder="••••••••"
|
|
125
|
+
/>
|
|
126
|
+
<InputGroupButton
|
|
127
|
+
icon
|
|
128
|
+
aria-label={showPassword ? "Hide password" : "Show password"}
|
|
129
|
+
onClick={() => setShowPassword((p) => !p)}
|
|
130
|
+
>
|
|
131
|
+
{showPassword ? (
|
|
132
|
+
<EyeOffIcon aria-hidden="true" />
|
|
133
|
+
) : (
|
|
134
|
+
<EyeIcon aria-hidden="true" />
|
|
135
|
+
)}
|
|
136
|
+
</InputGroupButton>
|
|
137
|
+
</InputGroup>
|
|
138
|
+
</ExampleSection>
|
|
139
|
+
|
|
140
|
+
<ExampleSection
|
|
141
|
+
label="Clear Button"
|
|
142
|
+
description="InputGroupButton icon để xoá nhanh nội dung — hiện có điều kiện."
|
|
143
|
+
codeString={`const [value, setValue] = useState("");
|
|
144
|
+
|
|
145
|
+
<InputGroup size="md">
|
|
146
|
+
<InputGroupAddon>
|
|
147
|
+
<InputGroupText>
|
|
148
|
+
<SearchIcon aria-hidden="true" />
|
|
149
|
+
</InputGroupText>
|
|
150
|
+
</InputGroupAddon>
|
|
151
|
+
<InputGroupInput
|
|
152
|
+
id="search-input"
|
|
153
|
+
value={value}
|
|
154
|
+
onChange={(e) => setValue(e.target.value)}
|
|
155
|
+
placeholder="Search..."
|
|
156
|
+
/>
|
|
157
|
+
{value && (
|
|
158
|
+
<InputGroupButton icon aria-label="Clear" onClick={() => setValue("")}>
|
|
159
|
+
<XIcon aria-hidden="true" />
|
|
160
|
+
</InputGroupButton>
|
|
161
|
+
)}
|
|
162
|
+
</InputGroup>`}
|
|
163
|
+
>
|
|
164
|
+
<InputGroup size={globalSize} className="w-full">
|
|
165
|
+
<InputGroupAddon>
|
|
166
|
+
<InputGroupText>
|
|
167
|
+
<SearchIcon aria-hidden="true" />
|
|
168
|
+
</InputGroupText>
|
|
169
|
+
</InputGroupAddon>
|
|
170
|
+
<InputGroupInput
|
|
171
|
+
id="ig-search"
|
|
172
|
+
value={clearValue}
|
|
173
|
+
onChange={(e) => setClearValue(e.target.value)}
|
|
174
|
+
placeholder="Search..."
|
|
175
|
+
/>
|
|
176
|
+
{clearValue && (
|
|
177
|
+
<InputGroupButton
|
|
178
|
+
icon
|
|
179
|
+
aria-label="Clear"
|
|
180
|
+
onClick={() => setClearValue("")}
|
|
181
|
+
>
|
|
182
|
+
<XIcon aria-hidden="true" />
|
|
183
|
+
</InputGroupButton>
|
|
184
|
+
)}
|
|
185
|
+
</InputGroup>
|
|
186
|
+
</ExampleSection>
|
|
187
|
+
</ExampleGrid>
|
|
188
|
+
|
|
189
|
+
{/* ── Text Buttons ───────────────────────────────────── */}
|
|
190
|
+
<ExampleGrid>
|
|
191
|
+
<ExampleSection
|
|
192
|
+
label="Text Button (non-icon)"
|
|
193
|
+
description="InputGroupButton không có prop icon — dùng horizontal padding và font-size từ group."
|
|
194
|
+
codeString={`<InputGroup size="md">
|
|
195
|
+
<InputGroupInput id="find-input" placeholder="Search..." />
|
|
196
|
+
<InputGroupButton variant="solid">
|
|
197
|
+
<SearchIcon aria-hidden="true" /> Find
|
|
198
|
+
</InputGroupButton>
|
|
199
|
+
</InputGroup>`}
|
|
200
|
+
>
|
|
201
|
+
<InputGroup size={globalSize} className="w-full">
|
|
202
|
+
<InputGroupInput id="ig-find" placeholder="Search..." />
|
|
203
|
+
<InputGroupButton variant="solid">
|
|
204
|
+
<SearchIcon aria-hidden="true" /> Find
|
|
205
|
+
</InputGroupButton>
|
|
206
|
+
</InputGroup>
|
|
207
|
+
</ExampleSection>
|
|
208
|
+
|
|
209
|
+
<ExampleSection
|
|
210
|
+
label="Both Ends — Counter"
|
|
211
|
+
description="Button ở cả 2 đầu — border-r border-r-border (start) và border-l border-l-border (end) tự động theo vị trí DOM."
|
|
212
|
+
codeString={`const [count, setCount] = useState(0);
|
|
213
|
+
|
|
214
|
+
<InputGroup size="md">
|
|
215
|
+
<InputGroupButton
|
|
216
|
+
icon
|
|
217
|
+
aria-label="Decrement"
|
|
218
|
+
onClick={() => setCount((c) => c - 1)}
|
|
219
|
+
>
|
|
220
|
+
<MinusIcon aria-hidden="true" />
|
|
221
|
+
</InputGroupButton>
|
|
222
|
+
<InputGroupInput
|
|
223
|
+
id="counter-input"
|
|
224
|
+
type="number"
|
|
225
|
+
value={count}
|
|
226
|
+
onChange={(e) => setCount(Number(e.target.value))}
|
|
227
|
+
className="text-center"
|
|
228
|
+
/>
|
|
229
|
+
<InputGroupButton
|
|
230
|
+
icon
|
|
231
|
+
aria-label="Increment"
|
|
232
|
+
onClick={() => setCount((c) => c + 1)}
|
|
233
|
+
>
|
|
234
|
+
<PlusIcon aria-hidden="true" />
|
|
235
|
+
</InputGroupButton>
|
|
236
|
+
</InputGroup>`}
|
|
237
|
+
>
|
|
238
|
+
<InputGroup size={globalSize} className="w-full">
|
|
239
|
+
<InputGroupButton
|
|
240
|
+
icon
|
|
241
|
+
aria-label="Decrement"
|
|
242
|
+
onClick={() => setCount((c) => c - 1)}
|
|
243
|
+
>
|
|
244
|
+
<MinusIcon aria-hidden="true" />
|
|
245
|
+
</InputGroupButton>
|
|
246
|
+
<InputGroupInput
|
|
247
|
+
id="ig-counter"
|
|
248
|
+
type="number"
|
|
249
|
+
value={count}
|
|
250
|
+
onChange={(e) => setCount(Number(e.target.value))}
|
|
251
|
+
className="text-center"
|
|
252
|
+
/>
|
|
253
|
+
<InputGroupButton
|
|
254
|
+
icon
|
|
255
|
+
aria-label="Increment"
|
|
256
|
+
onClick={() => setCount((c) => c + 1)}
|
|
257
|
+
>
|
|
258
|
+
<PlusIcon aria-hidden="true" />
|
|
259
|
+
</InputGroupButton>
|
|
260
|
+
</InputGroup>
|
|
261
|
+
</ExampleSection>
|
|
262
|
+
</ExampleGrid>
|
|
263
|
+
|
|
264
|
+
{/* ── Button Variants ─────────────────────────────────── */}
|
|
265
|
+
<ExampleSection
|
|
266
|
+
label="Button Variants"
|
|
267
|
+
description="InputGroupButton hỗ trợ 4 variants: ghost (default), solid, soft, outline. Demo với icon và text mode."
|
|
268
|
+
codeString={`{/* icon mode — 4 variants */}
|
|
269
|
+
<InputGroup size="md">
|
|
270
|
+
<InputGroupInput placeholder="ghost" />
|
|
271
|
+
<InputGroupButton icon variant="ghost" aria-label="Search">
|
|
272
|
+
<SearchIcon aria-hidden="true" />
|
|
273
|
+
</InputGroupButton>
|
|
274
|
+
</InputGroup>
|
|
275
|
+
|
|
276
|
+
<InputGroup size="md">
|
|
277
|
+
<InputGroupInput placeholder="solid" />
|
|
278
|
+
<InputGroupButton icon variant="solid" aria-label="Search">
|
|
279
|
+
<SearchIcon aria-hidden="true" />
|
|
280
|
+
</InputGroupButton>
|
|
281
|
+
</InputGroup>
|
|
282
|
+
|
|
283
|
+
<InputGroup size="md">
|
|
284
|
+
<InputGroupInput placeholder="soft" />
|
|
285
|
+
<InputGroupButton icon variant="soft" aria-label="Search">
|
|
286
|
+
<SearchIcon aria-hidden="true" />
|
|
287
|
+
</InputGroupButton>
|
|
288
|
+
</InputGroup>
|
|
289
|
+
|
|
290
|
+
<InputGroup size="md">
|
|
291
|
+
<InputGroupInput placeholder="outline" />
|
|
292
|
+
<InputGroupButton icon variant="outline" aria-label="Search">
|
|
293
|
+
<SearchIcon aria-hidden="true" />
|
|
294
|
+
</InputGroupButton>
|
|
295
|
+
</InputGroup>
|
|
296
|
+
|
|
297
|
+
{/* text mode — 4 variants */}
|
|
298
|
+
<InputGroup size="md">
|
|
299
|
+
<InputGroupInput placeholder="ghost text" />
|
|
300
|
+
<InputGroupButton variant="ghost">Go</InputGroupButton>
|
|
301
|
+
</InputGroup>
|
|
302
|
+
|
|
303
|
+
<InputGroup size="md">
|
|
304
|
+
<InputGroupInput placeholder="solid text" />
|
|
305
|
+
<InputGroupButton variant="solid">Go</InputGroupButton>
|
|
306
|
+
</InputGroup>
|
|
307
|
+
|
|
308
|
+
<InputGroup size="md">
|
|
309
|
+
<InputGroupInput placeholder="soft text" />
|
|
310
|
+
<InputGroupButton variant="soft">Go</InputGroupButton>
|
|
311
|
+
</InputGroup>
|
|
312
|
+
|
|
313
|
+
<InputGroup size="md">
|
|
314
|
+
<InputGroupInput placeholder="outline text" />
|
|
315
|
+
<InputGroupButton variant="outline">Go</InputGroupButton>
|
|
316
|
+
</InputGroup>`}
|
|
317
|
+
fullWidth
|
|
318
|
+
>
|
|
319
|
+
<div className="grid grid-cols-2 gap-3 sm:grid-cols-4">
|
|
320
|
+
<InputGroup size={globalSize}>
|
|
321
|
+
<InputGroupInput placeholder="ghost" />
|
|
322
|
+
<InputGroupButton icon variant="ghost" aria-label="Search">
|
|
323
|
+
<SearchIcon aria-hidden="true" />
|
|
324
|
+
</InputGroupButton>
|
|
325
|
+
</InputGroup>
|
|
326
|
+
<InputGroup size={globalSize}>
|
|
327
|
+
<InputGroupInput placeholder="solid" />
|
|
328
|
+
<InputGroupButton icon variant="solid" aria-label="Search">
|
|
329
|
+
<SearchIcon aria-hidden="true" />
|
|
330
|
+
</InputGroupButton>
|
|
331
|
+
</InputGroup>
|
|
332
|
+
<InputGroup size={globalSize}>
|
|
333
|
+
<InputGroupInput placeholder="soft" />
|
|
334
|
+
<InputGroupButton icon variant="soft" aria-label="Search">
|
|
335
|
+
<SearchIcon aria-hidden="true" />
|
|
336
|
+
</InputGroupButton>
|
|
337
|
+
</InputGroup>
|
|
338
|
+
<InputGroup size={globalSize}>
|
|
339
|
+
<InputGroupInput placeholder="outline" />
|
|
340
|
+
<InputGroupButton icon variant="outline" aria-label="Search">
|
|
341
|
+
<SearchIcon aria-hidden="true" />
|
|
342
|
+
</InputGroupButton>
|
|
343
|
+
</InputGroup>
|
|
344
|
+
</div>
|
|
345
|
+
<div className="mt-3 grid grid-cols-2 gap-3 sm:grid-cols-4">
|
|
346
|
+
<InputGroup size={globalSize}>
|
|
347
|
+
<InputGroupInput placeholder="ghost text" />
|
|
348
|
+
<InputGroupButton variant="ghost">Go</InputGroupButton>
|
|
349
|
+
</InputGroup>
|
|
350
|
+
<InputGroup size={globalSize}>
|
|
351
|
+
<InputGroupInput placeholder="solid text" />
|
|
352
|
+
<InputGroupButton variant="solid">Go</InputGroupButton>
|
|
353
|
+
</InputGroup>
|
|
354
|
+
<InputGroup size={globalSize}>
|
|
355
|
+
<InputGroupInput placeholder="soft text" />
|
|
356
|
+
<InputGroupButton variant="soft">Go</InputGroupButton>
|
|
357
|
+
</InputGroup>
|
|
358
|
+
<InputGroup size={globalSize}>
|
|
359
|
+
<InputGroupInput placeholder="outline text" />
|
|
360
|
+
<InputGroupButton variant="outline">Go</InputGroupButton>
|
|
361
|
+
</InputGroup>
|
|
362
|
+
</div>
|
|
363
|
+
</ExampleSection>
|
|
364
|
+
|
|
365
|
+
{/* ── States ─────────────────────────────────────────── */}
|
|
366
|
+
<ExampleGrid>
|
|
367
|
+
<ExampleSection
|
|
368
|
+
label="Disabled"
|
|
369
|
+
description="Trạng thái disabled delegate lên wrapper qua has-disabled: — toàn bộ group mờ đi."
|
|
370
|
+
codeString={`<InputGroup size="md">
|
|
371
|
+
<InputGroupAddon>
|
|
372
|
+
<InputGroupText>
|
|
373
|
+
<GlobeIcon aria-hidden="true" />
|
|
374
|
+
</InputGroupText>
|
|
375
|
+
</InputGroupAddon>
|
|
376
|
+
<InputGroupInput id="disabled-input" placeholder="Disabled" disabled />
|
|
377
|
+
</InputGroup>`}
|
|
378
|
+
>
|
|
379
|
+
<InputGroup size={globalSize} className="w-full">
|
|
380
|
+
<InputGroupAddon>
|
|
381
|
+
<InputGroupText>
|
|
382
|
+
<GlobeIcon aria-hidden="true" />
|
|
383
|
+
</InputGroupText>
|
|
384
|
+
</InputGroupAddon>
|
|
385
|
+
<InputGroupInput id="ig-disabled" placeholder="Disabled" disabled />
|
|
386
|
+
</InputGroup>
|
|
387
|
+
</ExampleSection>
|
|
388
|
+
|
|
389
|
+
<ExampleSection
|
|
390
|
+
label="Invalid / Error"
|
|
391
|
+
description="aria-invalid='true' trên input delegate border border-border đỏ lên toàn bộ wrapper qua has-[...aria-invalid]."
|
|
392
|
+
codeString={`<InputGroup size="md">
|
|
393
|
+
<InputGroupAddon>
|
|
394
|
+
<InputGroupText>$</InputGroupText>
|
|
395
|
+
</InputGroupAddon>
|
|
396
|
+
<InputGroupInput
|
|
397
|
+
id="error-input"
|
|
398
|
+
aria-invalid="true"
|
|
399
|
+
defaultValue="abc"
|
|
400
|
+
placeholder="0.00"
|
|
401
|
+
/>
|
|
402
|
+
</InputGroup>`}
|
|
403
|
+
>
|
|
404
|
+
<InputGroup size={globalSize} className="w-full">
|
|
405
|
+
<InputGroupAddon>
|
|
406
|
+
<InputGroupText>$</InputGroupText>
|
|
407
|
+
</InputGroupAddon>
|
|
408
|
+
<InputGroupInput
|
|
409
|
+
id="ig-error"
|
|
410
|
+
aria-invalid="true"
|
|
411
|
+
defaultValue="abc"
|
|
412
|
+
placeholder="0.00"
|
|
413
|
+
/>
|
|
414
|
+
</InputGroup>
|
|
415
|
+
</ExampleSection>
|
|
416
|
+
</ExampleGrid>
|
|
417
|
+
|
|
418
|
+
{/* ── Textarea ───────────────────────────────────────── */}
|
|
419
|
+
<ExampleSection
|
|
420
|
+
label="With Textarea"
|
|
421
|
+
description="InputGroupTextarea — InputGroup wrapper tự co giãn chiều cao với className='h-auto'."
|
|
422
|
+
codeString={`<InputGroup size="md" className="h-auto">
|
|
423
|
+
<InputGroupAddon className="self-start">
|
|
424
|
+
<InputGroupText>@</InputGroupText>
|
|
425
|
+
</InputGroupAddon>
|
|
426
|
+
<InputGroupTextarea
|
|
427
|
+
id="comment-input"
|
|
428
|
+
placeholder="Write a comment..."
|
|
429
|
+
rows={4}
|
|
430
|
+
/>
|
|
431
|
+
</InputGroup>`}
|
|
432
|
+
>
|
|
433
|
+
<InputGroup size={globalSize} className="h-auto w-full">
|
|
434
|
+
<InputGroupAddon className="self-start">
|
|
435
|
+
<InputGroupText>@</InputGroupText>
|
|
436
|
+
</InputGroupAddon>
|
|
437
|
+
<InputGroupTextarea
|
|
438
|
+
id="ig-comment"
|
|
439
|
+
placeholder="Write a comment..."
|
|
440
|
+
rows={4}
|
|
441
|
+
/>
|
|
442
|
+
</InputGroup>
|
|
443
|
+
</ExampleSection>
|
|
444
|
+
</div>
|
|
445
|
+
);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
export default function InputGroupShowcase() {
|
|
449
|
+
const { size: globalSize } = useDevContext();
|
|
450
|
+
return (
|
|
451
|
+
<Showcase
|
|
452
|
+
title="Input Group"
|
|
453
|
+
description="Kết hợp input với text, icon và action button bên trong một wrapper tuyến tính theo size."
|
|
454
|
+
generalConcept={
|
|
455
|
+
<ShowcaseDocs>
|
|
456
|
+
<DocsH3>Kiến trúc Self-Contained</DocsH3>
|
|
457
|
+
<DocsP>
|
|
458
|
+
<DocsCode>InputGroup</DocsCode> là wrapper duy nhất quản lý{" "}
|
|
459
|
+
<DocsCode>size</DocsCode>. Tất cả children (
|
|
460
|
+
<DocsCode>InputGroupInput</DocsCode>,{" "}
|
|
461
|
+
<DocsCode>InputGroupButton</DocsCode>,{" "}
|
|
462
|
+
<DocsCode>InputGroupTextarea</DocsCode>) tự đọc size từ wrapper qua
|
|
463
|
+
CSS group modifiers — không có <DocsCode>size</DocsCode> prop trên
|
|
464
|
+
sub-component nào.
|
|
465
|
+
</DocsP>
|
|
466
|
+
|
|
467
|
+
<DocsH3>InputGroupAddon vs InputGroupButton</DocsH3>
|
|
468
|
+
<DocsUl>
|
|
469
|
+
<DocsLi>
|
|
470
|
+
<DocsCode>InputGroupAddon</DocsCode> — slot trang trí (text,
|
|
471
|
+
icon). Click addon để focus input. Chỉ có{" "}
|
|
472
|
+
<DocsCode>align="start"</DocsCode> hoặc{" "}
|
|
473
|
+
<DocsCode>align="end"</DocsCode>.
|
|
474
|
+
</DocsLi>
|
|
475
|
+
<DocsLi>
|
|
476
|
+
<DocsCode>InputGroupButton</DocsCode> — đặt trực tiếp trong{" "}
|
|
477
|
+
<DocsCode>InputGroup</DocsCode> (không bọc trong Addon). Tự có
|
|
478
|
+
separator border border-border theo vị trí DOM.
|
|
479
|
+
</DocsLi>
|
|
480
|
+
</DocsUl>
|
|
481
|
+
|
|
482
|
+
<DocsH3>Icon Button vs Text Button</DocsH3>
|
|
483
|
+
<DocsUl>
|
|
484
|
+
<DocsLi>
|
|
485
|
+
<DocsCode>icon</DocsCode> prop → nút vuông, width = height của
|
|
486
|
+
wrapper. Không cần set size thủ công.
|
|
487
|
+
</DocsLi>
|
|
488
|
+
<DocsLi>
|
|
489
|
+
Không có <DocsCode>icon</DocsCode> → nút text với horizontal
|
|
490
|
+
padding tương xứng group size.
|
|
491
|
+
</DocsLi>
|
|
492
|
+
</DocsUl>
|
|
493
|
+
|
|
494
|
+
<DocsH3>Accessibility</DocsH3>
|
|
495
|
+
<DocsP>
|
|
496
|
+
Icon trang trí bên trong <DocsCode>InputGroupText</DocsCode> nên có{" "}
|
|
497
|
+
<DocsCode>aria-hidden="true"</DocsCode>. Icon trong{" "}
|
|
498
|
+
<DocsCode>InputGroupButton</DocsCode> icon-only cần{" "}
|
|
499
|
+
<DocsCode>aria-label</DocsCode> trên button thay vì trên icon.
|
|
500
|
+
</DocsP>
|
|
501
|
+
</ShowcaseDocs>
|
|
502
|
+
}
|
|
503
|
+
tabs={[
|
|
504
|
+
{
|
|
505
|
+
label: "Micro (Primitive)",
|
|
506
|
+
content: <InputGroupMicroShowcase globalSize={globalSize} />,
|
|
507
|
+
},
|
|
508
|
+
]}
|
|
509
|
+
/>
|
|
510
|
+
);
|
|
511
|
+
}
|