@eslamdevui/ui 3.2.0-beta.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/.nuxt/ui/accordion.ts +20 -0
- package/.nuxt/ui/alert.ts +264 -0
- package/.nuxt/ui/avatar-group.ts +52 -0
- package/.nuxt/ui/avatar.ts +54 -0
- package/.nuxt/ui/badge.ts +263 -0
- package/.nuxt/ui/breadcrumb.ts +45 -0
- package/.nuxt/ui/button-group.ts +16 -0
- package/.nuxt/ui/button.ts +378 -0
- package/.nuxt/ui/calendar.ts +103 -0
- package/.nuxt/ui/card.ts +34 -0
- package/.nuxt/ui/carousel.ts +38 -0
- package/.nuxt/ui/chat-message.ts +129 -0
- package/.nuxt/ui/chat-messages.ts +14 -0
- package/.nuxt/ui/chat-prompt-submit.ts +5 -0
- package/.nuxt/ui/chat-prompt.ts +35 -0
- package/.nuxt/ui/checkbox-group.ts +204 -0
- package/.nuxt/ui/checkbox.ts +236 -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 +51 -0
- package/.nuxt/ui/container.ts +3 -0
- package/.nuxt/ui/content-navigation.ts +339 -0
- package/.nuxt/ui/content-search-button.ts +6 -0
- package/.nuxt/ui/content-search.ts +6 -0
- package/.nuxt/ui/content-surround.ts +34 -0
- package/.nuxt/ui/content-toc.ts +150 -0
- package/.nuxt/ui/context-menu.ts +217 -0
- package/.nuxt/ui/dashboard-group.ts +3 -0
- package/.nuxt/ui/dashboard-navbar.ts +21 -0
- package/.nuxt/ui/dashboard-panel.ts +17 -0
- package/.nuxt/ui/dashboard-resize-handle.ts +3 -0
- package/.nuxt/ui/dashboard-search-button.ts +6 -0
- package/.nuxt/ui/dashboard-search.ts +6 -0
- package/.nuxt/ui/dashboard-sidebar-collapse.ts +9 -0
- package/.nuxt/ui/dashboard-sidebar-toggle.ts +9 -0
- package/.nuxt/ui/dashboard-sidebar.ts +37 -0
- package/.nuxt/ui/drawer.ts +126 -0
- package/.nuxt/ui/dropdown-menu.ts +218 -0
- package/.nuxt/ui/form-field.ts +48 -0
- package/.nuxt/ui/form.ts +3 -0
- package/.nuxt/ui/index.ts +71 -0
- package/.nuxt/ui/input-menu.ts +450 -0
- package/.nuxt/ui/input-number.ts +245 -0
- package/.nuxt/ui/input-tags.ts +310 -0
- package/.nuxt/ui/input.ts +289 -0
- package/.nuxt/ui/kbd.ts +31 -0
- package/.nuxt/ui/link.ts +22 -0
- package/.nuxt/ui/modal.ts +29 -0
- package/.nuxt/ui/navigation-menu.ts +510 -0
- package/.nuxt/ui/pagination.ts +13 -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/prose.ts +321 -0
- package/.nuxt/ui/radio-group.ts +350 -0
- package/.nuxt/ui/select-menu.ts +351 -0
- package/.nuxt/ui/select.ts +346 -0
- package/.nuxt/ui/separator.ts +172 -0
- package/.nuxt/ui/skeleton.ts +3 -0
- package/.nuxt/ui/slideover.ts +71 -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 +148 -0
- package/.nuxt/ui/tabs.ts +256 -0
- package/.nuxt/ui/textarea.ts +294 -0
- package/.nuxt/ui/timeline.ts +321 -0
- package/.nuxt/ui/toast.ts +81 -0
- package/.nuxt/ui/toaster.ts +91 -0
- package/.nuxt/ui/tooltip.ts +9 -0
- package/.nuxt/ui/tree.ts +154 -0
- package/.nuxt/ui.css +146 -0
- package/LICENSE.md +9 -0
- package/README.md +147 -0
- package/cli/commands/make/component.mjs +95 -0
- package/cli/commands/make/index.mjs +14 -0
- package/cli/commands/make/locale.mjs +64 -0
- package/cli/index.mjs +15 -0
- package/cli/package.json +13 -0
- package/cli/templates.mjs +228 -0
- package/cli/utils.mjs +31 -0
- package/dist/module.d.mts +63 -0
- package/dist/module.json +13 -0
- package/dist/module.mjs +135 -0
- package/dist/runtime/components/Accordion.vue +73 -0
- package/dist/runtime/components/Accordion.vue.d.ts +77 -0
- package/dist/runtime/components/Alert.vue +88 -0
- package/dist/runtime/components/Alert.vue.d.ts +81 -0
- package/dist/runtime/components/App.vue +44 -0
- package/dist/runtime/components/App.vue.d.ts +24 -0
- package/dist/runtime/components/Avatar.vue +83 -0
- package/dist/runtime/components/Avatar.vue.d.ts +41 -0
- package/dist/runtime/components/AvatarGroup.vue +65 -0
- package/dist/runtime/components/AvatarGroup.vue.d.ts +31 -0
- package/dist/runtime/components/Badge.vue +60 -0
- package/dist/runtime/components/Badge.vue.d.ts +43 -0
- package/dist/runtime/components/Breadcrumb.vue +65 -0
- package/dist/runtime/components/Breadcrumb.vue.d.ts +66 -0
- package/dist/runtime/components/Button.vue +147 -0
- package/dist/runtime/components/Button.vue.d.ts +48 -0
- package/dist/runtime/components/ButtonGroup.vue +31 -0
- package/dist/runtime/components/ButtonGroup.vue.d.ts +34 -0
- package/dist/runtime/components/Calendar.vue +154 -0
- package/dist/runtime/components/Calendar.vue.d.ts +111 -0
- package/dist/runtime/components/Card.vue +37 -0
- package/dist/runtime/components/Card.vue.d.ts +29 -0
- package/dist/runtime/components/Carousel.vue +210 -0
- package/dist/runtime/components/Carousel.vue.d.ts +127 -0
- package/dist/runtime/components/ChatMessage.vue +87 -0
- package/dist/runtime/components/ChatMessage.vue.d.ts +130 -0
- package/dist/runtime/components/ChatMessages.vue +225 -0
- package/dist/runtime/components/ChatMessages.vue.d.ts +83 -0
- package/dist/runtime/components/ChatPrompt.vue +77 -0
- package/dist/runtime/components/ChatPrompt.vue.d.ts +60 -0
- package/dist/runtime/components/ChatPromptSubmit.vue +74 -0
- package/dist/runtime/components/ChatPromptSubmit.vue.d.ts +99 -0
- package/dist/runtime/components/Checkbox.vue +90 -0
- package/dist/runtime/components/Checkbox.vue.d.ts +73 -0
- package/dist/runtime/components/CheckboxGroup.vue +124 -0
- package/dist/runtime/components/CheckboxGroup.vue.d.ts +84 -0
- package/dist/runtime/components/Chip.vue +48 -0
- package/dist/runtime/components/Chip.vue.d.ts +57 -0
- package/dist/runtime/components/Collapsible.vue +37 -0
- package/dist/runtime/components/Collapsible.vue.d.ts +35 -0
- package/dist/runtime/components/ColorPicker.vue +216 -0
- package/dist/runtime/components/ColorPicker.vue.d.ts +48 -0
- package/dist/runtime/components/CommandPalette.vue +275 -0
- package/dist/runtime/components/CommandPalette.vue.d.ts +187 -0
- package/dist/runtime/components/Container.vue +23 -0
- package/dist/runtime/components/Container.vue.d.ts +18 -0
- package/dist/runtime/components/ContextMenu.vue +61 -0
- package/dist/runtime/components/ContextMenu.vue.d.ts +109 -0
- package/dist/runtime/components/ContextMenuContent.vue +164 -0
- package/dist/runtime/components/ContextMenuContent.vue.d.ts +49 -0
- package/dist/runtime/components/DashboardGroup.vue +46 -0
- package/dist/runtime/components/DashboardGroup.vue.d.ts +27 -0
- package/dist/runtime/components/DashboardNavbar.vue +74 -0
- package/dist/runtime/components/DashboardNavbar.vue.d.ts +53 -0
- package/dist/runtime/components/DashboardPanel.vue +56 -0
- package/dist/runtime/components/DashboardPanel.vue.d.ts +28 -0
- package/dist/runtime/components/DashboardResizeHandle.vue +32 -0
- package/dist/runtime/components/DashboardResizeHandle.vue.d.ts +22 -0
- package/dist/runtime/components/DashboardSearch.vue +124 -0
- package/dist/runtime/components/DashboardSearch.vue.d.ts +48 -0
- package/dist/runtime/components/DashboardSearchButton.vue +72 -0
- package/dist/runtime/components/DashboardSearchButton.vue.d.ts +52 -0
- package/dist/runtime/components/DashboardSidebar.vue +170 -0
- package/dist/runtime/components/DashboardSidebar.vue.d.ts +72 -0
- package/dist/runtime/components/DashboardSidebarCollapse.vue +46 -0
- package/dist/runtime/components/DashboardSidebarCollapse.vue.d.ts +15 -0
- package/dist/runtime/components/DashboardSidebarToggle.vue +43 -0
- package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +19 -0
- package/dist/runtime/components/Drawer.vue +112 -0
- package/dist/runtime/components/Drawer.vue.d.ts +78 -0
- package/dist/runtime/components/DropdownMenu.vue +68 -0
- package/dist/runtime/components/DropdownMenu.vue.d.ts +119 -0
- package/dist/runtime/components/DropdownMenuContent.vue +171 -0
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +52 -0
- package/dist/runtime/components/Form.vue +210 -0
- package/dist/runtime/components/Form.vue.d.ts +70 -0
- package/dist/runtime/components/FormField.vue +90 -0
- package/dist/runtime/components/FormField.vue.d.ts +61 -0
- package/dist/runtime/components/Icon.vue +19 -0
- package/dist/runtime/components/Icon.vue.d.ts +8 -0
- package/dist/runtime/components/Input.vue +147 -0
- package/dist/runtime/components/Input.vue.d.ts +77 -0
- package/dist/runtime/components/InputMenu.vue +373 -0
- package/dist/runtime/components/InputMenu.vue.d.ts +534 -0
- package/dist/runtime/components/InputNumber.vue +144 -0
- package/dist/runtime/components/InputNumber.vue.d.ts +260 -0
- package/dist/runtime/components/InputTags.vue +159 -0
- package/dist/runtime/components/InputTags.vue.d.ts +183 -0
- package/dist/runtime/components/Kbd.vue +30 -0
- package/dist/runtime/components/Kbd.vue.d.ts +34 -0
- package/dist/runtime/components/Link.vue +127 -0
- package/dist/runtime/components/Link.vue.d.ts +93 -0
- package/dist/runtime/components/LinkBase.vue +57 -0
- package/dist/runtime/components/LinkBase.vue.d.ts +25 -0
- package/dist/runtime/components/Modal.vue +130 -0
- package/dist/runtime/components/Modal.vue.d.ts +106 -0
- package/dist/runtime/components/NavigationMenu.vue +275 -0
- package/dist/runtime/components/NavigationMenu.vue.d.ts +170 -0
- package/dist/runtime/components/OverlayProvider.vue +25 -0
- package/dist/runtime/components/OverlayProvider.vue.d.ts +2 -0
- package/dist/runtime/components/Pagination.vue +97 -0
- package/dist/runtime/components/Pagination.vue.d.ts +118 -0
- package/dist/runtime/components/PinInput.vue +94 -0
- package/dist/runtime/components/PinInput.vue.d.ts +60 -0
- package/dist/runtime/components/Popover.vue +73 -0
- package/dist/runtime/components/Popover.vue.d.ts +64 -0
- package/dist/runtime/components/Progress.vue +132 -0
- package/dist/runtime/components/Progress.vue.d.ts +66 -0
- package/dist/runtime/components/RadioGroup.vue +133 -0
- package/dist/runtime/components/RadioGroup.vue.d.ts +93 -0
- package/dist/runtime/components/Select.vue +225 -0
- package/dist/runtime/components/Select.vue.d.ts +253 -0
- package/dist/runtime/components/SelectMenu.vue +328 -0
- package/dist/runtime/components/SelectMenu.vue.d.ts +302 -0
- package/dist/runtime/components/Separator.vue +53 -0
- package/dist/runtime/components/Separator.vue.d.ts +54 -0
- package/dist/runtime/components/Skeleton.vue +29 -0
- package/dist/runtime/components/Skeleton.vue.d.ts +17 -0
- package/dist/runtime/components/Slideover.vue +137 -0
- package/dist/runtime/components/Slideover.vue.d.ts +107 -0
- package/dist/runtime/components/Slider.vue +94 -0
- package/dist/runtime/components/Slider.vue.d.ts +58 -0
- package/dist/runtime/components/Stepper.vue +116 -0
- package/dist/runtime/components/Stepper.vue.d.ts +85 -0
- package/dist/runtime/components/Switch.vue +89 -0
- package/dist/runtime/components/Switch.vue.d.ts +70 -0
- package/dist/runtime/components/Table.vue +286 -0
- package/dist/runtime/components/Table.vue.d.ts +185 -0
- package/dist/runtime/components/Tabs.vue +84 -0
- package/dist/runtime/components/Tabs.vue.d.ts +93 -0
- package/dist/runtime/components/Textarea.vue +169 -0
- package/dist/runtime/components/Textarea.vue.d.ts +78 -0
- package/dist/runtime/components/Timeline.vue +92 -0
- package/dist/runtime/components/Timeline.vue.d.ts +70 -0
- package/dist/runtime/components/Toast.vue +129 -0
- package/dist/runtime/components/Toast.vue.d.ts +163 -0
- package/dist/runtime/components/Toaster.vue +111 -0
- package/dist/runtime/components/Toaster.vue.d.ts +44 -0
- package/dist/runtime/components/Tooltip.vue +62 -0
- package/dist/runtime/components/Tooltip.vue.d.ts +50 -0
- package/dist/runtime/components/Tree.vue +121 -0
- package/dist/runtime/components/Tree.vue.d.ts +113 -0
- package/dist/runtime/components/color-mode/ColorModeAvatar.vue +16 -0
- package/dist/runtime/components/color-mode/ColorModeAvatar.vue.d.ts +7 -0
- package/dist/runtime/components/color-mode/ColorModeButton.vue +45 -0
- package/dist/runtime/components/color-mode/ColorModeButton.vue.d.ts +24 -0
- package/dist/runtime/components/color-mode/ColorModeImage.vue +17 -0
- package/dist/runtime/components/color-mode/ColorModeImage.vue.d.ts +6 -0
- package/dist/runtime/components/color-mode/ColorModeSelect.vue +49 -0
- package/dist/runtime/components/color-mode/ColorModeSelect.vue.d.ts +7 -0
- package/dist/runtime/components/color-mode/ColorModeSwitch.vue +44 -0
- package/dist/runtime/components/color-mode/ColorModeSwitch.vue.d.ts +7 -0
- package/dist/runtime/components/locale/LocaleSelect.vue +61 -0
- package/dist/runtime/components/locale/LocaleSelect.vue.d.ts +16 -0
- package/dist/runtime/composables/color-mode/useColorMode.d.ts +3 -0
- package/dist/runtime/composables/color-mode/useColorMode.js +5 -0
- package/dist/runtime/composables/defineLocale.d.ts +11 -0
- package/dist/runtime/composables/defineLocale.js +9 -0
- package/dist/runtime/composables/defineShortcuts.d.ts +15 -0
- package/dist/runtime/composables/defineShortcuts.js +141 -0
- package/dist/runtime/composables/useAvatarGroup.d.ts +10 -0
- package/dist/runtime/composables/useAvatarGroup.js +10 -0
- package/dist/runtime/composables/useButtonGroup.d.ts +15 -0
- package/dist/runtime/composables/useButtonGroup.js +9 -0
- package/dist/runtime/composables/useComponentIcons.d.ts +39 -0
- package/dist/runtime/composables/useComponentIcons.js +26 -0
- package/dist/runtime/composables/useContentSearch.d.ts +6 -0
- package/dist/runtime/composables/useContentSearch.js +9 -0
- package/dist/runtime/composables/useFormField.d.ts +42 -0
- package/dist/runtime/composables/useFormField.js +66 -0
- package/dist/runtime/composables/useKbd.d.ts +36 -0
- package/dist/runtime/composables/useKbd.js +53 -0
- package/dist/runtime/composables/useLocale.d.ts +4 -0
- package/dist/runtime/composables/useLocale.js +10 -0
- package/dist/runtime/composables/useLocalePro.d.ts +3 -0
- package/dist/runtime/composables/useLocalePro.js +11 -0
- package/dist/runtime/composables/useOverlay.d.ts +38 -0
- package/dist/runtime/composables/useOverlay.js +85 -0
- package/dist/runtime/composables/usePortal.d.ts +6 -0
- package/dist/runtime/composables/usePortal.js +17 -0
- package/dist/runtime/composables/useResizable.d.ts +27 -0
- package/dist/runtime/composables/useResizable.js +173 -0
- package/dist/runtime/composables/useScrollspy.d.ts +6 -0
- package/dist/runtime/composables/useScrollspy.js +38 -0
- package/dist/runtime/composables/useToast.d.ts +13 -0
- package/dist/runtime/composables/useToast.js +62 -0
- package/dist/runtime/index.css +1 -0
- package/dist/runtime/inertia/components/Link.vue +132 -0
- package/dist/runtime/inertia/components/Link.vue.d.ts +63 -0
- package/dist/runtime/inertia/components/LinkBase.vue +68 -0
- package/dist/runtime/inertia/components/LinkBase.vue.d.ts +25 -0
- package/dist/runtime/inertia/stubs.d.ts +43 -0
- package/dist/runtime/inertia/stubs.js +82 -0
- package/dist/runtime/keyframes.css +1 -0
- package/dist/runtime/locale/ar.d.ts +3 -0
- package/dist/runtime/locale/ar.js +56 -0
- package/dist/runtime/locale/az.d.ts +3 -0
- package/dist/runtime/locale/az.js +55 -0
- package/dist/runtime/locale/bg.d.ts +3 -0
- package/dist/runtime/locale/bg.js +55 -0
- package/dist/runtime/locale/bn.d.ts +3 -0
- package/dist/runtime/locale/bn.js +55 -0
- package/dist/runtime/locale/ca.d.ts +3 -0
- package/dist/runtime/locale/ca.js +55 -0
- package/dist/runtime/locale/ckb.d.ts +3 -0
- package/dist/runtime/locale/ckb.js +56 -0
- package/dist/runtime/locale/cs.d.ts +3 -0
- package/dist/runtime/locale/cs.js +55 -0
- package/dist/runtime/locale/da.d.ts +3 -0
- package/dist/runtime/locale/da.js +55 -0
- package/dist/runtime/locale/de.d.ts +3 -0
- package/dist/runtime/locale/de.js +55 -0
- package/dist/runtime/locale/el.d.ts +3 -0
- package/dist/runtime/locale/el.js +55 -0
- package/dist/runtime/locale/en.d.ts +3 -0
- package/dist/runtime/locale/en.js +125 -0
- package/dist/runtime/locale/es.d.ts +3 -0
- package/dist/runtime/locale/es.js +55 -0
- package/dist/runtime/locale/et.d.ts +3 -0
- package/dist/runtime/locale/et.js +55 -0
- package/dist/runtime/locale/fa_ir.d.ts +3 -0
- package/dist/runtime/locale/fa_ir.js +56 -0
- package/dist/runtime/locale/fi.d.ts +3 -0
- package/dist/runtime/locale/fi.js +55 -0
- package/dist/runtime/locale/fr.d.ts +3 -0
- package/dist/runtime/locale/fr.js +55 -0
- package/dist/runtime/locale/he.d.ts +3 -0
- package/dist/runtime/locale/he.js +54 -0
- package/dist/runtime/locale/hi.d.ts +3 -0
- package/dist/runtime/locale/hi.js +55 -0
- package/dist/runtime/locale/hu.d.ts +3 -0
- package/dist/runtime/locale/hu.js +55 -0
- package/dist/runtime/locale/hy.d.ts +3 -0
- package/dist/runtime/locale/hy.js +55 -0
- package/dist/runtime/locale/id.d.ts +3 -0
- package/dist/runtime/locale/id.js +55 -0
- package/dist/runtime/locale/index.d.ts +51 -0
- package/dist/runtime/locale/index.js +51 -0
- package/dist/runtime/locale/it.d.ts +3 -0
- package/dist/runtime/locale/it.js +55 -0
- package/dist/runtime/locale/ja.d.ts +3 -0
- package/dist/runtime/locale/ja.js +55 -0
- package/dist/runtime/locale/kk.d.ts +3 -0
- package/dist/runtime/locale/kk.js +55 -0
- package/dist/runtime/locale/km.d.ts +3 -0
- package/dist/runtime/locale/km.js +55 -0
- package/dist/runtime/locale/ko.d.ts +3 -0
- package/dist/runtime/locale/ko.js +55 -0
- package/dist/runtime/locale/ky.d.ts +3 -0
- package/dist/runtime/locale/ky.js +55 -0
- package/dist/runtime/locale/lb.d.ts +3 -0
- package/dist/runtime/locale/lb.js +55 -0
- package/dist/runtime/locale/lt.d.ts +3 -0
- package/dist/runtime/locale/lt.js +55 -0
- package/dist/runtime/locale/mn.d.ts +3 -0
- package/dist/runtime/locale/mn.js +55 -0
- package/dist/runtime/locale/ms.d.ts +3 -0
- package/dist/runtime/locale/ms.js +55 -0
- package/dist/runtime/locale/nb_no.d.ts +3 -0
- package/dist/runtime/locale/nb_no.js +55 -0
- package/dist/runtime/locale/nl.d.ts +3 -0
- package/dist/runtime/locale/nl.js +55 -0
- package/dist/runtime/locale/pl.d.ts +3 -0
- package/dist/runtime/locale/pl.js +55 -0
- package/dist/runtime/locale/pt.d.ts +3 -0
- package/dist/runtime/locale/pt.js +55 -0
- package/dist/runtime/locale/pt_br.d.ts +3 -0
- package/dist/runtime/locale/pt_br.js +55 -0
- package/dist/runtime/locale/ro.d.ts +3 -0
- package/dist/runtime/locale/ro.js +55 -0
- package/dist/runtime/locale/ru.d.ts +3 -0
- package/dist/runtime/locale/ru.js +55 -0
- package/dist/runtime/locale/sk.d.ts +3 -0
- package/dist/runtime/locale/sk.js +55 -0
- package/dist/runtime/locale/sl.d.ts +3 -0
- package/dist/runtime/locale/sl.js +55 -0
- package/dist/runtime/locale/sv.d.ts +3 -0
- package/dist/runtime/locale/sv.js +55 -0
- package/dist/runtime/locale/th.d.ts +3 -0
- package/dist/runtime/locale/th.js +55 -0
- package/dist/runtime/locale/tj.d.ts +3 -0
- package/dist/runtime/locale/tj.js +55 -0
- package/dist/runtime/locale/tr.d.ts +3 -0
- package/dist/runtime/locale/tr.js +55 -0
- package/dist/runtime/locale/ug_cn.d.ts +3 -0
- package/dist/runtime/locale/ug_cn.js +56 -0
- package/dist/runtime/locale/uk.d.ts +3 -0
- package/dist/runtime/locale/uk.js +55 -0
- package/dist/runtime/locale/ur.d.ts +3 -0
- package/dist/runtime/locale/ur.js +56 -0
- package/dist/runtime/locale/uz.d.ts +3 -0
- package/dist/runtime/locale/uz.js +55 -0
- package/dist/runtime/locale/vi.d.ts +3 -0
- package/dist/runtime/locale/vi.js +55 -0
- package/dist/runtime/locale/zh_cn.d.ts +3 -0
- package/dist/runtime/locale/zh_cn.js +55 -0
- package/dist/runtime/locale/zh_tw.d.ts +3 -0
- package/dist/runtime/locale/zh_tw.js +55 -0
- package/dist/runtime/plugins/colors.d.ts +2 -0
- package/dist/runtime/plugins/colors.js +51 -0
- package/dist/runtime/types/app.config.d.ts +6 -0
- package/dist/runtime/types/content.d.ts +1 -0
- package/dist/runtime/types/content.js +0 -0
- package/dist/runtime/types/form.d.ts +87 -0
- package/dist/runtime/types/form.js +12 -0
- package/dist/runtime/types/index.d.ts +76 -0
- package/dist/runtime/types/index.js +76 -0
- package/dist/runtime/types/locale.d.ts +127 -0
- package/dist/runtime/types/locale.js +0 -0
- package/dist/runtime/types/prose.d.ts +1 -0
- package/dist/runtime/types/prose.js +0 -0
- package/dist/runtime/types/tv.d.ts +53 -0
- package/dist/runtime/types/tv.js +0 -0
- package/dist/runtime/types/utils.d.ts +41 -0
- package/dist/runtime/types/utils.js +1 -0
- package/dist/runtime/utils/content.d.ts +13 -0
- package/dist/runtime/utils/content.js +51 -0
- package/dist/runtime/utils/dashboard.d.ts +10 -0
- package/dist/runtime/utils/dashboard.js +5 -0
- package/dist/runtime/utils/form.d.ts +13 -0
- package/dist/runtime/utils/form.js +108 -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 +12 -0
- package/dist/runtime/utils/index.js +89 -0
- package/dist/runtime/utils/link.d.ts +7 -0
- package/dist/runtime/utils/link.js +47 -0
- 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 +14 -0
- package/dist/runtime/vue/components/Icon.vue.d.ts +5 -0
- package/dist/runtime/vue/components/Link.vue +169 -0
- package/dist/runtime/vue/components/Link.vue.d.ts +93 -0
- package/dist/runtime/vue/components/color-mode/ColorModeButton.vue +34 -0
- package/dist/runtime/vue/components/color-mode/ColorModeButton.vue.d.ts +38 -0
- package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue +37 -0
- package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue.d.ts +5 -0
- package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue +32 -0
- package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue.d.ts +5 -0
- package/dist/runtime/vue/composables/useAppConfig.d.ts +1 -0
- package/dist/runtime/vue/composables/useAppConfig.js +4 -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 +10 -0
- package/dist/runtime/vue/stubs.d.ts +40 -0
- package/dist/runtime/vue/stubs.js +74 -0
- package/dist/shared/ui.BcVNrqyb.mjs +5374 -0
- package/dist/types.d.mts +5 -0
- package/dist/unplugin.d.mts +88 -0
- package/dist/unplugin.mjs +242 -0
- package/dist/vite.d.mts +15 -0
- package/dist/vite.mjs +21 -0
- package/package.json +255 -0
- package/vue-plugin.d.ts +5 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { ref, computed, toValue } from "vue";
|
|
2
|
+
import { useEventListener, useActiveElement, useDebounceFn } from "@vueuse/core";
|
|
3
|
+
import { useKbd } from "./useKbd.js";
|
|
4
|
+
const chainedShortcutRegex = /^[^-]+.*-.*[^-]+$/;
|
|
5
|
+
const combinedShortcutRegex = /^[^_]+.*_.*[^_]+$/;
|
|
6
|
+
export function extractShortcuts(items) {
|
|
7
|
+
const shortcuts = {};
|
|
8
|
+
function traverse(items2) {
|
|
9
|
+
items2.forEach((item) => {
|
|
10
|
+
if (item.kbds?.length && (item.onSelect || item.onClick)) {
|
|
11
|
+
const shortcutKey = item.kbds.join("_");
|
|
12
|
+
shortcuts[shortcutKey] = item.onSelect || item.onClick;
|
|
13
|
+
}
|
|
14
|
+
if (item.children) {
|
|
15
|
+
traverse(item.children.flat());
|
|
16
|
+
}
|
|
17
|
+
if (item.items) {
|
|
18
|
+
traverse(item.items.flat());
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
traverse(items.flat());
|
|
23
|
+
return shortcuts;
|
|
24
|
+
}
|
|
25
|
+
export function defineShortcuts(config, options = {}) {
|
|
26
|
+
const chainedInputs = ref([]);
|
|
27
|
+
const clearChainedInput = () => {
|
|
28
|
+
chainedInputs.value.splice(0, chainedInputs.value.length);
|
|
29
|
+
};
|
|
30
|
+
const debouncedClearChainedInput = useDebounceFn(clearChainedInput, options.chainDelay ?? 800);
|
|
31
|
+
const { macOS } = useKbd();
|
|
32
|
+
const activeElement = useActiveElement();
|
|
33
|
+
const onKeyDown = (e) => {
|
|
34
|
+
if (!e.key) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const alphabeticalKey = /^[a-z]{1}$/i.test(e.key);
|
|
38
|
+
let chainedKey;
|
|
39
|
+
chainedInputs.value.push(e.key);
|
|
40
|
+
if (chainedInputs.value.length >= 2) {
|
|
41
|
+
chainedKey = chainedInputs.value.slice(-2).join("-");
|
|
42
|
+
for (const shortcut of shortcuts.value.filter((s) => s.chained)) {
|
|
43
|
+
if (shortcut.key !== chainedKey) {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (shortcut.enabled) {
|
|
47
|
+
e.preventDefault();
|
|
48
|
+
shortcut.handler(e);
|
|
49
|
+
}
|
|
50
|
+
clearChainedInput();
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
for (const shortcut of shortcuts.value.filter((s) => !s.chained)) {
|
|
55
|
+
if (e.key.toLowerCase() !== shortcut.key) {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
if (e.metaKey !== shortcut.metaKey) {
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
if (e.ctrlKey !== shortcut.ctrlKey) {
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
if (alphabeticalKey && e.shiftKey !== shortcut.shiftKey) {
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
if (shortcut.enabled) {
|
|
68
|
+
e.preventDefault();
|
|
69
|
+
shortcut.handler();
|
|
70
|
+
}
|
|
71
|
+
clearChainedInput();
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
debouncedClearChainedInput();
|
|
75
|
+
};
|
|
76
|
+
const usingInput = computed(() => {
|
|
77
|
+
const tagName = activeElement.value?.tagName;
|
|
78
|
+
const contentEditable = activeElement.value?.contentEditable;
|
|
79
|
+
const usingInput2 = !!(tagName === "INPUT" || tagName === "TEXTAREA" || contentEditable === "true" || contentEditable === "plaintext-only");
|
|
80
|
+
if (usingInput2) {
|
|
81
|
+
return activeElement.value?.name || true;
|
|
82
|
+
}
|
|
83
|
+
return false;
|
|
84
|
+
});
|
|
85
|
+
const shortcuts = computed(() => {
|
|
86
|
+
return Object.entries(toValue(config)).map(([key, shortcutConfig]) => {
|
|
87
|
+
if (!shortcutConfig) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
let shortcut;
|
|
91
|
+
if (key.includes("-") && key !== "-" && !key.includes("_") && !key.match(chainedShortcutRegex)?.length) {
|
|
92
|
+
console.trace(`[Shortcut] Invalid key: "${key}"`);
|
|
93
|
+
}
|
|
94
|
+
if (key.includes("_") && key !== "_" && !key.match(combinedShortcutRegex)?.length) {
|
|
95
|
+
console.trace(`[Shortcut] Invalid key: "${key}"`);
|
|
96
|
+
}
|
|
97
|
+
const chained = key.includes("-") && key !== "-" && !key.includes("_");
|
|
98
|
+
if (chained) {
|
|
99
|
+
shortcut = {
|
|
100
|
+
key: key.toLowerCase(),
|
|
101
|
+
metaKey: false,
|
|
102
|
+
ctrlKey: false,
|
|
103
|
+
shiftKey: false,
|
|
104
|
+
altKey: false
|
|
105
|
+
};
|
|
106
|
+
} else {
|
|
107
|
+
const keySplit = key.toLowerCase().split("_").map((k) => k);
|
|
108
|
+
shortcut = {
|
|
109
|
+
key: keySplit.filter((k) => !["meta", "command", "ctrl", "shift", "alt", "option"].includes(k)).join("_"),
|
|
110
|
+
metaKey: keySplit.includes("meta") || keySplit.includes("command"),
|
|
111
|
+
ctrlKey: keySplit.includes("ctrl"),
|
|
112
|
+
shiftKey: keySplit.includes("shift"),
|
|
113
|
+
altKey: keySplit.includes("alt") || keySplit.includes("option")
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
shortcut.chained = chained;
|
|
117
|
+
if (!macOS.value && shortcut.metaKey && !shortcut.ctrlKey) {
|
|
118
|
+
shortcut.metaKey = false;
|
|
119
|
+
shortcut.ctrlKey = true;
|
|
120
|
+
}
|
|
121
|
+
if (typeof shortcutConfig === "function") {
|
|
122
|
+
shortcut.handler = shortcutConfig;
|
|
123
|
+
} else if (typeof shortcutConfig === "object") {
|
|
124
|
+
shortcut = { ...shortcut, handler: shortcutConfig.handler };
|
|
125
|
+
}
|
|
126
|
+
if (!shortcut.handler) {
|
|
127
|
+
console.trace("[Shortcut] Invalid value");
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
let enabled = true;
|
|
131
|
+
if (!shortcutConfig.usingInput) {
|
|
132
|
+
enabled = !usingInput.value;
|
|
133
|
+
} else if (typeof shortcutConfig.usingInput === "string") {
|
|
134
|
+
enabled = usingInput.value === shortcutConfig.usingInput;
|
|
135
|
+
}
|
|
136
|
+
shortcut.enabled = enabled;
|
|
137
|
+
return shortcut;
|
|
138
|
+
}).filter(Boolean);
|
|
139
|
+
});
|
|
140
|
+
return useEventListener("keydown", onKeyDown);
|
|
141
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ComputedRef, type InjectionKey } from 'vue';
|
|
2
|
+
import type { AvatarGroupProps } from '../types';
|
|
3
|
+
export declare const avatarGroupInjectionKey: InjectionKey<ComputedRef<{
|
|
4
|
+
size: AvatarGroupProps['size'];
|
|
5
|
+
}>>;
|
|
6
|
+
export declare function useAvatarGroup(props: {
|
|
7
|
+
size: AvatarGroupProps['size'];
|
|
8
|
+
}): {
|
|
9
|
+
size: ComputedRef<"3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | undefined>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { inject, provide, computed } from "vue";
|
|
2
|
+
export const avatarGroupInjectionKey = Symbol("nuxt-ui.avatar-group");
|
|
3
|
+
export function useAvatarGroup(props) {
|
|
4
|
+
const avatarGroup = inject(avatarGroupInjectionKey, void 0);
|
|
5
|
+
const size = computed(() => props.size ?? avatarGroup?.value.size);
|
|
6
|
+
provide(avatarGroupInjectionKey, computed(() => ({ size: size.value })));
|
|
7
|
+
return {
|
|
8
|
+
size
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { InjectionKey, ComputedRef } from 'vue';
|
|
2
|
+
import type { ButtonGroupProps } from '../components/ButtonGroup.vue';
|
|
3
|
+
import type { GetObjectField } from '../types/utils';
|
|
4
|
+
export declare const buttonGroupInjectionKey: InjectionKey<ComputedRef<{
|
|
5
|
+
size: ButtonGroupProps['size'];
|
|
6
|
+
orientation: ButtonGroupProps['orientation'];
|
|
7
|
+
}>>;
|
|
8
|
+
type Props<T> = {
|
|
9
|
+
size?: GetObjectField<T, 'size'>;
|
|
10
|
+
};
|
|
11
|
+
export declare function useButtonGroup<T>(props: Props<T>): {
|
|
12
|
+
orientation: ComputedRef<"horizontal" | "vertical" | undefined>;
|
|
13
|
+
size: ComputedRef<"xs" | "sm" | "md" | "lg" | "xl" | NonNullable<GetObjectField<T, "size">> | undefined>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { inject, computed } from "vue";
|
|
2
|
+
export const buttonGroupInjectionKey = Symbol("nuxt-ui.button-group");
|
|
3
|
+
export function useButtonGroup(props) {
|
|
4
|
+
const buttonGroup = inject(buttonGroupInjectionKey, void 0);
|
|
5
|
+
return {
|
|
6
|
+
orientation: computed(() => buttonGroup?.value.orientation),
|
|
7
|
+
size: computed(() => props?.size ?? buttonGroup?.value.size)
|
|
8
|
+
};
|
|
9
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import type { AvatarProps } from '../types';
|
|
3
|
+
export interface UseComponentIconsProps {
|
|
4
|
+
/**
|
|
5
|
+
* Display an icon based on the `leading` and `trailing` props.
|
|
6
|
+
* @IconifyIcon
|
|
7
|
+
*/
|
|
8
|
+
icon?: string;
|
|
9
|
+
/** Display an avatar on the left side. */
|
|
10
|
+
avatar?: AvatarProps;
|
|
11
|
+
/** When `true`, the icon will be displayed on the left side. */
|
|
12
|
+
leading?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Display an icon on the left side.
|
|
15
|
+
* @IconifyIcon
|
|
16
|
+
*/
|
|
17
|
+
leadingIcon?: string;
|
|
18
|
+
/** When `true`, the icon will be displayed on the right side. */
|
|
19
|
+
trailing?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Display an icon on the right side.
|
|
22
|
+
* @IconifyIcon
|
|
23
|
+
*/
|
|
24
|
+
trailingIcon?: string;
|
|
25
|
+
/** When `true`, the loading icon will be displayed. */
|
|
26
|
+
loading?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* The icon when the `loading` prop is `true`.
|
|
29
|
+
* @defaultValue appConfig.ui.icons.loading
|
|
30
|
+
* @IconifyIcon
|
|
31
|
+
*/
|
|
32
|
+
loadingIcon?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare function useComponentIcons(componentProps: MaybeRefOrGetter<UseComponentIconsProps>): {
|
|
35
|
+
isLeading: import("vue").ComputedRef<boolean>;
|
|
36
|
+
isTrailing: import("vue").ComputedRef<boolean>;
|
|
37
|
+
leadingIconName: import("vue").ComputedRef<any>;
|
|
38
|
+
trailingIconName: import("vue").ComputedRef<any>;
|
|
39
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { computed, toValue } from "vue";
|
|
2
|
+
import { useAppConfig } from "#imports";
|
|
3
|
+
export function useComponentIcons(componentProps) {
|
|
4
|
+
const appConfig = useAppConfig();
|
|
5
|
+
const props = computed(() => toValue(componentProps));
|
|
6
|
+
const isLeading = computed(() => props.value.icon && props.value.leading || props.value.icon && !props.value.trailing || props.value.loading && !props.value.trailing || !!props.value.leadingIcon);
|
|
7
|
+
const isTrailing = computed(() => props.value.icon && props.value.trailing || props.value.loading && props.value.trailing || !!props.value.trailingIcon);
|
|
8
|
+
const leadingIconName = computed(() => {
|
|
9
|
+
if (props.value.loading) {
|
|
10
|
+
return props.value.loadingIcon || appConfig.ui.icons.loading;
|
|
11
|
+
}
|
|
12
|
+
return props.value.leadingIcon || props.value.icon;
|
|
13
|
+
});
|
|
14
|
+
const trailingIconName = computed(() => {
|
|
15
|
+
if (props.value.loading && !isLeading.value) {
|
|
16
|
+
return props.value.loadingIcon || appConfig.ui.icons.loading;
|
|
17
|
+
}
|
|
18
|
+
return props.value.trailingIcon || props.value.icon;
|
|
19
|
+
});
|
|
20
|
+
return {
|
|
21
|
+
isLeading,
|
|
22
|
+
isTrailing,
|
|
23
|
+
leadingIconName,
|
|
24
|
+
trailingIconName
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type InjectionKey, type Ref, type ComputedRef } from 'vue';
|
|
2
|
+
import { type UseEventBusReturn } from '@vueuse/core';
|
|
3
|
+
import type { FormFieldProps } from '../types';
|
|
4
|
+
import type { FormEvent, FormFieldInjectedOptions, FormInjectedOptions } from '../types/form';
|
|
5
|
+
import type { GetObjectField } from '../types/utils';
|
|
6
|
+
type Props<T> = {
|
|
7
|
+
id?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
size?: GetObjectField<T, 'size'>;
|
|
10
|
+
color?: GetObjectField<T, 'color'>;
|
|
11
|
+
highlight?: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare const formOptionsInjectionKey: InjectionKey<ComputedRef<FormInjectedOptions>>;
|
|
15
|
+
export declare const formBusInjectionKey: InjectionKey<UseEventBusReturn<FormEvent<any>, string>>;
|
|
16
|
+
export declare const formFieldInjectionKey: InjectionKey<ComputedRef<FormFieldInjectedOptions<FormFieldProps>> | undefined>;
|
|
17
|
+
export declare const inputIdInjectionKey: InjectionKey<Ref<string | undefined>>;
|
|
18
|
+
export declare const formInputsInjectionKey: InjectionKey<Ref<Record<string, {
|
|
19
|
+
id?: string;
|
|
20
|
+
pattern?: RegExp;
|
|
21
|
+
}>>>;
|
|
22
|
+
export declare const formLoadingInjectionKey: InjectionKey<Readonly<Ref<boolean>>>;
|
|
23
|
+
export declare function useFormField<T>(props?: Props<T>, opts?: {
|
|
24
|
+
bind?: boolean;
|
|
25
|
+
deferInputValidation?: boolean;
|
|
26
|
+
}): {
|
|
27
|
+
id: ComputedRef<string | undefined>;
|
|
28
|
+
name: ComputedRef<string | undefined>;
|
|
29
|
+
size: ComputedRef<"xs" | "sm" | "md" | "lg" | "xl" | NonNullable<GetObjectField<T, "size">> | undefined>;
|
|
30
|
+
color: ComputedRef<"error" | GetObjectField<T, "color"> | undefined>;
|
|
31
|
+
highlight: ComputedRef<boolean | undefined>;
|
|
32
|
+
disabled: ComputedRef<boolean | undefined>;
|
|
33
|
+
emitFormBlur: () => void;
|
|
34
|
+
emitFormInput: import("@vueuse/shared").UseDebounceFnReturn<() => void>;
|
|
35
|
+
emitFormChange: () => void;
|
|
36
|
+
emitFormFocus: () => void;
|
|
37
|
+
ariaAttrs: ComputedRef<{
|
|
38
|
+
'aria-describedby': string;
|
|
39
|
+
'aria-invalid': boolean;
|
|
40
|
+
} | undefined>;
|
|
41
|
+
};
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { inject, computed, provide } from "vue";
|
|
2
|
+
import { useDebounceFn } from "@vueuse/core";
|
|
3
|
+
export const formOptionsInjectionKey = Symbol("nuxt-ui.form-options");
|
|
4
|
+
export const formBusInjectionKey = Symbol("nuxt-ui.form-events");
|
|
5
|
+
export const formFieldInjectionKey = Symbol("nuxt-ui.form-field");
|
|
6
|
+
export const inputIdInjectionKey = Symbol("nuxt-ui.input-id");
|
|
7
|
+
export const formInputsInjectionKey = Symbol("nuxt-ui.form-inputs");
|
|
8
|
+
export const formLoadingInjectionKey = Symbol("nuxt-ui.form-loading");
|
|
9
|
+
export function useFormField(props, opts) {
|
|
10
|
+
const formOptions = inject(formOptionsInjectionKey, void 0);
|
|
11
|
+
const formBus = inject(formBusInjectionKey, void 0);
|
|
12
|
+
const formField = inject(formFieldInjectionKey, void 0);
|
|
13
|
+
const formInputs = inject(formInputsInjectionKey, void 0);
|
|
14
|
+
const inputId = inject(inputIdInjectionKey, void 0);
|
|
15
|
+
provide(formFieldInjectionKey, void 0);
|
|
16
|
+
if (formField && inputId) {
|
|
17
|
+
if (opts?.bind === false) {
|
|
18
|
+
inputId.value = void 0;
|
|
19
|
+
} else if (props?.id) {
|
|
20
|
+
inputId.value = props?.id;
|
|
21
|
+
}
|
|
22
|
+
if (formInputs && formField.value.name && inputId.value) {
|
|
23
|
+
formInputs.value[formField.value.name] = { id: inputId.value, pattern: formField.value.errorPattern };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function emitFormEvent(type, name, eager) {
|
|
27
|
+
if (formBus && formField && name) {
|
|
28
|
+
formBus.emit({ type, name, eager });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function emitFormBlur() {
|
|
32
|
+
emitFormEvent("blur", formField?.value.name);
|
|
33
|
+
}
|
|
34
|
+
function emitFormFocus() {
|
|
35
|
+
emitFormEvent("focus", formField?.value.name);
|
|
36
|
+
}
|
|
37
|
+
function emitFormChange() {
|
|
38
|
+
emitFormEvent("change", formField?.value.name);
|
|
39
|
+
}
|
|
40
|
+
const emitFormInput = useDebounceFn(
|
|
41
|
+
() => {
|
|
42
|
+
emitFormEvent("input", formField?.value.name, !opts?.deferInputValidation || formField?.value.eagerValidation);
|
|
43
|
+
},
|
|
44
|
+
formField?.value.validateOnInputDelay ?? formOptions?.value.validateOnInputDelay ?? 0
|
|
45
|
+
);
|
|
46
|
+
return {
|
|
47
|
+
id: computed(() => props?.id ?? inputId?.value),
|
|
48
|
+
name: computed(() => props?.name ?? formField?.value.name),
|
|
49
|
+
size: computed(() => props?.size ?? formField?.value.size),
|
|
50
|
+
color: computed(() => formField?.value.error ? "error" : props?.color),
|
|
51
|
+
highlight: computed(() => formField?.value.error ? true : props?.highlight),
|
|
52
|
+
disabled: computed(() => formOptions?.value.disabled || props?.disabled),
|
|
53
|
+
emitFormBlur,
|
|
54
|
+
emitFormInput,
|
|
55
|
+
emitFormChange,
|
|
56
|
+
emitFormFocus,
|
|
57
|
+
ariaAttrs: computed(() => {
|
|
58
|
+
if (!formField?.value) return;
|
|
59
|
+
const descriptiveAttrs = ["error", "hint", "description", "help"].filter((type) => formField?.value?.[type]).map((type) => `${formField?.value.ariaId}-${type}`) || [];
|
|
60
|
+
return {
|
|
61
|
+
"aria-describedby": descriptiveAttrs.join(" "),
|
|
62
|
+
"aria-invalid": !!formField?.value.error
|
|
63
|
+
};
|
|
64
|
+
})
|
|
65
|
+
};
|
|
66
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
type KbdKeysSpecificMap = {
|
|
2
|
+
meta: string;
|
|
3
|
+
alt: string;
|
|
4
|
+
ctrl: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const kbdKeysMap: {
|
|
7
|
+
meta: string;
|
|
8
|
+
ctrl: string;
|
|
9
|
+
alt: string;
|
|
10
|
+
win: string;
|
|
11
|
+
command: string;
|
|
12
|
+
shift: string;
|
|
13
|
+
control: string;
|
|
14
|
+
option: string;
|
|
15
|
+
enter: string;
|
|
16
|
+
delete: string;
|
|
17
|
+
backspace: string;
|
|
18
|
+
escape: string;
|
|
19
|
+
tab: string;
|
|
20
|
+
capslock: string;
|
|
21
|
+
arrowup: string;
|
|
22
|
+
arrowright: string;
|
|
23
|
+
arrowdown: string;
|
|
24
|
+
arrowleft: string;
|
|
25
|
+
pageup: string;
|
|
26
|
+
pagedown: string;
|
|
27
|
+
home: string;
|
|
28
|
+
end: string;
|
|
29
|
+
};
|
|
30
|
+
export type KbdKey = keyof typeof kbdKeysMap;
|
|
31
|
+
export type KbdKeySpecific = keyof KbdKeysSpecificMap;
|
|
32
|
+
export declare const useKbd: () => {
|
|
33
|
+
macOS: import("vue").ComputedRef<false | "" | RegExpMatchArray | null | undefined>;
|
|
34
|
+
getKbdKey: (value?: KbdKey | string) => string | undefined;
|
|
35
|
+
};
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { reactive, computed, onMounted } from "vue";
|
|
2
|
+
import { createSharedComposable } from "@vueuse/core";
|
|
3
|
+
export const kbdKeysMap = {
|
|
4
|
+
meta: "",
|
|
5
|
+
ctrl: "",
|
|
6
|
+
alt: "",
|
|
7
|
+
win: "\u229E",
|
|
8
|
+
command: "\u2318",
|
|
9
|
+
shift: "\u21E7",
|
|
10
|
+
control: "\u2303",
|
|
11
|
+
option: "\u2325",
|
|
12
|
+
enter: "\u21B5",
|
|
13
|
+
delete: "\u2326",
|
|
14
|
+
backspace: "\u232B",
|
|
15
|
+
escape: "\u238B",
|
|
16
|
+
tab: "\u21E5",
|
|
17
|
+
capslock: "\u21EA",
|
|
18
|
+
arrowup: "\u2191",
|
|
19
|
+
arrowright: "\u2192",
|
|
20
|
+
arrowdown: "\u2193",
|
|
21
|
+
arrowleft: "\u2190",
|
|
22
|
+
pageup: "\u21DE",
|
|
23
|
+
pagedown: "\u21DF",
|
|
24
|
+
home: "\u2196",
|
|
25
|
+
end: "\u2198"
|
|
26
|
+
};
|
|
27
|
+
const _useKbd = () => {
|
|
28
|
+
const macOS = computed(() => import.meta.client && navigator && navigator.userAgent && navigator.userAgent.match(/Macintosh;/));
|
|
29
|
+
const kbdKeysSpecificMap = reactive({
|
|
30
|
+
meta: " ",
|
|
31
|
+
alt: " ",
|
|
32
|
+
ctrl: " "
|
|
33
|
+
});
|
|
34
|
+
onMounted(() => {
|
|
35
|
+
kbdKeysSpecificMap.meta = macOS.value ? kbdKeysMap.command : "Ctrl";
|
|
36
|
+
kbdKeysSpecificMap.ctrl = macOS.value ? kbdKeysMap.control : "Ctrl";
|
|
37
|
+
kbdKeysSpecificMap.alt = macOS.value ? kbdKeysMap.option : "Alt";
|
|
38
|
+
});
|
|
39
|
+
function getKbdKey(value) {
|
|
40
|
+
if (!value) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (["meta", "alt", "ctrl"].includes(value)) {
|
|
44
|
+
return kbdKeysSpecificMap[value];
|
|
45
|
+
}
|
|
46
|
+
return kbdKeysMap[value] || value.toUpperCase();
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
macOS,
|
|
50
|
+
getKbdKey
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export const useKbd = /* @__PURE__ */ createSharedComposable(_useKbd);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { InjectionKey, Ref } from 'vue';
|
|
2
|
+
import type { Locale, Messages } from '../types/locale';
|
|
3
|
+
export declare const localeContextInjectionKey: InjectionKey<Ref<Locale<unknown> | undefined>>;
|
|
4
|
+
export declare const useLocale: (localeOverrides?: Ref<Locale<Messages> | undefined>) => import("../utils/locale").LocaleContext<Messages>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { computed, inject, toRef } from "vue";
|
|
2
|
+
import { createSharedComposable } from "@vueuse/core";
|
|
3
|
+
import { buildLocaleContext } from "../utils/locale.js";
|
|
4
|
+
import en from "../locale/en.js";
|
|
5
|
+
export const localeContextInjectionKey = Symbol.for("nuxt-ui.locale-context");
|
|
6
|
+
const _useLocale = (localeOverrides) => {
|
|
7
|
+
const locale = localeOverrides || toRef(inject(localeContextInjectionKey));
|
|
8
|
+
return buildLocaleContext(computed(() => locale.value || en));
|
|
9
|
+
};
|
|
10
|
+
export const useLocale = /* @__PURE__ */ createSharedComposable(_useLocale);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { computed, inject, toRef } from "vue";
|
|
2
|
+
import { createSharedComposable } from "@vueuse/core";
|
|
3
|
+
import { buildLocaleContext } from "../utils/locale.js";
|
|
4
|
+
import en from "../locale/en.js";
|
|
5
|
+
import { localeContextInjectionKey } from "./useLocale.js";
|
|
6
|
+
const _useLocalePro = (localeOverrides) => {
|
|
7
|
+
const injectedLocale = inject(localeContextInjectionKey);
|
|
8
|
+
const locale = localeOverrides || toRef(injectedLocale);
|
|
9
|
+
return buildLocaleContext(computed(() => locale.value || en));
|
|
10
|
+
};
|
|
11
|
+
export const useLocalePro = /* @__PURE__ */ createSharedComposable(_useLocalePro);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
import type { ComponentProps, ComponentEmit } from 'vue-component-type-helpers';
|
|
3
|
+
type CloseEventArgType<T> = T extends (event: 'close', args_0: infer R) => void ? R : never;
|
|
4
|
+
export type OverlayOptions<OverlayAttrs = Record<string, any>> = {
|
|
5
|
+
defaultOpen?: boolean;
|
|
6
|
+
props?: OverlayAttrs;
|
|
7
|
+
destroyOnClose?: boolean;
|
|
8
|
+
};
|
|
9
|
+
interface ManagedOverlayOptionsPrivate<T extends Component> {
|
|
10
|
+
component?: T;
|
|
11
|
+
id: symbol;
|
|
12
|
+
isMounted: boolean;
|
|
13
|
+
isOpen: boolean;
|
|
14
|
+
originalProps?: ComponentProps<T>;
|
|
15
|
+
resolvePromise?: (value: any) => void;
|
|
16
|
+
}
|
|
17
|
+
export type Overlay = OverlayOptions<Component> & ManagedOverlayOptionsPrivate<Component>;
|
|
18
|
+
type OverlayInstance<T extends Component> = Omit<ManagedOverlayOptionsPrivate<T>, 'component'> & {
|
|
19
|
+
id: symbol;
|
|
20
|
+
open: (props?: ComponentProps<T>) => OpenedOverlay<T>;
|
|
21
|
+
close: (value?: any) => void;
|
|
22
|
+
patch: (props: Partial<ComponentProps<T>>) => void;
|
|
23
|
+
};
|
|
24
|
+
type OpenedOverlay<T extends Component> = Omit<OverlayInstance<T>, 'open' | 'close' | 'patch' | 'modelValue' | 'resolvePromise'> & {
|
|
25
|
+
result: Promise<CloseEventArgType<ComponentEmit<T>>>;
|
|
26
|
+
};
|
|
27
|
+
declare function _useOverlay(): {
|
|
28
|
+
overlays: import("vue").ShallowReactive<Overlay[]>;
|
|
29
|
+
open: <T extends Component>(id: symbol, props?: ComponentProps<T>) => OpenedOverlay<T>;
|
|
30
|
+
close: (id: symbol, value?: any) => void;
|
|
31
|
+
closeAll: () => void;
|
|
32
|
+
create: <T extends Component>(component: T, _options?: OverlayOptions<ComponentProps<T>>) => OverlayInstance<T>;
|
|
33
|
+
patch: <T extends Component>(id: symbol, props: Partial<ComponentProps<T>>) => void;
|
|
34
|
+
unmount: (id: symbol) => void;
|
|
35
|
+
isOpen: (id: symbol) => boolean;
|
|
36
|
+
};
|
|
37
|
+
export declare const useOverlay: typeof _useOverlay;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { reactive, markRaw, shallowReactive } from "vue";
|
|
2
|
+
import { createSharedComposable } from "@vueuse/core";
|
|
3
|
+
function _useOverlay() {
|
|
4
|
+
const overlays = shallowReactive([]);
|
|
5
|
+
const create = (component, _options) => {
|
|
6
|
+
const { props, defaultOpen, destroyOnClose } = _options || {};
|
|
7
|
+
const options = reactive({
|
|
8
|
+
id: Symbol(import.meta.dev ? "useOverlay" : ""),
|
|
9
|
+
isOpen: !!defaultOpen,
|
|
10
|
+
component: markRaw(component),
|
|
11
|
+
isMounted: !!defaultOpen,
|
|
12
|
+
destroyOnClose: !!destroyOnClose,
|
|
13
|
+
originalProps: props || {},
|
|
14
|
+
props: { ...props || {} }
|
|
15
|
+
});
|
|
16
|
+
overlays.push(options);
|
|
17
|
+
return {
|
|
18
|
+
...options,
|
|
19
|
+
open: (props2) => open(options.id, props2),
|
|
20
|
+
close: (value) => close(options.id, value),
|
|
21
|
+
patch: (props2) => patch(options.id, props2)
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
const open = (id, props) => {
|
|
25
|
+
const overlay = getOverlay(id);
|
|
26
|
+
if (props) {
|
|
27
|
+
patch(overlay.id, props);
|
|
28
|
+
} else {
|
|
29
|
+
patch(overlay.id, overlay.originalProps);
|
|
30
|
+
}
|
|
31
|
+
overlay.isOpen = true;
|
|
32
|
+
overlay.isMounted = true;
|
|
33
|
+
return {
|
|
34
|
+
id,
|
|
35
|
+
isMounted: overlay.isMounted,
|
|
36
|
+
isOpen: overlay.isOpen,
|
|
37
|
+
result: new Promise((resolve) => overlay.resolvePromise = resolve)
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
const close = (id, value) => {
|
|
41
|
+
const overlay = getOverlay(id);
|
|
42
|
+
overlay.isOpen = false;
|
|
43
|
+
if (overlay.resolvePromise) {
|
|
44
|
+
overlay.resolvePromise(value);
|
|
45
|
+
overlay.resolvePromise = void 0;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const closeAll = () => {
|
|
49
|
+
overlays.forEach((overlay) => close(overlay.id));
|
|
50
|
+
};
|
|
51
|
+
const unmount = (id) => {
|
|
52
|
+
const overlay = getOverlay(id);
|
|
53
|
+
overlay.isMounted = false;
|
|
54
|
+
if (overlay.destroyOnClose) {
|
|
55
|
+
const index = overlays.findIndex((overlay2) => overlay2.id === id);
|
|
56
|
+
overlays.splice(index, 1);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const patch = (id, props) => {
|
|
60
|
+
const overlay = getOverlay(id);
|
|
61
|
+
overlay.props = { ...props };
|
|
62
|
+
};
|
|
63
|
+
const getOverlay = (id) => {
|
|
64
|
+
const overlay = overlays.find((overlay2) => overlay2.id === id);
|
|
65
|
+
if (!overlay) {
|
|
66
|
+
throw new Error("Overlay not found");
|
|
67
|
+
}
|
|
68
|
+
return overlay;
|
|
69
|
+
};
|
|
70
|
+
const isOpen = (id) => {
|
|
71
|
+
const overlay = getOverlay(id);
|
|
72
|
+
return overlay.isOpen;
|
|
73
|
+
};
|
|
74
|
+
return {
|
|
75
|
+
overlays,
|
|
76
|
+
open,
|
|
77
|
+
close,
|
|
78
|
+
closeAll,
|
|
79
|
+
create,
|
|
80
|
+
patch,
|
|
81
|
+
unmount,
|
|
82
|
+
isOpen
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
export const useOverlay = /* @__PURE__ */ createSharedComposable(_useOverlay);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Ref, type InjectionKey } from 'vue';
|
|
2
|
+
export declare const portalTargetInjectionKey: InjectionKey<Ref<string | HTMLElement>>;
|
|
3
|
+
export declare function usePortal(portal: Ref<string | HTMLElement | boolean | undefined>): import("vue").ComputedRef<{
|
|
4
|
+
to: string | HTMLElement;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { inject, provide, computed } from "vue";
|
|
2
|
+
export const portalTargetInjectionKey = Symbol("nuxt-ui.portal-target");
|
|
3
|
+
export function usePortal(portal) {
|
|
4
|
+
const portalTarget = inject(portalTargetInjectionKey, void 0);
|
|
5
|
+
const to = computed(() => {
|
|
6
|
+
if (typeof portal.value === "boolean" || portal.value === void 0) {
|
|
7
|
+
return portalTarget?.value ?? "body";
|
|
8
|
+
}
|
|
9
|
+
return portal.value;
|
|
10
|
+
});
|
|
11
|
+
const disabled = computed(() => typeof portal.value === "boolean" ? !portal.value : false);
|
|
12
|
+
provide(portalTargetInjectionKey, computed(() => to.value));
|
|
13
|
+
return computed(() => ({
|
|
14
|
+
to: to.value,
|
|
15
|
+
disabled: disabled.value
|
|
16
|
+
}));
|
|
17
|
+
}
|