@nuxt/ui 4.7.1 → 4.8.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/.nuxt/{ui.css → ui.static.css} +0 -10
- package/LICENSE.md +1 -1
- package/cli/commands/make/component.mjs +6 -2
- package/cli/templates.mjs +46 -20
- package/cli/utils.mjs +19 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +4 -4
- package/dist/runtime/components/Accordion.vue +15 -14
- package/dist/runtime/components/Alert.vue +20 -20
- package/dist/runtime/components/AuthForm.vue +37 -37
- package/dist/runtime/components/Avatar.d.vue.ts +4 -0
- package/dist/runtime/components/Avatar.vue +14 -12
- package/dist/runtime/components/Avatar.vue.d.ts +4 -0
- package/dist/runtime/components/AvatarGroup.d.vue.ts +4 -0
- package/dist/runtime/components/AvatarGroup.vue +11 -8
- package/dist/runtime/components/AvatarGroup.vue.d.ts +4 -0
- package/dist/runtime/components/Badge.vue +11 -11
- package/dist/runtime/components/Banner.vue +25 -23
- package/dist/runtime/components/BlogPost.d.vue.ts +1 -1
- package/dist/runtime/components/BlogPost.vue +30 -28
- package/dist/runtime/components/BlogPost.vue.d.ts +1 -1
- package/dist/runtime/components/BlogPosts.vue +6 -6
- package/dist/runtime/components/Breadcrumb.d.vue.ts +4 -0
- package/dist/runtime/components/Breadcrumb.vue +21 -18
- package/dist/runtime/components/Breadcrumb.vue.d.ts +4 -0
- package/dist/runtime/components/Button.vue +16 -16
- package/dist/runtime/components/Calendar.vue +21 -20
- package/dist/runtime/components/Card.vue +11 -11
- package/dist/runtime/components/Carousel.vue +23 -22
- package/dist/runtime/components/ChangelogVersion.vue +31 -29
- package/dist/runtime/components/ChangelogVersions.vue +8 -8
- package/dist/runtime/components/ChatMessage.d.vue.ts +6 -0
- package/dist/runtime/components/ChatMessage.vue +46 -36
- package/dist/runtime/components/ChatMessage.vue.d.ts +6 -0
- package/dist/runtime/components/ChatMessages.vue +14 -14
- package/dist/runtime/components/ChatPalette.vue +6 -6
- package/dist/runtime/components/ChatPrompt.d.vue.ts +7 -0
- package/dist/runtime/components/ChatPrompt.vue +22 -12
- package/dist/runtime/components/ChatPrompt.vue.d.ts +7 -0
- package/dist/runtime/components/ChatPromptSubmit.d.vue.ts +3 -3
- package/dist/runtime/components/ChatPromptSubmit.vue +6 -6
- package/dist/runtime/components/ChatPromptSubmit.vue.d.ts +3 -3
- package/dist/runtime/components/ChatReasoning.vue +20 -20
- package/dist/runtime/components/ChatShimmer.vue +7 -7
- package/dist/runtime/components/ChatTool.d.vue.ts +1 -1
- package/dist/runtime/components/ChatTool.vue +19 -19
- package/dist/runtime/components/ChatTool.vue.d.ts +1 -1
- package/dist/runtime/components/Checkbox.d.vue.ts +2 -0
- package/dist/runtime/components/Checkbox.vue +25 -24
- package/dist/runtime/components/Checkbox.vue.d.ts +2 -0
- package/dist/runtime/components/CheckboxGroup.d.vue.ts +1 -1
- package/dist/runtime/components/CheckboxGroup.vue +17 -14
- package/dist/runtime/components/CheckboxGroup.vue.d.ts +1 -1
- package/dist/runtime/components/Chip.vue +8 -8
- package/dist/runtime/components/Collapsible.vue +8 -7
- package/dist/runtime/components/ColorPicker.d.vue.ts +2 -0
- package/dist/runtime/components/ColorPicker.vue +10 -10
- package/dist/runtime/components/ColorPicker.vue.d.ts +2 -0
- package/dist/runtime/components/CommandPalette.d.vue.ts +5 -5
- package/dist/runtime/components/CommandPalette.vue +92 -69
- package/dist/runtime/components/CommandPalette.vue.d.ts +5 -5
- package/dist/runtime/components/Container.vue +4 -4
- package/dist/runtime/components/ContextMenu.vue +16 -15
- package/dist/runtime/components/DashboardGroup.d.vue.ts +1 -1
- package/dist/runtime/components/DashboardGroup.vue +6 -4
- package/dist/runtime/components/DashboardGroup.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardNavbar.vue +16 -16
- package/dist/runtime/components/DashboardPanel.vue +7 -7
- package/dist/runtime/components/DashboardResizeHandle.vue +5 -5
- package/dist/runtime/components/DashboardSearch.d.vue.ts +16 -1
- package/dist/runtime/components/DashboardSearch.vue +25 -12
- package/dist/runtime/components/DashboardSearch.vue.d.ts +16 -1
- package/dist/runtime/components/DashboardSearchButton.d.vue.ts +2 -2
- package/dist/runtime/components/DashboardSearchButton.vue +15 -15
- package/dist/runtime/components/DashboardSearchButton.vue.d.ts +2 -2
- package/dist/runtime/components/DashboardSidebar.d.vue.ts +1 -1
- package/dist/runtime/components/DashboardSidebar.vue +22 -22
- package/dist/runtime/components/DashboardSidebar.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardSidebarCollapse.d.vue.ts +1 -1
- package/dist/runtime/components/DashboardSidebarCollapse.vue +5 -5
- package/dist/runtime/components/DashboardSidebarCollapse.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardSidebarToggle.d.vue.ts +1 -1
- package/dist/runtime/components/DashboardSidebarToggle.vue +5 -5
- package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardToolbar.vue +6 -6
- package/dist/runtime/components/Drawer.d.vue.ts +1 -1
- package/dist/runtime/components/Drawer.vue +23 -22
- package/dist/runtime/components/Drawer.vue.d.ts +1 -1
- package/dist/runtime/components/DropdownMenu.vue +21 -20
- package/dist/runtime/components/Editor.vue +8 -7
- package/dist/runtime/components/EditorDragHandle.d.vue.ts +2 -2
- package/dist/runtime/components/EditorDragHandle.vue +9 -8
- package/dist/runtime/components/EditorDragHandle.vue.d.ts +2 -2
- package/dist/runtime/components/EditorToolbar.vue +10 -9
- package/dist/runtime/components/Empty.vue +14 -14
- package/dist/runtime/components/Error.d.vue.ts +9 -1
- package/dist/runtime/components/Error.vue +17 -10
- package/dist/runtime/components/Error.vue.d.ts +9 -1
- package/dist/runtime/components/FieldGroup.vue +4 -4
- package/dist/runtime/components/FileUpload.vue +36 -37
- package/dist/runtime/components/Footer.vue +10 -10
- package/dist/runtime/components/FooterColumns.vue +15 -15
- package/dist/runtime/components/Form.d.vue.ts +1 -1
- package/dist/runtime/components/Form.vue +6 -5
- package/dist/runtime/components/Form.vue.d.ts +1 -1
- package/dist/runtime/components/FormField.d.vue.ts +1 -0
- package/dist/runtime/components/FormField.vue +21 -21
- package/dist/runtime/components/FormField.vue.d.ts +1 -0
- package/dist/runtime/components/Header.vue +19 -19
- package/dist/runtime/components/Icon.vue +2 -1
- package/dist/runtime/components/Input.vue +19 -19
- package/dist/runtime/components/InputDate.vue +21 -20
- package/dist/runtime/components/InputMenu.d.vue.ts +52 -51
- package/dist/runtime/components/InputMenu.vue +66 -63
- package/dist/runtime/components/InputMenu.vue.d.ts +52 -51
- package/dist/runtime/components/InputNumber.vue +25 -24
- package/dist/runtime/components/InputTags.vue +26 -25
- package/dist/runtime/components/InputTime.vue +21 -20
- package/dist/runtime/components/Kbd.vue +5 -5
- package/dist/runtime/components/Link.d.vue.ts +2 -2
- package/dist/runtime/components/Link.vue.d.ts +2 -2
- package/dist/runtime/components/LinkBase.d.vue.ts +1 -1
- package/dist/runtime/components/LinkBase.vue.d.ts +1 -1
- package/dist/runtime/components/Listbox.d.vue.ts +13 -9
- package/dist/runtime/components/Listbox.vue +34 -32
- package/dist/runtime/components/Listbox.vue.d.ts +13 -9
- package/dist/runtime/components/Main.vue +4 -4
- package/dist/runtime/components/Marquee.vue +5 -5
- package/dist/runtime/components/Modal.d.vue.ts +2 -2
- package/dist/runtime/components/Modal.vue +25 -24
- package/dist/runtime/components/Modal.vue.d.ts +2 -2
- package/dist/runtime/components/NavigationMenu.vue +66 -65
- package/dist/runtime/components/Page.vue +7 -7
- package/dist/runtime/components/PageAnchors.vue +11 -11
- package/dist/runtime/components/PageAside.vue +9 -9
- package/dist/runtime/components/PageBody.vue +4 -4
- package/dist/runtime/components/PageCTA.vue +18 -16
- package/dist/runtime/components/PageCard.vue +25 -23
- package/dist/runtime/components/PageColumns.vue +4 -4
- package/dist/runtime/components/PageFeature.vue +17 -15
- package/dist/runtime/components/PageGrid.vue +4 -4
- package/dist/runtime/components/PageHeader.vue +14 -14
- package/dist/runtime/components/PageHero.vue +20 -18
- package/dist/runtime/components/PageLinks.vue +12 -12
- package/dist/runtime/components/PageList.vue +4 -4
- package/dist/runtime/components/PageLogos.vue +16 -16
- package/dist/runtime/components/PageSection.d.vue.ts +1 -1
- package/dist/runtime/components/PageSection.vue +24 -22
- package/dist/runtime/components/PageSection.vue.d.ts +1 -1
- package/dist/runtime/components/Pagination.d.vue.ts +2 -2
- package/dist/runtime/components/Pagination.vue +23 -22
- package/dist/runtime/components/Pagination.vue.d.ts +2 -2
- package/dist/runtime/components/PinInput.vue +15 -14
- package/dist/runtime/components/Popover.vue +9 -8
- package/dist/runtime/components/PricingPlan.vue +36 -36
- package/dist/runtime/components/PricingPlans.vue +6 -6
- package/dist/runtime/components/PricingTable.vue +44 -44
- package/dist/runtime/components/Progress.d.vue.ts +1 -1
- package/dist/runtime/components/Progress.vue +12 -11
- package/dist/runtime/components/Progress.vue.d.ts +1 -1
- package/dist/runtime/components/RadioGroup.d.vue.ts +2 -0
- package/dist/runtime/components/RadioGroup.vue +28 -27
- package/dist/runtime/components/RadioGroup.vue.d.ts +2 -0
- package/dist/runtime/components/ScrollArea.vue +13 -13
- package/dist/runtime/components/Select.vue +38 -40
- package/dist/runtime/components/SelectMenu.d.vue.ts +46 -46
- package/dist/runtime/components/SelectMenu.vue +49 -48
- package/dist/runtime/components/SelectMenu.vue.d.ts +46 -46
- package/dist/runtime/components/Separator.d.vue.ts +9 -3
- package/dist/runtime/components/Separator.vue +29 -16
- package/dist/runtime/components/Separator.vue.d.ts +9 -3
- package/dist/runtime/components/Sidebar.vue +28 -28
- package/dist/runtime/components/Skeleton.vue +5 -5
- package/dist/runtime/components/Slideover.d.vue.ts +3 -3
- package/dist/runtime/components/Slideover.vue +24 -23
- package/dist/runtime/components/Slideover.vue.d.ts +3 -3
- package/dist/runtime/components/Slider.vue +16 -15
- package/dist/runtime/components/Stepper.vue +19 -18
- package/dist/runtime/components/Switch.d.vue.ts +2 -0
- package/dist/runtime/components/Switch.vue +26 -23
- package/dist/runtime/components/Switch.vue.d.ts +2 -0
- package/dist/runtime/components/Table.vue +26 -25
- package/dist/runtime/components/Tabs.vue +22 -21
- package/dist/runtime/components/Textarea.vue +19 -18
- package/dist/runtime/components/Theme.d.vue.ts +13 -5
- package/dist/runtime/components/Theme.vue +32 -4
- package/dist/runtime/components/Theme.vue.d.ts +13 -5
- package/dist/runtime/components/Timeline.vue +15 -15
- package/dist/runtime/components/Toast.vue +35 -34
- package/dist/runtime/components/Toaster.d.vue.ts +1 -1
- package/dist/runtime/components/Toaster.vue +10 -9
- package/dist/runtime/components/Toaster.vue.d.ts +1 -1
- package/dist/runtime/components/Tooltip.vue +13 -12
- package/dist/runtime/components/Tree.vue +24 -23
- package/dist/runtime/components/User.vue +23 -21
- package/dist/runtime/components/color-mode/ColorModeAvatar.vue +5 -2
- package/dist/runtime/components/color-mode/ColorModeButton.d.vue.ts +1 -1
- package/dist/runtime/components/color-mode/ColorModeButton.vue +8 -6
- package/dist/runtime/components/color-mode/ColorModeButton.vue.d.ts +1 -1
- package/dist/runtime/components/color-mode/ColorModeImage.vue +4 -2
- package/dist/runtime/components/color-mode/ColorModeSwitch.vue +1 -0
- package/dist/runtime/components/content/ContentNavigation.vue +31 -30
- package/dist/runtime/components/content/ContentSearch.d.vue.ts +31 -4
- package/dist/runtime/components/content/ContentSearch.vue +78 -33
- package/dist/runtime/components/content/ContentSearch.vue.d.ts +31 -4
- package/dist/runtime/components/content/ContentSearchButton.d.vue.ts +2 -2
- package/dist/runtime/components/content/ContentSearchButton.vue +15 -15
- package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +2 -2
- package/dist/runtime/components/content/ContentSurround.vue +14 -12
- package/dist/runtime/components/content/ContentToc.vue +34 -33
- package/dist/runtime/components/prose/A.vue +4 -4
- package/dist/runtime/components/prose/Accordion.vue +4 -4
- package/dist/runtime/components/prose/AccordionItem.vue +5 -5
- package/dist/runtime/components/prose/Badge.vue +4 -4
- package/dist/runtime/components/prose/Blockquote.vue +4 -4
- package/dist/runtime/components/prose/Callout.vue +8 -8
- package/dist/runtime/components/prose/Card.vue +12 -12
- package/dist/runtime/components/prose/CardGroup.vue +4 -4
- package/dist/runtime/components/prose/Code.vue +4 -4
- package/dist/runtime/components/prose/CodeCollapse.vue +8 -8
- package/dist/runtime/components/prose/CodeGroup.vue +9 -9
- package/dist/runtime/components/prose/CodePreview.vue +6 -6
- package/dist/runtime/components/prose/CodeTree.vue +14 -14
- package/dist/runtime/components/prose/Collapsible.vue +7 -7
- package/dist/runtime/components/prose/Em.vue +4 -4
- package/dist/runtime/components/prose/Field.vue +13 -13
- package/dist/runtime/components/prose/FieldGroup.vue +4 -4
- package/dist/runtime/components/prose/H1.vue +5 -5
- package/dist/runtime/components/prose/H2.vue +7 -7
- package/dist/runtime/components/prose/H3.vue +7 -7
- package/dist/runtime/components/prose/H4.vue +5 -5
- package/dist/runtime/components/prose/Hr.vue +4 -4
- package/dist/runtime/components/prose/Icon.vue +4 -4
- package/dist/runtime/components/prose/Img.vue +12 -12
- package/dist/runtime/components/prose/Kbd.d.vue.ts +10 -2
- package/dist/runtime/components/prose/Kbd.vue +8 -5
- package/dist/runtime/components/prose/Kbd.vue.d.ts +10 -2
- package/dist/runtime/components/prose/Li.vue +4 -4
- package/dist/runtime/components/prose/Ol.vue +4 -4
- package/dist/runtime/components/prose/P.vue +4 -4
- package/dist/runtime/components/prose/Pre.vue +9 -9
- package/dist/runtime/components/prose/Prompt.vue +12 -12
- package/dist/runtime/components/prose/Steps.vue +4 -4
- package/dist/runtime/components/prose/Strong.vue +4 -4
- package/dist/runtime/components/prose/Table.vue +5 -5
- package/dist/runtime/components/prose/Tabs.vue +4 -4
- package/dist/runtime/components/prose/TabsItem.vue +5 -5
- package/dist/runtime/components/prose/Tbody.vue +4 -4
- package/dist/runtime/components/prose/Td.vue +4 -4
- package/dist/runtime/components/prose/Th.vue +4 -4
- package/dist/runtime/components/prose/Thead.vue +4 -4
- package/dist/runtime/components/prose/Tr.vue +4 -4
- package/dist/runtime/components/prose/Ul.vue +4 -4
- package/dist/runtime/composables/defineShortcuts.js +7 -2
- package/dist/runtime/composables/index.d.ts +1 -2
- package/dist/runtime/composables/index.js +1 -2
- package/dist/runtime/composables/useAvatarGroup.d.ts +12 -1
- package/dist/runtime/composables/useAvatarGroup.js +4 -2
- package/dist/runtime/composables/useComponentIcons.js +1 -1
- package/dist/runtime/composables/useComponentProps.d.ts +180 -0
- package/dist/runtime/composables/useComponentProps.js +59 -0
- package/dist/runtime/composables/useContentSearch.d.ts +4 -2
- package/dist/runtime/composables/useContentSearch.js +64 -7
- package/dist/runtime/composables/useFieldGroup.d.ts +9 -1
- package/dist/runtime/composables/useFormField.d.ts +21 -1
- package/dist/runtime/composables/useForwardProps.d.ts +13 -0
- package/dist/runtime/composables/useForwardProps.js +14 -0
- package/dist/runtime/composables/usePrefix.d.ts +6 -0
- package/dist/runtime/composables/usePrefix.js +11 -0
- package/dist/runtime/composables/useResizable.d.ts +4 -0
- package/dist/runtime/composables/useResizable.js +1 -1
- package/dist/runtime/locale/ar.js +1 -0
- package/dist/runtime/locale/az.js +1 -0
- package/dist/runtime/locale/be.js +1 -0
- package/dist/runtime/locale/bg.js +1 -0
- package/dist/runtime/locale/bn.js +1 -0
- package/dist/runtime/locale/ca.js +1 -0
- package/dist/runtime/locale/ckb.js +1 -0
- package/dist/runtime/locale/cs.js +1 -0
- package/dist/runtime/locale/da.js +1 -0
- package/dist/runtime/locale/de.js +1 -0
- package/dist/runtime/locale/de_ch.js +1 -0
- package/dist/runtime/locale/el.js +1 -0
- package/dist/runtime/locale/en.js +1 -0
- package/dist/runtime/locale/es.js +1 -0
- package/dist/runtime/locale/et.js +1 -0
- package/dist/runtime/locale/eu.js +1 -0
- package/dist/runtime/locale/fa_ir.js +1 -0
- package/dist/runtime/locale/fi.js +1 -0
- package/dist/runtime/locale/fr.js +1 -0
- package/dist/runtime/locale/gl.js +1 -0
- package/dist/runtime/locale/he.js +1 -0
- package/dist/runtime/locale/hi.js +1 -0
- package/dist/runtime/locale/hr.js +1 -0
- package/dist/runtime/locale/hu.js +1 -0
- package/dist/runtime/locale/hy.js +1 -0
- package/dist/runtime/locale/id.js +1 -0
- package/dist/runtime/locale/is.js +1 -0
- package/dist/runtime/locale/it.js +1 -0
- package/dist/runtime/locale/ja.js +1 -0
- package/dist/runtime/locale/ka.js +1 -0
- package/dist/runtime/locale/kk.js +1 -0
- package/dist/runtime/locale/km.js +1 -0
- package/dist/runtime/locale/ko.js +1 -0
- package/dist/runtime/locale/ky.js +1 -0
- package/dist/runtime/locale/lb.js +1 -0
- package/dist/runtime/locale/lo.js +1 -0
- package/dist/runtime/locale/lt.js +1 -0
- package/dist/runtime/locale/mn.js +1 -0
- package/dist/runtime/locale/ms.js +1 -0
- package/dist/runtime/locale/nb_no.js +1 -0
- package/dist/runtime/locale/nl.js +1 -0
- package/dist/runtime/locale/pl.js +1 -0
- package/dist/runtime/locale/pt.js +1 -0
- package/dist/runtime/locale/pt_br.js +1 -0
- package/dist/runtime/locale/ro.js +1 -0
- package/dist/runtime/locale/ru.js +1 -0
- package/dist/runtime/locale/sk.js +1 -0
- package/dist/runtime/locale/sl.js +1 -0
- package/dist/runtime/locale/sq.js +1 -0
- package/dist/runtime/locale/sv.js +1 -0
- package/dist/runtime/locale/th.js +7 -6
- package/dist/runtime/locale/tj.js +1 -0
- package/dist/runtime/locale/tr.js +1 -0
- package/dist/runtime/locale/ug_cn.js +1 -0
- package/dist/runtime/locale/uk.js +1 -0
- package/dist/runtime/locale/ur.js +1 -0
- package/dist/runtime/locale/uz.js +1 -0
- package/dist/runtime/locale/vi.js +1 -0
- package/dist/runtime/locale/zh_cn.js +1 -0
- package/dist/runtime/locale/zh_tw.js +1 -0
- package/dist/runtime/plugins/colors.js +1 -1
- package/dist/runtime/types/content.d.ts +1 -0
- package/dist/runtime/types/content.js +1 -0
- package/dist/runtime/types/form.d.ts +2 -2
- package/dist/runtime/types/locale.d.ts +1 -0
- package/dist/runtime/types/tv.d.ts +13 -7
- package/dist/runtime/types/utils.d.ts +3 -0
- package/dist/runtime/utils/dashboard.d.ts +1 -1
- package/dist/runtime/utils/{fuse.d.ts → search.d.ts} +2 -1
- package/dist/runtime/utils/{fuse.js → search.js} +11 -2
- package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue +1 -0
- package/dist/runtime/vue/overrides/inertia/Link.d.vue.ts +2 -2
- package/dist/runtime/vue/overrides/inertia/Link.vue +5 -0
- package/dist/runtime/vue/overrides/inertia/Link.vue.d.ts +2 -2
- package/dist/runtime/vue/overrides/inertia/LinkBase.d.vue.ts +1 -1
- package/dist/runtime/vue/overrides/inertia/LinkBase.vue.d.ts +1 -1
- package/dist/runtime/vue/overrides/none/Link.d.vue.ts +2 -2
- package/dist/runtime/vue/overrides/none/Link.vue.d.ts +2 -2
- package/dist/runtime/vue/overrides/vue-router/Link.d.vue.ts +2 -2
- package/dist/runtime/vue/overrides/vue-router/Link.vue.d.ts +2 -2
- package/dist/shared/{ui.C6mn7iap.mjs → ui.BzjkAvk7.mjs} +244 -78
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +46 -53
- package/dist/runtime/composables/useComponentUI.d.ts +0 -33
- package/dist/runtime/composables/useComponentUI.js +0 -13
- package/dist/runtime/composables/useResolvedVariants.d.ts +0 -21
- package/dist/runtime/composables/useResolvedVariants.js +0 -14
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
@source "/home/runner/work/ui/ui/**/*";
|
|
2
|
-
@source inline("isolate");
|
|
3
|
-
@source "./ui";
|
|
4
|
-
|
|
5
|
-
@layer base {
|
|
6
|
-
body {
|
|
7
|
-
@apply antialiased text-default bg-default scheme-light dark:scheme-dark;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
1
|
@theme static {
|
|
12
2
|
--color-old-neutral-50: oklch(98.5% 0 0);
|
|
13
3
|
--color-old-neutral-100: oklch(97% 0 0);
|
package/LICENSE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2023
|
|
3
|
+
Copyright (c) 2023 Nuxt
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
6
|
|
|
@@ -3,7 +3,7 @@ import { resolve } from 'pathe'
|
|
|
3
3
|
import { defineCommand } from 'citty'
|
|
4
4
|
import { consola } from 'consola'
|
|
5
5
|
import { splitByCase, upperFirst, camelCase, kebabCase } from 'scule'
|
|
6
|
-
import { appendFile, sortFile } from '../../utils.mjs'
|
|
6
|
+
import { appendFile, appendThemeDefault, sortFile } from '../../utils.mjs'
|
|
7
7
|
import templates from '../../templates.mjs'
|
|
8
8
|
|
|
9
9
|
export default defineCommand({
|
|
@@ -75,8 +75,12 @@ export default defineCommand({
|
|
|
75
75
|
|
|
76
76
|
if (!args.prose) {
|
|
77
77
|
const typesPath = resolve(path, 'src/runtime/types/index.ts')
|
|
78
|
-
|
|
78
|
+
const pascal = splitByCase(name).map(p => upperFirst(p)).join('')
|
|
79
|
+
await appendFile(typesPath, `export * from '../components/${args.content ? 'content/' : ''}${pascal}.vue'`)
|
|
79
80
|
await sortFile(typesPath)
|
|
81
|
+
|
|
82
|
+
const useComponentPropsPath = resolve(path, 'src/runtime/composables/useComponentProps.ts')
|
|
83
|
+
await appendThemeDefault(useComponentPropsPath, camelCase(name), `${pascal}Props`)
|
|
80
84
|
}
|
|
81
85
|
}
|
|
82
86
|
})
|
package/cli/templates.mjs
CHANGED
|
@@ -20,18 +20,28 @@ const component = ({ name, primitive, prose, content }) => {
|
|
|
20
20
|
const upperName = splitByCase(name).map(p => upperFirst(p)).join('')
|
|
21
21
|
const camelName = camelCase(name)
|
|
22
22
|
const kebabName = kebabCase(name)
|
|
23
|
+
const nested = prose || content
|
|
24
|
+
const dirPrefix = prose ? 'prose/' : (content ? 'content/' : '')
|
|
25
|
+
const importPrefix = nested ? '../..' : '..'
|
|
26
|
+
const componentKey = prose ? `prose.${camelName}` : camelName
|
|
27
|
+
const componentConfigArgs = prose
|
|
28
|
+
? `typeof theme, AppConfig, '${camelName}', 'ui.prose'`
|
|
29
|
+
: `typeof theme, AppConfig, '${camelName}'`
|
|
30
|
+
const appConfigLookup = prose
|
|
31
|
+
? `appConfig.ui?.prose?.${camelName}`
|
|
32
|
+
: `appConfig.ui?.${camelName}`
|
|
23
33
|
|
|
24
34
|
return {
|
|
25
|
-
filename: `src/runtime/components/${
|
|
35
|
+
filename: `src/runtime/components/${dirPrefix}${upperName}.vue`,
|
|
26
36
|
contents: primitive
|
|
27
37
|
? `
|
|
28
38
|
<script lang="ts">
|
|
29
39
|
import type { VNode } from 'vue'
|
|
30
40
|
import type { AppConfig } from '@nuxt/schema'
|
|
31
|
-
import theme from '#build/ui/${
|
|
32
|
-
import type { ComponentConfig } from '
|
|
41
|
+
import theme from '#build/ui/${dirPrefix}${kebabName}'
|
|
42
|
+
import type { ComponentConfig } from '${importPrefix}/types/tv'
|
|
33
43
|
|
|
34
|
-
type ${upperName} = ComponentConfig
|
|
44
|
+
type ${upperName} = ComponentConfig<${componentConfigArgs}>
|
|
35
45
|
|
|
36
46
|
export interface ${upperName}Props {
|
|
37
47
|
/**
|
|
@@ -52,18 +62,22 @@ export interface ${upperName}Slots {
|
|
|
52
62
|
import { computed } from 'vue'
|
|
53
63
|
import { Primitive } from 'reka-ui'
|
|
54
64
|
import { useAppConfig } from '#imports'
|
|
55
|
-
import {
|
|
65
|
+
import { useComponentProps } from '${importPrefix}/composables/useComponentProps'
|
|
66
|
+
import { tv } from '${importPrefix}/utils/tv'
|
|
56
67
|
|
|
57
|
-
const
|
|
68
|
+
const _props = defineProps<${upperName}Props>()
|
|
58
69
|
defineSlots<${upperName}Slots>()
|
|
59
70
|
|
|
71
|
+
const props = useComponentProps('${componentKey}', _props)
|
|
72
|
+
|
|
60
73
|
const appConfig = useAppConfig() as ${upperName}['AppConfig']
|
|
61
74
|
|
|
62
|
-
|
|
75
|
+
// eslint-disable-next-line vue/no-dupe-keys
|
|
76
|
+
const ui = computed(() => tv({ extend: tv(theme), ...(${appConfigLookup} || {}) })())
|
|
63
77
|
</script>
|
|
64
78
|
|
|
65
79
|
<template>
|
|
66
|
-
<Primitive :as="as" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
80
|
+
<Primitive :as="props.as" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
67
81
|
<slot />
|
|
68
82
|
</Primitive>
|
|
69
83
|
</template>
|
|
@@ -71,42 +85,54 @@ const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.${camelName}
|
|
|
71
85
|
: `
|
|
72
86
|
<script lang="ts">
|
|
73
87
|
import type { ${upperName}RootProps, ${upperName}RootEmits } from 'reka-ui'
|
|
88
|
+
import type { VNode } from 'vue'
|
|
74
89
|
import type { AppConfig } from '@nuxt/schema'
|
|
75
|
-
import theme from '#build/ui/${
|
|
76
|
-
import type { ComponentConfig } from '
|
|
90
|
+
import theme from '#build/ui/${dirPrefix}${kebabName}'
|
|
91
|
+
import type { ComponentConfig } from '${importPrefix}/types/tv'
|
|
77
92
|
|
|
78
|
-
type ${upperName} = ComponentConfig
|
|
93
|
+
type ${upperName} = ComponentConfig<${componentConfigArgs}>
|
|
79
94
|
|
|
80
|
-
|
|
95
|
+
// TODO: narrow with \`Pick<${upperName}RootProps, '...' | '...'>\` to expose only the props you need.
|
|
96
|
+
export interface ${upperName}Props extends ${upperName}RootProps {
|
|
81
97
|
class?: any
|
|
82
98
|
ui?: ${upperName}['slots']
|
|
83
99
|
}
|
|
84
100
|
|
|
85
101
|
export interface ${upperName}Emits extends ${upperName}RootEmits {}
|
|
86
102
|
|
|
87
|
-
export interface ${upperName}Slots {
|
|
103
|
+
export interface ${upperName}Slots {
|
|
104
|
+
default?(props?: {}): VNode[]
|
|
105
|
+
}
|
|
88
106
|
</script>
|
|
89
107
|
|
|
90
108
|
<script setup lang="ts">
|
|
91
109
|
import { computed } from 'vue'
|
|
92
|
-
import { ${upperName}Root
|
|
110
|
+
import { ${upperName}Root } from 'reka-ui'
|
|
93
111
|
import { reactivePick } from '@vueuse/core'
|
|
94
112
|
import { useAppConfig } from '#imports'
|
|
95
|
-
import {
|
|
113
|
+
import { useComponentProps } from '${importPrefix}/composables/useComponentProps'
|
|
114
|
+
import { useForwardProps } from '${importPrefix}/composables/useForwardProps'
|
|
115
|
+
import { tv } from '${importPrefix}/utils/tv'
|
|
96
116
|
|
|
97
|
-
const
|
|
117
|
+
const _props = defineProps<${upperName}Props>()
|
|
98
118
|
const emits = defineEmits<${upperName}Emits>()
|
|
99
|
-
|
|
119
|
+
defineSlots<${upperName}Slots>()
|
|
120
|
+
|
|
121
|
+
const props = useComponentProps('${componentKey}', _props)
|
|
100
122
|
|
|
101
123
|
const appConfig = useAppConfig() as ${upperName}['AppConfig']
|
|
102
124
|
|
|
103
|
-
|
|
125
|
+
// TODO: list the same keys as in \`${upperName}Props\` Pick.
|
|
126
|
+
const rootProps = useForwardProps(reactivePick(props, 'as'), emits)
|
|
104
127
|
|
|
105
|
-
|
|
128
|
+
// eslint-disable-next-line vue/no-dupe-keys
|
|
129
|
+
const ui = computed(() => tv({ extend: tv(theme), ...(${appConfigLookup} || {}) })())
|
|
106
130
|
</script>
|
|
107
131
|
|
|
108
132
|
<template>
|
|
109
|
-
<${upperName}Root v-bind="rootProps" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
133
|
+
<${upperName}Root v-bind="rootProps" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
134
|
+
<slot />
|
|
135
|
+
</${upperName}Root>
|
|
110
136
|
</template>
|
|
111
137
|
`
|
|
112
138
|
}
|
package/cli/utils.mjs
CHANGED
|
@@ -16,6 +16,25 @@ export async function appendFile(path, contents) {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Insert a `key?: Partial<ComponentTypes.XProps>` entry into the `ThemeDefaults`
|
|
21
|
+
* interface in `src/runtime/composables/useComponentProps.ts`, keeping entries
|
|
22
|
+
* sorted alphabetically and avoiding duplicates.
|
|
23
|
+
*/
|
|
24
|
+
export async function appendThemeDefault(path, key, propsType) {
|
|
25
|
+
const file = await fsp.readFile(path, 'utf-8')
|
|
26
|
+
const entry = ` ${key}?: Partial<ComponentTypes.${propsType}>`
|
|
27
|
+
|
|
28
|
+
const match = file.match(/(export interface ThemeDefaults \{\n)([\s\S]*?)(\n\})/)
|
|
29
|
+
if (!match) return
|
|
30
|
+
|
|
31
|
+
const [, header, body, footer] = match
|
|
32
|
+
if (body.split('\n').includes(entry)) return
|
|
33
|
+
|
|
34
|
+
const sorted = [...body.split('\n'), entry].sort().join('\n')
|
|
35
|
+
await fsp.writeFile(path, file.replace(match[0], header + sorted + footer))
|
|
36
|
+
}
|
|
37
|
+
|
|
19
38
|
export function normalizeLocale(locale) {
|
|
20
39
|
if (!locale) {
|
|
21
40
|
return ''
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defu } from 'defu';
|
|
2
2
|
import { defineNuxtModule, createResolver, addPlugin, hasNuxtModule, addComponentsDir, addImportsDir, addImports } from '@nuxt/kit';
|
|
3
|
-
import { d as defaultOptions, r as resolveColors,
|
|
3
|
+
import { d as defaultOptions, r as resolveColors, g as getDefaultConfig, p as publicComposables, a as addTemplates } from './shared/ui.BzjkAvk7.mjs';
|
|
4
4
|
import '../dist/runtime/utils/index.js';
|
|
5
5
|
import 'node:url';
|
|
6
6
|
import 'scule';
|
|
@@ -11,7 +11,7 @@ import 'pathe';
|
|
|
11
11
|
import 'tinyglobby';
|
|
12
12
|
|
|
13
13
|
const name = "@nuxt/ui";
|
|
14
|
-
const version = "4.
|
|
14
|
+
const version = "4.8.1";
|
|
15
15
|
|
|
16
16
|
const module$1 = defineNuxtModule({
|
|
17
17
|
meta: {
|
|
@@ -50,7 +50,7 @@ const module$1 = defineNuxtModule({
|
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
"@nuxtjs/mdc": {
|
|
53
|
-
optional: !userUiOptions.mdc
|
|
53
|
+
optional: !userUiOptions.mdc,
|
|
54
54
|
defaults: {
|
|
55
55
|
highlight: {
|
|
56
56
|
theme: {
|
|
@@ -142,7 +142,7 @@ const module$1 = defineNuxtModule({
|
|
|
142
142
|
});
|
|
143
143
|
addImports(
|
|
144
144
|
Object.entries(publicComposables).flatMap(
|
|
145
|
-
([file, exports
|
|
145
|
+
([file, exports]) => exports.map((name2) => ({ name: name2, from: resolve(`./runtime/composables/${file}`) }))
|
|
146
146
|
)
|
|
147
147
|
);
|
|
148
148
|
addTemplates(options, nuxt, resolve);
|
|
@@ -4,14 +4,15 @@ import theme from "#build/ui/accordion";
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed } from "vue";
|
|
7
|
-
import { AccordionRoot, AccordionItem, AccordionHeader, AccordionTrigger, AccordionContent
|
|
7
|
+
import { AccordionRoot, AccordionItem, AccordionHeader, AccordionTrigger, AccordionContent } from "reka-ui";
|
|
8
|
+
import { useForwardProps } from "../composables/useForwardProps";
|
|
8
9
|
import { reactivePick } from "@vueuse/core";
|
|
9
10
|
import { useAppConfig } from "#imports";
|
|
10
|
-
import {
|
|
11
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
11
12
|
import { get } from "../utils";
|
|
12
13
|
import { tv } from "../utils/tv";
|
|
13
14
|
import UIcon from "./Icon.vue";
|
|
14
|
-
const
|
|
15
|
+
const _props = defineProps({
|
|
15
16
|
as: { type: null, required: false },
|
|
16
17
|
items: { type: Array, required: false },
|
|
17
18
|
trailingIcon: { type: null, required: false },
|
|
@@ -28,16 +29,16 @@ const props = defineProps({
|
|
|
28
29
|
});
|
|
29
30
|
const emits = defineEmits(["update:modelValue"]);
|
|
30
31
|
const slots = defineSlots();
|
|
32
|
+
const props = useComponentProps("accordion", _props);
|
|
31
33
|
const appConfig = useAppConfig();
|
|
32
|
-
const
|
|
33
|
-
const rootProps = useForwardPropsEmits(reactivePick(props, "as", "collapsible", "defaultValue", "disabled", "modelValue", "unmountOnHide"), emits);
|
|
34
|
+
const rootProps = useForwardProps(reactivePick(props, "as", "collapsible", "defaultValue", "disabled", "modelValue", "unmountOnHide"), emits);
|
|
34
35
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.accordion || {} })({
|
|
35
36
|
disabled: props.disabled
|
|
36
37
|
}));
|
|
37
38
|
</script>
|
|
38
39
|
|
|
39
40
|
<template>
|
|
40
|
-
<AccordionRoot v-bind="rootProps" :type="type" data-slot="root" :class="ui.root({ class: [
|
|
41
|
+
<AccordionRoot v-bind="rootProps" :type="props.type" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
41
42
|
<AccordionItem
|
|
42
43
|
v-for="(item, index) in props.items"
|
|
43
44
|
v-slot="{ open }"
|
|
@@ -45,27 +46,27 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.accordion ||
|
|
|
45
46
|
:value="get(item, props.valueKey) ?? String(index)"
|
|
46
47
|
:disabled="item.disabled"
|
|
47
48
|
data-slot="item"
|
|
48
|
-
:class="ui.item({ class: [
|
|
49
|
+
:class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class] })"
|
|
49
50
|
>
|
|
50
|
-
<AccordionHeader as="div" data-slot="header" :class="ui.header({ class: [
|
|
51
|
-
<AccordionTrigger data-slot="trigger" :class="ui.trigger({ class: [
|
|
51
|
+
<AccordionHeader as="div" data-slot="header" :class="ui.header({ class: [props.ui?.header, item.ui?.header] })">
|
|
52
|
+
<AccordionTrigger data-slot="trigger" :class="ui.trigger({ class: [props.ui?.trigger, item.ui?.trigger], disabled: item.disabled })">
|
|
52
53
|
<slot name="leading" :item="item" :index="index" :open="open" :ui="ui">
|
|
53
|
-
<UIcon v-if="item.icon" :name="item.icon" data-slot="leadingIcon" :class="ui.leadingIcon({ class: [
|
|
54
|
+
<UIcon v-if="item.icon" :name="item.icon" data-slot="leadingIcon" :class="ui.leadingIcon({ class: [props.ui?.leadingIcon, item?.ui?.leadingIcon] })" />
|
|
54
55
|
</slot>
|
|
55
56
|
|
|
56
|
-
<span v-if="get(item, props.labelKey) || !!slots.default" data-slot="label" :class="ui.label({ class: [
|
|
57
|
+
<span v-if="get(item, props.labelKey) || !!slots.default" data-slot="label" :class="ui.label({ class: [props.ui?.label, item.ui?.label] })">
|
|
57
58
|
<slot :item="item" :index="index" :open="open">{{ get(item, props.labelKey) }}</slot>
|
|
58
59
|
</span>
|
|
59
60
|
|
|
60
61
|
<slot name="trailing" :item="item" :index="index" :open="open" :ui="ui">
|
|
61
|
-
<UIcon :name="item.trailingIcon || trailingIcon || appConfig.ui.icons.chevronDown" data-slot="trailingIcon" :class="ui.trailingIcon({ class: [
|
|
62
|
+
<UIcon :name="item.trailingIcon || props.trailingIcon || appConfig.ui.icons.chevronDown" data-slot="trailingIcon" :class="ui.trailingIcon({ class: [props.ui?.trailingIcon, item.ui?.trailingIcon] })" />
|
|
62
63
|
</slot>
|
|
63
64
|
</AccordionTrigger>
|
|
64
65
|
</AccordionHeader>
|
|
65
66
|
|
|
66
|
-
<AccordionContent v-if="item.content || !!slots.content || item.slot && !!slots[item.slot] || !!slots.body || item.slot && !!slots[`${item.slot}-body`]" data-slot="content" :class="ui.content({ class: [
|
|
67
|
+
<AccordionContent v-if="item.content || !!slots.content || item.slot && !!slots[item.slot] || !!slots.body || item.slot && !!slots[`${item.slot}-body`]" data-slot="content" :class="ui.content({ class: [props.ui?.content, item.ui?.content] })">
|
|
67
68
|
<slot :name="item.slot || 'content'" :item="item" :index="index" :open="open" :ui="ui">
|
|
68
|
-
<div data-slot="body" :class="ui.body({ class: [
|
|
69
|
+
<div data-slot="body" :class="ui.body({ class: [props.ui?.body, item.ui?.body] })">
|
|
69
70
|
<slot :name="item.slot ? `${item.slot}-body` : 'body'" :item="item" :index="index" :open="open" :ui="ui">
|
|
70
71
|
{{ item.content }}
|
|
71
72
|
</slot>
|
|
@@ -6,13 +6,13 @@ import theme from "#build/ui/alert";
|
|
|
6
6
|
import { computed } from "vue";
|
|
7
7
|
import { Primitive } from "reka-ui";
|
|
8
8
|
import { useAppConfig } from "#imports";
|
|
9
|
-
import {
|
|
9
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
10
10
|
import { useLocale } from "../composables/useLocale";
|
|
11
11
|
import { tv } from "../utils/tv";
|
|
12
12
|
import UIcon from "./Icon.vue";
|
|
13
13
|
import UAvatar from "./Avatar.vue";
|
|
14
14
|
import UButton from "./Button.vue";
|
|
15
|
-
const
|
|
15
|
+
const _props = defineProps({
|
|
16
16
|
as: { type: null, required: false },
|
|
17
17
|
title: { type: String, required: false },
|
|
18
18
|
description: { type: String, required: false },
|
|
@@ -29,9 +29,9 @@ const props = defineProps({
|
|
|
29
29
|
});
|
|
30
30
|
const emits = defineEmits(["update:open"]);
|
|
31
31
|
const slots = defineSlots();
|
|
32
|
+
const props = useComponentProps("alert", _props);
|
|
32
33
|
const { t } = useLocale();
|
|
33
34
|
const appConfig = useAppConfig();
|
|
34
|
-
const uiProp = useComponentUI("alert", props);
|
|
35
35
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.alert || {} })({
|
|
36
36
|
color: props.color,
|
|
37
37
|
variant: props.variant,
|
|
@@ -41,48 +41,48 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.alert || {} }
|
|
|
41
41
|
</script>
|
|
42
42
|
|
|
43
43
|
<template>
|
|
44
|
-
<Primitive :as="as" :data-orientation="orientation" data-slot="root" :class="ui.root({ class: [
|
|
44
|
+
<Primitive :as="props.as" :data-orientation="props.orientation" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
45
45
|
<slot name="leading" :ui="ui">
|
|
46
|
-
<UAvatar v-if="avatar" :size="
|
|
47
|
-
<UIcon v-else-if="icon" :name="icon" data-slot="icon" :class="ui.icon({ class:
|
|
46
|
+
<UAvatar v-if="props.avatar" :size="props.ui?.avatarSize || ui.avatarSize()" v-bind="props.avatar" data-slot="avatar" :class="ui.avatar({ class: props.ui?.avatar })" />
|
|
47
|
+
<UIcon v-else-if="props.icon" :name="props.icon" data-slot="icon" :class="ui.icon({ class: props.ui?.icon })" />
|
|
48
48
|
</slot>
|
|
49
49
|
|
|
50
|
-
<div data-slot="wrapper" :class="ui.wrapper({ class:
|
|
51
|
-
<div v-if="title || !!slots.title" data-slot="title" :class="ui.title({ class:
|
|
50
|
+
<div data-slot="wrapper" :class="ui.wrapper({ class: props.ui?.wrapper })">
|
|
51
|
+
<div v-if="props.title || !!slots.title" data-slot="title" :class="ui.title({ class: props.ui?.title })">
|
|
52
52
|
<slot name="title">
|
|
53
|
-
{{ title }}
|
|
53
|
+
{{ props.title }}
|
|
54
54
|
</slot>
|
|
55
55
|
</div>
|
|
56
|
-
<div v-if="description || !!slots.description" data-slot="description" :class="ui.description({ class:
|
|
56
|
+
<div v-if="props.description || !!slots.description" data-slot="description" :class="ui.description({ class: props.ui?.description })">
|
|
57
57
|
<slot name="description">
|
|
58
|
-
{{ description }}
|
|
58
|
+
{{ props.description }}
|
|
59
59
|
</slot>
|
|
60
60
|
</div>
|
|
61
61
|
|
|
62
|
-
<div v-if="orientation === 'vertical' && (actions?.length || !!slots.actions)" data-slot="actions" :class="ui.actions({ class:
|
|
62
|
+
<div v-if="props.orientation === 'vertical' && (props.actions?.length || !!slots.actions)" data-slot="actions" :class="ui.actions({ class: props.ui?.actions })">
|
|
63
63
|
<slot name="actions">
|
|
64
|
-
<UButton v-for="(action, index) in actions" :key="index" size="xs" v-bind="action" />
|
|
64
|
+
<UButton v-for="(action, index) in props.actions" :key="index" size="xs" v-bind="action" />
|
|
65
65
|
</slot>
|
|
66
66
|
</div>
|
|
67
67
|
</div>
|
|
68
68
|
|
|
69
|
-
<div v-if="orientation === 'horizontal' && (actions?.length || !!slots.actions) || close" data-slot="actions" :class="ui.actions({ class:
|
|
70
|
-
<template v-if="orientation === 'horizontal' && (actions?.length || !!slots.actions)">
|
|
69
|
+
<div v-if="props.orientation === 'horizontal' && (props.actions?.length || !!slots.actions) || props.close" data-slot="actions" :class="ui.actions({ class: props.ui?.actions, orientation: 'horizontal' })">
|
|
70
|
+
<template v-if="props.orientation === 'horizontal' && (props.actions?.length || !!slots.actions)">
|
|
71
71
|
<slot name="actions">
|
|
72
|
-
<UButton v-for="(action, index) in actions" :key="index" size="xs" v-bind="action" />
|
|
72
|
+
<UButton v-for="(action, index) in props.actions" :key="index" size="xs" v-bind="action" />
|
|
73
73
|
</slot>
|
|
74
74
|
</template>
|
|
75
75
|
|
|
76
76
|
<slot name="close" :ui="ui">
|
|
77
77
|
<UButton
|
|
78
|
-
v-if="close"
|
|
79
|
-
:icon="closeIcon || appConfig.ui.icons.close"
|
|
78
|
+
v-if="props.close"
|
|
79
|
+
:icon="props.closeIcon || appConfig.ui.icons.close"
|
|
80
80
|
color="neutral"
|
|
81
81
|
variant="link"
|
|
82
82
|
:aria-label="t('alert.close')"
|
|
83
|
-
v-bind="typeof close === 'object' ? close : {}"
|
|
83
|
+
v-bind="typeof props.close === 'object' ? props.close : {}"
|
|
84
84
|
data-slot="close"
|
|
85
|
-
:class="ui.close({ class:
|
|
85
|
+
:class="ui.close({ class: props.ui?.close })"
|
|
86
86
|
@click="emits('update:open', false)"
|
|
87
87
|
/>
|
|
88
88
|
</slot>
|
|
@@ -6,7 +6,7 @@ import theme from "#build/ui/auth-form";
|
|
|
6
6
|
import { reactive, ref, computed, useTemplateRef } from "vue";
|
|
7
7
|
import { Primitive } from "reka-ui";
|
|
8
8
|
import { useAppConfig } from "#imports";
|
|
9
|
-
import {
|
|
9
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
10
10
|
import { useLocale } from "../composables/useLocale";
|
|
11
11
|
import { omit, pick } from "../utils";
|
|
12
12
|
import { tv } from "../utils/tv";
|
|
@@ -20,7 +20,7 @@ import USelectMenu from "./SelectMenu.vue";
|
|
|
20
20
|
import UInput from "./Input.vue";
|
|
21
21
|
import UPinInput from "./PinInput.vue";
|
|
22
22
|
defineOptions({ inheritAttrs: false });
|
|
23
|
-
const
|
|
23
|
+
const _props = defineProps({
|
|
24
24
|
as: { type: null, required: false },
|
|
25
25
|
icon: { type: null, required: false },
|
|
26
26
|
title: { type: String, required: false },
|
|
@@ -40,7 +40,7 @@ const props = defineProps({
|
|
|
40
40
|
onSubmit: { type: Function, required: false },
|
|
41
41
|
ui: { type: Object, required: false }
|
|
42
42
|
});
|
|
43
|
-
const state = reactive((
|
|
43
|
+
const state = reactive((_props.fields || []).reduce((acc, field) => {
|
|
44
44
|
if (field.name) {
|
|
45
45
|
acc[field.name] = field.defaultValue;
|
|
46
46
|
}
|
|
@@ -48,9 +48,9 @@ const state = reactive((props.fields || []).reduce((acc, field) => {
|
|
|
48
48
|
}, {}));
|
|
49
49
|
defineEmits(["submit"]);
|
|
50
50
|
const slots = defineSlots();
|
|
51
|
+
const props = useComponentProps("authForm", _props);
|
|
51
52
|
const { t } = useLocale();
|
|
52
53
|
const appConfig = useAppConfig();
|
|
53
|
-
const uiProp = useComponentUI("authForm", props);
|
|
54
54
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.authForm || {} })());
|
|
55
55
|
const formRef = useTemplateRef("formRef");
|
|
56
56
|
const passwordVisibility = ref(false);
|
|
@@ -79,34 +79,34 @@ defineExpose({
|
|
|
79
79
|
</script>
|
|
80
80
|
|
|
81
81
|
<template>
|
|
82
|
-
<Primitive :as="as" data-slot="root" :class="ui.root({ class: [
|
|
83
|
-
<div v-if="icon || !!slots.leading || (title || !!slots.title) || (description || !!slots.description) || !!slots.header" data-slot="header" :class="ui.header({ class:
|
|
82
|
+
<Primitive :as="props.as" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
83
|
+
<div v-if="props.icon || !!slots.leading || (props.title || !!slots.title) || (props.description || !!slots.description) || !!slots.header" data-slot="header" :class="ui.header({ class: props.ui?.header })">
|
|
84
84
|
<slot name="header">
|
|
85
|
-
<div v-if="icon || !!slots.leading" data-slot="leading" :class="ui.leading({ class:
|
|
85
|
+
<div v-if="props.icon || !!slots.leading" data-slot="leading" :class="ui.leading({ class: props.ui?.leading })">
|
|
86
86
|
<slot name="leading" :ui="ui">
|
|
87
|
-
<UIcon v-if="icon" :name="icon" data-slot="leadingIcon" :class="ui.leadingIcon({ class:
|
|
87
|
+
<UIcon v-if="props.icon" :name="props.icon" data-slot="leadingIcon" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
|
|
88
88
|
</slot>
|
|
89
89
|
</div>
|
|
90
90
|
|
|
91
|
-
<div v-if="title || !!slots.title" data-slot="title" :class="ui.title({ class:
|
|
91
|
+
<div v-if="props.title || !!slots.title" data-slot="title" :class="ui.title({ class: props.ui?.title })">
|
|
92
92
|
<slot name="title">
|
|
93
|
-
{{ title }}
|
|
93
|
+
{{ props.title }}
|
|
94
94
|
</slot>
|
|
95
95
|
</div>
|
|
96
96
|
|
|
97
|
-
<div v-if="description || !!slots.description" data-slot="description" :class="ui.description({ class:
|
|
97
|
+
<div v-if="props.description || !!slots.description" data-slot="description" :class="ui.description({ class: props.ui?.description })">
|
|
98
98
|
<slot name="description">
|
|
99
|
-
{{ description }}
|
|
99
|
+
{{ props.description }}
|
|
100
100
|
</slot>
|
|
101
101
|
</div>
|
|
102
102
|
</slot>
|
|
103
103
|
</div>
|
|
104
104
|
|
|
105
|
-
<div data-slot="body" :class="ui.body({ class:
|
|
106
|
-
<div v-if="providers?.length || !!slots.providers" data-slot="providers" :class="ui.providers({ class:
|
|
105
|
+
<div data-slot="body" :class="ui.body({ class: props.ui?.body })">
|
|
106
|
+
<div v-if="props.providers?.length || !!slots.providers" data-slot="providers" :class="ui.providers({ class: props.ui?.providers })">
|
|
107
107
|
<slot name="providers">
|
|
108
108
|
<UButton
|
|
109
|
-
v-for="(provider, index) in providers"
|
|
109
|
+
v-for="(provider, index) in props.providers"
|
|
110
110
|
:key="index"
|
|
111
111
|
block
|
|
112
112
|
color="neutral"
|
|
@@ -118,29 +118,29 @@ defineExpose({
|
|
|
118
118
|
|
|
119
119
|
<slot name="separator">
|
|
120
120
|
<USeparator
|
|
121
|
-
v-if="providers?.length && fields?.length"
|
|
122
|
-
v-bind="typeof separator === 'object' ? separator : { label: separator }"
|
|
121
|
+
v-if="props.providers?.length && props.fields?.length"
|
|
122
|
+
v-bind="typeof props.separator === 'object' ? props.separator : { label: props.separator }"
|
|
123
123
|
data-slot="separator"
|
|
124
|
-
:class="ui.separator({ class:
|
|
124
|
+
:class="ui.separator({ class: props.ui?.separator })"
|
|
125
125
|
/>
|
|
126
126
|
</slot>
|
|
127
127
|
|
|
128
128
|
<UForm
|
|
129
|
-
v-if="fields?.length"
|
|
129
|
+
v-if="props.fields?.length"
|
|
130
130
|
ref="formRef"
|
|
131
131
|
:state="state"
|
|
132
|
-
:schema="schema"
|
|
133
|
-
:validate="validate"
|
|
134
|
-
:validate-on="validateOn"
|
|
135
|
-
:disabled="disabled"
|
|
136
|
-
:loading-auto="loadingAuto"
|
|
132
|
+
:schema="props.schema"
|
|
133
|
+
:validate="props.validate"
|
|
134
|
+
:validate-on="props.validateOn"
|
|
135
|
+
:disabled="props.disabled"
|
|
136
|
+
:loading-auto="props.loadingAuto"
|
|
137
137
|
data-slot="form"
|
|
138
|
-
:class="ui.form({ class:
|
|
138
|
+
:class="ui.form({ class: props.ui?.form })"
|
|
139
139
|
v-bind="$attrs"
|
|
140
|
-
@submit="onSubmit"
|
|
140
|
+
@submit="props.onSubmit"
|
|
141
141
|
>
|
|
142
142
|
<UFormField
|
|
143
|
-
v-for="field in fields"
|
|
143
|
+
v-for="field in props.fields"
|
|
144
144
|
:key="field.name"
|
|
145
145
|
v-bind="pickFieldProps(field)"
|
|
146
146
|
>
|
|
@@ -149,14 +149,14 @@ defineExpose({
|
|
|
149
149
|
v-if="field.type === 'checkbox'"
|
|
150
150
|
v-model="state[field.name]"
|
|
151
151
|
data-slot="checkbox"
|
|
152
|
-
:class="ui.checkbox({ class:
|
|
152
|
+
:class="ui.checkbox({ class: props.ui?.checkbox })"
|
|
153
153
|
v-bind="omitFieldProps(field)"
|
|
154
154
|
/>
|
|
155
155
|
<USelectMenu
|
|
156
156
|
v-else-if="field.type === 'select'"
|
|
157
157
|
v-model="state[field.name]"
|
|
158
158
|
data-slot="select"
|
|
159
|
-
:class="ui.select({ class:
|
|
159
|
+
:class="ui.select({ class: props.ui?.select })"
|
|
160
160
|
v-bind="omitFieldProps(field)"
|
|
161
161
|
/>
|
|
162
162
|
<UPinInput
|
|
@@ -164,7 +164,7 @@ defineExpose({
|
|
|
164
164
|
:id="field.name"
|
|
165
165
|
v-model="state[field.name]"
|
|
166
166
|
data-slot="otp"
|
|
167
|
-
:class="ui.otp({ class:
|
|
167
|
+
:class="ui.otp({ class: props.ui?.otp })"
|
|
168
168
|
v-bind="Object.assign({}, omitFieldProps(field), typeof field.otp === 'object' ? field.otp : {})"
|
|
169
169
|
otp
|
|
170
170
|
/>
|
|
@@ -173,7 +173,7 @@ defineExpose({
|
|
|
173
173
|
ref="passwordRef"
|
|
174
174
|
v-model="state[field.name]"
|
|
175
175
|
data-slot="password"
|
|
176
|
-
:class="ui.password({ class:
|
|
176
|
+
:class="ui.password({ class: props.ui?.password })"
|
|
177
177
|
v-bind="omitFieldProps(field)"
|
|
178
178
|
:type="passwordVisibility ? 'text' : 'password'"
|
|
179
179
|
>
|
|
@@ -194,7 +194,7 @@ defineExpose({
|
|
|
194
194
|
v-else
|
|
195
195
|
v-model="state[field.name]"
|
|
196
196
|
data-slot="input"
|
|
197
|
-
:class="ui.input({ class:
|
|
197
|
+
:class="ui.input({ class: props.ui?.input })"
|
|
198
198
|
v-bind="omitFieldProps(field)"
|
|
199
199
|
/>
|
|
200
200
|
</slot>
|
|
@@ -218,20 +218,20 @@ defineExpose({
|
|
|
218
218
|
|
|
219
219
|
<slot v-if="!!slots.validation" name="validation" />
|
|
220
220
|
|
|
221
|
-
<slot name="submit" :loading="loading">
|
|
221
|
+
<slot name="submit" :loading="props.loading">
|
|
222
222
|
<UButton
|
|
223
223
|
type="submit"
|
|
224
224
|
:label="t('authForm.submit')"
|
|
225
225
|
block
|
|
226
|
-
:loading="loading"
|
|
227
|
-
:loading-auto="loadingAuto"
|
|
228
|
-
v-bind="submit"
|
|
226
|
+
:loading="props.loading"
|
|
227
|
+
:loading-auto="props.loadingAuto"
|
|
228
|
+
v-bind="props.submit"
|
|
229
229
|
/>
|
|
230
230
|
</slot>
|
|
231
231
|
</UForm>
|
|
232
232
|
</div>
|
|
233
233
|
|
|
234
|
-
<div v-if="!!slots.footer" data-slot="footer" :class="ui.footer({ class:
|
|
234
|
+
<div v-if="!!slots.footer" data-slot="footer" :class="ui.footer({ class: props.ui?.footer })">
|
|
235
235
|
<slot name="footer" />
|
|
236
236
|
</div>
|
|
237
237
|
</Primitive>
|
|
@@ -25,6 +25,10 @@ export interface AvatarProps extends /** @vue-ignore */ Omit<ImgHTMLAttributes,
|
|
|
25
25
|
* @defaultValue 'md'
|
|
26
26
|
*/
|
|
27
27
|
size?: Avatar['variants']['size'];
|
|
28
|
+
/**
|
|
29
|
+
* @defaultValue 'neutral'
|
|
30
|
+
*/
|
|
31
|
+
color?: Avatar['variants']['color'];
|
|
28
32
|
chip?: boolean | ChipProps;
|
|
29
33
|
class?: any;
|
|
30
34
|
style?: any;
|