fulldev-ui 0.7.0-beta.9 → 0.9.0
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/CHANGELOG.md +140 -2
- package/README.md +18 -16
- package/package.json +96 -77
- package/public/r/accordion.json +38 -0
- package/public/r/alert-dialog.json +78 -0
- package/public/r/alert.json +32 -0
- package/public/r/article-1.json +17 -0
- package/public/r/article-2.json +17 -0
- package/public/r/articles-1.json +17 -0
- package/public/r/articles-2.json +17 -0
- package/public/r/articles-3.json +17 -0
- package/public/r/articles-4.json +17 -0
- package/public/r/avatar.json +42 -0
- package/public/r/badge.json +22 -0
- package/public/r/banner-1.json +16 -0
- package/public/r/banner-2.json +16 -0
- package/public/r/banner.json +27 -0
- package/public/r/beta-repo-setup.json +131 -0
- package/public/r/blocks-1.json +19 -0
- package/public/r/blocks.json +89 -0
- package/public/r/breadcrumb.json +50 -0
- package/public/r/button.json +22 -0
- package/public/r/card.json +47 -0
- package/public/r/carousel.json +44 -0
- package/public/r/checkbox.json +17 -0
- package/public/r/collapsible.json +30 -0
- package/public/r/combobox.json +74 -0
- package/public/r/command.json +64 -0
- package/public/r/components.json +54 -0
- package/public/r/contact-1.json +20 -0
- package/public/r/contact-2.json +20 -0
- package/public/r/contact-3.json +20 -0
- package/public/r/content-1.json +17 -0
- package/public/r/content-2.json +17 -0
- package/public/r/content-3.json +16 -0
- package/public/r/content-4.json +17 -0
- package/public/r/content-5.json +17 -0
- package/public/r/content-6.json +17 -0
- package/public/r/cta-1.json +18 -0
- package/public/r/cta-2.json +18 -0
- package/public/r/cta-3.json +18 -0
- package/public/r/cta-4.json +18 -0
- package/public/r/cta-5.json +17 -0
- package/public/r/cta-6.json +18 -0
- package/public/r/cta-7.json +17 -0
- package/public/r/cta-8.json +16 -0
- package/public/r/dialog.json +69 -0
- package/public/r/doc-1.json +21 -0
- package/public/r/dropdown-menu.json +73 -0
- package/public/r/empty.json +42 -0
- package/public/r/faqs-1.json +17 -0
- package/public/r/faqs-2.json +17 -0
- package/public/r/faqs-3.json +17 -0
- package/public/r/faqs-4.json +16 -0
- package/public/r/features-1.json +17 -0
- package/public/r/features-2.json +17 -0
- package/public/r/features-3.json +15 -0
- package/public/r/features-4.json +17 -0
- package/public/r/features-5.json +17 -0
- package/public/r/features-6.json +17 -0
- package/public/r/field.json +66 -0
- package/public/r/footer-1.json +18 -0
- package/public/r/footer-2.json +18 -0
- package/public/r/footer-3.json +18 -0
- package/public/r/form.json +17 -0
- package/public/r/header-1.json +20 -0
- package/public/r/header-2.json +20 -0
- package/public/r/header-3.json +21 -0
- package/public/r/header-4.json +20 -0
- package/public/r/header-5.json +21 -0
- package/public/r/header.json +31 -0
- package/public/r/hero-1.json +17 -0
- package/public/r/hero-10.json +18 -0
- package/public/r/hero-11.json +18 -0
- package/public/r/hero-12.json +16 -0
- package/public/r/hero-13.json +16 -0
- package/public/r/hero-2.json +18 -0
- package/public/r/hero-3.json +16 -0
- package/public/r/hero-4.json +17 -0
- package/public/r/hero-5.json +19 -0
- package/public/r/hero-6.json +19 -0
- package/public/r/hero-7.json +19 -0
- package/public/r/hero-8.json +16 -0
- package/public/r/hero-9.json +19 -0
- package/public/r/hover-card.json +30 -0
- package/public/r/icon.json +21 -0
- package/public/r/init.json +23 -0
- package/public/r/input-group.json +48 -0
- package/public/r/input.json +17 -0
- package/public/r/item.json +65 -0
- package/public/r/kbd.json +22 -0
- package/public/r/label.json +17 -0
- package/public/r/layout.json +35 -0
- package/public/r/links-2.json +21 -0
- package/public/r/logo.json +27 -0
- package/public/r/logos-1.json +16 -0
- package/public/r/logos-2.json +17 -0
- package/public/r/logos-3.json +16 -0
- package/public/r/marquee.json +17 -0
- package/public/r/native-select.json +30 -0
- package/public/r/navigation-menu.json +63 -0
- package/public/r/popover.json +45 -0
- package/public/r/price.json +32 -0
- package/public/r/pricing-1.json +21 -0
- package/public/r/pricing-2.json +20 -0
- package/public/r/pricing-3.json +21 -0
- package/public/r/product-1.json +18 -0
- package/public/r/products-1.json +18 -0
- package/public/r/products-2.json +18 -0
- package/public/r/products-3.json +18 -0
- package/public/r/products-4.json +18 -0
- package/public/r/products-5.json +19 -0
- package/public/r/radio-group.json +25 -0
- package/public/r/rating.json +20 -0
- package/public/r/registry.json +3254 -0
- package/public/r/reviews-1.json +19 -0
- package/public/r/reviews-2.json +19 -0
- package/public/r/reviews-3.json +19 -0
- package/public/r/reviews-4.json +19 -0
- package/public/r/reviews-5.json +19 -0
- package/public/r/section.json +22 -0
- package/public/r/select.json +58 -0
- package/public/r/separator.json +17 -0
- package/public/r/services-1.json +18 -0
- package/public/r/services-2.json +17 -0
- package/public/r/services-3.json +17 -0
- package/public/r/services-4.json +17 -0
- package/public/r/services-5.json +18 -0
- package/public/r/services-6.json +18 -0
- package/public/r/services-7.json +18 -0
- package/public/r/sheet.json +57 -0
- package/public/r/sidebar-1.json +28 -0
- package/public/r/sidebar.json +137 -0
- package/public/r/skeleton.json +17 -0
- package/public/r/slider.json +20 -0
- package/public/r/spinner.json +20 -0
- package/public/r/switch.json +20 -0
- package/public/r/table.json +52 -0
- package/public/r/tabs.json +40 -0
- package/public/r/textarea.json +17 -0
- package/public/r/theme-toggle.json +26 -0
- package/public/r/tile.json +27 -0
- package/public/r/toc.json +37 -0
- package/public/r/toggle.json +25 -0
- package/public/r/tooltip.json +30 -0
- package/public/r/typography.json +92 -0
- package/public/r/video.json +17 -0
- package/registry.json +3254 -0
- package/src/components/blocks/article-1.astro +83 -0
- package/src/components/blocks/article-2.astro +83 -0
- package/src/components/blocks/articles-1.astro +101 -0
- package/src/components/blocks/articles-2.astro +158 -0
- package/src/components/blocks/articles-3.astro +99 -0
- package/src/components/blocks/articles-4.astro +86 -0
- package/src/components/blocks/banner-1.astro +44 -0
- package/src/components/blocks/banner-2.astro +46 -0
- package/src/components/blocks/blocks-1.astro +262 -0
- package/src/components/blocks/contact-1.astro +126 -0
- package/src/components/blocks/contact-2.astro +130 -0
- package/src/components/blocks/contact-3.astro +144 -0
- package/src/components/blocks/content-1.astro +89 -0
- package/src/components/blocks/content-2.astro +89 -0
- package/src/components/blocks/content-3.astro +74 -0
- package/src/components/blocks/content-4.astro +91 -0
- package/src/components/blocks/content-5.astro +115 -0
- package/src/components/blocks/content-6.astro +91 -0
- package/src/components/blocks/cta-1.astro +99 -0
- package/src/components/blocks/cta-2.astro +114 -0
- package/src/components/blocks/cta-3.astro +103 -0
- package/src/components/blocks/cta-4.astro +113 -0
- package/src/components/blocks/cta-5.astro +89 -0
- package/src/components/blocks/cta-6.astro +114 -0
- package/src/components/blocks/cta-7.astro +102 -0
- package/src/components/blocks/cta-8.astro +55 -0
- package/src/components/blocks/doc-1.astro +364 -0
- package/src/components/blocks/faqs-1.astro +77 -0
- package/src/components/blocks/faqs-2.astro +82 -0
- package/src/components/blocks/faqs-3.astro +55 -0
- package/src/components/blocks/faqs-4.astro +46 -0
- package/src/components/blocks/features-1.astro +89 -0
- package/src/components/blocks/features-2.astro +76 -0
- package/src/components/blocks/features-3.astro +65 -0
- package/src/components/blocks/features-4.astro +91 -0
- package/src/components/blocks/features-5.astro +76 -0
- package/src/components/blocks/features-6.astro +75 -0
- package/src/components/blocks/footer-1.astro +94 -0
- package/src/components/blocks/footer-2.astro +80 -0
- package/src/components/blocks/footer-3.astro +117 -0
- package/src/components/blocks/header-1.astro +127 -0
- package/src/components/blocks/header-2.astro +129 -0
- package/src/components/blocks/header-3.astro +133 -0
- package/src/components/blocks/header-4.astro +219 -0
- package/src/components/blocks/header-5.astro +223 -0
- package/src/components/blocks/hero-1.astro +84 -0
- package/src/components/blocks/hero-10.astro +116 -0
- package/src/components/blocks/hero-11.astro +111 -0
- package/src/components/blocks/hero-12.astro +70 -0
- package/src/components/blocks/hero-13.astro +66 -0
- package/src/components/blocks/hero-2.astro +107 -0
- package/src/components/blocks/hero-3.astro +67 -0
- package/src/components/blocks/hero-4.astro +86 -0
- package/src/components/blocks/hero-5.astro +122 -0
- package/src/components/blocks/hero-6.astro +122 -0
- package/src/components/blocks/hero-7.astro +124 -0
- package/src/components/blocks/hero-8.astro +69 -0
- package/src/components/blocks/hero-9.astro +126 -0
- package/src/components/blocks/links-2.astro +56 -0
- package/src/components/blocks/logos-1.astro +50 -0
- package/src/components/blocks/logos-2.astro +55 -0
- package/src/components/blocks/logos-3.astro +34 -0
- package/src/components/blocks/pricing-1.astro +106 -0
- package/src/components/blocks/pricing-2.astro +100 -0
- package/src/components/blocks/pricing-3.astro +92 -0
- package/src/components/blocks/product-1.astro +76 -0
- package/src/components/blocks/products-1.astro +76 -0
- package/src/components/blocks/products-2.astro +61 -0
- package/src/components/blocks/products-3.astro +63 -0
- package/src/components/blocks/products-4.astro +96 -0
- package/src/components/blocks/products-5.astro +93 -0
- package/src/components/blocks/reviews-1.astro +74 -0
- package/src/components/blocks/reviews-2.astro +81 -0
- package/src/components/blocks/reviews-3.astro +84 -0
- package/src/components/blocks/reviews-4.astro +111 -0
- package/src/components/blocks/reviews-5.astro +172 -0
- package/src/components/blocks/services-1.astro +104 -0
- package/src/components/blocks/services-2.astro +110 -0
- package/src/components/blocks/services-3.astro +105 -0
- package/src/components/blocks/services-4.astro +98 -0
- package/src/components/blocks/services-5.astro +96 -0
- package/src/components/blocks/services-6.astro +103 -0
- package/src/components/blocks/services-7.astro +131 -0
- package/src/components/blocks/sidebar-1.astro +385 -0
- package/src/components/ui/accordion/accordion-content.astro +25 -0
- package/src/components/ui/accordion/accordion-item.astro +22 -0
- package/src/components/ui/accordion/accordion-trigger.astro +34 -0
- package/src/components/ui/accordion/accordion.astro +52 -0
- package/src/components/ui/accordion/index.ts +4 -4
- package/src/components/ui/alert/alert-action.astro +17 -0
- package/src/components/ui/alert/alert-description.astro +20 -0
- package/src/components/ui/alert/alert-title.astro +20 -0
- package/src/components/ui/alert/alert.astro +35 -0
- package/src/components/ui/alert/index.ts +4 -0
- package/src/components/ui/alert-dialog/alert-dialog-action.astro +13 -0
- package/src/components/ui/alert-dialog/alert-dialog-cancel.astro +13 -0
- package/src/components/ui/alert-dialog/alert-dialog-content.astro +30 -0
- package/src/components/ui/alert-dialog/alert-dialog-description.astro +20 -0
- package/src/components/ui/alert-dialog/alert-dialog-footer.astro +20 -0
- package/src/components/ui/alert-dialog/alert-dialog-header.astro +20 -0
- package/src/components/ui/alert-dialog/alert-dialog-media.astro +20 -0
- package/src/components/ui/alert-dialog/alert-dialog-overlay.astro +21 -0
- package/src/components/ui/alert-dialog/alert-dialog-portal.astro +13 -0
- package/src/components/ui/alert-dialog/alert-dialog-title.astro +20 -0
- package/src/components/ui/alert-dialog/alert-dialog-trigger.astro +13 -0
- package/src/components/ui/alert-dialog/alert-dialog.astro +17 -0
- package/src/components/ui/alert-dialog/index.ts +12 -0
- package/src/components/ui/avatar/avatar-badge.astro +23 -0
- package/src/components/ui/avatar/avatar-fallback.astro +20 -0
- package/src/components/ui/avatar/avatar-group-count.astro +20 -0
- package/src/components/ui/avatar/avatar-group.astro +20 -0
- package/src/components/ui/avatar/avatar-image.astro +36 -0
- package/src/components/ui/avatar/avatar.astro +23 -0
- package/src/components/ui/avatar/index.ts +6 -24
- package/src/components/ui/badge/badge-variants.ts +26 -0
- package/src/components/ui/badge/badge.astro +24 -0
- package/src/components/ui/badge/index.ts +2 -21
- package/src/components/ui/banner/banner-container.astro +36 -0
- package/src/components/ui/banner/banner.astro +85 -0
- package/src/components/ui/banner/index.ts +2 -0
- package/src/components/ui/breadcrumb/breadcrumb-ellipsis.astro +24 -0
- package/src/components/ui/breadcrumb/breadcrumb-item.astro +17 -0
- package/src/components/ui/breadcrumb/breadcrumb-link.astro +17 -0
- package/src/components/ui/breadcrumb/breadcrumb-list.astro +20 -0
- package/src/components/ui/breadcrumb/breadcrumb-page.astro +20 -0
- package/src/components/ui/breadcrumb/breadcrumb-separator.astro +20 -0
- package/src/components/ui/breadcrumb/breadcrumb.astro +18 -0
- package/src/components/ui/breadcrumb/index.ts +7 -0
- package/src/components/ui/button/button-variants.ts +39 -0
- package/src/components/ui/button/button.astro +26 -0
- package/src/components/ui/button/index.ts +2 -30
- package/src/components/ui/card/card-action.astro +20 -0
- package/src/components/ui/card/card-content.astro +17 -0
- package/src/components/ui/card/card-description.astro +17 -0
- package/src/components/ui/card/card-footer.astro +20 -0
- package/src/components/ui/card/card-header.astro +20 -0
- package/src/components/ui/card/card-title.astro +20 -0
- package/src/components/ui/card/card.astro +23 -0
- package/src/components/ui/card/index.ts +7 -6
- package/src/components/ui/carousel/carousel-content.astro +24 -0
- package/src/components/ui/carousel/carousel-item.astro +24 -0
- package/src/components/ui/carousel/carousel-next.astro +36 -0
- package/src/components/ui/carousel/carousel-previous.astro +36 -0
- package/src/components/ui/carousel/carousel.astro +246 -0
- package/src/components/ui/carousel/index.ts +9 -8
- package/src/components/ui/checkbox/checkbox.astro +63 -0
- package/src/components/ui/checkbox/index.ts +1 -1
- package/src/components/ui/collapsible/collapsible-content.astro +13 -0
- package/src/components/ui/collapsible/collapsible-trigger.astro +18 -0
- package/src/components/ui/collapsible/collapsible.astro +33 -0
- package/src/components/ui/collapsible/index.ts +3 -3
- package/src/components/ui/combobox/combobox-content.astro +61 -0
- package/src/components/ui/combobox/combobox-empty.astro +21 -0
- package/src/components/ui/combobox/combobox-group.astro +13 -0
- package/src/components/ui/combobox/combobox-input.astro +57 -0
- package/src/components/ui/combobox/combobox-item.astro +44 -0
- package/src/components/ui/combobox/combobox-label.astro +17 -0
- package/src/components/ui/combobox/combobox-list.astro +20 -0
- package/src/components/ui/combobox/combobox-separator.astro +16 -0
- package/src/components/ui/combobox/combobox-trigger.astro +37 -0
- package/src/components/ui/combobox/combobox-value.astro +20 -0
- package/src/components/ui/combobox/combobox.astro +85 -0
- package/src/components/ui/combobox/index.ts +11 -0
- package/src/components/ui/command/command-dialog.astro +54 -0
- package/src/components/ui/command/command-empty.astro +18 -0
- package/src/components/ui/command/command-group.astro +27 -0
- package/src/components/ui/command/command-input.astro +31 -0
- package/src/components/ui/command/command-item.astro +50 -0
- package/src/components/ui/command/command-list.astro +20 -0
- package/src/components/ui/command/command-separator.astro +16 -0
- package/src/components/ui/command/command-shortcut.astro +20 -0
- package/src/components/ui/command/command.astro +76 -0
- package/src/components/ui/command/index.ts +9 -9
- package/src/components/ui/dialog/dialog-close.astro +17 -0
- package/src/components/ui/dialog/dialog-content.astro +50 -0
- package/src/components/ui/dialog/dialog-description.astro +20 -0
- package/src/components/ui/dialog/dialog-footer.astro +24 -0
- package/src/components/ui/dialog/dialog-header.astro +17 -0
- package/src/components/ui/dialog/dialog-overlay.astro +22 -0
- package/src/components/ui/dialog/dialog-portal.astro +13 -0
- package/src/components/ui/dialog/dialog-title.astro +17 -0
- package/src/components/ui/dialog/dialog-trigger.astro +13 -0
- package/src/components/ui/dialog/dialog.astro +17 -0
- package/src/components/ui/dialog/index.ts +10 -9
- package/src/components/ui/dropdown-menu/dropdown-menu-checkbox-item.astro +52 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-content.astro +58 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-group.astro +13 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-item.astro +36 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-label.astro +23 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-portal.astro +11 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-radio-item.astro +52 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-separator.astro +16 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-shortcut.astro +20 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-trigger.astro +16 -0
- package/src/components/ui/dropdown-menu/dropdown-menu.astro +68 -0
- package/src/components/ui/dropdown-menu/index.ts +11 -0
- package/src/components/ui/empty/empty-content.astro +20 -0
- package/src/components/ui/empty/empty-description.astro +20 -0
- package/src/components/ui/empty/empty-header.astro +17 -0
- package/src/components/ui/empty/empty-media.astro +34 -0
- package/src/components/ui/empty/empty-title.astro +17 -0
- package/src/components/ui/empty/empty.astro +20 -0
- package/src/components/ui/empty/index.ts +6 -0
- package/src/components/ui/field/field-content.astro +20 -0
- package/src/components/ui/field/field-description.astro +22 -0
- package/src/components/ui/field/field-error.astro +45 -0
- package/src/components/ui/field/field-group.astro +20 -0
- package/src/components/ui/field/field-label.astro +22 -0
- package/src/components/ui/field/field-legend.astro +23 -0
- package/src/components/ui/field/field-separator.astro +33 -0
- package/src/components/ui/field/field-set.astro +20 -0
- package/src/components/ui/field/field-title.astro +20 -0
- package/src/components/ui/field/field.astro +39 -0
- package/src/components/ui/field/index.ts +10 -0
- package/src/components/ui/form/form.astro +13 -0
- package/src/components/ui/form/index.ts +1 -7
- package/src/components/ui/header/header-container.astro +17 -0
- package/src/components/ui/header/header-group.astro +17 -0
- package/src/components/ui/header/header.astro +32 -0
- package/src/components/ui/header/index.ts +3 -0
- package/src/components/ui/hover-card/hover-card-content.astro +51 -0
- package/src/components/ui/hover-card/hover-card-trigger.astro +26 -0
- package/src/components/ui/hover-card/hover-card.astro +69 -0
- package/src/components/ui/hover-card/index.ts +3 -0
- package/src/components/ui/icon/icon.astro +90 -0
- package/src/components/ui/icon/index.ts +1 -0
- package/src/components/ui/input/index.ts +1 -1
- package/src/components/ui/input/input.astro +22 -0
- package/src/components/ui/input-group/index.ts +6 -0
- package/src/components/ui/input-group/input-group-addon.astro +41 -0
- package/src/components/ui/input-group/input-group-button.astro +49 -0
- package/src/components/ui/input-group/input-group-input.astro +23 -0
- package/src/components/ui/input-group/input-group-text.astro +20 -0
- package/src/components/ui/input-group/input-group-textarea.astro +19 -0
- package/src/components/ui/input-group/input-group.astro +51 -0
- package/src/components/ui/item/index.ts +10 -0
- package/src/components/ui/item/item-actions.astro +17 -0
- package/src/components/ui/item/item-content.astro +21 -0
- package/src/components/ui/item/item-description.astro +20 -0
- package/src/components/ui/item/item-footer.astro +17 -0
- package/src/components/ui/item/item-group.astro +21 -0
- package/src/components/ui/item/item-header.astro +17 -0
- package/src/components/ui/item/item-media.astro +36 -0
- package/src/components/ui/item/item-separator.astro +17 -0
- package/src/components/ui/item/item-title.astro +20 -0
- package/src/components/ui/item/item.astro +71 -0
- package/src/components/ui/kbd/index.ts +2 -0
- package/src/components/ui/kbd/kbd-group.astro +17 -0
- package/src/components/ui/kbd/kbd.astro +20 -0
- package/src/components/ui/label/index.ts +1 -1
- package/src/components/ui/label/label.astro +20 -0
- package/src/components/ui/layout/index.ts +4 -0
- package/src/components/ui/layout/layout-body.astro +26 -0
- package/src/components/ui/layout/layout-head.astro +100 -0
- package/src/components/ui/layout/layout-main.astro +20 -0
- package/src/components/ui/layout/layout.astro +34 -0
- package/src/components/ui/logo/index.ts +3 -0
- package/src/components/ui/logo/logo-image.astro +48 -0
- package/src/components/ui/logo/logo-text.astro +13 -0
- package/src/components/ui/logo/logo.astro +22 -0
- package/src/components/ui/marquee/index.ts +1 -0
- package/src/components/ui/marquee/marquee.astro +106 -0
- package/src/components/ui/native-select/index.ts +3 -0
- package/src/components/ui/native-select/native-select-optgroup.astro +17 -0
- package/src/components/ui/native-select/native-select-option.astro +17 -0
- package/src/components/ui/native-select/native-select.astro +36 -0
- package/src/components/ui/navigation-menu/index.ts +9 -14
- package/src/components/ui/navigation-menu/navigation-menu-content.astro +37 -0
- package/src/components/ui/navigation-menu/navigation-menu-indicator.astro +23 -0
- package/src/components/ui/navigation-menu/navigation-menu-item.astro +36 -0
- package/src/components/ui/navigation-menu/navigation-menu-link.astro +23 -0
- package/src/components/ui/navigation-menu/navigation-menu-list.astro +20 -0
- package/src/components/ui/navigation-menu/navigation-menu-positioner.astro +47 -0
- package/src/components/ui/navigation-menu/navigation-menu-trigger-style.ts +7 -0
- package/src/components/ui/navigation-menu/navigation-menu-trigger.astro +27 -0
- package/src/components/ui/navigation-menu/navigation-menu.astro +63 -0
- package/src/components/ui/popover/index.ts +6 -3
- package/src/components/ui/popover/popover-content.astro +62 -0
- package/src/components/ui/popover/popover-description.astro +17 -0
- package/src/components/ui/popover/popover-header.astro +17 -0
- package/src/components/ui/popover/popover-title.astro +13 -0
- package/src/components/ui/popover/popover-trigger.astro +11 -0
- package/src/components/ui/popover/popover.astro +59 -0
- package/src/components/ui/price/format-price-value.ts +91 -0
- package/src/components/ui/price/index.ts +3 -0
- package/src/components/ui/price/price-unit.astro +16 -0
- package/src/components/ui/price/price-value.astro +81 -0
- package/src/components/ui/price/price.astro +13 -0
- package/src/components/ui/radio-group/index.ts +2 -2
- package/src/components/ui/radio-group/radio-group-item.astro +43 -0
- package/src/components/ui/radio-group/radio-group.astro +42 -0
- package/src/components/ui/rating/index.ts +1 -0
- package/src/components/ui/rating/rating.astro +39 -0
- package/src/components/ui/section/index.ts +2 -0
- package/src/components/ui/section/section-container.astro +19 -0
- package/src/components/ui/section/section.astro +32 -0
- package/src/components/ui/select/index.ts +8 -11
- package/src/components/ui/select/select-content.astro +69 -0
- package/src/components/ui/select/select-group.astro +17 -0
- package/src/components/ui/select/select-item.astro +39 -0
- package/src/components/ui/select/select-label.astro +17 -0
- package/src/components/ui/select/select-separator.astro +16 -0
- package/src/components/ui/select/select-trigger.astro +40 -0
- package/src/components/ui/select/select-value.astro +17 -0
- package/src/components/ui/select/select.astro +76 -0
- package/src/components/ui/separator/index.ts +1 -1
- package/src/components/ui/separator/separator.astro +32 -0
- package/src/components/ui/sheet/index.ts +8 -0
- package/src/components/ui/sheet/sheet-close.astro +13 -0
- package/src/components/ui/sheet/sheet-content.astro +59 -0
- package/src/components/ui/sheet/sheet-description.astro +17 -0
- package/src/components/ui/sheet/sheet-footer.astro +17 -0
- package/src/components/ui/sheet/sheet-header.astro +17 -0
- package/src/components/ui/sheet/sheet-title.astro +17 -0
- package/src/components/ui/sheet/sheet-trigger.astro +13 -0
- package/src/components/ui/sheet/sheet.astro +125 -0
- package/src/components/ui/sidebar/index.ts +23 -0
- package/src/components/ui/sidebar/sidebar-content.astro +21 -0
- package/src/components/ui/sidebar/sidebar-footer.astro +18 -0
- package/src/components/ui/sidebar/sidebar-group-action.astro +31 -0
- package/src/components/ui/sidebar/sidebar-group-content.astro +18 -0
- package/src/components/ui/sidebar/sidebar-group-label.astro +26 -0
- package/src/components/ui/sidebar/sidebar-group.astro +18 -0
- package/src/components/ui/sidebar/sidebar-header.astro +18 -0
- package/src/components/ui/sidebar/sidebar-input.astro +19 -0
- package/src/components/ui/sidebar/sidebar-inset.astro +20 -0
- package/src/components/ui/sidebar/sidebar-menu-action.astro +40 -0
- package/src/components/ui/sidebar/sidebar-menu-badge.astro +21 -0
- package/src/components/ui/sidebar/sidebar-menu-button.astro +126 -0
- package/src/components/ui/sidebar/sidebar-menu-item.astro +18 -0
- package/src/components/ui/sidebar/sidebar-menu-skeleton.astro +31 -0
- package/src/components/ui/sidebar/sidebar-menu-sub-button.astro +55 -0
- package/src/components/ui/sidebar/sidebar-menu-sub-item.astro +18 -0
- package/src/components/ui/sidebar/sidebar-menu-sub.astro +21 -0
- package/src/components/ui/sidebar/sidebar-menu.astro +18 -0
- package/src/components/ui/sidebar/sidebar-provider.astro +180 -0
- package/src/components/ui/sidebar/sidebar-rail.astro +27 -0
- package/src/components/ui/sidebar/sidebar-separator.astro +17 -0
- package/src/components/ui/sidebar/sidebar-trigger.astro +26 -0
- package/src/components/ui/sidebar/sidebar.astro +118 -0
- package/src/components/ui/skeleton/index.ts +1 -0
- package/src/components/ui/skeleton/skeleton.astro +16 -0
- package/src/components/ui/slider/index.ts +1 -0
- package/src/components/ui/slider/slider.astro +84 -0
- package/src/components/ui/spinner/index.ts +1 -0
- package/src/components/ui/spinner/spinner.astro +24 -0
- package/src/components/ui/switch/index.ts +1 -1
- package/src/components/ui/switch/switch.astro +71 -0
- package/src/components/ui/table/index.ts +8 -0
- package/src/components/ui/table/table-body.astro +17 -0
- package/src/components/ui/table/table-caption.astro +17 -0
- package/src/components/ui/table/table-cell.astro +20 -0
- package/src/components/ui/table/table-footer.astro +20 -0
- package/src/components/ui/table/table-head.astro +20 -0
- package/src/components/ui/table/table-header.astro +17 -0
- package/src/components/ui/table/table-row.astro +20 -0
- package/src/components/ui/table/table.astro +19 -0
- package/src/components/ui/tabs/index.ts +8 -0
- package/src/components/ui/tabs/tabs-content.astro +20 -0
- package/src/components/ui/tabs/tabs-list-variants.ts +18 -0
- package/src/components/ui/tabs/tabs-list.astro +30 -0
- package/src/components/ui/tabs/tabs-trigger.astro +26 -0
- package/src/components/ui/tabs/tabs.astro +38 -0
- package/src/components/ui/textarea/index.ts +1 -1
- package/src/components/ui/textarea/textarea.astro +23 -0
- package/src/components/ui/theme-toggle/index.ts +2 -0
- package/src/components/ui/theme-toggle/theme-provider.astro +61 -0
- package/src/components/ui/theme-toggle/theme-toggle.astro +84 -0
- package/src/components/ui/tile/index.ts +3 -0
- package/src/components/ui/tile/tile-content.astro +17 -0
- package/src/components/ui/tile/tile-group.astro +76 -0
- package/src/components/ui/tile/tile.astro +46 -0
- package/src/components/ui/toc/index.ts +5 -0
- package/src/components/ui/toc/toc-menu-item.astro +13 -0
- package/src/components/ui/toc/toc-menu-link.astro +37 -0
- package/src/components/ui/toc/toc-menu.astro +17 -0
- package/src/components/ui/toc/toc-title.astro +21 -0
- package/src/components/ui/toc/toc.astro +13 -0
- package/src/components/ui/toggle/index.ts +3 -0
- package/src/components/ui/toggle/toggle-variants.ts +25 -0
- package/src/components/ui/toggle/toggle.astro +40 -0
- package/src/components/ui/tooltip/index.ts +3 -0
- package/src/components/ui/tooltip/tooltip-content.astro +64 -0
- package/src/components/ui/tooltip/tooltip-trigger.astro +26 -0
- package/src/components/ui/tooltip/tooltip.astro +55 -0
- package/src/components/ui/typography/index.ts +16 -0
- package/src/components/ui/typography/typography-a.astro +22 -0
- package/src/components/ui/typography/typography-blockquote.astro +23 -0
- package/src/components/ui/typography/typography-h1.astro +43 -0
- package/src/components/ui/typography/typography-h2.astro +43 -0
- package/src/components/ui/typography/typography-h3.astro +43 -0
- package/src/components/ui/typography/typography-h4.astro +43 -0
- package/src/components/ui/typography/typography-inline-code.astro +31 -0
- package/src/components/ui/typography/typography-lead.astro +21 -0
- package/src/components/ui/typography/typography-list-item.astro +28 -0
- package/src/components/ui/typography/typography-list.astro +45 -0
- package/src/components/ui/typography/typography-p.astro +23 -0
- package/src/components/ui/typography/typography-table-cell.astro +41 -0
- package/src/components/ui/typography/typography-table-head.astro +41 -0
- package/src/components/ui/typography/typography-table-row.astro +33 -0
- package/src/components/ui/typography/typography-table.astro +50 -0
- package/src/components/ui/typography/typography.astro +180 -0
- package/src/components/ui/video/index.ts +1 -0
- package/src/components/ui/video/video.astro +73 -0
- package/src/lib/integration.ts +53 -14
- package/src/lib/pages.ts +85 -0
- package/src/lib/utils.ts +2 -2
- package/src/styles/global.css +179 -113
- package/cli.js +0 -51
- package/components.json +0 -18
- package/src/blocks/CategoryGroup1.astro +0 -43
- package/src/blocks/CategoryList1.astro +0 -55
- package/src/blocks/Contact1.astro +0 -45
- package/src/blocks/Contact2.astro +0 -45
- package/src/blocks/Content1.astro +0 -29
- package/src/blocks/Cta1.astro +0 -30
- package/src/blocks/Faqs1.astro +0 -29
- package/src/blocks/Faqs2.astro +0 -29
- package/src/blocks/Features1.astro +0 -36
- package/src/blocks/Footer.astro +0 -59
- package/src/blocks/Header.astro +0 -87
- package/src/blocks/Hero1.astro +0 -38
- package/src/blocks/Intro1.astro +0 -25
- package/src/blocks/PostSingle1.astro +0 -29
- package/src/blocks/ProductGroup1.astro +0 -82
- package/src/blocks/ProductList1.astro +0 -60
- package/src/blocks/ProductSingle1.astro +0 -64
- package/src/blocks/Reviews1.astro +0 -37
- package/src/components/Abstract.astro +0 -36
- package/src/components/Accordion.vue +0 -31
- package/src/components/Avatar.astro +0 -31
- package/src/components/Badge.astro +0 -21
- package/src/components/Block.astro +0 -40
- package/src/components/Box.astro +0 -28
- package/src/components/Button.astro +0 -54
- package/src/components/Buttons.astro +0 -50
- package/src/components/Card.astro +0 -20
- package/src/components/Carousel.vue +0 -38
- package/src/components/Chip.astro +0 -27
- package/src/components/Code.astro +0 -72
- package/src/components/Container.astro +0 -25
- package/src/components/Drawer.vue +0 -53
- package/src/components/Form.vue +0 -79
- package/src/components/Gallery.vue +0 -85
- package/src/components/Grid.astro +0 -35
- package/src/components/Icon.astro +0 -24
- package/src/components/Image.astro +0 -26
- package/src/components/Layout.astro +0 -116
- package/src/components/Link.astro +0 -22
- package/src/components/List.astro +0 -32
- package/src/components/Logo.astro +0 -30
- package/src/components/Masonry.astro +0 -35
- package/src/components/Menu.astro +0 -48
- package/src/components/Menus.astro +0 -25
- package/src/components/Navigation.vue +0 -93
- package/src/components/Panel.astro +0 -18
- package/src/components/Person.astro +0 -43
- package/src/components/Price.astro +0 -46
- package/src/components/Proof.astro +0 -31
- package/src/components/Props.astro +0 -21
- package/src/components/Prose.astro +0 -28
- package/src/components/Rating.astro +0 -36
- package/src/components/Search.vue +0 -65
- package/src/components/Section.astro +0 -18
- package/src/components/Select.vue +0 -41
- package/src/components/Separator.astro +0 -0
- package/src/components/Sidebar.astro +0 -50
- package/src/components/Social.astro +0 -32
- package/src/components/Socials.astro +0 -27
- package/src/components/Sort.vue +0 -46
- package/src/components/Split.astro +0 -27
- package/src/components/Table.astro +0 -103
- package/src/components/Themer.astro +0 -85
- package/src/components/Toc.astro +0 -65
- package/src/components/Writeup.astro +0 -37
- package/src/components/ui/accordion/Accordion.vue +0 -19
- package/src/components/ui/accordion/AccordionContent.vue +0 -24
- package/src/components/ui/accordion/AccordionItem.vue +0 -24
- package/src/components/ui/accordion/AccordionTrigger.vue +0 -33
- package/src/components/ui/auto-form/AutoForm.vue +0 -115
- package/src/components/ui/auto-form/AutoFormField.vue +0 -45
- package/src/components/ui/auto-form/AutoFormFieldArray.vue +0 -127
- package/src/components/ui/auto-form/AutoFormFieldBoolean.vue +0 -47
- package/src/components/ui/auto-form/AutoFormFieldDate.vue +0 -78
- package/src/components/ui/auto-form/AutoFormFieldEnum.vue +0 -77
- package/src/components/ui/auto-form/AutoFormFieldFile.vue +0 -87
- package/src/components/ui/auto-form/AutoFormFieldInput.vue +0 -42
- package/src/components/ui/auto-form/AutoFormFieldNumber.vue +0 -42
- package/src/components/ui/auto-form/AutoFormFieldObject.vue +0 -90
- package/src/components/ui/auto-form/AutoFormLabel.vue +0 -19
- package/src/components/ui/auto-form/constant.ts +0 -40
- package/src/components/ui/auto-form/dependencies.ts +0 -92
- package/src/components/ui/auto-form/index.ts +0 -15
- package/src/components/ui/auto-form/interface.ts +0 -95
- package/src/components/ui/auto-form/utils.ts +0 -188
- package/src/components/ui/avatar/Avatar.vue +0 -24
- package/src/components/ui/avatar/AvatarFallback.vue +0 -11
- package/src/components/ui/avatar/AvatarImage.vue +0 -9
- package/src/components/ui/badge/Badge.vue +0 -16
- package/src/components/ui/button/Button.vue +0 -26
- package/src/components/ui/calendar/Calendar.vue +0 -80
- package/src/components/ui/calendar/CalendarCell.vue +0 -29
- package/src/components/ui/calendar/CalendarCellTrigger.vue +0 -40
- package/src/components/ui/calendar/CalendarGrid.vue +0 -24
- package/src/components/ui/calendar/CalendarGridBody.vue +0 -11
- package/src/components/ui/calendar/CalendarGridHead.vue +0 -11
- package/src/components/ui/calendar/CalendarGridRow.vue +0 -24
- package/src/components/ui/calendar/CalendarHeadCell.vue +0 -24
- package/src/components/ui/calendar/CalendarHeader.vue +0 -24
- package/src/components/ui/calendar/CalendarHeading.vue +0 -27
- package/src/components/ui/calendar/CalendarNextButton.vue +0 -30
- package/src/components/ui/calendar/CalendarPrevButton.vue +0 -30
- package/src/components/ui/calendar/index.ts +0 -12
- package/src/components/ui/card/Card.vue +0 -14
- package/src/components/ui/card/CardContent.vue +0 -14
- package/src/components/ui/card/CardDescription.vue +0 -14
- package/src/components/ui/card/CardFooter.vue +0 -14
- package/src/components/ui/card/CardHeader.vue +0 -14
- package/src/components/ui/card/CardTitle.vue +0 -14
- package/src/components/ui/carousel/Carousel.vue +0 -61
- package/src/components/ui/carousel/CarouselContent.vue +0 -27
- package/src/components/ui/carousel/CarouselItem.vue +0 -19
- package/src/components/ui/carousel/CarouselNext.vue +0 -33
- package/src/components/ui/carousel/CarouselPrevious.vue +0 -33
- package/src/components/ui/carousel/interface.ts +0 -26
- package/src/components/ui/carousel/useCarousel.ts +0 -56
- package/src/components/ui/checkbox/Checkbox.vue +0 -36
- package/src/components/ui/collapsible/Collapsible.vue +0 -15
- package/src/components/ui/collapsible/CollapsibleContent.vue +0 -11
- package/src/components/ui/collapsible/CollapsibleTrigger.vue +0 -11
- package/src/components/ui/command/Command.vue +0 -32
- package/src/components/ui/command/CommandDialog.vue +0 -23
- package/src/components/ui/command/CommandEmpty.vue +0 -23
- package/src/components/ui/command/CommandGroup.vue +0 -39
- package/src/components/ui/command/CommandInput.vue +0 -43
- package/src/components/ui/command/CommandItem.vue +0 -31
- package/src/components/ui/command/CommandList.vue +0 -30
- package/src/components/ui/command/CommandSeparator.vue +0 -23
- package/src/components/ui/command/CommandShortcut.vue +0 -14
- package/src/components/ui/dialog/Dialog.vue +0 -14
- package/src/components/ui/dialog/DialogClose.vue +0 -11
- package/src/components/ui/dialog/DialogContent.vue +0 -51
- package/src/components/ui/dialog/DialogDescription.vue +0 -24
- package/src/components/ui/dialog/DialogFooter.vue +0 -12
- package/src/components/ui/dialog/DialogHeader.vue +0 -14
- package/src/components/ui/dialog/DialogScrollContent.vue +0 -59
- package/src/components/ui/dialog/DialogTitle.vue +0 -24
- package/src/components/ui/dialog/DialogTrigger.vue +0 -11
- package/src/components/ui/drawer/Drawer.vue +0 -19
- package/src/components/ui/drawer/DrawerContent.vue +0 -31
- package/src/components/ui/drawer/DrawerDescription.vue +0 -23
- package/src/components/ui/drawer/DrawerFooter.vue +0 -14
- package/src/components/ui/drawer/DrawerHeader.vue +0 -14
- package/src/components/ui/drawer/DrawerOverlay.vue +0 -21
- package/src/components/ui/drawer/DrawerTitle.vue +0 -23
- package/src/components/ui/drawer/index.ts +0 -8
- package/src/components/ui/form/FormControl.vue +0 -16
- package/src/components/ui/form/FormDescription.vue +0 -20
- package/src/components/ui/form/FormItem.vue +0 -19
- package/src/components/ui/form/FormLabel.vue +0 -20
- package/src/components/ui/form/FormMessage.vue +0 -16
- package/src/components/ui/form/injectionKeys.ts +0 -4
- package/src/components/ui/form/useFormField.ts +0 -30
- package/src/components/ui/input/Input.vue +0 -32
- package/src/components/ui/label/Label.vue +0 -24
- package/src/components/ui/navigation-menu/NavigationMenu.vue +0 -33
- package/src/components/ui/navigation-menu/NavigationMenuContent.vue +0 -36
- package/src/components/ui/navigation-menu/NavigationMenuIndicator.vue +0 -29
- package/src/components/ui/navigation-menu/NavigationMenuItem.vue +0 -11
- package/src/components/ui/navigation-menu/NavigationMenuLink.vue +0 -19
- package/src/components/ui/navigation-menu/NavigationMenuList.vue +0 -24
- package/src/components/ui/navigation-menu/NavigationMenuTrigger.vue +0 -30
- package/src/components/ui/navigation-menu/NavigationMenuViewport.vue +0 -29
- package/src/components/ui/popover/Popover.vue +0 -15
- package/src/components/ui/popover/PopoverContent.vue +0 -45
- package/src/components/ui/popover/PopoverTrigger.vue +0 -11
- package/src/components/ui/radio-group/RadioGroup.vue +0 -25
- package/src/components/ui/radio-group/RadioGroupItem.vue +0 -32
- package/src/components/ui/select/Select.vue +0 -15
- package/src/components/ui/select/SelectContent.vue +0 -59
- package/src/components/ui/select/SelectGroup.vue +0 -22
- package/src/components/ui/select/SelectItem.vue +0 -38
- package/src/components/ui/select/SelectItemText.vue +0 -11
- package/src/components/ui/select/SelectLabel.vue +0 -13
- package/src/components/ui/select/SelectScrollDownButton.vue +0 -27
- package/src/components/ui/select/SelectScrollUpButton.vue +0 -27
- package/src/components/ui/select/SelectSeparator.vue +0 -20
- package/src/components/ui/select/SelectTrigger.vue +0 -33
- package/src/components/ui/select/SelectValue.vue +0 -11
- package/src/components/ui/separator/Separator.vue +0 -33
- package/src/components/ui/switch/Switch.vue +0 -39
- package/src/components/ui/textarea/Textarea.vue +0 -32
- package/src/schemas/blocks/categoryGroup.ts +0 -17
- package/src/schemas/blocks/categoryList.ts +0 -18
- package/src/schemas/blocks/categorySingle.ts +0 -12
- package/src/schemas/blocks/contact.ts +0 -13
- package/src/schemas/blocks/content.ts +0 -13
- package/src/schemas/blocks/cta.ts +0 -11
- package/src/schemas/blocks/faqs.ts +0 -18
- package/src/schemas/blocks/features.ts +0 -17
- package/src/schemas/blocks/footer.ts +0 -16
- package/src/schemas/blocks/header.ts +0 -18
- package/src/schemas/blocks/hero.ts +0 -15
- package/src/schemas/blocks/intro.ts +0 -9
- package/src/schemas/blocks/postSingle.ts +0 -12
- package/src/schemas/blocks/productGroup.ts +0 -17
- package/src/schemas/blocks/productList.ts +0 -18
- package/src/schemas/blocks/productSingle.ts +0 -17
- package/src/schemas/blocks/reviews.ts +0 -16
- package/src/schemas/collections/block.ts +0 -83
- package/src/schemas/collections/category.ts +0 -11
- package/src/schemas/collections/page.ts +0 -13
- package/src/schemas/collections/post.ts +0 -11
- package/src/schemas/collections/product.ts +0 -11
- package/src/schemas/fields/badge.ts +0 -9
- package/src/schemas/fields/button.ts +0 -12
- package/src/schemas/fields/card.ts +0 -28
- package/src/schemas/fields/channel.ts +0 -10
- package/src/schemas/fields/form.ts +0 -20
- package/src/schemas/fields/image.ts +0 -8
- package/src/schemas/fields/link.ts +0 -9
- package/src/schemas/fields/logo.ts +0 -10
- package/src/schemas/fields/menu.ts +0 -10
- package/src/schemas/fields/meta.ts +0 -14
- package/src/schemas/fields/path.ts +0 -13
- package/src/schemas/fields/proof.ts +0 -11
- package/src/schemas/fields/section.ts +0 -48
- package/tailwind.config.js +0 -111
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { FormControl, FormDescription, FormField, FormItem, FormMessage } from '@/components/ui/form'
|
|
3
|
-
import { Input } from '@/components/ui/input'
|
|
4
|
-
import AutoFormLabel from './AutoFormLabel.vue'
|
|
5
|
-
import type { FieldProps } from './interface'
|
|
6
|
-
import { beautifyObjectName } from './utils'
|
|
7
|
-
|
|
8
|
-
defineOptions({
|
|
9
|
-
inheritAttrs: false,
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
defineProps<FieldProps>()
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<template>
|
|
16
|
-
<FormField
|
|
17
|
-
v-slot="slotProps"
|
|
18
|
-
:name="fieldName"
|
|
19
|
-
>
|
|
20
|
-
<FormItem>
|
|
21
|
-
<AutoFormLabel
|
|
22
|
-
v-if="!config?.hideLabel"
|
|
23
|
-
:required="required"
|
|
24
|
-
>
|
|
25
|
-
{{ config?.label || beautifyObjectName(label ?? fieldName) }}
|
|
26
|
-
</AutoFormLabel>
|
|
27
|
-
<FormControl>
|
|
28
|
-
<slot v-bind="slotProps">
|
|
29
|
-
<Input
|
|
30
|
-
type="number"
|
|
31
|
-
v-bind="{ ...slotProps.componentField, ...config?.inputProps }"
|
|
32
|
-
:disabled="config?.inputProps?.disabled ?? disabled"
|
|
33
|
-
/>
|
|
34
|
-
</slot>
|
|
35
|
-
</FormControl>
|
|
36
|
-
<FormDescription v-if="config?.description">
|
|
37
|
-
{{ config.description }}
|
|
38
|
-
</FormDescription>
|
|
39
|
-
<FormMessage />
|
|
40
|
-
</FormItem>
|
|
41
|
-
</FormField>
|
|
42
|
-
</template>
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts" generic="T extends ZodRawShape">
|
|
2
|
-
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion'
|
|
3
|
-
import { FormItem } from '@/components/ui/form'
|
|
4
|
-
import { FieldContextKey, useField } from 'vee-validate'
|
|
5
|
-
import { computed, provide } from 'vue'
|
|
6
|
-
import type { ZodAny, ZodObject, ZodRawShape } from 'zod'
|
|
7
|
-
import AutoFormField from './AutoFormField.vue'
|
|
8
|
-
import AutoFormLabel from './AutoFormLabel.vue'
|
|
9
|
-
import type { Config, ConfigItem, Shape } from './interface'
|
|
10
|
-
import { beautifyObjectName, getBaseSchema, getBaseType, getDefaultValueInZodStack } from './utils'
|
|
11
|
-
|
|
12
|
-
const props = defineProps<{
|
|
13
|
-
fieldName: string
|
|
14
|
-
required?: boolean
|
|
15
|
-
config?: Config<T>
|
|
16
|
-
schema?: ZodObject<T>
|
|
17
|
-
disabled?: boolean
|
|
18
|
-
}>()
|
|
19
|
-
|
|
20
|
-
const shapes = computed(() => {
|
|
21
|
-
// @ts-expect-error ignore {} not assignable to object
|
|
22
|
-
const val: { [key in keyof T]: Shape } = {}
|
|
23
|
-
|
|
24
|
-
if (!props.schema) return
|
|
25
|
-
const shape = getBaseSchema(props.schema)?.shape
|
|
26
|
-
if (!shape) return
|
|
27
|
-
Object.keys(shape).forEach((name) => {
|
|
28
|
-
const item = shape[name] as ZodAny
|
|
29
|
-
const baseItem = getBaseSchema(item) as ZodAny
|
|
30
|
-
let options = baseItem && 'values' in baseItem._def ? (baseItem._def.values as string[]) : undefined
|
|
31
|
-
if (!Array.isArray(options) && typeof options === 'object') options = Object.values(options)
|
|
32
|
-
|
|
33
|
-
val[name as keyof T] = {
|
|
34
|
-
type: getBaseType(item),
|
|
35
|
-
default: getDefaultValueInZodStack(item),
|
|
36
|
-
options,
|
|
37
|
-
required: !['ZodOptional', 'ZodNullable'].includes(item._def.typeName),
|
|
38
|
-
schema: item,
|
|
39
|
-
}
|
|
40
|
-
})
|
|
41
|
-
return val
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
const fieldContext = useField(props.fieldName)
|
|
45
|
-
// @ts-expect-error ignore missing `id`
|
|
46
|
-
provide(FieldContextKey, fieldContext)
|
|
47
|
-
</script>
|
|
48
|
-
|
|
49
|
-
<template>
|
|
50
|
-
<section>
|
|
51
|
-
<slot v-bind="props">
|
|
52
|
-
<Accordion
|
|
53
|
-
type="single"
|
|
54
|
-
as-child
|
|
55
|
-
class="w-full"
|
|
56
|
-
collapsible
|
|
57
|
-
:disabled="disabled"
|
|
58
|
-
>
|
|
59
|
-
<FormItem>
|
|
60
|
-
<AccordionItem
|
|
61
|
-
:value="fieldName"
|
|
62
|
-
class="border-none"
|
|
63
|
-
>
|
|
64
|
-
<AccordionTrigger>
|
|
65
|
-
<AutoFormLabel
|
|
66
|
-
class="text-base"
|
|
67
|
-
:required="required"
|
|
68
|
-
>
|
|
69
|
-
{{ schema?.description || beautifyObjectName(fieldName) }}
|
|
70
|
-
</AutoFormLabel>
|
|
71
|
-
</AccordionTrigger>
|
|
72
|
-
<AccordionContent class="p-1 space-y-5">
|
|
73
|
-
<template
|
|
74
|
-
v-for="(shape, key) in shapes"
|
|
75
|
-
:key="key"
|
|
76
|
-
>
|
|
77
|
-
<AutoFormField
|
|
78
|
-
:config="config?.[key as keyof typeof config] as ConfigItem"
|
|
79
|
-
:field-name="`${fieldName}.${key.toString()}`"
|
|
80
|
-
:label="key.toString()"
|
|
81
|
-
:shape="shape"
|
|
82
|
-
/>
|
|
83
|
-
</template>
|
|
84
|
-
</AccordionContent>
|
|
85
|
-
</AccordionItem>
|
|
86
|
-
</FormItem>
|
|
87
|
-
</Accordion>
|
|
88
|
-
</slot>
|
|
89
|
-
</section>
|
|
90
|
-
</template>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { FormLabel } from '@/components/ui/form'
|
|
3
|
-
|
|
4
|
-
defineProps<{
|
|
5
|
-
required?: boolean
|
|
6
|
-
}>()
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<template>
|
|
10
|
-
<FormLabel>
|
|
11
|
-
<slot />
|
|
12
|
-
<span
|
|
13
|
-
v-if="required"
|
|
14
|
-
class="text-destructive"
|
|
15
|
-
>
|
|
16
|
-
*</span
|
|
17
|
-
>
|
|
18
|
-
</FormLabel>
|
|
19
|
-
</template>
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { InputComponents } from './interface'
|
|
2
|
-
import AutoFormFieldArray from './AutoFormFieldArray.vue'
|
|
3
|
-
import AutoFormFieldBoolean from './AutoFormFieldBoolean.vue'
|
|
4
|
-
import AutoFormFieldDate from './AutoFormFieldDate.vue'
|
|
5
|
-
import AutoFormFieldEnum from './AutoFormFieldEnum.vue'
|
|
6
|
-
import AutoFormFieldFile from './AutoFormFieldFile.vue'
|
|
7
|
-
import AutoFormFieldInput from './AutoFormFieldInput.vue'
|
|
8
|
-
import AutoFormFieldNumber from './AutoFormFieldNumber.vue'
|
|
9
|
-
import AutoFormFieldObject from './AutoFormFieldObject.vue'
|
|
10
|
-
|
|
11
|
-
export const INPUT_COMPONENTS: InputComponents = {
|
|
12
|
-
date: AutoFormFieldDate,
|
|
13
|
-
select: AutoFormFieldEnum,
|
|
14
|
-
radio: AutoFormFieldEnum,
|
|
15
|
-
checkbox: AutoFormFieldBoolean,
|
|
16
|
-
switch: AutoFormFieldBoolean,
|
|
17
|
-
textarea: AutoFormFieldInput,
|
|
18
|
-
number: AutoFormFieldNumber,
|
|
19
|
-
string: AutoFormFieldInput,
|
|
20
|
-
file: AutoFormFieldFile,
|
|
21
|
-
array: AutoFormFieldArray,
|
|
22
|
-
object: AutoFormFieldObject,
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Define handlers for specific Zod types.
|
|
27
|
-
* You can expand this object to support more types.
|
|
28
|
-
*/
|
|
29
|
-
export const DEFAULT_ZOD_HANDLERS: {
|
|
30
|
-
[key: string]: keyof typeof INPUT_COMPONENTS
|
|
31
|
-
} = {
|
|
32
|
-
ZodString: 'string',
|
|
33
|
-
ZodBoolean: 'checkbox',
|
|
34
|
-
ZodDate: 'date',
|
|
35
|
-
ZodEnum: 'select',
|
|
36
|
-
ZodNativeEnum: 'select',
|
|
37
|
-
ZodNumber: 'number',
|
|
38
|
-
ZodArray: 'array',
|
|
39
|
-
ZodObject: 'object',
|
|
40
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import type { Ref } from 'vue'
|
|
2
|
-
import type * as z from 'zod'
|
|
3
|
-
import { createContext } from 'radix-vue'
|
|
4
|
-
import { useFieldValue, useFormValues } from 'vee-validate'
|
|
5
|
-
import { computed, ref, watch } from 'vue'
|
|
6
|
-
import { type Dependency, DependencyType, type EnumValues } from './interface'
|
|
7
|
-
import { getFromPath, getIndexIfArray } from './utils'
|
|
8
|
-
|
|
9
|
-
export const [injectDependencies, provideDependencies] = createContext<Ref<Dependency<z.infer<z.ZodObject<any>>>[] | undefined>>('AutoFormDependencies')
|
|
10
|
-
|
|
11
|
-
export default function useDependencies(
|
|
12
|
-
fieldName: string,
|
|
13
|
-
) {
|
|
14
|
-
const form = useFormValues()
|
|
15
|
-
// parsed test[0].age => test.age
|
|
16
|
-
const currentFieldName = fieldName.replace(/\[\d+\]/g, '')
|
|
17
|
-
const currentFieldValue = useFieldValue<any>(fieldName)
|
|
18
|
-
|
|
19
|
-
if (!form)
|
|
20
|
-
throw new Error('useDependencies should be used within <AutoForm>')
|
|
21
|
-
|
|
22
|
-
const dependencies = injectDependencies()
|
|
23
|
-
const isDisabled = ref(false)
|
|
24
|
-
const isHidden = ref(false)
|
|
25
|
-
const isRequired = ref(false)
|
|
26
|
-
const overrideOptions = ref<EnumValues | undefined>()
|
|
27
|
-
|
|
28
|
-
const currentFieldDependencies = computed(() => dependencies.value?.filter(
|
|
29
|
-
dependency => dependency.targetField === currentFieldName,
|
|
30
|
-
))
|
|
31
|
-
|
|
32
|
-
function getSourceValue(dep: Dependency<any>) {
|
|
33
|
-
const source = dep.sourceField as string
|
|
34
|
-
const index = getIndexIfArray(fieldName) ?? -1
|
|
35
|
-
const [sourceLast, ...sourceInitial] = source.split('.').toReversed()
|
|
36
|
-
const [_targetLast, ...targetInitial] = (dep.targetField as string).split('.').toReversed()
|
|
37
|
-
|
|
38
|
-
if (index >= 0 && sourceInitial.join(',') === targetInitial.join(',')) {
|
|
39
|
-
const [_currentLast, ...currentInitial] = fieldName.split('.').toReversed()
|
|
40
|
-
return getFromPath(form.value, currentInitial.join('.') + sourceLast);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return getFromPath(form.value, source)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const sourceFieldValues = computed(() => currentFieldDependencies.value?.map(dep => getSourceValue(dep)))
|
|
47
|
-
|
|
48
|
-
const resetConditionState = () => {
|
|
49
|
-
isDisabled.value = false
|
|
50
|
-
isHidden.value = false
|
|
51
|
-
isRequired.value = false
|
|
52
|
-
overrideOptions.value = undefined
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
watch([sourceFieldValues, dependencies], () => {
|
|
56
|
-
resetConditionState()
|
|
57
|
-
currentFieldDependencies.value?.forEach((dep) => {
|
|
58
|
-
const sourceValue = getSourceValue(dep)
|
|
59
|
-
const conditionMet = dep.when(sourceValue, currentFieldValue.value)
|
|
60
|
-
|
|
61
|
-
switch (dep.type) {
|
|
62
|
-
case DependencyType.DISABLES:
|
|
63
|
-
if (conditionMet)
|
|
64
|
-
isDisabled.value = true
|
|
65
|
-
|
|
66
|
-
break
|
|
67
|
-
case DependencyType.REQUIRES:
|
|
68
|
-
if (conditionMet)
|
|
69
|
-
isRequired.value = true
|
|
70
|
-
|
|
71
|
-
break
|
|
72
|
-
case DependencyType.HIDES:
|
|
73
|
-
if (conditionMet)
|
|
74
|
-
isHidden.value = true
|
|
75
|
-
|
|
76
|
-
break
|
|
77
|
-
case DependencyType.SETS_OPTIONS:
|
|
78
|
-
if (conditionMet)
|
|
79
|
-
overrideOptions.value = dep.options
|
|
80
|
-
|
|
81
|
-
break
|
|
82
|
-
}
|
|
83
|
-
})
|
|
84
|
-
}, { immediate: true, deep: true })
|
|
85
|
-
|
|
86
|
-
return {
|
|
87
|
-
isDisabled,
|
|
88
|
-
isHidden,
|
|
89
|
-
isRequired,
|
|
90
|
-
overrideOptions,
|
|
91
|
-
}
|
|
92
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export { default as AutoForm } from './AutoForm.vue'
|
|
2
|
-
export { default as AutoFormField } from './AutoFormField.vue'
|
|
3
|
-
|
|
4
|
-
export { default as AutoFormFieldArray } from './AutoFormFieldArray.vue'
|
|
5
|
-
export { default as AutoFormFieldBoolean } from './AutoFormFieldBoolean.vue'
|
|
6
|
-
export { default as AutoFormFieldDate } from './AutoFormFieldDate.vue'
|
|
7
|
-
|
|
8
|
-
export { default as AutoFormFieldEnum } from './AutoFormFieldEnum.vue'
|
|
9
|
-
export { default as AutoFormFieldFile } from './AutoFormFieldFile.vue'
|
|
10
|
-
export { default as AutoFormFieldInput } from './AutoFormFieldInput.vue'
|
|
11
|
-
export { default as AutoFormFieldNumber } from './AutoFormFieldNumber.vue'
|
|
12
|
-
export { default as AutoFormFieldObject } from './AutoFormFieldObject.vue'
|
|
13
|
-
export { default as AutoFormLabel } from './AutoFormLabel.vue'
|
|
14
|
-
export type { Config, ConfigItem, FieldProps } from './interface'
|
|
15
|
-
export { getBaseSchema, getBaseType, getObjectFormSchema } from './utils'
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import type { Component, InputHTMLAttributes } from 'vue'
|
|
2
|
-
import type { z, ZodAny } from 'zod'
|
|
3
|
-
import type { INPUT_COMPONENTS } from './constant'
|
|
4
|
-
|
|
5
|
-
export interface FieldProps {
|
|
6
|
-
fieldName: string
|
|
7
|
-
label?: string
|
|
8
|
-
required?: boolean
|
|
9
|
-
config?: ConfigItem
|
|
10
|
-
disabled?: boolean
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface Shape {
|
|
14
|
-
type: string
|
|
15
|
-
default?: any
|
|
16
|
-
required?: boolean
|
|
17
|
-
options?: string[]
|
|
18
|
-
schema?: ZodAny
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface InputComponents {
|
|
22
|
-
date: Component;
|
|
23
|
-
select: Component;
|
|
24
|
-
radio: Component;
|
|
25
|
-
checkbox: Component;
|
|
26
|
-
switch: Component;
|
|
27
|
-
textarea: Component;
|
|
28
|
-
number: Component;
|
|
29
|
-
string: Component;
|
|
30
|
-
file: Component;
|
|
31
|
-
array: Component;
|
|
32
|
-
object: Component;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface ConfigItem {
|
|
36
|
-
/** Value for the `FormLabel` */
|
|
37
|
-
label?: string
|
|
38
|
-
/** Value for the `FormDescription` */
|
|
39
|
-
description?: string
|
|
40
|
-
/** Pick which component to be rendered. */
|
|
41
|
-
component?: keyof typeof INPUT_COMPONENTS | Component
|
|
42
|
-
/** Hide `FormLabel`. */
|
|
43
|
-
hideLabel?: boolean
|
|
44
|
-
inputProps?: InputHTMLAttributes
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// Define a type to unwrap an array
|
|
48
|
-
type UnwrapArray<T> = T extends (infer U)[] ? U : never
|
|
49
|
-
|
|
50
|
-
export type Config<SchemaType extends object> = {
|
|
51
|
-
// If SchemaType.key is an object, create a nested Config, otherwise ConfigItem
|
|
52
|
-
[Key in keyof SchemaType]?:
|
|
53
|
-
SchemaType[Key] extends any[]
|
|
54
|
-
? UnwrapArray<Config<SchemaType[Key]>>
|
|
55
|
-
: SchemaType[Key] extends object
|
|
56
|
-
? Config<SchemaType[Key]>
|
|
57
|
-
: ConfigItem;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export enum DependencyType {
|
|
61
|
-
DISABLES,
|
|
62
|
-
REQUIRES,
|
|
63
|
-
HIDES,
|
|
64
|
-
SETS_OPTIONS,
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
interface BaseDependency<SchemaType extends z.infer<z.ZodObject<any, any>>> {
|
|
68
|
-
sourceField: keyof SchemaType
|
|
69
|
-
type: DependencyType
|
|
70
|
-
targetField: keyof SchemaType
|
|
71
|
-
when: (sourceFieldValue: any, targetFieldValue: any) => boolean
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export type ValueDependency<SchemaType extends z.infer<z.ZodObject<any, any>>> =
|
|
75
|
-
BaseDependency<SchemaType> & {
|
|
76
|
-
type:
|
|
77
|
-
| DependencyType.DISABLES
|
|
78
|
-
| DependencyType.REQUIRES
|
|
79
|
-
| DependencyType.HIDES
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export type EnumValues = readonly [string, ...string[]]
|
|
83
|
-
|
|
84
|
-
export type OptionsDependency<
|
|
85
|
-
SchemaType extends z.infer<z.ZodObject<any, any>>,
|
|
86
|
-
> = BaseDependency<SchemaType> & {
|
|
87
|
-
type: DependencyType.SETS_OPTIONS
|
|
88
|
-
|
|
89
|
-
// Partial array of values from sourceField that will trigger the dependency
|
|
90
|
-
options: EnumValues
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export type Dependency<SchemaType extends z.infer<z.ZodObject<any, any>>> =
|
|
94
|
-
| ValueDependency<SchemaType>
|
|
95
|
-
| OptionsDependency<SchemaType>
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import type { z } from 'zod'
|
|
2
|
-
|
|
3
|
-
// TODO: This should support recursive ZodEffects but TypeScript doesn't allow circular type definitions.
|
|
4
|
-
export type ZodObjectOrWrapped =
|
|
5
|
-
| z.ZodObject<any, any>
|
|
6
|
-
| z.ZodEffects<z.ZodObject<any, any>>
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Beautify a camelCase string.
|
|
10
|
-
* e.g. "myString" -> "My String"
|
|
11
|
-
*/
|
|
12
|
-
export function beautifyObjectName(string: string) {
|
|
13
|
-
// Remove bracketed indices
|
|
14
|
-
// if numbers only return the string
|
|
15
|
-
let output = string.replace(/\[\d+\]/g, '').replace(/([A-Z])/g, ' $1')
|
|
16
|
-
output = output.charAt(0).toUpperCase() + output.slice(1)
|
|
17
|
-
return output
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Parse string and extract the index
|
|
22
|
-
* @param string
|
|
23
|
-
* @returns index or undefined
|
|
24
|
-
*/
|
|
25
|
-
export function getIndexIfArray(string: string) {
|
|
26
|
-
const indexRegex = /\[(\d+)\]/
|
|
27
|
-
// Match the index
|
|
28
|
-
const match = string.match(indexRegex)
|
|
29
|
-
// Extract the index (number)
|
|
30
|
-
const index = match ? Number.parseInt(match[1]) : undefined
|
|
31
|
-
return index
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Get the lowest level Zod type.
|
|
36
|
-
* This will unpack optionals, refinements, etc.
|
|
37
|
-
*/
|
|
38
|
-
export function getBaseSchema<
|
|
39
|
-
ChildType extends z.ZodAny | z.AnyZodObject = z.ZodAny,
|
|
40
|
-
>(schema: ChildType | z.ZodEffects<ChildType>): ChildType | null {
|
|
41
|
-
if (!schema)
|
|
42
|
-
return null;
|
|
43
|
-
if ('innerType' in schema._def)
|
|
44
|
-
return getBaseSchema(schema._def.innerType as ChildType)
|
|
45
|
-
|
|
46
|
-
if ('schema' in schema._def)
|
|
47
|
-
return getBaseSchema(schema._def.schema as ChildType)
|
|
48
|
-
|
|
49
|
-
return schema as ChildType
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Get the type name of the lowest level Zod type.
|
|
54
|
-
* This will unpack optionals, refinements, etc.
|
|
55
|
-
*/
|
|
56
|
-
export function getBaseType(schema: z.ZodAny) {
|
|
57
|
-
const baseSchema = getBaseSchema(schema)
|
|
58
|
-
return baseSchema ? baseSchema._def.typeName : '';
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Search for a "ZodDefault" in the Zod stack and return its value.
|
|
63
|
-
*/
|
|
64
|
-
export function getDefaultValueInZodStack(schema: z.ZodAny): any {
|
|
65
|
-
const typedSchema = schema as unknown as z.ZodDefault<
|
|
66
|
-
z.ZodNumber | z.ZodString
|
|
67
|
-
>
|
|
68
|
-
|
|
69
|
-
if (typedSchema._def.typeName === 'ZodDefault')
|
|
70
|
-
return typedSchema._def.defaultValue()
|
|
71
|
-
|
|
72
|
-
if ('innerType' in typedSchema._def) {
|
|
73
|
-
return getDefaultValueInZodStack(
|
|
74
|
-
typedSchema._def.innerType as unknown as z.ZodAny,
|
|
75
|
-
)
|
|
76
|
-
}
|
|
77
|
-
if ('schema' in typedSchema._def) {
|
|
78
|
-
return getDefaultValueInZodStack(
|
|
79
|
-
(typedSchema._def as any).schema as z.ZodAny,
|
|
80
|
-
)
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return undefined
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export function getObjectFormSchema(
|
|
87
|
-
schema: ZodObjectOrWrapped,
|
|
88
|
-
): z.ZodObject<any, any> {
|
|
89
|
-
if (schema?._def.typeName === 'ZodEffects') {
|
|
90
|
-
const typedSchema = schema as z.ZodEffects<z.ZodObject<any, any>>
|
|
91
|
-
return getObjectFormSchema(typedSchema._def.schema)
|
|
92
|
-
}
|
|
93
|
-
return schema as z.ZodObject<any, any>
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function isIndex(value: unknown): value is number {
|
|
97
|
-
return Number(value) >= 0;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Constructs a path with dot paths for arrays to use brackets to be compatible with vee-validate path syntax
|
|
101
|
-
*/
|
|
102
|
-
export function normalizeFormPath(path: string): string {
|
|
103
|
-
const pathArr = path.split('.')
|
|
104
|
-
if (!pathArr.length)
|
|
105
|
-
return '';
|
|
106
|
-
|
|
107
|
-
let fullPath = String(pathArr[0])
|
|
108
|
-
for (let i = 1; i < pathArr.length; i++) {
|
|
109
|
-
if (isIndex(pathArr[i])) {
|
|
110
|
-
fullPath += `[${pathArr[i]}]`
|
|
111
|
-
continue
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
fullPath += `.${pathArr[i]}`
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
return fullPath
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
type NestedRecord = Record<string, unknown> | { [k: string]: NestedRecord }
|
|
121
|
-
/**
|
|
122
|
-
* Checks if the path opted out of nested fields using `[fieldName]` syntax
|
|
123
|
-
*/
|
|
124
|
-
export function isNotNestedPath(path: string) {
|
|
125
|
-
return /^\[.+\]$/.test(path)
|
|
126
|
-
}
|
|
127
|
-
function isObject(obj: unknown): obj is Record<string, unknown> {
|
|
128
|
-
return obj !== null && !!obj && typeof obj === 'object' && !Array.isArray(obj);
|
|
129
|
-
}
|
|
130
|
-
function isContainerValue(value: unknown): value is Record<string, unknown> {
|
|
131
|
-
return isObject(value) || Array.isArray(value)
|
|
132
|
-
}
|
|
133
|
-
function cleanupNonNestedPath(path: string) {
|
|
134
|
-
if (isNotNestedPath(path))
|
|
135
|
-
return path.replace(/\[|\]/g, '');
|
|
136
|
-
|
|
137
|
-
return path
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Gets a nested property value from an object
|
|
142
|
-
*/
|
|
143
|
-
export function getFromPath<TValue = unknown>(object: NestedRecord | undefined, path: string): TValue | undefined
|
|
144
|
-
export function getFromPath<TValue = unknown, TFallback = TValue>(
|
|
145
|
-
object: NestedRecord | undefined,
|
|
146
|
-
path: string,
|
|
147
|
-
fallback?: TFallback,
|
|
148
|
-
): TValue | TFallback
|
|
149
|
-
export function getFromPath<TValue = unknown, TFallback = TValue>(
|
|
150
|
-
object: NestedRecord | undefined,
|
|
151
|
-
path: string,
|
|
152
|
-
fallback?: TFallback,
|
|
153
|
-
): TValue | TFallback | undefined {
|
|
154
|
-
if (!object)
|
|
155
|
-
return fallback
|
|
156
|
-
|
|
157
|
-
if (isNotNestedPath(path))
|
|
158
|
-
return object[cleanupNonNestedPath(path)] as TValue | undefined
|
|
159
|
-
|
|
160
|
-
const resolvedValue = (path || '')
|
|
161
|
-
.split(/\.|\[(\d+)\]/)
|
|
162
|
-
.filter(Boolean)
|
|
163
|
-
.reduce((acc, propKey) => {
|
|
164
|
-
if (isContainerValue(acc) && propKey in acc)
|
|
165
|
-
return acc[propKey]
|
|
166
|
-
|
|
167
|
-
return fallback
|
|
168
|
-
}, object as unknown)
|
|
169
|
-
|
|
170
|
-
return resolvedValue as TValue | undefined
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
type Booleanish = boolean | 'true' | 'false'
|
|
174
|
-
|
|
175
|
-
export function booleanishToBoolean(value: Booleanish) {
|
|
176
|
-
switch (value) {
|
|
177
|
-
case 'true':
|
|
178
|
-
case true:
|
|
179
|
-
return true;
|
|
180
|
-
case 'false':
|
|
181
|
-
case false:
|
|
182
|
-
return false;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export function maybeBooleanishToBoolean(value?: Booleanish) {
|
|
187
|
-
return value ? booleanishToBoolean(value) : undefined
|
|
188
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { cn } from '@/lib/utils'
|
|
3
|
-
import { AvatarRoot } from 'radix-vue'
|
|
4
|
-
import type { HTMLAttributes } from 'vue'
|
|
5
|
-
import { avatarVariant, type AvatarVariants } from '.'
|
|
6
|
-
|
|
7
|
-
const props = withDefaults(
|
|
8
|
-
defineProps<{
|
|
9
|
-
class?: HTMLAttributes['class']
|
|
10
|
-
size?: AvatarVariants['size']
|
|
11
|
-
shape?: AvatarVariants['shape']
|
|
12
|
-
}>(),
|
|
13
|
-
{
|
|
14
|
-
size: 'sm',
|
|
15
|
-
shape: 'circle',
|
|
16
|
-
}
|
|
17
|
-
)
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
<template>
|
|
21
|
-
<AvatarRoot :class="cn(avatarVariant({ size, shape }), props.class)">
|
|
22
|
-
<slot />
|
|
23
|
-
</AvatarRoot>
|
|
24
|
-
</template>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { cn } from '@/lib/utils'
|
|
3
|
-
import type { HTMLAttributes } from 'vue'
|
|
4
|
-
import { type BadgeVariants, badgeVariants } from '.'
|
|
5
|
-
|
|
6
|
-
const props = defineProps<{
|
|
7
|
-
variant?: BadgeVariants['variant']
|
|
8
|
-
class?: HTMLAttributes['class']
|
|
9
|
-
}>()
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<template>
|
|
13
|
-
<div :class="cn(badgeVariants({ variant }), props.class)">
|
|
14
|
-
<slot />
|
|
15
|
-
</div>
|
|
16
|
-
</template>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { cn } from '@/lib/utils'
|
|
3
|
-
import { Primitive, type PrimitiveProps } from 'radix-vue'
|
|
4
|
-
import type { HTMLAttributes } from 'vue'
|
|
5
|
-
import { type ButtonVariants, buttonVariants } from '.'
|
|
6
|
-
|
|
7
|
-
interface Props extends PrimitiveProps {
|
|
8
|
-
variant?: ButtonVariants['variant']
|
|
9
|
-
size?: ButtonVariants['size']
|
|
10
|
-
class?: HTMLAttributes['class']
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
14
|
-
as: 'button',
|
|
15
|
-
})
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
<template>
|
|
19
|
-
<Primitive
|
|
20
|
-
:as="as"
|
|
21
|
-
:as-child="asChild"
|
|
22
|
-
:class="cn(buttonVariants({ variant, size }), props.class)"
|
|
23
|
-
>
|
|
24
|
-
<slot />
|
|
25
|
-
</Primitive>
|
|
26
|
-
</template>
|