@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
|
@@ -4,17 +4,18 @@ import theme from "#build/ui/toast";
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { ref, computed, onMounted, useTemplateRef } from "vue";
|
|
7
|
-
import { ToastRoot, ToastTitle, ToastDescription, ToastAction, ToastClose
|
|
7
|
+
import { ToastRoot, ToastTitle, ToastDescription, ToastAction, ToastClose } 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 { useLocale } from "../composables/useLocale";
|
|
12
13
|
import { tv } from "../utils/tv";
|
|
13
14
|
import UIcon from "./Icon.vue";
|
|
14
15
|
import UAvatar from "./Avatar.vue";
|
|
15
16
|
import UButton from "./Button.vue";
|
|
16
17
|
import UProgress from "./Progress.vue";
|
|
17
|
-
const
|
|
18
|
+
const _props = defineProps({
|
|
18
19
|
as: { type: null, required: false },
|
|
19
20
|
title: { type: [String, Object, Function], required: false },
|
|
20
21
|
description: { type: [String, Object, Function], required: false },
|
|
@@ -35,10 +36,10 @@ const props = defineProps({
|
|
|
35
36
|
});
|
|
36
37
|
const emits = defineEmits(["escapeKeyDown", "pause", "resume", "swipeStart", "swipeMove", "swipeCancel", "swipeEnd", "update:open"]);
|
|
37
38
|
const slots = defineSlots();
|
|
39
|
+
const props = useComponentProps("toast", _props);
|
|
38
40
|
const { t } = useLocale();
|
|
39
41
|
const appConfig = useAppConfig();
|
|
40
|
-
const
|
|
41
|
-
const rootProps = useForwardPropsEmits(reactivePick(props, "as", "defaultOpen", "open", "duration", "type"), emits);
|
|
42
|
+
const rootProps = useForwardProps(reactivePick(props, "as", "defaultOpen", "open", "duration", "type"), emits);
|
|
42
43
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.toast || {} })({
|
|
43
44
|
color: props.color,
|
|
44
45
|
orientation: props.orientation,
|
|
@@ -62,65 +63,65 @@ defineExpose({
|
|
|
62
63
|
ref="rootRef"
|
|
63
64
|
v-slot="{ remaining, duration, open }"
|
|
64
65
|
v-bind="rootProps"
|
|
65
|
-
:data-orientation="orientation"
|
|
66
|
+
:data-orientation="props.orientation"
|
|
66
67
|
data-slot="root"
|
|
67
|
-
:class="ui.root({ class: [
|
|
68
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
68
69
|
:style="{ '--height': height }"
|
|
69
70
|
>
|
|
70
71
|
<slot name="leading" :ui="ui">
|
|
71
|
-
<UAvatar v-if="avatar" :size="
|
|
72
|
-
<UIcon v-else-if="icon" :name="icon" data-slot="icon" :class="ui.icon({ class:
|
|
72
|
+
<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 })" />
|
|
73
|
+
<UIcon v-else-if="props.icon" :name="props.icon" data-slot="icon" :class="ui.icon({ class: props.ui?.icon })" />
|
|
73
74
|
</slot>
|
|
74
75
|
|
|
75
|
-
<div data-slot="wrapper" :class="ui.wrapper({ class:
|
|
76
|
-
<ToastTitle v-if="title || !!slots.title" data-slot="title" :class="ui.title({ class:
|
|
76
|
+
<div data-slot="wrapper" :class="ui.wrapper({ class: props.ui?.wrapper })">
|
|
77
|
+
<ToastTitle v-if="props.title || !!slots.title" data-slot="title" :class="ui.title({ class: props.ui?.title })">
|
|
77
78
|
<slot name="title">
|
|
78
|
-
<component :is="title()" v-if="typeof title === 'function'" />
|
|
79
|
-
<component :is="title" v-else-if="typeof title === 'object'" />
|
|
79
|
+
<component :is="props.title()" v-if="typeof props.title === 'function'" />
|
|
80
|
+
<component :is="props.title" v-else-if="typeof props.title === 'object'" />
|
|
80
81
|
<template v-else>
|
|
81
|
-
{{ title }}
|
|
82
|
+
{{ props.title }}
|
|
82
83
|
</template>
|
|
83
84
|
</slot>
|
|
84
85
|
</ToastTitle>
|
|
85
|
-
<ToastDescription v-if="description || !!slots.description" data-slot="description" :class="ui.description({ class:
|
|
86
|
+
<ToastDescription v-if="props.description || !!slots.description" data-slot="description" :class="ui.description({ class: props.ui?.description })">
|
|
86
87
|
<slot name="description">
|
|
87
|
-
<component :is="description()" v-if="typeof description === 'function'" />
|
|
88
|
-
<component :is="description" v-else-if="typeof description === 'object'" />
|
|
88
|
+
<component :is="props.description()" v-if="typeof props.description === 'function'" />
|
|
89
|
+
<component :is="props.description" v-else-if="typeof props.description === 'object'" />
|
|
89
90
|
<template v-else>
|
|
90
|
-
{{ description }}
|
|
91
|
+
{{ props.description }}
|
|
91
92
|
</template>
|
|
92
93
|
</slot>
|
|
93
94
|
</ToastDescription>
|
|
94
95
|
|
|
95
|
-
<div v-if="orientation === 'vertical' && (actions?.length || !!slots.actions)" data-slot="actions" :class="ui.actions({ class:
|
|
96
|
+
<div v-if="props.orientation === 'vertical' && (props.actions?.length || !!slots.actions)" data-slot="actions" :class="ui.actions({ class: props.ui?.actions })">
|
|
96
97
|
<slot name="actions">
|
|
97
|
-
<ToastAction v-for="(action, index) in actions" :key="index" :alt-text="action.label || 'Action'" as-child @click.stop>
|
|
98
|
-
<UButton size="xs" :color="color" v-bind="action" />
|
|
98
|
+
<ToastAction v-for="(action, index) in props.actions" :key="index" :alt-text="action.label || 'Action'" as-child @click.stop>
|
|
99
|
+
<UButton size="xs" :color="props.color" v-bind="action" />
|
|
99
100
|
</ToastAction>
|
|
100
101
|
</slot>
|
|
101
102
|
</div>
|
|
102
103
|
</div>
|
|
103
104
|
|
|
104
|
-
<div v-if="orientation === 'horizontal' && (actions?.length || !!slots.actions) || close" data-slot="actions" :class="ui.actions({ class:
|
|
105
|
-
<template v-if="orientation === 'horizontal' && (actions?.length || !!slots.actions)">
|
|
105
|
+
<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' })">
|
|
106
|
+
<template v-if="props.orientation === 'horizontal' && (props.actions?.length || !!slots.actions)">
|
|
106
107
|
<slot name="actions">
|
|
107
|
-
<ToastAction v-for="(action, index) in actions" :key="index" :alt-text="action.label || 'Action'" as-child @click.stop>
|
|
108
|
-
<UButton size="xs" :color="color" v-bind="action" />
|
|
108
|
+
<ToastAction v-for="(action, index) in props.actions" :key="index" :alt-text="action.label || 'Action'" as-child @click.stop>
|
|
109
|
+
<UButton size="xs" :color="props.color" v-bind="action" />
|
|
109
110
|
</ToastAction>
|
|
110
111
|
</slot>
|
|
111
112
|
</template>
|
|
112
113
|
|
|
113
|
-
<ToastClose v-if="close || !!slots.close" as-child>
|
|
114
|
+
<ToastClose v-if="props.close || !!slots.close" as-child>
|
|
114
115
|
<slot name="close" :ui="ui">
|
|
115
116
|
<UButton
|
|
116
|
-
v-if="close"
|
|
117
|
-
:icon="closeIcon || appConfig.ui.icons.close"
|
|
117
|
+
v-if="props.close"
|
|
118
|
+
:icon="props.closeIcon || appConfig.ui.icons.close"
|
|
118
119
|
color="neutral"
|
|
119
120
|
variant="link"
|
|
120
121
|
:aria-label="t('toast.close')"
|
|
121
|
-
v-bind="typeof close === 'object' ? close : {}"
|
|
122
|
+
v-bind="typeof props.close === 'object' ? props.close : {}"
|
|
122
123
|
data-slot="close"
|
|
123
|
-
:class="ui.close({ class:
|
|
124
|
+
:class="ui.close({ class: props.ui?.close })"
|
|
124
125
|
@click.stop
|
|
125
126
|
/>
|
|
126
127
|
</slot>
|
|
@@ -128,13 +129,13 @@ defineExpose({
|
|
|
128
129
|
</div>
|
|
129
130
|
|
|
130
131
|
<UProgress
|
|
131
|
-
v-if="progress && open && remaining > 0 && duration"
|
|
132
|
+
v-if="props.progress && open && remaining > 0 && duration"
|
|
132
133
|
:model-value="remaining / duration * 100"
|
|
133
|
-
:color="color"
|
|
134
|
-
v-bind="typeof progress === 'object' ? progress : {}"
|
|
134
|
+
:color="props.color"
|
|
135
|
+
v-bind="typeof props.progress === 'object' ? props.progress : {}"
|
|
135
136
|
size="sm"
|
|
136
137
|
data-slot="progress"
|
|
137
|
-
:class="ui.progress({ class:
|
|
138
|
+
:class="ui.progress({ class: props.ui?.progress })"
|
|
138
139
|
/>
|
|
139
140
|
</ToastRoot>
|
|
140
141
|
</template>
|
|
@@ -40,8 +40,8 @@ declare const _default: typeof __VLS_export;
|
|
|
40
40
|
export default _default;
|
|
41
41
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ToasterProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ToasterProps> & Readonly<{}>, {
|
|
42
42
|
progress: boolean;
|
|
43
|
-
max: number;
|
|
44
43
|
expand: boolean;
|
|
44
|
+
max: number;
|
|
45
45
|
duration: number;
|
|
46
46
|
portal: boolean | string | HTMLElement;
|
|
47
47
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ToasterSlots>;
|
|
@@ -7,16 +7,17 @@ export default {
|
|
|
7
7
|
|
|
8
8
|
<script setup>
|
|
9
9
|
import { ref, computed, toRef, provide } from "vue";
|
|
10
|
-
import { ToastProvider, ToastViewport, ToastPortal
|
|
10
|
+
import { ToastProvider, ToastViewport, ToastPortal } from "reka-ui";
|
|
11
11
|
import { reactivePick } from "@vueuse/core";
|
|
12
12
|
import { useAppConfig } from "#imports";
|
|
13
|
-
import {
|
|
13
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
14
|
+
import { useForwardProps } from "../composables/useForwardProps";
|
|
14
15
|
import { useToast, toastMaxInjectionKey } from "../composables/useToast";
|
|
15
16
|
import { usePortal } from "../composables/usePortal";
|
|
16
17
|
import { omit } from "../utils";
|
|
17
18
|
import { tv } from "../utils/tv";
|
|
18
19
|
import UToast from "./Toast.vue";
|
|
19
|
-
const
|
|
20
|
+
const _props = defineProps({
|
|
20
21
|
position: { type: null, required: false },
|
|
21
22
|
expand: { type: Boolean, required: false, default: true },
|
|
22
23
|
progress: { type: Boolean, required: false, default: true },
|
|
@@ -30,9 +31,9 @@ const props = defineProps({
|
|
|
30
31
|
swipeThreshold: { type: Number, required: false }
|
|
31
32
|
});
|
|
32
33
|
defineSlots();
|
|
34
|
+
const props = useComponentProps("toaster", _props);
|
|
33
35
|
const { toasts, remove } = useToast();
|
|
34
36
|
const appConfig = useAppConfig();
|
|
35
|
-
const uiProp = useComponentUI("toaster", props);
|
|
36
37
|
provide(toastMaxInjectionKey, toRef(() => props.max));
|
|
37
38
|
const providerProps = useForwardProps(reactivePick(props, "duration", "label", "swipeThreshold", "disableSwipe"));
|
|
38
39
|
const portalProps = usePortal(toRef(() => props.portal));
|
|
@@ -79,7 +80,7 @@ function getOffset(index) {
|
|
|
79
80
|
v-for="(toast, index) of toasts"
|
|
80
81
|
:key="toast.id"
|
|
81
82
|
ref="refs"
|
|
82
|
-
:progress="progress"
|
|
83
|
+
:progress="props.progress"
|
|
83
84
|
v-bind="omit(toast, ['id', 'close', '_duplicate', '_updated'])"
|
|
84
85
|
:close="toast.close"
|
|
85
86
|
:data-expanded="expanded"
|
|
@@ -94,7 +95,7 @@ function getOffset(index) {
|
|
|
94
95
|
'--transform': 'translateY(var(--translate)) scale(var(--scale))'
|
|
95
96
|
}"
|
|
96
97
|
data-slot="base"
|
|
97
|
-
:class="ui.base({ class: [
|
|
98
|
+
:class="ui.base({ class: [props.ui?.base, toast.onClick ? 'cursor-pointer' : void 0] })"
|
|
98
99
|
@update:open="onUpdateOpen($event, toast.id)"
|
|
99
100
|
@click="toast.onClick && toast.onClick(toast)"
|
|
100
101
|
/>
|
|
@@ -103,11 +104,11 @@ function getOffset(index) {
|
|
|
103
104
|
<ToastViewport
|
|
104
105
|
:data-expanded="expanded"
|
|
105
106
|
data-slot="viewport"
|
|
106
|
-
:class="ui.viewport({ class: [
|
|
107
|
+
:class="ui.viewport({ class: [props.ui?.viewport, props.class] })"
|
|
107
108
|
:style="{
|
|
108
109
|
'--scale-factor': '0.05',
|
|
109
|
-
'--translate-factor': position?.startsWith('top') ? '1px' : '-1px',
|
|
110
|
-
'--gap': position?.startsWith('top') ? '16px' : '-16px',
|
|
110
|
+
'--translate-factor': props.position?.startsWith('top') ? '1px' : '-1px',
|
|
111
|
+
'--gap': props.position?.startsWith('top') ? '16px' : '-16px',
|
|
111
112
|
'--front-height': `${frontHeight}px`,
|
|
112
113
|
'--height': `${height}px`
|
|
113
114
|
}"
|
|
@@ -40,8 +40,8 @@ declare const _default: typeof __VLS_export;
|
|
|
40
40
|
export default _default;
|
|
41
41
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ToasterProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ToasterProps> & Readonly<{}>, {
|
|
42
42
|
progress: boolean;
|
|
43
|
-
max: number;
|
|
44
43
|
expand: boolean;
|
|
44
|
+
max: number;
|
|
45
45
|
duration: number;
|
|
46
46
|
portal: boolean | string | HTMLElement;
|
|
47
47
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ToasterSlots>;
|
|
@@ -5,15 +5,16 @@ import theme from "#build/ui/tooltip";
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed, toRef } from "vue";
|
|
7
7
|
import { defu } from "defu";
|
|
8
|
-
import { TooltipRoot, TooltipTrigger, TooltipPortal, TooltipContent, TooltipArrow,
|
|
8
|
+
import { TooltipRoot, TooltipTrigger, TooltipPortal, TooltipContent, TooltipArrow, injectTooltipProviderContext } from "reka-ui";
|
|
9
9
|
import { reactivePick } from "@vueuse/core";
|
|
10
10
|
import { useAppConfig } from "#imports";
|
|
11
|
-
import {
|
|
11
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
12
|
+
import { useForwardProps } from "../composables/useForwardProps";
|
|
12
13
|
import { FieldGroupReset } from "../composables/useFieldGroup";
|
|
13
14
|
import { usePortal } from "../composables/usePortal";
|
|
14
15
|
import { tv } from "../utils/tv";
|
|
15
16
|
import UKbd from "./Kbd.vue";
|
|
16
|
-
const
|
|
17
|
+
const _props = defineProps({
|
|
17
18
|
text: { type: String, required: false },
|
|
18
19
|
kbds: { type: Array, required: false },
|
|
19
20
|
content: { type: Object, required: false },
|
|
@@ -32,10 +33,10 @@ const props = defineProps({
|
|
|
32
33
|
});
|
|
33
34
|
const emits = defineEmits(["update:open"]);
|
|
34
35
|
const slots = defineSlots();
|
|
36
|
+
const props = useComponentProps("tooltip", _props);
|
|
35
37
|
const appConfig = useAppConfig();
|
|
36
|
-
const uiProp = useComponentUI("tooltip", props);
|
|
37
38
|
const providerContext = injectTooltipProviderContext();
|
|
38
|
-
const rootProps =
|
|
39
|
+
const rootProps = useForwardProps(reactivePick(props, "defaultOpen", "open", "delayDuration", "disableHoverableContent", "disableClosingTrigger", "ignoreNonKeyboardFocus"), emits);
|
|
39
40
|
const portalProps = usePortal(toRef(() => props.portal));
|
|
40
41
|
const contentProps = toRef(() => defu(props.content, providerContext.content.value, { side: "bottom", sideOffset: 8, collisionPadding: 8 }));
|
|
41
42
|
const arrowProps = toRef(() => defu(props.arrow, { rounded: true }));
|
|
@@ -45,23 +46,23 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.tooltip || {}
|
|
|
45
46
|
</script>
|
|
46
47
|
|
|
47
48
|
<template>
|
|
48
|
-
<TooltipRoot v-slot="{ open }" v-bind="rootProps" :disabled="!(text || kbds?.length || !!slots.content) || props.disabled">
|
|
49
|
-
<TooltipTrigger v-if="!!slots.default || !!reference" v-bind="$attrs" as-child :reference="reference" :class="props.class">
|
|
49
|
+
<TooltipRoot v-slot="{ open }" v-bind="rootProps" :disabled="!(props.text || props.kbds?.length || !!slots.content) || props.disabled">
|
|
50
|
+
<TooltipTrigger v-if="!!slots.default || !!props.reference" v-bind="$attrs" as-child :reference="props.reference" :class="props.class">
|
|
50
51
|
<slot :open="open" />
|
|
51
52
|
</TooltipTrigger>
|
|
52
53
|
|
|
53
54
|
<TooltipPortal v-bind="portalProps">
|
|
54
55
|
<FieldGroupReset>
|
|
55
|
-
<TooltipContent v-bind="contentProps" data-slot="content" :class="ui.content({ class: [!slots.default && props.class,
|
|
56
|
+
<TooltipContent v-bind="contentProps" data-slot="content" :class="ui.content({ class: [!slots.default && props.class, props.ui?.content] })">
|
|
56
57
|
<slot name="content" :ui="ui">
|
|
57
|
-
<span v-if="text" data-slot="text" :class="ui.text({ class:
|
|
58
|
+
<span v-if="props.text" data-slot="text" :class="ui.text({ class: props.ui?.text })">{{ props.text }}</span>
|
|
58
59
|
|
|
59
|
-
<span v-if="kbds?.length" data-slot="kbds" :class="ui.kbds({ class:
|
|
60
|
-
<UKbd v-for="(kbd, index) in kbds" :key="index" :size="
|
|
60
|
+
<span v-if="props.kbds?.length" data-slot="kbds" :class="ui.kbds({ class: props.ui?.kbds })">
|
|
61
|
+
<UKbd v-for="(kbd, index) in props.kbds" :key="index" :size="props.ui?.kbdsSize || ui.kbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
61
62
|
</span>
|
|
62
63
|
</slot>
|
|
63
64
|
|
|
64
|
-
<TooltipArrow v-if="!!arrow" v-bind="arrowProps" data-slot="arrow" :class="ui.arrow({ class:
|
|
65
|
+
<TooltipArrow v-if="!!props.arrow" v-bind="arrowProps" data-slot="arrow" :class="ui.arrow({ class: props.ui?.arrow })" />
|
|
65
66
|
</TooltipContent>
|
|
66
67
|
</FieldGroupReset>
|
|
67
68
|
</TooltipPortal>
|
|
@@ -4,17 +4,18 @@ import theme from "#build/ui/tree";
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed, toRef, useTemplateRef } from "vue";
|
|
7
|
-
import { TreeRoot, TreeItem, TreeVirtualizer
|
|
7
|
+
import { TreeRoot, TreeItem, TreeVirtualizer } from "reka-ui";
|
|
8
|
+
import { useForwardProps } from "../composables/useForwardProps";
|
|
8
9
|
import { reactivePick, createReusableTemplate } from "@vueuse/core";
|
|
9
10
|
import { defu } from "defu";
|
|
10
11
|
import { useAppConfig } from "#imports";
|
|
11
|
-
import {
|
|
12
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
12
13
|
import { get } from "../utils";
|
|
13
14
|
import { getEstimateSize } from "../utils/virtualizer";
|
|
14
15
|
import { tv } from "../utils/tv";
|
|
15
16
|
import UIcon from "./Icon.vue";
|
|
16
17
|
defineOptions({ inheritAttrs: false });
|
|
17
|
-
const
|
|
18
|
+
const _props = defineProps({
|
|
18
19
|
as: { type: null, required: false },
|
|
19
20
|
color: { type: null, required: false },
|
|
20
21
|
size: { type: null, required: false },
|
|
@@ -42,9 +43,9 @@ const props = defineProps({
|
|
|
42
43
|
});
|
|
43
44
|
const emits = defineEmits(["update:modelValue", "update:expanded"]);
|
|
44
45
|
const slots = defineSlots();
|
|
46
|
+
const props = useComponentProps("tree", _props);
|
|
45
47
|
const appConfig = useAppConfig();
|
|
46
|
-
const
|
|
47
|
-
const rootProps = useForwardPropsEmits(reactivePick(props, "items", "multiple", "expanded", "disabled", "propagateSelect", "bubbleSelect"), emits);
|
|
48
|
+
const rootProps = useForwardProps(reactivePick(props, "items", "multiple", "expanded", "disabled", "propagateSelect", "bubbleSelect"), emits);
|
|
48
49
|
const as = computed(() => {
|
|
49
50
|
if (typeof props.as === "string" || typeof props.as?.render === "function") {
|
|
50
51
|
return { root: props.as, link: "button" };
|
|
@@ -120,7 +121,7 @@ defineExpose({
|
|
|
120
121
|
<DefineItemTemplate v-slot="{ item, index, level }">
|
|
121
122
|
<li
|
|
122
123
|
role="presentation"
|
|
123
|
-
:class="!!nested && level > 1 ? ui.itemWithChildren({ class: [
|
|
124
|
+
:class="!!nested && level > 1 ? ui.itemWithChildren({ class: [props.ui?.itemWithChildren, item.ui?.itemWithChildren] }) : ui.item({ class: [props.ui?.item, item.ui?.item] })"
|
|
124
125
|
>
|
|
125
126
|
<TreeItem
|
|
126
127
|
v-slot="{ isExpanded, isSelected, isIndeterminate, handleSelect, handleToggle }"
|
|
@@ -138,9 +139,9 @@ defineExpose({
|
|
|
138
139
|
<component
|
|
139
140
|
:is="as.link"
|
|
140
141
|
:type="as.link === 'button' ? 'button' : void 0"
|
|
141
|
-
:disabled="item.disabled || disabled"
|
|
142
|
+
:disabled="item.disabled || props.disabled"
|
|
142
143
|
data-slot="link"
|
|
143
|
-
:class="ui.link({ class: [
|
|
144
|
+
:class="ui.link({ class: [props.ui?.link, item.ui?.link, item.class], selected: isSelected, disabled: item.disabled || props.disabled })"
|
|
144
145
|
:style="!nested && level > 1 ? { paddingLeft: flattenedPaddingFormula(level) } : void 0"
|
|
145
146
|
>
|
|
146
147
|
<slot
|
|
@@ -157,20 +158,20 @@ defineExpose({
|
|
|
157
158
|
v-if="item.icon"
|
|
158
159
|
:name="item.icon"
|
|
159
160
|
data-slot="linkLeadingIcon"
|
|
160
|
-
:class="ui.linkLeadingIcon({ class: [
|
|
161
|
+
:class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, item.ui?.linkLeadingIcon] })"
|
|
161
162
|
/>
|
|
162
163
|
<UIcon
|
|
163
164
|
v-else-if="item.children?.length"
|
|
164
|
-
:name="isExpanded ? expandedIcon ?? appConfig.ui.icons.folderOpen : collapsedIcon ?? appConfig.ui.icons.folder"
|
|
165
|
+
:name="isExpanded ? props.expandedIcon ?? appConfig.ui.icons.folderOpen : props.collapsedIcon ?? appConfig.ui.icons.folder"
|
|
165
166
|
data-slot="linkLeadingIcon"
|
|
166
|
-
:class="ui.linkLeadingIcon({ class: [
|
|
167
|
+
:class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, item.ui?.linkLeadingIcon] })"
|
|
167
168
|
/>
|
|
168
169
|
</slot>
|
|
169
170
|
|
|
170
171
|
<span
|
|
171
172
|
v-if="getItemLabel(item) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']"
|
|
172
173
|
data-slot="linkLabel"
|
|
173
|
-
:class="ui.linkLabel({ class: [
|
|
174
|
+
:class="ui.linkLabel({ class: [props.ui?.linkLabel, item.ui?.linkLabel] })"
|
|
174
175
|
>
|
|
175
176
|
<slot
|
|
176
177
|
:name="item.slot ? `${item.slot}-label` : 'item-label'"
|
|
@@ -184,7 +185,7 @@ defineExpose({
|
|
|
184
185
|
<span
|
|
185
186
|
v-if="item.trailingIcon || item.children?.length || !!slots[item.slot ? `${item.slot}-trailing` : 'item-trailing']"
|
|
186
187
|
data-slot="linkTrailing"
|
|
187
|
-
:class="ui.linkTrailing({ class: [
|
|
188
|
+
:class="ui.linkTrailing({ class: [props.ui?.linkTrailing, item.ui?.linkTrailing] })"
|
|
188
189
|
>
|
|
189
190
|
<slot
|
|
190
191
|
:name="item.slot ? `${item.slot}-trailing` : 'item-trailing'"
|
|
@@ -195,13 +196,13 @@ defineExpose({
|
|
|
195
196
|
v-if="item.trailingIcon"
|
|
196
197
|
:name="item.trailingIcon"
|
|
197
198
|
data-slot="linkTrailingIcon"
|
|
198
|
-
:class="ui.linkTrailingIcon({ class: [
|
|
199
|
+
:class="ui.linkTrailingIcon({ class: [props.ui?.linkTrailingIcon, item.ui?.linkTrailingIcon] })"
|
|
199
200
|
/>
|
|
200
201
|
<UIcon
|
|
201
202
|
v-else-if="item.children?.length"
|
|
202
|
-
:name="trailingIcon ?? appConfig.ui.icons.chevronDown"
|
|
203
|
+
:name="props.trailingIcon ?? appConfig.ui.icons.chevronDown"
|
|
203
204
|
data-slot="linkTrailingIcon"
|
|
204
|
-
:class="ui.linkTrailingIcon({ class: [
|
|
205
|
+
:class="ui.linkTrailingIcon({ class: [props.ui?.linkTrailingIcon, item.ui?.linkTrailingIcon] })"
|
|
205
206
|
/>
|
|
206
207
|
</slot>
|
|
207
208
|
</span>
|
|
@@ -213,7 +214,7 @@ defineExpose({
|
|
|
213
214
|
v-if="nested && item.children?.length && isExpanded"
|
|
214
215
|
role="group"
|
|
215
216
|
data-slot="listWithChildren"
|
|
216
|
-
:class="ui.listWithChildren({ class: [
|
|
217
|
+
:class="ui.listWithChildren({ class: [props.ui?.listWithChildren, item.ui?.listWithChildren] })"
|
|
217
218
|
>
|
|
218
219
|
<ReuseTreeTemplate :items="item.children" :level="level + 1" />
|
|
219
220
|
</ul>
|
|
@@ -230,16 +231,16 @@ defineExpose({
|
|
|
230
231
|
v-slot="{ flattenItems }"
|
|
231
232
|
v-bind="{ ...rootProps, ...$attrs }"
|
|
232
233
|
:as="as.root"
|
|
233
|
-
:model-value="modelValue"
|
|
234
|
-
:default-value="defaultValue"
|
|
234
|
+
:model-value="props.modelValue"
|
|
235
|
+
:default-value="props.defaultValue"
|
|
235
236
|
data-slot="root"
|
|
236
|
-
:class="ui.root({ class: [
|
|
237
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
237
238
|
:get-key="getItemKey"
|
|
238
239
|
:default-expanded="defaultExpanded"
|
|
239
|
-
:selection-behavior="selectionBehavior"
|
|
240
|
+
:selection-behavior="props.selectionBehavior"
|
|
240
241
|
>
|
|
241
242
|
<TreeVirtualizer
|
|
242
|
-
v-if="!!virtualize"
|
|
243
|
+
v-if="!!props.virtualize"
|
|
243
244
|
v-slot="{ item, virtualItem }"
|
|
244
245
|
:text-content="(item2) => getItemLabel(item2.value)"
|
|
245
246
|
v-bind="virtualizerProps"
|
|
@@ -257,6 +258,6 @@ defineExpose({
|
|
|
257
258
|
/>
|
|
258
259
|
</template>
|
|
259
260
|
|
|
260
|
-
<ReuseTreeTemplate v-else :items="items" :level="1" />
|
|
261
|
+
<ReuseTreeTemplate v-else :items="props.items" :level="1" />
|
|
261
262
|
</TreeRoot>
|
|
262
263
|
</template>
|
|
@@ -6,13 +6,14 @@ import theme from "#build/ui/user";
|
|
|
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
|
+
import { usePrefix } from "../composables/usePrefix";
|
|
10
11
|
import { tv } from "../utils/tv";
|
|
11
12
|
import UChip from "./Chip.vue";
|
|
12
13
|
import UAvatar from "./Avatar.vue";
|
|
13
14
|
import ULink from "./Link.vue";
|
|
14
15
|
defineOptions({ inheritAttrs: false });
|
|
15
|
-
const
|
|
16
|
+
const _props = defineProps({
|
|
16
17
|
as: { type: null, required: false },
|
|
17
18
|
name: { type: String, required: false },
|
|
18
19
|
description: { type: String, required: false },
|
|
@@ -27,8 +28,9 @@ const props = defineProps({
|
|
|
27
28
|
ui: { type: Object, required: false }
|
|
28
29
|
});
|
|
29
30
|
const slots = defineSlots();
|
|
31
|
+
const props = useComponentProps("user", _props);
|
|
30
32
|
const appConfig = useAppConfig();
|
|
31
|
-
const
|
|
33
|
+
const prefix = usePrefix();
|
|
32
34
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.user || {} })({
|
|
33
35
|
size: props.size,
|
|
34
36
|
orientation: props.orientation,
|
|
@@ -37,41 +39,41 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.user || {} })
|
|
|
37
39
|
</script>
|
|
38
40
|
|
|
39
41
|
<template>
|
|
40
|
-
<Primitive :as="as" :data-orientation="orientation" data-slot="root" :class="ui.root({ class: [
|
|
42
|
+
<Primitive :as="props.as" :data-orientation="props.orientation" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })" @click="props.onClick">
|
|
41
43
|
<slot name="avatar" :ui="ui">
|
|
42
|
-
<UChip v-if="chip && avatar" inset v-bind="typeof chip === 'object' ? chip : {}" :size="size">
|
|
43
|
-
<UAvatar :alt="name" v-bind="avatar" :size="size" data-slot="avatar" :class="ui.avatar({ class:
|
|
44
|
+
<UChip v-if="props.chip && props.avatar" inset v-bind="typeof props.chip === 'object' ? props.chip : {}" :size="props.size">
|
|
45
|
+
<UAvatar :alt="props.name" v-bind="props.avatar" :size="props.size" data-slot="avatar" :class="ui.avatar({ class: props.ui?.avatar })" />
|
|
44
46
|
</UChip>
|
|
45
47
|
<UAvatar
|
|
46
|
-
v-else-if="avatar"
|
|
47
|
-
:alt="name"
|
|
48
|
-
v-bind="avatar"
|
|
49
|
-
:size="size"
|
|
48
|
+
v-else-if="props.avatar"
|
|
49
|
+
:alt="props.name"
|
|
50
|
+
v-bind="props.avatar"
|
|
51
|
+
:size="props.size"
|
|
50
52
|
data-slot="avatar"
|
|
51
|
-
:class="ui.avatar({ class:
|
|
53
|
+
:class="ui.avatar({ class: props.ui?.avatar })"
|
|
52
54
|
/>
|
|
53
55
|
</slot>
|
|
54
56
|
|
|
55
|
-
<div data-slot="wrapper" :class="ui.wrapper({ class:
|
|
57
|
+
<div data-slot="wrapper" :class="ui.wrapper({ class: props.ui?.wrapper })">
|
|
56
58
|
<ULink
|
|
57
|
-
v-if="to"
|
|
58
|
-
:aria-label="name"
|
|
59
|
-
v-bind="{ to, target, ...$attrs }"
|
|
60
|
-
class="focus:outline-none peer"
|
|
59
|
+
v-if="props.to"
|
|
60
|
+
:aria-label="props.name"
|
|
61
|
+
v-bind="{ to: props.to, target: props.target, ...$attrs }"
|
|
62
|
+
:class="prefix('focus:outline-none peer')"
|
|
61
63
|
raw
|
|
62
64
|
>
|
|
63
|
-
<span class="absolute inset-0" aria-hidden="true" />
|
|
65
|
+
<span :class="prefix('absolute inset-0')" aria-hidden="true" />
|
|
64
66
|
</ULink>
|
|
65
67
|
|
|
66
68
|
<slot>
|
|
67
|
-
<p v-if="name || !!slots.name" data-slot="name" :class="ui.name({ class:
|
|
69
|
+
<p v-if="props.name || !!slots.name" data-slot="name" :class="ui.name({ class: props.ui?.name })">
|
|
68
70
|
<slot name="name">
|
|
69
|
-
{{ name }}
|
|
71
|
+
{{ props.name }}
|
|
70
72
|
</slot>
|
|
71
73
|
</p>
|
|
72
|
-
<p v-if="description || !!slots.description" data-slot="description" :class="ui.description({ class:
|
|
74
|
+
<p v-if="props.description || !!slots.description" data-slot="description" :class="ui.description({ class: props.ui?.description })">
|
|
73
75
|
<slot name="description">
|
|
74
|
-
{{ description }}
|
|
76
|
+
{{ props.description }}
|
|
75
77
|
</slot>
|
|
76
78
|
</p>
|
|
77
79
|
</slot>
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { useForwardProps } from "reka-ui";
|
|
7
7
|
import { reactiveOmit } from "@vueuse/core";
|
|
8
|
+
import { usePrefix } from "../../composables/usePrefix";
|
|
8
9
|
import UAvatar from "../Avatar.vue";
|
|
9
10
|
defineOptions({ inheritAttrs: false });
|
|
10
11
|
const props = defineProps({
|
|
@@ -15,15 +16,17 @@ const props = defineProps({
|
|
|
15
16
|
icon: { type: null, required: false },
|
|
16
17
|
text: { type: String, required: false },
|
|
17
18
|
size: { type: null, required: false },
|
|
19
|
+
color: { type: null, required: false },
|
|
18
20
|
chip: { type: [Boolean, Object], required: false },
|
|
19
21
|
class: { type: null, required: false },
|
|
20
22
|
style: { type: null, required: false },
|
|
21
23
|
ui: { type: Object, required: false }
|
|
22
24
|
});
|
|
23
25
|
const avatarProps = useForwardProps(reactiveOmit(props, "light", "dark"));
|
|
26
|
+
const prefix = usePrefix();
|
|
24
27
|
</script>
|
|
25
28
|
|
|
26
29
|
<template>
|
|
27
|
-
<UAvatar v-bind="{ ...avatarProps, ...$attrs }" :src="light" class="dark:hidden" />
|
|
28
|
-
<UAvatar v-bind="{ ...avatarProps, ...$attrs }" :src="dark" class="hidden dark:block" />
|
|
30
|
+
<UAvatar v-bind="{ ...avatarProps, ...$attrs }" :src="light" :class="prefix('dark:hidden')" />
|
|
31
|
+
<UAvatar v-bind="{ ...avatarProps, ...$attrs }" :src="dark" :class="prefix('hidden dark:block')" />
|
|
29
32
|
</template>
|
|
@@ -12,6 +12,6 @@ export interface ColorModeButtonProps extends Omit<ButtonProps, LinkPropsKeys |
|
|
|
12
12
|
declare const _default: typeof __VLS_export;
|
|
13
13
|
export default _default;
|
|
14
14
|
declare const __VLS_export: import("vue").DefineComponent<ColorModeButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorModeButtonProps> & Readonly<{}>, {
|
|
15
|
-
color: "error" | "primary" | "secondary" | "success" | "info" | "warning"
|
|
15
|
+
color: "error" | "neutral" | "primary" | "secondary" | "success" | "info" | "warning";
|
|
16
16
|
variant: "link" | "solid" | "outline" | "soft" | "subtle" | "ghost";
|
|
17
17
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed } from "vue";
|
|
7
|
-
import { useForwardProps } from "reka-ui";
|
|
8
7
|
import { reactiveOmit } from "@vueuse/core";
|
|
9
8
|
import { useColorMode, useAppConfig } from "#imports";
|
|
10
|
-
import {
|
|
9
|
+
import { useComponentProps } from "../../composables/useComponentProps";
|
|
10
|
+
import { useForwardProps } from "../../composables/useForwardProps";
|
|
11
11
|
import { useLocale } from "../../composables/useLocale";
|
|
12
|
+
import { usePrefix } from "../../composables/usePrefix";
|
|
12
13
|
import UButton from "../Button.vue";
|
|
13
14
|
import UIcon from "../Icon.vue";
|
|
14
15
|
defineOptions({ inheritAttrs: false });
|
|
15
|
-
const
|
|
16
|
+
const _props = defineProps({
|
|
16
17
|
color: { type: null, required: false, default: "neutral" },
|
|
17
18
|
variant: { type: null, required: false, default: "ghost" },
|
|
18
19
|
label: { type: String, required: false },
|
|
@@ -39,10 +40,11 @@ const props = defineProps({
|
|
|
39
40
|
exactActiveClass: { type: String, required: false },
|
|
40
41
|
viewTransition: { type: Boolean, required: false }
|
|
41
42
|
});
|
|
43
|
+
const props = useComponentProps("button", _props);
|
|
42
44
|
const { t } = useLocale();
|
|
43
45
|
const colorMode = useColorMode();
|
|
44
46
|
const appConfig = useAppConfig();
|
|
45
|
-
const
|
|
47
|
+
const prefix = usePrefix();
|
|
46
48
|
const buttonProps = useForwardProps(reactiveOmit(props, "icon"));
|
|
47
49
|
const isDark = computed({
|
|
48
50
|
get() {
|
|
@@ -64,8 +66,8 @@ const isDark = computed({
|
|
|
64
66
|
@click="isDark = !isDark"
|
|
65
67
|
>
|
|
66
68
|
<template #leading="{ ui }">
|
|
67
|
-
<UIcon :class="ui.leadingIcon({ class: [
|
|
68
|
-
<UIcon :class="ui.leadingIcon({ class: [
|
|
69
|
+
<UIcon :class="ui.leadingIcon({ class: [props.ui?.leadingIcon, prefix('hidden dark:inline-block')] })" :name="appConfig.ui.icons.dark" />
|
|
70
|
+
<UIcon :class="ui.leadingIcon({ class: [props.ui?.leadingIcon, prefix('dark:hidden')] })" :name="appConfig.ui.icons.light" />
|
|
69
71
|
</template>
|
|
70
72
|
</UButton>
|
|
71
73
|
</template>
|
|
@@ -12,6 +12,6 @@ export interface ColorModeButtonProps extends Omit<ButtonProps, LinkPropsKeys |
|
|
|
12
12
|
declare const _default: typeof __VLS_export;
|
|
13
13
|
export default _default;
|
|
14
14
|
declare const __VLS_export: import("vue").DefineComponent<ColorModeButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorModeButtonProps> & Readonly<{}>, {
|
|
15
|
-
color: "error" | "primary" | "secondary" | "success" | "info" | "warning"
|
|
15
|
+
color: "error" | "neutral" | "primary" | "secondary" | "success" | "info" | "warning";
|
|
16
16
|
variant: "link" | "solid" | "outline" | "soft" | "subtle" | "ghost";
|
|
17
17
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|