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,562 @@
|
|
|
1
|
+
import { CarouselPreset } from "../../components/macro/carousel-preset";
|
|
2
|
+
import { Card, CardContent } from "../../components/micro/card";
|
|
3
|
+
import {
|
|
4
|
+
Carousel,
|
|
5
|
+
CarouselContent,
|
|
6
|
+
CarouselDots,
|
|
7
|
+
CarouselItem,
|
|
8
|
+
CarouselNext,
|
|
9
|
+
CarouselPrevious,
|
|
10
|
+
} from "../../components/micro/carousel";
|
|
11
|
+
import {
|
|
12
|
+
DocsP,
|
|
13
|
+
ExampleGrid,
|
|
14
|
+
ExampleSection,
|
|
15
|
+
Showcase,
|
|
16
|
+
ShowcaseDocs,
|
|
17
|
+
} from "../../dev/components/showcase";
|
|
18
|
+
import { cn } from "../../lib/utils";
|
|
19
|
+
import { useState } from "react";
|
|
20
|
+
|
|
21
|
+
const SLIDES = [
|
|
22
|
+
{
|
|
23
|
+
id: 1,
|
|
24
|
+
title: "Modern Aesthetics",
|
|
25
|
+
desc: "Crafting beautiful interfaces with tailwind.",
|
|
26
|
+
bg: "bg-gradient-to-tr from-violet-500 to-purple-500",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: 2,
|
|
30
|
+
title: "Smooth Interactions",
|
|
31
|
+
desc: "Fluid animations and micro-interactions.",
|
|
32
|
+
bg: "bg-gradient-to-tr from-pink-500 to-rose-500",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: 3,
|
|
36
|
+
title: "Highly Customizable",
|
|
37
|
+
desc: "Easily adapt to your brand.",
|
|
38
|
+
bg: "bg-gradient-to-tr from-blue-500 to-cyan-500",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: 4,
|
|
42
|
+
title: "Accessible by Default",
|
|
43
|
+
desc: "Keyboard navigation out of the box.",
|
|
44
|
+
bg: "bg-gradient-to-tr from-emerald-500 to-teal-500",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: 5,
|
|
48
|
+
title: "Dark Mode Ready",
|
|
49
|
+
desc: "Looks stunning on dark and light mode.",
|
|
50
|
+
bg: "bg-gradient-to-tr from-amber-500 to-orange-500",
|
|
51
|
+
},
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
function ControlledCarouselDemo() {
|
|
55
|
+
const [index, setIndex] = useState(0);
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<div className="w-full max-w-sm flex flex-col items-center gap-6">
|
|
59
|
+
<div className="flex gap-2">
|
|
60
|
+
{[0, 1, 2].map((i) => (
|
|
61
|
+
<button
|
|
62
|
+
key={i}
|
|
63
|
+
onClick={() => setIndex(i)}
|
|
64
|
+
data-active={index === i ? "" : undefined}
|
|
65
|
+
className="px-4 py-2 text-sm font-medium rounded-md transition-colors bg-muted text-muted-foreground hover:bg-muted/80 data-active:bg-primary data-active:text-primary-foreground data-active:shadow-sm data-active:hover:bg-primary/90"
|
|
66
|
+
>
|
|
67
|
+
Slide {i + 1}
|
|
68
|
+
</button>
|
|
69
|
+
))}
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<div className="w-full px-12">
|
|
73
|
+
<CarouselPreset
|
|
74
|
+
index={index}
|
|
75
|
+
onIndexChange={setIndex}
|
|
76
|
+
showDots={false}
|
|
77
|
+
items={[
|
|
78
|
+
{
|
|
79
|
+
id: "c1",
|
|
80
|
+
content: (
|
|
81
|
+
<div className="p-1 border border-border rounded-xl">
|
|
82
|
+
<div className="flex aspect-square items-center justify-center p-6 bg-slate-100 dark:bg-slate-800 rounded-lg">
|
|
83
|
+
<span className="text-4xl font-semibold">1</span>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
),
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: "c2",
|
|
90
|
+
content: (
|
|
91
|
+
<div className="p-1 border border-border rounded-xl">
|
|
92
|
+
<div className="flex aspect-square items-center justify-center p-6 bg-slate-100 dark:bg-slate-800 rounded-lg">
|
|
93
|
+
<span className="text-4xl font-semibold">2</span>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
),
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: "c3",
|
|
100
|
+
content: (
|
|
101
|
+
<div className="p-1 border border-border rounded-xl">
|
|
102
|
+
<div className="flex aspect-square items-center justify-center p-6 bg-slate-100 dark:bg-slate-800 rounded-lg">
|
|
103
|
+
<span className="text-4xl font-semibold">3</span>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
),
|
|
107
|
+
},
|
|
108
|
+
]}
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
<p className="text-sm text-muted-foreground text-center">
|
|
112
|
+
Current Index in State:{" "}
|
|
113
|
+
<span className="font-mono font-bold text-foreground">{index}</span>
|
|
114
|
+
</p>
|
|
115
|
+
</div>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// ──────────────────────────────────────────────────────────
|
|
120
|
+
// SECTION 1: Macro Content
|
|
121
|
+
// ──────────────────────────────────────────────────────────
|
|
122
|
+
function CarouselMacroShowcase() {
|
|
123
|
+
return (
|
|
124
|
+
<div className="space-y-10 mt-6">
|
|
125
|
+
<ExampleGrid>
|
|
126
|
+
<ExampleSection
|
|
127
|
+
label="Tiêu chuẩn (Standard)"
|
|
128
|
+
description="Băng chuyền cơ bản nhất với cầu trượt."
|
|
129
|
+
codeString={`<CarouselPreset
|
|
130
|
+
items={[
|
|
131
|
+
{ id: "std-1", content: <div className="p-1 border border-border rounded-xl"><div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg"><span className="text-4xl font-semibold">1</span></div></div> },
|
|
132
|
+
{ id: "std-2", content: <div className="p-1 border border-border rounded-xl"><div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg"><span className="text-4xl font-semibold">2</span></div></div> },
|
|
133
|
+
{ id: "std-3", content: <div className="p-1 border border-border rounded-xl"><div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg"><span className="text-4xl font-semibold">3</span></div></div> },
|
|
134
|
+
]}
|
|
135
|
+
/>`}
|
|
136
|
+
>
|
|
137
|
+
<div className="w-full max-w-sm px-12">
|
|
138
|
+
<CarouselPreset
|
|
139
|
+
items={[
|
|
140
|
+
{
|
|
141
|
+
id: "std-1",
|
|
142
|
+
content: (
|
|
143
|
+
<div className="p-1 border border-border rounded-xl">
|
|
144
|
+
<div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg">
|
|
145
|
+
<span className="text-4xl font-semibold">1</span>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
),
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
id: "std-2",
|
|
152
|
+
content: (
|
|
153
|
+
<div className="p-1 border border-border rounded-xl">
|
|
154
|
+
<div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg">
|
|
155
|
+
<span className="text-4xl font-semibold">2</span>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
),
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
id: "std-3",
|
|
162
|
+
content: (
|
|
163
|
+
<div className="p-1 border border-border rounded-xl">
|
|
164
|
+
<div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg">
|
|
165
|
+
<span className="text-4xl font-semibold">3</span>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
),
|
|
169
|
+
},
|
|
170
|
+
]}
|
|
171
|
+
/>
|
|
172
|
+
</div>
|
|
173
|
+
</ExampleSection>
|
|
174
|
+
|
|
175
|
+
<ExampleSection
|
|
176
|
+
label="Thư viện ảnh (Image Gallery)"
|
|
177
|
+
description="Sử dụng hình ảnh thực làm nội dung slide."
|
|
178
|
+
codeString={`<CarouselPreset
|
|
179
|
+
items={[
|
|
180
|
+
{ id: "img-1", content: <img src="https://images.unsplash.com/photo-1707343843437-caacff5cfa74?q=80&w=600&h=400&auto=format&fit=crop" alt="Slide 1" className="rounded-xl object-cover" /> },
|
|
181
|
+
{ id: "img-2", content: <img src="https://images.unsplash.com/photo-1682687220742-aba13b6e50ba?q=80&w=600&h=400&auto=format&fit=crop" alt="Slide 2" className="rounded-xl object-cover" /> },
|
|
182
|
+
{ id: "img-3", content: <img src="https://images.unsplash.com/photo-1707343843437-caacff5cfa74?q=80&w=600&h=400&auto=format&fit=crop" alt="Slide 3" className="rounded-xl object-cover" /> },
|
|
183
|
+
]}
|
|
184
|
+
/>`}
|
|
185
|
+
>
|
|
186
|
+
<div className="w-full max-w-sm px-12">
|
|
187
|
+
<CarouselPreset
|
|
188
|
+
items={[
|
|
189
|
+
{
|
|
190
|
+
id: "img-1",
|
|
191
|
+
content: (
|
|
192
|
+
<img
|
|
193
|
+
src="https://images.unsplash.com/photo-1707343843437-caacff5cfa74?q=80&w=600&h=400&auto=format&fit=crop"
|
|
194
|
+
alt="Slide 1"
|
|
195
|
+
className="rounded-xl object-cover"
|
|
196
|
+
/>
|
|
197
|
+
),
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
id: "img-2",
|
|
201
|
+
content: (
|
|
202
|
+
<img
|
|
203
|
+
src="https://images.unsplash.com/photo-1682687220742-aba13b6e50ba?q=80&w=600&h=400&auto=format&fit=crop"
|
|
204
|
+
alt="Slide 2"
|
|
205
|
+
className="rounded-xl object-cover"
|
|
206
|
+
/>
|
|
207
|
+
),
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
id: "img-3",
|
|
211
|
+
content: (
|
|
212
|
+
<img
|
|
213
|
+
src="https://images.unsplash.com/photo-1707343843437-caacff5cfa74?q=80&w=600&h=400&auto=format&fit=crop"
|
|
214
|
+
alt="Slide 3"
|
|
215
|
+
className="rounded-xl object-cover"
|
|
216
|
+
/>
|
|
217
|
+
),
|
|
218
|
+
},
|
|
219
|
+
]}
|
|
220
|
+
/>
|
|
221
|
+
</div>
|
|
222
|
+
</ExampleSection>
|
|
223
|
+
</ExampleGrid>
|
|
224
|
+
|
|
225
|
+
<ExampleGrid>
|
|
226
|
+
<ExampleSection
|
|
227
|
+
label="Vòng lặp vô hạn (Loop Enabled)"
|
|
228
|
+
description="Chỉ hiển thị dấu chấm (ẩn mũi tên)."
|
|
229
|
+
codeString={`<CarouselPreset
|
|
230
|
+
opts={{ loop: true }}
|
|
231
|
+
showArrows={false}
|
|
232
|
+
items={[
|
|
233
|
+
{ id: "loop-1", content: <div className="p-1 border border-border rounded-xl"><div className="flex aspect-square items-center justify-center p-6 bg-gradient-to-tr from-violet-500 to-purple-500 rounded-lg text-white"><span className="text-4xl font-semibold">1</span></div></div> },
|
|
234
|
+
{ id: "loop-2", content: <div className="p-1 border border-border rounded-xl"><div className="flex aspect-square items-center justify-center p-6 bg-gradient-to-tr from-pink-500 to-rose-500 rounded-lg text-white"><span className="text-4xl font-semibold">2</span></div></div> },
|
|
235
|
+
{ id: "loop-3", content: <div className="p-1 border border-border rounded-xl"><div className="flex aspect-square items-center justify-center p-6 bg-gradient-to-tr from-blue-500 to-cyan-500 rounded-lg text-white"><span className="text-4xl font-semibold">3</span></div></div> },
|
|
236
|
+
]}
|
|
237
|
+
/>`}
|
|
238
|
+
>
|
|
239
|
+
<div className="w-full max-w-sm">
|
|
240
|
+
<CarouselPreset
|
|
241
|
+
opts={{ loop: true }}
|
|
242
|
+
showArrows={false}
|
|
243
|
+
items={[
|
|
244
|
+
{
|
|
245
|
+
id: "loop-1",
|
|
246
|
+
content: (
|
|
247
|
+
<div className="p-1 border border-border rounded-xl">
|
|
248
|
+
<div className="flex aspect-square items-center justify-center p-6 bg-gradient-to-tr from-violet-500 to-purple-500 rounded-lg text-white">
|
|
249
|
+
<span className="text-4xl font-semibold">1</span>
|
|
250
|
+
</div>
|
|
251
|
+
</div>
|
|
252
|
+
),
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
id: "loop-2",
|
|
256
|
+
content: (
|
|
257
|
+
<div className="p-1 border border-border rounded-xl">
|
|
258
|
+
<div className="flex aspect-square items-center justify-center p-6 bg-gradient-to-tr from-pink-500 to-rose-500 rounded-lg text-white">
|
|
259
|
+
<span className="text-4xl font-semibold">2</span>
|
|
260
|
+
</div>
|
|
261
|
+
</div>
|
|
262
|
+
),
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
id: "loop-3",
|
|
266
|
+
content: (
|
|
267
|
+
<div className="p-1 border border-border rounded-xl">
|
|
268
|
+
<div className="flex aspect-square items-center justify-center p-6 bg-gradient-to-tr from-blue-500 to-cyan-500 rounded-lg text-white">
|
|
269
|
+
<span className="text-4xl font-semibold">3</span>
|
|
270
|
+
</div>
|
|
271
|
+
</div>
|
|
272
|
+
),
|
|
273
|
+
},
|
|
274
|
+
]}
|
|
275
|
+
/>
|
|
276
|
+
</div>
|
|
277
|
+
</ExampleSection>
|
|
278
|
+
|
|
279
|
+
<ExampleSection
|
|
280
|
+
label="Chỉ mũi tên (Arrows Only)"
|
|
281
|
+
description="Mũi tên điều hướng không có dấu chấm."
|
|
282
|
+
codeString={`<CarouselPreset
|
|
283
|
+
showDots={false}
|
|
284
|
+
items={[
|
|
285
|
+
{ id: "arr-1", content: <div className="p-1 border border-border rounded-xl"><div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg"><span className="text-4xl font-semibold">A</span></div></div> },
|
|
286
|
+
{ id: "arr-2", content: <div className="p-1 border border-border rounded-xl"><div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg"><span className="text-4xl font-semibold">B</span></div></div> },
|
|
287
|
+
{ id: "arr-3", content: <div className="p-1 border border-border rounded-xl"><div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg"><span className="text-4xl font-semibold">C</span></div></div> },
|
|
288
|
+
]}
|
|
289
|
+
/>`}
|
|
290
|
+
>
|
|
291
|
+
<div className="w-full max-w-sm px-12">
|
|
292
|
+
<CarouselPreset
|
|
293
|
+
showDots={false}
|
|
294
|
+
items={[
|
|
295
|
+
{
|
|
296
|
+
id: "arr-1",
|
|
297
|
+
content: (
|
|
298
|
+
<div className="p-1 border border-border rounded-xl">
|
|
299
|
+
<div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg">
|
|
300
|
+
<span className="text-4xl font-semibold">A</span>
|
|
301
|
+
</div>
|
|
302
|
+
</div>
|
|
303
|
+
),
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
id: "arr-2",
|
|
307
|
+
content: (
|
|
308
|
+
<div className="p-1 border border-border rounded-xl">
|
|
309
|
+
<div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg">
|
|
310
|
+
<span className="text-4xl font-semibold">B</span>
|
|
311
|
+
</div>
|
|
312
|
+
</div>
|
|
313
|
+
),
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
id: "arr-3",
|
|
317
|
+
content: (
|
|
318
|
+
<div className="p-1 border border-border rounded-xl">
|
|
319
|
+
<div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg">
|
|
320
|
+
<span className="text-4xl font-semibold">C</span>
|
|
321
|
+
</div>
|
|
322
|
+
</div>
|
|
323
|
+
),
|
|
324
|
+
},
|
|
325
|
+
]}
|
|
326
|
+
/>
|
|
327
|
+
</div>
|
|
328
|
+
</ExampleSection>
|
|
329
|
+
</ExampleGrid>
|
|
330
|
+
|
|
331
|
+
<ExampleGrid>
|
|
332
|
+
<ExampleSection
|
|
333
|
+
label="Điều khiển từ bên ngoài (Controlled Mode)"
|
|
334
|
+
description="Sử dụng biến state React để điều khiển slide."
|
|
335
|
+
codeString={`const [index, setIndex] = useState(0);
|
|
336
|
+
|
|
337
|
+
return (
|
|
338
|
+
<CarouselPreset
|
|
339
|
+
index={index}
|
|
340
|
+
onIndexChange={setIndex}
|
|
341
|
+
items={[...]}
|
|
342
|
+
/>
|
|
343
|
+
);`}
|
|
344
|
+
>
|
|
345
|
+
<ControlledCarouselDemo />
|
|
346
|
+
</ExampleSection>
|
|
347
|
+
|
|
348
|
+
<ExampleSection
|
|
349
|
+
label="Theo chiều dọc (Vertical Orientation)"
|
|
350
|
+
description="Băng chuyền macro cuộn theo chiều dọc."
|
|
351
|
+
codeString={`<CarouselPreset
|
|
352
|
+
className="w-full"
|
|
353
|
+
orientation="vertical"
|
|
354
|
+
contentClassName="h-[300px]"
|
|
355
|
+
itemClassName="basis-[250px]"
|
|
356
|
+
items={[
|
|
357
|
+
{ id: "v1", content: <div className="h-full w-full border border-border rounded-xl flex items-center justify-center bg-muted/20 text-4xl font-semibold">A</div> },
|
|
358
|
+
{ id: "v2", content: <div className="h-full w-full border border-border rounded-xl flex items-center justify-center bg-muted/20 text-4xl font-semibold">B</div> },
|
|
359
|
+
{ id: "v3", content: <div className="h-full w-full border border-border rounded-xl flex items-center justify-center bg-muted/20 text-4xl font-semibold">C</div> },
|
|
360
|
+
]}
|
|
361
|
+
/>`}
|
|
362
|
+
>
|
|
363
|
+
<div className="w-full max-w-sm px-12 py-12 flex justify-center">
|
|
364
|
+
<CarouselPreset
|
|
365
|
+
className="w-full"
|
|
366
|
+
orientation="vertical"
|
|
367
|
+
contentClassName="h-[300px]"
|
|
368
|
+
itemClassName="basis-[250px]"
|
|
369
|
+
items={[
|
|
370
|
+
{
|
|
371
|
+
id: "v1",
|
|
372
|
+
content: (
|
|
373
|
+
<div className="h-full w-full border border-border rounded-xl flex items-center justify-center bg-muted/20 text-4xl font-semibold">
|
|
374
|
+
A
|
|
375
|
+
</div>
|
|
376
|
+
),
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
id: "v2",
|
|
380
|
+
content: (
|
|
381
|
+
<div className="h-full w-full border border-border rounded-xl flex items-center justify-center bg-muted/20 text-4xl font-semibold">
|
|
382
|
+
B
|
|
383
|
+
</div>
|
|
384
|
+
),
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
id: "v3",
|
|
388
|
+
content: (
|
|
389
|
+
<div className="h-full w-full border border-border rounded-xl flex items-center justify-center bg-muted/20 text-4xl font-semibold">
|
|
390
|
+
C
|
|
391
|
+
</div>
|
|
392
|
+
),
|
|
393
|
+
},
|
|
394
|
+
]}
|
|
395
|
+
/>
|
|
396
|
+
</div>
|
|
397
|
+
</ExampleSection>
|
|
398
|
+
</ExampleGrid>
|
|
399
|
+
</div>
|
|
400
|
+
);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// ──────────────────────────────────────────────────────────
|
|
404
|
+
// SECTION 2: Micro Content
|
|
405
|
+
// ──────────────────────────────────────────────────────────
|
|
406
|
+
function CarouselMicroShowcase() {
|
|
407
|
+
return (
|
|
408
|
+
<div className="space-y-10 mt-6">
|
|
409
|
+
<ExampleSection
|
|
410
|
+
label="Hero Banner (Overlay Navigation)"
|
|
411
|
+
description="Mũi tên kính mờ nằm đè trên Banner, chỉ hiện khi hover. Dấu chấm nằm sát mép dưới."
|
|
412
|
+
codeString={`<Carousel opts={{ loop: true }} className="group relative w-full overflow-hidden rounded-2xl shadow-xl">
|
|
413
|
+
<CarouselContent className="-ml-4">
|
|
414
|
+
<CarouselItem className="pl-4">...</CarouselItem>
|
|
415
|
+
</CarouselContent>
|
|
416
|
+
<div className="pointer-events-none absolute inset-0 z-10 flex items-center justify-between p-4 opacity-0 transition-opacity duration-300 group-hover:opacity-100">
|
|
417
|
+
<CarouselPrevious className="pointer-events-auto bg-background/50 backdrop-blur-md" />
|
|
418
|
+
<CarouselNext className="pointer-events-auto bg-background/50 backdrop-blur-md" />
|
|
419
|
+
</div>
|
|
420
|
+
<div className="absolute bottom-4 left-0 right-0 z-10">
|
|
421
|
+
<CarouselDots className="[&>[data-slot=carousel-dot][data-active]]:bg-white [&>[data-slot=carousel-dot]]:bg-white/40" />
|
|
422
|
+
</div>
|
|
423
|
+
</Carousel>`}
|
|
424
|
+
>
|
|
425
|
+
<div className="mx-auto w-full max-w-4xl">
|
|
426
|
+
<Carousel
|
|
427
|
+
opts={{ loop: true }}
|
|
428
|
+
className="group relative w-full overflow-hidden rounded-2xl shadow-xl border border-border/50"
|
|
429
|
+
>
|
|
430
|
+
<CarouselContent className="-ml-4">
|
|
431
|
+
{SLIDES.map((slide) => (
|
|
432
|
+
<CarouselItem key={slide.id} className="pl-4">
|
|
433
|
+
<div
|
|
434
|
+
className={cn(
|
|
435
|
+
"flex aspect-[21/9] flex-col items-center justify-center p-6 text-center text-white",
|
|
436
|
+
slide.bg,
|
|
437
|
+
)}
|
|
438
|
+
>
|
|
439
|
+
<h3 className="mb-2 text-3xl font-bold tracking-tight sm:text-5xl">
|
|
440
|
+
{slide.title}
|
|
441
|
+
</h3>
|
|
442
|
+
<p className="max-w-md text-sm text-white/80 sm:text-lg">
|
|
443
|
+
{slide.desc}
|
|
444
|
+
</p>
|
|
445
|
+
</div>
|
|
446
|
+
</CarouselItem>
|
|
447
|
+
))}
|
|
448
|
+
</CarouselContent>
|
|
449
|
+
|
|
450
|
+
<div className="pointer-events-none absolute inset-0 z-10 flex items-center justify-between p-4 transition-opacity duration-300 sm:p-6 opacity-0 group-hover:opacity-100">
|
|
451
|
+
<CarouselPrevious className="pointer-events-auto backdrop-blur-md bg-background/30 hover:bg-background/50 border-white/20 text-white" />
|
|
452
|
+
<CarouselNext className="pointer-events-auto backdrop-blur-md bg-background/30 hover:bg-background/50 border-white/20 text-white" />
|
|
453
|
+
</div>
|
|
454
|
+
|
|
455
|
+
<div className="absolute bottom-4 left-0 right-0 z-10">
|
|
456
|
+
<CarouselDots className="[&>[data-slot=carousel-dot][data-active]]:bg-white [&>[data-slot=carousel-dot]]:bg-white/40 hover:[&>[data-slot=carousel-dot]]:bg-white/60" />
|
|
457
|
+
</div>
|
|
458
|
+
</Carousel>
|
|
459
|
+
</div>
|
|
460
|
+
</ExampleSection>
|
|
461
|
+
|
|
462
|
+
<ExampleSection
|
|
463
|
+
label="Nhiều phần tử trên 1 slide (Product Gallery)"
|
|
464
|
+
description="Hiển thị nhiều Card (vd: basis-1/2, lg:basis-1/3) trên cùng một Slide của Băng chuyền."
|
|
465
|
+
codeString={`<div className="mx-auto w-full max-w-5xl px-12">
|
|
466
|
+
<Carousel opts={{ align: "start" }} className="w-full relative">
|
|
467
|
+
<CarouselContent className="-ml-4">
|
|
468
|
+
{Array.from({ length: 10 }).map((_, index) => (
|
|
469
|
+
<CarouselItem key={index} className="pl-4 md:basis-1/2 lg:basis-1/3">
|
|
470
|
+
<div className="p-1">
|
|
471
|
+
<Card className="overflow-hidden transition-all duration-300 hover:shadow-lg hover:-translate-y-1">
|
|
472
|
+
<div className="aspect-4/3 bg-muted flex items-center justify-center relative group">
|
|
473
|
+
<span className="text-4xl font-black text-muted-foreground/30 transition-transform duration-500 group-hover:scale-110">
|
|
474
|
+
0{index + 1}
|
|
475
|
+
</span>
|
|
476
|
+
<div className="absolute inset-0 bg-linear-to-t from-black/60 to-transparent opacity-0 transition-opacity duration-300 group-hover:opacity-100 flex items-end p-4">
|
|
477
|
+
<span className="text-white font-medium">View Item {index + 1}</span>
|
|
478
|
+
</div>
|
|
479
|
+
</div>
|
|
480
|
+
<CardContent className="p-4">
|
|
481
|
+
<div className="text-sm font-medium text-muted-foreground mb-1">Category</div>
|
|
482
|
+
<h4 className="font-semibold text-lg leading-none">Featured Item {index + 1}</h4>
|
|
483
|
+
</CardContent>
|
|
484
|
+
</Card>
|
|
485
|
+
</div>
|
|
486
|
+
</CarouselItem>
|
|
487
|
+
))}
|
|
488
|
+
</CarouselContent>
|
|
489
|
+
|
|
490
|
+
<CarouselPrevious className="absolute -left-12 top-1/2 -translate-y-1/2 border-border shadow-sm hover:bg-accent" />
|
|
491
|
+
<CarouselNext className="absolute -right-12 top-1/2 -translate-y-1/2 border-border shadow-sm hover:bg-accent" />
|
|
492
|
+
</Carousel>
|
|
493
|
+
</div>
|
|
494
|
+
`}
|
|
495
|
+
>
|
|
496
|
+
<div className="mx-auto w-full max-w-5xl px-12">
|
|
497
|
+
<Carousel opts={{ align: "start" }} className="w-full relative">
|
|
498
|
+
<CarouselContent className="-ml-4">
|
|
499
|
+
{Array.from({ length: 10 }).map((_, index) => (
|
|
500
|
+
<CarouselItem
|
|
501
|
+
key={index}
|
|
502
|
+
className="pl-4 md:basis-1/2 lg:basis-1/3"
|
|
503
|
+
>
|
|
504
|
+
<div className="p-1">
|
|
505
|
+
<Card className="overflow-hidden transition-all duration-300 hover:shadow-lg hover:-translate-y-1">
|
|
506
|
+
<div className="aspect-4/3 bg-muted flex items-center justify-center relative group">
|
|
507
|
+
<span className="text-4xl font-black text-muted-foreground/30 transition-transform duration-500 group-hover:scale-110">
|
|
508
|
+
0{index + 1}
|
|
509
|
+
</span>
|
|
510
|
+
<div className="absolute inset-0 bg-linear-to-t from-black/60 to-transparent opacity-0 transition-opacity duration-300 group-hover:opacity-100 flex items-end p-4">
|
|
511
|
+
<span className="text-white font-medium">
|
|
512
|
+
View Item {index + 1}
|
|
513
|
+
</span>
|
|
514
|
+
</div>
|
|
515
|
+
</div>
|
|
516
|
+
<CardContent className="p-4">
|
|
517
|
+
<div className="text-sm font-medium text-muted-foreground mb-1">
|
|
518
|
+
Category
|
|
519
|
+
</div>
|
|
520
|
+
<h4 className="font-semibold text-lg leading-none">
|
|
521
|
+
Featured Item {index + 1}
|
|
522
|
+
</h4>
|
|
523
|
+
</CardContent>
|
|
524
|
+
</Card>
|
|
525
|
+
</div>
|
|
526
|
+
</CarouselItem>
|
|
527
|
+
))}
|
|
528
|
+
</CarouselContent>
|
|
529
|
+
|
|
530
|
+
<CarouselPrevious className="absolute -left-12 top-1/2 -translate-y-1/2 border-border shadow-sm hover:bg-accent" />
|
|
531
|
+
<CarouselNext className="absolute -right-12 top-1/2 -translate-y-1/2 border-border shadow-sm hover:bg-accent" />
|
|
532
|
+
</Carousel>
|
|
533
|
+
</div>
|
|
534
|
+
</ExampleSection>
|
|
535
|
+
</div>
|
|
536
|
+
);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
// ──────────────────────────────────────────────────────────
|
|
540
|
+
// SECTION 3: Entry point
|
|
541
|
+
// ──────────────────────────────────────────────────────────
|
|
542
|
+
export default function CarouselShowcase() {
|
|
543
|
+
return (
|
|
544
|
+
<Showcase
|
|
545
|
+
title="Carousel"
|
|
546
|
+
description="Băng chuyền vuốt chuyển động cao cấp được xây dựng bằng Embla."
|
|
547
|
+
generalConcept={
|
|
548
|
+
<ShowcaseDocs>
|
|
549
|
+
<DocsP>
|
|
550
|
+
Dùng để duyệt qua một tập hợp các nội dung (như hình ảnh, thẻ bài,
|
|
551
|
+
hoặc biểu ngữ) theo dạng trượt ngang hoặc dọc. Thích hợp cho không
|
|
552
|
+
gian hiển thị giới hạn cần hiển thị nhiều mục.
|
|
553
|
+
</DocsP>
|
|
554
|
+
</ShowcaseDocs>
|
|
555
|
+
}
|
|
556
|
+
tabs={[
|
|
557
|
+
{ label: "Micro (Primitive)", content: <CarouselMicroShowcase /> },
|
|
558
|
+
{ label: "Macro (Preset)", content: <CarouselMacroShowcase /> },
|
|
559
|
+
]}
|
|
560
|
+
/>
|
|
561
|
+
);
|
|
562
|
+
}
|