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,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ✅ AUDITED & REFACTORED
|
|
3
|
+
* - Design System Compliant (20 Commandments)
|
|
4
|
+
* - WCAG AAA/AA
|
|
5
|
+
* - Form Control Parity
|
|
6
|
+
* - CSS Delegated Logic
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
|
|
10
|
+
import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar";
|
|
11
|
+
import * as React from "react";
|
|
12
|
+
|
|
13
|
+
import { type Size } from "../../lib/types";
|
|
14
|
+
import { cn } from "../../lib/utils";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @description An image element with a fallback for representing the user.
|
|
18
|
+
* @requires AvatarImage, AvatarFallback
|
|
19
|
+
* @example
|
|
20
|
+
* <Avatar>
|
|
21
|
+
* <AvatarImage src="https://github.com/shadcn.png" />
|
|
22
|
+
* <AvatarFallback>CN</AvatarFallback>
|
|
23
|
+
* </Avatar>
|
|
24
|
+
*/
|
|
25
|
+
const Avatar = React.forwardRef<
|
|
26
|
+
React.ComponentRef<typeof AvatarPrimitive.Root>,
|
|
27
|
+
AvatarPrimitive.Root.Props & { size?: Size }
|
|
28
|
+
>(({ className, size = "md", ...props }, ref) => {
|
|
29
|
+
return (
|
|
30
|
+
<AvatarPrimitive.Root
|
|
31
|
+
ref={ref}
|
|
32
|
+
data-slot="avatar"
|
|
33
|
+
data-size={size}
|
|
34
|
+
className={cn(
|
|
35
|
+
"group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",
|
|
36
|
+
"group-data-[slot=avatar-group]/avatar-group:ring-2 group-data-[slot=avatar-group]/avatar-group:ring-background",
|
|
37
|
+
className,
|
|
38
|
+
)}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
);
|
|
42
|
+
});
|
|
43
|
+
Avatar.displayName = "Avatar";
|
|
44
|
+
|
|
45
|
+
const AvatarImage = React.forwardRef<
|
|
46
|
+
React.ComponentRef<typeof AvatarPrimitive.Image>,
|
|
47
|
+
AvatarPrimitive.Image.Props
|
|
48
|
+
>(({ className, ...props }, ref) => {
|
|
49
|
+
return (
|
|
50
|
+
<AvatarPrimitive.Image
|
|
51
|
+
ref={ref}
|
|
52
|
+
data-slot="avatar-image"
|
|
53
|
+
className={cn(
|
|
54
|
+
"aspect-square size-full rounded-full object-cover",
|
|
55
|
+
className,
|
|
56
|
+
)}
|
|
57
|
+
{...props}
|
|
58
|
+
/>
|
|
59
|
+
);
|
|
60
|
+
});
|
|
61
|
+
AvatarImage.displayName = "AvatarImage";
|
|
62
|
+
|
|
63
|
+
const AvatarFallback = React.forwardRef<
|
|
64
|
+
React.ComponentRef<typeof AvatarPrimitive.Fallback>,
|
|
65
|
+
AvatarPrimitive.Fallback.Props
|
|
66
|
+
>(({ className, ...props }, ref) => {
|
|
67
|
+
return (
|
|
68
|
+
<AvatarPrimitive.Fallback
|
|
69
|
+
ref={ref}
|
|
70
|
+
data-slot="avatar-fallback"
|
|
71
|
+
className={cn(
|
|
72
|
+
"flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs group-data-[size=lg]/avatar:text-base",
|
|
73
|
+
className,
|
|
74
|
+
)}
|
|
75
|
+
{...props}
|
|
76
|
+
/>
|
|
77
|
+
);
|
|
78
|
+
});
|
|
79
|
+
AvatarFallback.displayName = "AvatarFallback";
|
|
80
|
+
|
|
81
|
+
const AvatarBadge = React.forwardRef<
|
|
82
|
+
HTMLSpanElement,
|
|
83
|
+
React.ComponentProps<"span">
|
|
84
|
+
>(({ className, ...props }, ref) => {
|
|
85
|
+
return (
|
|
86
|
+
<span
|
|
87
|
+
ref={ref}
|
|
88
|
+
data-slot="avatar-badge"
|
|
89
|
+
className={cn(
|
|
90
|
+
"rounded-full bg-primary ring-2 ring-background",
|
|
91
|
+
"group-data-[size=sm]/avatar:size-2",
|
|
92
|
+
"group-data-[size=md]/avatar:size-2.5",
|
|
93
|
+
"group-data-[size=lg]/avatar:size-3",
|
|
94
|
+
className,
|
|
95
|
+
)}
|
|
96
|
+
{...props}
|
|
97
|
+
/>
|
|
98
|
+
);
|
|
99
|
+
});
|
|
100
|
+
AvatarBadge.displayName = "AvatarBadge";
|
|
101
|
+
|
|
102
|
+
const AvatarGroup = React.forwardRef<
|
|
103
|
+
HTMLDivElement,
|
|
104
|
+
React.ComponentProps<"div">
|
|
105
|
+
>(({ className, ...props }, ref) => {
|
|
106
|
+
return (
|
|
107
|
+
<div
|
|
108
|
+
ref={ref}
|
|
109
|
+
data-slot="avatar-group"
|
|
110
|
+
className={cn("group/avatar-group flex -space-x-2", className)}
|
|
111
|
+
{...props}
|
|
112
|
+
/>
|
|
113
|
+
);
|
|
114
|
+
});
|
|
115
|
+
AvatarGroup.displayName = "AvatarGroup";
|
|
116
|
+
|
|
117
|
+
const AvatarGroupCount = React.forwardRef<
|
|
118
|
+
HTMLDivElement,
|
|
119
|
+
React.ComponentProps<"div"> & { size?: Size }
|
|
120
|
+
>(({ className, size = "md", ...props }, ref) => {
|
|
121
|
+
return (
|
|
122
|
+
<div
|
|
123
|
+
ref={ref}
|
|
124
|
+
data-slot="avatar-group-count"
|
|
125
|
+
data-size={size}
|
|
126
|
+
className={cn(
|
|
127
|
+
"relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background data-[size=lg]:size-10 data-[size=sm]:size-6",
|
|
128
|
+
className,
|
|
129
|
+
)}
|
|
130
|
+
{...props}
|
|
131
|
+
/>
|
|
132
|
+
);
|
|
133
|
+
});
|
|
134
|
+
AvatarGroupCount.displayName = "AvatarGroupCount";
|
|
135
|
+
|
|
136
|
+
export {
|
|
137
|
+
Avatar,
|
|
138
|
+
AvatarBadge,
|
|
139
|
+
AvatarFallback,
|
|
140
|
+
AvatarGroup,
|
|
141
|
+
AvatarGroupCount,
|
|
142
|
+
AvatarImage,
|
|
143
|
+
};
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ✅ AUDITED & REFACTORED
|
|
3
|
+
* - Design System Compliant (20 Commandments)
|
|
4
|
+
* - WCAG AAA/AA
|
|
5
|
+
* - Form Control Parity
|
|
6
|
+
* - CSS Delegated Logic
|
|
7
|
+
*/
|
|
8
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
9
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
10
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
11
|
+
|
|
12
|
+
import { cn } from "../../lib/utils";
|
|
13
|
+
|
|
14
|
+
const badgeVariants = cva(
|
|
15
|
+
"group/badge inline-flex h-6 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2.5 py-0.5 text-xs font-medium whitespace-nowrap transition-colors focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-offset-1 focus-visible:ring-offset-background",
|
|
16
|
+
{
|
|
17
|
+
variants: {
|
|
18
|
+
variant: {
|
|
19
|
+
solid: "border-transparent",
|
|
20
|
+
outline: "bg-transparent",
|
|
21
|
+
soft: "border-transparent",
|
|
22
|
+
},
|
|
23
|
+
color: {
|
|
24
|
+
primary: "",
|
|
25
|
+
secondary: "",
|
|
26
|
+
destructive: "",
|
|
27
|
+
warning: "",
|
|
28
|
+
success: "",
|
|
29
|
+
info: "",
|
|
30
|
+
tertiary: "",
|
|
31
|
+
muted: "",
|
|
32
|
+
accent: "",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
compoundVariants: [
|
|
36
|
+
// Solid
|
|
37
|
+
{
|
|
38
|
+
variant: "solid",
|
|
39
|
+
color: "primary",
|
|
40
|
+
className: "bg-primary text-primary-foreground",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
variant: "solid",
|
|
44
|
+
color: "secondary",
|
|
45
|
+
className: "bg-secondary text-secondary-foreground",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
variant: "solid",
|
|
49
|
+
color: "destructive",
|
|
50
|
+
className: "bg-destructive text-destructive-foreground",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
variant: "solid",
|
|
54
|
+
color: "warning",
|
|
55
|
+
className: "bg-warning text-warning-foreground",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
variant: "solid",
|
|
59
|
+
color: "success",
|
|
60
|
+
className: "bg-success text-success-foreground",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
variant: "solid",
|
|
64
|
+
color: "info",
|
|
65
|
+
className: "bg-info text-info-foreground",
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
variant: "solid",
|
|
69
|
+
color: "tertiary",
|
|
70
|
+
className: "bg-tertiary text-tertiary-foreground",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
variant: "solid",
|
|
74
|
+
color: "muted",
|
|
75
|
+
className: "bg-muted text-muted-foreground",
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
variant: "solid",
|
|
79
|
+
color: "accent",
|
|
80
|
+
className: "bg-accent text-accent-foreground",
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
// Outline
|
|
84
|
+
{
|
|
85
|
+
variant: "outline",
|
|
86
|
+
color: "primary",
|
|
87
|
+
className: "border-primary text-primary",
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
variant: "outline",
|
|
91
|
+
color: "secondary",
|
|
92
|
+
className: "border-secondary text-secondary",
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
variant: "outline",
|
|
96
|
+
color: "destructive",
|
|
97
|
+
className: "border-destructive text-destructive",
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
variant: "outline",
|
|
101
|
+
color: "warning",
|
|
102
|
+
className: "border-warning text-warning",
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
variant: "outline",
|
|
106
|
+
color: "success",
|
|
107
|
+
className: "border-success text-success",
|
|
108
|
+
},
|
|
109
|
+
{ variant: "outline", color: "info", className: "border-info text-info" },
|
|
110
|
+
{
|
|
111
|
+
variant: "outline",
|
|
112
|
+
color: "tertiary",
|
|
113
|
+
className: "border-tertiary text-tertiary",
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
variant: "outline",
|
|
117
|
+
color: "muted",
|
|
118
|
+
className: "border-muted text-muted-foreground",
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
variant: "outline",
|
|
122
|
+
color: "accent",
|
|
123
|
+
className: "border-accent text-accent-foreground",
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
// Soft
|
|
127
|
+
{
|
|
128
|
+
variant: "soft",
|
|
129
|
+
color: "primary",
|
|
130
|
+
className: "bg-primary/15 text-primary",
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
variant: "soft",
|
|
134
|
+
color: "secondary",
|
|
135
|
+
className: "bg-secondary/15 text-secondary",
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
variant: "soft",
|
|
139
|
+
color: "destructive",
|
|
140
|
+
className: "bg-destructive/15 text-destructive",
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
variant: "soft",
|
|
144
|
+
color: "warning",
|
|
145
|
+
className: "bg-warning/15 text-warning",
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
variant: "soft",
|
|
149
|
+
color: "success",
|
|
150
|
+
className: "bg-success/15 text-success",
|
|
151
|
+
},
|
|
152
|
+
{ variant: "soft", color: "info", className: "bg-info/15 text-info" },
|
|
153
|
+
{
|
|
154
|
+
variant: "soft",
|
|
155
|
+
color: "tertiary",
|
|
156
|
+
className: "bg-tertiary/15 text-tertiary",
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
variant: "soft",
|
|
160
|
+
color: "muted",
|
|
161
|
+
className: "bg-muted/50 text-muted-foreground",
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
variant: "soft",
|
|
165
|
+
color: "accent",
|
|
166
|
+
className: "bg-accent/50 text-accent-foreground",
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
},
|
|
170
|
+
);
|
|
171
|
+
|
|
172
|
+
import * as React from "react";
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* @description Displays a badge or a component that looks like a badge.
|
|
176
|
+
* @example
|
|
177
|
+
* <Badge variant="outline">Badge</Badge>
|
|
178
|
+
*/
|
|
179
|
+
export type BadgeProps = useRender.ComponentProps<"span"> &
|
|
180
|
+
VariantProps<typeof badgeVariants>;
|
|
181
|
+
|
|
182
|
+
const Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(
|
|
183
|
+
(
|
|
184
|
+
{ className, variant = "solid", color = "primary", render, ...props },
|
|
185
|
+
ref,
|
|
186
|
+
) => {
|
|
187
|
+
return useRender({
|
|
188
|
+
defaultTagName: "span",
|
|
189
|
+
props: mergeProps<"span">(
|
|
190
|
+
{
|
|
191
|
+
ref,
|
|
192
|
+
className: cn(badgeVariants({ variant, color }), className),
|
|
193
|
+
},
|
|
194
|
+
props,
|
|
195
|
+
),
|
|
196
|
+
render,
|
|
197
|
+
state: {
|
|
198
|
+
slot: "badge",
|
|
199
|
+
variant,
|
|
200
|
+
color,
|
|
201
|
+
},
|
|
202
|
+
});
|
|
203
|
+
},
|
|
204
|
+
);
|
|
205
|
+
Badge.displayName = "Badge";
|
|
206
|
+
|
|
207
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ✅ AUDITED & REFACTORED
|
|
3
|
+
* - Design System Compliant (22 Commandments)
|
|
4
|
+
* - WCAG AAA/AA
|
|
5
|
+
* - Form Control Parity
|
|
6
|
+
* - CSS Delegated Logic
|
|
7
|
+
*/
|
|
8
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
9
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
|
|
12
|
+
import { cn } from "../../lib/utils";
|
|
13
|
+
import { ChevronRightIcon, MoreHorizontalIcon } from "lucide-react";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @description Displays the path to the current resource using a hierarchy of links.
|
|
17
|
+
* @requires BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbSeparator, BreadcrumbPage
|
|
18
|
+
* @example
|
|
19
|
+
* <Breadcrumb>
|
|
20
|
+
* <BreadcrumbList>
|
|
21
|
+
* <BreadcrumbItem><BreadcrumbLink href="/">Home</BreadcrumbLink></BreadcrumbItem>
|
|
22
|
+
* <BreadcrumbSeparator />
|
|
23
|
+
* <BreadcrumbItem><BreadcrumbPage>Current</BreadcrumbPage></BreadcrumbItem>
|
|
24
|
+
* </BreadcrumbList>
|
|
25
|
+
* </Breadcrumb>
|
|
26
|
+
*/
|
|
27
|
+
const Breadcrumb = React.forwardRef<HTMLElement, React.ComponentProps<"nav">>(
|
|
28
|
+
({ className, ...props }, ref) => {
|
|
29
|
+
return (
|
|
30
|
+
<nav
|
|
31
|
+
ref={ref}
|
|
32
|
+
aria-label="breadcrumb"
|
|
33
|
+
data-slot="breadcrumb"
|
|
34
|
+
className={cn(className)}
|
|
35
|
+
{...props}
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
|
+
},
|
|
39
|
+
);
|
|
40
|
+
Breadcrumb.displayName = "Breadcrumb";
|
|
41
|
+
|
|
42
|
+
const BreadcrumbList = React.forwardRef<
|
|
43
|
+
HTMLOListElement,
|
|
44
|
+
React.ComponentProps<"ol">
|
|
45
|
+
>(({ className, ...props }, ref) => {
|
|
46
|
+
return (
|
|
47
|
+
<ol
|
|
48
|
+
ref={ref}
|
|
49
|
+
data-slot="breadcrumb-list"
|
|
50
|
+
className={cn(
|
|
51
|
+
"flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground",
|
|
52
|
+
className,
|
|
53
|
+
)}
|
|
54
|
+
{...props}
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
});
|
|
58
|
+
BreadcrumbList.displayName = "BreadcrumbList";
|
|
59
|
+
|
|
60
|
+
const BreadcrumbItem = React.forwardRef<
|
|
61
|
+
HTMLLIElement,
|
|
62
|
+
React.ComponentProps<"li">
|
|
63
|
+
>(({ className, ...props }, ref) => {
|
|
64
|
+
return (
|
|
65
|
+
<li
|
|
66
|
+
ref={ref}
|
|
67
|
+
data-slot="breadcrumb-item"
|
|
68
|
+
className={cn("inline-flex items-center gap-1", className)}
|
|
69
|
+
{...props}
|
|
70
|
+
/>
|
|
71
|
+
);
|
|
72
|
+
});
|
|
73
|
+
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
74
|
+
|
|
75
|
+
export type BreadcrumbLinkProps = useRender.ComponentProps<"a">;
|
|
76
|
+
|
|
77
|
+
const BreadcrumbLink = React.forwardRef<HTMLAnchorElement, BreadcrumbLinkProps>(
|
|
78
|
+
({ className, render, ...props }, ref) => {
|
|
79
|
+
return useRender({
|
|
80
|
+
defaultTagName: "a",
|
|
81
|
+
props: mergeProps<"a">(
|
|
82
|
+
{
|
|
83
|
+
ref,
|
|
84
|
+
className: cn("transition-colors hover:text-foreground", className),
|
|
85
|
+
},
|
|
86
|
+
props,
|
|
87
|
+
),
|
|
88
|
+
render,
|
|
89
|
+
state: {
|
|
90
|
+
slot: "breadcrumb-link",
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
);
|
|
95
|
+
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
96
|
+
|
|
97
|
+
const BreadcrumbPage = React.forwardRef<
|
|
98
|
+
HTMLSpanElement,
|
|
99
|
+
React.ComponentProps<"span">
|
|
100
|
+
>(({ className, ...props }, ref) => {
|
|
101
|
+
return (
|
|
102
|
+
<span
|
|
103
|
+
ref={ref}
|
|
104
|
+
data-slot="breadcrumb-page"
|
|
105
|
+
role="link"
|
|
106
|
+
aria-disabled="true"
|
|
107
|
+
aria-current="page"
|
|
108
|
+
className={cn("font-normal text-foreground", className)}
|
|
109
|
+
{...props}
|
|
110
|
+
/>
|
|
111
|
+
);
|
|
112
|
+
});
|
|
113
|
+
BreadcrumbPage.displayName = "BreadcrumbPage";
|
|
114
|
+
|
|
115
|
+
const BreadcrumbSeparator = React.forwardRef<
|
|
116
|
+
HTMLLIElement,
|
|
117
|
+
React.ComponentProps<"li">
|
|
118
|
+
>(({ children, className, ...props }, ref) => {
|
|
119
|
+
return (
|
|
120
|
+
<li
|
|
121
|
+
ref={ref}
|
|
122
|
+
data-slot="breadcrumb-separator"
|
|
123
|
+
role="presentation"
|
|
124
|
+
aria-hidden="true"
|
|
125
|
+
className={cn(className)}
|
|
126
|
+
{...props}
|
|
127
|
+
>
|
|
128
|
+
{children ?? <ChevronRightIcon className="size-3.5" />}
|
|
129
|
+
</li>
|
|
130
|
+
);
|
|
131
|
+
});
|
|
132
|
+
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
133
|
+
|
|
134
|
+
const BreadcrumbEllipsis = React.forwardRef<
|
|
135
|
+
HTMLSpanElement,
|
|
136
|
+
React.ComponentProps<"span">
|
|
137
|
+
>(({ className, ...props }, ref) => {
|
|
138
|
+
return (
|
|
139
|
+
<span
|
|
140
|
+
ref={ref}
|
|
141
|
+
data-slot="breadcrumb-ellipsis"
|
|
142
|
+
role="presentation"
|
|
143
|
+
aria-hidden="true"
|
|
144
|
+
className={cn("flex size-5 items-center justify-center", className)}
|
|
145
|
+
{...props}
|
|
146
|
+
>
|
|
147
|
+
<MoreHorizontalIcon className="size-4" />
|
|
148
|
+
<span className="sr-only">More</span>
|
|
149
|
+
</span>
|
|
150
|
+
);
|
|
151
|
+
});
|
|
152
|
+
BreadcrumbEllipsis.displayName = "BreadcrumbEllipsis";
|
|
153
|
+
|
|
154
|
+
export {
|
|
155
|
+
Breadcrumb,
|
|
156
|
+
BreadcrumbEllipsis,
|
|
157
|
+
BreadcrumbItem,
|
|
158
|
+
BreadcrumbLink,
|
|
159
|
+
BreadcrumbList,
|
|
160
|
+
BreadcrumbPage,
|
|
161
|
+
BreadcrumbSeparator,
|
|
162
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { render, screen } from "@testing-library/react";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import { Button } from "./button";
|
|
4
|
+
|
|
5
|
+
describe("Button", () => {
|
|
6
|
+
it("renders correctly with default props", () => {
|
|
7
|
+
render(<Button>Click me</Button>);
|
|
8
|
+
const button = screen.getByRole("button", { name: "Click me" });
|
|
9
|
+
expect(button).toBeInTheDocument();
|
|
10
|
+
// Default variant is "solid" and color is "primary"
|
|
11
|
+
expect(button).toHaveAttribute("data-variant", "solid");
|
|
12
|
+
expect(button).toHaveAttribute("data-color", "primary");
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it("applies custom variants and colors", () => {
|
|
16
|
+
render(
|
|
17
|
+
<Button variant="outline" color="destructive">
|
|
18
|
+
Delete
|
|
19
|
+
</Button>,
|
|
20
|
+
);
|
|
21
|
+
const button = screen.getByRole("button", { name: "Delete" });
|
|
22
|
+
expect(button).toHaveAttribute("data-variant", "outline");
|
|
23
|
+
expect(button).toHaveAttribute("data-color", "destructive");
|
|
24
|
+
});
|
|
25
|
+
});
|