@nuxt/ui 4.7.1 → 4.8.0
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 +13 -11
- 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 +8 -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 +5 -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/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 +1 -1
- package/dist/runtime/components/Link.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 +30 -3
- package/dist/runtime/components/content/ContentSearch.vue +66 -32
- package/dist/runtime/components/content/ContentSearch.vue.d.ts +30 -3
- 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 +1 -0
- 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/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 +1 -1
- package/dist/runtime/vue/overrides/inertia/Link.vue +5 -0
- package/dist/runtime/vue/overrides/inertia/Link.vue.d.ts +1 -1
- package/dist/runtime/vue/overrides/none/Link.d.vue.ts +1 -1
- package/dist/runtime/vue/overrides/none/Link.vue.d.ts +1 -1
- package/dist/runtime/vue/overrides/vue-router/Link.d.vue.ts +1 -1
- package/dist/runtime/vue/overrides/vue-router/Link.vue.d.ts +1 -1
- package/dist/shared/{ui.C6mn7iap.mjs → ui.CoJ8bnb0.mjs} +238 -77
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +27 -34
- 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
|
@@ -8,24 +8,26 @@ import { Primitive, Slot } from "reka-ui";
|
|
|
8
8
|
import { defu } from "defu";
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
10
10
|
import ImageComponent from "#build/ui-image-component";
|
|
11
|
-
import {
|
|
11
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
12
12
|
import { useAvatarGroup } from "../composables/useAvatarGroup";
|
|
13
13
|
import { tv } from "../utils/tv";
|
|
14
14
|
import UIcon from "./Icon.vue";
|
|
15
15
|
import UChip from "./Chip.vue";
|
|
16
16
|
defineOptions({ inheritAttrs: false });
|
|
17
|
-
const
|
|
17
|
+
const _props = defineProps({
|
|
18
18
|
as: { type: null, required: false },
|
|
19
19
|
src: { type: String, required: false },
|
|
20
20
|
alt: { type: String, required: false },
|
|
21
21
|
icon: { type: null, required: false },
|
|
22
22
|
text: { type: String, required: false },
|
|
23
23
|
size: { type: null, required: false },
|
|
24
|
+
color: { type: null, required: false },
|
|
24
25
|
chip: { type: [Boolean, Object], required: false },
|
|
25
26
|
class: { type: null, required: false },
|
|
26
27
|
style: { type: null, required: false },
|
|
27
28
|
ui: { type: Object, required: false }
|
|
28
29
|
});
|
|
30
|
+
const props = useComponentProps("avatar", _props);
|
|
29
31
|
const as = computed(() => {
|
|
30
32
|
if (typeof props.as === "string" || typeof props.as?.render === "function") {
|
|
31
33
|
return { root: props.as };
|
|
@@ -34,12 +36,12 @@ const as = computed(() => {
|
|
|
34
36
|
});
|
|
35
37
|
const fallback = computed(() => props.text || (props.alt || "").split(" ").map((word) => word.charAt(0)).join("").substring(0, 2));
|
|
36
38
|
const appConfig = useAppConfig();
|
|
37
|
-
const
|
|
38
|
-
const { size } = useAvatarGroup(props);
|
|
39
|
+
const { size, color } = useAvatarGroup(_props);
|
|
39
40
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.avatar || {} })({
|
|
40
|
-
size: size.value
|
|
41
|
+
size: size.value ?? props.size,
|
|
42
|
+
color: color.value ?? props.color
|
|
41
43
|
}));
|
|
42
|
-
const rootClass = computed(() => ui.value.root({ class: [
|
|
44
|
+
const rootClass = computed(() => ui.value.root({ class: [props.ui?.root, props.class] }));
|
|
43
45
|
const sizePx = computed(() => {
|
|
44
46
|
const sizeClass = rootClass.value.split(" ").find((c) => /^size-\d+$/.test(c));
|
|
45
47
|
if (sizeClass) {
|
|
@@ -70,21 +72,21 @@ function onError() {
|
|
|
70
72
|
>
|
|
71
73
|
<component
|
|
72
74
|
:is="as.img || ImageComponent"
|
|
73
|
-
v-if="src && !error"
|
|
74
|
-
:src="src"
|
|
75
|
-
:alt="alt"
|
|
75
|
+
v-if="props.src && !error"
|
|
76
|
+
:src="props.src"
|
|
77
|
+
:alt="props.alt"
|
|
76
78
|
:width="sizePx"
|
|
77
79
|
:height="sizePx"
|
|
78
80
|
v-bind="$attrs"
|
|
79
81
|
data-slot="image"
|
|
80
|
-
:class="ui.image({ class:
|
|
82
|
+
:class="ui.image({ class: props.ui?.image })"
|
|
81
83
|
@error="onError"
|
|
82
84
|
/>
|
|
83
85
|
|
|
84
86
|
<Slot v-else v-bind="$attrs">
|
|
85
87
|
<slot>
|
|
86
|
-
<UIcon v-if="icon" :name="icon" data-slot="icon" :class="ui.icon({ class:
|
|
87
|
-
<span v-else data-slot="fallback" :class="ui.fallback({ class:
|
|
88
|
+
<UIcon v-if="props.icon" :name="props.icon" data-slot="icon" :class="ui.icon({ class: props.ui?.icon })" />
|
|
89
|
+
<span v-else data-slot="fallback" :class="ui.fallback({ class: props.ui?.fallback })">{{ fallback || "\xA0" }}</span>
|
|
88
90
|
</slot>
|
|
89
91
|
</Slot>
|
|
90
92
|
</component>
|
|
@@ -25,6 +25,10 @@ export interface AvatarProps extends /** @vue-ignore */ Omit<ImgHTMLAttributes,
|
|
|
25
25
|
* @defaultValue 'md'
|
|
26
26
|
*/
|
|
27
27
|
size?: Avatar['variants']['size'];
|
|
28
|
+
/**
|
|
29
|
+
* @defaultValue 'neutral'
|
|
30
|
+
*/
|
|
31
|
+
color?: Avatar['variants']['color'];
|
|
28
32
|
chip?: boolean | ChipProps;
|
|
29
33
|
class?: any;
|
|
30
34
|
style?: any;
|
|
@@ -13,6 +13,10 @@ export interface AvatarGroupProps {
|
|
|
13
13
|
* @defaultValue 'md'
|
|
14
14
|
*/
|
|
15
15
|
size?: AvatarGroup['variants']['size'];
|
|
16
|
+
/**
|
|
17
|
+
* @defaultValue 'neutral'
|
|
18
|
+
*/
|
|
19
|
+
color?: AvatarGroup['variants']['color'];
|
|
16
20
|
/**
|
|
17
21
|
* The maximum number of avatars to display.
|
|
18
22
|
*/
|
|
@@ -6,22 +6,24 @@ import theme from "#build/ui/avatar-group";
|
|
|
6
6
|
import { computed, provide } 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 { avatarGroupInjectionKey } from "../composables/useAvatarGroup";
|
|
11
11
|
import { tv } from "../utils/tv";
|
|
12
12
|
import UAvatar from "./Avatar.vue";
|
|
13
|
-
const
|
|
13
|
+
const _props = defineProps({
|
|
14
14
|
as: { type: null, required: false },
|
|
15
15
|
size: { type: null, required: false },
|
|
16
|
+
color: { type: null, required: false },
|
|
16
17
|
max: { type: [Number, String], required: false },
|
|
17
18
|
class: { type: null, required: false },
|
|
18
19
|
ui: { type: Object, required: false }
|
|
19
20
|
});
|
|
20
21
|
const slots = defineSlots();
|
|
22
|
+
const props = useComponentProps("avatarGroup", _props);
|
|
21
23
|
const appConfig = useAppConfig();
|
|
22
|
-
const uiProp = useComponentUI("avatarGroup", props);
|
|
23
24
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.avatarGroup || {} })({
|
|
24
|
-
size: props.size
|
|
25
|
+
size: props.size,
|
|
26
|
+
color: props.color
|
|
25
27
|
}));
|
|
26
28
|
const max = computed(() => typeof props.max === "string" ? Number.parseInt(props.max, 10) : props.max);
|
|
27
29
|
const children = computed(() => {
|
|
@@ -55,13 +57,14 @@ const hiddenCount = computed(() => {
|
|
|
55
57
|
return children.value.length - visibleAvatars.value.length;
|
|
56
58
|
});
|
|
57
59
|
provide(avatarGroupInjectionKey, computed(() => ({
|
|
58
|
-
size: props.size
|
|
60
|
+
size: props.size,
|
|
61
|
+
color: props.color
|
|
59
62
|
})));
|
|
60
63
|
</script>
|
|
61
64
|
|
|
62
65
|
<template>
|
|
63
|
-
<Primitive :as="as" data-slot="root" :class="ui.root({ class: [
|
|
64
|
-
<UAvatar v-if="hiddenCount > 0" :text="`+${hiddenCount}`" data-slot="base" :class="ui.base({ class:
|
|
65
|
-
<component :is="avatar" v-for="(avatar, count) in visibleAvatars" :key="count" data-slot="base" :class="ui.base({ class:
|
|
66
|
+
<Primitive :as="props.as" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
67
|
+
<UAvatar v-if="hiddenCount > 0" :text="`+${hiddenCount}`" data-slot="base" :class="ui.base({ class: props.ui?.base })" />
|
|
68
|
+
<component :is="avatar" v-for="(avatar, count) in visibleAvatars" :key="count" data-slot="base" :class="ui.base({ class: props.ui?.base })" />
|
|
66
69
|
</Primitive>
|
|
67
70
|
</template>
|
|
@@ -13,6 +13,10 @@ export interface AvatarGroupProps {
|
|
|
13
13
|
* @defaultValue 'md'
|
|
14
14
|
*/
|
|
15
15
|
size?: AvatarGroup['variants']['size'];
|
|
16
|
+
/**
|
|
17
|
+
* @defaultValue 'neutral'
|
|
18
|
+
*/
|
|
19
|
+
color?: AvatarGroup['variants']['color'];
|
|
16
20
|
/**
|
|
17
21
|
* The maximum number of avatars to display.
|
|
18
22
|
*/
|
|
@@ -8,11 +8,11 @@ import { Primitive } from "reka-ui";
|
|
|
8
8
|
import { useAppConfig } from "#imports";
|
|
9
9
|
import { useFieldGroup } from "../composables/useFieldGroup";
|
|
10
10
|
import { useComponentIcons } from "../composables/useComponentIcons";
|
|
11
|
-
import {
|
|
11
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
12
12
|
import { tv } from "../utils/tv";
|
|
13
13
|
import UIcon from "./Icon.vue";
|
|
14
14
|
import UAvatar from "./Avatar.vue";
|
|
15
|
-
const
|
|
15
|
+
const _props = defineProps({
|
|
16
16
|
as: { type: null, required: false, default: "span" },
|
|
17
17
|
label: { type: [String, Number], required: false },
|
|
18
18
|
color: { type: null, required: false },
|
|
@@ -29,34 +29,34 @@ const props = defineProps({
|
|
|
29
29
|
trailingIcon: { type: null, required: false }
|
|
30
30
|
});
|
|
31
31
|
const slots = defineSlots();
|
|
32
|
+
const props = useComponentProps("badge", _props);
|
|
32
33
|
const appConfig = useAppConfig();
|
|
33
|
-
const
|
|
34
|
-
const { orientation, size: fieldGroupSize } = useFieldGroup(props);
|
|
34
|
+
const { orientation, size: fieldGroupSize } = useFieldGroup(_props);
|
|
35
35
|
const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(props);
|
|
36
36
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.badge || {} })({
|
|
37
37
|
color: props.color,
|
|
38
38
|
variant: props.variant,
|
|
39
|
-
size: fieldGroupSize.value
|
|
39
|
+
size: fieldGroupSize.value ?? props.size,
|
|
40
40
|
square: props.square || !slots.default && !props.label,
|
|
41
41
|
fieldGroup: orientation.value
|
|
42
42
|
}));
|
|
43
43
|
</script>
|
|
44
44
|
|
|
45
45
|
<template>
|
|
46
|
-
<Primitive :as="as" data-slot="base" :class="ui.base({ class: [
|
|
46
|
+
<Primitive :as="props.as" data-slot="base" :class="ui.base({ class: [props.ui?.base, props.class] })">
|
|
47
47
|
<slot name="leading" :ui="ui">
|
|
48
|
-
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" data-slot="leadingIcon" :class="ui.leadingIcon({ class:
|
|
49
|
-
<UAvatar v-else-if="!!avatar" :size="
|
|
48
|
+
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" data-slot="leadingIcon" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
|
|
49
|
+
<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 })" />
|
|
50
50
|
</slot>
|
|
51
51
|
|
|
52
52
|
<slot :ui="ui">
|
|
53
|
-
<span v-if="label !== void 0 && label !== null" data-slot="label" :class="ui.label({ class:
|
|
54
|
-
{{ label }}
|
|
53
|
+
<span v-if="props.label !== void 0 && props.label !== null" data-slot="label" :class="ui.label({ class: props.ui?.label })">
|
|
54
|
+
{{ props.label }}
|
|
55
55
|
</span>
|
|
56
56
|
</slot>
|
|
57
57
|
|
|
58
58
|
<slot name="trailing" :ui="ui">
|
|
59
|
-
<UIcon v-if="isTrailing && trailingIconName" :name="trailingIconName" data-slot="trailingIcon" :class="ui.trailingIcon({ class:
|
|
59
|
+
<UIcon v-if="isTrailing && trailingIconName" :name="trailingIconName" data-slot="trailingIcon" :class="ui.trailingIcon({ class: props.ui?.trailingIcon })" />
|
|
60
60
|
</slot>
|
|
61
61
|
</Primitive>
|
|
62
62
|
</template>
|
|
@@ -6,15 +6,16 @@ import theme from "#build/ui/banner";
|
|
|
6
6
|
import { computed, ref, onMounted, useId } from "vue";
|
|
7
7
|
import { Primitive } from "reka-ui";
|
|
8
8
|
import { useHead, useAppConfig } from "#imports";
|
|
9
|
-
import {
|
|
9
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
10
10
|
import { useLocale } from "../composables/useLocale";
|
|
11
|
+
import { usePrefix } from "../composables/usePrefix";
|
|
11
12
|
import { tv } from "../utils/tv";
|
|
12
13
|
import ULink from "./Link.vue";
|
|
13
14
|
import UContainer from "./Container.vue";
|
|
14
15
|
import UIcon from "./Icon.vue";
|
|
15
16
|
import UButton from "./Button.vue";
|
|
16
17
|
defineOptions({ inheritAttrs: false });
|
|
17
|
-
const
|
|
18
|
+
const _props = defineProps({
|
|
18
19
|
as: { type: null, required: false },
|
|
19
20
|
id: { type: String, required: false },
|
|
20
21
|
icon: { type: null, required: false },
|
|
@@ -30,9 +31,10 @@ const props = defineProps({
|
|
|
30
31
|
});
|
|
31
32
|
const slots = defineSlots();
|
|
32
33
|
const emits = defineEmits(["close"]);
|
|
34
|
+
const props = useComponentProps("banner", _props);
|
|
33
35
|
const { t } = useLocale();
|
|
34
36
|
const appConfig = useAppConfig();
|
|
35
|
-
const
|
|
37
|
+
const prefix = usePrefix();
|
|
36
38
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.banner || {} })({
|
|
37
39
|
color: props.color,
|
|
38
40
|
to: !!props.to
|
|
@@ -87,56 +89,56 @@ function onClose() {
|
|
|
87
89
|
<template>
|
|
88
90
|
<Primitive
|
|
89
91
|
v-show="isVisible"
|
|
90
|
-
:as="as"
|
|
92
|
+
:as="props.as"
|
|
91
93
|
class="banner"
|
|
92
94
|
:data-banner-id="id"
|
|
93
95
|
data-slot="root"
|
|
94
|
-
:class="ui.root({ class: [
|
|
96
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
95
97
|
>
|
|
96
98
|
<ULink
|
|
97
|
-
v-if="to"
|
|
98
|
-
:aria-label="title"
|
|
99
|
-
v-bind="{ to, target, ...$attrs }"
|
|
100
|
-
class="focus:outline-none"
|
|
99
|
+
v-if="props.to"
|
|
100
|
+
:aria-label="props.title"
|
|
101
|
+
v-bind="{ to: props.to, target: props.target, ...$attrs }"
|
|
102
|
+
:class="prefix('focus:outline-none')"
|
|
101
103
|
tabindex="-1"
|
|
102
104
|
raw
|
|
103
105
|
>
|
|
104
|
-
<span class="absolute inset-0" aria-hidden="true" />
|
|
106
|
+
<span :class="prefix('absolute inset-0')" aria-hidden="true" />
|
|
105
107
|
</ULink>
|
|
106
108
|
|
|
107
|
-
<UContainer data-slot="container" :class="ui.container({ class:
|
|
108
|
-
<div data-slot="left" :class="ui.left({ class:
|
|
109
|
+
<UContainer data-slot="container" :class="ui.container({ class: props.ui?.container })">
|
|
110
|
+
<div data-slot="left" :class="ui.left({ class: props.ui?.left })" />
|
|
109
111
|
|
|
110
|
-
<div data-slot="center" :class="ui.center({ class:
|
|
112
|
+
<div data-slot="center" :class="ui.center({ class: props.ui?.center })">
|
|
111
113
|
<slot name="leading" :ui="ui">
|
|
112
|
-
<UIcon v-if="icon" :name="icon" data-slot="icon" :class="ui.icon({ class:
|
|
114
|
+
<UIcon v-if="props.icon" :name="props.icon" data-slot="icon" :class="ui.icon({ class: props.ui?.icon })" />
|
|
113
115
|
</slot>
|
|
114
116
|
|
|
115
|
-
<div v-if="title || !!slots.title" data-slot="title" :class="ui.title({ class:
|
|
117
|
+
<div v-if="props.title || !!slots.title" data-slot="title" :class="ui.title({ class: props.ui?.title })">
|
|
116
118
|
<slot name="title">
|
|
117
|
-
{{ title }}
|
|
119
|
+
{{ props.title }}
|
|
118
120
|
</slot>
|
|
119
121
|
</div>
|
|
120
122
|
|
|
121
|
-
<div v-if="actions?.length || !!slots.actions" data-slot="actions" :class="ui.actions({ class:
|
|
123
|
+
<div v-if="props.actions?.length || !!slots.actions" data-slot="actions" :class="ui.actions({ class: props.ui?.actions })">
|
|
122
124
|
<slot name="actions">
|
|
123
|
-
<UButton v-for="(action, index) in actions" :key="index" color="neutral" size="xs" v-bind="action" />
|
|
125
|
+
<UButton v-for="(action, index) in props.actions" :key="index" color="neutral" size="xs" v-bind="action" />
|
|
124
126
|
</slot>
|
|
125
127
|
</div>
|
|
126
128
|
</div>
|
|
127
129
|
|
|
128
|
-
<div data-slot="right" :class="ui.right({ class:
|
|
130
|
+
<div data-slot="right" :class="ui.right({ class: props.ui?.right })">
|
|
129
131
|
<slot name="close" :ui="ui">
|
|
130
132
|
<UButton
|
|
131
|
-
v-if="close"
|
|
132
|
-
:icon="closeIcon || appConfig.ui.icons.close"
|
|
133
|
+
v-if="props.close"
|
|
134
|
+
:icon="props.closeIcon || appConfig.ui.icons.close"
|
|
133
135
|
size="md"
|
|
134
136
|
color="neutral"
|
|
135
137
|
variant="ghost"
|
|
136
138
|
:aria-label="t('banner.close')"
|
|
137
|
-
v-bind="typeof close === 'object' ? close : {}"
|
|
139
|
+
v-bind="typeof props.close === 'object' ? props.close : {}"
|
|
138
140
|
data-slot="close"
|
|
139
|
-
:class="ui.close({ class:
|
|
141
|
+
:class="ui.close({ class: props.ui?.close })"
|
|
140
142
|
@click="onClose"
|
|
141
143
|
/>
|
|
142
144
|
</slot>
|
|
@@ -59,8 +59,8 @@ export interface BlogPostSlots {
|
|
|
59
59
|
declare const _default: typeof __VLS_export;
|
|
60
60
|
export default _default;
|
|
61
61
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<BlogPostProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BlogPostProps> & Readonly<{}>, {
|
|
62
|
-
orientation: BlogPost["variants"]["orientation"];
|
|
63
62
|
as: any;
|
|
63
|
+
orientation: BlogPost["variants"]["orientation"];
|
|
64
64
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, BlogPostSlots>;
|
|
65
65
|
type __VLS_WithSlots<T, S> = T & {
|
|
66
66
|
new (): {
|
|
@@ -7,7 +7,8 @@ import { computed } from "vue";
|
|
|
7
7
|
import { Primitive, useDateFormatter } from "reka-ui";
|
|
8
8
|
import { useAppConfig } from "#imports";
|
|
9
9
|
import { useLocale } from "../composables/useLocale";
|
|
10
|
-
import {
|
|
10
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
11
|
+
import { usePrefix } from "../composables/usePrefix";
|
|
11
12
|
import ImageComponent from "#build/ui-image-component";
|
|
12
13
|
import { getSlotChildrenText } from "../utils";
|
|
13
14
|
import { tv } from "../utils/tv";
|
|
@@ -17,7 +18,7 @@ import UAvatar from "./Avatar.vue";
|
|
|
17
18
|
import UAvatarGroup from "./AvatarGroup.vue";
|
|
18
19
|
import UUser from "./User.vue";
|
|
19
20
|
defineOptions({ inheritAttrs: false });
|
|
20
|
-
const
|
|
21
|
+
const _props = defineProps({
|
|
21
22
|
as: { type: null, required: false, default: "article" },
|
|
22
23
|
title: { type: String, required: false },
|
|
23
24
|
description: { type: String, required: false },
|
|
@@ -34,10 +35,11 @@ const props = defineProps({
|
|
|
34
35
|
ui: { type: Object, required: false }
|
|
35
36
|
});
|
|
36
37
|
const slots = defineSlots();
|
|
38
|
+
const props = useComponentProps("blogPost", _props);
|
|
37
39
|
const { locale } = useLocale();
|
|
38
40
|
const appConfig = useAppConfig();
|
|
39
|
-
const uiProp = useComponentUI("blogPost", props);
|
|
40
41
|
const formatter = useDateFormatter(locale.value.code);
|
|
42
|
+
const prefix = usePrefix();
|
|
41
43
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.blogPost || {} })({
|
|
42
44
|
orientation: props.orientation,
|
|
43
45
|
variant: props.variant,
|
|
@@ -71,85 +73,85 @@ const ariaLabel = computed(() => {
|
|
|
71
73
|
</script>
|
|
72
74
|
|
|
73
75
|
<template>
|
|
74
|
-
<Primitive :as="as" :data-orientation="orientation" data-slot="root" :class="ui.root({ class: [
|
|
75
|
-
<div v-if="image || !!slots.header" data-slot="header" :class="ui.header({ class:
|
|
76
|
+
<Primitive :as="props.as" :data-orientation="props.orientation" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })" @click="props.onClick">
|
|
77
|
+
<div v-if="props.image || !!slots.header" data-slot="header" :class="ui.header({ class: props.ui?.header })">
|
|
76
78
|
<slot name="header" :ui="ui">
|
|
77
79
|
<component
|
|
78
80
|
:is="ImageComponent"
|
|
79
|
-
v-bind="typeof image === 'string' ? { src: image, alt: title } : { alt: title, ...image }"
|
|
81
|
+
v-bind="typeof props.image === 'string' ? { src: props.image, alt: props.title } : { alt: props.title, ...props.image }"
|
|
80
82
|
data-slot="image"
|
|
81
|
-
:class="ui.image({ class:
|
|
83
|
+
:class="ui.image({ class: props.ui?.image, to: !!props.to })"
|
|
82
84
|
/>
|
|
83
85
|
</slot>
|
|
84
86
|
</div>
|
|
85
87
|
|
|
86
|
-
<div data-slot="body" :class="ui.body({ class:
|
|
88
|
+
<div data-slot="body" :class="ui.body({ class: props.ui?.body })">
|
|
87
89
|
<ULink
|
|
88
|
-
v-if="to"
|
|
90
|
+
v-if="props.to"
|
|
89
91
|
:aria-label="ariaLabel"
|
|
90
|
-
v-bind="{ to, target, ...$attrs }"
|
|
91
|
-
class="focus:outline-none peer"
|
|
92
|
+
v-bind="{ to: props.to, target: props.target, ...$attrs }"
|
|
93
|
+
:class="prefix('focus:outline-none peer')"
|
|
92
94
|
raw
|
|
93
95
|
>
|
|
94
|
-
<span class="absolute inset-0" aria-hidden="true" />
|
|
96
|
+
<span :class="prefix('absolute inset-0')" aria-hidden="true" />
|
|
95
97
|
</ULink>
|
|
96
98
|
|
|
97
99
|
<slot name="body">
|
|
98
|
-
<div v-if="date || !!slots.date || (badge || !!slots.badge)" data-slot="meta" :class="ui.meta({ class:
|
|
100
|
+
<div v-if="date || !!slots.date || (props.badge || !!slots.badge)" data-slot="meta" :class="ui.meta({ class: props.ui?.meta })">
|
|
99
101
|
<slot name="badge">
|
|
100
102
|
<UBadge
|
|
101
|
-
v-if="badge"
|
|
103
|
+
v-if="props.badge"
|
|
102
104
|
color="neutral"
|
|
103
105
|
variant="subtle"
|
|
104
|
-
v-bind="typeof badge === 'string' ? { label: badge } : badge"
|
|
106
|
+
v-bind="typeof props.badge === 'string' ? { label: props.badge } : props.badge"
|
|
105
107
|
data-slot="badge"
|
|
106
|
-
:class="ui.badge({ class:
|
|
108
|
+
:class="ui.badge({ class: props.ui?.badge })"
|
|
107
109
|
/>
|
|
108
110
|
</slot>
|
|
109
111
|
|
|
110
|
-
<time v-if="date || !!slots.date" :datetime="datetime" data-slot="date" :class="ui.date({ class:
|
|
112
|
+
<time v-if="date || !!slots.date" :datetime="datetime" data-slot="date" :class="ui.date({ class: props.ui?.date })">
|
|
111
113
|
<slot name="date">
|
|
112
114
|
{{ date }}
|
|
113
115
|
</slot>
|
|
114
116
|
</time>
|
|
115
117
|
</div>
|
|
116
118
|
|
|
117
|
-
<h2 v-if="title || !!slots.title" data-slot="title" :class="ui.title({ class:
|
|
119
|
+
<h2 v-if="props.title || !!slots.title" data-slot="title" :class="ui.title({ class: props.ui?.title })">
|
|
118
120
|
<slot name="title">
|
|
119
|
-
{{ title }}
|
|
121
|
+
{{ props.title }}
|
|
120
122
|
</slot>
|
|
121
123
|
</h2>
|
|
122
124
|
|
|
123
|
-
<div v-if="description || !!slots.description" data-slot="description" :class="ui.description({ class:
|
|
125
|
+
<div v-if="props.description || !!slots.description" data-slot="description" :class="ui.description({ class: props.ui?.description })">
|
|
124
126
|
<slot name="description">
|
|
125
|
-
{{ description }}
|
|
127
|
+
{{ props.description }}
|
|
126
128
|
</slot>
|
|
127
129
|
</div>
|
|
128
130
|
|
|
129
|
-
<div v-if="authors?.length || !!slots.authors" data-slot="authors" :class="ui.authors({ class:
|
|
131
|
+
<div v-if="props.authors?.length || !!slots.authors" data-slot="authors" :class="ui.authors({ class: props.ui?.authors })">
|
|
130
132
|
<slot name="authors" :ui="ui">
|
|
131
|
-
<template v-if="authors?.length">
|
|
132
|
-
<UAvatarGroup v-if="authors.length > 1">
|
|
133
|
+
<template v-if="props.authors?.length">
|
|
134
|
+
<UAvatarGroup v-if="props.authors.length > 1">
|
|
133
135
|
<ULink
|
|
134
|
-
v-for="(author, index) in authors"
|
|
136
|
+
v-for="(author, index) in props.authors"
|
|
135
137
|
:key="index"
|
|
136
138
|
:to="author.to"
|
|
137
139
|
:target="author.target"
|
|
138
140
|
data-slot="avatar"
|
|
139
|
-
:class="ui.avatar({ class:
|
|
141
|
+
:class="ui.avatar({ class: props.ui?.avatar, to: !!author.to })"
|
|
140
142
|
raw
|
|
141
143
|
>
|
|
142
144
|
<UAvatar v-bind="author.avatar" />
|
|
143
145
|
</ULink>
|
|
144
146
|
</UAvatarGroup>
|
|
145
|
-
<UUser v-else v-bind="authors[0]" />
|
|
147
|
+
<UUser v-else v-bind="props.authors[0]" />
|
|
146
148
|
</template>
|
|
147
149
|
</slot>
|
|
148
150
|
</div>
|
|
149
151
|
</slot>
|
|
150
152
|
</div>
|
|
151
153
|
|
|
152
|
-
<div v-if="!!slots.footer" data-slot="footer" :class="ui.footer({ class:
|
|
154
|
+
<div v-if="!!slots.footer" data-slot="footer" :class="ui.footer({ class: props.ui?.footer })">
|
|
153
155
|
<slot name="footer" />
|
|
154
156
|
</div>
|
|
155
157
|
</Primitive>
|
|
@@ -59,8 +59,8 @@ export interface BlogPostSlots {
|
|
|
59
59
|
declare const _default: typeof __VLS_export;
|
|
60
60
|
export default _default;
|
|
61
61
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<BlogPostProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BlogPostProps> & Readonly<{}>, {
|
|
62
|
-
orientation: BlogPost["variants"]["orientation"];
|
|
63
62
|
as: any;
|
|
63
|
+
orientation: BlogPost["variants"]["orientation"];
|
|
64
64
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, BlogPostSlots>;
|
|
65
65
|
type __VLS_WithSlots<T, S> = T & {
|
|
66
66
|
new (): {
|
|
@@ -8,9 +8,9 @@ import { Primitive } from "reka-ui";
|
|
|
8
8
|
import { useAppConfig } from "#imports";
|
|
9
9
|
import { omit } from "../utils";
|
|
10
10
|
import { tv } from "../utils/tv";
|
|
11
|
-
import {
|
|
11
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
12
12
|
import UBlogPost from "./BlogPost.vue";
|
|
13
|
-
const
|
|
13
|
+
const _props = defineProps({
|
|
14
14
|
as: { type: null, required: false },
|
|
15
15
|
posts: { type: Array, required: false },
|
|
16
16
|
orientation: { type: null, required: false, default: "horizontal" },
|
|
@@ -18,19 +18,19 @@ const props = defineProps({
|
|
|
18
18
|
ui: { type: Object, required: false }
|
|
19
19
|
});
|
|
20
20
|
const slots = defineSlots();
|
|
21
|
+
const props = useComponentProps("blogPosts", _props);
|
|
21
22
|
const getProxySlots = () => omit(slots, ["default"]);
|
|
22
23
|
const appConfig = useAppConfig();
|
|
23
|
-
const uiProp = useComponentUI("blogPosts", props);
|
|
24
24
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.blogPosts || {} }));
|
|
25
25
|
</script>
|
|
26
26
|
|
|
27
27
|
<template>
|
|
28
|
-
<Primitive :as="as" :data-orientation="orientation" :class="ui({ orientation, class: [
|
|
28
|
+
<Primitive :as="props.as" :data-orientation="props.orientation" :class="ui({ orientation: props.orientation, class: [props.ui?.base, props.class] })">
|
|
29
29
|
<slot>
|
|
30
30
|
<UBlogPost
|
|
31
|
-
v-for="(post, index) in posts"
|
|
31
|
+
v-for="(post, index) in props.posts"
|
|
32
32
|
:key="index"
|
|
33
|
-
:orientation="orientation === 'vertical' ? 'horizontal' : 'vertical'"
|
|
33
|
+
:orientation="props.orientation === 'vertical' ? 'horizontal' : 'vertical'"
|
|
34
34
|
v-bind="post"
|
|
35
35
|
>
|
|
36
36
|
<template v-for="(_, name) in getProxySlots()" #[name]="slotData">
|
|
@@ -30,6 +30,10 @@ export interface BreadcrumbProps<T extends BreadcrumbItem = BreadcrumbItem> {
|
|
|
30
30
|
* @IconifyIcon
|
|
31
31
|
*/
|
|
32
32
|
separatorIcon?: IconProps['name'];
|
|
33
|
+
/**
|
|
34
|
+
* @defaultValue 'primary'
|
|
35
|
+
*/
|
|
36
|
+
color?: Breadcrumb['variants']['color'];
|
|
33
37
|
/**
|
|
34
38
|
* The key used to get the label from the item.
|
|
35
39
|
* @defaultValue 'label'
|
|
@@ -6,7 +6,7 @@ import theme from "#build/ui/breadcrumb";
|
|
|
6
6
|
import { computed } from "vue";
|
|
7
7
|
import { Primitive } from "reka-ui";
|
|
8
8
|
import { useAppConfig } from "#imports";
|
|
9
|
-
import {
|
|
9
|
+
import { useComponentProps } from "../composables/useComponentProps";
|
|
10
10
|
import { useLocale } from "../composables/useLocale";
|
|
11
11
|
import { get } from "../utils";
|
|
12
12
|
import { tv } from "../utils/tv";
|
|
@@ -15,50 +15,53 @@ import UIcon from "./Icon.vue";
|
|
|
15
15
|
import UAvatar from "./Avatar.vue";
|
|
16
16
|
import ULinkBase from "./LinkBase.vue";
|
|
17
17
|
import ULink from "./Link.vue";
|
|
18
|
-
const
|
|
18
|
+
const _props = defineProps({
|
|
19
19
|
as: { type: null, required: false, default: "nav" },
|
|
20
20
|
items: { type: Array, required: false },
|
|
21
21
|
separatorIcon: { type: null, required: false },
|
|
22
|
+
color: { type: null, required: false },
|
|
22
23
|
labelKey: { type: null, required: false, default: "label" },
|
|
23
24
|
class: { type: null, required: false },
|
|
24
25
|
ui: { type: Object, required: false }
|
|
25
26
|
});
|
|
26
27
|
const slots = defineSlots();
|
|
28
|
+
const props = useComponentProps("breadcrumb", _props);
|
|
27
29
|
const { dir } = useLocale();
|
|
28
30
|
const appConfig = useAppConfig();
|
|
29
|
-
const uiProp = useComponentUI("breadcrumb", props);
|
|
30
31
|
const separatorIcon = computed(() => props.separatorIcon || (dir.value === "rtl" ? appConfig.ui.icons.chevronLeft : appConfig.ui.icons.chevronRight));
|
|
31
|
-
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.breadcrumb || {} })(
|
|
32
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.breadcrumb || {} })({
|
|
33
|
+
color: props.color
|
|
34
|
+
}));
|
|
32
35
|
</script>
|
|
33
36
|
|
|
34
37
|
<template>
|
|
35
|
-
<Primitive :as="as" aria-label="breadcrumb" data-slot="root" :class="ui.root({ class: [
|
|
36
|
-
<ol data-slot="list" :class="ui.list({ class:
|
|
37
|
-
<template v-for="(item, index) in items" :key="index">
|
|
38
|
-
<li data-slot="item" :class="ui.item({ class: [
|
|
38
|
+
<Primitive :as="props.as" aria-label="breadcrumb" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
39
|
+
<ol data-slot="list" :class="ui.list({ class: props.ui?.list })">
|
|
40
|
+
<template v-for="(item, index) in props.items" :key="index">
|
|
41
|
+
<li data-slot="item" :class="ui.item({ class: [props.ui?.item, item.ui?.item] })">
|
|
39
42
|
<ULink v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
|
|
40
|
-
<ULinkBase v-bind="slotProps" as="span" :aria-current="(item.active ?? active) && index === items.length - 1 ? 'page' : void 0" data-slot="link" :class="ui.link({ class: [
|
|
41
|
-
<slot :name="item.slot || 'item'" :item="item" :active="item.active ?? index === items.length - 1" :index="index" :ui="ui">
|
|
42
|
-
<slot :name="item.slot ? `${item.slot}-leading` : 'item-leading'" :item="item" :active="item.active ?? index === items.length - 1" :index="index" :ui="ui">
|
|
43
|
-
<UIcon v-if="item.icon" :name="item.icon" data-slot="linkLeadingIcon" :class="ui.linkLeadingIcon({ class: [
|
|
44
|
-
<UAvatar v-else-if="item.avatar" :size="
|
|
43
|
+
<ULinkBase v-bind="slotProps" as="span" :aria-current="(item.active ?? active) && index === props.items.length - 1 ? 'page' : void 0" data-slot="link" :class="ui.link({ class: [props.ui?.link, item.ui?.link, item.class], active: item.active ?? index === props.items.length - 1, disabled: !!item.disabled, to: !!item.to })">
|
|
44
|
+
<slot :name="item.slot || 'item'" :item="item" :active="item.active ?? index === props.items.length - 1" :index="index" :ui="ui">
|
|
45
|
+
<slot :name="item.slot ? `${item.slot}-leading` : 'item-leading'" :item="item" :active="item.active ?? index === props.items.length - 1" :index="index" :ui="ui">
|
|
46
|
+
<UIcon v-if="item.icon" :name="item.icon" data-slot="linkLeadingIcon" :class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, item.ui?.linkLeadingIcon], active: item.active ?? index === props.items.length - 1 })" />
|
|
47
|
+
<UAvatar v-else-if="item.avatar" :size="props.ui?.linkLeadingAvatarSize || ui.linkLeadingAvatarSize()" v-bind="item.avatar" data-slot="linkLeadingAvatar" :class="ui.linkLeadingAvatar({ class: [props.ui?.linkLeadingAvatar, item.ui?.linkLeadingAvatar], active: item.active ?? index === props.items.length - 1 })" />
|
|
45
48
|
</slot>
|
|
46
49
|
|
|
47
|
-
<span v-if="get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" data-slot="linkLabel" :class="ui.linkLabel({ class: [
|
|
48
|
-
<slot :name="item.slot ? `${item.slot}-label` : 'item-label'" :item="item" :active="item.active ?? index === items.length - 1" :index="index">
|
|
50
|
+
<span v-if="get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" data-slot="linkLabel" :class="ui.linkLabel({ class: [props.ui?.linkLabel, item.ui?.linkLabel] })">
|
|
51
|
+
<slot :name="item.slot ? `${item.slot}-label` : 'item-label'" :item="item" :active="item.active ?? index === props.items.length - 1" :index="index">
|
|
49
52
|
{{ get(item, props.labelKey) }}
|
|
50
53
|
</slot>
|
|
51
54
|
</span>
|
|
52
55
|
|
|
53
|
-
<slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" :item="item" :active="item.active ?? index === items.length - 1" :index="index" />
|
|
56
|
+
<slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" :item="item" :active="item.active ?? index === props.items.length - 1" :index="index" />
|
|
54
57
|
</slot>
|
|
55
58
|
</ULinkBase>
|
|
56
59
|
</ULink>
|
|
57
60
|
</li>
|
|
58
61
|
|
|
59
|
-
<li v-if="index < items.length - 1" role="presentation" aria-hidden="true" data-slot="separator" :class="ui.separator({ class: [
|
|
62
|
+
<li v-if="index < props.items.length - 1" role="presentation" aria-hidden="true" data-slot="separator" :class="ui.separator({ class: [props.ui?.separator, item.ui?.separator] })">
|
|
60
63
|
<slot name="separator" :ui="ui">
|
|
61
|
-
<UIcon :name="separatorIcon" data-slot="separatorIcon" :class="ui.separatorIcon({ class: [
|
|
64
|
+
<UIcon :name="separatorIcon" data-slot="separatorIcon" :class="ui.separatorIcon({ class: [props.ui?.separatorIcon, item.ui?.separatorIcon] })" />
|
|
62
65
|
</slot>
|
|
63
66
|
</li>
|
|
64
67
|
</template>
|