@nuxt/ui 2.18.4 → 3.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -2
- package/cli/commands/init.mjs +83 -0
- package/cli/index.mjs +15 -0
- package/cli/node_modules/.ignored/citty/LICENSE +36 -0
- package/cli/node_modules/.ignored/citty/README.md +134 -0
- package/cli/node_modules/.ignored/citty/dist/index.cjs +475 -0
- package/cli/node_modules/.ignored/citty/dist/index.d.cts +80 -0
- package/cli/node_modules/.ignored/citty/dist/index.d.mts +80 -0
- package/cli/node_modules/.ignored/citty/dist/index.d.ts +80 -0
- package/cli/node_modules/.ignored/citty/dist/index.mjs +463 -0
- package/cli/node_modules/.ignored/citty/package.json +49 -0
- package/cli/node_modules/.ignored/consola/LICENSE +47 -0
- package/cli/node_modules/.ignored/consola/README.md +318 -0
- package/cli/node_modules/.ignored/consola/core.d.ts +1 -0
- package/cli/node_modules/.ignored/consola/dist/basic.cjs +32 -0
- package/cli/node_modules/.ignored/consola/dist/basic.d.ts +9 -0
- package/cli/node_modules/.ignored/consola/dist/basic.mjs +24 -0
- package/cli/node_modules/.ignored/consola/dist/browser.cjs +80 -0
- package/cli/node_modules/.ignored/consola/dist/browser.d.ts +7 -0
- package/cli/node_modules/.ignored/consola/dist/browser.mjs +72 -0
- package/cli/node_modules/.ignored/consola/dist/chunks/prompt.cjs +436 -0
- package/cli/node_modules/.ignored/consola/dist/chunks/prompt.mjs +429 -0
- package/cli/node_modules/.ignored/consola/dist/core.cjs +415 -0
- package/cli/node_modules/.ignored/consola/dist/core.d.ts +124 -0
- package/cli/node_modules/.ignored/consola/dist/core.mjs +410 -0
- package/cli/node_modules/.ignored/consola/dist/index.cjs +21 -0
- package/cli/node_modules/.ignored/consola/dist/index.d.ts +9 -0
- package/cli/node_modules/.ignored/consola/dist/index.mjs +8 -0
- package/cli/node_modules/.ignored/consola/dist/shared/consola.06ad8a64.mjs +62 -0
- package/cli/node_modules/.ignored/consola/dist/shared/consola.36c0034f.mjs +636 -0
- package/cli/node_modules/.ignored/consola/dist/shared/consola.4bbae468.cjs +645 -0
- package/cli/node_modules/.ignored/consola/dist/shared/consola.deac7d5a.cjs +65 -0
- package/cli/node_modules/.ignored/consola/dist/utils.cjs +308 -0
- package/cli/node_modules/.ignored/consola/dist/utils.d.ts +169 -0
- package/cli/node_modules/.ignored/consola/dist/utils.mjs +284 -0
- package/cli/node_modules/.ignored/consola/lib/index.cjs +9 -0
- package/cli/node_modules/.ignored/consola/package.json +101 -0
- package/cli/node_modules/.ignored/consola/utils.d.ts +1 -0
- package/cli/node_modules/.ignored/pathe/LICENSE +44 -0
- package/cli/node_modules/.ignored/pathe/README.md +69 -0
- package/cli/node_modules/.ignored/pathe/dist/index.cjs +23 -0
- package/cli/node_modules/.ignored/pathe/dist/index.d.cts +36 -0
- package/cli/node_modules/.ignored/pathe/dist/index.d.mts +36 -0
- package/cli/node_modules/.ignored/pathe/dist/index.d.ts +36 -0
- package/cli/node_modules/.ignored/pathe/dist/index.mjs +1 -0
- package/cli/node_modules/.ignored/pathe/dist/shared/pathe.1f0a373c.cjs +238 -0
- package/cli/node_modules/.ignored/pathe/dist/shared/pathe.ff20891b.mjs +221 -0
- package/cli/node_modules/.ignored/pathe/dist/utils.cjs +58 -0
- package/cli/node_modules/.ignored/pathe/dist/utils.d.cts +5 -0
- package/cli/node_modules/.ignored/pathe/dist/utils.d.mts +5 -0
- package/cli/node_modules/.ignored/pathe/dist/utils.d.ts +5 -0
- package/cli/node_modules/.ignored/pathe/dist/utils.mjs +54 -0
- package/cli/node_modules/.ignored/pathe/package.json +48 -0
- package/cli/node_modules/.ignored/pathe/utils.d.ts +1 -0
- package/cli/node_modules/.ignored/scule/LICENSE +21 -0
- package/cli/node_modules/.ignored/scule/README.md +149 -0
- package/cli/node_modules/.ignored/scule/dist/index.cjs +92 -0
- package/cli/node_modules/.ignored/scule/dist/index.d.cts +57 -0
- package/cli/node_modules/.ignored/scule/dist/index.d.mts +57 -0
- package/cli/node_modules/.ignored/scule/dist/index.d.ts +57 -0
- package/cli/node_modules/.ignored/scule/dist/index.mjs +80 -0
- package/cli/node_modules/.ignored/scule/package.json +43 -0
- package/cli/node_modules/.package-lock.json +33 -0
- package/cli/package.json +13 -0
- package/cli/templates.mjs +171 -0
- package/cli/utils.mjs +17 -0
- package/dist/module.d.mts +10 -26
- package/dist/module.d.ts +10 -26
- package/dist/module.json +4 -4
- package/dist/module.mjs +2574 -154
- package/dist/runtime/components/Accordion.vue +110 -0
- package/dist/runtime/components/Alert.vue +130 -0
- package/dist/runtime/components/App.vue +42 -0
- package/dist/runtime/components/Avatar.vue +69 -0
- package/dist/runtime/components/AvatarGroup.vue +98 -0
- package/dist/runtime/components/Badge.vue +46 -0
- package/dist/runtime/components/Breadcrumb.vue +98 -0
- package/dist/runtime/components/Button.vue +82 -0
- package/dist/runtime/components/ButtonGroup.vue +53 -0
- package/dist/runtime/components/Card.vue +52 -0
- package/dist/runtime/components/Checkbox.vue +128 -0
- package/dist/runtime/components/Chip.vue +76 -0
- package/dist/runtime/components/Collapsible.vue +54 -0
- package/dist/runtime/components/CommandPalette.vue +303 -0
- package/dist/runtime/components/Container.vue +36 -0
- package/dist/runtime/components/ContextMenu.vue +103 -0
- package/dist/runtime/components/ContextMenuContent.vue +122 -0
- package/dist/runtime/components/Drawer.vue +115 -0
- package/dist/runtime/components/DropdownMenu.vue +115 -0
- package/dist/runtime/components/DropdownMenuContent.vue +129 -0
- package/dist/runtime/components/Form.vue +227 -0
- package/dist/runtime/components/FormField.vue +107 -0
- package/dist/runtime/components/Icon.vue +26 -0
- package/dist/runtime/components/Input.vue +180 -0
- package/dist/runtime/components/InputMenu.vue +371 -0
- package/dist/runtime/components/Kbd.vue +49 -0
- package/dist/runtime/components/Link.vue +147 -0
- package/dist/runtime/components/LinkBase.vue +60 -0
- package/dist/runtime/components/Modal.vue +163 -0
- package/dist/runtime/components/ModalProvider.vue +12 -0
- package/dist/runtime/components/NavigationMenu.vue +195 -0
- package/dist/runtime/components/Pagination.vue +173 -0
- package/dist/runtime/components/Popover.vue +88 -0
- package/dist/runtime/components/Progress.vue +164 -0
- package/dist/runtime/components/RadioGroup.vue +159 -0
- package/dist/runtime/components/Select.vue +230 -0
- package/dist/runtime/components/SelectMenu.vue +306 -0
- package/dist/runtime/components/Separator.vue +82 -0
- package/dist/runtime/components/Skeleton.vue +31 -0
- package/dist/runtime/components/Slideover.vue +162 -0
- package/dist/runtime/components/SlideoverProvider.vue +12 -0
- package/dist/runtime/components/Slider.vue +113 -0
- package/dist/runtime/components/Switch.vue +124 -0
- package/dist/runtime/components/Tabs.vue +114 -0
- package/dist/runtime/components/Textarea.vue +189 -0
- package/dist/runtime/components/Toast.vue +161 -0
- package/dist/runtime/components/Toaster.vue +130 -0
- package/dist/runtime/components/Tooltip.vue +88 -0
- package/dist/runtime/composables/defineShortcuts.d.ts +7 -5
- package/dist/runtime/composables/defineShortcuts.js +94 -65
- package/dist/runtime/composables/useAvatarGroup.d.ts +10 -0
- package/dist/runtime/composables/useAvatarGroup.js +10 -0
- package/dist/runtime/composables/useButtonGroup.d.ts +12 -17
- package/dist/runtime/composables/useButtonGroup.js +6 -56
- package/dist/runtime/composables/useComponentIcons.d.ts +26 -0
- package/dist/runtime/composables/useComponentIcons.js +26 -0
- package/dist/runtime/composables/useFormField.d.ts +34 -0
- package/dist/runtime/composables/useFormField.js +54 -0
- package/dist/runtime/composables/useKbd.d.ts +28 -0
- package/dist/runtime/composables/useKbd.js +46 -0
- package/dist/runtime/composables/useModal.d.ts +8 -4
- package/dist/runtime/composables/useModal.js +1 -0
- package/dist/runtime/composables/useSlideover.d.ts +9 -5
- package/dist/runtime/composables/useSlideover.js +3 -2
- package/dist/runtime/composables/useToast.d.ts +9 -17
- package/dist/runtime/composables/useToast.js +27 -13
- package/dist/runtime/index.css +1 -0
- package/dist/runtime/plugins/colors.js +9 -17
- package/dist/runtime/plugins/{slideovers.js → slideover.js} +3 -3
- package/dist/runtime/types/app.config.d.ts +6 -0
- package/dist/runtime/types/component.d.ts +17 -14
- package/dist/runtime/types/component.js +0 -0
- package/dist/runtime/types/form.d.ts +62 -32
- package/dist/runtime/types/form.js +12 -0
- package/dist/runtime/types/index.d.ts +41 -30
- package/dist/runtime/types/index.js +42 -31
- package/dist/runtime/types/utils.d.ts +13 -32
- package/dist/runtime/types/utils.js +0 -0
- package/dist/runtime/utils/form.d.ts +15 -0
- package/dist/runtime/utils/form.js +66 -0
- package/dist/runtime/utils/fuse.d.ts +4 -0
- package/dist/runtime/utils/fuse.js +63 -0
- package/dist/runtime/utils/index.d.ts +4 -10
- package/dist/runtime/utils/index.js +40 -60
- package/dist/runtime/utils/link.d.ts +26 -71
- package/dist/runtime/utils/link.js +4 -124
- package/package.json +50 -49
- package/dist/runtime/components/data/Table.vue +0 -355
- package/dist/runtime/components/data/Table.vue.d.ts +0 -439
- package/dist/runtime/components/elements/Accordion.vue +0 -185
- package/dist/runtime/components/elements/Accordion.vue.d.ts +0 -223
- package/dist/runtime/components/elements/Alert.vue +0 -139
- package/dist/runtime/components/elements/Alert.vue.d.ts +0 -194
- package/dist/runtime/components/elements/Avatar.vue +0 -160
- package/dist/runtime/components/elements/Avatar.vue.d.ts +0 -255
- package/dist/runtime/components/elements/AvatarGroup.d.ts +0 -56
- package/dist/runtime/components/elements/AvatarGroup.js +0 -58
- package/dist/runtime/components/elements/Badge.vue +0 -75
- package/dist/runtime/components/elements/Badge.vue.d.ts +0 -109
- package/dist/runtime/components/elements/Button.vue +0 -193
- package/dist/runtime/components/elements/Button.vue.d.ts +0 -504
- package/dist/runtime/components/elements/ButtonGroup.d.ts +0 -153
- package/dist/runtime/components/elements/ButtonGroup.js +0 -51
- package/dist/runtime/components/elements/Carousel.vue +0 -165
- package/dist/runtime/components/elements/Carousel.vue.d.ts +0 -159
- package/dist/runtime/components/elements/Chip.vue +0 -85
- package/dist/runtime/components/elements/Chip.vue.d.ts +0 -162
- package/dist/runtime/components/elements/Dropdown.vue +0 -254
- package/dist/runtime/components/elements/Dropdown.vue.d.ts +0 -254
- package/dist/runtime/components/elements/Icon.vue +0 -30
- package/dist/runtime/components/elements/Icon.vue.d.ts +0 -47
- package/dist/runtime/components/elements/Kbd.vue +0 -59
- package/dist/runtime/components/elements/Kbd.vue.d.ts +0 -86
- package/dist/runtime/components/elements/Link.vue +0 -95
- package/dist/runtime/components/elements/Link.vue.d.ts +0 -225
- package/dist/runtime/components/elements/Meter.vue +0 -170
- package/dist/runtime/components/elements/Meter.vue.d.ts +0 -279
- package/dist/runtime/components/elements/MeterGroup.d.ts +0 -135
- package/dist/runtime/components/elements/MeterGroup.js +0 -159
- package/dist/runtime/components/elements/Progress.vue +0 -203
- package/dist/runtime/components/elements/Progress.vue.d.ts +0 -280
- package/dist/runtime/components/forms/Checkbox.vue +0 -143
- package/dist/runtime/components/forms/Checkbox.vue.d.ts +0 -179
- package/dist/runtime/components/forms/Form.vue +0 -219
- package/dist/runtime/components/forms/Form.vue.d.ts +0 -53
- package/dist/runtime/components/forms/FormGroup.vue +0 -128
- package/dist/runtime/components/forms/FormGroup.vue.d.ts +0 -169
- package/dist/runtime/components/forms/Input.vue +0 -300
- package/dist/runtime/components/forms/Input.vue.d.ts +0 -482
- package/dist/runtime/components/forms/InputMenu.vue +0 -439
- package/dist/runtime/components/forms/InputMenu.vue.d.ts +0 -700
- package/dist/runtime/components/forms/Radio.vue +0 -140
- package/dist/runtime/components/forms/Radio.vue.d.ts +0 -168
- package/dist/runtime/components/forms/RadioGroup.vue +0 -145
- package/dist/runtime/components/forms/RadioGroup.vue.d.ts +0 -176
- package/dist/runtime/components/forms/Range.vue +0 -173
- package/dist/runtime/components/forms/Range.vue.d.ts +0 -268
- package/dist/runtime/components/forms/Select.vue +0 -322
- package/dist/runtime/components/forms/Select.vue.d.ts +0 -471
- package/dist/runtime/components/forms/SelectMenu.vue +0 -546
- package/dist/runtime/components/forms/SelectMenu.vue.d.ts +0 -754
- package/dist/runtime/components/forms/Textarea.vue +0 -231
- package/dist/runtime/components/forms/Textarea.vue.d.ts +0 -436
- package/dist/runtime/components/forms/Toggle.vue +0 -171
- package/dist/runtime/components/forms/Toggle.vue.d.ts +0 -262
- package/dist/runtime/components/layout/Card.vue +0 -63
- package/dist/runtime/components/layout/Card.vue.d.ts +0 -89
- package/dist/runtime/components/layout/Container.vue +0 -48
- package/dist/runtime/components/layout/Container.vue.d.ts +0 -53
- package/dist/runtime/components/layout/Divider.vue +0 -108
- package/dist/runtime/components/layout/Divider.vue.d.ts +0 -198
- package/dist/runtime/components/layout/Skeleton.vue +0 -46
- package/dist/runtime/components/layout/Skeleton.vue.d.ts +0 -53
- package/dist/runtime/components/navigation/Breadcrumb.vue +0 -82
- package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +0 -95
- package/dist/runtime/components/navigation/CommandPalette.vue +0 -345
- package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +0 -390
- package/dist/runtime/components/navigation/CommandPaletteGroup.vue +0 -152
- package/dist/runtime/components/navigation/CommandPaletteGroup.vue.d.ts +0 -60
- package/dist/runtime/components/navigation/HorizontalNavigation.vue +0 -102
- package/dist/runtime/components/navigation/HorizontalNavigation.vue.d.ts +0 -99
- package/dist/runtime/components/navigation/Pagination.vue +0 -270
- package/dist/runtime/components/navigation/Pagination.vue.d.ts +0 -260
- package/dist/runtime/components/navigation/Tabs.vue +0 -163
- package/dist/runtime/components/navigation/Tabs.vue.d.ts +0 -165
- package/dist/runtime/components/navigation/VerticalNavigation.vue +0 -105
- package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +0 -113
- package/dist/runtime/components/overlays/ContextMenu.vue +0 -85
- package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +0 -126
- package/dist/runtime/components/overlays/Modal.vue +0 -122
- package/dist/runtime/components/overlays/Modal.vue.d.ts +0 -166
- package/dist/runtime/components/overlays/Modals.client.vue +0 -18
- package/dist/runtime/components/overlays/Notification.vue +0 -212
- package/dist/runtime/components/overlays/Notification.vue.d.ts +0 -235
- package/dist/runtime/components/overlays/Notifications.vue +0 -69
- package/dist/runtime/components/overlays/Notifications.vue.d.ts +0 -66
- package/dist/runtime/components/overlays/Popover.vue +0 -213
- package/dist/runtime/components/overlays/Popover.vue.d.ts +0 -220
- package/dist/runtime/components/overlays/Slideover.vue +0 -152
- package/dist/runtime/components/overlays/Slideover.vue.d.ts +0 -167
- package/dist/runtime/components/overlays/Slideovers.client.vue +0 -18
- package/dist/runtime/components/overlays/Tooltip.vue +0 -127
- package/dist/runtime/components/overlays/Tooltip.vue.d.ts +0 -165
- package/dist/runtime/composables/useCarouselScroll.d.ts +0 -2
- package/dist/runtime/composables/useCarouselScroll.js +0 -37
- package/dist/runtime/composables/useCopyToClipboard.d.ts +0 -10
- package/dist/runtime/composables/useCopyToClipboard.js +0 -26
- package/dist/runtime/composables/useFormGroup.d.ts +0 -18
- package/dist/runtime/composables/useFormGroup.js +0 -45
- package/dist/runtime/composables/usePopper.d.ts +0 -268
- package/dist/runtime/composables/usePopper.js +0 -94
- package/dist/runtime/composables/useShortcuts.d.ts +0 -12
- package/dist/runtime/composables/useShortcuts.js +0 -26
- package/dist/runtime/composables/useTimer.d.ts +0 -8
- package/dist/runtime/composables/useTimer.js +0 -51
- package/dist/runtime/composables/useUI.d.ts +0 -10
- package/dist/runtime/composables/useUI.js +0 -24
- package/dist/runtime/types/accordion.d.ts +0 -9
- package/dist/runtime/types/alert.d.ts +0 -12
- package/dist/runtime/types/avatar.d.ts +0 -17
- package/dist/runtime/types/badge.d.ts +0 -15
- package/dist/runtime/types/breadcrumb.d.ts +0 -10
- package/dist/runtime/types/button.d.ts +0 -31
- package/dist/runtime/types/chip.d.ts +0 -15
- package/dist/runtime/types/clipboard.d.ts +0 -3
- package/dist/runtime/types/command-palette.d.ts +0 -29
- package/dist/runtime/types/divider.d.ts +0 -3
- package/dist/runtime/types/dropdown.d.ts +0 -15
- package/dist/runtime/types/form-group.d.ts +0 -5
- package/dist/runtime/types/horizontal-navigation.d.ts +0 -13
- package/dist/runtime/types/input.d.ts +0 -8
- package/dist/runtime/types/kbd.d.ts +0 -5
- package/dist/runtime/types/link.d.ts +0 -12
- package/dist/runtime/types/meter.d.ts +0 -5
- package/dist/runtime/types/modal.d.ts +0 -18
- package/dist/runtime/types/notification.d.ts +0 -24
- package/dist/runtime/types/popper.d.ts +0 -17
- package/dist/runtime/types/progress.d.ts +0 -6
- package/dist/runtime/types/range.d.ts +0 -7
- package/dist/runtime/types/select.d.ts +0 -8
- package/dist/runtime/types/slideover.d.ts +0 -16
- package/dist/runtime/types/tabs.d.ts +0 -8
- package/dist/runtime/types/textarea.d.ts +0 -8
- package/dist/runtime/types/toggle.d.ts +0 -7
- package/dist/runtime/types/tooltip.d.ts +0 -7
- package/dist/runtime/types/vertical-navigation.d.ts +0 -13
- package/dist/runtime/ui.config/data/table.d.ts +0 -81
- package/dist/runtime/ui.config/data/table.js +0 -80
- package/dist/runtime/ui.config/elements/accordion.d.ts +0 -23
- package/dist/runtime/ui.config/elements/accordion.js +0 -22
- package/dist/runtime/ui.config/elements/alert.d.ts +0 -41
- package/dist/runtime/ui.config/elements/alert.js +0 -40
- package/dist/runtime/ui.config/elements/avatar.d.ts +0 -60
- package/dist/runtime/ui.config/elements/avatar.js +0 -59
- package/dist/runtime/ui.config/elements/avatarGroup.d.ts +0 -6
- package/dist/runtime/ui.config/elements/avatarGroup.js +0 -5
- package/dist/runtime/ui.config/elements/badge.d.ts +0 -34
- package/dist/runtime/ui.config/elements/badge.js +0 -33
- package/dist/runtime/ui.config/elements/button.d.ts +0 -81
- package/dist/runtime/ui.config/elements/button.js +0 -80
- package/dist/runtime/ui.config/elements/buttonGroup.d.ts +0 -101
- package/dist/runtime/ui.config/elements/buttonGroup.js +0 -19
- package/dist/runtime/ui.config/elements/carousel.d.ts +0 -27
- package/dist/runtime/ui.config/elements/carousel.js +0 -26
- package/dist/runtime/ui.config/elements/chip.d.ts +0 -35
- package/dist/runtime/ui.config/elements/chip.js +0 -34
- package/dist/runtime/ui.config/elements/dropdown.d.ts +0 -59
- package/dist/runtime/ui.config/elements/dropdown.js +0 -57
- package/dist/runtime/ui.config/elements/kbd.d.ts +0 -17
- package/dist/runtime/ui.config/elements/kbd.js +0 -16
- package/dist/runtime/ui.config/elements/meter.d.ts +0 -77
- package/dist/runtime/ui.config/elements/meter.js +0 -76
- package/dist/runtime/ui.config/elements/meterGroup.d.ts +0 -52
- package/dist/runtime/ui.config/elements/meterGroup.js +0 -24
- package/dist/runtime/ui.config/elements/progress.d.ts +0 -75
- package/dist/runtime/ui.config/elements/progress.js +0 -74
- package/dist/runtime/ui.config/forms/checkbox.d.ts +0 -19
- package/dist/runtime/ui.config/forms/checkbox.js +0 -18
- package/dist/runtime/ui.config/forms/formGroup.d.ts +0 -26
- package/dist/runtime/ui.config/forms/formGroup.js +0 -26
- package/dist/runtime/ui.config/forms/input.d.ts +0 -110
- package/dist/runtime/ui.config/forms/input.js +0 -109
- package/dist/runtime/ui.config/forms/inputMenu.d.ts +0 -64
- package/dist/runtime/ui.config/forms/inputMenu.js +0 -62
- package/dist/runtime/ui.config/forms/radio.d.ts +0 -18
- package/dist/runtime/ui.config/forms/radio.js +0 -17
- package/dist/runtime/ui.config/forms/radioGroup.d.ts +0 -9
- package/dist/runtime/ui.config/forms/radioGroup.js +0 -8
- package/dist/runtime/ui.config/forms/range.d.ts +0 -64
- package/dist/runtime/ui.config/forms/range.js +0 -63
- package/dist/runtime/ui.config/forms/select.d.ts +0 -111
- package/dist/runtime/ui.config/forms/select.js +0 -13
- package/dist/runtime/ui.config/forms/selectMenu.d.ts +0 -70
- package/dist/runtime/ui.config/forms/selectMenu.js +0 -32
- package/dist/runtime/ui.config/forms/textarea.d.ts +0 -109
- package/dist/runtime/ui.config/forms/textarea.js +0 -10
- package/dist/runtime/ui.config/forms/toggle.d.ts +0 -63
- package/dist/runtime/ui.config/forms/toggle.js +0 -62
- package/dist/runtime/ui.config/index.d.ts +0 -43
- package/dist/runtime/ui.config/index.js +0 -43
- package/dist/runtime/ui.config/layout/card.d.ts +0 -24
- package/dist/runtime/ui.config/layout/card.js +0 -23
- package/dist/runtime/ui.config/layout/container.d.ts +0 -6
- package/dist/runtime/ui.config/layout/container.js +0 -5
- package/dist/runtime/ui.config/layout/divider.d.ts +0 -52
- package/dist/runtime/ui.config/layout/divider.js +0 -51
- package/dist/runtime/ui.config/layout/skeleton.d.ts +0 -6
- package/dist/runtime/ui.config/layout/skeleton.js +0 -5
- package/dist/runtime/ui.config/navigation/breadcrumb.d.ts +0 -21
- package/dist/runtime/ui.config/navigation/breadcrumb.js +0 -20
- package/dist/runtime/ui.config/navigation/commandPalette.d.ts +0 -72
- package/dist/runtime/ui.config/navigation/commandPalette.js +0 -71
- package/dist/runtime/ui.config/navigation/horizontalNavigation.d.ts +0 -27
- package/dist/runtime/ui.config/navigation/horizontalNavigation.js +0 -26
- package/dist/runtime/ui.config/navigation/pagination.d.ts +0 -35
- package/dist/runtime/ui.config/navigation/pagination.js +0 -34
- package/dist/runtime/ui.config/navigation/tabs.d.ts +0 -35
- package/dist/runtime/ui.config/navigation/tabs.js +0 -34
- package/dist/runtime/ui.config/navigation/verticalNavigation.d.ts +0 -34
- package/dist/runtime/ui.config/navigation/verticalNavigation.js +0 -33
- package/dist/runtime/ui.config/overlays/contextMenu.d.ts +0 -31
- package/dist/runtime/ui.config/overlays/contextMenu.js +0 -25
- package/dist/runtime/ui.config/overlays/modal.d.ts +0 -36
- package/dist/runtime/ui.config/overlays/modal.js +0 -37
- package/dist/runtime/ui.config/overlays/notification.d.ts +0 -50
- package/dist/runtime/ui.config/overlays/notification.js +0 -50
- package/dist/runtime/ui.config/overlays/notifications.d.ts +0 -7
- package/dist/runtime/ui.config/overlays/notifications.js +0 -6
- package/dist/runtime/ui.config/overlays/popover.d.ts +0 -47
- package/dist/runtime/ui.config/overlays/popover.js +0 -41
- package/dist/runtime/ui.config/overlays/slideover.d.ts +0 -35
- package/dist/runtime/ui.config/overlays/slideover.js +0 -36
- package/dist/runtime/ui.config/overlays/tooltip.d.ts +0 -37
- package/dist/runtime/ui.config/overlays/tooltip.js +0 -34
- package/dist/runtime/ui.config/popper.d.ts +0 -8
- package/dist/runtime/ui.config/popper.js +0 -9
- package/dist/runtime/ui.css +0 -1
- package/dist/runtime/utils/colors.d.ts +0 -11
- package/dist/runtime/utils/colors.js +0 -307
- package/dist/runtime/utils/lodash.d.ts +0 -2
- package/dist/runtime/utils/lodash.js +0 -23
- package/dist/runtime/plugins/{modals.d.ts → modal.d.ts} +0 -0
- package/dist/runtime/plugins/{modals.js → modal.js} +1 -1
- /package/dist/runtime/plugins/{slideovers.d.ts → slideover.d.ts} +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { tv } from 'tailwind-variants'
|
|
3
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
4
|
+
import _appConfig from '#build/app.config'
|
|
5
|
+
import theme from '#build/ui/container'
|
|
6
|
+
|
|
7
|
+
const appConfig = _appConfig as AppConfig & { ui: { container: Partial<typeof theme> } }
|
|
8
|
+
|
|
9
|
+
const container = tv({ extend: tv(theme), ...(appConfig.ui?.container || {}) })
|
|
10
|
+
|
|
11
|
+
export interface ContainerProps {
|
|
12
|
+
/**
|
|
13
|
+
* The element or component this component should render as.
|
|
14
|
+
* @defaultValue 'div'
|
|
15
|
+
*/
|
|
16
|
+
as?: any
|
|
17
|
+
class?: any
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ContainerSlots {
|
|
21
|
+
default(props?: {}): any
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<script setup lang="ts">
|
|
26
|
+
import { Primitive } from 'radix-vue'
|
|
27
|
+
|
|
28
|
+
const props = defineProps<ContainerProps>()
|
|
29
|
+
defineSlots<ContainerSlots>()
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<template>
|
|
33
|
+
<Primitive :as="as" :class="container({ class: props.class })">
|
|
34
|
+
<slot />
|
|
35
|
+
</Primitive>
|
|
36
|
+
</template>
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { tv, type VariantProps } from 'tailwind-variants'
|
|
3
|
+
import type { ContextMenuRootProps, ContextMenuRootEmits, ContextMenuContentProps, ContextMenuTriggerProps, ContextMenuItemProps } from 'radix-vue'
|
|
4
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
5
|
+
import _appConfig from '#build/app.config'
|
|
6
|
+
import theme from '#build/ui/context-menu'
|
|
7
|
+
import type { AvatarProps, KbdProps, LinkProps } from '../types'
|
|
8
|
+
import type { DynamicSlots } from '../types/utils'
|
|
9
|
+
|
|
10
|
+
const appConfig = _appConfig as AppConfig & { ui: { contextMenu: Partial<typeof theme> } }
|
|
11
|
+
|
|
12
|
+
const contextMenu = tv({ extend: tv(theme), ...(appConfig.ui?.contextMenu || {}) })
|
|
13
|
+
|
|
14
|
+
export interface ContextMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'custom'>, Pick<ContextMenuItemProps, 'disabled'> {
|
|
15
|
+
label?: string
|
|
16
|
+
icon?: string
|
|
17
|
+
avatar?: AvatarProps
|
|
18
|
+
content?: Omit<ContextMenuContentProps, 'as' | 'asChild' | 'forceMount'>
|
|
19
|
+
kbds?: KbdProps['value'][] | KbdProps[]
|
|
20
|
+
/**
|
|
21
|
+
* The item type.
|
|
22
|
+
* @defaultValue 'link'
|
|
23
|
+
*/
|
|
24
|
+
type?: 'label' | 'separator' | 'link'
|
|
25
|
+
slot?: string
|
|
26
|
+
open?: boolean
|
|
27
|
+
defaultOpen?: boolean
|
|
28
|
+
children?: ContextMenuItem[] | ContextMenuItem[][]
|
|
29
|
+
select?(e: Event): void
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
type ContextMenuVariants = VariantProps<typeof contextMenu>
|
|
33
|
+
|
|
34
|
+
export interface ContextMenuProps<T> extends Omit<ContextMenuRootProps, 'dir'>, Pick<ContextMenuTriggerProps, 'disabled'> {
|
|
35
|
+
size?: ContextMenuVariants['size']
|
|
36
|
+
items?: T[] | T[][]
|
|
37
|
+
/** The content of the menu. */
|
|
38
|
+
content?: Omit<ContextMenuContentProps, 'as' | 'asChild' | 'forceMount'>
|
|
39
|
+
/**
|
|
40
|
+
* Render the menu in a portal.
|
|
41
|
+
* @defaultValue true
|
|
42
|
+
*/
|
|
43
|
+
portal?: boolean
|
|
44
|
+
class?: any
|
|
45
|
+
ui?: Partial<typeof contextMenu.slots>
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface ContextMenuEmits extends ContextMenuRootEmits {}
|
|
49
|
+
|
|
50
|
+
type SlotProps<T> = (props: { item: T, active?: boolean, index: number }) => any
|
|
51
|
+
|
|
52
|
+
export type ContextMenuSlots<T extends { slot?: string }> = {
|
|
53
|
+
'default'(props?: {}): any
|
|
54
|
+
'item': SlotProps<T>
|
|
55
|
+
'item-leading': SlotProps<T>
|
|
56
|
+
'item-label': SlotProps<T>
|
|
57
|
+
'item-trailing': SlotProps<T>
|
|
58
|
+
} & DynamicSlots<T, SlotProps<T>>
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<script setup lang="ts" generic="T extends ContextMenuItem">
|
|
62
|
+
import { computed, toRef } from 'vue'
|
|
63
|
+
import { ContextMenuRoot, ContextMenuTrigger, useForwardPropsEmits } from 'radix-vue'
|
|
64
|
+
import { reactivePick } from '@vueuse/core'
|
|
65
|
+
import UContextMenuContent from './ContextMenuContent.vue'
|
|
66
|
+
import { omit } from '../utils'
|
|
67
|
+
|
|
68
|
+
const props = withDefaults(defineProps<ContextMenuProps<T>>(), {
|
|
69
|
+
portal: true,
|
|
70
|
+
modal: true
|
|
71
|
+
})
|
|
72
|
+
const emits = defineEmits<ContextMenuEmits>()
|
|
73
|
+
const slots = defineSlots<ContextMenuSlots<T>>()
|
|
74
|
+
|
|
75
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, 'modal'), emits)
|
|
76
|
+
const contentProps = toRef(() => props.content as ContextMenuContentProps)
|
|
77
|
+
const proxySlots = omit(slots, ['default']) as Record<string, ContextMenuSlots<T>[string]>
|
|
78
|
+
|
|
79
|
+
const ui = computed(() => contextMenu({
|
|
80
|
+
size: props.size
|
|
81
|
+
}))
|
|
82
|
+
</script>
|
|
83
|
+
|
|
84
|
+
<template>
|
|
85
|
+
<ContextMenuRoot v-bind="rootProps">
|
|
86
|
+
<ContextMenuTrigger v-if="!!slots.default" as-child :disabled="disabled">
|
|
87
|
+
<slot />
|
|
88
|
+
</ContextMenuTrigger>
|
|
89
|
+
|
|
90
|
+
<UContextMenuContent
|
|
91
|
+
:class="ui.content({ class: [props.class, props.ui?.content] })"
|
|
92
|
+
:ui="ui"
|
|
93
|
+
:ui-override="props.ui"
|
|
94
|
+
v-bind="contentProps"
|
|
95
|
+
:items="items"
|
|
96
|
+
:portal="portal"
|
|
97
|
+
>
|
|
98
|
+
<template v-for="(_, name) in proxySlots" #[name]="slotData: any">
|
|
99
|
+
<slot :name="name" v-bind="slotData" />
|
|
100
|
+
</template>
|
|
101
|
+
</UContextMenuContent>
|
|
102
|
+
</ContextMenuRoot>
|
|
103
|
+
</template>
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { tv } from 'tailwind-variants'
|
|
3
|
+
import type { ContextMenuContentProps as RadixContextMenuContentProps, ContextMenuContentEmits as RadixContextMenuContentEmits } from 'radix-vue'
|
|
4
|
+
import theme from '#build/ui/context-menu'
|
|
5
|
+
import type { KbdProps, AvatarProps, ContextMenuItem, ContextMenuSlots } from '../types'
|
|
6
|
+
|
|
7
|
+
const _contextMenu = tv(theme)()
|
|
8
|
+
|
|
9
|
+
interface ContextMenuContentProps<T> extends Omit<RadixContextMenuContentProps, 'as' | 'asChild' | 'forceMount'> {
|
|
10
|
+
items?: T[] | T[][]
|
|
11
|
+
portal?: boolean
|
|
12
|
+
sub?: boolean
|
|
13
|
+
class?: any
|
|
14
|
+
ui: typeof _contextMenu
|
|
15
|
+
uiOverride?: any
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface ContextMenuContentEmits extends RadixContextMenuContentEmits {}
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<script setup lang="ts" generic="T extends ContextMenuItem">
|
|
22
|
+
import { computed } from 'vue'
|
|
23
|
+
import { ContextMenu } from 'radix-vue/namespaced'
|
|
24
|
+
import { useForwardPropsEmits } from 'radix-vue'
|
|
25
|
+
import { reactiveOmit, createReusableTemplate } from '@vueuse/core'
|
|
26
|
+
import { useAppConfig } from '#imports'
|
|
27
|
+
import ULinkBase from './LinkBase.vue'
|
|
28
|
+
import ULink from './Link.vue'
|
|
29
|
+
import UAvatar from './Avatar.vue'
|
|
30
|
+
import UIcon from './Icon.vue'
|
|
31
|
+
import UKbd from './Kbd.vue'
|
|
32
|
+
import { omit } from '../utils'
|
|
33
|
+
import { pickLinkProps } from '../utils/link'
|
|
34
|
+
|
|
35
|
+
const props = defineProps<ContextMenuContentProps<T>>()
|
|
36
|
+
const emits = defineEmits<ContextMenuContentEmits>()
|
|
37
|
+
const slots = defineSlots<ContextMenuSlots<T>>()
|
|
38
|
+
|
|
39
|
+
const appConfig = useAppConfig()
|
|
40
|
+
const contentProps = useForwardPropsEmits(reactiveOmit(props, 'sub', 'items', 'portal', 'class', 'ui'), emits)
|
|
41
|
+
const proxySlots = omit(slots, ['default']) as Record<string, ContextMenuSlots<T>[string]>
|
|
42
|
+
|
|
43
|
+
const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate<{ item: ContextMenuItem, active?: boolean, index: number }>()
|
|
44
|
+
|
|
45
|
+
const groups = computed(() => props.items?.length ? (Array.isArray(props.items[0]) ? props.items : [props.items]) as T[][] : [])
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<template>
|
|
49
|
+
<DefineItemTemplate v-slot="{ item, active, index }">
|
|
50
|
+
<slot :name="item.slot || 'item'" :item="(item as T)" :index="index">
|
|
51
|
+
<slot :name="item.slot ? `${item.slot}-leading`: 'item-leading'" :item="(item as T)" :active="active" :index="index">
|
|
52
|
+
<UAvatar v-if="item.avatar" :size="((props.uiOverride?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()) as AvatarProps['size'])" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: uiOverride?.itemLeadingAvatar, active })" />
|
|
53
|
+
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: uiOverride?.itemLeadingIcon, active })" />
|
|
54
|
+
</slot>
|
|
55
|
+
|
|
56
|
+
<span v-if="item.label || !!slots[item.slot ? `${item.slot}-label`: 'item-label']" :class="ui.itemLabel({ class: uiOverride?.itemLabel, active })">
|
|
57
|
+
<slot :name="item.slot ? `${item.slot}-label`: 'item-label'" :item="(item as T)" :active="active" :index="index">
|
|
58
|
+
{{ item.label }}
|
|
59
|
+
</slot>
|
|
60
|
+
|
|
61
|
+
<UIcon v-if="item.target === '_blank'" :name="appConfig.ui.icons.external" :class="ui.itemLabelExternalIcon({ class: uiOverride?.itemLabelExternalIcon, active })" />
|
|
62
|
+
</span>
|
|
63
|
+
|
|
64
|
+
<span v-if="item.children?.length || item.kbds?.length || !!slots[item.slot ? `${item.slot}-trailing`: 'item-trailing']" :class="ui.itemTrailing({ class: uiOverride?.itemTrailing })">
|
|
65
|
+
<slot :name="item.slot ? `${item.slot}-trailing`: 'item-trailing'" :item="(item as T)" :active="active" :index="index">
|
|
66
|
+
<UIcon v-if="item.children?.length" :name="appConfig.ui.icons.chevronRight" :class="ui.itemTrailingIcon({ class: uiOverride?.itemTrailingIcon, active })" />
|
|
67
|
+
<span v-else-if="item.kbds?.length" :class="ui.itemTrailingKbds({ class: uiOverride?.itemTrailingKbds })">
|
|
68
|
+
<UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="((props.uiOverride?.itemTrailingKbdsSize || ui.itemTrailingKbdsSize()) as KbdProps['size'])" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
69
|
+
</span>
|
|
70
|
+
</slot>
|
|
71
|
+
</span>
|
|
72
|
+
</slot>
|
|
73
|
+
</DefineItemTemplate>
|
|
74
|
+
|
|
75
|
+
<ContextMenu.Portal :disabled="!portal">
|
|
76
|
+
<component :is="sub ? ContextMenu.SubContent : ContextMenu.Content" :class="props.class" v-bind="contentProps">
|
|
77
|
+
<ContextMenu.Group v-for="(group, groupIndex) in groups" :key="`group-${groupIndex}`" :class="ui.group({ class: uiOverride?.group })">
|
|
78
|
+
<template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
|
|
79
|
+
<ContextMenu.Label v-if="item.type === 'label'" :class="ui.label({ class: uiOverride?.label })">
|
|
80
|
+
<ReuseItemTemplate :item="item" :index="index" />
|
|
81
|
+
</ContextMenu.Label>
|
|
82
|
+
<ContextMenu.Separator v-else-if="item.type === 'separator'" :class="ui.separator({ class: uiOverride?.separator })" />
|
|
83
|
+
<ContextMenu.Sub v-else-if="item?.children?.length" :open="item.open" :default-open="item.defaultOpen">
|
|
84
|
+
<ContextMenu.SubTrigger
|
|
85
|
+
as="button"
|
|
86
|
+
type="button"
|
|
87
|
+
:disabled="item.disabled"
|
|
88
|
+
:text-value="item.label"
|
|
89
|
+
:class="ui.item({ class: uiOverride?.item })"
|
|
90
|
+
>
|
|
91
|
+
<ReuseItemTemplate :item="item" :index="index" />
|
|
92
|
+
</ContextMenu.SubTrigger>
|
|
93
|
+
|
|
94
|
+
<UContextMenuContent
|
|
95
|
+
sub
|
|
96
|
+
:class="props.class"
|
|
97
|
+
:ui="ui"
|
|
98
|
+
:ui-override="uiOverride"
|
|
99
|
+
:portal="portal"
|
|
100
|
+
:items="item.children"
|
|
101
|
+
:align-offset="-4"
|
|
102
|
+
v-bind="item.content"
|
|
103
|
+
>
|
|
104
|
+
<template v-for="(_, name) in proxySlots" #[name]="slotData: any">
|
|
105
|
+
<slot :name="name" v-bind="slotData" />
|
|
106
|
+
</template>
|
|
107
|
+
</UContextMenuContent>
|
|
108
|
+
</ContextMenu.Sub>
|
|
109
|
+
<ContextMenu.Item v-else as-child :disabled="item.disabled" :text-value="item.label" @select="item.select">
|
|
110
|
+
<ULink v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item as Omit<ContextMenuItem, 'type'>)" custom>
|
|
111
|
+
<ULinkBase v-bind="slotProps" :class="ui.item({ class: [uiOverride?.item, item.class], active })">
|
|
112
|
+
<ReuseItemTemplate :item="item" :active="active" :index="index" />
|
|
113
|
+
</ULinkBase>
|
|
114
|
+
</ULink>
|
|
115
|
+
</ContextMenu.Item>
|
|
116
|
+
</template>
|
|
117
|
+
</ContextMenu.Group>
|
|
118
|
+
|
|
119
|
+
<slot />
|
|
120
|
+
</component>
|
|
121
|
+
</ContextMenu.Portal>
|
|
122
|
+
</template>
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { tv } from 'tailwind-variants'
|
|
3
|
+
import type { DrawerRootProps, DrawerRootEmits } from 'vaul-vue'
|
|
4
|
+
import type { DialogContentProps } from 'radix-vue'
|
|
5
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
6
|
+
import _appConfig from '#build/app.config'
|
|
7
|
+
import theme from '#build/ui/drawer'
|
|
8
|
+
|
|
9
|
+
const appConfig = _appConfig as AppConfig & { ui: { drawer: Partial<typeof theme> } }
|
|
10
|
+
|
|
11
|
+
const drawer = tv({ extend: tv(theme), ...(appConfig.ui?.drawer || {}) })
|
|
12
|
+
|
|
13
|
+
export interface DrawerProps extends Pick<DrawerRootProps, 'activeSnapPoint' | 'closeThreshold' | 'defaultOpen' | 'direction' | 'dismissible' | 'fadeFromIndex' | 'fixed' | 'modal' | 'nested' | 'open' | 'scrollLockTimeout' | 'shouldScaleBackground' | 'snapPoints'> {
|
|
14
|
+
/**
|
|
15
|
+
* The element or component this component should render as.
|
|
16
|
+
* @defaultValue 'div'
|
|
17
|
+
*/
|
|
18
|
+
as?: any
|
|
19
|
+
title?: string
|
|
20
|
+
description?: string
|
|
21
|
+
/** The content of the drawer. */
|
|
22
|
+
content?: Omit<DialogContentProps, 'as' | 'asChild' | 'forceMount'>
|
|
23
|
+
/**
|
|
24
|
+
* Render an overlay behind the drawer.
|
|
25
|
+
* @defaultValue true
|
|
26
|
+
*/
|
|
27
|
+
overlay?: boolean
|
|
28
|
+
/**
|
|
29
|
+
* Render the drawer in a portal.
|
|
30
|
+
* @defaultValue true
|
|
31
|
+
*/
|
|
32
|
+
portal?: boolean
|
|
33
|
+
class?: any
|
|
34
|
+
ui?: Partial<typeof drawer.slots>
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface DrawerEmits extends DrawerRootEmits {}
|
|
38
|
+
|
|
39
|
+
export interface DrawerSlots {
|
|
40
|
+
default(props?: {}): any
|
|
41
|
+
handle(props?: {}): any
|
|
42
|
+
content(props?: {}): any
|
|
43
|
+
header(props?: {}): any
|
|
44
|
+
title(props?: {}): any
|
|
45
|
+
description(props?: {}): any
|
|
46
|
+
body(props?: {}): any
|
|
47
|
+
footer(props?: {}): any
|
|
48
|
+
}
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<script setup lang="ts">
|
|
52
|
+
import { toRef } from 'vue'
|
|
53
|
+
import { useForwardPropsEmits } from 'radix-vue'
|
|
54
|
+
import { DrawerRoot, DrawerTrigger, DrawerPortal, DrawerOverlay, DrawerContent, DrawerTitle, DrawerDescription } from 'vaul-vue'
|
|
55
|
+
import { reactivePick } from '@vueuse/core'
|
|
56
|
+
|
|
57
|
+
const props = withDefaults(defineProps<DrawerProps>(), {
|
|
58
|
+
portal: true,
|
|
59
|
+
overlay: true
|
|
60
|
+
})
|
|
61
|
+
const emits = defineEmits<DrawerEmits>()
|
|
62
|
+
const slots = defineSlots<DrawerSlots>()
|
|
63
|
+
|
|
64
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, 'activeSnapPoint', 'closeThreshold', 'defaultOpen', 'dismissible', 'fadeFromIndex', 'fixed', 'modal', 'nested', 'open', 'scrollLockTimeout', 'shouldScaleBackground', 'snapPoints'), emits)
|
|
65
|
+
const contentProps = toRef(() => props.content)
|
|
66
|
+
|
|
67
|
+
// eslint-disable-next-line vue/no-dupe-keys
|
|
68
|
+
const ui = drawer()
|
|
69
|
+
</script>
|
|
70
|
+
|
|
71
|
+
<template>
|
|
72
|
+
<DrawerRoot v-bind="rootProps">
|
|
73
|
+
<DrawerTrigger v-if="!!slots.default" as-child>
|
|
74
|
+
<slot />
|
|
75
|
+
</DrawerTrigger>
|
|
76
|
+
|
|
77
|
+
<DrawerPortal :disabled="!portal">
|
|
78
|
+
<DrawerOverlay v-if="overlay" :class="ui.overlay({ class: props.ui?.overlay })" />
|
|
79
|
+
|
|
80
|
+
<DrawerContent :class="ui.content({ class: [props.class, props.ui?.content] })" v-bind="contentProps">
|
|
81
|
+
<slot name="handle">
|
|
82
|
+
<div :class="ui.handle({ class: props.ui?.handle })" />
|
|
83
|
+
</slot>
|
|
84
|
+
|
|
85
|
+
<slot name="content">
|
|
86
|
+
<div :class="ui.container({ class: props.ui?.container })">
|
|
87
|
+
<div v-if="!!slots.header || (title || !!slots.title) || (description || !!slots.description)" :class="ui.header({ class: props.ui?.header })">
|
|
88
|
+
<slot name="header">
|
|
89
|
+
<DrawerTitle v-if="title || !!slots.title" :class="ui.title({ class: props.ui?.title })">
|
|
90
|
+
<slot name="title">
|
|
91
|
+
{{ title }}
|
|
92
|
+
</slot>
|
|
93
|
+
</DrawerTitle>
|
|
94
|
+
|
|
95
|
+
<DrawerDescription v-if="description || !!slots.description" :class="ui.description({ class: props.ui?.description })">
|
|
96
|
+
<slot name="description">
|
|
97
|
+
{{ description }}
|
|
98
|
+
</slot>
|
|
99
|
+
</DrawerDescription>
|
|
100
|
+
</slot>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
<div v-if="!!slots.body" :class="ui.body({ class: props.ui?.body })">
|
|
104
|
+
<slot name="body" />
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<div v-if="!!slots.footer" :class="ui.footer({ class: props.ui?.footer })">
|
|
108
|
+
<slot name="footer" />
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</slot>
|
|
112
|
+
</DrawerContent>
|
|
113
|
+
</DrawerPortal>
|
|
114
|
+
</DrawerRoot>
|
|
115
|
+
</template>
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { tv, type VariantProps } from 'tailwind-variants'
|
|
3
|
+
import type { DropdownMenuRootProps, DropdownMenuRootEmits, DropdownMenuContentProps, DropdownMenuArrowProps, DropdownMenuTriggerProps, DropdownMenuItemProps } from 'radix-vue'
|
|
4
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
5
|
+
import _appConfig from '#build/app.config'
|
|
6
|
+
import theme from '#build/ui/dropdown-menu'
|
|
7
|
+
import type { AvatarProps, KbdProps, LinkProps } from '../types'
|
|
8
|
+
import type { DynamicSlots } from '../types/utils'
|
|
9
|
+
|
|
10
|
+
const appConfig = _appConfig as AppConfig & { ui: { dropdownMenu: Partial<typeof theme> } }
|
|
11
|
+
|
|
12
|
+
const dropdownMenu = tv({ extend: tv(theme), ...(appConfig.ui?.dropdownMenu || {}) })
|
|
13
|
+
|
|
14
|
+
export interface DropdownMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'custom'>, Pick<DropdownMenuItemProps, 'disabled'> {
|
|
15
|
+
label?: string
|
|
16
|
+
icon?: string
|
|
17
|
+
avatar?: AvatarProps
|
|
18
|
+
content?: Omit<DropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'>
|
|
19
|
+
kbds?: KbdProps['value'][] | KbdProps[]
|
|
20
|
+
/**
|
|
21
|
+
* The item type.
|
|
22
|
+
* @defaultValue 'link'
|
|
23
|
+
*/
|
|
24
|
+
type?: 'label' | 'separator' | 'link'
|
|
25
|
+
slot?: string
|
|
26
|
+
open?: boolean
|
|
27
|
+
defaultOpen?: boolean
|
|
28
|
+
children?: DropdownMenuItem[] | DropdownMenuItem[][]
|
|
29
|
+
select?(e: Event): void
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
type DropdownMenuVariants = VariantProps<typeof dropdownMenu>
|
|
33
|
+
|
|
34
|
+
export interface DropdownMenuProps<T> extends Omit<DropdownMenuRootProps, 'dir'>, Pick<DropdownMenuTriggerProps, 'disabled'> {
|
|
35
|
+
size?: DropdownMenuVariants['size']
|
|
36
|
+
items?: T[] | T[][]
|
|
37
|
+
/**
|
|
38
|
+
* The content of the menu.
|
|
39
|
+
* @defaultValue { side: 'bottom', sideOffset: 8 }
|
|
40
|
+
*/
|
|
41
|
+
content?: Omit<DropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'>
|
|
42
|
+
/**
|
|
43
|
+
* Display an arrow alongside the menu.
|
|
44
|
+
* @defaultValue false
|
|
45
|
+
*/
|
|
46
|
+
arrow?: boolean | Omit<DropdownMenuArrowProps, 'as' | 'asChild'>
|
|
47
|
+
/**
|
|
48
|
+
* Render the menu in a portal.
|
|
49
|
+
* @defaultValue true
|
|
50
|
+
*/
|
|
51
|
+
portal?: boolean
|
|
52
|
+
class?: any
|
|
53
|
+
ui?: Partial<typeof dropdownMenu.slots>
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface DropdownMenuEmits extends DropdownMenuRootEmits {}
|
|
57
|
+
|
|
58
|
+
type SlotProps<T> = (props: { item: T, active?: boolean, index: number }) => any
|
|
59
|
+
|
|
60
|
+
export type DropdownMenuSlots<T extends { slot?: string }> = {
|
|
61
|
+
'default'(props: { open: boolean }): any
|
|
62
|
+
'item': SlotProps<T>
|
|
63
|
+
'item-leading': SlotProps<T>
|
|
64
|
+
'item-label': SlotProps<T>
|
|
65
|
+
'item-trailing': SlotProps<T>
|
|
66
|
+
} & DynamicSlots<T, SlotProps<T>>
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<script setup lang="ts" generic="T extends DropdownMenuItem">
|
|
70
|
+
import { computed, toRef } from 'vue'
|
|
71
|
+
import { defu } from 'defu'
|
|
72
|
+
import { DropdownMenuRoot, DropdownMenuTrigger, DropdownMenuArrow, useForwardPropsEmits } from 'radix-vue'
|
|
73
|
+
import { reactivePick } from '@vueuse/core'
|
|
74
|
+
import UDropdownMenuContent from './DropdownMenuContent.vue'
|
|
75
|
+
import { omit } from '../utils'
|
|
76
|
+
|
|
77
|
+
const props = withDefaults(defineProps<DropdownMenuProps<T>>(), {
|
|
78
|
+
portal: true,
|
|
79
|
+
modal: true
|
|
80
|
+
})
|
|
81
|
+
const emits = defineEmits<DropdownMenuEmits>()
|
|
82
|
+
const slots = defineSlots<DropdownMenuSlots<T>>()
|
|
83
|
+
|
|
84
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, 'defaultOpen', 'open', 'modal'), emits)
|
|
85
|
+
const contentProps = toRef(() => defu(props.content, { side: 'bottom', sideOffset: 8 }) as DropdownMenuContentProps)
|
|
86
|
+
const arrowProps = toRef(() => props.arrow as DropdownMenuArrowProps)
|
|
87
|
+
const proxySlots = omit(slots, ['default']) as Record<string, DropdownMenuSlots<T>[string]>
|
|
88
|
+
|
|
89
|
+
const ui = computed(() => dropdownMenu({
|
|
90
|
+
size: props.size
|
|
91
|
+
}))
|
|
92
|
+
</script>
|
|
93
|
+
|
|
94
|
+
<template>
|
|
95
|
+
<DropdownMenuRoot v-slot="{ open }" v-bind="rootProps">
|
|
96
|
+
<DropdownMenuTrigger v-if="!!slots.default" as-child :disabled="disabled">
|
|
97
|
+
<slot :open="open" />
|
|
98
|
+
</DropdownMenuTrigger>
|
|
99
|
+
|
|
100
|
+
<UDropdownMenuContent
|
|
101
|
+
:class="ui.content({ class: [props.class, props.ui?.content] })"
|
|
102
|
+
:ui="ui"
|
|
103
|
+
:ui-override="props.ui"
|
|
104
|
+
v-bind="contentProps"
|
|
105
|
+
:items="items"
|
|
106
|
+
:portal="portal"
|
|
107
|
+
>
|
|
108
|
+
<template v-for="(_, name) in proxySlots" #[name]="slotData: any">
|
|
109
|
+
<slot :name="name" v-bind="slotData" />
|
|
110
|
+
</template>
|
|
111
|
+
|
|
112
|
+
<DropdownMenuArrow v-if="!!arrow" v-bind="arrowProps" :class="ui.arrow({ class: props.ui?.arrow })" />
|
|
113
|
+
</UDropdownMenuContent>
|
|
114
|
+
</DropdownMenuRoot>
|
|
115
|
+
</template>
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { tv } from 'tailwind-variants'
|
|
3
|
+
import type { DropdownMenuContentProps as RadixDropdownMenuContentProps, DropdownMenuContentEmits as RadixDropdownMenuContentEmits } from 'radix-vue'
|
|
4
|
+
import theme from '#build/ui/dropdown-menu'
|
|
5
|
+
import type { KbdProps, AvatarProps, DropdownMenuItem, DropdownMenuSlots } from '../types'
|
|
6
|
+
|
|
7
|
+
const _dropdownMenu = tv(theme)()
|
|
8
|
+
|
|
9
|
+
interface DropdownMenuContentProps<T> extends Omit<RadixDropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'> {
|
|
10
|
+
items?: T[] | T[][]
|
|
11
|
+
portal?: boolean
|
|
12
|
+
sub?: boolean
|
|
13
|
+
class?: any
|
|
14
|
+
ui: typeof _dropdownMenu
|
|
15
|
+
uiOverride?: any
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface DropdownMenuContentEmits extends RadixDropdownMenuContentEmits {}
|
|
19
|
+
|
|
20
|
+
type DropdownMenuContentSlots<T extends { slot?: string }> = Omit<DropdownMenuSlots<T>, 'default'> & {
|
|
21
|
+
default(props?: {}): any
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<script setup lang="ts" generic="T extends DropdownMenuItem">
|
|
26
|
+
import { computed } from 'vue'
|
|
27
|
+
import { DropdownMenu } from 'radix-vue/namespaced'
|
|
28
|
+
import { useForwardPropsEmits } from 'radix-vue'
|
|
29
|
+
import { reactiveOmit, createReusableTemplate } from '@vueuse/core'
|
|
30
|
+
import { useAppConfig } from '#imports'
|
|
31
|
+
import ULinkBase from './LinkBase.vue'
|
|
32
|
+
import ULink from './Link.vue'
|
|
33
|
+
import UAvatar from './Avatar.vue'
|
|
34
|
+
import UIcon from './Icon.vue'
|
|
35
|
+
import UKbd from './Kbd.vue'
|
|
36
|
+
import { omit } from '../utils'
|
|
37
|
+
import { pickLinkProps } from '../utils/link'
|
|
38
|
+
|
|
39
|
+
const props = defineProps<DropdownMenuContentProps<T>>()
|
|
40
|
+
const emits = defineEmits<DropdownMenuContentEmits>()
|
|
41
|
+
const slots = defineSlots<DropdownMenuContentSlots<T>>()
|
|
42
|
+
|
|
43
|
+
const appConfig = useAppConfig()
|
|
44
|
+
const contentProps = useForwardPropsEmits(reactiveOmit(props, 'sub', 'items', 'portal', 'class', 'ui'), emits)
|
|
45
|
+
const proxySlots = omit(slots, ['default']) as Record<string, DropdownMenuContentSlots<T>[string]>
|
|
46
|
+
|
|
47
|
+
const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate<{ item: DropdownMenuItem, active?: boolean, index: number }>()
|
|
48
|
+
|
|
49
|
+
const groups = computed(() => props.items?.length ? (Array.isArray(props.items[0]) ? props.items : [props.items]) as T[][] : [])
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<template>
|
|
53
|
+
<DefineItemTemplate v-slot="{ item, active, index }">
|
|
54
|
+
<slot :name="item.slot || 'item'" :item="(item as T)" :index="index">
|
|
55
|
+
<slot :name="item.slot ? `${item.slot}-leading`: 'item-leading'" :item="(item as T)" :active="active" :index="index">
|
|
56
|
+
<UAvatar v-if="item.avatar" :size="((props.uiOverride?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()) as AvatarProps['size'])" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: uiOverride?.itemLeadingAvatar, active })" />
|
|
57
|
+
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: uiOverride?.itemLeadingIcon, active })" />
|
|
58
|
+
</slot>
|
|
59
|
+
|
|
60
|
+
<span v-if="item.label || !!slots[item.slot ? `${item.slot}-label`: 'item-label']" :class="ui.itemLabel({ class: uiOverride?.itemLabel, active })">
|
|
61
|
+
<slot :name="item.slot ? `${item.slot}-label`: 'item-label'" :item="(item as T)" :active="active" :index="index">
|
|
62
|
+
{{ item.label }}
|
|
63
|
+
</slot>
|
|
64
|
+
|
|
65
|
+
<UIcon v-if="item.target === '_blank'" :name="appConfig.ui.icons.external" :class="ui.itemLabelExternalIcon({ class: uiOverride?.itemLabelExternalIcon, active })" />
|
|
66
|
+
</span>
|
|
67
|
+
|
|
68
|
+
<span v-if="item.children?.length || item.kbds?.length || !!slots[item.slot ? `${item.slot}-trailing`: 'item-trailing']" :class="ui.itemTrailing({ class: uiOverride?.itemTrailing })">
|
|
69
|
+
<slot :name="item.slot ? `${item.slot}-trailing`: 'item-trailing'" :item="(item as T)" :active="active" :index="index">
|
|
70
|
+
<UIcon v-if="item.children?.length" :name="appConfig.ui.icons.chevronRight" :class="ui.itemTrailingIcon({ class: uiOverride?.itemTrailingIcon, active })" />
|
|
71
|
+
<span v-else-if="item.kbds?.length" :class="ui.itemTrailingKbds({ class: uiOverride?.itemTrailingKbds })">
|
|
72
|
+
<UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="((props.uiOverride?.itemTrailingKbdsSize || ui.itemTrailingKbdsSize()) as KbdProps['size'])" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
73
|
+
</span>
|
|
74
|
+
</slot>
|
|
75
|
+
</span>
|
|
76
|
+
</slot>
|
|
77
|
+
</DefineItemTemplate>
|
|
78
|
+
|
|
79
|
+
<DropdownMenu.Portal :disabled="!portal">
|
|
80
|
+
<component :is="sub ? DropdownMenu.SubContent : DropdownMenu.Content" :class="props.class" v-bind="contentProps">
|
|
81
|
+
<DropdownMenu.Group v-for="(group, groupIndex) in groups" :key="`group-${groupIndex}`" :class="ui.group({ class: uiOverride?.group })">
|
|
82
|
+
<template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
|
|
83
|
+
<DropdownMenu.Label v-if="item.type === 'label'" :class="ui.label({ class: uiOverride?.label })">
|
|
84
|
+
<ReuseItemTemplate :item="item" :index="index" />
|
|
85
|
+
</DropdownMenu.Label>
|
|
86
|
+
<DropdownMenu.Separator v-else-if="item.type === 'separator'" :class="ui.separator({ class: uiOverride?.separator })" />
|
|
87
|
+
<DropdownMenu.Sub v-else-if="item?.children?.length" :open="item.open" :default-open="item.defaultOpen">
|
|
88
|
+
<DropdownMenu.SubTrigger
|
|
89
|
+
as="button"
|
|
90
|
+
type="button"
|
|
91
|
+
:disabled="item.disabled"
|
|
92
|
+
:text-value="item.label"
|
|
93
|
+
:class="ui.item({ class: uiOverride?.item })"
|
|
94
|
+
>
|
|
95
|
+
<ReuseItemTemplate :item="item" :index="index" />
|
|
96
|
+
</DropdownMenu.SubTrigger>
|
|
97
|
+
|
|
98
|
+
<UDropdownMenuContent
|
|
99
|
+
sub
|
|
100
|
+
:class="props.class"
|
|
101
|
+
:ui="ui"
|
|
102
|
+
:ui-override="uiOverride"
|
|
103
|
+
:portal="portal"
|
|
104
|
+
:items="item.children"
|
|
105
|
+
side="right"
|
|
106
|
+
align="start"
|
|
107
|
+
:align-offset="-4"
|
|
108
|
+
:side-offset="3"
|
|
109
|
+
v-bind="item.content"
|
|
110
|
+
>
|
|
111
|
+
<template v-for="(_, name) in proxySlots" #[name]="slotData: any">
|
|
112
|
+
<slot :name="name" v-bind="slotData" />
|
|
113
|
+
</template>
|
|
114
|
+
</UDropdownMenuContent>
|
|
115
|
+
</DropdownMenu.Sub>
|
|
116
|
+
<DropdownMenu.Item v-else as-child :disabled="item.disabled" :text-value="item.label" @select="item.select">
|
|
117
|
+
<ULink v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item as Omit<DropdownMenuItem, 'type'>)" custom>
|
|
118
|
+
<ULinkBase v-bind="slotProps" :class="ui.item({ class: [uiOverride?.item, item.class], active })">
|
|
119
|
+
<ReuseItemTemplate :item="item" :active="active" :index="index" />
|
|
120
|
+
</ULinkBase>
|
|
121
|
+
</ULink>
|
|
122
|
+
</DropdownMenu.Item>
|
|
123
|
+
</template>
|
|
124
|
+
</DropdownMenu.Group>
|
|
125
|
+
|
|
126
|
+
<slot />
|
|
127
|
+
</component>
|
|
128
|
+
</DropdownMenu.Portal>
|
|
129
|
+
</template>
|