@nuxt/ui 3.0.0-alpha.7 → 3.0.0-alpha.8
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/accordion.ts +20 -0
- package/.nuxt/ui/alert.ts +242 -0
- package/.nuxt/ui/avatar-group.ts +40 -0
- package/.nuxt/ui/avatar.ts +42 -0
- package/.nuxt/ui/badge.ts +194 -0
- package/.nuxt/ui/breadcrumb.ts +45 -0
- package/.nuxt/ui/button-group.ts +16 -0
- package/.nuxt/ui/button.ts +344 -0
- package/.nuxt/ui/card.ts +8 -0
- package/.nuxt/ui/carousel.ts +41 -0
- package/.nuxt/ui/checkbox.ts +105 -0
- package/.nuxt/ui/chip.ts +67 -0
- package/.nuxt/ui/collapsible.ts +6 -0
- package/.nuxt/ui/command-palette.ts +40 -0
- package/.nuxt/ui/container.ts +3 -0
- package/.nuxt/ui/context-menu.ts +198 -0
- package/.nuxt/ui/drawer.ts +55 -0
- package/.nuxt/ui/dropdown-menu.ts +199 -0
- package/.nuxt/ui/form-field.ts +40 -0
- package/.nuxt/ui/form.ts +3 -0
- package/.nuxt/ui/index.ts +43 -0
- package/.nuxt/ui/input-menu.ts +411 -0
- package/.nuxt/ui/input.ts +263 -0
- package/.nuxt/ui/kbd.ts +19 -0
- package/.nuxt/ui/link.ts +15 -0
- package/.nuxt/ui/modal.ts +28 -0
- package/.nuxt/ui/navigation-menu.ts +390 -0
- package/.nuxt/ui/pagination.ts +8 -0
- package/.nuxt/ui/popover.ts +6 -0
- package/.nuxt/ui/progress.ts +258 -0
- package/.nuxt/ui/radio-group.ts +112 -0
- package/.nuxt/ui/select-menu.ts +321 -0
- package/.nuxt/ui/select.ts +314 -0
- package/.nuxt/ui/separator.ts +143 -0
- package/.nuxt/ui/skeleton.ts +3 -0
- package/.nuxt/ui/slideover.ts +63 -0
- package/.nuxt/ui/slider.ts +148 -0
- package/.nuxt/ui/switch.ts +113 -0
- package/.nuxt/ui/table.ts +128 -0
- package/.nuxt/ui/tabs.ts +227 -0
- package/.nuxt/ui/textarea.ts +263 -0
- package/.nuxt/ui/toast.ts +66 -0
- package/.nuxt/ui/toaster.ts +75 -0
- package/.nuxt/ui/tooltip.ts +9 -0
- package/cli/templates.mjs +1 -1
- package/dist/chunks/component-meta.cjs +73264 -0
- package/dist/chunks/component-meta.mjs +73262 -0
- package/dist/client/devtools/200.html +1 -0
- package/dist/client/devtools/404.html +1 -0
- package/dist/client/devtools/_fonts/rP2Wp2ywxg089UriCZaSExd86J3t9jz86MvyyKK58UfivUw4aw-SK92LTmKP0.woff2 +0 -0
- package/dist/client/devtools/_fonts/rP2Wp2ywxg089UriCZaSExd86J3t9jz86MvyyKy58UfivUw-9uYm8d48E4.woff2 +0 -0
- package/dist/client/devtools/_fonts/rP2Yp2ywxg089UriI5-g4vlH9VoD8Cmcqbu0-K6z9mXg-VNw7NHvqnp.woff2 +0 -0
- package/dist/client/devtools/_fonts/rP2Yp2ywxg089UriI5-g4vlH9VoD8Cmcqbu6-K6z9mXgjU0-EkYdMs3MAX.woff2 +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-7DW3w-R7n06NbhGy.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-JDG3w-leGNfkTmsj.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-JDW3w-ciElMF03ku.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat8JCm3w-sB722Uoa0f.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat8JDW3w-PBDI1JDjwV.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat8gCm3w-0q1hqVn09O.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat9XCm3w-ByvzuLy2fa.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat9uCm3w-5TKCIs6EEw.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat_XDW3w-r2swRDGfn2.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAC5thTQ-ldB60l5U8r.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAIpthTQ-wbFKGFDrgo.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAIpxhTQ-LLUBv5jskj.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwARZthTQ-F71RdTRbNg.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwA_JxhTQ-6nh65gZkc0.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAfJthTQ-aMoWEJLmTt.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAkJxhTQ-WMBvmLOgKm.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAop1hTQ-utGC2hnWq2.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAopxhTQ-YpyTieVa5B.woff +0 -0
- package/dist/client/devtools/_nuxt/Bj9hdafK.js +1 -0
- package/dist/client/devtools/_nuxt/DM3_wAgz.js +62 -0
- package/dist/client/devtools/_nuxt/builds/latest.json +1 -0
- package/dist/client/devtools/_nuxt/builds/meta/e6b425f7-b919-4014-915b-0ea07c316790.json +1 -0
- package/dist/client/devtools/_nuxt/entry.DaJP-ZMB.css +24 -0
- package/dist/client/devtools/_nuxt/error-404.B0Nmv3fV.css +1 -0
- package/dist/client/devtools/_nuxt/error-500.C8fgTxVz.css +1 -0
- package/dist/client/devtools/_nuxt/hKiujHsR.js +1 -0
- package/dist/client/devtools/favicon.svg +1 -0
- package/dist/client/devtools/index.html +1 -0
- package/dist/devtools/runtime/DevtoolsRenderer.vue +53 -0
- package/dist/devtools/runtime/examples/AvatarGroupExample.vue +7 -0
- package/dist/devtools/runtime/examples/ButtonGroupExample.vue +8 -0
- package/dist/devtools/runtime/examples/CardExample.vue +13 -0
- package/dist/devtools/runtime/examples/CarouselExample.vue +13 -0
- package/dist/devtools/runtime/examples/ChipExample.vue +5 -0
- package/dist/devtools/runtime/examples/CollapsibleExample.vue +8 -0
- package/dist/devtools/runtime/examples/CommandPaletteExample.vue +29 -0
- package/dist/devtools/runtime/examples/ContainerExample.vue +5 -0
- package/dist/devtools/runtime/examples/ContextMenuExample.vue +5 -0
- package/dist/devtools/runtime/examples/DrawerExample.vue +8 -0
- package/dist/devtools/runtime/examples/DropdownMenuExample.vue +5 -0
- package/dist/devtools/runtime/examples/FormExample.vue +30 -0
- package/dist/devtools/runtime/examples/FormFieldExample.vue +5 -0
- package/dist/devtools/runtime/examples/LinkExample.vue +5 -0
- package/dist/devtools/runtime/examples/ModalExample.vue +8 -0
- package/dist/devtools/runtime/examples/PopoverExample.vue +8 -0
- package/dist/devtools/runtime/examples/SkeletonExample.vue +3 -0
- package/dist/devtools/runtime/examples/SlideoverExample.vue +8 -0
- package/dist/devtools/runtime/examples/ToasterExample.vue +11 -0
- package/dist/devtools/runtime/examples/TooltipExample.vue +5 -0
- package/dist/module.cjs +222 -4
- package/dist/module.d.cts +54 -0
- package/dist/module.d.mts +10 -0
- package/dist/module.d.ts +10 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +157 -2763
- package/dist/runtime/components/Accordion.vue +32 -1
- package/dist/runtime/components/Alert.vue +4 -0
- package/dist/runtime/components/App.vue +8 -0
- package/dist/runtime/components/Avatar.vue +23 -5
- package/dist/runtime/components/AvatarGroup.vue +3 -0
- package/dist/runtime/components/Badge.vue +33 -3
- package/dist/runtime/components/Breadcrumb.vue +25 -1
- package/dist/runtime/components/Button.vue +6 -1
- package/dist/runtime/components/ButtonGroup.vue +4 -1
- package/dist/runtime/components/Card.vue +3 -0
- package/dist/runtime/components/Carousel.vue +7 -2
- package/dist/runtime/components/Checkbox.vue +4 -0
- package/dist/runtime/components/Chip.vue +9 -2
- package/dist/runtime/components/Collapsible.vue +3 -0
- package/dist/runtime/components/CommandPalette.vue +3 -1
- package/dist/runtime/components/Container.vue +3 -0
- package/dist/runtime/components/ContextMenu.vue +64 -3
- package/dist/runtime/components/ContextMenuContent.vue +8 -8
- package/dist/runtime/components/Drawer.vue +3 -0
- package/dist/runtime/components/DropdownMenu.vue +52 -3
- package/dist/runtime/components/DropdownMenuContent.vue +8 -8
- package/dist/runtime/components/Form.vue +3 -0
- package/dist/runtime/components/FormField.vue +3 -0
- package/dist/runtime/components/Input.vue +1 -0
- package/dist/runtime/components/InputMenu.vue +23 -12
- package/dist/runtime/components/Kbd.vue +2 -0
- package/dist/runtime/components/Link.vue +50 -1
- package/dist/runtime/components/Modal.vue +3 -0
- package/dist/runtime/components/NavigationMenu.vue +91 -44
- package/dist/runtime/components/Pagination.vue +5 -1
- package/dist/runtime/components/Popover.vue +3 -0
- package/dist/runtime/components/Progress.vue +1 -1
- package/dist/runtime/components/RadioGroup.vue +4 -1
- package/dist/runtime/components/Select.vue +24 -13
- package/dist/runtime/components/SelectMenu.vue +29 -17
- package/dist/runtime/components/Separator.vue +1 -1
- package/dist/runtime/components/Skeleton.vue +3 -0
- package/dist/runtime/components/Slideover.vue +3 -0
- package/dist/runtime/components/Slider.vue +1 -1
- package/dist/runtime/components/Switch.vue +5 -1
- package/dist/runtime/components/Table.vue +16 -7
- package/dist/runtime/components/Tabs.vue +20 -1
- package/dist/runtime/components/Toast.vue +4 -0
- package/dist/runtime/components/Toaster.vue +7 -0
- package/dist/runtime/components/Tooltip.vue +3 -0
- package/dist/runtime/composables/defineShortcuts.js +0 -6
- package/dist/runtime/composables/extendDevtoolsMeta.d.ts +7 -0
- package/dist/runtime/composables/extendDevtoolsMeta.js +2 -0
- package/dist/runtime/composables/useKbd.d.ts +10 -3
- package/dist/runtime/composables/useKbd.js +14 -8
- package/dist/runtime/types/utils.d.ts +7 -0
- package/dist/runtime/utils/index.js +1 -1
- package/dist/runtime/utils/link.d.ts +1 -1
- package/dist/runtime/vue/components/Icon.vue +15 -0
- package/dist/runtime/vue/components/Link.vue +195 -0
- package/dist/runtime/vue/plugins/color-mode.d.ts +4 -0
- package/dist/runtime/vue/plugins/color-mode.js +6 -0
- package/dist/runtime/vue/plugins/head.d.ts +4 -0
- package/dist/runtime/vue/plugins/head.js +6 -0
- package/dist/runtime/vue/stubs.d.ts +15 -0
- package/dist/runtime/vue/stubs.js +27 -0
- package/dist/shared/ui.BU7wzH0D.cjs +2872 -0
- package/dist/shared/ui.BufKhDiD.mjs +2865 -0
- package/dist/unplugin.cjs +192 -0
- package/dist/unplugin.d.cts +47 -0
- package/dist/unplugin.d.mts +47 -0
- package/dist/unplugin.d.ts +47 -0
- package/dist/unplugin.mjs +181 -0
- package/dist/vite.cjs +22 -0
- package/dist/vite.d.cts +13 -0
- package/dist/vite.d.mts +13 -0
- package/dist/vite.d.ts +13 -0
- package/dist/vite.mjs +20 -0
- package/package.json +68 -30
- package/vue-plugin.d.ts +5 -0
- package/cli/node_modules/.ignored/citty/LICENSE +0 -36
- package/cli/node_modules/.ignored/citty/README.md +0 -134
- package/cli/node_modules/.ignored/citty/dist/index.cjs +0 -475
- package/cli/node_modules/.ignored/citty/dist/index.d.cts +0 -80
- package/cli/node_modules/.ignored/citty/dist/index.d.mts +0 -80
- package/cli/node_modules/.ignored/citty/dist/index.d.ts +0 -80
- package/cli/node_modules/.ignored/citty/dist/index.mjs +0 -463
- package/cli/node_modules/.ignored/citty/package.json +0 -49
- package/cli/node_modules/.ignored/consola/LICENSE +0 -47
- package/cli/node_modules/.ignored/consola/README.md +0 -318
- package/cli/node_modules/.ignored/consola/core.d.ts +0 -1
- package/cli/node_modules/.ignored/consola/dist/basic.cjs +0 -32
- package/cli/node_modules/.ignored/consola/dist/basic.d.ts +0 -9
- package/cli/node_modules/.ignored/consola/dist/basic.mjs +0 -24
- package/cli/node_modules/.ignored/consola/dist/browser.cjs +0 -80
- package/cli/node_modules/.ignored/consola/dist/browser.d.ts +0 -7
- package/cli/node_modules/.ignored/consola/dist/browser.mjs +0 -72
- package/cli/node_modules/.ignored/consola/dist/chunks/prompt.cjs +0 -436
- package/cli/node_modules/.ignored/consola/dist/chunks/prompt.mjs +0 -429
- package/cli/node_modules/.ignored/consola/dist/core.cjs +0 -415
- package/cli/node_modules/.ignored/consola/dist/core.d.ts +0 -124
- package/cli/node_modules/.ignored/consola/dist/core.mjs +0 -410
- package/cli/node_modules/.ignored/consola/dist/index.cjs +0 -21
- package/cli/node_modules/.ignored/consola/dist/index.d.ts +0 -9
- package/cli/node_modules/.ignored/consola/dist/index.mjs +0 -8
- package/cli/node_modules/.ignored/consola/dist/shared/consola.06ad8a64.mjs +0 -62
- package/cli/node_modules/.ignored/consola/dist/shared/consola.36c0034f.mjs +0 -636
- package/cli/node_modules/.ignored/consola/dist/shared/consola.4bbae468.cjs +0 -645
- package/cli/node_modules/.ignored/consola/dist/shared/consola.deac7d5a.cjs +0 -65
- package/cli/node_modules/.ignored/consola/dist/utils.cjs +0 -308
- package/cli/node_modules/.ignored/consola/dist/utils.d.ts +0 -169
- package/cli/node_modules/.ignored/consola/dist/utils.mjs +0 -284
- package/cli/node_modules/.ignored/consola/lib/index.cjs +0 -9
- package/cli/node_modules/.ignored/consola/package.json +0 -101
- package/cli/node_modules/.ignored/consola/utils.d.ts +0 -1
- package/cli/node_modules/.ignored/pathe/LICENSE +0 -44
- package/cli/node_modules/.ignored/pathe/README.md +0 -69
- package/cli/node_modules/.ignored/pathe/dist/index.cjs +0 -23
- package/cli/node_modules/.ignored/pathe/dist/index.d.cts +0 -36
- package/cli/node_modules/.ignored/pathe/dist/index.d.mts +0 -36
- package/cli/node_modules/.ignored/pathe/dist/index.d.ts +0 -36
- package/cli/node_modules/.ignored/pathe/dist/index.mjs +0 -1
- package/cli/node_modules/.ignored/pathe/dist/shared/pathe.1f0a373c.cjs +0 -238
- package/cli/node_modules/.ignored/pathe/dist/shared/pathe.ff20891b.mjs +0 -221
- package/cli/node_modules/.ignored/pathe/dist/utils.cjs +0 -58
- package/cli/node_modules/.ignored/pathe/dist/utils.d.cts +0 -5
- package/cli/node_modules/.ignored/pathe/dist/utils.d.mts +0 -5
- package/cli/node_modules/.ignored/pathe/dist/utils.d.ts +0 -5
- package/cli/node_modules/.ignored/pathe/dist/utils.mjs +0 -54
- package/cli/node_modules/.ignored/pathe/package.json +0 -48
- package/cli/node_modules/.ignored/pathe/utils.d.ts +0 -1
- package/cli/node_modules/.ignored/scule/LICENSE +0 -21
- package/cli/node_modules/.ignored/scule/README.md +0 -149
- package/cli/node_modules/.ignored/scule/dist/index.cjs +0 -92
- package/cli/node_modules/.ignored/scule/dist/index.d.cts +0 -57
- package/cli/node_modules/.ignored/scule/dist/index.d.mts +0 -57
- package/cli/node_modules/.ignored/scule/dist/index.d.ts +0 -57
- package/cli/node_modules/.ignored/scule/dist/index.mjs +0 -80
- package/cli/node_modules/.ignored/scule/package.json +0 -43
- package/cli/node_modules/.package-lock.json +0 -33
|
@@ -52,8 +52,8 @@ const groups = computed(() => props.items?.length ? (Array.isArray(props.items[0
|
|
|
52
52
|
<DefineItemTemplate v-slot="{ item, active, index }">
|
|
53
53
|
<slot :name="item.slot || 'item'" :item="(item as T)" :index="index">
|
|
54
54
|
<slot :name="item.slot ? `${item.slot}-leading`: 'item-leading'" :item="(item as T)" :active="active" :index="index">
|
|
55
|
-
<UIcon v-if="item.loading" :name="loadingIcon || appConfig.ui.icons.loading" :class="ui.itemLeadingIcon({ class: uiOverride?.itemLeadingIcon, loading: true })" />
|
|
56
|
-
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: uiOverride?.itemLeadingIcon, active })" />
|
|
55
|
+
<UIcon v-if="item.loading" :name="loadingIcon || appConfig.ui.icons.loading" :class="ui.itemLeadingIcon({ class: uiOverride?.itemLeadingIcon, color: item?.color, loading: true })" />
|
|
56
|
+
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: uiOverride?.itemLeadingIcon, color: item?.color, active })" />
|
|
57
57
|
<UAvatar v-else-if="item.avatar" :size="((props.uiOverride?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()) as AvatarProps['size'])" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: uiOverride?.itemLeadingAvatar, active })" />
|
|
58
58
|
</slot>
|
|
59
59
|
|
|
@@ -62,19 +62,19 @@ const groups = computed(() => props.items?.length ? (Array.isArray(props.items[0
|
|
|
62
62
|
{{ get(item, props.labelKey as string) }}
|
|
63
63
|
</slot>
|
|
64
64
|
|
|
65
|
-
<UIcon v-if="item.target === '_blank'" :name="appConfig.ui.icons.external" :class="ui.itemLabelExternalIcon({ class: uiOverride?.itemLabelExternalIcon, active })" />
|
|
65
|
+
<UIcon v-if="item.target === '_blank'" :name="appConfig.ui.icons.external" :class="ui.itemLabelExternalIcon({ class: uiOverride?.itemLabelExternalIcon, color: item?.color, active })" />
|
|
66
66
|
</span>
|
|
67
67
|
|
|
68
68
|
<span :class="ui.itemTrailing({ class: uiOverride?.itemTrailing })">
|
|
69
69
|
<slot :name="item.slot ? `${item.slot}-trailing`: 'item-trailing'" :item="(item as T)" :active="active" :index="index">
|
|
70
|
-
<UIcon v-if="item.children?.length" :name="appConfig.ui.icons.chevronRight" :class="ui.itemTrailingIcon({ class: uiOverride?.itemTrailingIcon, active })" />
|
|
70
|
+
<UIcon v-if="item.children?.length" :name="appConfig.ui.icons.chevronRight" :class="ui.itemTrailingIcon({ class: uiOverride?.itemTrailingIcon, color: item?.color, active })" />
|
|
71
71
|
<span v-else-if="item.kbds?.length" :class="ui.itemTrailingKbds({ class: uiOverride?.itemTrailingKbds })">
|
|
72
72
|
<UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="((props.uiOverride?.itemTrailingKbdsSize || ui.itemTrailingKbdsSize()) as KbdProps['size'])" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
73
73
|
</span>
|
|
74
74
|
</slot>
|
|
75
75
|
|
|
76
76
|
<ContextMenu.ItemIndicator as-child>
|
|
77
|
-
<UIcon :name="checkedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: uiOverride?.itemTrailingIcon })" />
|
|
77
|
+
<UIcon :name="checkedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: uiOverride?.itemTrailingIcon, color: item?.color })" />
|
|
78
78
|
</ContextMenu.ItemIndicator>
|
|
79
79
|
</span>
|
|
80
80
|
</slot>
|
|
@@ -94,7 +94,7 @@ const groups = computed(() => props.items?.length ? (Array.isArray(props.items[0
|
|
|
94
94
|
type="button"
|
|
95
95
|
:disabled="item.disabled"
|
|
96
96
|
:text-value="get(item, props.labelKey as string)"
|
|
97
|
-
:class="ui.item({ class: uiOverride?.item })"
|
|
97
|
+
:class="ui.item({ class: uiOverride?.item, color: item?.color })"
|
|
98
98
|
>
|
|
99
99
|
<ReuseItemTemplate :item="item" :index="index" />
|
|
100
100
|
</ContextMenu.SubTrigger>
|
|
@@ -122,7 +122,7 @@ const groups = computed(() => props.items?.length ? (Array.isArray(props.items[0
|
|
|
122
122
|
:checked="item.checked"
|
|
123
123
|
:disabled="item.disabled"
|
|
124
124
|
:text-value="get(item, props.labelKey as string)"
|
|
125
|
-
:class="ui.item({ class: [uiOverride?.item, item.class] })"
|
|
125
|
+
:class="ui.item({ class: [uiOverride?.item, item.class], color: item?.color })"
|
|
126
126
|
@update:checked="item.onUpdateChecked"
|
|
127
127
|
@select="item.onSelect"
|
|
128
128
|
>
|
|
@@ -136,7 +136,7 @@ const groups = computed(() => props.items?.length ? (Array.isArray(props.items[0
|
|
|
136
136
|
@select="item.onSelect"
|
|
137
137
|
>
|
|
138
138
|
<ULink v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item as Omit<ContextMenuItem, 'type'>)" custom>
|
|
139
|
-
<ULinkBase v-bind="slotProps" :class="ui.item({ class: [uiOverride?.item, item.class], active })">
|
|
139
|
+
<ULinkBase v-bind="slotProps" :class="ui.item({ class: [uiOverride?.item, item.class], active, color: item?.color })">
|
|
140
140
|
<ReuseItemTemplate :item="item" :active="active" :index="index" />
|
|
141
141
|
</ULinkBase>
|
|
142
142
|
</ULink>
|
|
@@ -5,6 +5,7 @@ import type { DialogContentProps } from 'radix-vue'
|
|
|
5
5
|
import type { AppConfig } from '@nuxt/schema'
|
|
6
6
|
import _appConfig from '#build/app.config'
|
|
7
7
|
import theme from '#build/ui/drawer'
|
|
8
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
8
9
|
|
|
9
10
|
const appConfig = _appConfig as AppConfig & { ui: { drawer: Partial<typeof theme> } }
|
|
10
11
|
|
|
@@ -51,6 +52,8 @@ export interface DrawerSlots {
|
|
|
51
52
|
body(props?: {}): any
|
|
52
53
|
footer(props?: {}): any
|
|
53
54
|
}
|
|
55
|
+
|
|
56
|
+
extendDevtoolsMeta({ example: 'DrawerExample' })
|
|
54
57
|
</script>
|
|
55
58
|
|
|
56
59
|
<script setup lang="ts">
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
<!-- eslint-disable vue/block-tag-newline -->
|
|
2
1
|
<script lang="ts">
|
|
3
2
|
import { tv, type VariantProps } from 'tailwind-variants'
|
|
4
3
|
import type { DropdownMenuRootProps, DropdownMenuRootEmits, DropdownMenuContentProps, DropdownMenuArrowProps } from 'radix-vue'
|
|
5
4
|
import type { AppConfig } from '@nuxt/schema'
|
|
6
5
|
import _appConfig from '#build/app.config'
|
|
7
6
|
import theme from '#build/ui/dropdown-menu'
|
|
7
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
8
8
|
import type { AvatarProps, KbdProps, LinkProps } from '../types'
|
|
9
9
|
import type { DynamicSlots, PartialString } from '../types/utils'
|
|
10
10
|
|
|
@@ -12,9 +12,12 @@ const appConfig = _appConfig as AppConfig & { ui: { dropdownMenu: Partial<typeof
|
|
|
12
12
|
|
|
13
13
|
const dropdownMenu = tv({ extend: tv(theme), ...(appConfig.ui?.dropdownMenu || {}) })
|
|
14
14
|
|
|
15
|
+
type DropdownMenuVariants = VariantProps<typeof dropdownMenu>
|
|
16
|
+
|
|
15
17
|
export interface DropdownMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'custom'> {
|
|
16
18
|
label?: string
|
|
17
19
|
icon?: string
|
|
20
|
+
color?: DropdownMenuVariants['color']
|
|
18
21
|
avatar?: AvatarProps
|
|
19
22
|
content?: Omit<DropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'>
|
|
20
23
|
kbds?: KbdProps['value'][] | KbdProps[]
|
|
@@ -34,8 +37,6 @@ export interface DropdownMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'cust
|
|
|
34
37
|
onUpdateChecked?(checked: boolean): void
|
|
35
38
|
}
|
|
36
39
|
|
|
37
|
-
type DropdownMenuVariants = VariantProps<typeof dropdownMenu>
|
|
38
|
-
|
|
39
40
|
export interface DropdownMenuProps<T> extends Omit<DropdownMenuRootProps, 'dir'> {
|
|
40
41
|
size?: DropdownMenuVariants['size']
|
|
41
42
|
items?: T[] | T[][]
|
|
@@ -86,6 +87,54 @@ export type DropdownMenuSlots<T extends { slot?: string }> = {
|
|
|
86
87
|
'item-trailing': SlotProps<T>
|
|
87
88
|
} & DynamicSlots<T, SlotProps<T>>
|
|
88
89
|
|
|
90
|
+
extendDevtoolsMeta({
|
|
91
|
+
example: 'DropdownMenuExample',
|
|
92
|
+
ignoreProps: ['items'],
|
|
93
|
+
defaultProps: {
|
|
94
|
+
items: [
|
|
95
|
+
[{
|
|
96
|
+
label: 'My account',
|
|
97
|
+
avatar: {
|
|
98
|
+
src: 'https://avatars.githubusercontent.com/u/739984?v=4'
|
|
99
|
+
},
|
|
100
|
+
type: 'label'
|
|
101
|
+
}], [{
|
|
102
|
+
label: 'Profile',
|
|
103
|
+
icon: 'i-lucide-user',
|
|
104
|
+
slot: 'custom'
|
|
105
|
+
}, {
|
|
106
|
+
label: 'Billing',
|
|
107
|
+
icon: 'i-lucide-credit-card',
|
|
108
|
+
kbds: ['meta', 'b']
|
|
109
|
+
}, {
|
|
110
|
+
label: 'Settings',
|
|
111
|
+
icon: 'i-lucide-cog',
|
|
112
|
+
kbds: ['?']
|
|
113
|
+
}], [{
|
|
114
|
+
label: 'Invite users',
|
|
115
|
+
icon: 'i-lucide-user-plus',
|
|
116
|
+
children: [[{
|
|
117
|
+
label: 'Invite by email',
|
|
118
|
+
icon: 'i-lucide-send-horizontal'
|
|
119
|
+
}, {
|
|
120
|
+
label: 'Invite by link',
|
|
121
|
+
icon: 'i-lucide-link',
|
|
122
|
+
kbds: ['meta', 'i']
|
|
123
|
+
}]]
|
|
124
|
+
}],
|
|
125
|
+
[{
|
|
126
|
+
label: 'GitHub',
|
|
127
|
+
icon: 'i-simple-icons-github',
|
|
128
|
+
to: 'https://github.com/nuxt/ui',
|
|
129
|
+
target: '_blank'
|
|
130
|
+
}, {
|
|
131
|
+
label: 'Support',
|
|
132
|
+
icon: 'i-lucide-life-buoy',
|
|
133
|
+
to: '/components/dropdown-menu'
|
|
134
|
+
}]
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
})
|
|
89
138
|
</script>
|
|
90
139
|
|
|
91
140
|
<script setup lang="ts" generic="T extends DropdownMenuItem">
|
|
@@ -58,8 +58,8 @@ const groups = computed(() => props.items?.length ? (Array.isArray(props.items[0
|
|
|
58
58
|
<DefineItemTemplate v-slot="{ item, active, index }">
|
|
59
59
|
<slot :name="item.slot || 'item'" :item="(item as T)" :index="index">
|
|
60
60
|
<slot :name="item.slot ? `${item.slot}-leading`: 'item-leading'" :item="(item as T)" :active="active" :index="index">
|
|
61
|
-
<UIcon v-if="item.loading" :name="loadingIcon || appConfig.ui.icons.loading" :class="ui.itemLeadingIcon({ class: uiOverride?.itemLeadingIcon, loading: true })" />
|
|
62
|
-
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: uiOverride?.itemLeadingIcon, active })" />
|
|
61
|
+
<UIcon v-if="item.loading" :name="loadingIcon || appConfig.ui.icons.loading" :class="ui.itemLeadingIcon({ class: uiOverride?.itemLeadingIcon, color: item?.color, loading: true })" />
|
|
62
|
+
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: uiOverride?.itemLeadingIcon, color: item?.color, active })" />
|
|
63
63
|
<UAvatar v-else-if="item.avatar" :size="((props.uiOverride?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()) as AvatarProps['size'])" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: uiOverride?.itemLeadingAvatar, active })" />
|
|
64
64
|
</slot>
|
|
65
65
|
|
|
@@ -68,19 +68,19 @@ const groups = computed(() => props.items?.length ? (Array.isArray(props.items[0
|
|
|
68
68
|
{{ get(item, props.labelKey as string) }}
|
|
69
69
|
</slot>
|
|
70
70
|
|
|
71
|
-
<UIcon v-if="item.target === '_blank'" :name="appConfig.ui.icons.external" :class="ui.itemLabelExternalIcon({ class: uiOverride?.itemLabelExternalIcon, active })" />
|
|
71
|
+
<UIcon v-if="item.target === '_blank'" :name="appConfig.ui.icons.external" :class="ui.itemLabelExternalIcon({ class: uiOverride?.itemLabelExternalIcon, color: item?.color, active })" />
|
|
72
72
|
</span>
|
|
73
73
|
|
|
74
74
|
<span :class="ui.itemTrailing({ class: uiOverride?.itemTrailing })">
|
|
75
75
|
<slot :name="item.slot ? `${item.slot}-trailing`: 'item-trailing'" :item="(item as T)" :active="active" :index="index">
|
|
76
|
-
<UIcon v-if="item.children?.length" :name="appConfig.ui.icons.chevronRight" :class="ui.itemTrailingIcon({ class: uiOverride?.itemTrailingIcon, active })" />
|
|
76
|
+
<UIcon v-if="item.children?.length" :name="appConfig.ui.icons.chevronRight" :class="ui.itemTrailingIcon({ class: uiOverride?.itemTrailingIcon, color: item?.color, active })" />
|
|
77
77
|
<span v-else-if="item.kbds?.length" :class="ui.itemTrailingKbds({ class: uiOverride?.itemTrailingKbds })">
|
|
78
78
|
<UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="((props.uiOverride?.itemTrailingKbdsSize || ui.itemTrailingKbdsSize()) as KbdProps['size'])" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
79
79
|
</span>
|
|
80
80
|
</slot>
|
|
81
81
|
|
|
82
82
|
<DropdownMenu.ItemIndicator as-child>
|
|
83
|
-
<UIcon :name="checkedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: uiOverride?.itemTrailingIcon })" />
|
|
83
|
+
<UIcon :name="checkedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: uiOverride?.itemTrailingIcon, color: item?.color })" />
|
|
84
84
|
</DropdownMenu.ItemIndicator>
|
|
85
85
|
</span>
|
|
86
86
|
</slot>
|
|
@@ -100,7 +100,7 @@ const groups = computed(() => props.items?.length ? (Array.isArray(props.items[0
|
|
|
100
100
|
type="button"
|
|
101
101
|
:disabled="item.disabled"
|
|
102
102
|
:text-value="get(item, props.labelKey as string)"
|
|
103
|
-
:class="ui.item({ class: uiOverride?.item })"
|
|
103
|
+
:class="ui.item({ class: uiOverride?.item, color: item?.color })"
|
|
104
104
|
>
|
|
105
105
|
<ReuseItemTemplate :item="item" :index="index" />
|
|
106
106
|
</DropdownMenu.SubTrigger>
|
|
@@ -131,7 +131,7 @@ const groups = computed(() => props.items?.length ? (Array.isArray(props.items[0
|
|
|
131
131
|
:checked="item.checked"
|
|
132
132
|
:disabled="item.disabled"
|
|
133
133
|
:text-value="get(item, props.labelKey as string)"
|
|
134
|
-
:class="ui.item({ class: [uiOverride?.item, item.class] })"
|
|
134
|
+
:class="ui.item({ class: [uiOverride?.item, item.class], color: item?.color })"
|
|
135
135
|
@update:checked="item.onUpdateChecked"
|
|
136
136
|
@select="item.onSelect"
|
|
137
137
|
>
|
|
@@ -145,7 +145,7 @@ const groups = computed(() => props.items?.length ? (Array.isArray(props.items[0
|
|
|
145
145
|
@select="item.onSelect"
|
|
146
146
|
>
|
|
147
147
|
<ULink v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item as Omit<DropdownMenuItem, 'type'>)" custom>
|
|
148
|
-
<ULinkBase v-bind="slotProps" :class="ui.item({ class: [uiOverride?.item, item.class], active })">
|
|
148
|
+
<ULinkBase v-bind="slotProps" :class="ui.item({ class: [uiOverride?.item, item.class], color: item?.color, active })">
|
|
149
149
|
<ReuseItemTemplate :item="item" :active="active" :index="index" />
|
|
150
150
|
</ULinkBase>
|
|
151
151
|
</ULink>
|
|
@@ -3,6 +3,7 @@ import { tv } from 'tailwind-variants'
|
|
|
3
3
|
import type { AppConfig } from '@nuxt/schema'
|
|
4
4
|
import _appConfig from '#build/app.config'
|
|
5
5
|
import theme from '#build/ui/form'
|
|
6
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
6
7
|
import type { FormSchema, FormError, FormInputEvents, FormErrorEvent, FormSubmitEvent, FormEvent, Form, FormErrorWithId } from '../types/form'
|
|
7
8
|
|
|
8
9
|
const appConfig = _appConfig as AppConfig & { ui: { form: Partial<typeof theme> } }
|
|
@@ -29,6 +30,8 @@ export interface FormEmits<T extends object> {
|
|
|
29
30
|
export interface FormSlots {
|
|
30
31
|
default(props?: {}): any
|
|
31
32
|
}
|
|
33
|
+
|
|
34
|
+
extendDevtoolsMeta({ example: 'FormExample' })
|
|
32
35
|
</script>
|
|
33
36
|
|
|
34
37
|
<script lang="ts" setup generic="T extends object">
|
|
@@ -3,6 +3,7 @@ import { tv, type VariantProps } from 'tailwind-variants'
|
|
|
3
3
|
import type { AppConfig } from '@nuxt/schema'
|
|
4
4
|
import _appConfig from '#build/app.config'
|
|
5
5
|
import theme from '#build/ui/form-field'
|
|
6
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
6
7
|
|
|
7
8
|
const appConfig = _appConfig as AppConfig & { ui: { formField: Partial<typeof theme> } }
|
|
8
9
|
|
|
@@ -33,6 +34,8 @@ export interface FormFieldSlots {
|
|
|
33
34
|
error(props: { error?: string | boolean }): any
|
|
34
35
|
default(props: { error?: string | boolean }): any
|
|
35
36
|
}
|
|
37
|
+
|
|
38
|
+
extendDevtoolsMeta({ example: 'FormFieldExample', defaultProps: { label: 'Label' } })
|
|
36
39
|
</script>
|
|
37
40
|
|
|
38
41
|
<script setup lang="ts">
|
|
@@ -54,6 +54,7 @@ import { useComponentIcons } from '../composables/useComponentIcons'
|
|
|
54
54
|
import { useFormField } from '../composables/useFormField'
|
|
55
55
|
import { looseToNumber } from '../utils'
|
|
56
56
|
import UIcon from './Icon.vue'
|
|
57
|
+
import UAvatar from './Avatar.vue'
|
|
57
58
|
|
|
58
59
|
defineOptions({ inheritAttrs: false })
|
|
59
60
|
|
|
@@ -6,8 +6,9 @@ import type { AppConfig } from '@nuxt/schema'
|
|
|
6
6
|
import _appConfig from '#build/app.config'
|
|
7
7
|
import theme from '#build/ui/input-menu'
|
|
8
8
|
import type { UseComponentIconsProps } from '../composables/useComponentIcons'
|
|
9
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
9
10
|
import type { AvatarProps, ChipProps, InputProps } from '../types'
|
|
10
|
-
import type { AcceptableValue, ArrayOrWrapped, PartialString } from '../types/utils'
|
|
11
|
+
import type { AcceptableValue, ArrayOrWrapped, PartialString, MaybeArrayOfArray, MaybeArrayOfArrayItem, SelectModelValue, SelectModelValueEmits, SelectItemKey } from '../types/utils'
|
|
11
12
|
|
|
12
13
|
const appConfig = _appConfig as AppConfig & { ui: { inputMenu: Partial<typeof theme> } }
|
|
13
14
|
|
|
@@ -29,7 +30,7 @@ export interface InputMenuItem {
|
|
|
29
30
|
|
|
30
31
|
type InputMenuVariants = VariantProps<typeof inputMenu>
|
|
31
32
|
|
|
32
|
-
export interface InputMenuProps<T> extends Pick<ComboboxRootProps<T>, '
|
|
33
|
+
export interface InputMenuProps<T extends MaybeArrayOfArrayItem<I>, I extends MaybeArrayOfArray<InputMenuItem | AcceptableValue> = MaybeArrayOfArray<InputMenuItem | AcceptableValue>, V extends SelectItemKey<T> | undefined = undefined, M extends boolean = false> extends Pick<ComboboxRootProps<T>, 'defaultValue' | 'selectedValue' | 'open' | 'defaultOpen' | 'searchTerm' | 'disabled' | 'name' | 'resetSearchTermOnBlur'>, UseComponentIconsProps {
|
|
33
34
|
/**
|
|
34
35
|
* The element or component this component should render as.
|
|
35
36
|
* @defaultValue 'div'
|
|
@@ -86,24 +87,28 @@ export interface InputMenuProps<T> extends Pick<ComboboxRootProps<T>, 'modelValu
|
|
|
86
87
|
* When `items` is an array of objects, select the field to use as the value instead of the object itself.
|
|
87
88
|
* @defaultValue undefined
|
|
88
89
|
*/
|
|
89
|
-
valueKey?:
|
|
90
|
+
valueKey?: V
|
|
90
91
|
/**
|
|
91
92
|
* When `items` is an array of objects, select the field to use as the label.
|
|
92
93
|
* @defaultValue 'label'
|
|
93
94
|
*/
|
|
94
95
|
labelKey?: keyof T
|
|
95
|
-
items?:
|
|
96
|
+
items?: I
|
|
96
97
|
/** Highlight the ring color like a focus state. */
|
|
97
98
|
highlight?: boolean
|
|
98
99
|
class?: any
|
|
99
100
|
ui?: PartialString<typeof inputMenu.slots>
|
|
101
|
+
/** The controlled value of the Combobox. Can be binded-with with `v-model`. */
|
|
102
|
+
modelValue?: SelectModelValue<T, V, M>
|
|
103
|
+
/** Whether multiple options can be selected or not. */
|
|
104
|
+
multiple?: M
|
|
100
105
|
}
|
|
101
106
|
|
|
102
|
-
export type InputMenuEmits<T> = ComboboxRootEmits<T> & {
|
|
107
|
+
export type InputMenuEmits<T, V, M extends boolean> = Omit<ComboboxRootEmits<T>, 'update:modelValue'> & {
|
|
103
108
|
change: [payload: Event]
|
|
104
109
|
blur: [payload: FocusEvent]
|
|
105
110
|
focus: [payload: FocusEvent]
|
|
106
|
-
}
|
|
111
|
+
} & SelectModelValueEmits<T, V, M>
|
|
107
112
|
|
|
108
113
|
type SlotProps<T> = (props: { item: T, index: number }) => any
|
|
109
114
|
|
|
@@ -118,13 +123,15 @@ export interface InputMenuSlots<T> {
|
|
|
118
123
|
'tags-item-text': SlotProps<T>
|
|
119
124
|
'tags-item-delete': SlotProps<T>
|
|
120
125
|
}
|
|
126
|
+
|
|
127
|
+
extendDevtoolsMeta({ defaultProps: { items: ['Option 1', 'Option 2', 'Option 3'] } })
|
|
121
128
|
</script>
|
|
122
129
|
|
|
123
|
-
<script setup lang="ts" generic="T extends InputMenuItem | AcceptableValue">
|
|
130
|
+
<script setup lang="ts" generic="T extends MaybeArrayOfArrayItem<I>, I extends MaybeArrayOfArray<InputMenuItem | AcceptableValue> = MaybeArrayOfArray<InputMenuItem | AcceptableValue>, V extends SelectItemKey<T> | undefined = undefined, M extends boolean = false">
|
|
124
131
|
import { computed, ref, toRef, onMounted } from 'vue'
|
|
125
|
-
import { ComboboxRoot, ComboboxAnchor, ComboboxInput, ComboboxTrigger, ComboboxPortal, ComboboxContent, ComboboxViewport, ComboboxEmpty, ComboboxGroup, ComboboxLabel, ComboboxSeparator, ComboboxItem, ComboboxItemIndicator, TagsInputRoot, TagsInputItem, TagsInputItemText, TagsInputItemDelete, TagsInputInput, useForwardPropsEmits } from 'radix-vue'
|
|
132
|
+
import { ComboboxRoot, ComboboxArrow, ComboboxAnchor, ComboboxInput, ComboboxTrigger, ComboboxPortal, ComboboxContent, ComboboxViewport, ComboboxEmpty, ComboboxGroup, ComboboxLabel, ComboboxSeparator, ComboboxItem, ComboboxItemIndicator, TagsInputRoot, TagsInputItem, TagsInputItemText, TagsInputItemDelete, TagsInputInput, useForwardPropsEmits } from 'radix-vue'
|
|
126
133
|
import { defu } from 'defu'
|
|
127
|
-
import isEqual from 'fast-deep-equal'
|
|
134
|
+
import * as isEqual from 'fast-deep-equal'
|
|
128
135
|
import { reactivePick } from '@vueuse/core'
|
|
129
136
|
import { useAppConfig } from '#imports'
|
|
130
137
|
import { useButtonGroup } from '../composables/useButtonGroup'
|
|
@@ -137,14 +144,14 @@ import UChip from './Chip.vue'
|
|
|
137
144
|
|
|
138
145
|
defineOptions({ inheritAttrs: false })
|
|
139
146
|
|
|
140
|
-
const props = withDefaults(defineProps<InputMenuProps<T>>(), {
|
|
147
|
+
const props = withDefaults(defineProps<InputMenuProps<T, I, V, M>>(), {
|
|
141
148
|
type: 'text',
|
|
142
149
|
autofocusDelay: 0,
|
|
143
150
|
portal: true,
|
|
144
151
|
filter: () => ['label'],
|
|
145
152
|
labelKey: 'label' as keyof T
|
|
146
153
|
})
|
|
147
|
-
const emits = defineEmits<InputMenuEmits<T>>()
|
|
154
|
+
const emits = defineEmits<InputMenuEmits<T, V, M>>()
|
|
148
155
|
const slots = defineSlots<InputMenuSlots<T>>()
|
|
149
156
|
|
|
150
157
|
const searchTerm = defineModel<string>('searchTerm', { default: '' })
|
|
@@ -152,6 +159,8 @@ const searchTerm = defineModel<string>('searchTerm', { default: '' })
|
|
|
152
159
|
const appConfig = useAppConfig()
|
|
153
160
|
const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'modelValue', 'defaultValue', 'selectedValue', 'open', 'defaultOpen', 'multiple', 'resetSearchTermOnBlur'), emits)
|
|
154
161
|
const contentProps = toRef(() => defu(props.content, { side: 'bottom', sideOffset: 8, position: 'popper' }) as ComboboxContentProps)
|
|
162
|
+
const arrowProps = toRef(() => props.arrow as ComboboxArrowProps)
|
|
163
|
+
|
|
155
164
|
const { emitFormBlur, emitFormChange, emitFormInput, size: formGroupSize, color, id, name, highlight, disabled } = useFormField<InputProps>(props)
|
|
156
165
|
const { orientation, size: buttonGroupSize } = useButtonGroup<InputProps>(props)
|
|
157
166
|
const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(toRef(() => defu(props, { trailingIcon: appConfig.ui.icons.chevronDown })))
|
|
@@ -171,7 +180,7 @@ const ui = computed(() => inputMenu({
|
|
|
171
180
|
}))
|
|
172
181
|
|
|
173
182
|
function displayValue(value: AcceptableValue): string {
|
|
174
|
-
const item = items.value.find(item => props.valueKey ? isEqual(get(item as Record<string, any>, props.valueKey as string), value) : isEqual(item, value))
|
|
183
|
+
const item = items.value.find(item => props.valueKey ? isEqual.default(get(item as Record<string, any>, props.valueKey as string), value) : isEqual.default(item, value))
|
|
175
184
|
|
|
176
185
|
return item && (typeof item === 'object' ? get(item, props.labelKey as string) : item)
|
|
177
186
|
}
|
|
@@ -383,6 +392,8 @@ defineExpose({
|
|
|
383
392
|
</template>
|
|
384
393
|
</ComboboxGroup>
|
|
385
394
|
</ComboboxViewport>
|
|
395
|
+
|
|
396
|
+
<ComboboxArrow v-if="!!arrow" v-bind="arrowProps" :class="ui.arrow({ class: props.ui?.arrow })" />
|
|
386
397
|
</ComboboxContent>
|
|
387
398
|
</ComboboxPortal>
|
|
388
399
|
</ComboboxRoot>
|
|
@@ -4,6 +4,7 @@ import type { AppConfig } from '@nuxt/schema'
|
|
|
4
4
|
import _appConfig from '#build/app.config'
|
|
5
5
|
import theme from '#build/ui/kbd'
|
|
6
6
|
import type { KbdKey } from '../composables/useKbd'
|
|
7
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
7
8
|
|
|
8
9
|
const appConfig = _appConfig as AppConfig & { ui: { kbd: Partial<typeof theme> } }
|
|
9
10
|
|
|
@@ -26,6 +27,7 @@ export interface KbdProps {
|
|
|
26
27
|
export interface KbdSlots {
|
|
27
28
|
default(props?: {}): any
|
|
28
29
|
}
|
|
30
|
+
extendDevtoolsMeta({ defaultProps: { value: 'K' } })
|
|
29
31
|
</script>
|
|
30
32
|
|
|
31
33
|
<script setup lang="ts">
|
|
@@ -3,8 +3,55 @@ import type { ButtonHTMLAttributes } from 'vue'
|
|
|
3
3
|
import { tv } from 'tailwind-variants'
|
|
4
4
|
import type { AppConfig } from '@nuxt/schema'
|
|
5
5
|
import _appConfig from '#build/app.config'
|
|
6
|
+
import type { RouterLinkProps, RouteLocationRaw } from 'vue-router'
|
|
6
7
|
import theme from '#build/ui/link'
|
|
7
|
-
import
|
|
8
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
9
|
+
|
|
10
|
+
interface NuxtLinkProps extends Omit<RouterLinkProps, 'to'> {
|
|
11
|
+
/**
|
|
12
|
+
* Route Location the link should navigate to when clicked on.
|
|
13
|
+
*/
|
|
14
|
+
to?: RouteLocationRaw // need to manually type to avoid breaking typedPages
|
|
15
|
+
/**
|
|
16
|
+
* An alias for `to`. If used with `to`, `href` will be ignored
|
|
17
|
+
*/
|
|
18
|
+
href?: NuxtLinkProps['to']
|
|
19
|
+
/**
|
|
20
|
+
* Forces the link to be considered as external (true) or internal (false). This is helpful to handle edge-cases
|
|
21
|
+
*/
|
|
22
|
+
external?: boolean
|
|
23
|
+
/**
|
|
24
|
+
* Where to display the linked URL, as the name for a browsing context.
|
|
25
|
+
*/
|
|
26
|
+
target?: '_blank' | '_parent' | '_self' | '_top' | (string & {}) | null
|
|
27
|
+
/**
|
|
28
|
+
* A rel attribute value to apply on the link. Defaults to "noopener noreferrer" for external links.
|
|
29
|
+
*/
|
|
30
|
+
rel?: 'noopener' | 'noreferrer' | 'nofollow' | 'sponsored' | 'ugc' | (string & {}) | null
|
|
31
|
+
/**
|
|
32
|
+
* If set to true, no rel attribute will be added to the link
|
|
33
|
+
*/
|
|
34
|
+
noRel?: boolean
|
|
35
|
+
/**
|
|
36
|
+
* A class to apply to links that have been prefetched.
|
|
37
|
+
*/
|
|
38
|
+
prefetchedClass?: string
|
|
39
|
+
/**
|
|
40
|
+
* When enabled will prefetch middleware, layouts and payloads of links in the viewport.
|
|
41
|
+
*/
|
|
42
|
+
prefetch?: boolean
|
|
43
|
+
/**
|
|
44
|
+
* Allows controlling when to prefetch links. By default, prefetch is triggered only on visibility.
|
|
45
|
+
*/
|
|
46
|
+
prefetchOn?: 'visibility' | 'interaction' | Partial<{
|
|
47
|
+
visibility: boolean
|
|
48
|
+
interaction: boolean
|
|
49
|
+
}>
|
|
50
|
+
/**
|
|
51
|
+
* Escape hatch to disable `prefetch` attribute.
|
|
52
|
+
*/
|
|
53
|
+
noPrefetch?: boolean
|
|
54
|
+
}
|
|
8
55
|
|
|
9
56
|
const appConfig = _appConfig as AppConfig & { ui: { link: Partial<typeof theme> } }
|
|
10
57
|
|
|
@@ -41,6 +88,8 @@ export interface LinkProps extends NuxtLinkProps {
|
|
|
41
88
|
export interface LinkSlots {
|
|
42
89
|
default(props: { active: boolean }): any
|
|
43
90
|
}
|
|
91
|
+
|
|
92
|
+
extendDevtoolsMeta({ example: 'LinkExample' })
|
|
44
93
|
</script>
|
|
45
94
|
|
|
46
95
|
<script setup lang="ts">
|
|
@@ -4,6 +4,7 @@ import type { DialogRootProps, DialogRootEmits, DialogContentProps } from 'radix
|
|
|
4
4
|
import type { AppConfig } from '@nuxt/schema'
|
|
5
5
|
import _appConfig from '#build/app.config'
|
|
6
6
|
import theme from '#build/ui/modal'
|
|
7
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
7
8
|
import type { ButtonProps } from '../types'
|
|
8
9
|
|
|
9
10
|
const appConfig = _appConfig as AppConfig & { ui: { modal: Partial<typeof theme> } }
|
|
@@ -67,6 +68,8 @@ export interface ModalSlots {
|
|
|
67
68
|
body(props?: {}): any
|
|
68
69
|
footer(props?: {}): any
|
|
69
70
|
}
|
|
71
|
+
|
|
72
|
+
extendDevtoolsMeta({ example: 'ModalExample' })
|
|
70
73
|
</script>
|
|
71
74
|
|
|
72
75
|
<script setup lang="ts">
|