@nuxt/ui 3.0.0-alpha.1 → 3.0.0-alpha.11
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 +259 -0
- package/.nuxt/ui/avatar-group.ts +52 -0
- package/.nuxt/ui/avatar.ts +54 -0
- package/.nuxt/ui/badge.ts +231 -0
- package/.nuxt/ui/breadcrumb.ts +45 -0
- package/.nuxt/ui/button-group.ts +29 -0
- package/.nuxt/ui/button.ts +376 -0
- package/.nuxt/ui/calendar.ts +103 -0
- package/.nuxt/ui/card.ts +8 -0
- package/.nuxt/ui/carousel.ts +43 -0
- package/.nuxt/ui/checkbox.ts +123 -0
- package/.nuxt/ui/chip.ts +96 -0
- package/.nuxt/ui/collapsible.ts +6 -0
- package/.nuxt/ui/color-picker.ts +47 -0
- package/.nuxt/ui/command-palette.ts +50 -0
- package/.nuxt/ui/container.ts +3 -0
- package/.nuxt/ui/context-menu.ts +216 -0
- package/.nuxt/ui/drawer.ts +62 -0
- package/.nuxt/ui/dropdown-menu.ts +217 -0
- package/.nuxt/ui/form-field.ts +48 -0
- package/.nuxt/ui/form.ts +3 -0
- package/.nuxt/ui/index.ts +48 -0
- package/.nuxt/ui/input-menu.ts +445 -0
- package/.nuxt/ui/input-number.ts +235 -0
- package/.nuxt/ui/input.ts +298 -0
- package/.nuxt/ui/kbd.ts +31 -0
- package/.nuxt/ui/link.ts +15 -0
- package/.nuxt/ui/modal.ts +28 -0
- package/.nuxt/ui/navigation-menu.ts +436 -0
- package/.nuxt/ui/pagination.ts +8 -0
- package/.nuxt/ui/pin-input.ts +171 -0
- package/.nuxt/ui/popover.ts +6 -0
- package/.nuxt/ui/progress.ts +297 -0
- package/.nuxt/ui/radio-group.ts +135 -0
- package/.nuxt/ui/select-menu.ts +351 -0
- package/.nuxt/ui/select.ts +350 -0
- package/.nuxt/ui/separator.ts +172 -0
- package/.nuxt/ui/skeleton.ts +3 -0
- package/.nuxt/ui/slideover.ts +70 -0
- package/.nuxt/ui/slider.ts +171 -0
- package/.nuxt/ui/stepper.ts +202 -0
- package/.nuxt/ui/switch.ts +131 -0
- package/.nuxt/ui/table.ts +146 -0
- package/.nuxt/ui/tabs.ts +255 -0
- package/.nuxt/ui/textarea.ts +298 -0
- package/.nuxt/ui/toast.ts +76 -0
- package/.nuxt/ui/toaster.ts +91 -0
- package/.nuxt/ui/tooltip.ts +9 -0
- package/README.md +82 -54
- package/cli/commands/{init.mjs → make/component.mjs} +17 -5
- package/cli/commands/make/index.mjs +14 -0
- package/cli/commands/make/locale.mjs +64 -0
- package/cli/index.mjs +2 -2
- package/cli/package.json +2 -2
- package/cli/templates.mjs +60 -10
- package/cli/utils.mjs +14 -0
- package/dist/chunks/component-meta.cjs +82802 -0
- package/dist/chunks/component-meta.mjs +82800 -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/CQ-XZFu7.js +54 -0
- package/dist/client/devtools/_nuxt/DNZFyo26.js +1 -0
- package/dist/client/devtools/_nuxt/Dtz-o9GB.js +1 -0
- package/dist/client/devtools/_nuxt/builds/latest.json +1 -0
- package/dist/client/devtools/_nuxt/builds/meta/1f5fbd7b-9d97-480e-9ae4-e02b4ff7018b.json +1 -0
- package/dist/client/devtools/_nuxt/entry.qOdop8tq.css +1 -0
- package/dist/client/devtools/_nuxt/error-404.D-rS9BDk.css +1 -0
- package/dist/client/devtools/_nuxt/error-500.CfcCHs91.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 +54 -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/StepperExample.vue +44 -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 +38 -7
- package/dist/module.d.ts +38 -7
- package/dist/module.json +2 -1
- package/dist/module.mjs +179 -2568
- package/dist/runtime/components/Accordion.vue +51 -9
- package/dist/runtime/components/Alert.vue +16 -8
- package/dist/runtime/components/App.vue +20 -7
- package/dist/runtime/components/Avatar.vue +36 -11
- package/dist/runtime/components/AvatarGroup.vue +6 -2
- package/dist/runtime/components/Badge.vue +36 -5
- package/dist/runtime/components/Breadcrumb.vue +53 -14
- package/dist/runtime/components/Button.vue +47 -7
- package/dist/runtime/components/ButtonGroup.vue +7 -3
- package/dist/runtime/components/Calendar.vue +191 -0
- package/dist/runtime/components/Card.vue +5 -2
- package/dist/runtime/components/Carousel.vue +323 -0
- package/dist/runtime/components/Checkbox.vue +30 -34
- package/dist/runtime/components/Chip.vue +12 -4
- package/dist/runtime/components/Collapsible.vue +11 -6
- package/dist/runtime/components/ColorPicker.vue +266 -0
- package/dist/runtime/components/CommandPalette.vue +132 -99
- package/dist/runtime/components/Container.vue +5 -2
- package/dist/runtime/components/ContextMenu.vue +103 -15
- package/dist/runtime/components/ContextMenuContent.vue +49 -19
- package/dist/runtime/components/Drawer.vue +28 -12
- package/dist/runtime/components/DropdownMenu.vue +93 -17
- package/dist/runtime/components/DropdownMenuContent.vue +51 -19
- package/dist/runtime/components/Form.vue +59 -41
- package/dist/runtime/components/FormField.vue +20 -7
- package/dist/runtime/components/Icon.vue +1 -1
- package/dist/runtime/components/Input.vue +18 -8
- package/dist/runtime/components/InputMenu.vue +164 -66
- package/dist/runtime/components/InputNumber.vue +193 -0
- package/dist/runtime/components/Kbd.vue +5 -2
- package/dist/runtime/components/Link.vue +72 -9
- package/dist/runtime/components/LinkBase.vue +10 -7
- package/dist/runtime/components/Modal.vue +23 -16
- package/dist/runtime/components/NavigationMenu.vue +178 -78
- package/dist/runtime/components/Pagination.vue +32 -16
- package/dist/runtime/components/PinInput.vue +97 -0
- package/dist/runtime/components/Popover.vue +29 -9
- package/dist/runtime/components/Progress.vue +29 -11
- package/dist/runtime/components/RadioGroup.vue +30 -8
- package/dist/runtime/components/Select.vue +81 -33
- package/dist/runtime/components/SelectMenu.vue +181 -81
- package/dist/runtime/components/Separator.vue +5 -4
- package/dist/runtime/components/Skeleton.vue +5 -2
- package/dist/runtime/components/Slideover.vue +23 -15
- package/dist/runtime/components/Slider.vue +5 -4
- package/dist/runtime/components/Stepper.vue +173 -0
- package/dist/runtime/components/Switch.vue +18 -17
- package/dist/runtime/components/Table.vue +263 -0
- package/dist/runtime/components/Tabs.vue +45 -16
- package/dist/runtime/components/Textarea.vue +12 -5
- package/dist/runtime/components/Toast.vue +15 -6
- package/dist/runtime/components/Toaster.vue +33 -17
- package/dist/runtime/components/Tooltip.vue +10 -7
- package/dist/runtime/composables/defineLocale.d.ts +9 -0
- package/dist/runtime/composables/defineLocale.js +4 -0
- package/dist/runtime/composables/defineShortcuts.d.ts +1 -1
- package/dist/runtime/composables/defineShortcuts.js +3 -9
- package/dist/runtime/composables/extendDevtoolsMeta.d.ts +7 -0
- package/dist/runtime/composables/extendDevtoolsMeta.js +2 -0
- package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
- package/dist/runtime/composables/useButtonGroup.d.ts +2 -2
- package/dist/runtime/composables/useComponentIcons.d.ts +3 -0
- package/dist/runtime/composables/useFormField.d.ts +9 -5
- package/dist/runtime/composables/useFormField.js +8 -4
- 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/composables/useModal.d.ts +2 -2
- package/dist/runtime/composables/useSlideover.d.ts +2 -2
- package/dist/runtime/composables/useToast.d.ts +2 -2
- package/dist/runtime/index.css +1 -1
- package/dist/runtime/keyframes.css +1 -0
- package/dist/runtime/locale/ar.d.ts +2 -0
- package/dist/runtime/locale/ar.js +55 -0
- package/dist/runtime/locale/cs.d.ts +2 -0
- package/dist/runtime/locale/cs.js +54 -0
- package/dist/runtime/locale/da.d.ts +2 -0
- package/dist/runtime/locale/da.js +54 -0
- package/dist/runtime/locale/de.d.ts +2 -0
- package/dist/runtime/locale/de.js +54 -0
- package/dist/runtime/locale/el.d.ts +2 -0
- package/dist/runtime/locale/el.js +54 -0
- package/dist/runtime/locale/en.d.ts +2 -0
- package/dist/runtime/locale/en.js +54 -0
- package/dist/runtime/locale/es.d.ts +2 -0
- package/dist/runtime/locale/es.js +54 -0
- package/dist/runtime/locale/et.d.ts +2 -0
- package/dist/runtime/locale/et.js +54 -0
- package/dist/runtime/locale/fa_ir.d.ts +2 -0
- package/dist/runtime/locale/fa_ir.js +55 -0
- package/dist/runtime/locale/fi.d.ts +2 -0
- package/dist/runtime/locale/fi.js +54 -0
- package/dist/runtime/locale/fr.d.ts +2 -0
- package/dist/runtime/locale/fr.js +54 -0
- package/dist/runtime/locale/id.d.ts +2 -0
- package/dist/runtime/locale/id.js +54 -0
- package/dist/runtime/locale/index.d.ts +28 -0
- package/dist/runtime/locale/index.js +28 -0
- package/dist/runtime/locale/it.d.ts +2 -0
- package/dist/runtime/locale/it.js +54 -0
- package/dist/runtime/locale/ja.d.ts +2 -0
- package/dist/runtime/locale/ja.js +54 -0
- package/dist/runtime/locale/ko.d.ts +2 -0
- package/dist/runtime/locale/ko.js +54 -0
- package/dist/runtime/locale/nl.d.ts +2 -0
- package/dist/runtime/locale/nl.js +54 -0
- package/dist/runtime/locale/pl.d.ts +2 -0
- package/dist/runtime/locale/pl.js +54 -0
- package/dist/runtime/locale/pt.d.ts +2 -0
- package/dist/runtime/locale/pt.js +54 -0
- package/dist/runtime/locale/pt_br.d.ts +2 -0
- package/dist/runtime/locale/pt_br.js +54 -0
- package/dist/runtime/locale/ru.d.ts +2 -0
- package/dist/runtime/locale/ru.js +54 -0
- package/dist/runtime/locale/sk.d.ts +2 -0
- package/dist/runtime/locale/sk.js +54 -0
- package/dist/runtime/locale/sv.d.ts +2 -0
- package/dist/runtime/locale/sv.js +54 -0
- package/dist/runtime/locale/th.d.ts +2 -0
- package/dist/runtime/locale/th.js +54 -0
- package/dist/runtime/locale/tr.d.ts +2 -0
- package/dist/runtime/locale/tr.js +54 -0
- package/dist/runtime/locale/uk.d.ts +2 -0
- package/dist/runtime/locale/uk.js +54 -0
- package/dist/runtime/locale/vi.d.ts +2 -0
- package/dist/runtime/locale/vi.js +54 -0
- package/dist/runtime/locale/zh_hans.d.ts +2 -0
- package/dist/runtime/locale/zh_hans.js +54 -0
- package/dist/runtime/locale/zh_hant.d.ts +2 -0
- package/dist/runtime/locale/zh_hant.js +54 -0
- package/dist/runtime/plugins/colors.js +12 -8
- package/dist/runtime/types/form.d.ts +11 -4
- package/dist/runtime/types/form.js +2 -2
- package/dist/runtime/types/index.d.ts +50 -42
- package/dist/runtime/types/index.js +8 -0
- package/dist/runtime/types/locale.d.ts +56 -0
- package/dist/runtime/types/utils.d.ts +8 -3
- package/dist/runtime/utils/form.d.ts +7 -5
- package/dist/runtime/utils/form.js +117 -28
- package/dist/runtime/utils/index.d.ts +2 -1
- package/dist/runtime/utils/index.js +16 -0
- package/dist/runtime/utils/link.d.ts +5 -3
- package/dist/runtime/utils/link.js +1 -1
- package/dist/runtime/utils/locale.d.ts +15 -0
- package/dist/runtime/utils/locale.js +25 -0
- package/dist/runtime/utils/tv.d.ts +1 -0
- package/dist/runtime/utils/tv.js +4 -0
- package/dist/runtime/vue/components/Icon.vue +15 -0
- package/dist/runtime/vue/components/Link.vue +208 -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.BKsd22-Q.mjs +3289 -0
- package/dist/shared/ui.DCjJwb6l.cjs +3296 -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 +107 -35
- 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
- package/dist/runtime/types/component.d.ts +0 -17
- /package/dist/runtime/types/{component.js → locale.js} +0 -0
|
@@ -1,40 +1,45 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import type { NavigationMenuRootProps, NavigationMenuRootEmits,
|
|
2
|
+
import type { VariantProps } from 'tailwind-variants'
|
|
3
|
+
import type { NavigationMenuRootProps, NavigationMenuRootEmits, NavigationMenuContentProps, CollapsibleRootProps } from 'reka-ui'
|
|
4
4
|
import type { AppConfig } from '@nuxt/schema'
|
|
5
5
|
import _appConfig from '#build/app.config'
|
|
6
6
|
import theme from '#build/ui/navigation-menu'
|
|
7
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
8
|
+
import { tv } from '../utils/tv'
|
|
7
9
|
import type { AvatarProps, BadgeProps, LinkProps } from '../types'
|
|
8
|
-
import type { DynamicSlots } from '../types/utils'
|
|
10
|
+
import type { DynamicSlots, MaybeArrayOfArray, MaybeArrayOfArrayItem, PartialString } from '../types/utils'
|
|
9
11
|
|
|
10
12
|
const appConfig = _appConfig as AppConfig & { ui: { navigationMenu: Partial<typeof theme> } }
|
|
11
13
|
|
|
12
14
|
const navigationMenu = tv({ extend: tv(theme), ...(appConfig.ui?.navigationMenu || {}) })
|
|
13
15
|
|
|
14
|
-
export interface NavigationMenuChildItem extends Omit<
|
|
15
|
-
|
|
16
|
+
export interface NavigationMenuChildItem extends Omit<NavigationMenuItem, 'children'> {
|
|
17
|
+
/** Description is only used when `orientation` is `horizontal`. */
|
|
16
18
|
description?: string
|
|
17
|
-
icon?: string
|
|
18
|
-
select?(e: Event): void
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export interface NavigationMenuItem extends Omit<LinkProps, 'raw' | 'custom'>, Pick<
|
|
21
|
+
export interface NavigationMenuItem extends Omit<LinkProps, 'raw' | 'custom'>, Pick<CollapsibleRootProps, 'defaultOpen' | 'open'> {
|
|
22
22
|
label?: string
|
|
23
23
|
icon?: string
|
|
24
24
|
avatar?: AvatarProps
|
|
25
|
+
/**
|
|
26
|
+
* Display a badge on the item.
|
|
27
|
+
* `{ size: 'sm', color: 'neutral', variant: 'outline' }`{lang="ts-type"}
|
|
28
|
+
*/
|
|
25
29
|
badge?: string | number | BadgeProps
|
|
26
30
|
trailingIcon?: string
|
|
27
31
|
slot?: string
|
|
32
|
+
value?: string
|
|
28
33
|
children?: NavigationMenuChildItem[]
|
|
29
|
-
|
|
34
|
+
onSelect?(e: Event): void
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
type NavigationMenuVariants = VariantProps<typeof navigationMenu>
|
|
33
38
|
|
|
34
|
-
export interface NavigationMenuProps<T> extends Pick<NavigationMenuRootProps, 'defaultValue' | 'delayDuration' | 'disableClickTrigger' | 'disableHoverTrigger' | '
|
|
39
|
+
export interface NavigationMenuProps<T> extends Pick<NavigationMenuRootProps, 'modelValue' | 'defaultValue' | 'delayDuration' | 'disableClickTrigger' | 'disableHoverTrigger' | 'skipDelayDuration' | 'disablePointerLeaveClose' | 'unmountOnHide'> {
|
|
35
40
|
/**
|
|
36
41
|
* The element or component this component should render as.
|
|
37
|
-
* @defaultValue
|
|
42
|
+
* @defaultValue 'div'
|
|
38
43
|
*/
|
|
39
44
|
as?: any
|
|
40
45
|
/**
|
|
@@ -42,7 +47,7 @@ export interface NavigationMenuProps<T> extends Pick<NavigationMenuRootProps, 'd
|
|
|
42
47
|
* @defaultValue appConfig.ui.icons.chevronDown
|
|
43
48
|
*/
|
|
44
49
|
trailingIcon?: string
|
|
45
|
-
items?: T
|
|
50
|
+
items?: T
|
|
46
51
|
color?: NavigationMenuVariants['color']
|
|
47
52
|
variant?: NavigationMenuVariants['variant']
|
|
48
53
|
/**
|
|
@@ -60,8 +65,13 @@ export interface NavigationMenuProps<T> extends Pick<NavigationMenuRootProps, 'd
|
|
|
60
65
|
* @defaultValue false
|
|
61
66
|
*/
|
|
62
67
|
arrow?: boolean
|
|
68
|
+
/**
|
|
69
|
+
* The key used to get the label from the item.
|
|
70
|
+
* @defaultValue 'label'
|
|
71
|
+
*/
|
|
72
|
+
labelKey?: string
|
|
63
73
|
class?: any
|
|
64
|
-
ui?:
|
|
74
|
+
ui?: PartialString<typeof navigationMenu.slots>
|
|
65
75
|
}
|
|
66
76
|
|
|
67
77
|
export interface NavigationMenuEmits extends NavigationMenuRootEmits {}
|
|
@@ -73,30 +83,88 @@ export type NavigationMenuSlots<T extends { slot?: string }> = {
|
|
|
73
83
|
'item-leading': SlotProps<T>
|
|
74
84
|
'item-label': SlotProps<T>
|
|
75
85
|
'item-trailing': SlotProps<T>
|
|
86
|
+
'item-content': SlotProps<T>
|
|
76
87
|
} & DynamicSlots<T, SlotProps<T>>
|
|
88
|
+
|
|
89
|
+
extendDevtoolsMeta({
|
|
90
|
+
ignoreProps: ['items'],
|
|
91
|
+
defaultProps: {
|
|
92
|
+
items: [
|
|
93
|
+
[{
|
|
94
|
+
label: 'Documentation',
|
|
95
|
+
icon: 'i-lucide-book-open',
|
|
96
|
+
badge: 10,
|
|
97
|
+
children: [{
|
|
98
|
+
label: 'Introduction',
|
|
99
|
+
description: 'Fully styled and customizable components for Nuxt.',
|
|
100
|
+
icon: 'i-lucide-house'
|
|
101
|
+
}, {
|
|
102
|
+
label: 'Installation',
|
|
103
|
+
description: 'Learn how to install and configure Nuxt UI in your application.',
|
|
104
|
+
icon: 'i-lucide-cloud-download'
|
|
105
|
+
}, {
|
|
106
|
+
label: 'Theming',
|
|
107
|
+
description: 'Learn how to customize the look and feel of the components.',
|
|
108
|
+
icon: 'i-lucide-swatch-book'
|
|
109
|
+
}, {
|
|
110
|
+
label: 'Shortcuts',
|
|
111
|
+
description: 'Learn how to display and define keyboard shortcuts in your app.',
|
|
112
|
+
icon: 'i-lucide-monitor'
|
|
113
|
+
}]
|
|
114
|
+
}, {
|
|
115
|
+
label: 'GitHub',
|
|
116
|
+
icon: 'i-simple-icons-github',
|
|
117
|
+
to: 'https://github.com/nuxt/ui',
|
|
118
|
+
target: '_blank'
|
|
119
|
+
}, {
|
|
120
|
+
label: 'Help',
|
|
121
|
+
icon: 'i-lucide-circle-help',
|
|
122
|
+
disabled: true
|
|
123
|
+
}]
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
})
|
|
77
127
|
</script>
|
|
78
128
|
|
|
79
|
-
<script setup lang="ts" generic="T extends NavigationMenuItem">
|
|
129
|
+
<script setup lang="ts" generic="T extends MaybeArrayOfArrayItem<I>, I extends MaybeArrayOfArray<NavigationMenuItem>">
|
|
80
130
|
import { computed, toRef } from 'vue'
|
|
81
|
-
import { NavigationMenuRoot, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, useForwardPropsEmits } from '
|
|
82
|
-
import {
|
|
131
|
+
import { NavigationMenuRoot, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, useForwardPropsEmits } from 'reka-ui'
|
|
132
|
+
import { createReusableTemplate } from '@vueuse/core'
|
|
133
|
+
import { get } from '../utils'
|
|
134
|
+
import { pickLinkProps } from '../utils/link'
|
|
83
135
|
import ULinkBase from './LinkBase.vue'
|
|
84
136
|
import ULink from './Link.vue'
|
|
85
137
|
import UAvatar from './Avatar.vue'
|
|
86
138
|
import UIcon from './Icon.vue'
|
|
87
139
|
import UBadge from './Badge.vue'
|
|
88
|
-
import
|
|
140
|
+
import UCollapsible from './Collapsible.vue'
|
|
89
141
|
|
|
90
|
-
const props = withDefaults(defineProps<NavigationMenuProps<
|
|
142
|
+
const props = withDefaults(defineProps<NavigationMenuProps<I>>(), {
|
|
91
143
|
orientation: 'horizontal',
|
|
92
|
-
delayDuration: 0
|
|
144
|
+
delayDuration: 0,
|
|
145
|
+
unmountOnHide: true,
|
|
146
|
+
labelKey: 'label'
|
|
93
147
|
})
|
|
94
148
|
const emits = defineEmits<NavigationMenuEmits>()
|
|
95
149
|
const slots = defineSlots<NavigationMenuSlots<T>>()
|
|
96
150
|
|
|
97
|
-
const rootProps = useForwardPropsEmits(
|
|
151
|
+
const rootProps = useForwardPropsEmits(computed(() => ({
|
|
152
|
+
as: props.as,
|
|
153
|
+
modelValue: props.modelValue,
|
|
154
|
+
defaultValue: props.defaultValue,
|
|
155
|
+
delayDuration: props.delayDuration,
|
|
156
|
+
skipDelayDuration: props.skipDelayDuration,
|
|
157
|
+
orientation: props.orientation,
|
|
158
|
+
disableClickTrigger: props.disableClickTrigger,
|
|
159
|
+
disableHoverTrigger: props.disableHoverTrigger,
|
|
160
|
+
disablePointerLeaveClose: props.disablePointerLeaveClose,
|
|
161
|
+
unmountOnHide: props.unmountOnHide
|
|
162
|
+
})), emits)
|
|
163
|
+
|
|
98
164
|
const contentProps = toRef(() => props.content)
|
|
99
165
|
|
|
166
|
+
const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate<{ item: NavigationMenuItem, active?: boolean, index: number }>()
|
|
167
|
+
|
|
100
168
|
const ui = computed(() => navigationMenu({
|
|
101
169
|
orientation: props.orientation,
|
|
102
170
|
color: props.color,
|
|
@@ -109,76 +177,108 @@ const lists = computed(() => props.items?.length ? (Array.isArray(props.items[0]
|
|
|
109
177
|
</script>
|
|
110
178
|
|
|
111
179
|
<template>
|
|
180
|
+
<DefineItemTemplate v-slot="{ item, active, index }">
|
|
181
|
+
<slot :name="item.slot || 'item'" :item="(item as T)" :index="index">
|
|
182
|
+
<slot :name="item.slot ? `${item.slot}-leading` : 'item-leading'" :item="(item as T)" :active="active" :index="index">
|
|
183
|
+
<UAvatar v-if="item.avatar" :size="((props.ui?.linkLeadingAvatarSize || ui.linkLeadingAvatarSize()) as AvatarProps['size'])" v-bind="item.avatar" :class="ui.linkLeadingAvatar({ class: props.ui?.linkLeadingAvatar, active, disabled: !!item.disabled })" />
|
|
184
|
+
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.linkLeadingIcon({ class: props.ui?.linkLeadingIcon, active, disabled: !!item.disabled })" />
|
|
185
|
+
</slot>
|
|
186
|
+
|
|
187
|
+
<span v-if="get(item, props.labelKey as string) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="ui.linkLabel({ class: props.ui?.linkLabel })">
|
|
188
|
+
<slot :name="item.slot ? `${item.slot}-label` : 'item-label'" :item="(item as T)" :active="active" :index="index">
|
|
189
|
+
{{ get(item, props.labelKey as string) }}
|
|
190
|
+
</slot>
|
|
191
|
+
|
|
192
|
+
<UIcon v-if="item.target === '_blank'" :name="appConfig.ui.icons.external" :class="ui.linkLabelExternalIcon({ class: props.ui?.linkLabelExternalIcon, active })" />
|
|
193
|
+
</span>
|
|
194
|
+
|
|
195
|
+
<span v-if="item.badge || (orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content'])) || (orientation === 'vertical' && item.children?.length) || item.trailingIcon || !!slots[item.slot ? `${item.slot}-trailing` : 'item-trailing']" :class="ui.linkTrailing({ class: props.ui?.linkTrailing })">
|
|
196
|
+
<slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" :item="(item as T)" :active="active" :index="index">
|
|
197
|
+
<UBadge
|
|
198
|
+
v-if="item.badge"
|
|
199
|
+
color="neutral"
|
|
200
|
+
variant="outline"
|
|
201
|
+
:size="((props.ui?.linkTrailingBadgeSize || ui.linkTrailingBadgeSize()) as BadgeProps['size'])"
|
|
202
|
+
v-bind="(typeof item.badge === 'string' || typeof item.badge === 'number') ? { label: item.badge } : item.badge"
|
|
203
|
+
:class="ui.linkTrailingBadge({ class: props.ui?.linkTrailingBadge })"
|
|
204
|
+
/>
|
|
205
|
+
|
|
206
|
+
<UIcon v-if="(orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content'])) || (orientation === 'vertical' && item.children?.length)" :name="item.trailingIcon || trailingIcon || appConfig.ui.icons.chevronDown" :class="ui.linkTrailingIcon({ class: props.ui?.linkTrailingIcon, active })" />
|
|
207
|
+
<UIcon v-else-if="item.trailingIcon" :name="item.trailingIcon" :class="ui.linkTrailingIcon({ class: props.ui?.linkTrailingIcon, active })" />
|
|
208
|
+
</slot>
|
|
209
|
+
</span>
|
|
210
|
+
</slot>
|
|
211
|
+
</DefineItemTemplate>
|
|
212
|
+
|
|
112
213
|
<NavigationMenuRoot v-bind="rootProps" :class="ui.root({ class: [props.class, props.ui?.root] })">
|
|
113
214
|
<template v-for="(list, listIndex) in lists" :key="`list-${listIndex}`">
|
|
114
215
|
<NavigationMenuList :class="ui.list({ class: props.ui?.list })">
|
|
115
|
-
<
|
|
116
|
-
|
|
216
|
+
<component
|
|
217
|
+
:is="(orientation === 'vertical' && item.children?.length) ? UCollapsible : NavigationMenuItem"
|
|
218
|
+
v-for="(item, index) in list"
|
|
219
|
+
:key="`list-${listIndex}-${index}`"
|
|
220
|
+
as="li"
|
|
221
|
+
:value="item.value || String(index)"
|
|
222
|
+
:default-open="item.defaultOpen"
|
|
223
|
+
:unmount-on-hide="(orientation === 'vertical' && item.children?.length) ? unmountOnHide : undefined"
|
|
224
|
+
:open="item.open"
|
|
225
|
+
:class="ui.item({ class: props.ui?.item })"
|
|
226
|
+
>
|
|
227
|
+
<ULink v-slot="{ active, ...slotProps }" v-bind="(orientation === 'vertical' && item.children?.length) ? {} : pickLinkProps(item)" custom>
|
|
117
228
|
<component
|
|
118
|
-
:is="item.children?.length ? NavigationMenuTrigger : NavigationMenuLink"
|
|
119
|
-
v-bind="item.children?.length ? { disabled: item.disabled } : { active }"
|
|
229
|
+
:is="(orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content'])) ? NavigationMenuTrigger : NavigationMenuLink"
|
|
120
230
|
as-child
|
|
121
231
|
:active="active"
|
|
122
|
-
|
|
232
|
+
:disabled="item.disabled"
|
|
233
|
+
@select="item.onSelect"
|
|
123
234
|
>
|
|
124
|
-
<ULinkBase v-bind="slotProps" :class="ui.link({ class: [props.ui?.link, item.class], active, disabled: !!item.disabled })">
|
|
125
|
-
<
|
|
126
|
-
<slot :name="item.slot ? `${item.slot}-leading`: 'item-leading'" :item="item" :active="active" :index="index">
|
|
127
|
-
<UAvatar v-if="item.avatar" :size="((props.ui?.linkLeadingAvatarSize || ui.linkLeadingAvatarSize()) as AvatarProps['size'])" v-bind="item.avatar" :class="ui.linkLeadingAvatar({ class: props.ui?.linkLeadingAvatar, active, disabled: !!item.disabled })" />
|
|
128
|
-
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.linkLeadingIcon({ class: props.ui?.linkLeadingIcon, active, disabled: !!item.disabled })" />
|
|
129
|
-
</slot>
|
|
130
|
-
|
|
131
|
-
<span v-if="item.label || !!slots[item.slot ? `${item.slot}-label`: 'item-label']" :class="ui.linkLabel({ class: props.ui?.linkLabel })">
|
|
132
|
-
<slot :name="item.slot ? `${item.slot}-label`: 'item-label'" :item="item" :active="active" :index="index">
|
|
133
|
-
{{ item.label }}
|
|
134
|
-
</slot>
|
|
135
|
-
|
|
136
|
-
<UIcon v-if="item.target === '_blank'" :name="appConfig.ui.icons.external" :class="ui.linkLabelExternalIcon({ class: props.ui?.linkLabelExternalIcon, active })" />
|
|
137
|
-
</span>
|
|
138
|
-
|
|
139
|
-
<span v-if="item.badge || (item.children?.length && orientation === 'horizontal') || !!slots[item.slot ? `${item.slot}-trailing`: 'item-trailing']" :class="ui.linkTrailing({ class: props.ui?.linkTrailing })">
|
|
140
|
-
<slot :name="item.slot ? `${item.slot}-trailing`: 'item-trailing'" :item="item" :active="active" :index="index">
|
|
141
|
-
<UBadge
|
|
142
|
-
v-if="item.badge"
|
|
143
|
-
color="gray"
|
|
144
|
-
variant="outline"
|
|
145
|
-
:size="((props.ui?.linkTrailingBadgeSize || ui.linkTrailingBadgeSize()) as BadgeProps['size'])"
|
|
146
|
-
v-bind="(typeof item.badge === 'string' || typeof item.badge === 'number') ? { label: item.badge } : item.badge"
|
|
147
|
-
:class="ui.linkTrailingBadge({ class: props.ui?.linkTrailingBadge })"
|
|
148
|
-
/>
|
|
149
|
-
<UIcon v-if="item.children?.length && orientation === 'horizontal'" :name="item.trailingIcon || trailingIcon || appConfig.ui.icons.chevronDown" :class="ui.linkTrailingIcon({ class: props.ui?.linkTrailingIcon, active })" />
|
|
150
|
-
</slot>
|
|
151
|
-
</span>
|
|
152
|
-
</slot>
|
|
235
|
+
<ULinkBase v-bind="slotProps" :class="ui.link({ class: [props.ui?.link, item.class], active: active || item.active, disabled: !!item.disabled, level: !(orientation === 'vertical' && item.children?.length) })">
|
|
236
|
+
<ReuseItemTemplate :item="(item as T)" :active="active || item.active" :index="index" />
|
|
153
237
|
</ULinkBase>
|
|
154
238
|
</component>
|
|
155
239
|
|
|
156
|
-
<NavigationMenuContent v-if="item.children?.length
|
|
157
|
-
<
|
|
158
|
-
<
|
|
159
|
-
<
|
|
160
|
-
<
|
|
161
|
-
<
|
|
162
|
-
<
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
<
|
|
166
|
-
{
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
240
|
+
<NavigationMenuContent v-if="orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content'])" v-bind="contentProps" :class="ui.content({ class: props.ui?.content })">
|
|
241
|
+
<slot :name="item.slot ? `${item.slot}-content` : 'item-content'" :item="(item as T)" :active="active" :index="index">
|
|
242
|
+
<ul :class="ui.childList({ class: props.ui?.childList })">
|
|
243
|
+
<li v-for="(childItem, childIndex) in item.children" :key="childIndex" :class="ui.childItem({ class: props.ui?.childItem })">
|
|
244
|
+
<ULink v-slot="{ active: childActive, ...childSlotProps }" v-bind="pickLinkProps(childItem)" custom>
|
|
245
|
+
<NavigationMenuLink as-child :active="childActive" @select="childItem.onSelect">
|
|
246
|
+
<ULinkBase v-bind="childSlotProps" :class="ui.childLink({ class: [props.ui?.childLink, childItem.class], active: childActive })">
|
|
247
|
+
<UIcon v-if="childItem.icon" :name="childItem.icon" :class="ui.childLinkIcon({ class: props.ui?.childLinkIcon, active: childActive })" />
|
|
248
|
+
|
|
249
|
+
<div :class="ui.childLinkWrapper({ class: props.ui?.childLinkWrapper })">
|
|
250
|
+
<p :class="ui.childLinkLabel({ class: props.ui?.childLinkLabel, active: childActive })">
|
|
251
|
+
{{ get(childItem, props.labelKey as string) }}
|
|
252
|
+
|
|
253
|
+
<UIcon v-if="childItem.target === '_blank'" :name="appConfig.ui.icons.external" :class="ui.childLinkLabelExternalIcon({ class: props.ui?.childLinkLabelExternalIcon, active: childActive })" />
|
|
254
|
+
</p>
|
|
255
|
+
<p v-if="childItem.description" :class="ui.childLinkDescription({ class: props.ui?.childLinkDescription, active: childActive })">
|
|
256
|
+
{{ childItem.description }}
|
|
257
|
+
</p>
|
|
258
|
+
</div>
|
|
259
|
+
</ULinkBase>
|
|
260
|
+
</NavigationMenuLink>
|
|
261
|
+
</ULink>
|
|
262
|
+
</li>
|
|
263
|
+
</ul>
|
|
264
|
+
</slot>
|
|
179
265
|
</NavigationMenuContent>
|
|
180
266
|
</ULink>
|
|
181
|
-
|
|
267
|
+
|
|
268
|
+
<template v-if="orientation === 'vertical' && item.children?.length" #content>
|
|
269
|
+
<ul :class="ui.childList({ class: props.ui?.childList })">
|
|
270
|
+
<li v-for="(childItem, childIndex) in item.children" :key="childIndex" :class="ui.childItem({ class: props.ui?.childItem })">
|
|
271
|
+
<ULink v-slot="{ active: childActive, ...childSlotProps }" v-bind="pickLinkProps(childItem)" custom>
|
|
272
|
+
<NavigationMenuLink as-child :active="childActive" @select="childItem.onSelect">
|
|
273
|
+
<ULinkBase v-bind="childSlotProps" :class="ui.link({ class: [props.ui?.link, childItem.class], active: childActive, disabled: !!childItem.disabled, level: true })">
|
|
274
|
+
<ReuseItemTemplate :item="(childItem as T)" :active="childActive" :index="childIndex" />
|
|
275
|
+
</ULinkBase>
|
|
276
|
+
</NavigationMenuLink>
|
|
277
|
+
</ULink>
|
|
278
|
+
</li>
|
|
279
|
+
</ul>
|
|
280
|
+
</template>
|
|
281
|
+
</component>
|
|
182
282
|
</NavigationMenuList>
|
|
183
283
|
|
|
184
284
|
<div v-if="orientation === 'vertical' && listIndex < lists.length - 1" :class="ui.separator({ class: props.ui?.separator })" />
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import type { PaginationRootProps, PaginationRootEmits } from 'radix-vue'
|
|
2
|
+
import type { PaginationRootProps, PaginationRootEmits } from 'reka-ui'
|
|
4
3
|
import type { AppConfig } from '@nuxt/schema'
|
|
5
4
|
import type { RouteLocationRaw } from '#vue-router'
|
|
6
5
|
import _appConfig from '#build/app.config'
|
|
7
6
|
import theme from '#build/ui/pagination'
|
|
7
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
8
|
+
import { tv } from '../utils/tv'
|
|
8
9
|
import type { ButtonProps } from '../types'
|
|
9
10
|
|
|
10
11
|
const appConfig = _appConfig as AppConfig & { ui: { pagination: Partial<typeof theme> } }
|
|
11
12
|
|
|
12
13
|
const pagination = tv({ extend: tv(theme), ...(appConfig.ui?.pagination || {}) })
|
|
13
14
|
|
|
14
|
-
export interface PaginationProps extends Pick<PaginationRootProps, 'defaultPage' | 'disabled' | 'itemsPerPage' | 'page' | 'showEdges' | 'siblingCount' | 'total'
|
|
15
|
+
export interface PaginationProps extends Partial<Pick<PaginationRootProps, 'defaultPage' | 'disabled' | 'itemsPerPage' | 'page' | 'showEdges' | 'siblingCount' | 'total'>> {
|
|
15
16
|
/**
|
|
16
17
|
* The element or component this component should render as.
|
|
17
|
-
* @defaultValue
|
|
18
|
+
* @defaultValue 'div'
|
|
18
19
|
*/
|
|
19
20
|
as?: any
|
|
20
21
|
/**
|
|
@@ -44,17 +45,17 @@ export interface PaginationProps extends Pick<PaginationRootProps, 'defaultPage'
|
|
|
44
45
|
ellipsisIcon?: string
|
|
45
46
|
/**
|
|
46
47
|
* The color of the pagination controls.
|
|
47
|
-
* @defaultValue '
|
|
48
|
+
* @defaultValue 'neutral'
|
|
48
49
|
*/
|
|
49
50
|
color?: ButtonProps['color']
|
|
50
51
|
/**
|
|
51
52
|
* The variant of the pagination controls.
|
|
52
|
-
* @defaultValue '
|
|
53
|
+
* @defaultValue 'outline'
|
|
53
54
|
*/
|
|
54
55
|
variant?: ButtonProps['variant']
|
|
55
56
|
/**
|
|
56
57
|
* The color of the active pagination control.
|
|
57
|
-
* @defaultValue '
|
|
58
|
+
* @defaultValue 'primary'
|
|
58
59
|
*/
|
|
59
60
|
activeColor?: ButtonProps['color']
|
|
60
61
|
/**
|
|
@@ -97,27 +98,42 @@ export interface PaginationSlots {
|
|
|
97
98
|
index: number
|
|
98
99
|
}): any
|
|
99
100
|
}
|
|
101
|
+
|
|
102
|
+
extendDevtoolsMeta({ defaultProps: { total: 50 } })
|
|
100
103
|
</script>
|
|
101
104
|
|
|
102
105
|
<script setup lang="ts">
|
|
103
|
-
import {
|
|
106
|
+
import { computed } from 'vue'
|
|
107
|
+
import { PaginationRoot, PaginationList, PaginationListItem, PaginationFirst, PaginationPrev, PaginationEllipsis, PaginationNext, PaginationLast, useForwardPropsEmits } from 'reka-ui'
|
|
104
108
|
import { reactivePick } from '@vueuse/core'
|
|
105
109
|
import { useAppConfig } from '#imports'
|
|
110
|
+
import { useLocale } from '../composables/useLocale'
|
|
111
|
+
import UButton from './Button.vue'
|
|
106
112
|
|
|
107
113
|
const props = withDefaults(defineProps<PaginationProps>(), {
|
|
108
|
-
|
|
109
|
-
|
|
114
|
+
size: 'md',
|
|
115
|
+
color: 'neutral',
|
|
110
116
|
variant: 'outline',
|
|
117
|
+
activeColor: 'primary',
|
|
111
118
|
activeVariant: 'solid',
|
|
112
|
-
showControls: true
|
|
119
|
+
showControls: true,
|
|
120
|
+
showEdges: false,
|
|
121
|
+
itemsPerPage: 10,
|
|
122
|
+
siblingCount: 2,
|
|
123
|
+
total: 0
|
|
113
124
|
})
|
|
114
125
|
const emits = defineEmits<PaginationEmits>()
|
|
115
126
|
const slots = defineSlots<PaginationSlots>()
|
|
116
127
|
|
|
117
128
|
const appConfig = useAppConfig()
|
|
118
|
-
|
|
129
|
+
const { dir } = useLocale()
|
|
119
130
|
const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'defaultPage', 'disabled', 'itemsPerPage', 'page', 'showEdges', 'siblingCount', 'total'), emits)
|
|
120
131
|
|
|
132
|
+
const firstIcon = computed(() => props.firstIcon || (dir.value === 'rtl' ? appConfig.ui.icons.chevronDoubleRight : appConfig.ui.icons.chevronDoubleLeft))
|
|
133
|
+
const prevIcon = computed(() => props.prevIcon || (dir.value === 'rtl' ? appConfig.ui.icons.chevronRight : appConfig.ui.icons.chevronLeft))
|
|
134
|
+
const nextIcon = computed(() => props.nextIcon || (dir.value === 'rtl' ? appConfig.ui.icons.chevronLeft : appConfig.ui.icons.chevronRight))
|
|
135
|
+
const lastIcon = computed(() => props.lastIcon || (dir.value === 'rtl' ? appConfig.ui.icons.chevronDoubleLeft : appConfig.ui.icons.chevronDoubleRight))
|
|
136
|
+
|
|
121
137
|
// eslint-disable-next-line vue/no-dupe-keys
|
|
122
138
|
const ui = pagination()
|
|
123
139
|
</script>
|
|
@@ -127,12 +143,12 @@ const ui = pagination()
|
|
|
127
143
|
<PaginationList v-slot="{ items }" :class="ui.list({ class: props.ui?.list })">
|
|
128
144
|
<PaginationFirst v-if="showControls || !!slots.first" as-child>
|
|
129
145
|
<slot name="first">
|
|
130
|
-
<UButton :color="color" :variant="variant" :size="size" :icon="firstIcon
|
|
146
|
+
<UButton :color="color" :variant="variant" :size="size" :icon="firstIcon" :to="to?.(1)" />
|
|
131
147
|
</slot>
|
|
132
148
|
</PaginationFirst>
|
|
133
149
|
<PaginationPrev v-if="showControls || !!slots.prev" as-child>
|
|
134
150
|
<slot name="prev">
|
|
135
|
-
<UButton :color="color" :variant="variant" :size="size" :icon="prevIcon
|
|
151
|
+
<UButton :color="color" :variant="variant" :size="size" :icon="prevIcon" :to="page > 1 ? to?.(page - 1) : undefined" />
|
|
136
152
|
</slot>
|
|
137
153
|
</PaginationPrev>
|
|
138
154
|
|
|
@@ -160,12 +176,12 @@ const ui = pagination()
|
|
|
160
176
|
|
|
161
177
|
<PaginationNext v-if="showControls || !!slots.next" as-child>
|
|
162
178
|
<slot name="next">
|
|
163
|
-
<UButton :color="color" :variant="variant" :size="size" :icon="nextIcon
|
|
179
|
+
<UButton :color="color" :variant="variant" :size="size" :icon="nextIcon" :to="page < pageCount ? to?.(pageCount) : undefined" />
|
|
164
180
|
</slot>
|
|
165
181
|
</PaginationNext>
|
|
166
182
|
<PaginationLast v-if="showControls || !!slots.last" as-child>
|
|
167
183
|
<slot name="last">
|
|
168
|
-
<UButton :color="color" :variant="variant" :size="size" :icon="lastIcon
|
|
184
|
+
<UButton :color="color" :variant="variant" :size="size" :icon="lastIcon" :to=" to?.(pageCount)" />
|
|
169
185
|
</slot>
|
|
170
186
|
</PaginationLast>
|
|
171
187
|
</PaginationList>
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { VariantProps } from 'tailwind-variants'
|
|
3
|
+
import type { PinInputRootEmits, PinInputRootProps } from 'reka-ui'
|
|
4
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
5
|
+
import _appConfig from '#build/app.config'
|
|
6
|
+
import theme from '#build/ui/pin-input'
|
|
7
|
+
import { tv } from '../utils/tv'
|
|
8
|
+
import type { PartialString } from '../types/utils'
|
|
9
|
+
|
|
10
|
+
const appConfig = _appConfig as AppConfig & { ui: { pinInput: Partial<typeof theme> } }
|
|
11
|
+
|
|
12
|
+
const pinInput = tv({ extend: tv(theme), ...(appConfig.ui?.pinInput || {}) })
|
|
13
|
+
|
|
14
|
+
type PinInputVariants = VariantProps<typeof pinInput>
|
|
15
|
+
|
|
16
|
+
export interface PinInputProps extends Pick<PinInputRootProps, 'defaultValue' | 'disabled' | 'id' | 'mask' | 'modelValue' | 'name' | 'otp' | 'placeholder' | 'required' | 'type'> {
|
|
17
|
+
/**
|
|
18
|
+
* The element or component this component should render as.
|
|
19
|
+
* @defaultValue 'div'
|
|
20
|
+
*/
|
|
21
|
+
as?: any
|
|
22
|
+
color?: PinInputVariants['color']
|
|
23
|
+
variant?: PinInputVariants['variant']
|
|
24
|
+
size?: PinInputVariants['size']
|
|
25
|
+
length?: number | string
|
|
26
|
+
highlight?: boolean
|
|
27
|
+
class?: any
|
|
28
|
+
ui?: PartialString<typeof pinInput.slots>
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type PinInputEmits = PinInputRootEmits & {
|
|
32
|
+
change: [payload: Event]
|
|
33
|
+
blur: [payload: Event]
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<script setup lang="ts">
|
|
38
|
+
import { ref, computed } from 'vue'
|
|
39
|
+
import { PinInputInput, PinInputRoot, useForwardPropsEmits } from 'reka-ui'
|
|
40
|
+
import { reactivePick } from '@vueuse/core'
|
|
41
|
+
import { useFormField } from '../composables/useFormField'
|
|
42
|
+
import { looseToNumber } from '../utils'
|
|
43
|
+
|
|
44
|
+
defineOptions({ inheritAttrs: false })
|
|
45
|
+
|
|
46
|
+
const props = withDefaults(defineProps<PinInputProps>(), {
|
|
47
|
+
type: 'text',
|
|
48
|
+
length: 5
|
|
49
|
+
})
|
|
50
|
+
const emits = defineEmits<PinInputEmits>()
|
|
51
|
+
|
|
52
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, 'defaultValue', 'disabled', 'id', 'mask', 'modelValue', 'name', 'otp', 'placeholder', 'required', 'type'), emits)
|
|
53
|
+
const { emitFormInput, emitFormChange, emitFormBlur, size, color, id, name, highlight, disabled } = useFormField<PinInputProps>(props)
|
|
54
|
+
|
|
55
|
+
const ui = computed(() => pinInput({
|
|
56
|
+
color: color.value,
|
|
57
|
+
variant: props.variant,
|
|
58
|
+
size: size.value,
|
|
59
|
+
highlight: highlight.value
|
|
60
|
+
}))
|
|
61
|
+
|
|
62
|
+
const completed = ref(false)
|
|
63
|
+
function onComplete(value: string[]) {
|
|
64
|
+
// @ts-expect-error - 'target' does not exist in type 'EventInit'
|
|
65
|
+
const event = new Event('change', { target: { value } })
|
|
66
|
+
emits('change', event)
|
|
67
|
+
emitFormChange()
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function onBlur(event: FocusEvent) {
|
|
71
|
+
if (!event.relatedTarget || completed.value) {
|
|
72
|
+
emits('blur', event)
|
|
73
|
+
emitFormBlur()
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
</script>
|
|
77
|
+
|
|
78
|
+
<template>
|
|
79
|
+
<PinInputRoot
|
|
80
|
+
v-bind="rootProps"
|
|
81
|
+
:id="id"
|
|
82
|
+
:name="name"
|
|
83
|
+
:class="ui.root({ class: [props.class, props.ui?.root] })"
|
|
84
|
+
@update:model-value="emitFormInput()"
|
|
85
|
+
@complete="onComplete"
|
|
86
|
+
>
|
|
87
|
+
<PinInputInput
|
|
88
|
+
v-for="(ids, index) in looseToNumber(props.length)"
|
|
89
|
+
:key="ids"
|
|
90
|
+
:index="index"
|
|
91
|
+
:class="ui.base({ class: props.ui?.base })"
|
|
92
|
+
v-bind="$attrs"
|
|
93
|
+
:disabled="disabled"
|
|
94
|
+
@blur="onBlur"
|
|
95
|
+
/>
|
|
96
|
+
</PinInputRoot>
|
|
97
|
+
</template>
|