@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
|
@@ -7,20 +7,20 @@ import { computed } from "vue";
|
|
|
7
7
|
import { Primitive } from "reka-ui";
|
|
8
8
|
import { useAppConfig } from "#imports";
|
|
9
9
|
import { tv } from "../utils/tv";
|
|
10
|
-
import {
|
|
11
|
-
const
|
|
10
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
11
|
+
const _props = defineProps({
|
|
12
12
|
as: { type: null, required: false, default: "main" },
|
|
13
13
|
class: { type: null, required: false },
|
|
14
14
|
ui: { type: Object, required: false }
|
|
15
15
|
});
|
|
16
16
|
defineSlots();
|
|
17
|
+
const props = useComponentProps("main", _props);
|
|
17
18
|
const appConfig = useAppConfig();
|
|
18
|
-
const uiProp = useComponentUI("main", props);
|
|
19
19
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.main || {} }));
|
|
20
20
|
</script>
|
|
21
21
|
|
|
22
22
|
<template>
|
|
23
|
-
<Primitive :as="as" :class="ui({ class: [
|
|
23
|
+
<Primitive :as="props.as" :class="ui({ class: [props.ui?.base, props.class] })">
|
|
24
24
|
<slot />
|
|
25
25
|
</Primitive>
|
|
26
26
|
</template>
|
|
@@ -6,9 +6,9 @@ import theme from "#build/ui/marquee";
|
|
|
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 { tv } from "../utils/tv";
|
|
11
|
-
const
|
|
11
|
+
const _props = defineProps({
|
|
12
12
|
as: { type: null, required: false },
|
|
13
13
|
pauseOnHover: { type: Boolean, required: false },
|
|
14
14
|
reverse: { type: Boolean, required: false },
|
|
@@ -19,8 +19,8 @@ const props = defineProps({
|
|
|
19
19
|
ui: { type: Object, required: false }
|
|
20
20
|
});
|
|
21
21
|
defineSlots();
|
|
22
|
+
const props = useComponentProps("marquee", _props);
|
|
22
23
|
const appConfig = useAppConfig();
|
|
23
|
-
const uiProp = useComponentUI("marquee", props);
|
|
24
24
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.marquee || {} })({
|
|
25
25
|
pauseOnHover: props.pauseOnHover,
|
|
26
26
|
orientation: props.orientation,
|
|
@@ -30,8 +30,8 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.marquee || {}
|
|
|
30
30
|
</script>
|
|
31
31
|
|
|
32
32
|
<template>
|
|
33
|
-
<Primitive :as="as" :data-orientation="orientation" data-slot="root" :class="ui.root({ class: [
|
|
34
|
-
<div v-for="i in repeat" :key="i" data-slot="content" :class="ui.content({ class: [
|
|
33
|
+
<Primitive :as="props.as" :data-orientation="props.orientation" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
34
|
+
<div v-for="i in props.repeat" :key="i" data-slot="content" :class="ui.content({ class: [props.ui?.content] })">
|
|
35
35
|
<slot />
|
|
36
36
|
</div>
|
|
37
37
|
</Primitive>
|
|
@@ -98,10 +98,10 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ModalP
|
|
|
98
98
|
"onClose:prevent"?: (() => any) | undefined;
|
|
99
99
|
}>, {
|
|
100
100
|
close: boolean | Omit<ButtonProps, LinkPropsKeys>;
|
|
101
|
-
transition: boolean;
|
|
102
|
-
overlay: boolean;
|
|
103
101
|
modal: boolean;
|
|
102
|
+
transition: boolean;
|
|
104
103
|
portal: boolean | string | HTMLElement;
|
|
104
|
+
overlay: boolean;
|
|
105
105
|
dismissible: boolean;
|
|
106
106
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ModalSlots>;
|
|
107
107
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -4,17 +4,18 @@ import theme from "#build/ui/modal";
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed, toRef } from "vue";
|
|
7
|
-
import { DialogRoot, DialogTrigger, DialogPortal, DialogOverlay, DialogContent, DialogTitle, DialogDescription, DialogClose, VisuallyHidden
|
|
7
|
+
import { DialogRoot, DialogTrigger, DialogPortal, DialogOverlay, DialogContent, DialogTitle, DialogDescription, DialogClose, VisuallyHidden } from "reka-ui";
|
|
8
|
+
import { useForwardProps } from "../composables/useForwardProps";
|
|
8
9
|
import { reactivePick, createReusableTemplate } from "@vueuse/core";
|
|
9
10
|
import { useAppConfig } from "#imports";
|
|
10
|
-
import {
|
|
11
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
11
12
|
import { FieldGroupReset } from "../composables/useFieldGroup";
|
|
12
13
|
import { useLocale } from "../composables/useLocale";
|
|
13
14
|
import { usePortal } from "../composables/usePortal";
|
|
14
15
|
import { pointerDownOutside } from "../utils/overlay";
|
|
15
16
|
import { tv } from "../utils/tv";
|
|
16
17
|
import UButton from "./Button.vue";
|
|
17
|
-
const
|
|
18
|
+
const _props = defineProps({
|
|
18
19
|
title: { type: String, required: false },
|
|
19
20
|
description: { type: String, required: false },
|
|
20
21
|
content: { type: Object, required: false },
|
|
@@ -34,10 +35,10 @@ const props = defineProps({
|
|
|
34
35
|
});
|
|
35
36
|
const emits = defineEmits(["after:leave", "after:enter", "close:prevent", "update:open"]);
|
|
36
37
|
const slots = defineSlots();
|
|
38
|
+
const props = useComponentProps("modal", _props);
|
|
37
39
|
const { t } = useLocale();
|
|
38
40
|
const appConfig = useAppConfig();
|
|
39
|
-
const
|
|
40
|
-
const rootProps = useForwardPropsEmits(reactivePick(props, "open", "defaultOpen", "modal"), emits);
|
|
41
|
+
const rootProps = useForwardProps(reactivePick(props, "open", "defaultOpen", "modal"), emits);
|
|
41
42
|
const portalProps = usePortal(toRef(() => props.portal));
|
|
42
43
|
const contentProps = toRef(() => props.content);
|
|
43
44
|
const contentEvents = computed(() => {
|
|
@@ -69,41 +70,41 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.modal || {} }
|
|
|
69
70
|
<DefineContentTemplate>
|
|
70
71
|
<DialogContent
|
|
71
72
|
data-slot="content"
|
|
72
|
-
:class="ui.content({ class: [!slots.default && props.class,
|
|
73
|
+
:class="ui.content({ class: [!slots.default && props.class, props.ui?.content] })"
|
|
73
74
|
v-bind="contentProps"
|
|
74
75
|
@after-enter="emits('after:enter')"
|
|
75
76
|
@after-leave="emits('after:leave')"
|
|
76
77
|
v-on="contentEvents"
|
|
77
78
|
>
|
|
78
|
-
<VisuallyHidden v-if="!title && !slots.title || !description && !slots.description || !!slots.content">
|
|
79
|
-
<DialogTitle v-if="!title && !slots.title" />
|
|
79
|
+
<VisuallyHidden v-if="!props.title && !slots.title || !props.description && !slots.description || !!slots.content">
|
|
80
|
+
<DialogTitle v-if="!props.title && !slots.title" />
|
|
80
81
|
<DialogTitle v-else-if="!!slots.content">
|
|
81
82
|
<slot name="title">
|
|
82
|
-
{{ title }}
|
|
83
|
+
{{ props.title }}
|
|
83
84
|
</slot>
|
|
84
85
|
</DialogTitle>
|
|
85
86
|
|
|
86
|
-
<DialogDescription v-if="!description && !slots.description" />
|
|
87
|
+
<DialogDescription v-if="!props.description && !slots.description" />
|
|
87
88
|
<DialogDescription v-else-if="!!slots.content">
|
|
88
89
|
<slot name="description">
|
|
89
|
-
{{ description }}
|
|
90
|
+
{{ props.description }}
|
|
90
91
|
</slot>
|
|
91
92
|
</DialogDescription>
|
|
92
93
|
</VisuallyHidden>
|
|
93
94
|
|
|
94
95
|
<slot name="content" :close="close">
|
|
95
|
-
<div v-if="!!slots.header || (title || !!slots.title) || (description || !!slots.description) || (props.close || !!slots.close)" data-slot="header" :class="ui.header({ class:
|
|
96
|
+
<div v-if="!!slots.header || (props.title || !!slots.title) || (props.description || !!slots.description) || (props.close || !!slots.close)" data-slot="header" :class="ui.header({ class: props.ui?.header })">
|
|
96
97
|
<slot name="header" :close="close">
|
|
97
|
-
<div v-if="title || !!slots.title || description || !!slots.description" data-slot="wrapper" :class="ui.wrapper({ class:
|
|
98
|
-
<DialogTitle v-if="title || !!slots.title" data-slot="title" :class="ui.title({ class:
|
|
98
|
+
<div v-if="props.title || !!slots.title || props.description || !!slots.description" data-slot="wrapper" :class="ui.wrapper({ class: props.ui?.wrapper })">
|
|
99
|
+
<DialogTitle v-if="props.title || !!slots.title" data-slot="title" :class="ui.title({ class: props.ui?.title })">
|
|
99
100
|
<slot name="title">
|
|
100
|
-
{{ title }}
|
|
101
|
+
{{ props.title }}
|
|
101
102
|
</slot>
|
|
102
103
|
</DialogTitle>
|
|
103
104
|
|
|
104
|
-
<DialogDescription v-if="description || !!slots.description" data-slot="description" :class="ui.description({ class:
|
|
105
|
+
<DialogDescription v-if="props.description || !!slots.description" data-slot="description" :class="ui.description({ class: props.ui?.description })">
|
|
105
106
|
<slot name="description">
|
|
106
|
-
{{ description }}
|
|
107
|
+
{{ props.description }}
|
|
107
108
|
</slot>
|
|
108
109
|
</DialogDescription>
|
|
109
110
|
</div>
|
|
@@ -114,24 +115,24 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.modal || {} }
|
|
|
114
115
|
<slot name="close" :ui="ui">
|
|
115
116
|
<UButton
|
|
116
117
|
v-if="props.close"
|
|
117
|
-
:icon="closeIcon || appConfig.ui.icons.close"
|
|
118
|
+
:icon="props.closeIcon || appConfig.ui.icons.close"
|
|
118
119
|
color="neutral"
|
|
119
120
|
variant="ghost"
|
|
120
121
|
:aria-label="t('modal.close')"
|
|
121
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
|
/>
|
|
125
126
|
</slot>
|
|
126
127
|
</DialogClose>
|
|
127
128
|
</slot>
|
|
128
129
|
</div>
|
|
129
130
|
|
|
130
|
-
<div v-if="!!slots.body" data-slot="body" :class="ui.body({ class:
|
|
131
|
+
<div v-if="!!slots.body" data-slot="body" :class="ui.body({ class: props.ui?.body })">
|
|
131
132
|
<slot name="body" :close="close" />
|
|
132
133
|
</div>
|
|
133
134
|
|
|
134
|
-
<div v-if="!!slots.footer" data-slot="footer" :class="ui.footer({ class:
|
|
135
|
+
<div v-if="!!slots.footer" data-slot="footer" :class="ui.footer({ class: props.ui?.footer })">
|
|
135
136
|
<slot name="footer" :close="close" />
|
|
136
137
|
</div>
|
|
137
138
|
</slot>
|
|
@@ -144,14 +145,14 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.modal || {} }
|
|
|
144
145
|
|
|
145
146
|
<DialogPortal v-bind="portalProps">
|
|
146
147
|
<FieldGroupReset>
|
|
147
|
-
<template v-if="scrollable">
|
|
148
|
-
<DialogOverlay data-slot="overlay" :class="ui.overlay({ class:
|
|
148
|
+
<template v-if="props.scrollable">
|
|
149
|
+
<DialogOverlay data-slot="overlay" :class="ui.overlay({ class: props.ui?.overlay })">
|
|
149
150
|
<ReuseContentTemplate />
|
|
150
151
|
</DialogOverlay>
|
|
151
152
|
</template>
|
|
152
153
|
|
|
153
154
|
<template v-else>
|
|
154
|
-
<DialogOverlay v-if="overlay" data-slot="overlay" :class="ui.overlay({ class:
|
|
155
|
+
<DialogOverlay v-if="props.overlay" data-slot="overlay" :class="ui.overlay({ class: props.ui?.overlay })" />
|
|
155
156
|
|
|
156
157
|
<ReuseContentTemplate />
|
|
157
158
|
</template>
|
|
@@ -98,10 +98,10 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ModalP
|
|
|
98
98
|
"onClose:prevent"?: (() => any) | undefined;
|
|
99
99
|
}>, {
|
|
100
100
|
close: boolean | Omit<ButtonProps, LinkPropsKeys>;
|
|
101
|
-
transition: boolean;
|
|
102
|
-
overlay: boolean;
|
|
103
101
|
modal: boolean;
|
|
102
|
+
transition: boolean;
|
|
104
103
|
portal: boolean | string | HTMLElement;
|
|
104
|
+
overlay: boolean;
|
|
105
105
|
dismissible: boolean;
|
|
106
106
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ModalSlots>;
|
|
107
107
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -4,11 +4,12 @@ import theme from "#build/ui/navigation-menu";
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed, toRef } from "vue";
|
|
7
|
-
import { NavigationMenuRoot, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, AccordionRoot, AccordionItem, AccordionTrigger, AccordionContent
|
|
7
|
+
import { NavigationMenuRoot, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, AccordionRoot, AccordionItem, AccordionTrigger, AccordionContent } from "reka-ui";
|
|
8
|
+
import { useForwardProps } from "../composables/useForwardProps";
|
|
8
9
|
import { defu } from "defu";
|
|
9
10
|
import { reactivePick, createReusableTemplate } from "@vueuse/core";
|
|
10
11
|
import { useAppConfig } from "#imports";
|
|
11
|
-
import {
|
|
12
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
12
13
|
import { get, isArrayOfArray } from "../utils";
|
|
13
14
|
import { tv } from "../utils/tv";
|
|
14
15
|
import { pickLinkProps } from "../utils/link";
|
|
@@ -21,7 +22,7 @@ import UChip from "./Chip.vue";
|
|
|
21
22
|
import UPopover from "./Popover.vue";
|
|
22
23
|
import UTooltip from "./Tooltip.vue";
|
|
23
24
|
defineOptions({ inheritAttrs: false });
|
|
24
|
-
const
|
|
25
|
+
const _props = defineProps({
|
|
25
26
|
as: { type: null, required: false },
|
|
26
27
|
type: { type: null, required: false, default: "multiple" },
|
|
27
28
|
modelValue: { type: null, required: false },
|
|
@@ -55,9 +56,9 @@ const props = defineProps({
|
|
|
55
56
|
});
|
|
56
57
|
const emits = defineEmits(["update:modelValue"]);
|
|
57
58
|
const slots = defineSlots();
|
|
59
|
+
const props = useComponentProps("navigationMenu", _props);
|
|
58
60
|
const appConfig = useAppConfig();
|
|
59
|
-
const
|
|
60
|
-
const rootProps = useForwardPropsEmits(computed(() => ({
|
|
61
|
+
const rootProps = useForwardProps(computed(() => ({
|
|
61
62
|
as: props.as,
|
|
62
63
|
delayDuration: props.delayDuration,
|
|
63
64
|
skipDelayDuration: props.skipDelayDuration,
|
|
@@ -67,7 +68,7 @@ const rootProps = useForwardPropsEmits(computed(() => ({
|
|
|
67
68
|
disablePointerLeaveClose: props.disablePointerLeaveClose,
|
|
68
69
|
unmountOnHide: props.unmountOnHide
|
|
69
70
|
})), emits);
|
|
70
|
-
const accordionProps =
|
|
71
|
+
const accordionProps = useForwardProps(reactivePick(props, "collapsible", "disabled", "type", "unmountOnHide"), emits);
|
|
71
72
|
const contentProps = toRef(() => props.content);
|
|
72
73
|
const tooltipProps = toRef(() => defu(typeof props.tooltip === "boolean" ? {} : props.tooltip, { ...props.orientation === "vertical" && { delayDuration: 0, content: { side: "right" } } }));
|
|
73
74
|
const popoverProps = toRef(() => defu(typeof props.popover === "boolean" ? {} : props.popover, { mode: "hover", content: { side: "right", align: "start", alignOffset: 2 } }));
|
|
@@ -122,37 +123,37 @@ function onLinkTrailingClick(e, item) {
|
|
|
122
123
|
<DefineLinkTemplate v-slot="{ item, active, index }">
|
|
123
124
|
<slot :name="item.slot || 'item'" :item="item" :index="index" :active="active" :ui="ui">
|
|
124
125
|
<slot :name="item.slot ? `${item.slot}-leading` : 'item-leading'" :item="item" :active="active" :index="index" :ui="ui">
|
|
125
|
-
<UAvatar v-if="item.avatar" :size="item.ui?.linkLeadingAvatarSize ||
|
|
126
|
+
<UAvatar v-if="item.avatar" :size="item.ui?.linkLeadingAvatarSize || props.ui?.linkLeadingAvatarSize || ui.linkLeadingAvatarSize()" v-bind="item.avatar" data-slot="linkLeadingAvatar" :class="ui.linkLeadingAvatar({ class: [props.ui?.linkLeadingAvatar, item.ui?.linkLeadingAvatar], active, disabled: !!item.disabled })" />
|
|
126
127
|
<UChip
|
|
127
128
|
v-else-if="item.icon && item.chip"
|
|
128
|
-
:size="item.ui?.linkLeadingChipSize ||
|
|
129
|
+
:size="item.ui?.linkLeadingChipSize || props.ui?.linkLeadingChipSize || ui.linkLeadingChipSize()"
|
|
129
130
|
inset
|
|
130
131
|
v-bind="typeof item.chip === 'object' ? item.chip : {}"
|
|
131
132
|
data-slot="linkLeadingChip"
|
|
132
133
|
>
|
|
133
|
-
<UIcon :name="item.icon" data-slot="linkLeadingIcon" :class="ui.linkLeadingIcon({ class: [
|
|
134
|
+
<UIcon :name="item.icon" data-slot="linkLeadingIcon" :class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, item.ui?.linkLeadingIcon], active, disabled: !!item.disabled })" />
|
|
134
135
|
</UChip>
|
|
135
|
-
<UIcon v-else-if="item.icon" :name="item.icon" data-slot="linkLeadingIcon" :class="ui.linkLeadingIcon({ class: [
|
|
136
|
+
<UIcon v-else-if="item.icon" :name="item.icon" data-slot="linkLeadingIcon" :class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, item.ui?.linkLeadingIcon], active, disabled: !!item.disabled })" />
|
|
136
137
|
</slot>
|
|
137
138
|
|
|
138
139
|
<span
|
|
139
140
|
v-if="get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']"
|
|
140
141
|
data-slot="linkLabel"
|
|
141
|
-
:class="ui.linkLabel({ class: [
|
|
142
|
+
:class="ui.linkLabel({ class: [props.ui?.linkLabel, item.ui?.linkLabel] })"
|
|
142
143
|
>
|
|
143
144
|
<slot :name="item.slot ? `${item.slot}-label` : 'item-label'" :item="item" :active="active" :index="index">
|
|
144
145
|
{{ get(item, props.labelKey) }}
|
|
145
146
|
</slot>
|
|
146
147
|
|
|
147
|
-
<UIcon v-if="item.target === '_blank' && externalIcon !== false" :name="typeof externalIcon === 'string' ? externalIcon : appConfig.ui.icons.external" data-slot="linkLabelExternalIcon" :class="ui.linkLabelExternalIcon({ class: [
|
|
148
|
+
<UIcon v-if="item.target === '_blank' && props.externalIcon !== false" :name="typeof props.externalIcon === 'string' ? props.externalIcon : appConfig.ui.icons.external" data-slot="linkLabelExternalIcon" :class="ui.linkLabelExternalIcon({ class: [props.ui?.linkLabelExternalIcon, item.ui?.linkLabelExternalIcon], active })" />
|
|
148
149
|
</span>
|
|
149
150
|
|
|
150
151
|
<component
|
|
151
|
-
:is="orientation === 'vertical' && item.children?.length && !collapsed ? AccordionTrigger : 'span'"
|
|
152
|
-
v-if="item.badge || item.badge === 0 || orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content']) || orientation === 'vertical' && item.children?.length || item.trailingIcon || !!slots[item.slot ? `${item.slot}-trailing` : 'item-trailing']"
|
|
153
|
-
:as="orientation === 'vertical' && item.children?.length && !collapsed ? 'span' : void 0"
|
|
152
|
+
:is="props.orientation === 'vertical' && item.children?.length && !props.collapsed ? AccordionTrigger : 'span'"
|
|
153
|
+
v-if="item.badge || item.badge === 0 || props.orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content']) || props.orientation === 'vertical' && item.children?.length || item.trailingIcon || !!slots[item.slot ? `${item.slot}-trailing` : 'item-trailing']"
|
|
154
|
+
:as="props.orientation === 'vertical' && item.children?.length && !props.collapsed ? 'span' : void 0"
|
|
154
155
|
data-slot="linkTrailing"
|
|
155
|
-
:class="ui.linkTrailing({ class: [
|
|
156
|
+
:class="ui.linkTrailing({ class: [props.ui?.linkTrailing, item.ui?.linkTrailing] })"
|
|
156
157
|
@click="(e) => onLinkTrailingClick(e, item)"
|
|
157
158
|
>
|
|
158
159
|
<slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" :item="item" :active="active" :index="index" :ui="ui">
|
|
@@ -160,14 +161,14 @@ function onLinkTrailingClick(e, item) {
|
|
|
160
161
|
v-if="item.badge || item.badge === 0"
|
|
161
162
|
color="neutral"
|
|
162
163
|
variant="outline"
|
|
163
|
-
:size="item.ui?.linkTrailingBadgeSize ||
|
|
164
|
+
:size="item.ui?.linkTrailingBadgeSize || props.ui?.linkTrailingBadgeSize || ui.linkTrailingBadgeSize()"
|
|
164
165
|
v-bind="typeof item.badge === 'string' || typeof item.badge === 'number' ? { label: item.badge } : item.badge"
|
|
165
166
|
data-slot="linkTrailingBadge"
|
|
166
|
-
:class="ui.linkTrailingBadge({ class: [
|
|
167
|
+
:class="ui.linkTrailingBadge({ class: [props.ui?.linkTrailingBadge, item.ui?.linkTrailingBadge] })"
|
|
167
168
|
/>
|
|
168
169
|
|
|
169
|
-
<UIcon v-if="orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content']) || orientation === 'vertical' && item.children?.length" :name="item.trailingIcon || trailingIcon || appConfig.ui.icons.chevronDown" data-slot="linkTrailingIcon" :class="ui.linkTrailingIcon({ class: [
|
|
170
|
-
<UIcon v-else-if="item.trailingIcon" :name="item.trailingIcon" data-slot="linkTrailingIcon" :class="ui.linkTrailingIcon({ class: [
|
|
170
|
+
<UIcon v-if="props.orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content']) || props.orientation === 'vertical' && item.children?.length" :name="item.trailingIcon || props.trailingIcon || appConfig.ui.icons.chevronDown" data-slot="linkTrailingIcon" :class="ui.linkTrailingIcon({ class: [props.ui?.linkTrailingIcon, item.ui?.linkTrailingIcon], active })" />
|
|
171
|
+
<UIcon v-else-if="item.trailingIcon" :name="item.trailingIcon" data-slot="linkTrailingIcon" :class="ui.linkTrailingIcon({ class: [props.ui?.linkTrailingIcon, item.ui?.linkTrailingIcon], active })" />
|
|
171
172
|
</slot>
|
|
172
173
|
</component>
|
|
173
174
|
</slot>
|
|
@@ -175,24 +176,24 @@ function onLinkTrailingClick(e, item) {
|
|
|
175
176
|
|
|
176
177
|
<DefineItemTemplate v-slot="{ item, index, level = 0, listIndex = 0 }">
|
|
177
178
|
<component
|
|
178
|
-
:is="orientation === 'vertical' && !collapsed ? AccordionItem : NavigationMenuItem"
|
|
179
|
+
:is="props.orientation === 'vertical' && !props.collapsed ? AccordionItem : NavigationMenuItem"
|
|
179
180
|
as="li"
|
|
180
|
-
v-bind="orientation === 'vertical' && !collapsed ? { disabled: !!item.disabled } : {}"
|
|
181
|
+
v-bind="props.orientation === 'vertical' && !props.collapsed ? { disabled: !!item.disabled } : {}"
|
|
181
182
|
:value="getItemValue(item, index, level, listIndex)"
|
|
182
183
|
>
|
|
183
|
-
<div v-if="orientation === 'vertical' && item.type === 'label' && !collapsed" data-slot="label" :class="ui.label({ class: [
|
|
184
|
+
<div v-if="props.orientation === 'vertical' && item.type === 'label' && !props.collapsed" data-slot="label" :class="ui.label({ class: [props.ui?.label, item.ui?.label, item.class] })">
|
|
184
185
|
<ReuseLinkTemplate :item="item" :index="index" />
|
|
185
186
|
</div>
|
|
186
|
-
<ULink v-else-if="item.type !== 'label'" v-slot="{ active, ...slotProps }" v-bind="orientation === 'vertical' && item.children?.length && !collapsed && item.type === 'trigger' ? {} : pickLinkProps(item)" custom>
|
|
187
|
+
<ULink v-else-if="item.type !== 'label'" v-slot="{ active, ...slotProps }" v-bind="props.orientation === 'vertical' && item.children?.length && !props.collapsed && item.type === 'trigger' ? {} : pickLinkProps(item)" custom>
|
|
187
188
|
<component
|
|
188
|
-
:is="orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content']) ? NavigationMenuTrigger : orientation === 'vertical' && item.children?.length && !collapsed && !slotProps.href ? AccordionTrigger : NavigationMenuLink"
|
|
189
|
+
:is="props.orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content']) ? NavigationMenuTrigger : props.orientation === 'vertical' && item.children?.length && !props.collapsed && !slotProps.href ? AccordionTrigger : NavigationMenuLink"
|
|
189
190
|
as-child
|
|
190
191
|
:active="active || item.active"
|
|
191
192
|
:disabled="item.disabled"
|
|
192
193
|
@select="item.onSelect"
|
|
193
194
|
>
|
|
194
|
-
<UPopover v-if="orientation === 'vertical' && collapsed && item.children?.length && (!!props.popover || !!item.popover)" v-bind="{ ...popoverProps, ...typeof item.popover === 'boolean' ? {} : item.popover || {} }" :ui="{ content: ui.content({ class: [
|
|
195
|
-
<ULinkBase v-bind="slotProps" data-slot="link" :class="ui.link({ class: [
|
|
195
|
+
<UPopover v-if="props.orientation === 'vertical' && props.collapsed && item.children?.length && (!!props.popover || !!item.popover)" v-bind="{ ...popoverProps, ...typeof item.popover === 'boolean' ? {} : item.popover || {} }" :ui="{ content: ui.content({ class: [props.ui?.content, item.ui?.content] }) }">
|
|
196
|
+
<ULinkBase v-bind="slotProps" data-slot="link" :class="ui.link({ class: [props.ui?.link, item.ui?.link, item.class], active: active || item.active, disabled: !!item.disabled, level: level > 0 })">
|
|
196
197
|
<ReuseLinkTemplate :item="item" :active="active || item.active" :index="index" />
|
|
197
198
|
</ULinkBase>
|
|
198
199
|
|
|
@@ -205,20 +206,20 @@ function onLinkTrailingClick(e, item) {
|
|
|
205
206
|
:ui="ui"
|
|
206
207
|
:close="close"
|
|
207
208
|
>
|
|
208
|
-
<ul data-slot="childList" :class="ui.childList({ class: [
|
|
209
|
-
<li data-slot="childLabel" :class="ui.childLabel({ class: [
|
|
209
|
+
<ul data-slot="childList" :class="ui.childList({ class: [props.ui?.childList, item.ui?.childList] })">
|
|
210
|
+
<li data-slot="childLabel" :class="ui.childLabel({ class: [props.ui?.childLabel, item.ui?.childLabel] })">
|
|
210
211
|
{{ get(item, props.labelKey) }}
|
|
211
212
|
</li>
|
|
212
|
-
<li v-for="(childItem, childIndex) in item.children" :key="childIndex" data-slot="childItem" :class="ui.childItem({ class: [
|
|
213
|
+
<li v-for="(childItem, childIndex) in item.children" :key="childIndex" data-slot="childItem" :class="ui.childItem({ class: [props.ui?.childItem, item.ui?.childItem] })">
|
|
213
214
|
<ULink v-slot="{ active: childActive, ...childSlotProps }" v-bind="pickLinkProps(childItem)" custom>
|
|
214
215
|
<NavigationMenuLink as-child :active="childActive" @select="childItem.onSelect">
|
|
215
|
-
<ULinkBase v-bind="childSlotProps" data-slot="childLink" :class="ui.childLink({ class: [
|
|
216
|
-
<UIcon v-if="childItem.icon" :name="childItem.icon" data-slot="childLinkIcon" :class="ui.childLinkIcon({ class: [
|
|
216
|
+
<ULinkBase v-bind="childSlotProps" data-slot="childLink" :class="ui.childLink({ class: [props.ui?.childLink, item.ui?.childLink, childItem.class], active: childActive })">
|
|
217
|
+
<UIcon v-if="childItem.icon" :name="childItem.icon" data-slot="childLinkIcon" :class="ui.childLinkIcon({ class: [props.ui?.childLinkIcon, item.ui?.childLinkIcon], active: childActive })" />
|
|
217
218
|
|
|
218
|
-
<span data-slot="childLinkLabel" :class="ui.childLinkLabel({ class: [
|
|
219
|
+
<span data-slot="childLinkLabel" :class="ui.childLinkLabel({ class: [props.ui?.childLinkLabel, item.ui?.childLinkLabel], active: childActive })">
|
|
219
220
|
{{ get(childItem, props.labelKey) }}
|
|
220
221
|
|
|
221
|
-
<UIcon v-if="childItem.target === '_blank' && externalIcon !== false" :name="typeof externalIcon === 'string' ? externalIcon : appConfig.ui.icons.external" data-slot="childLinkLabelExternalIcon" :class="ui.childLinkLabelExternalIcon({ class: [
|
|
222
|
+
<UIcon v-if="childItem.target === '_blank' && props.externalIcon !== false" :name="typeof props.externalIcon === 'string' ? props.externalIcon : appConfig.ui.icons.external" data-slot="childLinkLabelExternalIcon" :class="ui.childLinkLabelExternalIcon({ class: [props.ui?.childLinkLabelExternalIcon, item.ui?.childLinkLabelExternalIcon], active: childActive })" />
|
|
222
223
|
</span>
|
|
223
224
|
</ULinkBase>
|
|
224
225
|
</NavigationMenuLink>
|
|
@@ -228,32 +229,32 @@ function onLinkTrailingClick(e, item) {
|
|
|
228
229
|
</slot>
|
|
229
230
|
</template>
|
|
230
231
|
</UPopover>
|
|
231
|
-
<UTooltip v-else-if="orientation === 'vertical' && collapsed && (!!props.tooltip || !!item.tooltip) || orientation === 'horizontal' && !!item.tooltip" :text="get(item, props.labelKey)" v-bind="{ ...tooltipProps, ...typeof item.tooltip === 'boolean' ? {} : item.tooltip || {} }">
|
|
232
|
-
<ULinkBase v-bind="slotProps" data-slot="link" :class="ui.link({ class: [
|
|
232
|
+
<UTooltip v-else-if="props.orientation === 'vertical' && props.collapsed && (!!props.tooltip || !!item.tooltip) || props.orientation === 'horizontal' && !!item.tooltip" :text="get(item, props.labelKey)" v-bind="{ ...tooltipProps, ...typeof item.tooltip === 'boolean' ? {} : item.tooltip || {} }">
|
|
233
|
+
<ULinkBase v-bind="slotProps" data-slot="link" :class="ui.link({ class: [props.ui?.link, item.ui?.link, item.class], active: active || item.active, disabled: !!item.disabled, level: level > 0 })">
|
|
233
234
|
<ReuseLinkTemplate :item="item" :active="active || item.active" :index="index" />
|
|
234
235
|
</ULinkBase>
|
|
235
236
|
</UTooltip>
|
|
236
|
-
<ULinkBase v-else v-bind="slotProps" data-slot="link" :class="ui.link({ class: [
|
|
237
|
+
<ULinkBase v-else v-bind="slotProps" data-slot="link" :class="ui.link({ class: [props.ui?.link, item.ui?.link, item.class], active: active || item.active, disabled: !!item.disabled, level: props.orientation === 'horizontal' || level > 0 })">
|
|
237
238
|
<ReuseLinkTemplate :item="item" :active="active || item.active" :index="index" />
|
|
238
239
|
</ULinkBase>
|
|
239
240
|
</component>
|
|
240
241
|
|
|
241
|
-
<NavigationMenuContent v-if="orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content'])" v-bind="contentProps" data-slot="content" :class="ui.content({ class: [
|
|
242
|
+
<NavigationMenuContent v-if="props.orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content'])" v-bind="contentProps" data-slot="content" :class="ui.content({ class: [props.ui?.content, item.ui?.content] })">
|
|
242
243
|
<slot :name="item.slot ? `${item.slot}-content` : 'item-content'" :item="item" :active="active || item.active" :index="index" :ui="ui">
|
|
243
|
-
<ul data-slot="childList" :class="ui.childList({ class: [
|
|
244
|
-
<li v-for="(childItem, childIndex) in item.children" :key="childIndex" data-slot="childItem" :class="ui.childItem({ class: [
|
|
244
|
+
<ul data-slot="childList" :class="ui.childList({ class: [props.ui?.childList, item.ui?.childList] })">
|
|
245
|
+
<li v-for="(childItem, childIndex) in item.children" :key="childIndex" data-slot="childItem" :class="ui.childItem({ class: [props.ui?.childItem, item.ui?.childItem] })">
|
|
245
246
|
<ULink v-slot="{ active: childActive, ...childSlotProps }" v-bind="pickLinkProps(childItem)" custom>
|
|
246
247
|
<NavigationMenuLink as-child :active="childActive" @select="childItem.onSelect">
|
|
247
|
-
<ULinkBase v-bind="childSlotProps" data-slot="childLink" :class="ui.childLink({ class: [
|
|
248
|
-
<UIcon v-if="childItem.icon" :name="childItem.icon" data-slot="childLinkIcon" :class="ui.childLinkIcon({ class: [
|
|
248
|
+
<ULinkBase v-bind="childSlotProps" data-slot="childLink" :class="ui.childLink({ class: [props.ui?.childLink, item.ui?.childLink, childItem.class], active: childActive })">
|
|
249
|
+
<UIcon v-if="childItem.icon" :name="childItem.icon" data-slot="childLinkIcon" :class="ui.childLinkIcon({ class: [props.ui?.childLinkIcon, item.ui?.childLinkIcon], active: childActive })" />
|
|
249
250
|
|
|
250
|
-
<div data-slot="childLinkWrapper" :class="ui.childLinkWrapper({ class: [
|
|
251
|
-
<p data-slot="childLinkLabel" :class="ui.childLinkLabel({ class: [
|
|
251
|
+
<div data-slot="childLinkWrapper" :class="ui.childLinkWrapper({ class: [props.ui?.childLinkWrapper, item.ui?.childLinkWrapper] })">
|
|
252
|
+
<p data-slot="childLinkLabel" :class="ui.childLinkLabel({ class: [props.ui?.childLinkLabel, item.ui?.childLinkLabel], active: childActive })">
|
|
252
253
|
{{ get(childItem, props.labelKey) }}
|
|
253
254
|
|
|
254
|
-
<UIcon v-if="childItem.target === '_blank' && externalIcon !== false" :name="typeof externalIcon === 'string' ? externalIcon : appConfig.ui.icons.external" data-slot="childLinkLabelExternalIcon" :class="ui.childLinkLabelExternalIcon({ class: [
|
|
255
|
+
<UIcon v-if="childItem.target === '_blank' && props.externalIcon !== false" :name="typeof props.externalIcon === 'string' ? props.externalIcon : appConfig.ui.icons.external" data-slot="childLinkLabelExternalIcon" :class="ui.childLinkLabelExternalIcon({ class: [props.ui?.childLinkLabelExternalIcon, item.ui?.childLinkLabelExternalIcon], active: childActive })" />
|
|
255
256
|
</p>
|
|
256
|
-
<p v-if="childItem.description" data-slot="childLinkDescription" :class="ui.childLinkDescription({ class: [
|
|
257
|
+
<p v-if="childItem.description" data-slot="childLinkDescription" :class="ui.childLinkDescription({ class: [props.ui?.childLinkDescription, item.ui?.childLinkDescription], active: childActive })">
|
|
257
258
|
{{ childItem.description }}
|
|
258
259
|
</p>
|
|
259
260
|
</div>
|
|
@@ -266,7 +267,7 @@ function onLinkTrailingClick(e, item) {
|
|
|
266
267
|
</NavigationMenuContent>
|
|
267
268
|
</ULink>
|
|
268
269
|
|
|
269
|
-
<AccordionContent v-if="orientation === 'vertical' && item.children?.length && !collapsed" data-slot="content" :class="ui.content({ class: [
|
|
270
|
+
<AccordionContent v-if="props.orientation === 'vertical' && item.children?.length && !props.collapsed" data-slot="content" :class="ui.content({ class: [props.ui?.content, item.ui?.content] })">
|
|
270
271
|
<AccordionRoot
|
|
271
272
|
v-bind="{
|
|
272
273
|
...accordionProps,
|
|
@@ -274,7 +275,7 @@ function onLinkTrailingClick(e, item) {
|
|
|
274
275
|
}"
|
|
275
276
|
as="ul"
|
|
276
277
|
data-slot="childList"
|
|
277
|
-
:class="ui.childList({ class: [
|
|
278
|
+
:class="ui.childList({ class: [props.ui?.childList, item.ui?.childList] })"
|
|
278
279
|
>
|
|
279
280
|
<ReuseItemTemplate
|
|
280
281
|
v-for="(childItem, childIndex) in item.children"
|
|
@@ -284,7 +285,7 @@ function onLinkTrailingClick(e, item) {
|
|
|
284
285
|
:level="level + 1"
|
|
285
286
|
:list-index="listIndex"
|
|
286
287
|
data-slot="childItem"
|
|
287
|
-
:class="ui.childItem({ class: [
|
|
288
|
+
:class="ui.childItem({ class: [props.ui?.childItem, childItem.ui?.childItem] })"
|
|
288
289
|
/>
|
|
289
290
|
</AccordionRoot>
|
|
290
291
|
</AccordionContent>
|
|
@@ -294,29 +295,29 @@ function onLinkTrailingClick(e, item) {
|
|
|
294
295
|
<NavigationMenuRoot
|
|
295
296
|
v-bind="{
|
|
296
297
|
...rootProps,
|
|
297
|
-
...orientation === 'horizontal' ? {
|
|
298
|
-
modelValue,
|
|
299
|
-
defaultValue
|
|
298
|
+
...props.orientation === 'horizontal' ? {
|
|
299
|
+
modelValue: props.modelValue,
|
|
300
|
+
defaultValue: props.defaultValue
|
|
300
301
|
} : {},
|
|
301
302
|
...$attrs
|
|
302
303
|
}"
|
|
303
|
-
:data-collapsed="collapsed"
|
|
304
|
+
:data-collapsed="props.collapsed"
|
|
304
305
|
data-slot="root"
|
|
305
|
-
:class="ui.root({ class: [
|
|
306
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
306
307
|
>
|
|
307
308
|
<slot name="list-leading" />
|
|
308
309
|
|
|
309
310
|
<template v-for="(list, listIndex) in lists" :key="`list-${listIndex}`">
|
|
310
311
|
<component
|
|
311
|
-
v-bind="orientation === 'vertical' && !collapsed ? {
|
|
312
|
+
v-bind="props.orientation === 'vertical' && !props.collapsed ? {
|
|
312
313
|
...accordionProps,
|
|
313
|
-
modelValue,
|
|
314
|
-
defaultValue: defaultValue ?? getAccordionDefaultValue(list, 0, listIndex)
|
|
314
|
+
modelValue: props.modelValue,
|
|
315
|
+
defaultValue: props.defaultValue ?? getAccordionDefaultValue(list, 0, listIndex)
|
|
315
316
|
} : {}"
|
|
316
|
-
:is="orientation === 'vertical' ? AccordionRoot : NavigationMenuList"
|
|
317
|
+
:is="props.orientation === 'vertical' ? AccordionRoot : NavigationMenuList"
|
|
317
318
|
as="ul"
|
|
318
319
|
data-slot="list"
|
|
319
|
-
:class="ui.list({ class:
|
|
320
|
+
:class="ui.list({ class: props.ui?.list })"
|
|
320
321
|
>
|
|
321
322
|
<ReuseItemTemplate
|
|
322
323
|
v-for="(item, index) in list"
|
|
@@ -325,21 +326,21 @@ function onLinkTrailingClick(e, item) {
|
|
|
325
326
|
:index="index"
|
|
326
327
|
:list-index="listIndex"
|
|
327
328
|
data-slot="item"
|
|
328
|
-
:class="ui.item({ class: [
|
|
329
|
+
:class="ui.item({ class: [props.ui?.item, item.ui?.item] })"
|
|
329
330
|
/>
|
|
330
331
|
</component>
|
|
331
332
|
|
|
332
|
-
<div v-if="orientation === 'vertical' && listIndex < lists.length - 1" data-slot="separator" :class="ui.separator({ class:
|
|
333
|
+
<div v-if="props.orientation === 'vertical' && listIndex < lists.length - 1" data-slot="separator" :class="ui.separator({ class: props.ui?.separator })" />
|
|
333
334
|
</template>
|
|
334
335
|
|
|
335
336
|
<slot name="list-trailing" />
|
|
336
337
|
|
|
337
|
-
<div v-if="orientation === 'horizontal'" data-slot="viewportWrapper" :class="ui.viewportWrapper({ class:
|
|
338
|
-
<NavigationMenuIndicator v-if="arrow" data-slot="indicator" :class="ui.indicator({ class:
|
|
339
|
-
<div data-slot="arrow" :class="ui.arrow({ class:
|
|
338
|
+
<div v-if="props.orientation === 'horizontal'" data-slot="viewportWrapper" :class="ui.viewportWrapper({ class: props.ui?.viewportWrapper })">
|
|
339
|
+
<NavigationMenuIndicator v-if="props.arrow" data-slot="indicator" :class="ui.indicator({ class: props.ui?.indicator })">
|
|
340
|
+
<div data-slot="arrow" :class="ui.arrow({ class: props.ui?.arrow })" />
|
|
340
341
|
</NavigationMenuIndicator>
|
|
341
342
|
|
|
342
|
-
<NavigationMenuViewport data-slot="viewport" :class="ui.viewport({ class:
|
|
343
|
+
<NavigationMenuViewport data-slot="viewport" :class="ui.viewport({ class: props.ui?.viewport })" />
|
|
343
344
|
</div>
|
|
344
345
|
</NavigationMenuRoot>
|
|
345
346
|
</template>
|
|
@@ -6,16 +6,16 @@ import theme from "#build/ui/page";
|
|
|
6
6
|
import { computed, onBeforeUpdate, shallowRef } from "vue";
|
|
7
7
|
import { Primitive, Slot } from "reka-ui";
|
|
8
8
|
import { useAppConfig } from "#imports";
|
|
9
|
-
import {
|
|
9
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
10
10
|
import { tv } from "../utils/tv";
|
|
11
|
-
const
|
|
11
|
+
const _props = defineProps({
|
|
12
12
|
as: { type: null, required: false },
|
|
13
13
|
class: { type: null, required: false },
|
|
14
14
|
ui: { type: Object, required: false }
|
|
15
15
|
});
|
|
16
16
|
const slots = defineSlots();
|
|
17
|
+
const props = useComponentProps("page", _props);
|
|
17
18
|
const appConfig = useAppConfig();
|
|
18
|
-
const uiProp = useComponentUI("page", props);
|
|
19
19
|
const hasLeft = shallowRef(!!slots.left);
|
|
20
20
|
const hasRight = shallowRef(!!slots.right);
|
|
21
21
|
onBeforeUpdate(() => {
|
|
@@ -29,16 +29,16 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.page || {} })
|
|
|
29
29
|
</script>
|
|
30
30
|
|
|
31
31
|
<template>
|
|
32
|
-
<Primitive :as="as" data-slot="root" :class="ui.root({ class: [
|
|
33
|
-
<Slot v-if="!!slots.left" data-slot="left" :class="ui.left({ class:
|
|
32
|
+
<Primitive :as="props.as" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
33
|
+
<Slot v-if="!!slots.left" data-slot="left" :class="ui.left({ class: props.ui?.left })">
|
|
34
34
|
<slot name="left" />
|
|
35
35
|
</Slot>
|
|
36
36
|
|
|
37
|
-
<div data-slot="center" :class="ui.center({ class:
|
|
37
|
+
<div data-slot="center" :class="ui.center({ class: props.ui?.center })">
|
|
38
38
|
<slot />
|
|
39
39
|
</div>
|
|
40
40
|
|
|
41
|
-
<Slot v-if="!!slots.right" data-slot="right" :class="ui.right({ class:
|
|
41
|
+
<Slot v-if="!!slots.right" data-slot="right" :class="ui.right({ class: props.ui?.right })">
|
|
42
42
|
<slot name="right" />
|
|
43
43
|
</Slot>
|
|
44
44
|
</Primitive>
|