fulldev-ui 0.6.5 → 0.7.0-beta.1
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/.prettierrc.yaml +10 -3
- package/README.md +2 -1
- package/astro.config.ts +20 -17
- package/components.json +18 -0
- package/package.json +63 -34
- package/pnpm-lock.yaml +3690 -1465
- package/public/images/categories/journals.jpg +0 -0
- package/public/images/categories/productivity.jpg +0 -0
- package/public/images/categories/workspace.jpg +0 -0
- package/public/images/leather-long-wallet.jpg +0 -0
- package/public/images/products/earthen-mug.jpg +0 -0
- package/public/images/products/leather-long-wallet.jpg +0 -0
- package/public/images/products/leatherbound-daily-journal-set.jpg +0 -0
- package/public/images/products/leatherbound-daily-journal.jpg +0 -0
- package/public/images/products/machines-pen.jpg +0 -0
- package/public/images/products/machines-pencil-and-pen-set.jpg +0 -0
- package/public/images/products/mini-sketchbooks.jpg +0 -0
- package/public/images/products/organizer-set.jpg +0 -0
- package/src/blocks/CategoryGroup1.astro +43 -0
- package/src/blocks/CategoryList1.astro +55 -0
- package/src/blocks/Contact1.astro +34 -77
- package/src/blocks/Contact2.astro +31 -77
- package/src/blocks/Content1.astro +18 -30
- package/src/blocks/Cta1.astro +18 -58
- package/src/blocks/Faqs1.astro +29 -0
- package/src/blocks/Faqs2.astro +29 -0
- package/src/blocks/Features1.astro +25 -61
- package/src/blocks/Footer.astro +47 -71
- package/src/blocks/Header.astro +64 -124
- package/src/blocks/Hero1.astro +23 -54
- package/src/blocks/Intro1.astro +16 -58
- package/src/blocks/PostSingle1.astro +29 -0
- package/src/blocks/ProductGroup1.astro +82 -0
- package/src/blocks/ProductList1.astro +60 -0
- package/src/blocks/ProductSingle1.astro +65 -0
- package/src/blocks/Reviews1.astro +23 -67
- package/src/components/Abstract.astro +36 -0
- package/src/components/Accordion.vue +31 -0
- package/src/components/Avatar.astro +23 -32
- package/src/components/Badge.astro +10 -58
- package/src/components/Box.astro +28 -0
- package/src/components/Button.astro +38 -78
- package/src/components/Buttons.astro +41 -19
- package/src/components/Card.astro +20 -0
- package/src/components/Carousel.vue +44 -0
- package/src/components/Chip.astro +27 -0
- package/src/{structures → components}/Code.astro +27 -8
- package/src/components/Collapsible.vue +21 -0
- package/src/components/Container.astro +25 -0
- package/src/components/Drawer.vue +53 -0
- package/src/components/Form.vue +82 -0
- package/src/components/Gallery.vue +85 -0
- package/src/components/Grid.astro +35 -0
- package/src/components/Icon.astro +12 -45
- package/src/components/Image.astro +6 -28
- package/src/components/Layout.astro +126 -0
- package/src/components/Link.astro +7 -65
- package/src/components/List.astro +13 -77
- package/src/components/Logo.astro +16 -35
- package/src/components/Masonry.astro +35 -0
- package/src/components/Menu.astro +31 -36
- package/src/components/Menus.astro +15 -10
- package/src/components/Navigation.vue +93 -0
- package/src/components/Panel.astro +18 -0
- package/src/components/Person.astro +43 -0
- package/src/components/Price.astro +26 -11
- package/src/components/Proof.astro +16 -37
- package/src/components/{docs/Props.astro → Props.astro} +3 -3
- package/src/components/Prose.astro +28 -0
- package/src/components/Rating.astro +5 -24
- package/src/components/Search.vue +65 -0
- package/src/components/Section.astro +18 -0
- package/src/components/Select.vue +41 -0
- package/src/components/Separator.astro +0 -0
- package/src/components/Sidebar.astro +50 -0
- package/src/components/Social.astro +8 -15
- package/src/components/Socials.astro +21 -19
- package/src/components/Sort.vue +46 -0
- package/src/components/Split.astro +27 -0
- package/src/components/Table.astro +17 -17
- package/src/components/Tabs.vue +17 -0
- package/src/components/Themer.astro +12 -3
- package/src/components/Toc.astro +24 -21
- package/src/components/Toolbar.vue +115 -0
- package/src/components/Writeup.astro +37 -0
- package/src/components/ui/accordion/Accordion.vue +19 -0
- package/src/components/ui/accordion/AccordionContent.vue +24 -0
- package/src/components/ui/accordion/AccordionItem.vue +24 -0
- package/src/components/ui/accordion/AccordionTrigger.vue +33 -0
- package/src/components/ui/accordion/index.ts +4 -0
- package/src/components/ui/auto-form/AutoForm.vue +115 -0
- package/src/components/ui/auto-form/AutoFormField.vue +45 -0
- package/src/components/ui/auto-form/AutoFormFieldArray.vue +127 -0
- package/src/components/ui/auto-form/AutoFormFieldBoolean.vue +47 -0
- package/src/components/ui/auto-form/AutoFormFieldDate.vue +78 -0
- package/src/components/ui/auto-form/AutoFormFieldEnum.vue +77 -0
- package/src/components/ui/auto-form/AutoFormFieldFile.vue +87 -0
- package/src/components/ui/auto-form/AutoFormFieldInput.vue +42 -0
- package/src/components/ui/auto-form/AutoFormFieldNumber.vue +42 -0
- package/src/components/ui/auto-form/AutoFormFieldObject.vue +90 -0
- package/src/components/ui/auto-form/AutoFormLabel.vue +19 -0
- package/src/components/ui/auto-form/constant.ts +40 -0
- package/src/components/ui/auto-form/dependencies.ts +92 -0
- package/src/components/ui/auto-form/index.ts +15 -0
- package/src/components/ui/auto-form/interface.ts +95 -0
- package/src/components/ui/auto-form/utils.ts +188 -0
- package/src/components/ui/avatar/Avatar.vue +24 -0
- package/src/components/ui/avatar/AvatarFallback.vue +11 -0
- package/src/components/ui/avatar/AvatarImage.vue +9 -0
- package/src/components/ui/avatar/index.ts +24 -0
- package/src/components/ui/badge/Badge.vue +16 -0
- package/src/components/ui/badge/index.ts +22 -0
- package/src/components/ui/breadcrumb/Breadcrumb.vue +13 -0
- package/src/components/ui/breadcrumb/BreadcrumbEllipsis.vue +22 -0
- package/src/components/ui/breadcrumb/BreadcrumbItem.vue +14 -0
- package/src/components/ui/breadcrumb/BreadcrumbLink.vue +19 -0
- package/src/components/ui/breadcrumb/BreadcrumbList.vue +16 -0
- package/src/components/ui/breadcrumb/BreadcrumbPage.vue +19 -0
- package/src/components/ui/breadcrumb/BreadcrumbSeparator.vue +21 -0
- package/src/components/ui/breadcrumb/index.ts +7 -0
- package/src/components/ui/button/Button.vue +26 -0
- package/src/components/ui/button/index.ts +31 -0
- package/src/components/ui/calendar/Calendar.vue +80 -0
- package/src/components/ui/calendar/CalendarCell.vue +29 -0
- package/src/components/ui/calendar/CalendarCellTrigger.vue +40 -0
- package/src/components/ui/calendar/CalendarGrid.vue +24 -0
- package/src/components/ui/calendar/CalendarGridBody.vue +11 -0
- package/src/components/ui/calendar/CalendarGridHead.vue +11 -0
- package/src/components/ui/calendar/CalendarGridRow.vue +24 -0
- package/src/components/ui/calendar/CalendarHeadCell.vue +24 -0
- package/src/components/ui/calendar/CalendarHeader.vue +24 -0
- package/src/components/ui/calendar/CalendarHeading.vue +27 -0
- package/src/components/ui/calendar/CalendarNextButton.vue +30 -0
- package/src/components/ui/calendar/CalendarPrevButton.vue +30 -0
- package/src/components/ui/calendar/index.ts +12 -0
- package/src/components/ui/card/Card.vue +14 -0
- package/src/components/ui/card/CardContent.vue +14 -0
- package/src/components/ui/card/CardDescription.vue +14 -0
- package/src/components/ui/card/CardFooter.vue +14 -0
- package/src/components/ui/card/CardHeader.vue +14 -0
- package/src/components/ui/card/CardTitle.vue +14 -0
- package/src/components/ui/card/index.ts +6 -0
- package/src/components/ui/carousel/Carousel.vue +61 -0
- package/src/components/ui/carousel/CarouselContent.vue +27 -0
- package/src/components/ui/carousel/CarouselItem.vue +19 -0
- package/src/components/ui/carousel/CarouselNext.vue +33 -0
- package/src/components/ui/carousel/CarouselPrevious.vue +33 -0
- package/src/components/ui/carousel/index.ts +10 -0
- package/src/components/ui/carousel/interface.ts +26 -0
- package/src/components/ui/carousel/useCarousel.ts +56 -0
- package/src/components/ui/checkbox/Checkbox.vue +36 -0
- package/src/components/ui/checkbox/index.ts +1 -0
- package/src/components/ui/collapsible/Collapsible.vue +15 -0
- package/src/components/ui/collapsible/CollapsibleContent.vue +11 -0
- package/src/components/ui/collapsible/CollapsibleTrigger.vue +11 -0
- package/src/components/ui/collapsible/index.ts +3 -0
- package/src/components/ui/command/Command.vue +32 -0
- package/src/components/ui/command/CommandDialog.vue +23 -0
- package/src/components/ui/command/CommandEmpty.vue +23 -0
- package/src/components/ui/command/CommandGroup.vue +39 -0
- package/src/components/ui/command/CommandInput.vue +43 -0
- package/src/components/ui/command/CommandItem.vue +31 -0
- package/src/components/ui/command/CommandList.vue +30 -0
- package/src/components/ui/command/CommandSeparator.vue +23 -0
- package/src/components/ui/command/CommandShortcut.vue +14 -0
- package/src/components/ui/command/index.ts +9 -0
- package/src/components/ui/dialog/Dialog.vue +14 -0
- package/src/components/ui/dialog/DialogClose.vue +11 -0
- package/src/components/ui/dialog/DialogContent.vue +51 -0
- package/src/components/ui/dialog/DialogDescription.vue +24 -0
- package/src/components/ui/dialog/DialogFooter.vue +12 -0
- package/src/components/ui/dialog/DialogHeader.vue +14 -0
- package/src/components/ui/dialog/DialogScrollContent.vue +59 -0
- package/src/components/ui/dialog/DialogTitle.vue +24 -0
- package/src/components/ui/dialog/DialogTrigger.vue +11 -0
- package/src/components/ui/dialog/index.ts +9 -0
- package/src/components/ui/drawer/Drawer.vue +19 -0
- package/src/components/ui/drawer/DrawerContent.vue +31 -0
- package/src/components/ui/drawer/DrawerDescription.vue +23 -0
- package/src/components/ui/drawer/DrawerFooter.vue +14 -0
- package/src/components/ui/drawer/DrawerHeader.vue +14 -0
- package/src/components/ui/drawer/DrawerOverlay.vue +21 -0
- package/src/components/ui/drawer/DrawerTitle.vue +23 -0
- package/src/components/ui/drawer/index.ts +8 -0
- package/src/components/ui/form/FormControl.vue +16 -0
- package/src/components/ui/form/FormDescription.vue +20 -0
- package/src/components/ui/form/FormItem.vue +19 -0
- package/src/components/ui/form/FormLabel.vue +20 -0
- package/src/components/ui/form/FormMessage.vue +16 -0
- package/src/components/ui/form/index.ts +7 -0
- package/src/components/ui/form/injectionKeys.ts +4 -0
- package/src/components/ui/form/useFormField.ts +30 -0
- package/src/components/ui/input/Input.vue +32 -0
- package/src/components/ui/input/index.ts +1 -0
- package/src/components/ui/label/Label.vue +24 -0
- package/src/components/ui/label/index.ts +1 -0
- package/src/components/ui/menubar/Menubar.vue +25 -0
- package/src/components/ui/menubar/MenubarCheckboxItem.vue +42 -0
- package/src/components/ui/menubar/MenubarContent.vue +35 -0
- package/src/components/ui/menubar/MenubarGroup.vue +11 -0
- package/src/components/ui/menubar/MenubarItem.vue +32 -0
- package/src/components/ui/menubar/MenubarLabel.vue +13 -0
- package/src/components/ui/menubar/MenubarMenu.vue +11 -0
- package/src/components/ui/menubar/MenubarRadioGroup.vue +20 -0
- package/src/components/ui/menubar/MenubarRadioItem.vue +42 -0
- package/src/components/ui/menubar/MenubarSeparator.vue +22 -0
- package/src/components/ui/menubar/MenubarShortcut.vue +14 -0
- package/src/components/ui/menubar/MenubarSub.vue +19 -0
- package/src/components/ui/menubar/MenubarSubContent.vue +39 -0
- package/src/components/ui/menubar/MenubarSubTrigger.vue +32 -0
- package/src/components/ui/menubar/MenubarTrigger.vue +29 -0
- package/src/components/ui/menubar/index.ts +15 -0
- package/src/components/ui/navigation-menu/NavigationMenu.vue +33 -0
- package/src/components/ui/navigation-menu/NavigationMenuContent.vue +36 -0
- package/src/components/ui/navigation-menu/NavigationMenuIndicator.vue +29 -0
- package/src/components/ui/navigation-menu/NavigationMenuItem.vue +11 -0
- package/src/components/ui/navigation-menu/NavigationMenuLink.vue +19 -0
- package/src/components/ui/navigation-menu/NavigationMenuList.vue +24 -0
- package/src/components/ui/navigation-menu/NavigationMenuTrigger.vue +30 -0
- package/src/components/ui/navigation-menu/NavigationMenuViewport.vue +29 -0
- package/src/components/ui/navigation-menu/index.ts +14 -0
- package/src/components/ui/popover/Popover.vue +15 -0
- package/src/components/ui/popover/PopoverContent.vue +45 -0
- package/src/components/ui/popover/PopoverTrigger.vue +11 -0
- package/src/components/ui/popover/index.ts +3 -0
- package/src/components/ui/radio-group/RadioGroup.vue +25 -0
- package/src/components/ui/radio-group/RadioGroupItem.vue +32 -0
- package/src/components/ui/radio-group/index.ts +2 -0
- package/src/components/ui/select/Select.vue +15 -0
- package/src/components/ui/select/SelectContent.vue +59 -0
- package/src/components/ui/select/SelectGroup.vue +22 -0
- package/src/components/ui/select/SelectItem.vue +38 -0
- package/src/components/ui/select/SelectItemText.vue +11 -0
- package/src/components/ui/select/SelectLabel.vue +13 -0
- package/src/components/ui/select/SelectScrollDownButton.vue +27 -0
- package/src/components/ui/select/SelectScrollUpButton.vue +27 -0
- package/src/components/ui/select/SelectSeparator.vue +20 -0
- package/src/components/ui/select/SelectTrigger.vue +33 -0
- package/src/components/ui/select/SelectValue.vue +11 -0
- package/src/components/ui/select/index.ts +11 -0
- package/src/components/ui/separator/Separator.vue +33 -0
- package/src/components/ui/separator/index.ts +1 -0
- package/src/components/ui/switch/Switch.vue +39 -0
- package/src/components/ui/switch/index.ts +1 -0
- package/src/components/ui/tabs/Tabs.vue +15 -0
- package/src/components/ui/tabs/TabsContent.vue +27 -0
- package/src/components/ui/tabs/TabsList.vue +22 -0
- package/src/components/ui/tabs/TabsTrigger.vue +31 -0
- package/src/components/ui/tabs/index.ts +4 -0
- package/src/components/ui/textarea/Textarea.vue +32 -0
- package/src/components/ui/textarea/index.ts +1 -0
- package/src/lib/utils.ts +6 -0
- package/src/schemas/blocks/categoryGroup.ts +17 -0
- package/src/schemas/blocks/categoryList.ts +18 -0
- package/src/schemas/blocks/categorySingle.ts +12 -0
- package/src/schemas/blocks/contact.ts +13 -0
- package/src/schemas/blocks/content.ts +13 -0
- package/src/schemas/blocks/cta.ts +11 -0
- package/src/schemas/blocks/faqs.ts +17 -0
- package/src/schemas/blocks/features.ts +16 -0
- package/src/schemas/blocks/footer.ts +16 -0
- package/src/schemas/{header.ts → blocks/header.ts} +5 -8
- package/src/schemas/blocks/hero.ts +15 -0
- package/src/schemas/blocks/intro.ts +9 -0
- package/src/schemas/blocks/postSingle.ts +12 -0
- package/src/schemas/blocks/productGroup.ts +17 -0
- package/src/schemas/blocks/productList.ts +18 -0
- package/src/schemas/blocks/productSingle.ts +15 -0
- package/src/schemas/blocks/reviews.ts +16 -0
- package/src/schemas/fields/badge.ts +9 -0
- package/src/schemas/fields/block.ts +60 -0
- package/src/schemas/fields/button.ts +12 -0
- package/src/schemas/fields/card.ts +28 -0
- package/src/schemas/fields/channel.ts +10 -0
- package/src/schemas/fields/form.ts +20 -0
- package/src/schemas/fields/image.ts +8 -0
- package/src/schemas/fields/link.ts +9 -0
- package/src/schemas/fields/logo.ts +10 -0
- package/src/schemas/fields/menu.ts +10 -0
- package/src/schemas/fields/meta.ts +14 -0
- package/src/schemas/fields/proof.ts +11 -0
- package/src/schemas/fields/section.ts +48 -0
- package/tailwind.config.js +111 -0
- package/tsconfig.json +5 -7
- package/.env.example +0 -3
- package/.vscode/settings.json +0 -25
- package/CONTRIBUTING.md +0 -124
- package/cloudcannon.config.yml +0 -207
- package/public/favicon/android-chrome-192x192.png +0 -0
- package/public/favicon/android-chrome-512x512.png +0 -0
- package/public/favicon/apple-touch-icon.png +0 -0
- package/public/favicon/browserconfig.xml +0 -9
- package/public/favicon/favicon-16x16.png +0 -0
- package/public/favicon/favicon-32x32.png +0 -0
- package/public/favicon/favicon-48x48.png +0 -0
- package/public/favicon/favicon.ico +0 -0
- package/public/favicon/favicon.svg +0 -16
- package/public/favicon/manifest.webmanifest +0 -30
- package/public/favicon/mstile-150x150.png +0 -0
- package/public/favicon/safari-pinned-tab.svg +0 -16
- package/public/favicon/yandex-browser-50x50.png +0 -0
- package/public/favicon/yandex-browser-manifest.json +0 -9
- package/siteicon.png +0 -0
- package/src/blocks/Banner.astro +0 -31
- package/src/blocks/Colleagues1.astro +0 -74
- package/src/blocks/Compare1.astro +0 -64
- package/src/blocks/Content2.astro +0 -47
- package/src/blocks/Content3.astro +0 -47
- package/src/blocks/Content4.astro +0 -52
- package/src/blocks/Content5.astro +0 -43
- package/src/blocks/Content6.astro +0 -57
- package/src/blocks/Content7.astro +0 -65
- package/src/blocks/Content8.astro +0 -48
- package/src/blocks/Cta2.astro +0 -52
- package/src/blocks/Features2.astro +0 -71
- package/src/blocks/JobCategories1.astro +0 -61
- package/src/blocks/JobCategory1.astro +0 -92
- package/src/blocks/Jobs1.astro +0 -74
- package/src/blocks/Logos1.astro +0 -55
- package/src/blocks/Pages1.astro +0 -85
- package/src/blocks/Pricings1.astro +0 -61
- package/src/blocks/Products1.astro +0 -87
- package/src/blocks/Projects1.astro +0 -79
- package/src/blocks/Subheader.astro +0 -53
- package/src/components/Avatars.astro +0 -20
- package/src/components/Badges.astro +0 -20
- package/src/components/Block.astro +0 -46
- package/src/components/Cart.astro +0 -42
- package/src/components/CartAdd.svelte +0 -76
- package/src/components/CartCheckout.svelte +0 -58
- package/src/components/CartForm.svelte +0 -130
- package/src/components/CartList.svelte +0 -88
- package/src/components/CartQuantity.svelte +0 -81
- package/src/components/CartSummary.astro +0 -59
- package/src/components/CartTotal.svelte +0 -15
- package/src/components/Channel.astro +0 -89
- package/src/components/Channels.astro +0 -20
- package/src/components/Checkbox.astro +0 -76
- package/src/components/Element.astro +0 -70
- package/src/components/Field.astro +0 -33
- package/src/components/Fields.astro +0 -20
- package/src/components/Form.astro +0 -34
- package/src/components/Gallery.astro +0 -175
- package/src/components/Head.astro +0 -94
- package/src/components/Heading.astro +0 -91
- package/src/components/Input.astro +0 -115
- package/src/components/Label.astro +0 -42
- package/src/components/Links.astro +0 -20
- package/src/components/Paragraph.astro +0 -54
- package/src/components/Search.astro +0 -118
- package/src/components/Select.astro +0 -114
- package/src/components/Switch.astro +0 -81
- package/src/components/Tagline.astro +0 -49
- package/src/components/Textarea.astro +0 -78
- package/src/components/Toggle.astro +0 -45
- package/src/components/_Breadcrumb.astro +0 -58
- package/src/components/_Image.astro +0 -79
- package/src/components/_LocaleSwitcher.astro +0 -25
- package/src/content/config.ts +0 -18
- package/src/content/layouts/base.yml +0 -166
- package/src/content/pages/_base/toggle.mdx +0 -28
- package/src/content/pages/_posts/post.md +0 -7
- package/src/content/pages/_showcase/anti-slip-profiles.md +0 -5
- package/src/content/pages/_showcase/fulldev-ui.md +0 -5
- package/src/content/pages/_showcase/lavis-detailing.md +0 -5
- package/src/content/pages/_showcase/leren-trainingsacteren.md +0 -5
- package/src/content/pages/_showcase/miele-witgoedcenter-amsterdam.md +0 -5
- package/src/content/pages/_showcase/sloepverhuur-bolsward.md +0 -5
- package/src/content/pages/_showcase/stark-vulcanising-products.md +0 -4
- package/src/content/pages/_showcase/the-gym-haren.md +0 -5
- package/src/content/pages/_showcase/van-dillen-antieke-bouwmaterialen.md +0 -5
- package/src/content/pages/docs/blocks/_categories.mdx +0 -129
- package/src/content/pages/docs/blocks/_contact.mdx +0 -67
- package/src/content/pages/docs/blocks/_jobs.mdx +0 -34
- package/src/content/pages/docs/blocks/_posts.mdx +0 -45
- package/src/content/pages/docs/blocks/_stats.mdx +0 -32
- package/src/content/pages/docs/blocks/banner.mdx +0 -12
- package/src/content/pages/docs/blocks/colleagues.mdx +0 -49
- package/src/content/pages/docs/blocks/content.mdx +0 -316
- package/src/content/pages/docs/blocks/cta.mdx +0 -16
- package/src/content/pages/docs/blocks/features.mdx +0 -100
- package/src/content/pages/docs/blocks/footer.mdx +0 -46
- package/src/content/pages/docs/blocks/header.mdx +0 -60
- package/src/content/pages/docs/blocks/hero.mdx +0 -18
- package/src/content/pages/docs/blocks/intro.mdx +0 -16
- package/src/content/pages/docs/blocks/logos.mdx +0 -37
- package/src/content/pages/docs/blocks/projects.mdx +0 -36
- package/src/content/pages/docs/blocks/reviews.mdx +0 -65
- package/src/content/pages/docs/blocks.mdx +0 -52
- package/src/content/pages/docs/collections/images.mdx +0 -102
- package/src/content/pages/docs/collections/pages.mdx +0 -119
- package/src/content/pages/docs/collections/presets.mdx +0 -60
- package/src/content/pages/docs/components/_localeswitcher.mdx +0 -16
- package/src/content/pages/docs/components/_table.mdx +0 -101
- package/src/content/pages/docs/components/_tagline.mdx +0 -34
- package/src/content/pages/docs/components/_themer.mdx +0 -47
- package/src/content/pages/docs/components/_toggle.mdx +0 -30
- package/src/content/pages/docs/components/avatar.mdx +0 -32
- package/src/content/pages/docs/components/badge.mdx +0 -42
- package/src/content/pages/docs/components/badges.mdx +0 -33
- package/src/content/pages/docs/components/button.mdx +0 -76
- package/src/content/pages/docs/components/buttons.mdx +0 -50
- package/src/content/pages/docs/components/channel.mdx +0 -89
- package/src/content/pages/docs/components/channels.mdx +0 -90
- package/src/content/pages/docs/components/checkbox.mdx +0 -32
- package/src/content/pages/docs/components/heading.mdx +0 -49
- package/src/content/pages/docs/components/icon.mdx +0 -46
- package/src/content/pages/docs/components/image.mdx +0 -20
- package/src/content/pages/docs/components/input.mdx +0 -38
- package/src/content/pages/docs/components/label.mdx +0 -42
- package/src/content/pages/docs/components/link.mdx +0 -63
- package/src/content/pages/docs/components/links.mdx +0 -57
- package/src/content/pages/docs/components/list.mdx +0 -53
- package/src/content/pages/docs/components/logo.mdx +0 -24
- package/src/content/pages/docs/components/menu.mdx +0 -48
- package/src/content/pages/docs/components/paragraph.mdx +0 -44
- package/src/content/pages/docs/components/rating.mdx +0 -43
- package/src/content/pages/docs/components/select.mdx +0 -46
- package/src/content/pages/docs/components/social.mdx +0 -92
- package/src/content/pages/docs/components/socials.mdx +0 -103
- package/src/content/pages/docs/components/switch.mdx +0 -32
- package/src/content/pages/docs/components/tagline.mdx +0 -42
- package/src/content/pages/docs/components/textarea.mdx +0 -32
- package/src/content/pages/docs/components.mdx +0 -36
- package/src/content/pages/docs/customization.mdx +0 -183
- package/src/content/pages/docs/frameworks.mdx +0 -30
- package/src/content/pages/docs/index.mdx +0 -21
- package/src/content/pages/docs/installation.mdx +0 -30
- package/src/content/pages/docs/layouts/doc.mdx +0 -15
- package/src/content/pages/docs/layouts/page.mdx +0 -15
- package/src/content/pages/docs/pages.mdx +0 -130
- package/src/content/pages/docs/structures/_card.mdx +0 -84
- package/src/content/pages/docs/structures/_dialog.mdx +0 -15
- package/src/content/pages/docs/structures/_drawer.mdx +0 -15
- package/src/content/pages/docs/structures/card.mdx +0 -15
- package/src/content/pages/docs/structures/carousel.mdx +0 -14
- package/src/content/pages/docs/structures/code.mdx +0 -42
- package/src/content/pages/docs/structures/container.mdx +0 -15
- package/src/content/pages/docs/structures/drawer.mdx +0 -15
- package/src/content/pages/docs/structures/group.mdx +0 -15
- package/src/content/pages/docs/structures/layout.mdx +0 -15
- package/src/content/pages/docs/structures/masonry.mdx +0 -15
- package/src/content/pages/docs/structures/matrix.mdx +0 -15
- package/src/content/pages/docs/structures/panel.mdx +0 -15
- package/src/content/pages/docs/structures/prose.mdx +0 -33
- package/src/content/pages/docs/structures/section.mdx +0 -15
- package/src/content/pages/docs/structures/stack.mdx +0 -15
- package/src/content/pages/docs/structures/writeup.mdx +0 -15
- package/src/content/pages/docs/structures.mdx +0 -7
- package/src/content/pages/index.mdx +0 -52
- package/src/content/pages/showcase.mdx +0 -30
- package/src/css/custom.css +0 -24
- package/src/css/theme.css +0 -62
- package/src/env.d.ts +0 -3
- package/src/integration/index.ts +0 -185
- package/src/layouts/Page.astro +0 -64
- package/src/layouts/_Product.astro +0 -115
- package/src/pages/[...page].astro +0 -49
- package/src/pages/test.astro +0 -16
- package/src/schemas/badge.ts +0 -14
- package/src/schemas/block.ts +0 -42
- package/src/schemas/button.ts +0 -17
- package/src/schemas/card.ts +0 -43
- package/src/schemas/channel.ts +0 -15
- package/src/schemas/checkbox.ts +0 -13
- package/src/schemas/footer.ts +0 -17
- package/src/schemas/head.ts +0 -17
- package/src/schemas/image.ts +0 -53
- package/src/schemas/input.ts +0 -13
- package/src/schemas/link.ts +0 -14
- package/src/schemas/logo.ts +0 -13
- package/src/schemas/menu.ts +0 -11
- package/src/schemas/page.ts +0 -23
- package/src/schemas/proof.ts +0 -12
- package/src/schemas/textarea.ts +0 -11
- package/src/stores/cart.svelte.ts +0 -78
- package/src/stores/cart.ts +0 -76
- package/src/structures/Card.astro +0 -35
- package/src/structures/Carousel.astro +0 -106
- package/src/structures/Container.astro +0 -25
- package/src/structures/Drawer.astro +0 -81
- package/src/structures/Group.astro +0 -25
- package/src/structures/Layout.astro +0 -34
- package/src/structures/Masonry.astro +0 -42
- package/src/structures/Matrix.astro +0 -39
- package/src/structures/Panel.astro +0 -25
- package/src/structures/Prose.astro +0 -96
- package/src/structures/Section.astro +0 -26
- package/src/structures/Sidebar.astro +0 -36
- package/src/structures/Split.astro +0 -38
- package/src/structures/Stack.astro +0 -25
- package/src/structures/Writeup.astro +0 -67
- package/src/structures/_Bento.astro +0 -34
- package/src/utils/cart.ts +0 -27
- package/src/utils/getHref.ts +0 -6
- package/src/utils/slugify.ts +0 -6
- package/svelte.config.js +0 -5
- package/tailwind.config.ts +0 -72
- package/virtual.d.ts +0 -5
- /package/src/schemas/{path.ts → fields/path.ts} +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script setup lang="ts" generic="U extends ZodAny">
|
|
2
|
+
import type { ZodAny } from 'zod'
|
|
3
|
+
import type { Config, ConfigItem, Shape } from './interface'
|
|
4
|
+
import { computed } from 'vue'
|
|
5
|
+
import { DEFAULT_ZOD_HANDLERS, INPUT_COMPONENTS } from './constant'
|
|
6
|
+
import useDependencies from './dependencies'
|
|
7
|
+
|
|
8
|
+
const props = defineProps<{
|
|
9
|
+
fieldName: string
|
|
10
|
+
shape: Shape
|
|
11
|
+
config?: ConfigItem | Config<U>
|
|
12
|
+
}>()
|
|
13
|
+
|
|
14
|
+
function isValidConfig(config: any): config is ConfigItem {
|
|
15
|
+
return !!config?.component
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const delegatedProps = computed(() => {
|
|
19
|
+
if (['ZodObject', 'ZodArray'].includes(props.shape?.type))
|
|
20
|
+
return { schema: props.shape?.schema }
|
|
21
|
+
return undefined
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const { isDisabled, isHidden, isRequired, overrideOptions } = useDependencies(props.fieldName)
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<component
|
|
29
|
+
:is="isValidConfig(config)
|
|
30
|
+
? typeof config.component === 'string'
|
|
31
|
+
? INPUT_COMPONENTS[config.component!]
|
|
32
|
+
: config.component
|
|
33
|
+
: INPUT_COMPONENTS[DEFAULT_ZOD_HANDLERS[shape.type]] "
|
|
34
|
+
v-if="!isHidden"
|
|
35
|
+
:field-name="fieldName"
|
|
36
|
+
:label="shape.schema?.description"
|
|
37
|
+
:required="isRequired || shape.required"
|
|
38
|
+
:options="overrideOptions || shape.options"
|
|
39
|
+
:disabled="isDisabled"
|
|
40
|
+
:config="config"
|
|
41
|
+
v-bind="delegatedProps"
|
|
42
|
+
>
|
|
43
|
+
<slot />
|
|
44
|
+
</component>
|
|
45
|
+
</template>
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
<script setup lang="ts" generic="T extends z.ZodAny">
|
|
2
|
+
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from 'fulldev-ui/components/ui/accordion'
|
|
3
|
+
import { Button } from 'fulldev-ui/components/ui/button'
|
|
4
|
+
import { FormItem, FormMessage } from 'fulldev-ui/components/ui/form'
|
|
5
|
+
import { Separator } from 'fulldev-ui/components/ui/separator'
|
|
6
|
+
import { PlusIcon, TrashIcon } from 'lucide-vue-next'
|
|
7
|
+
import { FieldArray, FieldContextKey, useField } from 'vee-validate'
|
|
8
|
+
import { computed, provide } from 'vue'
|
|
9
|
+
import * as z from 'zod'
|
|
10
|
+
import AutoFormField from './AutoFormField.vue'
|
|
11
|
+
import AutoFormLabel from './AutoFormLabel.vue'
|
|
12
|
+
import type { Config, ConfigItem } from './interface'
|
|
13
|
+
import { beautifyObjectName, getBaseType } from './utils'
|
|
14
|
+
|
|
15
|
+
const props = defineProps<{
|
|
16
|
+
fieldName: string
|
|
17
|
+
required?: boolean
|
|
18
|
+
config?: Config<T>
|
|
19
|
+
schema?: z.ZodArray<T>
|
|
20
|
+
disabled?: boolean
|
|
21
|
+
}>()
|
|
22
|
+
|
|
23
|
+
function isZodArray(item: z.ZodArray<any> | z.ZodDefault<any>): item is z.ZodArray<any> {
|
|
24
|
+
return item instanceof z.ZodArray
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function isZodDefault(item: z.ZodArray<any> | z.ZodDefault<any>): item is z.ZodDefault<any> {
|
|
28
|
+
return item instanceof z.ZodDefault
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const itemShape = computed(() => {
|
|
32
|
+
if (!props.schema) return
|
|
33
|
+
|
|
34
|
+
const schema: z.ZodAny = isZodArray(props.schema)
|
|
35
|
+
? props.schema._def.type
|
|
36
|
+
: isZodDefault(props.schema)
|
|
37
|
+
? // @ts-expect-error missing schema
|
|
38
|
+
props.schema._def.innerType._def.type
|
|
39
|
+
: null
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
type: getBaseType(schema),
|
|
43
|
+
schema,
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
const fieldContext = useField(props.fieldName)
|
|
48
|
+
// @ts-expect-error ignore missing `id`
|
|
49
|
+
provide(FieldContextKey, fieldContext)
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<template>
|
|
53
|
+
<FieldArray
|
|
54
|
+
v-slot="{ fields, remove, push }"
|
|
55
|
+
as="section"
|
|
56
|
+
:name="fieldName"
|
|
57
|
+
>
|
|
58
|
+
<slot v-bind="props">
|
|
59
|
+
<Accordion
|
|
60
|
+
type="multiple"
|
|
61
|
+
class="w-full"
|
|
62
|
+
collapsible
|
|
63
|
+
:disabled="disabled"
|
|
64
|
+
as-child
|
|
65
|
+
>
|
|
66
|
+
<FormItem>
|
|
67
|
+
<AccordionItem
|
|
68
|
+
:value="fieldName"
|
|
69
|
+
class="border-none"
|
|
70
|
+
>
|
|
71
|
+
<AccordionTrigger>
|
|
72
|
+
<AutoFormLabel
|
|
73
|
+
class="text-base"
|
|
74
|
+
:required="required"
|
|
75
|
+
>
|
|
76
|
+
{{ schema?.description || beautifyObjectName(fieldName) }}
|
|
77
|
+
</AutoFormLabel>
|
|
78
|
+
</AccordionTrigger>
|
|
79
|
+
|
|
80
|
+
<AccordionContent>
|
|
81
|
+
<template
|
|
82
|
+
v-for="(field, index) of fields"
|
|
83
|
+
:key="field.key"
|
|
84
|
+
>
|
|
85
|
+
<div class="mb-4 p-1">
|
|
86
|
+
<AutoFormField
|
|
87
|
+
:field-name="`${fieldName}[${index}]`"
|
|
88
|
+
:label="fieldName"
|
|
89
|
+
:shape="itemShape!"
|
|
90
|
+
:config="config as ConfigItem"
|
|
91
|
+
/>
|
|
92
|
+
|
|
93
|
+
<div class="!my-4 flex justify-end">
|
|
94
|
+
<Button
|
|
95
|
+
type="button"
|
|
96
|
+
size="icon"
|
|
97
|
+
variant="secondary"
|
|
98
|
+
@click="remove(index)"
|
|
99
|
+
>
|
|
100
|
+
<TrashIcon :size="16" />
|
|
101
|
+
</Button>
|
|
102
|
+
</div>
|
|
103
|
+
<Separator v-if="!field.isLast" />
|
|
104
|
+
</div>
|
|
105
|
+
</template>
|
|
106
|
+
|
|
107
|
+
<Button
|
|
108
|
+
type="button"
|
|
109
|
+
variant="secondary"
|
|
110
|
+
class="mt-4 flex items-center"
|
|
111
|
+
@click="push(null)"
|
|
112
|
+
>
|
|
113
|
+
<PlusIcon
|
|
114
|
+
class="mr-2"
|
|
115
|
+
:size="16"
|
|
116
|
+
/>
|
|
117
|
+
Add
|
|
118
|
+
</Button>
|
|
119
|
+
</AccordionContent>
|
|
120
|
+
|
|
121
|
+
<FormMessage />
|
|
122
|
+
</AccordionItem>
|
|
123
|
+
</FormItem>
|
|
124
|
+
</Accordion>
|
|
125
|
+
</slot>
|
|
126
|
+
</FieldArray>
|
|
127
|
+
</template>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { Checkbox } from 'fulldev-ui/components/ui/checkbox'
|
|
3
|
+
import { FormControl, FormDescription, FormField, FormItem, FormMessage } from 'fulldev-ui/components/ui/form'
|
|
4
|
+
import { Switch } from 'fulldev-ui/components/ui/switch'
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
import AutoFormLabel from './AutoFormLabel.vue'
|
|
7
|
+
import type { FieldProps } from './interface'
|
|
8
|
+
import { beautifyObjectName, maybeBooleanishToBoolean } from './utils'
|
|
9
|
+
|
|
10
|
+
const props = defineProps<FieldProps>()
|
|
11
|
+
|
|
12
|
+
const booleanComponent = computed(() => (props.config?.component === 'switch' ? Switch : Checkbox))
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<FormField
|
|
17
|
+
v-slot="slotProps"
|
|
18
|
+
:name="fieldName"
|
|
19
|
+
>
|
|
20
|
+
<FormItem>
|
|
21
|
+
<div class="space-y-0 mb-3 flex items-center gap-3">
|
|
22
|
+
<FormControl>
|
|
23
|
+
<slot v-bind="slotProps">
|
|
24
|
+
<component
|
|
25
|
+
:is="booleanComponent"
|
|
26
|
+
v-bind="{ ...slotProps.componentField }"
|
|
27
|
+
:disabled="maybeBooleanishToBoolean(config?.inputProps?.disabled) ?? disabled"
|
|
28
|
+
:checked="slotProps.componentField.modelValue"
|
|
29
|
+
@update:checked="slotProps.componentField['onUpdate:modelValue']"
|
|
30
|
+
/>
|
|
31
|
+
</slot>
|
|
32
|
+
</FormControl>
|
|
33
|
+
<AutoFormLabel
|
|
34
|
+
v-if="!config?.hideLabel"
|
|
35
|
+
:required="required"
|
|
36
|
+
>
|
|
37
|
+
{{ config?.label || beautifyObjectName(label ?? fieldName) }}
|
|
38
|
+
</AutoFormLabel>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<FormDescription v-if="config?.description">
|
|
42
|
+
{{ config.description }}
|
|
43
|
+
</FormDescription>
|
|
44
|
+
<FormMessage />
|
|
45
|
+
</FormItem>
|
|
46
|
+
</FormField>
|
|
47
|
+
</template>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { Button } from 'fulldev-ui/components/ui/button'
|
|
3
|
+
import { Calendar } from 'fulldev-ui/components/ui/calendar'
|
|
4
|
+
import { FormControl, FormDescription, FormField, FormItem, FormMessage } from 'fulldev-ui/components/ui/form'
|
|
5
|
+
import { Popover, PopoverContent, PopoverTrigger } from 'fulldev-ui/components/ui/popover'
|
|
6
|
+
import { cn } from 'fulldev-ui/lib/utils'
|
|
7
|
+
import type { FieldProps } from './interface'
|
|
8
|
+
|
|
9
|
+
import { DateFormatter, getLocalTimeZone } from '@internationalized/date'
|
|
10
|
+
import { CalendarIcon } from 'lucide-vue-next'
|
|
11
|
+
import AutoFormLabel from './AutoFormLabel.vue'
|
|
12
|
+
import { beautifyObjectName, maybeBooleanishToBoolean } from './utils'
|
|
13
|
+
|
|
14
|
+
defineProps<FieldProps>()
|
|
15
|
+
|
|
16
|
+
const df = new DateFormatter('en-US', {
|
|
17
|
+
dateStyle: 'long',
|
|
18
|
+
})
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<FormField
|
|
23
|
+
v-slot="slotProps"
|
|
24
|
+
:name="fieldName"
|
|
25
|
+
>
|
|
26
|
+
<FormItem>
|
|
27
|
+
<AutoFormLabel
|
|
28
|
+
v-if="!config?.hideLabel"
|
|
29
|
+
:required="required"
|
|
30
|
+
>
|
|
31
|
+
{{ config?.label || beautifyObjectName(label ?? fieldName) }}
|
|
32
|
+
</AutoFormLabel>
|
|
33
|
+
<FormControl>
|
|
34
|
+
<slot v-bind="slotProps">
|
|
35
|
+
<div>
|
|
36
|
+
<Popover>
|
|
37
|
+
<PopoverTrigger
|
|
38
|
+
as-child
|
|
39
|
+
:disabled="maybeBooleanishToBoolean(config?.inputProps?.disabled) ?? disabled"
|
|
40
|
+
>
|
|
41
|
+
<Button
|
|
42
|
+
variant="outline"
|
|
43
|
+
:class="
|
|
44
|
+
cn(
|
|
45
|
+
'w-full justify-start text-left font-normal',
|
|
46
|
+
!slotProps.componentField.modelValue && 'text-muted-foreground'
|
|
47
|
+
)
|
|
48
|
+
"
|
|
49
|
+
>
|
|
50
|
+
<CalendarIcon
|
|
51
|
+
class="mr-2 h-4 w-4"
|
|
52
|
+
:size="16"
|
|
53
|
+
/>
|
|
54
|
+
{{
|
|
55
|
+
slotProps.componentField.modelValue
|
|
56
|
+
? df.format(slotProps.componentField.modelValue.toDate(getLocalTimeZone()))
|
|
57
|
+
: 'Pick a date'
|
|
58
|
+
}}
|
|
59
|
+
</Button>
|
|
60
|
+
</PopoverTrigger>
|
|
61
|
+
<PopoverContent class="w-auto p-0">
|
|
62
|
+
<Calendar
|
|
63
|
+
initial-focus
|
|
64
|
+
v-bind="slotProps.componentField"
|
|
65
|
+
/>
|
|
66
|
+
</PopoverContent>
|
|
67
|
+
</Popover>
|
|
68
|
+
</div>
|
|
69
|
+
</slot>
|
|
70
|
+
</FormControl>
|
|
71
|
+
|
|
72
|
+
<FormDescription v-if="config?.description">
|
|
73
|
+
{{ config.description }}
|
|
74
|
+
</FormDescription>
|
|
75
|
+
<FormMessage />
|
|
76
|
+
</FormItem>
|
|
77
|
+
</FormField>
|
|
78
|
+
</template>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { FormControl, FormDescription, FormField, FormItem, FormMessage } from 'fulldev-ui/components/ui/form'
|
|
3
|
+
import { Label } from 'fulldev-ui/components/ui/label'
|
|
4
|
+
import { RadioGroup, RadioGroupItem } from 'fulldev-ui/components/ui/radio-group'
|
|
5
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from 'fulldev-ui/components/ui/select'
|
|
6
|
+
import AutoFormLabel from './AutoFormLabel.vue'
|
|
7
|
+
import type { FieldProps } from './interface'
|
|
8
|
+
import { beautifyObjectName, maybeBooleanishToBoolean } from './utils'
|
|
9
|
+
|
|
10
|
+
defineProps<
|
|
11
|
+
FieldProps & {
|
|
12
|
+
options?: string[]
|
|
13
|
+
}
|
|
14
|
+
>()
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<FormField
|
|
19
|
+
v-slot="slotProps"
|
|
20
|
+
:name="fieldName"
|
|
21
|
+
>
|
|
22
|
+
<FormItem>
|
|
23
|
+
<AutoFormLabel
|
|
24
|
+
v-if="!config?.hideLabel"
|
|
25
|
+
:required="required"
|
|
26
|
+
>
|
|
27
|
+
{{ config?.label || beautifyObjectName(label ?? fieldName) }}
|
|
28
|
+
</AutoFormLabel>
|
|
29
|
+
<FormControl>
|
|
30
|
+
<slot v-bind="slotProps">
|
|
31
|
+
<RadioGroup
|
|
32
|
+
v-if="config?.component === 'radio'"
|
|
33
|
+
:disabled="maybeBooleanishToBoolean(config?.inputProps?.disabled) ?? disabled"
|
|
34
|
+
:orientation="'vertical'"
|
|
35
|
+
v-bind="{ ...slotProps.componentField }"
|
|
36
|
+
>
|
|
37
|
+
<div
|
|
38
|
+
v-for="(option, index) in options"
|
|
39
|
+
:key="option"
|
|
40
|
+
class="mb-2 flex items-center gap-3 space-y-0"
|
|
41
|
+
>
|
|
42
|
+
<RadioGroupItem
|
|
43
|
+
:id="`${option}-${index}`"
|
|
44
|
+
:value="option"
|
|
45
|
+
/>
|
|
46
|
+
<Label :for="`${option}-${index}`">{{ beautifyObjectName(option) }}</Label>
|
|
47
|
+
</div>
|
|
48
|
+
</RadioGroup>
|
|
49
|
+
|
|
50
|
+
<Select
|
|
51
|
+
v-else
|
|
52
|
+
:disabled="maybeBooleanishToBoolean(config?.inputProps?.disabled) ?? disabled"
|
|
53
|
+
v-bind="{ ...slotProps.componentField }"
|
|
54
|
+
>
|
|
55
|
+
<SelectTrigger class="w-full">
|
|
56
|
+
<SelectValue :placeholder="config?.inputProps?.placeholder" />
|
|
57
|
+
</SelectTrigger>
|
|
58
|
+
<SelectContent>
|
|
59
|
+
<SelectItem
|
|
60
|
+
v-for="option in options"
|
|
61
|
+
:key="option"
|
|
62
|
+
:value="option"
|
|
63
|
+
>
|
|
64
|
+
{{ beautifyObjectName(option) }}
|
|
65
|
+
</SelectItem>
|
|
66
|
+
</SelectContent>
|
|
67
|
+
</Select>
|
|
68
|
+
</slot>
|
|
69
|
+
</FormControl>
|
|
70
|
+
|
|
71
|
+
<FormDescription v-if="config?.description">
|
|
72
|
+
{{ config.description }}
|
|
73
|
+
</FormDescription>
|
|
74
|
+
<FormMessage />
|
|
75
|
+
</FormItem>
|
|
76
|
+
</FormField>
|
|
77
|
+
</template>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { Button } from 'fulldev-ui/components/ui/button'
|
|
3
|
+
import { FormControl, FormDescription, FormField, FormItem, FormMessage } from 'fulldev-ui/components/ui/form'
|
|
4
|
+
import { Input } from 'fulldev-ui/components/ui/input'
|
|
5
|
+
import { TrashIcon } from 'lucide-vue-next'
|
|
6
|
+
import { ref } from 'vue'
|
|
7
|
+
import AutoFormLabel from './AutoFormLabel.vue'
|
|
8
|
+
import type { FieldProps } from './interface'
|
|
9
|
+
import { beautifyObjectName } from './utils'
|
|
10
|
+
|
|
11
|
+
defineProps<FieldProps>()
|
|
12
|
+
|
|
13
|
+
const inputFile = ref<File>()
|
|
14
|
+
async function parseFileAsString(file: File | undefined): Promise<string> {
|
|
15
|
+
return new Promise((resolve, reject) => {
|
|
16
|
+
if (file) {
|
|
17
|
+
const reader = new FileReader()
|
|
18
|
+
reader.onloadend = () => {
|
|
19
|
+
resolve(reader.result as string)
|
|
20
|
+
}
|
|
21
|
+
reader.onerror = (err) => {
|
|
22
|
+
reject(err)
|
|
23
|
+
}
|
|
24
|
+
reader.readAsDataURL(file)
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<FormField
|
|
32
|
+
v-slot="slotProps"
|
|
33
|
+
:name="fieldName"
|
|
34
|
+
>
|
|
35
|
+
<FormItem v-bind="$attrs">
|
|
36
|
+
<AutoFormLabel
|
|
37
|
+
v-if="!config?.hideLabel"
|
|
38
|
+
:required="required"
|
|
39
|
+
>
|
|
40
|
+
{{ config?.label || beautifyObjectName(label ?? fieldName) }}
|
|
41
|
+
</AutoFormLabel>
|
|
42
|
+
<FormControl>
|
|
43
|
+
<slot v-bind="slotProps">
|
|
44
|
+
<Input
|
|
45
|
+
v-if="!inputFile"
|
|
46
|
+
type="file"
|
|
47
|
+
v-bind="{ ...config?.inputProps }"
|
|
48
|
+
:disabled="config?.inputProps?.disabled ?? disabled"
|
|
49
|
+
@change="
|
|
50
|
+
async (ev: InputEvent) => {
|
|
51
|
+
const file = (ev.target as HTMLInputElement).files?.[0]
|
|
52
|
+
inputFile = file
|
|
53
|
+
const parsed = await parseFileAsString(file)
|
|
54
|
+
slotProps.componentField.onInput(parsed)
|
|
55
|
+
}
|
|
56
|
+
"
|
|
57
|
+
/>
|
|
58
|
+
<div
|
|
59
|
+
v-else
|
|
60
|
+
class="flex h-10 w-full items-center justify-between rounded-md border border-input bg-transparent pl-3 pr-1 py-1 text-sm shadow-sm transition-colors"
|
|
61
|
+
>
|
|
62
|
+
<p>{{ inputFile?.name }}</p>
|
|
63
|
+
<Button
|
|
64
|
+
:size="'icon'"
|
|
65
|
+
:variant="'ghost'"
|
|
66
|
+
class="h-[26px] w-[26px]"
|
|
67
|
+
aria-label="Remove file"
|
|
68
|
+
type="button"
|
|
69
|
+
@click="
|
|
70
|
+
() => {
|
|
71
|
+
inputFile = undefined
|
|
72
|
+
slotProps.componentField.onInput(undefined)
|
|
73
|
+
}
|
|
74
|
+
"
|
|
75
|
+
>
|
|
76
|
+
<TrashIcon :size="16" />
|
|
77
|
+
</Button>
|
|
78
|
+
</div>
|
|
79
|
+
</slot>
|
|
80
|
+
</FormControl>
|
|
81
|
+
<FormDescription v-if="config?.description">
|
|
82
|
+
{{ config.description }}
|
|
83
|
+
</FormDescription>
|
|
84
|
+
<FormMessage />
|
|
85
|
+
</FormItem>
|
|
86
|
+
</FormField>
|
|
87
|
+
</template>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { FormControl, FormDescription, FormField, FormItem, FormMessage } from 'fulldev-ui/components/ui/form'
|
|
3
|
+
import { Input } from 'fulldev-ui/components/ui/input'
|
|
4
|
+
import { Textarea } from 'fulldev-ui/components/ui/textarea'
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
import AutoFormLabel from './AutoFormLabel.vue'
|
|
7
|
+
import type { FieldProps } from './interface'
|
|
8
|
+
import { beautifyObjectName } from './utils'
|
|
9
|
+
|
|
10
|
+
const props = defineProps<FieldProps>()
|
|
11
|
+
const inputComponent = computed(() => (props.config?.component === 'textarea' ? Textarea : Input))
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<FormField
|
|
16
|
+
v-slot="slotProps"
|
|
17
|
+
:name="fieldName"
|
|
18
|
+
>
|
|
19
|
+
<FormItem v-bind="$attrs">
|
|
20
|
+
<AutoFormLabel
|
|
21
|
+
v-if="!config?.hideLabel"
|
|
22
|
+
:required="required"
|
|
23
|
+
>
|
|
24
|
+
{{ config?.label || beautifyObjectName(label ?? fieldName) }}
|
|
25
|
+
</AutoFormLabel>
|
|
26
|
+
<FormControl>
|
|
27
|
+
<slot v-bind="slotProps">
|
|
28
|
+
<component
|
|
29
|
+
:is="inputComponent"
|
|
30
|
+
type="text"
|
|
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>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { FormControl, FormDescription, FormField, FormItem, FormMessage } from 'fulldev-ui/components/ui/form'
|
|
3
|
+
import { Input } from 'fulldev-ui/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>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<script setup lang="ts" generic="T extends ZodRawShape">
|
|
2
|
+
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from 'fulldev-ui/components/ui/accordion'
|
|
3
|
+
import { FormItem } from 'fulldev-ui/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>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { FormLabel } from 'fulldev-ui/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>
|