@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
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
<!-- eslint-disable vue/block-tag-newline -->
|
|
2
1
|
<script lang="ts">
|
|
3
2
|
import { tv } from 'tailwind-variants'
|
|
4
3
|
import type { AccordionRootProps, AccordionRootEmits } 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/accordion'
|
|
7
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
8
8
|
import type { DynamicSlots } from '../types/utils'
|
|
9
9
|
|
|
10
10
|
const appConfig = _appConfig as AppConfig & { ui: { accordion: Partial<typeof theme> } }
|
|
@@ -55,6 +55,36 @@ export type AccordionSlots<T extends { slot?: string }> = {
|
|
|
55
55
|
body: SlotProps<T>
|
|
56
56
|
} & DynamicSlots<T, SlotProps<T>>
|
|
57
57
|
|
|
58
|
+
extendDevtoolsMeta({
|
|
59
|
+
defaultProps: {
|
|
60
|
+
items: [{
|
|
61
|
+
label: 'Getting Started',
|
|
62
|
+
icon: 'i-lucide-info',
|
|
63
|
+
content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed neque elit, tristique placerat feugiat ac, facilisis vitae arcu. Proin eget egestas augue. Praesent ut sem nec arcu pellentesque aliquet. Duis dapibus diam vel metus tempus vulputate.'
|
|
64
|
+
}, {
|
|
65
|
+
label: 'Installation',
|
|
66
|
+
icon: 'i-lucide-download',
|
|
67
|
+
disabled: true,
|
|
68
|
+
content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed neque elit, tristique placerat feugiat ac, facilisis vitae arcu. Proin eget egestas augue. Praesent ut sem nec arcu pellentesque aliquet. Duis dapibus diam vel metus tempus vulputate.'
|
|
69
|
+
}, {
|
|
70
|
+
label: 'Theming',
|
|
71
|
+
icon: 'i-lucide-pipette',
|
|
72
|
+
content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed neque elit, tristique placerat feugiat ac, facilisis vitae arcu. Proin eget egestas augue. Praesent ut sem nec arcu pellentesque aliquet. Duis dapibus diam vel metus tempus vulputate.'
|
|
73
|
+
}, {
|
|
74
|
+
label: 'Layouts',
|
|
75
|
+
icon: 'i-lucide-layout-dashboard',
|
|
76
|
+
content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed neque elit, tristique placerat feugiat ac, facilisis vitae arcu. Proin eget egestas augue. Praesent ut sem nec arcu pellentesque aliquet. Duis dapibus diam vel metus tempus vulputate.'
|
|
77
|
+
}, {
|
|
78
|
+
label: 'Components',
|
|
79
|
+
icon: 'i-lucide-layers-3',
|
|
80
|
+
content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed neque elit, tristique placerat feugiat ac, facilisis vitae arcu. Proin eget egestas augue. Praesent ut sem nec arcu pellentesque aliquet. Duis dapibus diam vel metus tempus vulputate.'
|
|
81
|
+
}, {
|
|
82
|
+
label: 'Utilities',
|
|
83
|
+
icon: 'i-lucide-wrench',
|
|
84
|
+
content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed neque elit, tristique placerat feugiat ac, facilisis vitae arcu. Proin eget egestas augue. Praesent ut sem nec arcu pellentesque aliquet. Duis dapibus diam vel metus tempus vulputate.'
|
|
85
|
+
}]
|
|
86
|
+
}
|
|
87
|
+
})
|
|
58
88
|
</script>
|
|
59
89
|
|
|
60
90
|
<script setup lang="ts" generic="T extends AccordionItem">
|
|
@@ -63,6 +93,7 @@ import { AccordionRoot, AccordionItem, AccordionHeader, AccordionTrigger, Accord
|
|
|
63
93
|
import { reactivePick } from '@vueuse/core'
|
|
64
94
|
import { useAppConfig } from '#imports'
|
|
65
95
|
import { get } from '../utils'
|
|
96
|
+
import UIcon from './Icon.vue'
|
|
66
97
|
|
|
67
98
|
const props = withDefaults(defineProps<AccordionProps<T>>(), {
|
|
68
99
|
type: 'single',
|
|
@@ -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/alert'
|
|
6
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
6
7
|
import type { AvatarProps, ButtonProps } from '../types'
|
|
7
8
|
|
|
8
9
|
const appConfig = _appConfig as AppConfig & { ui: { alert: Partial<typeof theme> } }
|
|
@@ -56,6 +57,8 @@ export interface AlertSlots {
|
|
|
56
57
|
actions(props?: {}): any
|
|
57
58
|
close(props: { ui: any }): any
|
|
58
59
|
}
|
|
60
|
+
|
|
61
|
+
extendDevtoolsMeta<AlertProps>({ defaultProps: { title: 'Heads up!' } })
|
|
59
62
|
</script>
|
|
60
63
|
|
|
61
64
|
<script setup lang="ts">
|
|
@@ -64,6 +67,7 @@ import { Primitive } from 'radix-vue'
|
|
|
64
67
|
import { useAppConfig } from '#imports'
|
|
65
68
|
import UIcon from './Icon.vue'
|
|
66
69
|
import UAvatar from './Avatar.vue'
|
|
70
|
+
import UButton from './Button.vue'
|
|
67
71
|
|
|
68
72
|
const props = defineProps<AlertProps>()
|
|
69
73
|
const emits = defineEmits<AlertEmits>()
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { ConfigProviderProps, TooltipProviderProps } from 'radix-vue'
|
|
3
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
3
4
|
import type { ToasterProps } from '../types'
|
|
4
5
|
|
|
5
6
|
export interface AppProps extends Omit<ConfigProviderProps, 'useId'> {
|
|
@@ -10,6 +11,12 @@ export interface AppProps extends Omit<ConfigProviderProps, 'useId'> {
|
|
|
10
11
|
export interface AppSlots {
|
|
11
12
|
default(props?: {}): any
|
|
12
13
|
}
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
name: 'App'
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
extendDevtoolsMeta({ ignore: true })
|
|
13
20
|
</script>
|
|
14
21
|
|
|
15
22
|
<script setup lang="ts">
|
|
@@ -34,6 +41,7 @@ const toasterProps = toRef(() => props.toaster)
|
|
|
34
41
|
<UToaster v-if="toaster !== null" v-bind="toasterProps">
|
|
35
42
|
<slot />
|
|
36
43
|
</UToaster>
|
|
44
|
+
<slot v-else />
|
|
37
45
|
</TooltipProvider>
|
|
38
46
|
|
|
39
47
|
<UModalProvider />
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { tv, type VariantProps } from 'tailwind-variants'
|
|
3
3
|
import type { AvatarFallbackProps } from 'radix-vue'
|
|
4
4
|
import type { AppConfig } from '@nuxt/schema'
|
|
5
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
5
6
|
import _appConfig from '#build/app.config'
|
|
6
7
|
import theme from '#build/ui/avatar'
|
|
7
8
|
|
|
@@ -14,9 +15,9 @@ type AvatarVariants = VariantProps<typeof avatar>
|
|
|
14
15
|
export interface AvatarProps extends Pick<AvatarFallbackProps, 'delayMs'> {
|
|
15
16
|
/**
|
|
16
17
|
* The element or component this component should render as.
|
|
17
|
-
* @defaultValue '
|
|
18
|
+
* @defaultValue 'span'
|
|
18
19
|
*/
|
|
19
|
-
as?:
|
|
20
|
+
as?: any
|
|
20
21
|
src?: string
|
|
21
22
|
alt?: string
|
|
22
23
|
icon?: string
|
|
@@ -25,6 +26,8 @@ export interface AvatarProps extends Pick<AvatarFallbackProps, 'delayMs'> {
|
|
|
25
26
|
class?: any
|
|
26
27
|
ui?: Partial<typeof avatar.slots>
|
|
27
28
|
}
|
|
29
|
+
|
|
30
|
+
extendDevtoolsMeta<AvatarProps>({ defaultProps: { src: 'https://avatars.githubusercontent.com/u/739984?v=4', alt: 'Benjamin Canac' } })
|
|
28
31
|
</script>
|
|
29
32
|
|
|
30
33
|
<script setup lang="ts">
|
|
@@ -33,10 +36,11 @@ import { AvatarRoot, AvatarImage, AvatarFallback, useForwardProps } from 'radix-
|
|
|
33
36
|
import { reactivePick } from '@vueuse/core'
|
|
34
37
|
import { useAvatarGroup } from '../composables/useAvatarGroup'
|
|
35
38
|
import UIcon from './Icon.vue'
|
|
39
|
+
import ImageComponent from '#build/ui-image-component'
|
|
36
40
|
|
|
37
41
|
defineOptions({ inheritAttrs: false })
|
|
38
42
|
|
|
39
|
-
const props = defineProps<AvatarProps>()
|
|
43
|
+
const props = withDefaults(defineProps<AvatarProps>(), { as: 'span' })
|
|
40
44
|
|
|
41
45
|
const fallbackProps = useForwardProps(reactivePick(props, 'delayMs'))
|
|
42
46
|
|
|
@@ -48,15 +52,29 @@ const { size } = useAvatarGroup(props)
|
|
|
48
52
|
const ui = computed(() => avatar({
|
|
49
53
|
size: size.value
|
|
50
54
|
}))
|
|
55
|
+
|
|
56
|
+
const sizePx = computed(() => ({
|
|
57
|
+
'3xs': 16,
|
|
58
|
+
'2xs': 20,
|
|
59
|
+
'xs': 24,
|
|
60
|
+
'sm': 28,
|
|
61
|
+
'md': 32,
|
|
62
|
+
'lg': 36,
|
|
63
|
+
'xl': 40,
|
|
64
|
+
'2xl': 44,
|
|
65
|
+
'3xl': 48
|
|
66
|
+
})[props.size || 'md'])
|
|
51
67
|
</script>
|
|
52
68
|
|
|
53
69
|
<template>
|
|
54
|
-
<AvatarRoot :class="ui.root({ class: [props.class, props.ui?.root] })">
|
|
70
|
+
<AvatarRoot :as="as" :class="ui.root({ class: [props.class, props.ui?.root] })">
|
|
55
71
|
<AvatarImage
|
|
56
72
|
v-if="src"
|
|
57
|
-
:as="
|
|
73
|
+
:as="ImageComponent"
|
|
58
74
|
:src="src"
|
|
59
75
|
:alt="alt"
|
|
76
|
+
:width="sizePx"
|
|
77
|
+
:height="sizePx"
|
|
60
78
|
v-bind="$attrs"
|
|
61
79
|
:class="ui.image({ class: props.ui?.image })"
|
|
62
80
|
/>
|
|
@@ -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/avatar-group'
|
|
6
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
6
7
|
|
|
7
8
|
const appConfig = _appConfig as AppConfig & { ui: { avatarGroup: Partial<typeof theme> } }
|
|
8
9
|
|
|
@@ -28,6 +29,8 @@ export interface AvatarGroupProps {
|
|
|
28
29
|
export interface AvatarGroupSlots {
|
|
29
30
|
default(props?: {}): any
|
|
30
31
|
}
|
|
32
|
+
|
|
33
|
+
extendDevtoolsMeta({ example: 'AvatarGroupExample' })
|
|
31
34
|
</script>
|
|
32
35
|
|
|
33
36
|
<script setup lang="ts">
|
|
@@ -3,6 +3,9 @@ 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/badge'
|
|
6
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
7
|
+
import type { UseComponentIconsProps } from '../composables/useComponentIcons'
|
|
8
|
+
import type { AvatarProps } from '../types'
|
|
6
9
|
|
|
7
10
|
const appConfig = _appConfig as AppConfig & { ui: { badge: Partial<typeof theme> } }
|
|
8
11
|
|
|
@@ -10,7 +13,7 @@ const badge = tv({ extend: tv(theme), ...(appConfig.ui?.badge || {}) })
|
|
|
10
13
|
|
|
11
14
|
type BadgeVariants = VariantProps<typeof badge>
|
|
12
15
|
|
|
13
|
-
export interface BadgeProps {
|
|
16
|
+
export interface BadgeProps extends Omit<UseComponentIconsProps, 'loading' | 'loadingIcon'> {
|
|
14
17
|
/**
|
|
15
18
|
* The element or component this component should render as.
|
|
16
19
|
* @defaultValue 'span'
|
|
@@ -21,26 +24,53 @@ export interface BadgeProps {
|
|
|
21
24
|
variant?: BadgeVariants['variant']
|
|
22
25
|
size?: BadgeVariants['size']
|
|
23
26
|
class?: any
|
|
27
|
+
ui?: Partial<typeof badge.slots>
|
|
24
28
|
}
|
|
25
29
|
|
|
26
30
|
export interface BadgeSlots {
|
|
31
|
+
leading(props?: {}): any
|
|
27
32
|
default(props?: {}): any
|
|
33
|
+
trailing(props?: {}): any
|
|
28
34
|
}
|
|
29
35
|
</script>
|
|
30
36
|
|
|
31
37
|
<script setup lang="ts">
|
|
38
|
+
import { computed } from 'vue'
|
|
32
39
|
import { Primitive } from 'radix-vue'
|
|
40
|
+
import { useComponentIcons } from '../composables/useComponentIcons'
|
|
41
|
+
import UIcon from './Icon.vue'
|
|
33
42
|
|
|
34
43
|
const props = withDefaults(defineProps<BadgeProps>(), {
|
|
35
44
|
as: 'span'
|
|
36
45
|
})
|
|
37
46
|
defineSlots<BadgeSlots>()
|
|
47
|
+
|
|
48
|
+
const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(props)
|
|
49
|
+
|
|
50
|
+
const ui = computed(() => badge({
|
|
51
|
+
color: props.color,
|
|
52
|
+
variant: props.variant,
|
|
53
|
+
size: props.size
|
|
54
|
+
}))
|
|
55
|
+
|
|
56
|
+
extendDevtoolsMeta({ defaultProps: { label: 'Badge' } })
|
|
38
57
|
</script>
|
|
39
58
|
|
|
40
59
|
<template>
|
|
41
|
-
<Primitive :as="as" :class="
|
|
60
|
+
<Primitive :as="as" :class="ui.base({ class: [props.class, props.ui?.base] })">
|
|
61
|
+
<slot name="leading">
|
|
62
|
+
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
|
|
63
|
+
<UAvatar v-else-if="!!avatar" :size="((props.ui?.leadingAvatarSize || ui.leadingAvatarSize()) as AvatarProps['size'])" v-bind="avatar" :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })" />
|
|
64
|
+
</slot>
|
|
65
|
+
|
|
42
66
|
<slot>
|
|
43
|
-
{
|
|
67
|
+
<span v-if="label" :class="ui.label({ class: props.ui?.label })">
|
|
68
|
+
{{ label }}
|
|
69
|
+
</span>
|
|
70
|
+
</slot>
|
|
71
|
+
|
|
72
|
+
<slot name="trailing">
|
|
73
|
+
<UIcon v-if="isTrailing && trailingIconName" :name="trailingIconName" :class="ui.trailingIcon({ class: props.ui?.trailingIcon })" />
|
|
44
74
|
</slot>
|
|
45
75
|
</Primitive>
|
|
46
76
|
</template>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
<!-- eslint-disable vue/block-tag-newline -->
|
|
2
1
|
<script lang="ts">
|
|
3
2
|
import { tv } from 'tailwind-variants'
|
|
4
3
|
import type { AppConfig } from '@nuxt/schema'
|
|
5
4
|
import _appConfig from '#build/app.config'
|
|
6
5
|
import theme from '#build/ui/breadcrumb'
|
|
6
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
7
7
|
import type { AvatarProps, LinkProps } from '../types'
|
|
8
8
|
import type { DynamicSlots, PartialString } from '../types/utils'
|
|
9
9
|
|
|
@@ -49,6 +49,30 @@ export type BreadcrumbSlots<T extends { slot?: string }> = {
|
|
|
49
49
|
'separator'(props?: {}): any
|
|
50
50
|
} & DynamicSlots<T, SlotProps<T>>
|
|
51
51
|
|
|
52
|
+
extendDevtoolsMeta({
|
|
53
|
+
defaultProps: {
|
|
54
|
+
items: [
|
|
55
|
+
{ label: 'Home', to: '/' },
|
|
56
|
+
{
|
|
57
|
+
slot: 'dropdown',
|
|
58
|
+
icon: 'i-lucide-ellipsis',
|
|
59
|
+
children: [{
|
|
60
|
+
label: 'Documentation'
|
|
61
|
+
}, {
|
|
62
|
+
label: 'Themes'
|
|
63
|
+
}, {
|
|
64
|
+
label: 'GitHub'
|
|
65
|
+
}]
|
|
66
|
+
}, {
|
|
67
|
+
label: 'Components',
|
|
68
|
+
disabled: true
|
|
69
|
+
}, {
|
|
70
|
+
label: 'Breadcrumb',
|
|
71
|
+
to: '/components/breadcrumb'
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
})
|
|
52
76
|
</script>
|
|
53
77
|
|
|
54
78
|
<script setup lang="ts" generic="T extends BreadcrumbItem">
|
|
@@ -5,9 +5,9 @@ import _appConfig from '#build/app.config'
|
|
|
5
5
|
import theme from '#build/ui/button'
|
|
6
6
|
import type { LinkProps } from './Link.vue'
|
|
7
7
|
import type { UseComponentIconsProps } from '../composables/useComponentIcons'
|
|
8
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
8
9
|
import type { AvatarProps } from '../types'
|
|
9
10
|
import type { PartialString } from '../types/utils'
|
|
10
|
-
import { formLoadingInjectionKey } from '../composables/useFormField'
|
|
11
11
|
|
|
12
12
|
const appConfig = _appConfig as AppConfig & { ui: { button: Partial<typeof theme> } }
|
|
13
13
|
|
|
@@ -31,6 +31,9 @@ export interface ButtonProps extends UseComponentIconsProps, Omit<LinkProps, 'ra
|
|
|
31
31
|
ui?: PartialString<typeof button.slots>
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
// Injects props to use as default in the devtools playground.
|
|
35
|
+
extendDevtoolsMeta<ButtonProps>({ defaultProps: { label: 'Click me!' } })
|
|
36
|
+
|
|
34
37
|
export interface ButtonSlots {
|
|
35
38
|
leading(props?: {}): any
|
|
36
39
|
default(props?: {}): any
|
|
@@ -43,9 +46,11 @@ import { type Ref, computed, ref, inject } from 'vue'
|
|
|
43
46
|
import { useForwardProps } from 'radix-vue'
|
|
44
47
|
import { useComponentIcons } from '../composables/useComponentIcons'
|
|
45
48
|
import { useButtonGroup } from '../composables/useButtonGroup'
|
|
49
|
+
import { formLoadingInjectionKey } from '../composables/useFormField'
|
|
46
50
|
import { omit } from '../utils'
|
|
47
51
|
import { pickLinkProps } from '../utils/link'
|
|
48
52
|
import UIcon from './Icon.vue'
|
|
53
|
+
import UAvatar from './Avatar.vue'
|
|
49
54
|
import ULink from './Link.vue'
|
|
50
55
|
|
|
51
56
|
const props = defineProps<ButtonProps>()
|
|
@@ -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/button-group'
|
|
6
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
6
7
|
|
|
7
8
|
const appConfig = _appConfig as AppConfig & { ui: { buttonGroup: Partial<typeof theme> } }
|
|
8
9
|
|
|
@@ -28,6 +29,8 @@ export interface ButtonGroupProps {
|
|
|
28
29
|
export interface ButtonGroupSlots {
|
|
29
30
|
default(props?: {}): any
|
|
30
31
|
}
|
|
32
|
+
|
|
33
|
+
extendDevtoolsMeta({ example: 'ButtonGroupExample' })
|
|
31
34
|
</script>
|
|
32
35
|
|
|
33
36
|
<script setup lang="ts">
|
|
@@ -47,7 +50,7 @@ provide(buttonGroupInjectionKey, computed(() => ({
|
|
|
47
50
|
</script>
|
|
48
51
|
|
|
49
52
|
<template>
|
|
50
|
-
<Primitive :as="as" :class="buttonGroup({ orientation })">
|
|
53
|
+
<Primitive :as="as" :class="buttonGroup({ orientation, class: props.class })">
|
|
51
54
|
<slot />
|
|
52
55
|
</Primitive>
|
|
53
56
|
</template>
|
|
@@ -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/card'
|
|
6
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
6
7
|
|
|
7
8
|
const appConfig = _appConfig as AppConfig & { ui: { card: Partial<typeof theme> } }
|
|
8
9
|
|
|
@@ -23,6 +24,8 @@ export interface CardSlots {
|
|
|
23
24
|
default(props?: {}): any
|
|
24
25
|
footer(props?: {}): any
|
|
25
26
|
}
|
|
27
|
+
|
|
28
|
+
extendDevtoolsMeta({ example: 'CardExample' })
|
|
26
29
|
</script>
|
|
27
30
|
|
|
28
31
|
<script setup lang="ts">
|
|
@@ -1,4 +1,3 @@
|
|
|
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 { AppConfig } from '@nuxt/schema'
|
|
@@ -11,6 +10,7 @@ import type { FadeOptionsType } from 'embla-carousel-fade'
|
|
|
11
10
|
import type { WheelGesturesPluginOptions } from 'embla-carousel-wheel-gestures'
|
|
12
11
|
import _appConfig from '#build/app.config'
|
|
13
12
|
import theme from '#build/ui/carousel'
|
|
13
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
14
14
|
import type { ButtonProps } from '../types'
|
|
15
15
|
import type { AcceptableValue, PartialString } from '../types/utils'
|
|
16
16
|
|
|
@@ -91,6 +91,7 @@ export type CarouselSlots<T> = {
|
|
|
91
91
|
default(props: { item: T, index: number }): any
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
extendDevtoolsMeta({ example: 'CarouselExample' })
|
|
94
95
|
</script>
|
|
95
96
|
|
|
96
97
|
<script setup lang="ts" generic="T extends AcceptableValue">
|
|
@@ -298,7 +299,11 @@ defineExpose({
|
|
|
298
299
|
|
|
299
300
|
<div v-if="dots" :class="ui.dots({ class: props.ui?.dots })">
|
|
300
301
|
<template v-for="(_, index) in scrollSnaps" :key="index">
|
|
301
|
-
<button
|
|
302
|
+
<button
|
|
303
|
+
:aria-label="`Go to slide ${index + 1}`"
|
|
304
|
+
:class="ui.dot({ class: props.ui?.dot, active: selectedIndex === index })"
|
|
305
|
+
@click="scrollTo(index)"
|
|
306
|
+
/>
|
|
302
307
|
</template>
|
|
303
308
|
</div>
|
|
304
309
|
</div>
|
|
@@ -4,6 +4,7 @@ import type { CheckboxRootProps } from 'radix-vue'
|
|
|
4
4
|
import type { AppConfig } from '@nuxt/schema'
|
|
5
5
|
import _appConfig from '#build/app.config'
|
|
6
6
|
import theme from '#build/ui/checkbox'
|
|
7
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
7
8
|
|
|
8
9
|
const appConfig = _appConfig as AppConfig & { ui: { checkbox: Partial<typeof theme> } }
|
|
9
10
|
|
|
@@ -42,6 +43,8 @@ export interface CheckboxSlots {
|
|
|
42
43
|
label(props: { label?: string }): any
|
|
43
44
|
description(props: { description?: string }): any
|
|
44
45
|
}
|
|
46
|
+
|
|
47
|
+
extendDevtoolsMeta({ defaultProps: { label: 'Check me!' } })
|
|
45
48
|
</script>
|
|
46
49
|
|
|
47
50
|
<script setup lang="ts">
|
|
@@ -50,6 +53,7 @@ import { CheckboxRoot, CheckboxIndicator, Label, useForwardProps } from 'radix-v
|
|
|
50
53
|
import { reactivePick } from '@vueuse/core'
|
|
51
54
|
import { useAppConfig } from '#imports'
|
|
52
55
|
import { useFormField } from '../composables/useFormField'
|
|
56
|
+
import UIcon from './Icon.vue'
|
|
53
57
|
|
|
54
58
|
const props = defineProps<CheckboxProps>()
|
|
55
59
|
const slots = defineSlots<CheckboxSlots>()
|
|
@@ -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/chip'
|
|
6
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
6
7
|
|
|
7
8
|
const appConfig = _appConfig as AppConfig & { ui: { chip: Partial<typeof theme> } }
|
|
8
9
|
|
|
@@ -37,13 +38,17 @@ export interface ChipSlots {
|
|
|
37
38
|
default(props?: {}): any
|
|
38
39
|
content(props?: {}): any
|
|
39
40
|
}
|
|
41
|
+
|
|
42
|
+
extendDevtoolsMeta({ example: 'ChipExample' })
|
|
40
43
|
</script>
|
|
41
44
|
|
|
42
45
|
<script setup lang="ts">
|
|
43
46
|
import { computed } from 'vue'
|
|
44
|
-
import { Primitive } from 'radix-vue'
|
|
47
|
+
import { Primitive, Slot } from 'radix-vue'
|
|
45
48
|
import { useAvatarGroup } from '../composables/useAvatarGroup'
|
|
46
49
|
|
|
50
|
+
defineOptions({ inheritAttrs: false })
|
|
51
|
+
|
|
47
52
|
const props = withDefaults(defineProps<ChipProps>(), {
|
|
48
53
|
inset: false,
|
|
49
54
|
standalone: false
|
|
@@ -65,7 +70,9 @@ const ui = computed(() => chip({
|
|
|
65
70
|
|
|
66
71
|
<template>
|
|
67
72
|
<Primitive :as="as" :class="ui.root({ class: [props.class, props.ui?.root] })">
|
|
68
|
-
<
|
|
73
|
+
<Slot v-bind="$attrs">
|
|
74
|
+
<slot />
|
|
75
|
+
</Slot>
|
|
69
76
|
|
|
70
77
|
<span v-if="show" :class="ui.base({ class: props.ui?.base })">
|
|
71
78
|
<slot name="content">
|
|
@@ -4,6 +4,7 @@ import type { CollapsibleRootProps, CollapsibleRootEmits } from 'radix-vue'
|
|
|
4
4
|
import type { AppConfig } from '@nuxt/schema'
|
|
5
5
|
import _appConfig from '#build/app.config'
|
|
6
6
|
import theme from '#build/ui/collapsible'
|
|
7
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
7
8
|
|
|
8
9
|
const appConfig = _appConfig as AppConfig & { ui: { collapsible: Partial<typeof theme> } }
|
|
9
10
|
|
|
@@ -25,6 +26,8 @@ export interface CollapsibleSlots {
|
|
|
25
26
|
default(props: { open: boolean }): any
|
|
26
27
|
content(props?: {}): any
|
|
27
28
|
}
|
|
29
|
+
|
|
30
|
+
extendDevtoolsMeta({ example: 'CollapsibleExample' })
|
|
28
31
|
</script>
|
|
29
32
|
|
|
30
33
|
<script setup lang="ts">
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
<!-- eslint-disable vue/block-tag-newline -->
|
|
2
1
|
<script lang="ts">
|
|
3
2
|
import { tv } from 'tailwind-variants'
|
|
4
3
|
import type { ComboboxRootProps, ComboboxRootEmits } from 'radix-vue'
|
|
@@ -8,6 +7,7 @@ import type { UseFuseOptions } from '@vueuse/integrations/useFuse'
|
|
|
8
7
|
import _appConfig from '#build/app.config'
|
|
9
8
|
import theme from '#build/ui/command-palette'
|
|
10
9
|
import type { UseComponentIconsProps } from '../composables/useComponentIcons'
|
|
10
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
11
11
|
import type { AvatarProps, ButtonProps, ChipProps, KbdProps, InputProps } from '../types'
|
|
12
12
|
import type { DynamicSlots, PartialString } from '../types/utils'
|
|
13
13
|
|
|
@@ -114,6 +114,7 @@ export type CommandPaletteSlots<G extends { slot?: string }, T extends { slot?:
|
|
|
114
114
|
'item-trailing': SlotProps<T>
|
|
115
115
|
} & DynamicSlots<G, SlotProps<T>> & DynamicSlots<T, SlotProps<T>>
|
|
116
116
|
|
|
117
|
+
extendDevtoolsMeta({ example: 'CommandPaletteExample', ignoreProps: ['groups'] })
|
|
117
118
|
</script>
|
|
118
119
|
|
|
119
120
|
<script setup lang="ts" generic="G extends CommandPaletteGroup<T>, T extends CommandPaletteItem">
|
|
@@ -127,6 +128,7 @@ import { omit, get } from '../utils'
|
|
|
127
128
|
import { highlight } from '../utils/fuse'
|
|
128
129
|
import UIcon from './Icon.vue'
|
|
129
130
|
import UAvatar from './Avatar.vue'
|
|
131
|
+
import UButton from './Button.vue'
|
|
130
132
|
import UChip from './Chip.vue'
|
|
131
133
|
import UKbd from './Kbd.vue'
|
|
132
134
|
import UInput from './Input.vue'
|
|
@@ -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/container'
|
|
6
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
6
7
|
|
|
7
8
|
const appConfig = _appConfig as AppConfig & { ui: { container: Partial<typeof theme> } }
|
|
8
9
|
|
|
@@ -20,6 +21,8 @@ export interface ContainerProps {
|
|
|
20
21
|
export interface ContainerSlots {
|
|
21
22
|
default(props?: {}): any
|
|
22
23
|
}
|
|
24
|
+
|
|
25
|
+
extendDevtoolsMeta({ example: 'ContainerExample' })
|
|
23
26
|
</script>
|
|
24
27
|
|
|
25
28
|
<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 { ContextMenuRootProps, ContextMenuRootEmits, ContextMenuContentProps } 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/context-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: { contextMenu: Partial<typeof
|
|
|
12
12
|
|
|
13
13
|
const contextMenu = tv({ extend: tv(theme), ...(appConfig.ui?.contextMenu || {}) })
|
|
14
14
|
|
|
15
|
+
type ContextMenuVariants = VariantProps<typeof contextMenu>
|
|
16
|
+
|
|
15
17
|
export interface ContextMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'custom'> {
|
|
16
18
|
label?: string
|
|
17
19
|
icon?: string
|
|
20
|
+
color?: ContextMenuVariants['color']
|
|
18
21
|
avatar?: AvatarProps
|
|
19
22
|
content?: Omit<ContextMenuContentProps, 'as' | 'asChild' | 'forceMount'>
|
|
20
23
|
kbds?: KbdProps['value'][] | KbdProps[]
|
|
@@ -34,8 +37,6 @@ export interface ContextMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'custo
|
|
|
34
37
|
onUpdateChecked?(checked: boolean): void
|
|
35
38
|
}
|
|
36
39
|
|
|
37
|
-
type ContextMenuVariants = VariantProps<typeof contextMenu>
|
|
38
|
-
|
|
39
40
|
export interface ContextMenuProps<T> extends Omit<ContextMenuRootProps, 'dir'> {
|
|
40
41
|
size?: ContextMenuVariants['size']
|
|
41
42
|
items?: T[] | T[][]
|
|
@@ -78,6 +79,66 @@ export type ContextMenuSlots<T extends { slot?: string }> = {
|
|
|
78
79
|
'item-trailing': SlotProps<T>
|
|
79
80
|
} & DynamicSlots<T, SlotProps<T>>
|
|
80
81
|
|
|
82
|
+
extendDevtoolsMeta({
|
|
83
|
+
example: 'ContextMenuExample',
|
|
84
|
+
ignoreProps: ['items'],
|
|
85
|
+
defaultProps: {
|
|
86
|
+
items: [
|
|
87
|
+
[{
|
|
88
|
+
label: 'My account',
|
|
89
|
+
avatar: {
|
|
90
|
+
src: 'https://avatars.githubusercontent.com/u/739984?v=4'
|
|
91
|
+
}
|
|
92
|
+
}],
|
|
93
|
+
[{
|
|
94
|
+
label: 'Appearance',
|
|
95
|
+
children: [{
|
|
96
|
+
label: 'System',
|
|
97
|
+
icon: 'i-lucide-monitor'
|
|
98
|
+
}, {
|
|
99
|
+
label: 'Light',
|
|
100
|
+
icon: 'i-lucide-sun'
|
|
101
|
+
}, {
|
|
102
|
+
label: 'Dark',
|
|
103
|
+
icon: 'i-lucide-moon'
|
|
104
|
+
}]
|
|
105
|
+
}],
|
|
106
|
+
[{
|
|
107
|
+
label: 'Show Sidebar',
|
|
108
|
+
kbds: ['meta', 'S']
|
|
109
|
+
}, {
|
|
110
|
+
label: 'Show Toolbar',
|
|
111
|
+
kbds: ['shift', 'meta', 'D']
|
|
112
|
+
}, {
|
|
113
|
+
label: 'Collapse Pinned Tabs',
|
|
114
|
+
disabled: true
|
|
115
|
+
}], [{
|
|
116
|
+
label: 'Refresh the Page'
|
|
117
|
+
}, {
|
|
118
|
+
label: 'Clear Cookies and Refresh'
|
|
119
|
+
}, {
|
|
120
|
+
label: 'Clear Cache and Refresh'
|
|
121
|
+
}, {
|
|
122
|
+
type: 'separator'
|
|
123
|
+
}, {
|
|
124
|
+
label: 'Developer',
|
|
125
|
+
children: [[{
|
|
126
|
+
label: 'View Source',
|
|
127
|
+
kbds: ['option', 'meta', 'U']
|
|
128
|
+
}, {
|
|
129
|
+
label: 'Developer Tools',
|
|
130
|
+
kbds: ['option', 'meta', 'I']
|
|
131
|
+
}], [{
|
|
132
|
+
label: 'Inspect Elements',
|
|
133
|
+
kbds: ['option', 'meta', 'C']
|
|
134
|
+
}], [{
|
|
135
|
+
label: 'JavaScript Console',
|
|
136
|
+
kbds: ['option', 'meta', 'J']
|
|
137
|
+
}]]
|
|
138
|
+
}]
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
})
|
|
81
142
|
</script>
|
|
82
143
|
|
|
83
144
|
<script setup lang="ts" generic="T extends ContextMenuItem">
|