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
package/README.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# 🌊 gladcn
|
|
2
|
+
|
|
3
|
+
> **✨ [Explore the Interactive Showcase & Documentation](https://gladcn.vercel.app/)**
|
|
4
|
+
|
|
5
|
+
A highly composable, accessible, and beautifully designed React component library. Built on top of [shadcn/ui](https://ui.shadcn.com/), [Base UI](https://base-ui.com/), and powered by **Tailwind CSS v4+**, `gladcn` provides a robust, zero-magic foundation for your next web application.
|
|
6
|
+
|
|
7
|
+
Designed with strict architectural principles, `gladcn` is optimized not just for human developers, but specifically for **AI coding assistants**, ensuring predictable styling and maintenance.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## ✨ Key Features
|
|
12
|
+
|
|
13
|
+
- **Micro & Macro Architecture**: Cleanly separates primitive UI elements (Micro) from complex, stateful, composite components (Macro).
|
|
14
|
+
- **Zero "Magic CSS"**: No arbitrary deep descendant overrides (`[&_p]`, `has-[>div]`). Styling is predictable, slot-based, and relies on strict data-attributes (e.g., `data-active`, `data-disabled`).
|
|
15
|
+
- **Tailwind CSS v4 Ready**: Fully compatible with the modern `@tailwindcss/postcss` and `@tailwindcss/vite` ecosystem.
|
|
16
|
+
- **Copy-Paste or Install**: Choose between cloning the source code directly into your repo (the shadcn way) or installing it as a standard npm dependency.
|
|
17
|
+
- **55+ Components**: From basic buttons to complex comboboxes and date pickers.
|
|
18
|
+
- **Comprehensive Showcase**: Comes with an interactive, beautifully designed showcase featuring bilingual documentation (Vietnamese/English).
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 🚀 Installation
|
|
23
|
+
|
|
24
|
+
> [!WARNING]
|
|
25
|
+
> **Please use `npx` to clone the components into your project instead of installing via `npm`.** While installing via `npm` works, using `npx` (Option 1) gives you full control over the source code and styling, which is the core philosophy and intended way to use this library.
|
|
26
|
+
|
|
27
|
+
There are two ways to use `gladcn` in your project. We highly recommend **Option 1** for maximum flexibility.
|
|
28
|
+
|
|
29
|
+
### Option 1: Clone components to your project (Recommended)
|
|
30
|
+
|
|
31
|
+
This approach automatically copies all component source code, hooks, and styles directly into your project. You own the code, you can freely modify it, and the CLI will automatically install necessary peer dependencies for you!
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npx gladvn init
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
*By default, this will create a `gladcn` folder at your project root. If you prefer to place it elsewhere, specify the path:*
|
|
38
|
+
```bash
|
|
39
|
+
npx gladvn init components/ui
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Usage:**
|
|
43
|
+
```tsx
|
|
44
|
+
// Import directly from your local folder
|
|
45
|
+
import { Button } from "@/gladcn/components/micro/button";
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Option 2: Install as an npm package
|
|
49
|
+
|
|
50
|
+
If you prefer to use the pre-built components without cluttering your repository with source code, install it via npm:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm install gladvn
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Setup Tailwind CSS v4:**
|
|
57
|
+
Update your main CSS file to scan the library for Tailwind utility classes and import its CSS variables:
|
|
58
|
+
|
|
59
|
+
```css
|
|
60
|
+
@import "tailwindcss";
|
|
61
|
+
|
|
62
|
+
/* 1. Tell Tailwind to scan gladcn for utility classes */
|
|
63
|
+
@source "../node_modules/gladvn/dist";
|
|
64
|
+
|
|
65
|
+
/* 2. Import gladcn global CSS variables */
|
|
66
|
+
@import "gladvn/gladcn.css";
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Usage:**
|
|
70
|
+
```tsx
|
|
71
|
+
import { Button, Card, CardHeader, CardTitle, CardContent } from "gladvn";
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 🏗️ Architecture: Micro vs. Macro
|
|
77
|
+
|
|
78
|
+
Most component libraries fail in their second year because developers become afraid to modify the core files. `gladcn` solves this with explicit architectural boundaries:
|
|
79
|
+
|
|
80
|
+
- **Micro Components** (`components/micro/`): "Dumb" presentational primitives (e.g., `Button`, `Badge`, `Input`). They do not contain internal React state (`useState`) or business logic. They strictly rely on props for rendering and avoid dictating layout boundaries (like `w-full`).
|
|
81
|
+
- **Macro Components** (`components/macro/`): "Smart" presets and compositions (e.g., `DatePicker`, `SelectPreset`, `PaginationPreset`). These components combine multiple Micro components and manage complex state, accessibility (a11y), and interactions. Macro components strictly reuse Micro components via pure composition.
|
|
82
|
+
|
|
83
|
+
## 🎨 Theming & Customization
|
|
84
|
+
|
|
85
|
+
`gladcn` uses standard CSS variables for theming, ensuring zero runtime parsing overhead. You can easily override these variables in your own CSS file.
|
|
86
|
+
|
|
87
|
+
```css
|
|
88
|
+
:root {
|
|
89
|
+
--primary: oklch(0.6 0.25 260);
|
|
90
|
+
--primary-foreground: oklch(0.98 0 0);
|
|
91
|
+
--radius: 0.5rem;
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
If you cloned the components via `npx` (Option 1), you can modify the CSS directly inside the `gladcn/styles/` directory.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## 📦 Included Components
|
|
100
|
+
|
|
101
|
+
| Basic | Forms & Inputs | Overlays & Feedback | Navigation & Data |
|
|
102
|
+
| --- | --- | --- | --- |
|
|
103
|
+
| Button, Badge, Avatar | Input, Textarea, Checkbox | Dialog, Alert Dialog | Breadcrumb, Menubar |
|
|
104
|
+
| Card, Separator | Select, Combobox, Slider | Popover, Tooltip | Tabs, Pagination |
|
|
105
|
+
| Skeleton, Spinner | Switch, Radio Group | Sheet, Drawer | Table, Accordion |
|
|
106
|
+
| Aspect Ratio | Input OTP, Command | Sonner (Toasts) | Carousel, Chart |
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## 📄 License
|
|
111
|
+
|
|
112
|
+
MIT © Duongy96
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import { execSync } from 'child_process';
|
|
6
|
+
import readline from 'readline';
|
|
7
|
+
|
|
8
|
+
const cyan = "\x1b[36m";
|
|
9
|
+
const green = "\x1b[32m";
|
|
10
|
+
const yellow = "\x1b[33m";
|
|
11
|
+
const bold = "\x1b[1m";
|
|
12
|
+
const dim = "\x1b[90m";
|
|
13
|
+
const reset = "\x1b[0m";
|
|
14
|
+
|
|
15
|
+
if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
16
|
+
console.log(`
|
|
17
|
+
Usage:
|
|
18
|
+
npx @duongy96/gladcn init [destination]
|
|
19
|
+
|
|
20
|
+
Options:
|
|
21
|
+
[destination] The folder where components will be copied. Defaults to "gladcn".
|
|
22
|
+
--help, -h Show this help message.
|
|
23
|
+
`);
|
|
24
|
+
process.exit(0);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Find destination
|
|
28
|
+
let userDest = "gladcn";
|
|
29
|
+
const args = process.argv.slice(2);
|
|
30
|
+
|
|
31
|
+
if (args[0] === "init") {
|
|
32
|
+
if (args[1]) userDest = args[1];
|
|
33
|
+
} else if (args[0]) {
|
|
34
|
+
userDest = args[0];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
38
|
+
const __dirname = path.dirname(__filename);
|
|
39
|
+
|
|
40
|
+
const destPath = path.resolve(process.cwd(), userDest);
|
|
41
|
+
const srcDir = path.resolve(__dirname, "../src");
|
|
42
|
+
|
|
43
|
+
// Recursive file scanner
|
|
44
|
+
const IGNORE_DIRS = ['node_modules', '.git', '.next', 'dist', 'build', 'out', 'coverage', '.cache', userDest];
|
|
45
|
+
|
|
46
|
+
function findCssFiles(dir, fileList = []) {
|
|
47
|
+
if (!fs.existsSync(dir)) return fileList;
|
|
48
|
+
const files = fs.readdirSync(dir);
|
|
49
|
+
for (const file of files) {
|
|
50
|
+
if (IGNORE_DIRS.includes(file)) continue;
|
|
51
|
+
const filePath = path.join(dir, file);
|
|
52
|
+
try {
|
|
53
|
+
const stat = fs.statSync(filePath);
|
|
54
|
+
if (stat.isDirectory()) {
|
|
55
|
+
findCssFiles(filePath, fileList);
|
|
56
|
+
} else if (file.endsWith('.css')) {
|
|
57
|
+
fileList.push(filePath);
|
|
58
|
+
}
|
|
59
|
+
} catch (e) {
|
|
60
|
+
// Ignore permission or access errors
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return fileList;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Native arrow key selector
|
|
67
|
+
async function selectOption(message, options) {
|
|
68
|
+
return new Promise((resolve) => {
|
|
69
|
+
let selectedIndex = 0;
|
|
70
|
+
|
|
71
|
+
const render = () => {
|
|
72
|
+
process.stdout.write('\x1B[?25l'); // Hide cursor
|
|
73
|
+
readline.cursorTo(process.stdout, 0);
|
|
74
|
+
readline.clearScreenDown(process.stdout);
|
|
75
|
+
|
|
76
|
+
console.log(`\x1b[33m?\x1b[0m \x1b[1m${message}\x1b[0m`);
|
|
77
|
+
options.forEach((opt, index) => {
|
|
78
|
+
if (index === selectedIndex) {
|
|
79
|
+
console.log(` \x1b[36m❯ ${opt}\x1b[0m`);
|
|
80
|
+
} else {
|
|
81
|
+
console.log(` ${opt}`);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
readline.moveCursor(process.stdout, 0, -(options.length + 1));
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
render();
|
|
88
|
+
|
|
89
|
+
const onKeyPress = (str, key) => {
|
|
90
|
+
if (key.name === 'up') {
|
|
91
|
+
selectedIndex = selectedIndex > 0 ? selectedIndex - 1 : options.length - 1;
|
|
92
|
+
render();
|
|
93
|
+
} else if (key.name === 'down') {
|
|
94
|
+
selectedIndex = selectedIndex < options.length - 1 ? selectedIndex + 1 : 0;
|
|
95
|
+
render();
|
|
96
|
+
} else if (key.name === 'return' || key.name === 'enter') {
|
|
97
|
+
cleanup();
|
|
98
|
+
console.log(`\x1b[32m✔\x1b[0m \x1b[1m${message}\x1b[0m \x1b[90m…\x1b[0m \x1b[36m${options[selectedIndex]}\x1b[0m`);
|
|
99
|
+
resolve(options[selectedIndex]);
|
|
100
|
+
} else if (key.name === 'c' && key.ctrl) {
|
|
101
|
+
cleanup();
|
|
102
|
+
console.log('\n\x1b[31m✖ Cancelled.\x1b[0m');
|
|
103
|
+
process.exit(1);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const cleanup = () => {
|
|
108
|
+
process.stdin.removeListener('keypress', onKeyPress);
|
|
109
|
+
if (process.stdin.isTTY) process.stdin.setRawMode(false);
|
|
110
|
+
process.stdin.pause();
|
|
111
|
+
readline.moveCursor(process.stdout, 0, options.length + 1);
|
|
112
|
+
process.stdout.write('\x1B[?25h'); // Show cursor
|
|
113
|
+
readline.moveCursor(process.stdout, 0, -(options.length + 1));
|
|
114
|
+
readline.clearScreenDown(process.stdout);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
readline.emitKeypressEvents(process.stdin);
|
|
118
|
+
if (process.stdin.isTTY) process.stdin.setRawMode(true);
|
|
119
|
+
process.stdin.resume();
|
|
120
|
+
process.stdin.on('keypress', onKeyPress);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
async function main() {
|
|
125
|
+
console.log(`\n${cyan}╔══════════════════════════════════════════════════════════════════╗${reset}`);
|
|
126
|
+
console.log(`${cyan}║ ${bold}gladcn${reset}${cyan} — Initialization ║${reset}`);
|
|
127
|
+
console.log(`${cyan}╚══════════════════════════════════════════════════════════════════╝${reset}\n`);
|
|
128
|
+
|
|
129
|
+
let targetCss = "app/globals.css";
|
|
130
|
+
const cssFilesFull = findCssFiles(process.cwd());
|
|
131
|
+
const cssFiles = cssFilesFull.map(f => path.relative(process.cwd(), f));
|
|
132
|
+
|
|
133
|
+
const isTTY = process.stdin.isTTY;
|
|
134
|
+
|
|
135
|
+
if (cssFiles.length === 0) {
|
|
136
|
+
console.log(`\x1b[33m⚠ No CSS files found in the project.\x1b[0m`);
|
|
137
|
+
|
|
138
|
+
let answer = 'y';
|
|
139
|
+
if (isTTY) {
|
|
140
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
141
|
+
answer = await new Promise((resolve) => rl.question(`${yellow}? Do you want to create a new app/globals.css file? (Y/n)${reset} `, resolve));
|
|
142
|
+
rl.close();
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (answer.trim().toLowerCase() !== 'n') {
|
|
146
|
+
targetCss = "app/globals.css";
|
|
147
|
+
const newCssPath = path.resolve(process.cwd(), targetCss);
|
|
148
|
+
if (!fs.existsSync(path.dirname(newCssPath))) {
|
|
149
|
+
fs.mkdirSync(path.dirname(newCssPath), { recursive: true });
|
|
150
|
+
}
|
|
151
|
+
fs.writeFileSync(newCssPath, `@import "tailwindcss";\n`);
|
|
152
|
+
console.log(`\x1b[32m✔\x1b[0m \x1b[1mCreated\x1b[0m \x1b[36m${targetCss}\x1b[0m`);
|
|
153
|
+
} else {
|
|
154
|
+
targetCss = null;
|
|
155
|
+
}
|
|
156
|
+
} else if (!isTTY) {
|
|
157
|
+
const rl = readline.createInterface({
|
|
158
|
+
input: process.stdin,
|
|
159
|
+
output: process.stdout,
|
|
160
|
+
});
|
|
161
|
+
const ask = (question) => new Promise((resolve) => rl.question(question, resolve));
|
|
162
|
+
const cssFile = await ask(
|
|
163
|
+
`${yellow} 📄 Path to your main CSS file? ${dim}(default: app/globals.css)${reset}\n > `
|
|
164
|
+
);
|
|
165
|
+
targetCss = cssFile.trim() || "app/globals.css";
|
|
166
|
+
rl.close();
|
|
167
|
+
} else if (cssFiles.length === 1) {
|
|
168
|
+
targetCss = cssFiles[0];
|
|
169
|
+
console.log(`\x1b[32m✔\x1b[0m \x1b[1mFound global CSS file\x1b[0m \x1b[90m…\x1b[0m \x1b[36m${targetCss}\x1b[0m`);
|
|
170
|
+
} else {
|
|
171
|
+
// We have more than 1 file, and environment is TTY
|
|
172
|
+
targetCss = await selectOption("Which CSS file should we inject gladcn styles into?", cssFiles);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
let cssFilePath = null;
|
|
176
|
+
if (targetCss) {
|
|
177
|
+
cssFilePath = path.resolve(process.cwd(), targetCss);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// 1. Copy files
|
|
181
|
+
let dirsToCopy = [];
|
|
182
|
+
if (fs.existsSync(srcDir)) {
|
|
183
|
+
const excludeList = ['dev', 'test', 'vite-env.d.ts'];
|
|
184
|
+
dirsToCopy = fs.readdirSync(srcDir).filter(item => !excludeList.includes(item));
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
console.log(`\n\x1b[36mInitializing gladcn components into ${userDest}...\x1b[0m`);
|
|
188
|
+
|
|
189
|
+
if (!fs.existsSync(destPath)) {
|
|
190
|
+
fs.mkdirSync(destPath, { recursive: true });
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
let hasErrors = false;
|
|
194
|
+
|
|
195
|
+
for (const dir of dirsToCopy) {
|
|
196
|
+
const sourcePath = path.join(srcDir, dir);
|
|
197
|
+
const targetPath = path.join(destPath, dir);
|
|
198
|
+
|
|
199
|
+
if (fs.existsSync(sourcePath)) {
|
|
200
|
+
try {
|
|
201
|
+
fs.cpSync(sourcePath, targetPath, { recursive: true, force: true });
|
|
202
|
+
console.log(`\x1b[32m✔ Copied ${dir}\x1b[0m`);
|
|
203
|
+
} catch (err) {
|
|
204
|
+
console.error(`\x1b[31m✖ Failed to copy ${dir}/: ${err.message}\x1b[0m`);
|
|
205
|
+
hasErrors = true;
|
|
206
|
+
}
|
|
207
|
+
} else {
|
|
208
|
+
console.warn(`\x1b[33m⚠ Source directory src/${dir} not found in package.\x1b[0m`);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// 2. Inject CSS import
|
|
213
|
+
if (cssFilePath && fs.existsSync(cssFilePath)) {
|
|
214
|
+
const gladcnCssPath = path.resolve(destPath, "styles", "gladcn.css");
|
|
215
|
+
const cssDir = path.dirname(cssFilePath);
|
|
216
|
+
|
|
217
|
+
let relPath = path.relative(cssDir, gladcnCssPath);
|
|
218
|
+
if (!relPath.startsWith('.')) {
|
|
219
|
+
relPath = './' + relPath;
|
|
220
|
+
}
|
|
221
|
+
relPath = relPath.replace(/\\/g, '/');
|
|
222
|
+
|
|
223
|
+
let content = fs.readFileSync(cssFilePath, "utf8");
|
|
224
|
+
|
|
225
|
+
if (content.includes(relPath)) {
|
|
226
|
+
console.log(`\x1b[90m⏭ CSS import already exists in ${targetCss}\x1b[0m`);
|
|
227
|
+
} else {
|
|
228
|
+
const importStatement = `@import "${relPath}";`;
|
|
229
|
+
|
|
230
|
+
const tailwindPattern = /@import\s+["']tailwindcss["'];?\s*\n?/;
|
|
231
|
+
if (tailwindPattern.test(content)) {
|
|
232
|
+
content = content.replace(tailwindPattern, (match) => match + importStatement + '\n');
|
|
233
|
+
} else {
|
|
234
|
+
content = importStatement + '\n' + content;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
fs.writeFileSync(cssFilePath, content);
|
|
238
|
+
console.log(`\x1b[32m✔ Injected CSS import into ${targetCss}\x1b[0m`);
|
|
239
|
+
}
|
|
240
|
+
} else if (targetCss) {
|
|
241
|
+
console.log(`\x1b[33m⚠ CSS file not found at ${targetCss}. You will need to manually import ${userDest}/styles/gladcn.css\x1b[0m`);
|
|
242
|
+
} else {
|
|
243
|
+
console.log(`\x1b[33m⚠ No CSS file configured. You will need to manually import ${userDest}/styles/gladcn.css into your project.\x1b[0m`);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// 2.5 Configure tsconfig.json
|
|
247
|
+
if (isTTY) {
|
|
248
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
249
|
+
const answer = await new Promise((resolve) => rl.question(`\n${yellow}? Do you want to configure tsconfig.json to use the @gladcn/* alias? (Y/n)${reset} `, resolve));
|
|
250
|
+
rl.close();
|
|
251
|
+
|
|
252
|
+
if (answer.trim().toLowerCase() !== 'n') {
|
|
253
|
+
const tsconfigPath = path.resolve(process.cwd(), 'tsconfig.json');
|
|
254
|
+
if (fs.existsSync(tsconfigPath)) {
|
|
255
|
+
let tsContent = fs.readFileSync(tsconfigPath, 'utf8');
|
|
256
|
+
const aliasPath = `./${userDest}/*`;
|
|
257
|
+
|
|
258
|
+
if (tsContent.includes('"@gladcn/*"')) {
|
|
259
|
+
console.log(`\x1b[90m⏭ @gladcn/* alias already exists in tsconfig.json\x1b[0m`);
|
|
260
|
+
} else {
|
|
261
|
+
const pathsRegex = /"paths"\s*:\s*\{/;
|
|
262
|
+
if (pathsRegex.test(tsContent)) {
|
|
263
|
+
tsContent = tsContent.replace(pathsRegex, `"paths": {\n "@gladcn/*": ["${aliasPath}"],`);
|
|
264
|
+
fs.writeFileSync(tsconfigPath, tsContent);
|
|
265
|
+
console.log(`\x1b[32m✔ Injected @gladcn/* alias into existing paths\x1b[0m`);
|
|
266
|
+
} else {
|
|
267
|
+
const compilerOptionsRegex = /"compilerOptions"\s*:\s*\{/;
|
|
268
|
+
if (compilerOptionsRegex.test(tsContent)) {
|
|
269
|
+
tsContent = tsContent.replace(compilerOptionsRegex, `"compilerOptions": {\n "paths": {\n "@gladcn/*": ["${aliasPath}"]\n },`);
|
|
270
|
+
fs.writeFileSync(tsconfigPath, tsContent);
|
|
271
|
+
console.log(`\x1b[32m✔ Injected paths object and @gladcn/* alias\x1b[0m`);
|
|
272
|
+
} else {
|
|
273
|
+
console.log(`\x1b[33m⚠ Could not find compilerOptions in tsconfig.json. Please add manually.\x1b[0m`);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
} else {
|
|
278
|
+
console.log(`\x1b[33m⚠ tsconfig.json not found. Please configure alias manually if desired.\x1b[0m`);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// 3. Install dependencies
|
|
284
|
+
try {
|
|
285
|
+
const pkgPath = path.resolve(__dirname, "../package.json");
|
|
286
|
+
const pkgContent = fs.readFileSync(pkgPath, "utf-8");
|
|
287
|
+
const pkg = JSON.parse(pkgContent);
|
|
288
|
+
const depsObj = pkg.dependencies || {};
|
|
289
|
+
|
|
290
|
+
if (Object.keys(depsObj).length > 0) {
|
|
291
|
+
const depsToInstall = Object.entries(depsObj).map(([name, version]) => `${name}@"${version}"`);
|
|
292
|
+
|
|
293
|
+
let pm = "npm";
|
|
294
|
+
let installCmd = "install";
|
|
295
|
+
|
|
296
|
+
if (fs.existsSync(path.resolve(process.cwd(), "pnpm-lock.yaml"))) {
|
|
297
|
+
pm = "pnpm";
|
|
298
|
+
installCmd = "add";
|
|
299
|
+
} else if (fs.existsSync(path.resolve(process.cwd(), "yarn.lock"))) {
|
|
300
|
+
pm = "yarn";
|
|
301
|
+
installCmd = "add";
|
|
302
|
+
} else if (fs.existsSync(path.resolve(process.cwd(), "bun.lockb"))) {
|
|
303
|
+
pm = "bun";
|
|
304
|
+
installCmd = "add";
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
const fullCmd = `${pm} ${installCmd} ${depsToInstall.join(" ")}`;
|
|
308
|
+
|
|
309
|
+
console.log(`\n\x1b[36mInstalling required dependencies using ${pm}...\x1b[0m`);
|
|
310
|
+
execSync(fullCmd, { stdio: "inherit", cwd: process.cwd() });
|
|
311
|
+
console.log(`\x1b[32m✔ Dependencies installed successfully!\x1b[0m`);
|
|
312
|
+
}
|
|
313
|
+
} catch (err) {
|
|
314
|
+
console.error(`\x1b[31m✖ Failed to install dependencies: ${err.message}\x1b[0m`);
|
|
315
|
+
hasErrors = true;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
if (!hasErrors) {
|
|
319
|
+
console.log(`\n\x1b[32m✨ Successfully initialized gladcn files in ${userDest}!\x1b[0m`);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
main().catch(err => {
|
|
324
|
+
console.error(`\x1b[31m✖ An unexpected error occurred: ${err.message}\x1b[0m`);
|
|
325
|
+
process.exit(1);
|
|
326
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Accordion } from '../../components/micro/accordion';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface AccordionPresetItem {
|
|
4
|
+
value: string;
|
|
5
|
+
title: React.ReactNode;
|
|
6
|
+
content: React.ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export type AccordionPresetProps = React.ComponentProps<typeof Accordion> & {
|
|
10
|
+
items: AccordionPresetItem[];
|
|
11
|
+
};
|
|
12
|
+
declare const AccordionPreset: React.ForwardRefExoticComponent<Omit<AccordionPresetProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export { AccordionPreset };
|
|
14
|
+
//# sourceMappingURL=accordion-preset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion-preset.d.ts","sourceRoot":"","sources":["../../../src/components/macro/accordion-preset.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAIV,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,GAAG;IAC1E,KAAK,EAAE,mBAAmB,EAAE,CAAC;CAC9B,CAAC;AAEF,QAAA,MAAM,eAAe,0GAkBnB,CAAC;AAGH,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AlertDialog } from '../../components/micro/alert-dialog';
|
|
2
|
+
import { Color, Size, Variant } from '../../lib/types';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
type AlertDialogPresetProps = Omit<React.ComponentProps<typeof AlertDialog>, "children"> & {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
trigger?: React.ReactElement;
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
title?: React.ReactNode;
|
|
9
|
+
description?: React.ReactNode;
|
|
10
|
+
cancelLabel?: React.ReactNode;
|
|
11
|
+
cancelColor?: Color;
|
|
12
|
+
cancelVariant?: Variant;
|
|
13
|
+
actionLabel?: React.ReactNode;
|
|
14
|
+
actionColor?: Color;
|
|
15
|
+
actionVariant?: Variant;
|
|
16
|
+
onAction?: () => void;
|
|
17
|
+
onCancel?: () => void;
|
|
18
|
+
size?: Size;
|
|
19
|
+
};
|
|
20
|
+
declare function AlertDialogPreset({ trigger, icon, title, description, cancelLabel, cancelColor, cancelVariant, actionLabel, actionColor, actionVariant, onAction, onCancel, size, children, ...props }: AlertDialogPresetProps): React.JSX.Element;
|
|
21
|
+
declare namespace AlertDialogPreset {
|
|
22
|
+
var displayName: string;
|
|
23
|
+
}
|
|
24
|
+
export { AlertDialogPreset };
|
|
25
|
+
export type { AlertDialogPresetProps };
|
|
26
|
+
//# sourceMappingURL=alert-dialog-preset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dialog-preset.d.ts","sourceRoot":"","sources":["../../../src/components/macro/alert-dialog-preset.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EAWZ,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,IAAI,EAAE,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAEtE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,KAAK,sBAAsB,GAAG,IAAI,CAChC,KAAK,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC,EACxC,UAAU,CACX,GAAG;IACF,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,CAAC;AAEF,iBAAS,iBAAiB,CAAC,EACzB,OAAO,EACP,IAAI,EACJ,KAAK,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACX,aAAa,EACb,WAAW,EACX,WAAW,EACX,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,IAAW,EACX,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,sBAAsB,qBAsDxB;kBAtEQ,iBAAiB;;;AA0E1B,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAC7B,YAAY,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AlertProps } from '../../components/micro/alert';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type AlertPresetProps = AlertProps & {
|
|
4
|
+
title?: React.ReactNode;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
icon?: React.ReactElement;
|
|
7
|
+
action?: React.ReactNode;
|
|
8
|
+
dismissible?: boolean;
|
|
9
|
+
onDismiss?: () => void;
|
|
10
|
+
defaultOpen?: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare const AlertPreset: React.ForwardRefExoticComponent<Omit<AlertPresetProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export { AlertPreset };
|
|
14
|
+
//# sourceMappingURL=alert-preset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-preset.d.ts","sourceRoot":"","sources":["../../../src/components/macro/alert-preset.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,UAAU,EAChB,MAAM,8BAA8B,CAAC;AAItC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG;IAC1C,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,QAAA,MAAM,WAAW,sGAkEhB,CAAC;AAIF,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Avatar } from '../../components/micro/avatar';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type AvatarPresetProps = React.ComponentProps<typeof Avatar> & {
|
|
4
|
+
src?: string;
|
|
5
|
+
alt?: string;
|
|
6
|
+
fallback?: React.ReactNode;
|
|
7
|
+
status?: "online" | "offline" | "away" | "busy";
|
|
8
|
+
};
|
|
9
|
+
declare const AvatarPreset: React.ForwardRefExoticComponent<Omit<AvatarPresetProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
10
|
+
export { AvatarPreset };
|
|
11
|
+
//# sourceMappingURL=avatar-preset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar-preset.d.ts","sourceRoot":"","sources":["../../../src/components/macro/avatar-preset.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EAIP,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG;IACpE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;CACjD,CAAC;AAmBF,QAAA,MAAM,YAAY,wGAkBhB,CAAC;AAGH,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Breadcrumb } from '../../components/micro/breadcrumb';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface BreadcrumbPresetItem {
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
href?: string;
|
|
6
|
+
}
|
|
7
|
+
export type BreadcrumbPresetProps = React.ComponentProps<typeof Breadcrumb> & {
|
|
8
|
+
items: BreadcrumbPresetItem[];
|
|
9
|
+
};
|
|
10
|
+
declare const BreadcrumbPreset: React.ForwardRefExoticComponent<Omit<BreadcrumbPresetProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
11
|
+
export { BreadcrumbPreset };
|
|
12
|
+
//# sourceMappingURL=breadcrumb-preset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumb-preset.d.ts","sourceRoot":"","sources":["../../../src/components/macro/breadcrumb-preset.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAMX,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,UAAU,CAAC,GAAG;IAC5E,KAAK,EAAE,oBAAoB,EAAE,CAAC;CAC/B,CAAC;AAEF,QAAA,MAAM,gBAAgB,wGA2BpB,CAAC;AAGH,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Card } from '../../components/micro/card';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type CardPresetProps = Omit<React.ComponentProps<typeof Card>, "title"> & {
|
|
4
|
+
title?: React.ReactNode;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
footer?: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
declare const CardPreset: React.ForwardRefExoticComponent<Omit<CardPresetProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export { CardPreset };
|
|
10
|
+
//# sourceMappingURL=card-preset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-preset.d.ts","sourceRoot":"","sources":["../../../src/components/macro/card-preset.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAML,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,EACjC,OAAO,CACR,GAAG;IACF,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,CAAC;AAEF,QAAA,MAAM,UAAU,qGAqBf,CAAC;AAGF,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Carousel } from '../../components/micro/carousel';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type CarouselPresetProps = Omit<React.ComponentProps<typeof Carousel>, "setApi" | "onScroll"> & {
|
|
4
|
+
items: {
|
|
5
|
+
id: string | number;
|
|
6
|
+
content: React.ReactNode;
|
|
7
|
+
}[];
|
|
8
|
+
showArrows?: boolean;
|
|
9
|
+
showDots?: boolean;
|
|
10
|
+
itemClassName?: string;
|
|
11
|
+
contentClassName?: string;
|
|
12
|
+
index?: number;
|
|
13
|
+
defaultIndex?: number;
|
|
14
|
+
onIndexChange?: (index: number) => void;
|
|
15
|
+
};
|
|
16
|
+
declare const CarouselPreset: React.ForwardRefExoticComponent<Omit<CarouselPresetProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
export { CarouselPreset };
|
|
18
|
+
//# sourceMappingURL=carousel-preset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carousel-preset.d.ts","sourceRoot":"","sources":["../../../src/components/macro/carousel-preset.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAOT,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACpC,KAAK,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,EACrC,QAAQ,GAAG,UAAU,CACtB,GAAG;IACF,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE,EAAE,CAAC;IAC3D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAG1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF,QAAA,MAAM,cAAc,yGAsHnB,CAAC;AAGF,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Checkbox } from '../../components/micro/checkbox';
|
|
2
|
+
import { Size } from '../../lib/types';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
export type CheckboxPresetProps = Omit<React.ComponentProps<typeof Checkbox>, "className" | "size"> & {
|
|
5
|
+
className?: string;
|
|
6
|
+
label?: React.ReactNode;
|
|
7
|
+
description?: React.ReactNode;
|
|
8
|
+
errorMessage?: React.ReactNode;
|
|
9
|
+
showError?: boolean;
|
|
10
|
+
size?: Size;
|
|
11
|
+
};
|
|
12
|
+
declare const CheckboxPreset: React.ForwardRefExoticComponent<Omit<CheckboxPresetProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
13
|
+
export { CheckboxPreset };
|
|
14
|
+
//# sourceMappingURL=checkbox-preset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox-preset.d.ts","sourceRoot":"","sources":["../../../src/components/macro/checkbox-preset.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAqB,MAAM,iCAAiC,CAAC;AAO9E,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACpC,KAAK,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,EACrC,WAAW,GAAG,MAAM,CACrB,GAAG;IAEF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,CAAC;AAEF,QAAA,MAAM,cAAc,sGAuDnB,CAAC;AAGF,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Size } from '../../lib/types';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface ComboboxOption {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface ComboboxPresetProps {
|
|
9
|
+
options: ComboboxOption[];
|
|
10
|
+
value?: string;
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
onValueChange?: (value: string | null) => void;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
searchPlaceholder?: string;
|
|
15
|
+
emptyText?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
label?: React.ReactNode;
|
|
19
|
+
description?: React.ReactNode;
|
|
20
|
+
errorMessage?: React.ReactNode;
|
|
21
|
+
showError?: boolean;
|
|
22
|
+
id?: string;
|
|
23
|
+
size?: Size;
|
|
24
|
+
}
|
|
25
|
+
declare const ComboboxPreset: React.ForwardRefExoticComponent<ComboboxPresetProps & React.RefAttributes<HTMLInputElement>>;
|
|
26
|
+
export { ComboboxPreset };
|
|
27
|
+
//# sourceMappingURL=combobox-preset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox-preset.d.ts","sourceRoot":"","sources":["../../../src/components/macro/combobox-preset.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,IAAI,CAAC;CACb;AAED,QAAA,MAAM,cAAc,8FAgFnB,CAAC;AAGF,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut } from '../../components/micro/command';
|
|
2
|
+
import { Dialog } from '../../components/micro/dialog';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
type CommandDialogProps = Omit<React.ComponentProps<typeof Dialog>, "children"> & {
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
declare function CommandDialog({ title, description, children, className, ...props }: CommandDialogProps): React.JSX.Element;
|
|
11
|
+
declare namespace CommandDialog {
|
|
12
|
+
var displayName: string;
|
|
13
|
+
}
|
|
14
|
+
export { CommandDialog, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, };
|
|
15
|
+
export type { CommandDialogProps };
|
|
16
|
+
//# sourceMappingURL=command-preset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-preset.d.ts","sourceRoot":"","sources":["../../../src/components/macro/command-preset.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,eAAe,EAChB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,MAAM,EAMP,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,KAAK,kBAAkB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,iBAAS,aAAa,CAAC,EACrB,KAAyB,EACzB,WAA8C,EAC9C,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,kBAAkB,qBAqBpB;kBA3BQ,aAAa;;;AA8BtB,OAAO,EACL,aAAa,EAEb,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,eAAe,GAChB,CAAC;AACF,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
|