@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
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import type { ComputedRef } from 'vue';
|
|
2
|
+
import type { ClassValue } from 'tailwind-variants';
|
|
3
|
+
import type * as ComponentTypes from '../types';
|
|
4
|
+
import type * as ui from '#build/ui';
|
|
5
|
+
type ThemeSlotOverrides<T> = T extends {
|
|
6
|
+
slots: infer S extends Record<string, any>;
|
|
7
|
+
} ? {
|
|
8
|
+
[K in keyof S]?: ClassValue;
|
|
9
|
+
} : {
|
|
10
|
+
[K in keyof T]?: T[K] extends any[] ? ClassValue : T[K] extends Record<string, any> ? ThemeSlotOverrides<T[K]> : ClassValue;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Flat slot-class override shape: `{ button: { base: '...' }, modal: {...} }`.
|
|
14
|
+
* Powers the `:ui` prop on `<UTheme>`, which remains the recommended way to
|
|
15
|
+
* scope class overrides without touching component prop defaults.
|
|
16
|
+
*/
|
|
17
|
+
export type ThemeUI = {
|
|
18
|
+
[K in keyof typeof ui]?: ThemeSlotOverrides<(typeof ui)[K]>;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Strict per-component defaults shape used by `<UTheme :props>`. Authored as
|
|
22
|
+
* a flat interface with literal keys (rather than a mapped type) so editors —
|
|
23
|
+
* Volar in particular — surface key completions inside template inline
|
|
24
|
+
* objects (`:props="{ button: { … } }"`). Volar reliably iterates interface
|
|
25
|
+
* members but not mapped-type members in this position.
|
|
26
|
+
*
|
|
27
|
+
* Keys mirror the theme registry exposed by `#build/ui` (see
|
|
28
|
+
* `src/templates.ts`): every themable component gets one camelCase entry
|
|
29
|
+
* whose value is a `Partial` of that component's `<PascalCase>Props`.
|
|
30
|
+
*/
|
|
31
|
+
export interface ThemeDefaults {
|
|
32
|
+
accordion?: Partial<ComponentTypes.AccordionProps>;
|
|
33
|
+
alert?: Partial<ComponentTypes.AlertProps>;
|
|
34
|
+
authForm?: Partial<ComponentTypes.AuthFormProps>;
|
|
35
|
+
avatar?: Partial<ComponentTypes.AvatarProps>;
|
|
36
|
+
avatarGroup?: Partial<ComponentTypes.AvatarGroupProps>;
|
|
37
|
+
badge?: Partial<ComponentTypes.BadgeProps>;
|
|
38
|
+
banner?: Partial<ComponentTypes.BannerProps>;
|
|
39
|
+
blogPost?: Partial<ComponentTypes.BlogPostProps>;
|
|
40
|
+
blogPosts?: Partial<ComponentTypes.BlogPostsProps>;
|
|
41
|
+
breadcrumb?: Partial<ComponentTypes.BreadcrumbProps>;
|
|
42
|
+
button?: Partial<ComponentTypes.ButtonProps>;
|
|
43
|
+
calendar?: Partial<ComponentTypes.CalendarProps>;
|
|
44
|
+
card?: Partial<ComponentTypes.CardProps>;
|
|
45
|
+
carousel?: Partial<ComponentTypes.CarouselProps>;
|
|
46
|
+
changelogVersion?: Partial<ComponentTypes.ChangelogVersionProps>;
|
|
47
|
+
changelogVersions?: Partial<ComponentTypes.ChangelogVersionsProps>;
|
|
48
|
+
chatMessage?: Partial<ComponentTypes.ChatMessageProps>;
|
|
49
|
+
chatMessages?: Partial<ComponentTypes.ChatMessagesProps>;
|
|
50
|
+
chatPalette?: Partial<ComponentTypes.ChatPaletteProps>;
|
|
51
|
+
chatPrompt?: Partial<ComponentTypes.ChatPromptProps>;
|
|
52
|
+
chatPromptSubmit?: Partial<ComponentTypes.ChatPromptSubmitProps>;
|
|
53
|
+
chatReasoning?: Partial<ComponentTypes.ChatReasoningProps>;
|
|
54
|
+
chatShimmer?: Partial<ComponentTypes.ChatShimmerProps>;
|
|
55
|
+
chatTool?: Partial<ComponentTypes.ChatToolProps>;
|
|
56
|
+
checkbox?: Partial<ComponentTypes.CheckboxProps>;
|
|
57
|
+
checkboxGroup?: Partial<ComponentTypes.CheckboxGroupProps>;
|
|
58
|
+
chip?: Partial<ComponentTypes.ChipProps>;
|
|
59
|
+
collapsible?: Partial<ComponentTypes.CollapsibleProps>;
|
|
60
|
+
colorPicker?: Partial<ComponentTypes.ColorPickerProps>;
|
|
61
|
+
commandPalette?: Partial<ComponentTypes.CommandPaletteProps>;
|
|
62
|
+
container?: Partial<ComponentTypes.ContainerProps>;
|
|
63
|
+
contentNavigation?: Partial<ComponentTypes.ContentNavigationProps>;
|
|
64
|
+
contentSearch?: Partial<ComponentTypes.ContentSearchProps>;
|
|
65
|
+
contentSearchButton?: Partial<ComponentTypes.ContentSearchButtonProps>;
|
|
66
|
+
contentSurround?: Partial<ComponentTypes.ContentSurroundProps>;
|
|
67
|
+
contentToc?: Partial<ComponentTypes.ContentTocProps>;
|
|
68
|
+
contextMenu?: Partial<ComponentTypes.ContextMenuProps>;
|
|
69
|
+
dashboardGroup?: Partial<ComponentTypes.DashboardGroupProps>;
|
|
70
|
+
dashboardNavbar?: Partial<ComponentTypes.DashboardNavbarProps>;
|
|
71
|
+
dashboardPanel?: Partial<ComponentTypes.DashboardPanelProps>;
|
|
72
|
+
dashboardResizeHandle?: Partial<ComponentTypes.DashboardResizeHandleProps>;
|
|
73
|
+
dashboardSearch?: Partial<ComponentTypes.DashboardSearchProps>;
|
|
74
|
+
dashboardSearchButton?: Partial<ComponentTypes.DashboardSearchButtonProps>;
|
|
75
|
+
dashboardSidebar?: Partial<ComponentTypes.DashboardSidebarProps>;
|
|
76
|
+
dashboardSidebarCollapse?: Partial<ComponentTypes.DashboardSidebarCollapseProps>;
|
|
77
|
+
dashboardSidebarToggle?: Partial<ComponentTypes.DashboardSidebarToggleProps>;
|
|
78
|
+
dashboardToolbar?: Partial<ComponentTypes.DashboardToolbarProps>;
|
|
79
|
+
drawer?: Partial<ComponentTypes.DrawerProps>;
|
|
80
|
+
dropdownMenu?: Partial<ComponentTypes.DropdownMenuProps>;
|
|
81
|
+
editor?: Partial<ComponentTypes.EditorProps>;
|
|
82
|
+
editorDragHandle?: Partial<ComponentTypes.EditorDragHandleProps>;
|
|
83
|
+
editorToolbar?: Partial<ComponentTypes.EditorToolbarProps>;
|
|
84
|
+
empty?: Partial<ComponentTypes.EmptyProps>;
|
|
85
|
+
error?: Partial<ComponentTypes.ErrorProps>;
|
|
86
|
+
fieldGroup?: Partial<ComponentTypes.FieldGroupProps>;
|
|
87
|
+
fileUpload?: Partial<ComponentTypes.FileUploadProps>;
|
|
88
|
+
footer?: Partial<ComponentTypes.FooterProps>;
|
|
89
|
+
footerColumns?: Partial<ComponentTypes.FooterColumnsProps>;
|
|
90
|
+
form?: Partial<ComponentTypes.FormProps<any, any, any>>;
|
|
91
|
+
formField?: Partial<ComponentTypes.FormFieldProps>;
|
|
92
|
+
header?: Partial<ComponentTypes.HeaderProps>;
|
|
93
|
+
input?: Partial<ComponentTypes.InputProps>;
|
|
94
|
+
inputDate?: Partial<ComponentTypes.InputDateProps>;
|
|
95
|
+
inputMenu?: Partial<ComponentTypes.InputMenuProps>;
|
|
96
|
+
inputNumber?: Partial<ComponentTypes.InputNumberProps>;
|
|
97
|
+
inputTags?: Partial<ComponentTypes.InputTagsProps>;
|
|
98
|
+
inputTime?: Partial<ComponentTypes.InputTimeProps>;
|
|
99
|
+
kbd?: Partial<ComponentTypes.KbdProps>;
|
|
100
|
+
listbox?: Partial<ComponentTypes.ListboxProps>;
|
|
101
|
+
main?: Partial<ComponentTypes.MainProps>;
|
|
102
|
+
marquee?: Partial<ComponentTypes.MarqueeProps>;
|
|
103
|
+
modal?: Partial<ComponentTypes.ModalProps>;
|
|
104
|
+
navigationMenu?: Partial<ComponentTypes.NavigationMenuProps>;
|
|
105
|
+
page?: Partial<ComponentTypes.PageProps>;
|
|
106
|
+
pageAnchors?: Partial<ComponentTypes.PageAnchorsProps>;
|
|
107
|
+
pageAside?: Partial<ComponentTypes.PageAsideProps>;
|
|
108
|
+
pageBody?: Partial<ComponentTypes.PageBodyProps>;
|
|
109
|
+
pageCTA?: Partial<ComponentTypes.PageCTAProps>;
|
|
110
|
+
pageCard?: Partial<ComponentTypes.PageCardProps>;
|
|
111
|
+
pageColumns?: Partial<ComponentTypes.PageColumnsProps>;
|
|
112
|
+
pageFeature?: Partial<ComponentTypes.PageFeatureProps>;
|
|
113
|
+
pageGrid?: Partial<ComponentTypes.PageGridProps>;
|
|
114
|
+
pageHeader?: Partial<ComponentTypes.PageHeaderProps>;
|
|
115
|
+
pageHero?: Partial<ComponentTypes.PageHeroProps>;
|
|
116
|
+
pageLinks?: Partial<ComponentTypes.PageLinksProps>;
|
|
117
|
+
pageList?: Partial<ComponentTypes.PageListProps>;
|
|
118
|
+
pageLogos?: Partial<ComponentTypes.PageLogosProps>;
|
|
119
|
+
pageSection?: Partial<ComponentTypes.PageSectionProps>;
|
|
120
|
+
pagination?: Partial<ComponentTypes.PaginationProps>;
|
|
121
|
+
pinInput?: Partial<ComponentTypes.PinInputProps>;
|
|
122
|
+
popover?: Partial<ComponentTypes.PopoverProps>;
|
|
123
|
+
pricingPlan?: Partial<ComponentTypes.PricingPlanProps>;
|
|
124
|
+
pricingPlans?: Partial<ComponentTypes.PricingPlansProps>;
|
|
125
|
+
pricingTable?: Partial<ComponentTypes.PricingTableProps>;
|
|
126
|
+
progress?: Partial<ComponentTypes.ProgressProps>;
|
|
127
|
+
radioGroup?: Partial<ComponentTypes.RadioGroupProps>;
|
|
128
|
+
scrollArea?: Partial<ComponentTypes.ScrollAreaProps>;
|
|
129
|
+
select?: Partial<ComponentTypes.SelectProps>;
|
|
130
|
+
selectMenu?: Partial<ComponentTypes.SelectMenuProps>;
|
|
131
|
+
separator?: Partial<ComponentTypes.SeparatorProps>;
|
|
132
|
+
sidebar?: Partial<ComponentTypes.SidebarProps>;
|
|
133
|
+
skeleton?: Partial<ComponentTypes.SkeletonProps>;
|
|
134
|
+
slideover?: Partial<ComponentTypes.SlideoverProps>;
|
|
135
|
+
slider?: Partial<ComponentTypes.SliderProps>;
|
|
136
|
+
stepper?: Partial<ComponentTypes.StepperProps>;
|
|
137
|
+
switch?: Partial<ComponentTypes.SwitchProps>;
|
|
138
|
+
table?: Partial<ComponentTypes.TableProps>;
|
|
139
|
+
tabs?: Partial<ComponentTypes.TabsProps>;
|
|
140
|
+
textarea?: Partial<ComponentTypes.TextareaProps>;
|
|
141
|
+
timeline?: Partial<ComponentTypes.TimelineProps>;
|
|
142
|
+
toast?: Partial<ComponentTypes.ToastProps>;
|
|
143
|
+
toaster?: Partial<ComponentTypes.ToasterProps>;
|
|
144
|
+
tooltip?: Partial<ComponentTypes.TooltipProps>;
|
|
145
|
+
tree?: Partial<ComponentTypes.TreeProps>;
|
|
146
|
+
user?: Partial<ComponentTypes.UserProps>;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Loose internal shape stored on the injected `ThemeContext`. Allows the
|
|
150
|
+
* `prose` namespace (lifted by `normalizeUi`) and any unknown keys to flow
|
|
151
|
+
* through without polluting the user-facing `ThemeDefaults` type.
|
|
152
|
+
*/
|
|
153
|
+
export type ThemeContextDefaults = ThemeDefaults & {
|
|
154
|
+
[name: string]: Record<string, any> | undefined;
|
|
155
|
+
};
|
|
156
|
+
export type ThemeContext = {
|
|
157
|
+
defaults: ComputedRef<ThemeContextDefaults>;
|
|
158
|
+
};
|
|
159
|
+
declare const provideThemeContext: (contextValue: ThemeContext) => ThemeContext;
|
|
160
|
+
/**
|
|
161
|
+
* Module-level fallback so components can call `useComponentProps` outside any
|
|
162
|
+
* `<UTheme>` wrapper without crashing.
|
|
163
|
+
*/
|
|
164
|
+
export declare const defaultThemeContext: ThemeContext;
|
|
165
|
+
export declare function injectThemeContext(fallback?: ThemeContext): ThemeContext;
|
|
166
|
+
export { provideThemeContext };
|
|
167
|
+
/**
|
|
168
|
+
* Resolve a component's props with the priority chain:
|
|
169
|
+
* explicit prop > nearest UTheme > withDefaults
|
|
170
|
+
* > app.config.ui.<name>.defaultVariants
|
|
171
|
+
*
|
|
172
|
+
* The returned proxy transparently reads from `props`, falling through to the
|
|
173
|
+
* injected `ThemeContext` and `app.config.ui.<name>.defaultVariants` for
|
|
174
|
+
* defaults. The component's tv() `defaultVariants` are intentionally left out
|
|
175
|
+
* of the proxy fallback — they continue to drive `tv()`-internal class
|
|
176
|
+
* resolution (the original semantics) without leaking into prop reads. The
|
|
177
|
+
* `ui` prop is deep-merged (explicit slot classes override theme slot classes)
|
|
178
|
+
* instead of being replaced.
|
|
179
|
+
*/
|
|
180
|
+
export declare function useComponentProps<T extends object>(name: string, props: T): T;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { computed, getCurrentInstance } from "vue";
|
|
2
|
+
import defu from "defu";
|
|
3
|
+
import { createContext } from "reka-ui";
|
|
4
|
+
import { useAppConfig } from "#imports";
|
|
5
|
+
import { get } from "../utils/index.js";
|
|
6
|
+
const [_injectThemeContext, provideThemeContext] = createContext("UTheme", "RootContext");
|
|
7
|
+
export const defaultThemeContext = {
|
|
8
|
+
defaults: computed(() => ({}))
|
|
9
|
+
};
|
|
10
|
+
export function injectThemeContext(fallback = defaultThemeContext) {
|
|
11
|
+
return _injectThemeContext(fallback);
|
|
12
|
+
}
|
|
13
|
+
export { provideThemeContext };
|
|
14
|
+
function camelCase(str) {
|
|
15
|
+
return str.replace(/-(\w)/g, (_, c) => c.toUpperCase());
|
|
16
|
+
}
|
|
17
|
+
function kebabCase(str) {
|
|
18
|
+
return str.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`);
|
|
19
|
+
}
|
|
20
|
+
function propIsDefined(vnode, prop) {
|
|
21
|
+
if (!vnode || !vnode.props) return false;
|
|
22
|
+
return vnode.props[camelCase(prop)] !== void 0 || vnode.props[kebabCase(prop)] !== void 0;
|
|
23
|
+
}
|
|
24
|
+
export function useComponentProps(name, props) {
|
|
25
|
+
const vm = getCurrentInstance();
|
|
26
|
+
const { defaults } = injectThemeContext();
|
|
27
|
+
const appConfig = useAppConfig();
|
|
28
|
+
return new Proxy(props, {
|
|
29
|
+
get(target, prop, receiver) {
|
|
30
|
+
if (prop === "__v_isReactive") return true;
|
|
31
|
+
if (prop === "__v_raw") return target;
|
|
32
|
+
const raw = Reflect.get(target, prop, receiver);
|
|
33
|
+
if (typeof prop !== "string") return raw;
|
|
34
|
+
const themeEntry = name.includes(".") ? get(defaults.value, name) : defaults.value[name];
|
|
35
|
+
if (prop === "ui") {
|
|
36
|
+
const themeUi = themeEntry?.ui;
|
|
37
|
+
if (!raw && !themeUi) return raw;
|
|
38
|
+
return defu(raw ?? {}, themeUi ?? {});
|
|
39
|
+
}
|
|
40
|
+
if (vm && propIsDefined(vm.vnode, prop)) return raw;
|
|
41
|
+
const themeValue = themeEntry?.[prop];
|
|
42
|
+
if (themeValue !== void 0) return themeValue;
|
|
43
|
+
const propDef = vm?.type?.props?.[prop];
|
|
44
|
+
if (propDef && Object.prototype.hasOwnProperty.call(propDef, "default")) {
|
|
45
|
+
return raw;
|
|
46
|
+
}
|
|
47
|
+
const appConfigEntry = name.includes(".") ? get(appConfig.ui ?? {}, name) : appConfig.ui?.[name];
|
|
48
|
+
return appConfigEntry?.defaultVariants?.[prop];
|
|
49
|
+
},
|
|
50
|
+
// `has`, `ownKeys`, and `getOwnPropertyDescriptor` reflect the underlying
|
|
51
|
+
// `defineProps` schema only — theme defaults are NOT enumerable. As a
|
|
52
|
+
// result, `Object.keys(props)`, `for…in`, and `{ ...props }` see only the
|
|
53
|
+
// declared prop keys, but each value lookup still flows through the proxy.
|
|
54
|
+
// This is the contract our internal `useForwardProps` relies on.
|
|
55
|
+
has: (t, p) => Reflect.has(t, p),
|
|
56
|
+
ownKeys: (t) => Reflect.ownKeys(t),
|
|
57
|
+
getOwnPropertyDescriptor: (t, p) => Reflect.getOwnPropertyDescriptor(t, p)
|
|
58
|
+
});
|
|
59
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { ContentNavigationItem } from '@nuxt/content';
|
|
2
|
-
import type { ContentSearchFile, ContentSearchItem } from '../components/content/ContentSearch.vue';
|
|
2
|
+
import type { ContentSearchFile, ContentSearchItem, ContentSearchLink, ContentSearchResult } from '../components/content/ContentSearch.vue';
|
|
3
3
|
declare function _useContentSearch(): {
|
|
4
4
|
open: import("vue").Ref<boolean, boolean>;
|
|
5
|
-
mapFile: (file: ContentSearchFile, link: ContentNavigationItem,
|
|
5
|
+
mapFile: (file: ContentSearchFile, link: ContentNavigationItem, ancestors?: ContentNavigationItem[]) => ContentSearchItem;
|
|
6
6
|
mapNavigationItems: (children: ContentNavigationItem[], files: ContentSearchFile[], parent?: ContentNavigationItem) => ContentSearchItem[];
|
|
7
|
+
mapLinks: (links: ContentSearchLink[]) => ContentSearchItem[];
|
|
8
|
+
mapSearchResults: (results: ContentSearchResult[], navigation?: ContentNavigationItem[]) => ContentSearchItem[];
|
|
7
9
|
postFilter: (query: string, items: ContentSearchItem[]) => ContentSearchItem[];
|
|
8
10
|
};
|
|
9
11
|
export declare const useContentSearch: typeof _useContentSearch;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { ref } from "vue";
|
|
2
2
|
import { createSharedComposable } from "@vueuse/core";
|
|
3
3
|
import { useAppConfig } from "#imports";
|
|
4
|
+
import { sanitizeSnippet } from "../utils/search.js";
|
|
4
5
|
function _useContentSearch() {
|
|
5
6
|
const open = ref(false);
|
|
6
7
|
const appConfig = useAppConfig();
|
|
7
|
-
function mapFile(file, link,
|
|
8
|
-
const prefix = [...new Set([
|
|
8
|
+
function mapFile(file, link, ancestors = []) {
|
|
9
|
+
const prefix = [...new Set([...ancestors.map((a) => a.title), ...file.titles].filter(Boolean))];
|
|
10
|
+
const ancestorIcon = ancestors.findLast((a) => a.icon)?.icon;
|
|
9
11
|
return {
|
|
10
12
|
prefix: prefix?.length ? prefix.join(" > ") + " >" : void 0,
|
|
11
13
|
label: file.id === link.path ? link.title : file.title,
|
|
12
14
|
suffix: file.content.replaceAll("<", "<").replaceAll(">", ">"),
|
|
13
15
|
to: file.id,
|
|
14
|
-
icon: link.icon ||
|
|
16
|
+
icon: link.icon || ancestorIcon || (file.level > 1 ? appConfig.ui.icons.hash : appConfig.ui.icons.file),
|
|
15
17
|
level: file.level
|
|
16
18
|
};
|
|
17
19
|
}
|
|
@@ -26,16 +28,69 @@ function _useContentSearch() {
|
|
|
26
28
|
}
|
|
27
29
|
bucket.push(file);
|
|
28
30
|
}
|
|
29
|
-
function visit(nodes,
|
|
31
|
+
function visit(nodes, ancestors) {
|
|
30
32
|
return nodes.flatMap((link) => {
|
|
31
33
|
if (link.children?.length) {
|
|
32
|
-
return visit(link.children, link);
|
|
34
|
+
return visit(link.children, [...ancestors, link]);
|
|
33
35
|
}
|
|
34
36
|
const matched = link.path ? filesByPath.get(link.path) : void 0;
|
|
35
|
-
return matched?.map((file) => mapFile(file, link,
|
|
37
|
+
return matched?.map((file) => mapFile(file, link, ancestors)) || [];
|
|
36
38
|
});
|
|
37
39
|
}
|
|
38
|
-
return visit(children, parent);
|
|
40
|
+
return visit(children, parent ? [parent] : []);
|
|
41
|
+
}
|
|
42
|
+
function mapLinks(links) {
|
|
43
|
+
return links.flatMap((link) => [{
|
|
44
|
+
...link,
|
|
45
|
+
suffix: link.description,
|
|
46
|
+
description: void 0,
|
|
47
|
+
icon: link.icon || appConfig.ui.icons.file,
|
|
48
|
+
children: void 0
|
|
49
|
+
}, ...link.children?.map((child) => ({
|
|
50
|
+
...child,
|
|
51
|
+
prefix: link.label ? link.label + " >" : void 0,
|
|
52
|
+
suffix: child.description,
|
|
53
|
+
description: void 0,
|
|
54
|
+
icon: child.icon || link.icon || appConfig.ui.icons.file
|
|
55
|
+
})) || []]);
|
|
56
|
+
}
|
|
57
|
+
function findNavItem(path, nodes, ancestors = []) {
|
|
58
|
+
for (const node of nodes || []) {
|
|
59
|
+
if (node.path === path) return { link: node, ancestors };
|
|
60
|
+
if (node.children?.length) {
|
|
61
|
+
const found = findNavItem(path, node.children, [...ancestors, node]);
|
|
62
|
+
if (found.link) return found;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return {};
|
|
66
|
+
}
|
|
67
|
+
function mapSearchResults(results, navigation) {
|
|
68
|
+
const navCache = /* @__PURE__ */ new Map();
|
|
69
|
+
return results.reduce((acc, result) => {
|
|
70
|
+
const basePath = result.id.split("#")[0] ?? result.id;
|
|
71
|
+
let nav = navCache.get(basePath);
|
|
72
|
+
if (!nav) {
|
|
73
|
+
nav = findNavItem(basePath, navigation);
|
|
74
|
+
navCache.set(basePath, nav);
|
|
75
|
+
}
|
|
76
|
+
const { link, ancestors = [] } = nav;
|
|
77
|
+
if (navigation?.length && !link) return acc;
|
|
78
|
+
const sectionChain = ancestors.length ? ancestors : link ? [link] : [];
|
|
79
|
+
const prefixParts = [...new Set([...sectionChain.map((s) => s.title), ...result.titles].filter(Boolean))];
|
|
80
|
+
const prefix = prefixParts.length ? prefixParts.join(" > ") + " >" : void 0;
|
|
81
|
+
const ancestorIcon = ancestors.findLast((a) => a.icon)?.icon;
|
|
82
|
+
acc.push({
|
|
83
|
+
label: result.title,
|
|
84
|
+
labelHtml: result.snippets?.title ? sanitizeSnippet(result.snippets.title) : void 0,
|
|
85
|
+
prefix,
|
|
86
|
+
description: result.content.replaceAll("<", "<").replaceAll(">", ">"),
|
|
87
|
+
descriptionHtml: result.snippets?.content ? sanitizeSnippet(result.snippets.content) : void 0,
|
|
88
|
+
to: result.id,
|
|
89
|
+
icon: link?.icon || ancestorIcon || (result.level > 1 ? appConfig.ui.icons.hash : appConfig.ui.icons.file),
|
|
90
|
+
level: result.level
|
|
91
|
+
});
|
|
92
|
+
return acc;
|
|
93
|
+
}, []);
|
|
39
94
|
}
|
|
40
95
|
function postFilter(query, items) {
|
|
41
96
|
if (!query) {
|
|
@@ -47,6 +102,8 @@ function _useContentSearch() {
|
|
|
47
102
|
open,
|
|
48
103
|
mapFile,
|
|
49
104
|
mapNavigationItems,
|
|
105
|
+
mapLinks,
|
|
106
|
+
mapSearchResults,
|
|
50
107
|
postFilter
|
|
51
108
|
};
|
|
52
109
|
}
|
|
@@ -8,9 +8,17 @@ export declare const fieldGroupInjectionKey: InjectionKey<ComputedRef<{
|
|
|
8
8
|
type Props<T> = {
|
|
9
9
|
size?: GetObjectField<T, 'size'>;
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Reads `size` / `orientation` from a wrapping `<UFieldGroup>` (or `<UButtonGroup>`, etc.).
|
|
13
|
+
*
|
|
14
|
+
* **Always pass the raw `_props`, never the `useComponentProps` proxy** — the
|
|
15
|
+
* fallback `props?.size ?? fieldGroup?.value.size` must keep the closer context
|
|
16
|
+
* winning over `<UTheme :props>`. To still apply theme defaults on bare inputs,
|
|
17
|
+
* fall back to the proxy at the `tv()` call site: `size: groupSize.value ?? props.size`.
|
|
18
|
+
*/
|
|
11
19
|
export declare function useFieldGroup<T>(props: Props<T>): {
|
|
12
20
|
orientation: ComputedRef<"horizontal" | "vertical" | undefined>;
|
|
13
|
-
size: ComputedRef<"
|
|
21
|
+
size: ComputedRef<"md" | "xs" | "sm" | "lg" | "xl" | NonNullable<GetObjectField<T, "size">> | undefined>;
|
|
14
22
|
};
|
|
15
23
|
export declare const FieldGroupReset: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
16
24
|
[key: string]: any;
|
|
@@ -22,13 +22,33 @@ export declare const formInputsInjectionKey: InjectionKey<Ref<Record<string, {
|
|
|
22
22
|
}>>>;
|
|
23
23
|
export declare const formLoadingInjectionKey: InjectionKey<Readonly<Ref<boolean>>>;
|
|
24
24
|
export declare const formErrorsInjectionKey: InjectionKey<Readonly<Ref<FormErrorWithId[]>>>;
|
|
25
|
+
/**
|
|
26
|
+
* Wires an input to its wrapping `<UFormField>` (id/name/aria, validation events, error-driven color).
|
|
27
|
+
*
|
|
28
|
+
* **Always pass the raw `_props`, never the `useComponentProps` proxy.**
|
|
29
|
+
* The internal fallback `props?.x ?? formField?.value.x` must distinguish
|
|
30
|
+
* "explicit prop" from "theme default" — passing the proxy would leak
|
|
31
|
+
* `<UTheme :props>` defaults into the explicit slot and let theme size/color
|
|
32
|
+
* silently override the wrapping field (regression-tested in `Theme.spec.ts`).
|
|
33
|
+
*
|
|
34
|
+
* To get `<UTheme :props>` to apply when no `<UFormField>` wraps the input,
|
|
35
|
+
* fall back to the proxy at the `tv()` call site:
|
|
36
|
+
*
|
|
37
|
+
* ```ts
|
|
38
|
+
* size: size.value ?? props.size,
|
|
39
|
+
* color: color.value ?? props.color,
|
|
40
|
+
* highlight: highlight.value ?? props.highlight
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* Final precedence: `explicit > FormField > <UTheme :props> > withDefaults > app.config > tv defaults`.
|
|
44
|
+
*/
|
|
25
45
|
export declare function useFormField<T>(props?: Props<T>, opts?: {
|
|
26
46
|
bind?: boolean;
|
|
27
47
|
deferInputValidation?: boolean;
|
|
28
48
|
}): {
|
|
29
49
|
id: ComputedRef<string | undefined>;
|
|
30
50
|
name: ComputedRef<string | undefined>;
|
|
31
|
-
size: ComputedRef<"
|
|
51
|
+
size: ComputedRef<"md" | "xs" | "sm" | "lg" | "xl" | NonNullable<GetObjectField<T, "size">> | undefined>;
|
|
32
52
|
color: ComputedRef<"error" | GetObjectField<T, "color"> | undefined>;
|
|
33
53
|
highlight: ComputedRef<boolean | undefined>;
|
|
34
54
|
disabled: ComputedRef<boolean | undefined>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComputedRef, MaybeRef } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Proxy-aware replacement for reka-ui's `useForwardProps` / `useForwardPropsEmits`.
|
|
4
|
+
* Forwards every enumerable key of `source` whose value is not `undefined`, and
|
|
5
|
+
* — when `emits` is provided — merges the emit handlers as `onUpdate:open`-style
|
|
6
|
+
* props on the resulting object.
|
|
7
|
+
*
|
|
8
|
+
* Unlike reka-ui's version, this does NOT filter by `vm.vnode.props` or
|
|
9
|
+
* `vm.type.props.<key>.default`, so values supplied by `<UTheme :props>`
|
|
10
|
+
* through `useComponentProps` flow through transparently to the underlying
|
|
11
|
+
* Reka primitive.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useForwardProps<T extends object, E extends string = string>(source: MaybeRef<T> | ComputedRef<T>, emits?: (event: E, ...args: any[]) => void): ComputedRef<Partial<T>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { computed, isRef } from "vue";
|
|
2
|
+
import { useEmitAsProps } from "reka-ui";
|
|
3
|
+
export function useForwardProps(source, emits) {
|
|
4
|
+
const emitAsProps = emits ? useEmitAsProps(emits) : {};
|
|
5
|
+
return computed(() => {
|
|
6
|
+
const src = isRef(source) ? source.value : source;
|
|
7
|
+
const out = { ...emitAsProps };
|
|
8
|
+
for (const key in src) {
|
|
9
|
+
const value = src[key];
|
|
10
|
+
if (value !== void 0) out[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return out;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prefixes Tailwind utility class strings with the configured `theme.prefix`,
|
|
3
|
+
* so static utility classes inside Nuxt UI components match the consumer's
|
|
4
|
+
* Tailwind `prefix(...)` configuration.
|
|
5
|
+
*/
|
|
6
|
+
export declare function usePrefix(): (classString: string) => string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useAppConfig } from "#imports";
|
|
2
|
+
export function usePrefix() {
|
|
3
|
+
const appConfig = useAppConfig();
|
|
4
|
+
const prefix = appConfig.ui?.prefix;
|
|
5
|
+
return (classString) => {
|
|
6
|
+
if (!prefix || !classString) {
|
|
7
|
+
return classString;
|
|
8
|
+
}
|
|
9
|
+
return classString.split(/\s+/).filter(Boolean).map((cls) => `${prefix}:${cls}`).join(" ");
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -50,6 +50,10 @@ export type UseResizableProps = {
|
|
|
50
50
|
* @defaultValue 'dashboard'
|
|
51
51
|
*/
|
|
52
52
|
storageKey?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Options to pass to the underlying storage (`useCookie` or `useStorage`).
|
|
55
|
+
*/
|
|
56
|
+
storageOptions?: Record<string, any>;
|
|
53
57
|
/**
|
|
54
58
|
* Whether to persist the size in the storage.
|
|
55
59
|
* @defaultValue true
|
|
@@ -22,7 +22,7 @@ export function useResizable(key, options = {}, { collapsed = ref(false) } = {})
|
|
|
22
22
|
size: opts.value.defaultSize,
|
|
23
23
|
collapsed: unref(collapsed) ?? false
|
|
24
24
|
};
|
|
25
|
-
const storageData = opts.value.persistent && (opts.value.resizable || opts.value.collapsible) ? opts.value.storage === "cookie" ? useCookie(key, { default: () => defaultStorageValue }) : useStorage(key, defaultStorageValue) : ref(defaultStorageValue);
|
|
25
|
+
const storageData = opts.value.persistent && (opts.value.resizable || opts.value.collapsible) ? opts.value.storage === "cookie" ? useCookie(key, { ...opts.value.storageOptions, default: () => defaultStorageValue }) : useStorage(key, defaultStorageValue, void 0, opts.value.storageOptions) : ref(defaultStorageValue);
|
|
26
26
|
const isCollapsed = computed({
|
|
27
27
|
get: () => storageData.value.collapsed,
|
|
28
28
|
set: (value) => {
|
|
@@ -54,6 +54,7 @@ export default defineLocale({
|
|
|
54
54
|
},
|
|
55
55
|
contentSearch: {
|
|
56
56
|
links: "\u0628\u06D5\u0633\u062A\u06D5\u0631\u06D5\u06A9\u0627\u0646",
|
|
57
|
+
search: "\u0626\u06D5\u0646\u062C\u0627\u0645\u06D5\u06A9\u0627\u0646",
|
|
57
58
|
theme: "\u0695\u0648\u0648\u06A9\u0627\u0631"
|
|
58
59
|
},
|
|
59
60
|
contentSearchButton: {
|
|
@@ -53,6 +53,7 @@ export default defineLocale({
|
|
|
53
53
|
},
|
|
54
54
|
contentSearch: {
|
|
55
55
|
links: "\u03A3\u03CD\u03BD\u03B4\u03B5\u03C3\u03BC\u03BF\u03B9",
|
|
56
|
+
search: "\u0391\u03C0\u03BF\u03C4\u03B5\u03BB\u03AD\u03C3\u03BC\u03B1\u03C4\u03B1",
|
|
56
57
|
theme: "\u0398\u03AD\u03BC\u03B1"
|
|
57
58
|
},
|
|
58
59
|
contentSearchButton: {
|