@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
|
@@ -20,6 +20,8 @@ export interface SwitchProps<T = boolean> extends Pick<SwitchRootProps<T>, 'disa
|
|
|
20
20
|
* @defaultValue 'md'
|
|
21
21
|
*/
|
|
22
22
|
size?: Switch['variants']['size'];
|
|
23
|
+
/** Highlight the ring color like a focus state. */
|
|
24
|
+
highlight?: boolean;
|
|
23
25
|
/** When `true`, the loading icon will be displayed. */
|
|
24
26
|
loading?: boolean;
|
|
25
27
|
/**
|
|
@@ -4,18 +4,19 @@ import theme from "#build/ui/table";
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed, useTemplateRef, watch, toRef } from "vue";
|
|
7
|
-
import { Primitive
|
|
7
|
+
import { Primitive } from "reka-ui";
|
|
8
8
|
import { upperFirst } from "scule";
|
|
9
9
|
import { defu } from "defu";
|
|
10
10
|
import { FlexRender, getCoreRowModel, getFilteredRowModel, getSortedRowModel, getExpandedRowModel, useVueTable } from "@tanstack/vue-table";
|
|
11
11
|
import { useVirtualizer } from "@tanstack/vue-virtual";
|
|
12
12
|
import { reactivePick, createReusableTemplate, createRef } from "@vueuse/core";
|
|
13
13
|
import { useAppConfig } from "#imports";
|
|
14
|
-
import {
|
|
14
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
15
|
+
import { useForwardProps } from "../composables/useForwardProps";
|
|
15
16
|
import { useLocale } from "../composables/useLocale";
|
|
16
17
|
import { tv } from "../utils/tv";
|
|
17
18
|
defineOptions({ inheritAttrs: false });
|
|
18
|
-
const
|
|
19
|
+
const _props = defineProps({
|
|
19
20
|
as: { type: null, required: false },
|
|
20
21
|
data: { type: Array, required: false },
|
|
21
22
|
columns: { type: Array, required: false },
|
|
@@ -65,9 +66,9 @@ const props = defineProps({
|
|
|
65
66
|
mergeOptions: { type: Function, required: false }
|
|
66
67
|
});
|
|
67
68
|
const slots = defineSlots();
|
|
69
|
+
const props = useComponentProps("table", _props);
|
|
68
70
|
const { t } = useLocale();
|
|
69
71
|
const appConfig = useAppConfig();
|
|
70
|
-
const uiProp = useComponentUI("table", props);
|
|
71
72
|
const data = createRef(props.data ?? [], props.watchOptions?.deep !== false);
|
|
72
73
|
const meta = computed(() => props.meta ?? {});
|
|
73
74
|
const columns = computed(() => processColumns(props.columns ?? Object.keys(data.value[0] ?? {}).map((accessorKey) => ({ accessorKey, header: upperFirst(accessorKey) }))));
|
|
@@ -315,7 +316,7 @@ defineExpose({
|
|
|
315
316
|
data-slot="tr"
|
|
316
317
|
:class="ui.tr({
|
|
317
318
|
class: [
|
|
318
|
-
|
|
319
|
+
props.ui?.tr,
|
|
319
320
|
resolveValue(tableApi.options.meta?.class?.tr, row)
|
|
320
321
|
]
|
|
321
322
|
})"
|
|
@@ -334,7 +335,7 @@ defineExpose({
|
|
|
334
335
|
data-slot="td"
|
|
335
336
|
:class="ui.td({
|
|
336
337
|
class: [
|
|
337
|
-
|
|
338
|
+
props.ui?.td,
|
|
338
339
|
resolveValue(cell.column.columnDef.meta?.class?.td, cell)
|
|
339
340
|
],
|
|
340
341
|
pinned: !!cell.column.getIsPinned()
|
|
@@ -350,23 +351,23 @@ defineExpose({
|
|
|
350
351
|
</td>
|
|
351
352
|
</tr>
|
|
352
353
|
|
|
353
|
-
<tr v-if="row.getIsExpanded()" data-slot="tr" :class="ui.tr({ class: [
|
|
354
|
-
<td :colspan="row.getAllCells().length" data-slot="td" :class="ui.td({ class: [
|
|
354
|
+
<tr v-if="row.getIsExpanded()" data-slot="tr" :class="ui.tr({ class: [props.ui?.tr] })">
|
|
355
|
+
<td :colspan="row.getAllCells().length" data-slot="td" :class="ui.td({ class: [props.ui?.td] })">
|
|
355
356
|
<slot name="expanded" :row="row" />
|
|
356
357
|
</td>
|
|
357
358
|
</tr>
|
|
358
359
|
</DefineRowTemplate>
|
|
359
360
|
|
|
360
361
|
<DefineTableTemplate>
|
|
361
|
-
<table ref="tableRef" data-slot="base" :class="ui.base({ class: [
|
|
362
|
-
<caption v-if="caption || !!slots.caption" data-slot="caption" :class="ui.caption({ class: [
|
|
362
|
+
<table ref="tableRef" data-slot="base" :class="ui.base({ class: [props.ui?.base] })">
|
|
363
|
+
<caption v-if="props.caption || !!slots.caption" data-slot="caption" :class="ui.caption({ class: [props.ui?.caption] })">
|
|
363
364
|
<slot name="caption">
|
|
364
|
-
{{ caption }}
|
|
365
|
+
{{ props.caption }}
|
|
365
366
|
</slot>
|
|
366
367
|
</caption>
|
|
367
368
|
|
|
368
|
-
<thead data-slot="thead" :class="ui.thead({ class: [
|
|
369
|
-
<tr v-for="headerGroup in tableApi.getHeaderGroups()" :key="headerGroup.id" data-slot="tr" :class="ui.tr({ class: [
|
|
369
|
+
<thead data-slot="thead" :class="ui.thead({ class: [props.ui?.thead] })">
|
|
370
|
+
<tr v-for="headerGroup in tableApi.getHeaderGroups()" :key="headerGroup.id" data-slot="tr" :class="ui.tr({ class: [props.ui?.tr] })">
|
|
370
371
|
<th
|
|
371
372
|
v-for="header in headerGroup.headers"
|
|
372
373
|
:key="header.id"
|
|
@@ -377,7 +378,7 @@ defineExpose({
|
|
|
377
378
|
data-slot="th"
|
|
378
379
|
:class="ui.th({
|
|
379
380
|
class: [
|
|
380
|
-
|
|
381
|
+
props.ui?.th,
|
|
381
382
|
resolveValue(header.column.columnDef.meta?.class?.th, header)
|
|
382
383
|
],
|
|
383
384
|
pinned: !!header.column.getIsPinned()
|
|
@@ -393,10 +394,10 @@ defineExpose({
|
|
|
393
394
|
</th>
|
|
394
395
|
</tr>
|
|
395
396
|
|
|
396
|
-
<tr data-slot="separator" :class="ui.separator({ class: [
|
|
397
|
+
<tr data-slot="separator" :class="ui.separator({ class: [props.ui?.separator] })" />
|
|
397
398
|
</thead>
|
|
398
399
|
|
|
399
|
-
<tbody data-slot="tbody" :class="ui.tbody({ class: [
|
|
400
|
+
<tbody data-slot="tbody" :class="ui.tbody({ class: [props.ui?.tbody] })">
|
|
400
401
|
<slot name="body-top" />
|
|
401
402
|
|
|
402
403
|
<template v-if="rows.length">
|
|
@@ -425,16 +426,16 @@ defineExpose({
|
|
|
425
426
|
<ReuseRowTemplate v-for="row in bottomRows" :key="row.id" :row="row" />
|
|
426
427
|
</template>
|
|
427
428
|
|
|
428
|
-
<tr v-else-if="loading && !!slots['loading']">
|
|
429
|
-
<td :colspan="tableApi.getAllLeafColumns().length" data-slot="loading" :class="ui.loading({ class:
|
|
429
|
+
<tr v-else-if="props.loading && !!slots['loading']">
|
|
430
|
+
<td :colspan="tableApi.getAllLeafColumns().length" data-slot="loading" :class="ui.loading({ class: props.ui?.loading })">
|
|
430
431
|
<slot name="loading" />
|
|
431
432
|
</td>
|
|
432
433
|
</tr>
|
|
433
434
|
|
|
434
435
|
<tr v-else>
|
|
435
|
-
<td :colspan="tableApi.getAllLeafColumns().length" data-slot="empty" :class="ui.empty({ class:
|
|
436
|
+
<td :colspan="tableApi.getAllLeafColumns().length" data-slot="empty" :class="ui.empty({ class: props.ui?.empty })">
|
|
436
437
|
<slot name="empty">
|
|
437
|
-
{{ empty || t("table.noData") }}
|
|
438
|
+
{{ props.empty || t("table.noData") }}
|
|
438
439
|
</slot>
|
|
439
440
|
</td>
|
|
440
441
|
</tr>
|
|
@@ -445,11 +446,11 @@ defineExpose({
|
|
|
445
446
|
<tfoot
|
|
446
447
|
v-if="hasFooter"
|
|
447
448
|
data-slot="tfoot"
|
|
448
|
-
:class="ui.tfoot({ class: [
|
|
449
|
+
:class="ui.tfoot({ class: [props.ui?.tfoot] })"
|
|
449
450
|
>
|
|
450
|
-
<tr data-slot="separator" :class="ui.separator({ class: [
|
|
451
|
+
<tr data-slot="separator" :class="ui.separator({ class: [props.ui?.separator] })" />
|
|
451
452
|
|
|
452
|
-
<tr v-for="footerGroup in tableApi.getFooterGroups()" :key="footerGroup.id" data-slot="tr" :class="ui.tr({ class: [
|
|
453
|
+
<tr v-for="footerGroup in tableApi.getFooterGroups()" :key="footerGroup.id" data-slot="tr" :class="ui.tr({ class: [props.ui?.tr] })">
|
|
453
454
|
<th
|
|
454
455
|
v-for="header in footerGroup.headers"
|
|
455
456
|
:key="header.id"
|
|
@@ -459,7 +460,7 @@ defineExpose({
|
|
|
459
460
|
data-slot="th"
|
|
460
461
|
:class="ui.th({
|
|
461
462
|
class: [
|
|
462
|
-
|
|
463
|
+
props.ui?.th,
|
|
463
464
|
resolveValue(header.column.columnDef.meta?.class?.th, header)
|
|
464
465
|
],
|
|
465
466
|
pinned: !!header.column.getIsPinned()
|
|
@@ -478,7 +479,7 @@ defineExpose({
|
|
|
478
479
|
</table>
|
|
479
480
|
</DefineTableTemplate>
|
|
480
481
|
|
|
481
|
-
<Primitive ref="rootRef" :as="as" v-bind="$attrs" data-slot="root" :class="ui.root({ class: [
|
|
482
|
+
<Primitive ref="rootRef" :as="props.as" v-bind="$attrs" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
482
483
|
<ReuseTableTemplate />
|
|
483
484
|
</Primitive>
|
|
484
485
|
</template>
|
|
@@ -4,16 +4,17 @@ import theme from "#build/ui/tabs";
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { ref, computed } from "vue";
|
|
7
|
-
import { TabsRoot, TabsList, TabsIndicator, TabsTrigger, TabsContent
|
|
7
|
+
import { TabsRoot, TabsList, TabsIndicator, TabsTrigger, TabsContent } from "reka-ui";
|
|
8
|
+
import { useForwardProps } from "../composables/useForwardProps";
|
|
8
9
|
import { reactivePick } from "@vueuse/core";
|
|
9
10
|
import { useAppConfig } from "#imports";
|
|
10
|
-
import {
|
|
11
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
11
12
|
import { get } from "../utils";
|
|
12
13
|
import { tv } from "../utils/tv";
|
|
13
14
|
import UIcon from "./Icon.vue";
|
|
14
15
|
import UAvatar from "./Avatar.vue";
|
|
15
16
|
import UBadge from "./Badge.vue";
|
|
16
|
-
const
|
|
17
|
+
const _props = defineProps({
|
|
17
18
|
as: { type: null, required: false },
|
|
18
19
|
items: { type: Array, required: false },
|
|
19
20
|
color: { type: null, required: false },
|
|
@@ -32,9 +33,9 @@ const props = defineProps({
|
|
|
32
33
|
});
|
|
33
34
|
const emits = defineEmits(["update:modelValue"]);
|
|
34
35
|
const slots = defineSlots();
|
|
36
|
+
const props = useComponentProps("tabs", _props);
|
|
35
37
|
const appConfig = useAppConfig();
|
|
36
|
-
const
|
|
37
|
-
const rootProps = useForwardPropsEmits(reactivePick(props, "as", "unmountOnHide"), emits);
|
|
38
|
+
const rootProps = useForwardProps(reactivePick(props, "as", "unmountOnHide"), emits);
|
|
38
39
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.tabs || {} })({
|
|
39
40
|
color: props.color,
|
|
40
41
|
variant: props.variant,
|
|
@@ -53,33 +54,33 @@ defineExpose({
|
|
|
53
54
|
<template>
|
|
54
55
|
<TabsRoot
|
|
55
56
|
v-bind="rootProps"
|
|
56
|
-
:model-value="modelValue"
|
|
57
|
-
:default-value="defaultValue"
|
|
58
|
-
:orientation="orientation"
|
|
59
|
-
:activation-mode="activationMode"
|
|
57
|
+
:model-value="props.modelValue"
|
|
58
|
+
:default-value="props.defaultValue"
|
|
59
|
+
:orientation="props.orientation"
|
|
60
|
+
:activation-mode="props.activationMode"
|
|
60
61
|
data-slot="root"
|
|
61
|
-
:class="ui.root({ class: [
|
|
62
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
62
63
|
>
|
|
63
|
-
<TabsList data-slot="list" :class="ui.list({ class:
|
|
64
|
-
<TabsIndicator data-slot="indicator" :class="ui.indicator({ class:
|
|
64
|
+
<TabsList data-slot="list" :class="ui.list({ class: props.ui?.list })">
|
|
65
|
+
<TabsIndicator data-slot="indicator" :class="ui.indicator({ class: props.ui?.indicator })" />
|
|
65
66
|
|
|
66
67
|
<slot name="list-leading" />
|
|
67
68
|
|
|
68
69
|
<TabsTrigger
|
|
69
|
-
v-for="(item, index) of items"
|
|
70
|
+
v-for="(item, index) of props.items"
|
|
70
71
|
:key="get(item, props.valueKey) ?? index"
|
|
71
72
|
:ref="(el) => setTriggerRef(index, el)"
|
|
72
73
|
:value="get(item, props.valueKey) ?? String(index)"
|
|
73
74
|
:disabled="item.disabled"
|
|
74
75
|
data-slot="trigger"
|
|
75
|
-
:class="ui.trigger({ class: [
|
|
76
|
+
:class="ui.trigger({ class: [props.ui?.trigger, item.ui?.trigger] })"
|
|
76
77
|
>
|
|
77
78
|
<slot name="leading" :item="item" :index="index" :ui="ui">
|
|
78
|
-
<UIcon v-if="item.icon" :name="item.icon" data-slot="leadingIcon" :class="ui.leadingIcon({ class: [
|
|
79
|
-
<UAvatar v-else-if="item.avatar" :size="item.ui?.leadingAvatarSize ||
|
|
79
|
+
<UIcon v-if="item.icon" :name="item.icon" data-slot="leadingIcon" :class="ui.leadingIcon({ class: [props.ui?.leadingIcon, item.ui?.leadingIcon] })" />
|
|
80
|
+
<UAvatar v-else-if="item.avatar" :size="item.ui?.leadingAvatarSize || props.ui?.leadingAvatarSize || ui.leadingAvatarSize()" v-bind="item.avatar" data-slot="leadingAvatar" :class="ui.leadingAvatar({ class: [props.ui?.leadingAvatar, item.ui?.leadingAvatar] })" />
|
|
80
81
|
</slot>
|
|
81
82
|
|
|
82
|
-
<span v-if="get(item, props.labelKey) || !!slots.default" data-slot="label" :class="ui.label({ class: [
|
|
83
|
+
<span v-if="get(item, props.labelKey) || !!slots.default" data-slot="label" :class="ui.label({ class: [props.ui?.label, item.ui?.label] })">
|
|
83
84
|
<slot :item="item" :index="index">{{ get(item, props.labelKey) }}</slot>
|
|
84
85
|
</span>
|
|
85
86
|
|
|
@@ -88,10 +89,10 @@ defineExpose({
|
|
|
88
89
|
v-if="item.badge || item.badge === 0"
|
|
89
90
|
color="neutral"
|
|
90
91
|
variant="outline"
|
|
91
|
-
:size="item.ui?.trailingBadgeSize ||
|
|
92
|
+
:size="item.ui?.trailingBadgeSize || props.ui?.trailingBadgeSize || ui.trailingBadgeSize()"
|
|
92
93
|
v-bind="typeof item.badge === 'string' || typeof item.badge === 'number' ? { label: item.badge } : item.badge"
|
|
93
94
|
data-slot="trailingBadge"
|
|
94
|
-
:class="ui.trailingBadge({ class: [
|
|
95
|
+
:class="ui.trailingBadge({ class: [props.ui?.trailingBadge, item.ui?.trailingBadge] })"
|
|
95
96
|
/>
|
|
96
97
|
</slot>
|
|
97
98
|
</TabsTrigger>
|
|
@@ -99,8 +100,8 @@ defineExpose({
|
|
|
99
100
|
<slot name="list-trailing" />
|
|
100
101
|
</TabsList>
|
|
101
102
|
|
|
102
|
-
<template v-if="!!content">
|
|
103
|
-
<TabsContent v-for="(item, index) of items" :key="get(item, props.valueKey) ?? index" :value="get(item, props.valueKey) ?? String(index)" data-slot="content" :class="ui.content({ class: [
|
|
103
|
+
<template v-if="!!props.content">
|
|
104
|
+
<TabsContent v-for="(item, index) of props.items" :key="get(item, props.valueKey) ?? index" :value="get(item, props.valueKey) ?? String(index)" data-slot="content" :class="ui.content({ class: [props.ui?.content, item.ui?.content, item.class] })">
|
|
104
105
|
<slot :name="item.slot || 'content'" :item="item" :index="index" :ui="ui">
|
|
105
106
|
{{ item.content }}
|
|
106
107
|
</slot>
|
|
@@ -7,7 +7,7 @@ import { useTemplateRef, computed, onMounted, nextTick, watch } from "vue";
|
|
|
7
7
|
import { Primitive } from "reka-ui";
|
|
8
8
|
import { useVModel } from "@vueuse/core";
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
10
|
-
import {
|
|
10
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
11
11
|
import { useComponentIcons } from "../composables/useComponentIcons";
|
|
12
12
|
import { useFormField } from "../composables/useFormField";
|
|
13
13
|
import { looseToNumber } from "../utils";
|
|
@@ -15,7 +15,7 @@ import { tv } from "../utils/tv";
|
|
|
15
15
|
import UIcon from "./Icon.vue";
|
|
16
16
|
import UAvatar from "./Avatar.vue";
|
|
17
17
|
defineOptions({ inheritAttrs: false });
|
|
18
|
-
const
|
|
18
|
+
const _props = defineProps({
|
|
19
19
|
as: { type: null, required: false },
|
|
20
20
|
id: { type: String, required: false },
|
|
21
21
|
name: { type: String, required: false },
|
|
@@ -49,17 +49,17 @@ const props = defineProps({
|
|
|
49
49
|
});
|
|
50
50
|
const emits = defineEmits(["update:modelValue", "blur", "change"]);
|
|
51
51
|
const slots = defineSlots();
|
|
52
|
+
const props = useComponentProps("textarea", _props);
|
|
52
53
|
const modelValue = useVModel(props, "modelValue", emits, { defaultValue: props.defaultValue });
|
|
53
54
|
const appConfig = useAppConfig();
|
|
54
|
-
const
|
|
55
|
-
const { emitFormFocus, emitFormBlur, emitFormInput, emitFormChange, size, color, id, name, highlight, disabled, ariaAttrs } = useFormField(props, { deferInputValidation: true });
|
|
55
|
+
const { emitFormFocus, emitFormBlur, emitFormInput, emitFormChange, size, color, id, name, highlight, disabled, ariaAttrs } = useFormField(_props, { deferInputValidation: true });
|
|
56
56
|
const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(props);
|
|
57
57
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.textarea || {} })({
|
|
58
|
-
color: color.value,
|
|
58
|
+
color: color.value ?? props.color,
|
|
59
59
|
variant: props.variant,
|
|
60
|
-
size: size?.value,
|
|
60
|
+
size: size?.value ?? props.size,
|
|
61
61
|
loading: props.loading,
|
|
62
|
-
highlight: highlight.value,
|
|
62
|
+
highlight: highlight.value ?? props.highlight,
|
|
63
63
|
fixed: props.fixed,
|
|
64
64
|
autoresize: props.autoresize,
|
|
65
65
|
leading: isLeading.value || !!props.avatar || !!slots.leading,
|
|
@@ -133,7 +133,8 @@ onMounted(() => {
|
|
|
133
133
|
setTimeout(() => {
|
|
134
134
|
autoFocus();
|
|
135
135
|
}, props.autofocusDelay);
|
|
136
|
-
setTimeout(() => {
|
|
136
|
+
setTimeout(async () => {
|
|
137
|
+
await nextTick();
|
|
137
138
|
autoResize();
|
|
138
139
|
}, props.autoresizeDelay);
|
|
139
140
|
});
|
|
@@ -144,18 +145,18 @@ defineExpose({
|
|
|
144
145
|
</script>
|
|
145
146
|
|
|
146
147
|
<template>
|
|
147
|
-
<Primitive :as="as" data-slot="root" :class="ui.root({ class: [
|
|
148
|
+
<Primitive :as="props.as" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
148
149
|
<textarea
|
|
149
150
|
:id="id"
|
|
150
151
|
ref="textareaRef"
|
|
151
152
|
:value="modelValue"
|
|
152
153
|
:name="name"
|
|
153
|
-
:rows="rows"
|
|
154
|
-
:placeholder="placeholder"
|
|
154
|
+
:rows="props.rows"
|
|
155
|
+
:placeholder="props.placeholder"
|
|
155
156
|
data-slot="base"
|
|
156
|
-
:class="ui.base({ class:
|
|
157
|
+
:class="ui.base({ class: props.ui?.base })"
|
|
157
158
|
:disabled="disabled"
|
|
158
|
-
:required="required"
|
|
159
|
+
:required="props.required"
|
|
159
160
|
v-bind="{ ...$attrs, ...ariaAttrs }"
|
|
160
161
|
@input="onInput"
|
|
161
162
|
@blur="onBlur"
|
|
@@ -165,16 +166,16 @@ defineExpose({
|
|
|
165
166
|
|
|
166
167
|
<slot :ui="ui" />
|
|
167
168
|
|
|
168
|
-
<span v-if="isLeading || !!avatar || !!slots.leading" data-slot="leading" :class="ui.leading({ class:
|
|
169
|
+
<span v-if="isLeading || !!props.avatar || !!slots.leading" data-slot="leading" :class="ui.leading({ class: props.ui?.leading })">
|
|
169
170
|
<slot name="leading" :ui="ui">
|
|
170
|
-
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" data-slot="leadingIcon" :class="ui.leadingIcon({ class:
|
|
171
|
-
<UAvatar v-else-if="!!avatar" :size="
|
|
171
|
+
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" data-slot="leadingIcon" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
|
|
172
|
+
<UAvatar v-else-if="!!props.avatar" :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()" v-bind="props.avatar" data-slot="leadingAvatar" :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })" />
|
|
172
173
|
</slot>
|
|
173
174
|
</span>
|
|
174
175
|
|
|
175
|
-
<span v-if="isTrailing || !!slots.trailing" data-slot="trailing" :class="ui.trailing({ class:
|
|
176
|
+
<span v-if="isTrailing || !!slots.trailing" data-slot="trailing" :class="ui.trailing({ class: props.ui?.trailing })">
|
|
176
177
|
<slot name="trailing" :ui="ui">
|
|
177
|
-
<UIcon v-if="trailingIconName" :name="trailingIconName" data-slot="trailingIcon" :class="ui.trailingIcon({ class:
|
|
178
|
+
<UIcon v-if="trailingIconName" :name="trailingIconName" data-slot="trailingIcon" :class="ui.trailingIcon({ class: props.ui?.trailingIcon })" />
|
|
178
179
|
</slot>
|
|
179
180
|
</span>
|
|
180
181
|
</Primitive>
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import { type VNode } from 'vue';
|
|
2
|
-
import type { ThemeUI } from '../composables/
|
|
2
|
+
import type { ThemeDefaults, ThemeUI } from '../composables/useComponentProps';
|
|
3
3
|
export interface ThemeProps {
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Per-component prop defaults that flow through `useComponentProps` to
|
|
6
|
+
* every descendant. Each key maps to a partial of that component's props.
|
|
7
|
+
* @example `{ button: { color: 'warning' }, tooltip: { delayDuration: 0 } }`
|
|
8
|
+
*/
|
|
9
|
+
props?: ThemeDefaults;
|
|
10
|
+
/**
|
|
11
|
+
* Per-component slot class overrides (flat shorthand for `:props.<name>.ui`).
|
|
12
|
+
* @example `{ button: { base: 'rounded-full' } }`
|
|
13
|
+
*/
|
|
14
|
+
ui?: ThemeUI;
|
|
5
15
|
}
|
|
6
16
|
export interface ThemeSlots {
|
|
7
17
|
default?(props?: {}): VNode[];
|
|
8
18
|
}
|
|
9
19
|
declare const _default: typeof __VLS_export;
|
|
10
20
|
export default _default;
|
|
11
|
-
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ThemeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ThemeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>,
|
|
12
|
-
default?: (props: {}) => any;
|
|
13
|
-
}>;
|
|
21
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ThemeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ThemeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ThemeSlots>;
|
|
14
22
|
type __VLS_WithSlots<T, S> = T & {
|
|
15
23
|
new (): {
|
|
16
24
|
$slots: S;
|
|
@@ -1,14 +1,42 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { computed } from "vue";
|
|
3
|
-
import
|
|
3
|
+
import defu from "defu";
|
|
4
|
+
import { injectThemeContext, provideThemeContext } from "../composables/useComponentProps";
|
|
4
5
|
</script>
|
|
5
6
|
|
|
6
7
|
<script setup>
|
|
7
|
-
const
|
|
8
|
-
|
|
8
|
+
const _props = defineProps({
|
|
9
|
+
props: { type: Object, required: false },
|
|
10
|
+
ui: { type: null, required: false }
|
|
9
11
|
});
|
|
12
|
+
defineSlots();
|
|
13
|
+
const parent = injectThemeContext();
|
|
14
|
+
const NAMESPACES = /* @__PURE__ */ new Set(["prose"]);
|
|
15
|
+
function normalizeUi(ui) {
|
|
16
|
+
if (!ui) return {};
|
|
17
|
+
const result = {};
|
|
18
|
+
for (const [key, value] of Object.entries(ui)) {
|
|
19
|
+
if (!value || typeof value !== "object") continue;
|
|
20
|
+
if (NAMESPACES.has(key)) {
|
|
21
|
+
const nested = {};
|
|
22
|
+
for (const [childKey, childValue] of Object.entries(value)) {
|
|
23
|
+
if (childValue && typeof childValue === "object") {
|
|
24
|
+
nested[childKey] = { ui: childValue };
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
result[key] = nested;
|
|
28
|
+
} else {
|
|
29
|
+
result[key] = { ui: value };
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
10
34
|
provideThemeContext({
|
|
11
|
-
|
|
35
|
+
defaults: computed(() => defu(
|
|
36
|
+
_props.props ?? {},
|
|
37
|
+
normalizeUi(_props.ui),
|
|
38
|
+
parent.defaults.value
|
|
39
|
+
))
|
|
12
40
|
});
|
|
13
41
|
</script>
|
|
14
42
|
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import { type VNode } from 'vue';
|
|
2
|
-
import type { ThemeUI } from '../composables/
|
|
2
|
+
import type { ThemeDefaults, ThemeUI } from '../composables/useComponentProps';
|
|
3
3
|
export interface ThemeProps {
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Per-component prop defaults that flow through `useComponentProps` to
|
|
6
|
+
* every descendant. Each key maps to a partial of that component's props.
|
|
7
|
+
* @example `{ button: { color: 'warning' }, tooltip: { delayDuration: 0 } }`
|
|
8
|
+
*/
|
|
9
|
+
props?: ThemeDefaults;
|
|
10
|
+
/**
|
|
11
|
+
* Per-component slot class overrides (flat shorthand for `:props.<name>.ui`).
|
|
12
|
+
* @example `{ button: { base: 'rounded-full' } }`
|
|
13
|
+
*/
|
|
14
|
+
ui?: ThemeUI;
|
|
5
15
|
}
|
|
6
16
|
export interface ThemeSlots {
|
|
7
17
|
default?(props?: {}): VNode[];
|
|
8
18
|
}
|
|
9
19
|
declare const _default: typeof __VLS_export;
|
|
10
20
|
export default _default;
|
|
11
|
-
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ThemeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ThemeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>,
|
|
12
|
-
default?: (props: {}) => any;
|
|
13
|
-
}>;
|
|
21
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ThemeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ThemeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ThemeSlots>;
|
|
14
22
|
type __VLS_WithSlots<T, S> = T & {
|
|
15
23
|
new (): {
|
|
16
24
|
$slots: S;
|
|
@@ -6,11 +6,11 @@ import theme from "#build/ui/timeline";
|
|
|
6
6
|
import { computed } from "vue";
|
|
7
7
|
import { Primitive, Separator } 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
11
|
import { get } from "../utils";
|
|
12
12
|
import UAvatar from "./Avatar.vue";
|
|
13
|
-
const
|
|
13
|
+
const _props = defineProps({
|
|
14
14
|
as: { type: null, required: false },
|
|
15
15
|
items: { type: Array, required: true },
|
|
16
16
|
size: { type: null, required: false },
|
|
@@ -24,9 +24,9 @@ const props = defineProps({
|
|
|
24
24
|
});
|
|
25
25
|
const emits = defineEmits(["select"]);
|
|
26
26
|
const slots = defineSlots();
|
|
27
|
+
const props = useComponentProps("timeline", _props);
|
|
27
28
|
const modelValue = defineModel({ type: [String, Number] });
|
|
28
29
|
const appConfig = useAppConfig();
|
|
29
|
-
const uiProp = useComponentUI("timeline", props);
|
|
30
30
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.timeline || {} })({
|
|
31
31
|
orientation: props.orientation,
|
|
32
32
|
size: props.size,
|
|
@@ -59,48 +59,48 @@ function onSelect(event, item) {
|
|
|
59
59
|
</script>
|
|
60
60
|
|
|
61
61
|
<template>
|
|
62
|
-
<Primitive :as="as" :data-orientation="orientation" data-slot="root" :class="ui.root({ class: [
|
|
62
|
+
<Primitive :as="props.as" :data-orientation="props.orientation" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
63
63
|
<div
|
|
64
|
-
v-for="(item, index) in items"
|
|
64
|
+
v-for="(item, index) in props.items"
|
|
65
65
|
:key="index"
|
|
66
66
|
data-slot="item"
|
|
67
|
-
:class="ui.item({ class: [
|
|
67
|
+
:class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class] })"
|
|
68
68
|
:data-state="getItemState(index)"
|
|
69
69
|
@click="onSelect($event, item)"
|
|
70
70
|
>
|
|
71
|
-
<div data-slot="container" :class="ui.container({ class: [
|
|
71
|
+
<div data-slot="container" :class="ui.container({ class: [props.ui?.container, item.ui?.container] })">
|
|
72
72
|
<UAvatar
|
|
73
|
-
:size="size"
|
|
73
|
+
:size="props.size"
|
|
74
74
|
:icon="item.icon"
|
|
75
75
|
v-bind="typeof item.avatar === 'object' ? item.avatar : {}"
|
|
76
76
|
data-slot="indicator"
|
|
77
|
-
:class="ui.indicator({ class: [
|
|
77
|
+
:class="ui.indicator({ class: [props.ui?.indicator, item.ui?.indicator] })"
|
|
78
78
|
:ui="{ icon: 'text-inherit', fallback: 'text-inherit' }"
|
|
79
79
|
>
|
|
80
80
|
<slot :name="item.slot ? `${item.slot}-indicator` : 'indicator'" :item="item" />
|
|
81
81
|
</UAvatar>
|
|
82
82
|
|
|
83
83
|
<Separator
|
|
84
|
-
v-if="index < items.length - 1"
|
|
84
|
+
v-if="index < props.items.length - 1"
|
|
85
85
|
data-slot="separator"
|
|
86
|
-
:class="ui.separator({ class: [
|
|
86
|
+
:class="ui.separator({ class: [props.ui?.separator, item.ui?.separator] })"
|
|
87
87
|
:orientation="props.orientation"
|
|
88
88
|
/>
|
|
89
89
|
</div>
|
|
90
90
|
|
|
91
|
-
<div data-slot="wrapper" :class="ui.wrapper({ class: [
|
|
91
|
+
<div data-slot="wrapper" :class="ui.wrapper({ class: [props.ui?.wrapper, item.ui?.wrapper] })">
|
|
92
92
|
<slot :name="item.slot ? `${item.slot}-wrapper` : 'wrapper'" :item="item">
|
|
93
|
-
<div v-if="item.date || !!slots[item.slot ? `${item.slot}-date` : 'date']" data-slot="date" :class="ui.date({ class: [
|
|
93
|
+
<div v-if="item.date || !!slots[item.slot ? `${item.slot}-date` : 'date']" data-slot="date" :class="ui.date({ class: [props.ui?.date, item.ui?.date] })">
|
|
94
94
|
<slot :name="item.slot ? `${item.slot}-date` : 'date'" :item="item">
|
|
95
95
|
{{ item.date }}
|
|
96
96
|
</slot>
|
|
97
97
|
</div>
|
|
98
|
-
<div v-if="item.title || !!slots[item.slot ? `${item.slot}-title` : 'title']" data-slot="title" :class="ui.title({ class: [
|
|
98
|
+
<div v-if="item.title || !!slots[item.slot ? `${item.slot}-title` : 'title']" data-slot="title" :class="ui.title({ class: [props.ui?.title, item.ui?.title] })">
|
|
99
99
|
<slot :name="item.slot ? `${item.slot}-title` : 'title'" :item="item">
|
|
100
100
|
{{ item.title }}
|
|
101
101
|
</slot>
|
|
102
102
|
</div>
|
|
103
|
-
<div v-if="item.description || !!slots[item.slot ? `${item.slot}-description` : 'description']" data-slot="description" :class="ui.description({ class: [
|
|
103
|
+
<div v-if="item.description || !!slots[item.slot ? `${item.slot}-description` : 'description']" data-slot="description" :class="ui.description({ class: [props.ui?.description, item.ui?.description] })">
|
|
104
104
|
<slot :name="item.slot ? `${item.slot}-description` : 'description'" :item="item">
|
|
105
105
|
{{ item.description }}
|
|
106
106
|
</slot>
|