@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,92 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/timeline";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { Primitive, Separator } from "reka-ui";
|
|
8
|
+
import { useAppConfig } from "#imports";
|
|
9
|
+
import { tv } from "../utils/tv";
|
|
10
|
+
import UAvatar from "./Avatar.vue";
|
|
11
|
+
const props = defineProps({
|
|
12
|
+
as: { type: null, required: false },
|
|
13
|
+
items: { type: Array, required: true },
|
|
14
|
+
size: { type: null, required: false },
|
|
15
|
+
color: { type: null, required: false },
|
|
16
|
+
orientation: { type: null, required: false, default: "vertical" },
|
|
17
|
+
defaultValue: { type: [String, Number], required: false },
|
|
18
|
+
reverse: { type: Boolean, required: false },
|
|
19
|
+
class: { type: null, required: false },
|
|
20
|
+
ui: { type: null, required: false }
|
|
21
|
+
});
|
|
22
|
+
const slots = defineSlots();
|
|
23
|
+
const modelValue = defineModel({ type: [String, Number] });
|
|
24
|
+
const appConfig = useAppConfig();
|
|
25
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.timeline || {} })({
|
|
26
|
+
orientation: props.orientation,
|
|
27
|
+
size: props.size,
|
|
28
|
+
color: props.color,
|
|
29
|
+
reverse: props.reverse
|
|
30
|
+
}));
|
|
31
|
+
const currentStepIndex = computed(() => {
|
|
32
|
+
const value = modelValue.value ?? props.defaultValue;
|
|
33
|
+
if (typeof value === "string") {
|
|
34
|
+
return props.items.findIndex((item) => item.value === value) ?? -1;
|
|
35
|
+
}
|
|
36
|
+
if (props.reverse) {
|
|
37
|
+
return value != null ? props.items.length - 1 - value : -1;
|
|
38
|
+
} else {
|
|
39
|
+
return value ?? -1;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
function getItemState(index) {
|
|
43
|
+
if (currentStepIndex.value === -1) return void 0;
|
|
44
|
+
if (index === currentStepIndex.value) return "active";
|
|
45
|
+
if (props.reverse) {
|
|
46
|
+
return index > currentStepIndex.value ? "completed" : void 0;
|
|
47
|
+
} else {
|
|
48
|
+
return index < currentStepIndex.value ? "completed" : void 0;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<template>
|
|
54
|
+
<Primitive :as="as" :data-orientation="orientation" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
55
|
+
<div
|
|
56
|
+
v-for="(item, index) in items"
|
|
57
|
+
:key="item.value ?? index"
|
|
58
|
+
:class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class] })"
|
|
59
|
+
:data-state="getItemState(index)"
|
|
60
|
+
>
|
|
61
|
+
<div :class="ui.container({ class: [props.ui?.container, item.ui?.container] })">
|
|
62
|
+
<UAvatar :size="size" :icon="item.icon" v-bind="typeof item.avatar === 'object' ? item.avatar : {}" :class="ui.indicator({ class: [props.ui?.indicator, item.ui?.indicator] })" :ui="{ icon: 'text-inherit', fallback: 'text-inherit' }">
|
|
63
|
+
<slot :name="item.slot ? `${item.slot}-indicator` : 'indicator'" :item="item" />
|
|
64
|
+
</UAvatar>
|
|
65
|
+
|
|
66
|
+
<Separator
|
|
67
|
+
v-if="index < items.length - 1"
|
|
68
|
+
:class="ui.separator({ class: [props.ui?.separator, item.ui?.separator] })"
|
|
69
|
+
:orientation="props.orientation"
|
|
70
|
+
/>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<div :class="ui.wrapper({ class: [props.ui?.wrapper, item.ui?.wrapper] })">
|
|
74
|
+
<div v-if="item.date" :class="ui.date({ class: [props.ui?.date, item.ui?.date] })">
|
|
75
|
+
<slot :name="item.slot ? `${item.slot}-date` : 'date'" :item="item">
|
|
76
|
+
{{ item.date }}
|
|
77
|
+
</slot>
|
|
78
|
+
</div>
|
|
79
|
+
<div v-if="item.title || !!slots.title" :class="ui.title({ class: [props.ui?.title, item.ui?.title] })">
|
|
80
|
+
<slot :name="item.slot ? `${item.slot}-title` : 'title'" :item="item">
|
|
81
|
+
{{ item.title }}
|
|
82
|
+
</slot>
|
|
83
|
+
</div>
|
|
84
|
+
<div v-if="item.description || !!slots.description" :class="ui.description({ class: [props.ui?.description, item.ui?.description] })">
|
|
85
|
+
<slot :name="item.slot ? `${item.slot}-description` : 'description'" :item="item">
|
|
86
|
+
{{ item.description }}
|
|
87
|
+
</slot>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</Primitive>
|
|
92
|
+
</template>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
2
|
+
import theme from '#build/ui/timeline';
|
|
3
|
+
import type { AvatarProps } from '../types';
|
|
4
|
+
import type { DynamicSlots, ComponentConfig } from '../types/utils';
|
|
5
|
+
type Timeline = ComponentConfig<typeof theme, AppConfig, 'timeline'>;
|
|
6
|
+
export interface TimelineItem {
|
|
7
|
+
date?: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
icon?: string;
|
|
11
|
+
avatar?: AvatarProps;
|
|
12
|
+
value?: string | number;
|
|
13
|
+
slot?: string;
|
|
14
|
+
class?: any;
|
|
15
|
+
ui?: Pick<Timeline['slots'], 'item' | 'container' | 'indicator' | 'separator' | 'wrapper' | 'date' | 'title' | 'description'>;
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}
|
|
18
|
+
export interface TimelineProps<T extends TimelineItem = TimelineItem> {
|
|
19
|
+
/**
|
|
20
|
+
* The element or component this component should render as.
|
|
21
|
+
* @defaultValue 'div'
|
|
22
|
+
*/
|
|
23
|
+
as?: any;
|
|
24
|
+
items: T[];
|
|
25
|
+
/**
|
|
26
|
+
* @defaultValue 'md'
|
|
27
|
+
*/
|
|
28
|
+
size?: Timeline['variants']['size'];
|
|
29
|
+
/**
|
|
30
|
+
* @defaultValue 'primary'
|
|
31
|
+
*/
|
|
32
|
+
color?: Timeline['variants']['color'];
|
|
33
|
+
/**
|
|
34
|
+
* The orientation of the Timeline.
|
|
35
|
+
* @defaultValue 'vertical'
|
|
36
|
+
*/
|
|
37
|
+
orientation?: Timeline['variants']['orientation'];
|
|
38
|
+
defaultValue?: string | number;
|
|
39
|
+
reverse?: boolean;
|
|
40
|
+
class?: any;
|
|
41
|
+
ui?: Timeline['slots'];
|
|
42
|
+
}
|
|
43
|
+
type SlotProps<T extends TimelineItem> = (props: {
|
|
44
|
+
item: T;
|
|
45
|
+
}) => any;
|
|
46
|
+
export type TimelineSlots<T extends TimelineItem = TimelineItem> = {
|
|
47
|
+
indicator: SlotProps<T>;
|
|
48
|
+
date: SlotProps<T>;
|
|
49
|
+
title: SlotProps<T>;
|
|
50
|
+
description: SlotProps<T>;
|
|
51
|
+
} & DynamicSlots<T, 'indicator' | 'date' | 'title' | 'description', {
|
|
52
|
+
item: T;
|
|
53
|
+
}>;
|
|
54
|
+
declare const _default: <T extends TimelineItem>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
55
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
56
|
+
readonly "onUpdate:modelValue"?: ((value: string | number | undefined) => any) | undefined;
|
|
57
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:modelValue"> & (TimelineProps<T> & {
|
|
58
|
+
modelValue?: string | number;
|
|
59
|
+
}) & Partial<{}>> & import("vue").PublicProps;
|
|
60
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
61
|
+
attrs: any;
|
|
62
|
+
slots: TimelineSlots<T>;
|
|
63
|
+
emit: (evt: "update:modelValue", value: string | number | undefined) => void;
|
|
64
|
+
}>) => import("vue").VNode & {
|
|
65
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
66
|
+
};
|
|
67
|
+
export default _default;
|
|
68
|
+
type __VLS_PrettifyLocal<T> = {
|
|
69
|
+
[K in keyof T]: T[K];
|
|
70
|
+
} & {};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/toast";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { ref, computed, onMounted, nextTick } from "vue";
|
|
7
|
+
import { ToastRoot, ToastTitle, ToastDescription, ToastAction, ToastClose, useForwardPropsEmits } from "reka-ui";
|
|
8
|
+
import { reactivePick } from "@vueuse/core";
|
|
9
|
+
import { useAppConfig } from "#imports";
|
|
10
|
+
import { useLocale } from "../composables/useLocale";
|
|
11
|
+
import { tv } from "../utils/tv";
|
|
12
|
+
import UIcon from "./Icon.vue";
|
|
13
|
+
import UAvatar from "./Avatar.vue";
|
|
14
|
+
import UButton from "./Button.vue";
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
as: { type: null, required: false },
|
|
17
|
+
title: { type: [String, Object, Function], required: false },
|
|
18
|
+
description: { type: [String, Object, Function], required: false },
|
|
19
|
+
icon: { type: String, required: false },
|
|
20
|
+
avatar: { type: Object, required: false },
|
|
21
|
+
color: { type: null, required: false },
|
|
22
|
+
orientation: { type: null, required: false, default: "vertical" },
|
|
23
|
+
progress: { type: Boolean, required: false, default: true },
|
|
24
|
+
actions: { type: Array, required: false },
|
|
25
|
+
close: { type: [Boolean, Object], required: false, default: true },
|
|
26
|
+
closeIcon: { type: String, required: false },
|
|
27
|
+
class: { type: null, required: false },
|
|
28
|
+
ui: { type: null, required: false },
|
|
29
|
+
defaultOpen: { type: Boolean, required: false },
|
|
30
|
+
open: { type: Boolean, required: false },
|
|
31
|
+
type: { type: String, required: false },
|
|
32
|
+
duration: { type: Number, required: false }
|
|
33
|
+
});
|
|
34
|
+
const emits = defineEmits(["escapeKeyDown", "pause", "resume", "swipeStart", "swipeMove", "swipeCancel", "swipeEnd", "update:open"]);
|
|
35
|
+
const slots = defineSlots();
|
|
36
|
+
const { t } = useLocale();
|
|
37
|
+
const appConfig = useAppConfig();
|
|
38
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, "as", "defaultOpen", "open", "duration", "type"), emits);
|
|
39
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.toast || {} })({
|
|
40
|
+
color: props.color,
|
|
41
|
+
orientation: props.orientation,
|
|
42
|
+
title: !!props.title || !!slots.title
|
|
43
|
+
}));
|
|
44
|
+
const el = ref();
|
|
45
|
+
const height = ref(0);
|
|
46
|
+
onMounted(() => {
|
|
47
|
+
if (!el.value) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
nextTick(() => {
|
|
51
|
+
height.value = el.value?.$el?.getBoundingClientRect()?.height;
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
defineExpose({
|
|
55
|
+
height
|
|
56
|
+
});
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<template>
|
|
60
|
+
<ToastRoot
|
|
61
|
+
ref="el"
|
|
62
|
+
v-slot="{ remaining, duration }"
|
|
63
|
+
v-bind="rootProps"
|
|
64
|
+
:data-orientation="orientation"
|
|
65
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
66
|
+
:style="{ '--height': height }"
|
|
67
|
+
>
|
|
68
|
+
<slot name="leading">
|
|
69
|
+
<UAvatar v-if="avatar" :size="props.ui?.avatarSize || ui.avatarSize()" v-bind="avatar" :class="ui.avatar({ class: props.ui?.avatar })" />
|
|
70
|
+
<UIcon v-else-if="icon" :name="icon" :class="ui.icon({ class: props.ui?.icon })" />
|
|
71
|
+
</slot>
|
|
72
|
+
|
|
73
|
+
<div :class="ui.wrapper({ class: props.ui?.wrapper })">
|
|
74
|
+
<ToastTitle v-if="title || !!slots.title" :class="ui.title({ class: props.ui?.title })">
|
|
75
|
+
<slot name="title">
|
|
76
|
+
<component :is="title()" v-if="typeof title === 'function'" />
|
|
77
|
+
<component :is="title" v-else-if="typeof title === 'object'" />
|
|
78
|
+
<template v-else>
|
|
79
|
+
{{ title }}
|
|
80
|
+
</template>
|
|
81
|
+
</slot>
|
|
82
|
+
</ToastTitle>
|
|
83
|
+
<ToastDescription v-if="description || !!slots.description" :class="ui.description({ class: props.ui?.description })">
|
|
84
|
+
<slot name="description">
|
|
85
|
+
<component :is="description()" v-if="typeof description === 'function'" />
|
|
86
|
+
<component :is="description" v-else-if="typeof description === 'object'" />
|
|
87
|
+
<template v-else>
|
|
88
|
+
{{ description }}
|
|
89
|
+
</template>
|
|
90
|
+
</slot>
|
|
91
|
+
</ToastDescription>
|
|
92
|
+
|
|
93
|
+
<div v-if="orientation === 'vertical' && (actions?.length || !!slots.actions)" :class="ui.actions({ class: props.ui?.actions })">
|
|
94
|
+
<slot name="actions">
|
|
95
|
+
<ToastAction v-for="(action, index) in actions" :key="index" :alt-text="action.label || 'Action'" as-child @click.stop>
|
|
96
|
+
<UButton size="xs" :color="color" v-bind="action" />
|
|
97
|
+
</ToastAction>
|
|
98
|
+
</slot>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<div v-if="orientation === 'horizontal' && (actions?.length || !!slots.actions) || close" :class="ui.actions({ class: props.ui?.actions, orientation: 'horizontal' })">
|
|
103
|
+
<template v-if="orientation === 'horizontal' && (actions?.length || !!slots.actions)">
|
|
104
|
+
<slot name="actions">
|
|
105
|
+
<ToastAction v-for="(action, index) in actions" :key="index" :alt-text="action.label || 'Action'" as-child @click.stop>
|
|
106
|
+
<UButton size="xs" :color="color" v-bind="action" />
|
|
107
|
+
</ToastAction>
|
|
108
|
+
</slot>
|
|
109
|
+
</template>
|
|
110
|
+
|
|
111
|
+
<ToastClose v-if="close || !!slots.close" as-child>
|
|
112
|
+
<slot name="close" :ui="ui">
|
|
113
|
+
<UButton
|
|
114
|
+
v-if="close"
|
|
115
|
+
:icon="closeIcon || appConfig.ui.icons.close"
|
|
116
|
+
color="neutral"
|
|
117
|
+
variant="link"
|
|
118
|
+
:aria-label="t('toast.close')"
|
|
119
|
+
v-bind="typeof close === 'object' ? close : {}"
|
|
120
|
+
:class="ui.close({ class: props.ui?.close })"
|
|
121
|
+
@click.stop
|
|
122
|
+
/>
|
|
123
|
+
</slot>
|
|
124
|
+
</ToastClose>
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
<div v-if="progress && remaining > 0 && duration" :class="ui.progress({ class: props.ui?.progress })" :style="{ width: `${remaining / duration * 100}%` }" />
|
|
128
|
+
</ToastRoot>
|
|
129
|
+
</template>
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import type { ToastRootProps, ToastRootEmits } from 'reka-ui';
|
|
2
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
3
|
+
import theme from '#build/ui/toast';
|
|
4
|
+
import type { AvatarProps, ButtonProps } from '../types';
|
|
5
|
+
import type { StringOrVNode, ComponentConfig } from '../types/utils';
|
|
6
|
+
type Toast = ComponentConfig<typeof theme, AppConfig, 'toast'>;
|
|
7
|
+
export interface ToastProps extends Pick<ToastRootProps, 'defaultOpen' | 'open' | 'type' | 'duration'> {
|
|
8
|
+
/**
|
|
9
|
+
* The element or component this component should render as.
|
|
10
|
+
* @defaultValue 'li'
|
|
11
|
+
*/
|
|
12
|
+
as?: any;
|
|
13
|
+
title?: StringOrVNode;
|
|
14
|
+
description?: StringOrVNode;
|
|
15
|
+
/**
|
|
16
|
+
* @IconifyIcon
|
|
17
|
+
*/
|
|
18
|
+
icon?: string;
|
|
19
|
+
avatar?: AvatarProps;
|
|
20
|
+
/**
|
|
21
|
+
* @defaultValue 'primary'
|
|
22
|
+
*/
|
|
23
|
+
color?: Toast['variants']['color'];
|
|
24
|
+
/**
|
|
25
|
+
* The orientation between the content and the actions.
|
|
26
|
+
* @defaultValue 'vertical'
|
|
27
|
+
*/
|
|
28
|
+
orientation?: Toast['variants']['orientation'];
|
|
29
|
+
/**
|
|
30
|
+
* Whether to show the progress bar.
|
|
31
|
+
* @defaultValue true
|
|
32
|
+
*/
|
|
33
|
+
progress?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Display a list of actions:
|
|
36
|
+
* - under the title and description when orientation is `vertical`
|
|
37
|
+
* - next to the close button when orientation is `horizontal`
|
|
38
|
+
* `{ size: 'xs' }`{lang="ts-type"}
|
|
39
|
+
*/
|
|
40
|
+
actions?: ButtonProps[];
|
|
41
|
+
/**
|
|
42
|
+
* Display a close button to dismiss the toast.
|
|
43
|
+
* `{ size: 'md', color: 'neutral', variant: 'link' }`{lang="ts-type"}
|
|
44
|
+
* @defaultValue true
|
|
45
|
+
*/
|
|
46
|
+
close?: boolean | Partial<ButtonProps>;
|
|
47
|
+
/**
|
|
48
|
+
* The icon displayed in the close button.
|
|
49
|
+
* @defaultValue appConfig.ui.icons.close
|
|
50
|
+
* @IconifyIcon
|
|
51
|
+
*/
|
|
52
|
+
closeIcon?: string;
|
|
53
|
+
class?: any;
|
|
54
|
+
ui?: Toast['slots'];
|
|
55
|
+
}
|
|
56
|
+
export interface ToastEmits extends ToastRootEmits {
|
|
57
|
+
}
|
|
58
|
+
export interface ToastSlots {
|
|
59
|
+
leading(props?: {}): any;
|
|
60
|
+
title(props?: {}): any;
|
|
61
|
+
description(props?: {}): any;
|
|
62
|
+
actions(props?: {}): any;
|
|
63
|
+
close(props: {
|
|
64
|
+
ui: {
|
|
65
|
+
[K in keyof Required<Toast['slots']>]: (props?: Record<string, any>) => string;
|
|
66
|
+
};
|
|
67
|
+
}): any;
|
|
68
|
+
}
|
|
69
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ToastProps, {
|
|
70
|
+
height: import("vue").Ref<number, number>;
|
|
71
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
72
|
+
resume: () => any;
|
|
73
|
+
pause: () => any;
|
|
74
|
+
"update:open": (value: boolean) => any;
|
|
75
|
+
escapeKeyDown: (event: KeyboardEvent) => any;
|
|
76
|
+
swipeStart: (event: {
|
|
77
|
+
currentTarget: EventTarget & HTMLElement;
|
|
78
|
+
} & Omit<CustomEvent<{
|
|
79
|
+
originalEvent: PointerEvent;
|
|
80
|
+
delta: {
|
|
81
|
+
x: number;
|
|
82
|
+
y: number;
|
|
83
|
+
};
|
|
84
|
+
}>, "currentTarget">) => any;
|
|
85
|
+
swipeMove: (event: {
|
|
86
|
+
currentTarget: EventTarget & HTMLElement;
|
|
87
|
+
} & Omit<CustomEvent<{
|
|
88
|
+
originalEvent: PointerEvent;
|
|
89
|
+
delta: {
|
|
90
|
+
x: number;
|
|
91
|
+
y: number;
|
|
92
|
+
};
|
|
93
|
+
}>, "currentTarget">) => any;
|
|
94
|
+
swipeCancel: (event: {
|
|
95
|
+
currentTarget: EventTarget & HTMLElement;
|
|
96
|
+
} & Omit<CustomEvent<{
|
|
97
|
+
originalEvent: PointerEvent;
|
|
98
|
+
delta: {
|
|
99
|
+
x: number;
|
|
100
|
+
y: number;
|
|
101
|
+
};
|
|
102
|
+
}>, "currentTarget">) => any;
|
|
103
|
+
swipeEnd: (event: {
|
|
104
|
+
currentTarget: EventTarget & HTMLElement;
|
|
105
|
+
} & Omit<CustomEvent<{
|
|
106
|
+
originalEvent: PointerEvent;
|
|
107
|
+
delta: {
|
|
108
|
+
x: number;
|
|
109
|
+
y: number;
|
|
110
|
+
};
|
|
111
|
+
}>, "currentTarget">) => any;
|
|
112
|
+
}, string, import("vue").PublicProps, Readonly<ToastProps> & Readonly<{
|
|
113
|
+
onResume?: (() => any) | undefined;
|
|
114
|
+
onPause?: (() => any) | undefined;
|
|
115
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
116
|
+
onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
117
|
+
onSwipeStart?: ((event: {
|
|
118
|
+
currentTarget: EventTarget & HTMLElement;
|
|
119
|
+
} & Omit<CustomEvent<{
|
|
120
|
+
originalEvent: PointerEvent;
|
|
121
|
+
delta: {
|
|
122
|
+
x: number;
|
|
123
|
+
y: number;
|
|
124
|
+
};
|
|
125
|
+
}>, "currentTarget">) => any) | undefined;
|
|
126
|
+
onSwipeMove?: ((event: {
|
|
127
|
+
currentTarget: EventTarget & HTMLElement;
|
|
128
|
+
} & Omit<CustomEvent<{
|
|
129
|
+
originalEvent: PointerEvent;
|
|
130
|
+
delta: {
|
|
131
|
+
x: number;
|
|
132
|
+
y: number;
|
|
133
|
+
};
|
|
134
|
+
}>, "currentTarget">) => any) | undefined;
|
|
135
|
+
onSwipeCancel?: ((event: {
|
|
136
|
+
currentTarget: EventTarget & HTMLElement;
|
|
137
|
+
} & Omit<CustomEvent<{
|
|
138
|
+
originalEvent: PointerEvent;
|
|
139
|
+
delta: {
|
|
140
|
+
x: number;
|
|
141
|
+
y: number;
|
|
142
|
+
};
|
|
143
|
+
}>, "currentTarget">) => any) | undefined;
|
|
144
|
+
onSwipeEnd?: ((event: {
|
|
145
|
+
currentTarget: EventTarget & HTMLElement;
|
|
146
|
+
} & Omit<CustomEvent<{
|
|
147
|
+
originalEvent: PointerEvent;
|
|
148
|
+
delta: {
|
|
149
|
+
x: number;
|
|
150
|
+
y: number;
|
|
151
|
+
};
|
|
152
|
+
}>, "currentTarget">) => any) | undefined;
|
|
153
|
+
}>, {
|
|
154
|
+
close: boolean | Partial<ButtonProps>;
|
|
155
|
+
progress: boolean;
|
|
156
|
+
orientation: Toast["variants"]["orientation"];
|
|
157
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ToastSlots>;
|
|
158
|
+
export default _default;
|
|
159
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
160
|
+
new (): {
|
|
161
|
+
$slots: S;
|
|
162
|
+
};
|
|
163
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/toaster";
|
|
3
|
+
export default {
|
|
4
|
+
name: "Toaster"
|
|
5
|
+
};
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script setup>
|
|
9
|
+
import { ref, computed, toRef } from "vue";
|
|
10
|
+
import { ToastProvider, ToastViewport, ToastPortal, useForwardProps } from "reka-ui";
|
|
11
|
+
import { reactivePick } from "@vueuse/core";
|
|
12
|
+
import { useAppConfig } from "#imports";
|
|
13
|
+
import { useToast } from "../composables/useToast";
|
|
14
|
+
import { usePortal } from "../composables/usePortal";
|
|
15
|
+
import { omit } from "../utils";
|
|
16
|
+
import { tv } from "../utils/tv";
|
|
17
|
+
import UToast from "./Toast.vue";
|
|
18
|
+
const props = defineProps({
|
|
19
|
+
position: { type: null, required: false },
|
|
20
|
+
expand: { type: Boolean, required: false, default: true },
|
|
21
|
+
progress: { type: Boolean, required: false, default: true },
|
|
22
|
+
portal: { type: [Boolean, String], required: false, skipCheck: true, default: true },
|
|
23
|
+
class: { type: null, required: false },
|
|
24
|
+
ui: { type: null, required: false },
|
|
25
|
+
label: { type: String, required: false },
|
|
26
|
+
duration: { type: Number, required: false, default: 5e3 },
|
|
27
|
+
swipeThreshold: { type: Number, required: false }
|
|
28
|
+
});
|
|
29
|
+
defineSlots();
|
|
30
|
+
const { toasts, remove } = useToast();
|
|
31
|
+
const appConfig = useAppConfig();
|
|
32
|
+
const providerProps = useForwardProps(reactivePick(props, "duration", "label", "swipeThreshold"));
|
|
33
|
+
const portalProps = usePortal(toRef(() => props.portal));
|
|
34
|
+
const swipeDirection = computed(() => {
|
|
35
|
+
switch (props.position) {
|
|
36
|
+
case "top-center":
|
|
37
|
+
return "up";
|
|
38
|
+
case "top-right":
|
|
39
|
+
case "bottom-right":
|
|
40
|
+
return "right";
|
|
41
|
+
case "bottom-center":
|
|
42
|
+
return "down";
|
|
43
|
+
case "top-left":
|
|
44
|
+
case "bottom-left":
|
|
45
|
+
return "left";
|
|
46
|
+
}
|
|
47
|
+
return "right";
|
|
48
|
+
});
|
|
49
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.toaster || {} })({
|
|
50
|
+
position: props.position,
|
|
51
|
+
swipeDirection: swipeDirection.value
|
|
52
|
+
}));
|
|
53
|
+
function onUpdateOpen(value, id) {
|
|
54
|
+
if (value) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
remove(id);
|
|
58
|
+
}
|
|
59
|
+
const hovered = ref(false);
|
|
60
|
+
const expanded = computed(() => props.expand || hovered.value);
|
|
61
|
+
const refs = ref([]);
|
|
62
|
+
const height = computed(() => refs.value.reduce((acc, { height: height2 }) => acc + height2 + 16, 0));
|
|
63
|
+
const frontHeight = computed(() => refs.value[refs.value.length - 1]?.height || 0);
|
|
64
|
+
function getOffset(index) {
|
|
65
|
+
return refs.value.slice(index + 1).reduce((acc, { height: height2 }) => acc + height2 + 16, 0);
|
|
66
|
+
}
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<template>
|
|
70
|
+
<ToastProvider :swipe-direction="swipeDirection" v-bind="providerProps">
|
|
71
|
+
<slot />
|
|
72
|
+
|
|
73
|
+
<UToast
|
|
74
|
+
v-for="(toast, index) of toasts"
|
|
75
|
+
:key="toast.id"
|
|
76
|
+
ref="refs"
|
|
77
|
+
:progress="progress"
|
|
78
|
+
v-bind="omit(toast, ['id', 'close'])"
|
|
79
|
+
:close="toast.close"
|
|
80
|
+
:data-expanded="expanded"
|
|
81
|
+
:data-front="!expanded && index === toasts.length - 1"
|
|
82
|
+
:style="{
|
|
83
|
+
'--index': index - toasts.length + toasts.length,
|
|
84
|
+
'--before': toasts.length - 1 - index,
|
|
85
|
+
'--offset': getOffset(index),
|
|
86
|
+
'--scale': expanded ? '1' : 'calc(1 - var(--before) * var(--scale-factor))',
|
|
87
|
+
'--translate': expanded ? 'calc(var(--offset) * var(--translate-factor))' : 'calc(var(--before) * var(--gap))',
|
|
88
|
+
'--transform': 'translateY(var(--translate)) scale(var(--scale))'
|
|
89
|
+
}"
|
|
90
|
+
:class="ui.base({ class: [props.ui?.base, toast.onClick ? 'cursor-pointer' : void 0] })"
|
|
91
|
+
@update:open="onUpdateOpen($event, toast.id)"
|
|
92
|
+
@click="toast.onClick && toast.onClick(toast)"
|
|
93
|
+
/>
|
|
94
|
+
|
|
95
|
+
<ToastPortal v-bind="portalProps">
|
|
96
|
+
<ToastViewport
|
|
97
|
+
:data-expanded="expanded"
|
|
98
|
+
:class="ui.viewport({ class: [props.ui?.viewport, props.class] })"
|
|
99
|
+
:style="{
|
|
100
|
+
'--scale-factor': '0.05',
|
|
101
|
+
'--translate-factor': position?.startsWith('top') ? '1px' : '-1px',
|
|
102
|
+
'--gap': position?.startsWith('top') ? '16px' : '-16px',
|
|
103
|
+
'--front-height': `${frontHeight}px`,
|
|
104
|
+
'--height': `${height}px`
|
|
105
|
+
}"
|
|
106
|
+
@mouseenter="hovered = true"
|
|
107
|
+
@mouseleave="hovered = false"
|
|
108
|
+
/>
|
|
109
|
+
</ToastPortal>
|
|
110
|
+
</ToastProvider>
|
|
111
|
+
</template>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ToastProviderProps } from 'reka-ui';
|
|
2
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
3
|
+
import theme from '#build/ui/toaster';
|
|
4
|
+
import type { ComponentConfig } from '../types/utils';
|
|
5
|
+
type Toaster = ComponentConfig<typeof theme, AppConfig, 'toaster'>;
|
|
6
|
+
export interface ToasterProps extends Omit<ToastProviderProps, 'swipeDirection'> {
|
|
7
|
+
/**
|
|
8
|
+
* The position on the screen to display the toasts.
|
|
9
|
+
* @defaultValue 'bottom-right'
|
|
10
|
+
*/
|
|
11
|
+
position?: Toaster['variants']['position'];
|
|
12
|
+
/**
|
|
13
|
+
* Expand the toasts to show multiple toasts at once.
|
|
14
|
+
* @defaultValue true
|
|
15
|
+
*/
|
|
16
|
+
expand?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Whether to show the progress bar on all toasts.
|
|
19
|
+
* @defaultValue true
|
|
20
|
+
*/
|
|
21
|
+
progress?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Render the toaster in a portal.
|
|
24
|
+
* @defaultValue true
|
|
25
|
+
*/
|
|
26
|
+
portal?: boolean | string | HTMLElement;
|
|
27
|
+
class?: any;
|
|
28
|
+
ui?: Toaster['slots'];
|
|
29
|
+
}
|
|
30
|
+
export interface ToasterSlots {
|
|
31
|
+
default(props?: {}): any;
|
|
32
|
+
}
|
|
33
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ToasterProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ToasterProps> & Readonly<{}>, {
|
|
34
|
+
progress: boolean;
|
|
35
|
+
expand: boolean;
|
|
36
|
+
duration: number;
|
|
37
|
+
portal: boolean | string | HTMLElement;
|
|
38
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ToasterSlots>;
|
|
39
|
+
export default _default;
|
|
40
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
41
|
+
new (): {
|
|
42
|
+
$slots: S;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/tooltip";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed, toRef } from "vue";
|
|
7
|
+
import { defu } from "defu";
|
|
8
|
+
import { TooltipRoot, TooltipTrigger, TooltipPortal, TooltipContent, TooltipArrow, useForwardPropsEmits } from "reka-ui";
|
|
9
|
+
import { reactivePick } from "@vueuse/core";
|
|
10
|
+
import { useAppConfig } from "#imports";
|
|
11
|
+
import { usePortal } from "../composables/usePortal";
|
|
12
|
+
import { tv } from "../utils/tv";
|
|
13
|
+
import UKbd from "./Kbd.vue";
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
text: { type: String, required: false },
|
|
16
|
+
kbds: { type: Array, required: false },
|
|
17
|
+
content: { type: Object, required: false },
|
|
18
|
+
arrow: { type: [Boolean, Object], required: false },
|
|
19
|
+
portal: { type: [Boolean, String], required: false, skipCheck: true, default: true },
|
|
20
|
+
class: { type: null, required: false },
|
|
21
|
+
ui: { type: null, required: false },
|
|
22
|
+
defaultOpen: { type: Boolean, required: false },
|
|
23
|
+
open: { type: Boolean, required: false },
|
|
24
|
+
delayDuration: { type: Number, required: false },
|
|
25
|
+
disableHoverableContent: { type: Boolean, required: false },
|
|
26
|
+
disableClosingTrigger: { type: Boolean, required: false },
|
|
27
|
+
disabled: { type: Boolean, required: false },
|
|
28
|
+
ignoreNonKeyboardFocus: { type: Boolean, required: false }
|
|
29
|
+
});
|
|
30
|
+
const emits = defineEmits(["update:open"]);
|
|
31
|
+
const slots = defineSlots();
|
|
32
|
+
const appConfig = useAppConfig();
|
|
33
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, "defaultOpen", "open", "delayDuration", "disableHoverableContent", "disableClosingTrigger", "disabled", "ignoreNonKeyboardFocus"), emits);
|
|
34
|
+
const portalProps = usePortal(toRef(() => props.portal));
|
|
35
|
+
const contentProps = toRef(() => defu(props.content, { side: "bottom", sideOffset: 8, collisionPadding: 8 }));
|
|
36
|
+
const arrowProps = toRef(() => props.arrow);
|
|
37
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.tooltip || {} })({
|
|
38
|
+
side: contentProps.value.side
|
|
39
|
+
}));
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<template>
|
|
43
|
+
<TooltipRoot v-slot="{ open }" v-bind="rootProps">
|
|
44
|
+
<TooltipTrigger v-if="!!slots.default" v-bind="$attrs" as-child :class="props.class">
|
|
45
|
+
<slot :open="open" />
|
|
46
|
+
</TooltipTrigger>
|
|
47
|
+
|
|
48
|
+
<TooltipPortal v-bind="portalProps">
|
|
49
|
+
<TooltipContent v-bind="contentProps" :class="ui.content({ class: [!slots.default && props.class, props.ui?.content] })">
|
|
50
|
+
<slot name="content">
|
|
51
|
+
<span v-if="text" :class="ui.text({ class: props.ui?.text })">{{ text }}</span>
|
|
52
|
+
|
|
53
|
+
<span v-if="kbds?.length" :class="ui.kbds({ class: props.ui?.kbds })">
|
|
54
|
+
<UKbd v-for="(kbd, index) in kbds" :key="index" :size="props.ui?.kbdsSize || ui.kbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
55
|
+
</span>
|
|
56
|
+
</slot>
|
|
57
|
+
|
|
58
|
+
<TooltipArrow v-if="!!arrow" v-bind="arrowProps" :class="ui.arrow({ class: props.ui?.arrow })" />
|
|
59
|
+
</TooltipContent>
|
|
60
|
+
</TooltipPortal>
|
|
61
|
+
</TooltipRoot>
|
|
62
|
+
</template>
|