@nuxt/ui 3.0.0-alpha.7 → 3.0.0-alpha.9
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 +45 -0
- package/.nuxt/ui/input-menu.ts +411 -0
- package/.nuxt/ui/input-number.ts +204 -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/pin-input.ts +145 -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 +316 -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 +129 -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/README.md +52 -12
- package/cli/commands/{init.mjs → make/component.mjs} +4 -4
- package/cli/commands/make/index.mjs +14 -0
- package/cli/commands/make/locale.mjs +64 -0
- package/cli/index.mjs +2 -2
- package/cli/templates.mjs +47 -2
- package/cli/utils.mjs +14 -0
- package/dist/chunks/component-meta.cjs +77249 -0
- package/dist/chunks/component-meta.mjs +77247 -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/BDC8ywlR.js +1 -0
- package/dist/client/devtools/_nuxt/BT004Uxp.js +53 -0
- package/dist/client/devtools/_nuxt/C1H2Soz3.js +1 -0
- package/dist/client/devtools/_nuxt/builds/latest.json +1 -0
- package/dist/client/devtools/_nuxt/builds/meta/f98c13ea-d751-4b37-8ce3-94e99708745f.json +1 -0
- package/dist/client/devtools/_nuxt/entry.Bx6WJjrx.css +1 -0
- package/dist/client/devtools/_nuxt/error-404.Cq4qshcf.css +1 -0
- package/dist/client/devtools/_nuxt/error-500.ax1aM34m.css +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 +223 -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 +158 -2763
- package/dist/runtime/components/Accordion.vue +32 -1
- package/dist/runtime/components/Alert.vue +8 -1
- package/dist/runtime/components/App.vue +19 -5
- 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 +33 -4
- 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 +17 -8
- 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 +8 -4
- package/dist/runtime/components/Container.vue +3 -0
- package/dist/runtime/components/ContextMenu.vue +64 -3
- package/dist/runtime/components/ContextMenuContent.vue +10 -8
- package/dist/runtime/components/Drawer.vue +3 -0
- package/dist/runtime/components/DropdownMenu.vue +52 -3
- package/dist/runtime/components/DropdownMenuContent.vue +10 -8
- package/dist/runtime/components/Form.vue +21 -20
- package/dist/runtime/components/FormField.vue +10 -3
- package/dist/runtime/components/Input.vue +1 -0
- package/dist/runtime/components/InputMenu.vue +118 -31
- package/dist/runtime/components/InputNumber.vue +192 -0
- package/dist/runtime/components/Kbd.vue +2 -0
- package/dist/runtime/components/Link.vue +69 -6
- package/dist/runtime/components/Modal.vue +15 -3
- package/dist/runtime/components/NavigationMenu.vue +95 -46
- package/dist/runtime/components/Pagination.vue +17 -6
- package/dist/runtime/components/PinInput.vue +96 -0
- package/dist/runtime/components/Popover.vue +20 -1
- 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 +130 -42
- package/dist/runtime/components/Separator.vue +1 -1
- package/dist/runtime/components/Skeleton.vue +3 -0
- package/dist/runtime/components/Slideover.vue +15 -3
- package/dist/runtime/components/Slider.vue +1 -1
- package/dist/runtime/components/Switch.vue +5 -1
- package/dist/runtime/components/Table.vue +27 -8
- package/dist/runtime/components/Tabs.vue +20 -1
- package/dist/runtime/components/Textarea.vue +1 -1
- package/dist/runtime/components/Toast.vue +8 -1
- package/dist/runtime/components/Toaster.vue +29 -14
- package/dist/runtime/components/Tooltip.vue +3 -0
- package/dist/runtime/composables/defineLocale.d.ts +9 -0
- package/dist/runtime/composables/defineLocale.js +4 -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/useFormField.d.ts +4 -1
- package/dist/runtime/composables/useFormField.js +1 -1
- package/dist/runtime/composables/useKbd.d.ts +10 -3
- package/dist/runtime/composables/useKbd.js +14 -8
- package/dist/runtime/composables/useLocale.d.ts +4 -0
- package/dist/runtime/composables/useLocale.js +10 -0
- package/dist/runtime/index.css +1 -1
- package/dist/runtime/locale/ar.d.ts +2 -0
- package/dist/runtime/locale/ar.js +47 -0
- package/dist/runtime/locale/cs.d.ts +2 -0
- package/dist/runtime/locale/cs.js +46 -0
- package/dist/runtime/locale/de.d.ts +2 -0
- package/dist/runtime/locale/de.js +46 -0
- package/dist/runtime/locale/en.d.ts +2 -0
- package/dist/runtime/locale/en.js +46 -0
- package/dist/runtime/locale/es.d.ts +2 -0
- package/dist/runtime/locale/es.js +46 -0
- package/dist/runtime/locale/fa_ir.d.ts +2 -0
- package/dist/runtime/locale/fa_ir.js +47 -0
- package/dist/runtime/locale/fr.d.ts +2 -0
- package/dist/runtime/locale/fr.js +46 -0
- package/dist/runtime/locale/index.d.ts +12 -0
- package/dist/runtime/locale/index.js +12 -0
- package/dist/runtime/locale/it.d.ts +2 -0
- package/dist/runtime/locale/it.js +46 -0
- package/dist/runtime/locale/pl.d.ts +2 -0
- package/dist/runtime/locale/pl.js +46 -0
- package/dist/runtime/locale/ru.d.ts +2 -0
- package/dist/runtime/locale/ru.js +46 -0
- package/dist/runtime/locale/zh_hans.d.ts +2 -0
- package/dist/runtime/locale/zh_hans.js +46 -0
- package/dist/runtime/locale/zh_hant.d.ts +2 -0
- package/dist/runtime/locale/zh_hant.js +46 -0
- package/dist/runtime/types/form.d.ts +7 -2
- package/dist/runtime/types/index.d.ts +3 -0
- package/dist/runtime/types/index.js +3 -0
- package/dist/runtime/types/locale.d.ts +48 -0
- package/dist/runtime/types/locale.js +0 -0
- package/dist/runtime/types/utils.d.ts +7 -0
- package/dist/runtime/utils/form.d.ts +5 -9
- package/dist/runtime/utils/form.js +115 -50
- package/dist/runtime/utils/index.js +1 -1
- package/dist/runtime/utils/link.d.ts +2 -2
- package/dist/runtime/utils/locale.d.ts +15 -0
- package/dist/runtime/utils/locale.js +25 -0
- 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.BPnAe4QS.cjs +3030 -0
- package/dist/shared/ui.d52SSCwA.mjs +3023 -0
- package/dist/unplugin.cjs +192 -0
- package/dist/unplugin.d.cts +49 -0
- package/dist/unplugin.d.mts +49 -0
- package/dist/unplugin.d.ts +49 -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 +78 -33
- 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> } }
|
|
@@ -27,6 +28,7 @@ export interface AlertProps {
|
|
|
27
28
|
* Display a list of actions:
|
|
28
29
|
* - under the title and description if multiline
|
|
29
30
|
* - next to the close button if not multiline
|
|
31
|
+
* `{ size: 'xs' }`{lang="ts-type"}
|
|
30
32
|
*/
|
|
31
33
|
actions?: ButtonProps[]
|
|
32
34
|
/**
|
|
@@ -56,20 +58,25 @@ export interface AlertSlots {
|
|
|
56
58
|
actions(props?: {}): any
|
|
57
59
|
close(props: { ui: any }): any
|
|
58
60
|
}
|
|
61
|
+
|
|
62
|
+
extendDevtoolsMeta<AlertProps>({ defaultProps: { title: 'Heads up!' } })
|
|
59
63
|
</script>
|
|
60
64
|
|
|
61
65
|
<script setup lang="ts">
|
|
62
66
|
import { computed } from 'vue'
|
|
63
67
|
import { Primitive } from 'radix-vue'
|
|
64
68
|
import { useAppConfig } from '#imports'
|
|
69
|
+
import { useLocale } from '../composables/useLocale'
|
|
65
70
|
import UIcon from './Icon.vue'
|
|
66
71
|
import UAvatar from './Avatar.vue'
|
|
72
|
+
import UButton from './Button.vue'
|
|
67
73
|
|
|
68
74
|
const props = defineProps<AlertProps>()
|
|
69
75
|
const emits = defineEmits<AlertEmits>()
|
|
70
76
|
const slots = defineSlots<AlertSlots>()
|
|
71
77
|
|
|
72
78
|
const appConfig = useAppConfig()
|
|
79
|
+
const { t } = useLocale()
|
|
73
80
|
|
|
74
81
|
const multiline = computed(() => !!props.title && !!props.description)
|
|
75
82
|
|
|
@@ -119,7 +126,7 @@ const ui = computed(() => alert({
|
|
|
119
126
|
size="md"
|
|
120
127
|
color="neutral"
|
|
121
128
|
variant="link"
|
|
122
|
-
aria-label="
|
|
129
|
+
:aria-label="t('alert.close')"
|
|
123
130
|
v-bind="typeof close === 'object' ? close : undefined"
|
|
124
131
|
:class="ui.close({ class: props.ui?.close })"
|
|
125
132
|
@click="emits('update:open', false)"
|
|
@@ -1,19 +1,29 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { ConfigProviderProps, TooltipProviderProps } from 'radix-vue'
|
|
3
|
-
import
|
|
3
|
+
import { localeContextInjectionKey } from '../composables/useLocale'
|
|
4
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
5
|
+
import type { ToasterProps, Locale } from '../types'
|
|
6
|
+
import { en } from '../locale'
|
|
4
7
|
|
|
5
|
-
export interface AppProps extends Omit<ConfigProviderProps, 'useId'> {
|
|
8
|
+
export interface AppProps extends Omit<ConfigProviderProps, 'useId' | 'dir'> {
|
|
6
9
|
tooltip?: TooltipProviderProps
|
|
7
10
|
toaster?: ToasterProps | null
|
|
11
|
+
locale?: Locale
|
|
8
12
|
}
|
|
9
13
|
|
|
10
14
|
export interface AppSlots {
|
|
11
15
|
default(props?: {}): any
|
|
12
16
|
}
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
name: 'App'
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
extendDevtoolsMeta({ ignore: true })
|
|
13
23
|
</script>
|
|
14
24
|
|
|
15
25
|
<script setup lang="ts">
|
|
16
|
-
import { toRef, useId } from 'vue'
|
|
26
|
+
import { toRef, useId, provide, computed } from 'vue'
|
|
17
27
|
import { ConfigProvider, TooltipProvider, useForwardProps } from 'radix-vue'
|
|
18
28
|
import { reactivePick } from '@vueuse/core'
|
|
19
29
|
import UToaster from './Toaster.vue'
|
|
@@ -23,17 +33,21 @@ import USlideoverProvider from './SlideoverProvider.vue'
|
|
|
23
33
|
const props = defineProps<AppProps>()
|
|
24
34
|
defineSlots<AppSlots>()
|
|
25
35
|
|
|
26
|
-
const configProviderProps = useForwardProps(reactivePick(props, '
|
|
36
|
+
const configProviderProps = useForwardProps(reactivePick(props, 'scrollBody'))
|
|
27
37
|
const tooltipProps = toRef(() => props.tooltip)
|
|
28
38
|
const toasterProps = toRef(() => props.toaster)
|
|
39
|
+
|
|
40
|
+
const locale = computed(() => props.locale || en)
|
|
41
|
+
provide(localeContextInjectionKey, locale)
|
|
29
42
|
</script>
|
|
30
43
|
|
|
31
44
|
<template>
|
|
32
|
-
<ConfigProvider :use-id="() => (useId() as string)" v-bind="configProviderProps">
|
|
45
|
+
<ConfigProvider :use-id="() => (useId() as string)" :dir="locale.dir" v-bind="configProviderProps">
|
|
33
46
|
<TooltipProvider v-bind="tooltipProps">
|
|
34
47
|
<UToaster v-if="toaster !== null" v-bind="toasterProps">
|
|
35
48
|
<slot />
|
|
36
49
|
</UToaster>
|
|
50
|
+
<slot v-else />
|
|
37
51
|
</TooltipProvider>
|
|
38
52
|
|
|
39
53
|
<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
|
|
|
@@ -21,7 +21,7 @@ export interface BreadcrumbItem extends Omit<LinkProps, 'raw' | 'custom'> {
|
|
|
21
21
|
export interface BreadcrumbProps<T> {
|
|
22
22
|
/**
|
|
23
23
|
* The element or component this component should render as.
|
|
24
|
-
* @defaultValue '
|
|
24
|
+
* @defaultValue 'nav'
|
|
25
25
|
*/
|
|
26
26
|
as?: any
|
|
27
27
|
items?: T[]
|
|
@@ -49,11 +49,37 @@ 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">
|
|
79
|
+
import { computed } from 'vue'
|
|
55
80
|
import { Primitive } from 'radix-vue'
|
|
56
81
|
import { useAppConfig } from '#imports'
|
|
82
|
+
import { useLocale } from '../composables/useLocale'
|
|
57
83
|
import { get } from '../utils'
|
|
58
84
|
import { pickLinkProps } from '../utils/link'
|
|
59
85
|
import UIcon from './Icon.vue'
|
|
@@ -62,12 +88,15 @@ import ULinkBase from './LinkBase.vue'
|
|
|
62
88
|
import ULink from './Link.vue'
|
|
63
89
|
|
|
64
90
|
const props = withDefaults(defineProps<BreadcrumbProps<T>>(), {
|
|
91
|
+
as: 'nav',
|
|
65
92
|
labelKey: 'label'
|
|
66
93
|
})
|
|
67
94
|
const slots = defineSlots<BreadcrumbSlots<T>>()
|
|
68
|
-
|
|
95
|
+
const { dir } = useLocale()
|
|
69
96
|
const appConfig = useAppConfig()
|
|
70
97
|
|
|
98
|
+
const separatorIcon = computed(() => props.separatorIcon || (dir.value === 'rtl' ? appConfig.ui.icons.chevronLeft : appConfig.ui.icons.chevronRight))
|
|
99
|
+
|
|
71
100
|
// eslint-disable-next-line vue/no-dupe-keys
|
|
72
101
|
const ui = breadcrumb()
|
|
73
102
|
</script>
|
|
@@ -99,7 +128,7 @@ const ui = breadcrumb()
|
|
|
99
128
|
|
|
100
129
|
<li v-if="index < items!.length - 1" role="presentation" :class="ui.separator({ class: props.ui?.separator })">
|
|
101
130
|
<slot name="separator">
|
|
102
|
-
<UIcon :name="separatorIcon
|
|
131
|
+
<UIcon :name="separatorIcon" :class="ui.separatorIcon({ class: props.ui?.separatorIcon })" />
|
|
103
132
|
</slot>
|
|
104
133
|
</li>
|
|
105
134
|
</template>
|
|
@@ -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">
|
|
@@ -99,6 +100,7 @@ import useEmblaCarousel from 'embla-carousel-vue'
|
|
|
99
100
|
import { useForwardProps } from 'radix-vue'
|
|
100
101
|
import { reactivePick, computedAsync } from '@vueuse/core'
|
|
101
102
|
import { useAppConfig } from '#imports'
|
|
103
|
+
import { useLocale } from '../composables/useLocale'
|
|
102
104
|
import UButton from './Button.vue'
|
|
103
105
|
|
|
104
106
|
const props = withDefaults(defineProps<CarouselProps<T>>(), {
|
|
@@ -133,8 +135,12 @@ const props = withDefaults(defineProps<CarouselProps<T>>(), {
|
|
|
133
135
|
defineSlots<CarouselSlots<T>>()
|
|
134
136
|
|
|
135
137
|
const appConfig = useAppConfig()
|
|
138
|
+
const { dir, t } = useLocale()
|
|
136
139
|
const rootProps = useForwardProps(reactivePick(props, 'active', 'align', 'breakpoints', 'containScroll', 'dragFree', 'dragThreshold', 'duration', 'inViewThreshold', 'loop', 'skipSnaps', 'slidesToScroll', 'startIndex', 'watchDrag', 'watchResize', 'watchSlides', 'watchFocus'))
|
|
137
140
|
|
|
141
|
+
const prevIcon = computed(() => props.prevIcon || (dir.value === 'rtl' ? appConfig.ui.icons.arrowRight : appConfig.ui.icons.arrowLeft))
|
|
142
|
+
const nextIcon = computed(() => props.nextIcon || (dir.value === 'rtl' ? appConfig.ui.icons.arrowLeft : appConfig.ui.icons.arrowRight))
|
|
143
|
+
|
|
138
144
|
const ui = computed(() => carousel({
|
|
139
145
|
orientation: props.orientation
|
|
140
146
|
}))
|
|
@@ -143,8 +149,7 @@ const options = computed<EmblaOptionsType>(() => ({
|
|
|
143
149
|
...(props.fade ? { align: 'center', containScroll: false } : {}),
|
|
144
150
|
...rootProps.value,
|
|
145
151
|
axis: props.orientation === 'horizontal' ? 'x' : 'y',
|
|
146
|
-
|
|
147
|
-
direction: 'ltr'
|
|
152
|
+
direction: dir.value === 'rtl' ? 'rtl' : 'ltr'
|
|
148
153
|
}))
|
|
149
154
|
|
|
150
155
|
const plugins = computedAsync<EmblaPluginType[]>(async () => {
|
|
@@ -274,22 +279,22 @@ defineExpose({
|
|
|
274
279
|
<div v-if="arrows" :class="ui.arrows({ class: props.ui?.arrows })">
|
|
275
280
|
<UButton
|
|
276
281
|
:disabled="!canScrollPrev"
|
|
277
|
-
:icon="prevIcon
|
|
282
|
+
:icon="prevIcon"
|
|
278
283
|
size="md"
|
|
279
284
|
color="neutral"
|
|
280
285
|
variant="outline"
|
|
281
|
-
aria-label="
|
|
286
|
+
:aria-label="t('carousel.prev')"
|
|
282
287
|
v-bind="typeof prev === 'object' ? prev : undefined"
|
|
283
288
|
:class="ui.prev({ class: props.ui?.prev })"
|
|
284
289
|
@click="scrollPrev"
|
|
285
290
|
/>
|
|
286
291
|
<UButton
|
|
287
292
|
:disabled="!canScrollNext"
|
|
288
|
-
:icon="nextIcon
|
|
293
|
+
:icon="nextIcon"
|
|
289
294
|
size="md"
|
|
290
295
|
color="neutral"
|
|
291
296
|
variant="outline"
|
|
292
|
-
aria-label="
|
|
297
|
+
:aria-label="t('carousel.next')"
|
|
293
298
|
v-bind="typeof next === 'object' ? next : undefined"
|
|
294
299
|
:class="ui.next({ class: props.ui?.next })"
|
|
295
300
|
@click="scrollNext"
|
|
@@ -298,7 +303,11 @@ defineExpose({
|
|
|
298
303
|
|
|
299
304
|
<div v-if="dots" :class="ui.dots({ class: props.ui?.dots })">
|
|
300
305
|
<template v-for="(_, index) in scrollSnaps" :key="index">
|
|
301
|
-
<button
|
|
306
|
+
<button
|
|
307
|
+
:aria-label="t('carousel.goto', { slide: index + 1 })"
|
|
308
|
+
:class="ui.dot({ class: props.ui?.dot, active: selectedIndex === index })"
|
|
309
|
+
@click="scrollTo(index)"
|
|
310
|
+
/>
|
|
302
311
|
</template>
|
|
303
312
|
</div>
|
|
304
313
|
</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">
|