@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,210 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/carousel";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed, ref, watch, onMounted } from "vue";
|
|
7
|
+
import useEmblaCarousel from "embla-carousel-vue";
|
|
8
|
+
import { Primitive, useForwardProps } from "reka-ui";
|
|
9
|
+
import { reactivePick, computedAsync } from "@vueuse/core";
|
|
10
|
+
import { useAppConfig } from "#imports";
|
|
11
|
+
import { useLocale } from "../composables/useLocale";
|
|
12
|
+
import { tv } from "../utils/tv";
|
|
13
|
+
import UButton from "./Button.vue";
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
as: { type: null, required: false },
|
|
16
|
+
prev: { type: Object, required: false },
|
|
17
|
+
prevIcon: { type: String, required: false },
|
|
18
|
+
next: { type: Object, required: false },
|
|
19
|
+
nextIcon: { type: String, required: false },
|
|
20
|
+
arrows: { type: Boolean, required: false, default: false },
|
|
21
|
+
dots: { type: Boolean, required: false, default: false },
|
|
22
|
+
orientation: { type: null, required: false, default: "horizontal" },
|
|
23
|
+
items: { type: Array, required: false },
|
|
24
|
+
autoplay: { type: [Boolean, Object], required: false, default: false },
|
|
25
|
+
autoScroll: { type: [Boolean, Object], required: false, default: false },
|
|
26
|
+
autoHeight: { type: [Boolean, Object], required: false, default: false },
|
|
27
|
+
classNames: { type: [Boolean, Object], required: false, default: false },
|
|
28
|
+
fade: { type: [Boolean, Object], required: false, default: false },
|
|
29
|
+
wheelGestures: { type: Boolean, required: false, skipCheck: true, default: false },
|
|
30
|
+
class: { type: null, required: false },
|
|
31
|
+
ui: { type: null, required: false },
|
|
32
|
+
align: { type: [String, Function], required: false, default: "center" },
|
|
33
|
+
containScroll: { type: [Boolean, String], required: false, default: "trimSnaps" },
|
|
34
|
+
slidesToScroll: { type: [String, Number], required: false, default: 1 },
|
|
35
|
+
dragFree: { type: Boolean, required: false, default: false },
|
|
36
|
+
dragThreshold: { type: Number, required: false, default: 10 },
|
|
37
|
+
inViewThreshold: { type: null, required: false, default: 0 },
|
|
38
|
+
loop: { type: Boolean, required: false, default: false },
|
|
39
|
+
skipSnaps: { type: Boolean, required: false, default: false },
|
|
40
|
+
duration: { type: Number, required: false, default: 25 },
|
|
41
|
+
startIndex: { type: Number, required: false, default: 0 },
|
|
42
|
+
watchDrag: { type: [Boolean, Function], required: false, default: true },
|
|
43
|
+
watchResize: { type: [Boolean, Function], required: false, default: true },
|
|
44
|
+
watchSlides: { type: [Boolean, Function], required: false, default: true },
|
|
45
|
+
watchFocus: { type: [Boolean, Function], required: false, default: true },
|
|
46
|
+
active: { type: Boolean, required: false, default: true },
|
|
47
|
+
breakpoints: { type: Object, required: false, default: () => ({}) }
|
|
48
|
+
});
|
|
49
|
+
defineSlots();
|
|
50
|
+
const emits = defineEmits(["select"]);
|
|
51
|
+
const { dir, t } = useLocale();
|
|
52
|
+
const appConfig = useAppConfig();
|
|
53
|
+
const rootProps = useForwardProps(reactivePick(props, "active", "align", "breakpoints", "containScroll", "dragFree", "dragThreshold", "duration", "inViewThreshold", "loop", "skipSnaps", "slidesToScroll", "startIndex", "watchDrag", "watchResize", "watchSlides", "watchFocus"));
|
|
54
|
+
const prevIcon = computed(() => props.prevIcon || (dir.value === "rtl" ? appConfig.ui.icons.arrowRight : appConfig.ui.icons.arrowLeft));
|
|
55
|
+
const nextIcon = computed(() => props.nextIcon || (dir.value === "rtl" ? appConfig.ui.icons.arrowLeft : appConfig.ui.icons.arrowRight));
|
|
56
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.carousel || {} })({
|
|
57
|
+
orientation: props.orientation
|
|
58
|
+
}));
|
|
59
|
+
const options = computed(() => ({
|
|
60
|
+
...props.fade ? { align: "center", containScroll: false } : {},
|
|
61
|
+
...rootProps.value,
|
|
62
|
+
axis: props.orientation === "horizontal" ? "x" : "y",
|
|
63
|
+
direction: dir.value === "rtl" ? "rtl" : "ltr"
|
|
64
|
+
}));
|
|
65
|
+
const plugins = computedAsync(async () => {
|
|
66
|
+
const plugins2 = [];
|
|
67
|
+
if (props.autoplay) {
|
|
68
|
+
const AutoplayPlugin = await import("embla-carousel-autoplay").then((r) => r.default);
|
|
69
|
+
plugins2.push(AutoplayPlugin(typeof props.autoplay === "boolean" ? {} : props.autoplay));
|
|
70
|
+
}
|
|
71
|
+
if (props.autoScroll) {
|
|
72
|
+
const AutoScrollPlugin = await import("embla-carousel-auto-scroll").then((r) => r.default);
|
|
73
|
+
plugins2.push(AutoScrollPlugin(typeof props.autoScroll === "boolean" ? {} : props.autoScroll));
|
|
74
|
+
}
|
|
75
|
+
if (props.autoHeight) {
|
|
76
|
+
const AutoHeightPlugin = await import("embla-carousel-auto-height").then((r) => r.default);
|
|
77
|
+
plugins2.push(AutoHeightPlugin(typeof props.autoHeight === "boolean" ? {} : props.autoHeight));
|
|
78
|
+
}
|
|
79
|
+
if (props.classNames) {
|
|
80
|
+
const ClassNamesPlugin = await import("embla-carousel-class-names").then((r) => r.default);
|
|
81
|
+
plugins2.push(ClassNamesPlugin(typeof props.classNames === "boolean" ? {} : props.classNames));
|
|
82
|
+
}
|
|
83
|
+
if (props.fade) {
|
|
84
|
+
const FadePlugin = await import("embla-carousel-fade").then((r) => r.default);
|
|
85
|
+
plugins2.push(FadePlugin(typeof props.fade === "boolean" ? {} : props.fade));
|
|
86
|
+
}
|
|
87
|
+
if (props.wheelGestures) {
|
|
88
|
+
const { WheelGesturesPlugin } = await import("embla-carousel-wheel-gestures");
|
|
89
|
+
plugins2.push(WheelGesturesPlugin(typeof props.wheelGestures === "boolean" ? {} : props.wheelGestures));
|
|
90
|
+
}
|
|
91
|
+
return plugins2;
|
|
92
|
+
});
|
|
93
|
+
const [emblaRef, emblaApi] = useEmblaCarousel(options.value, plugins.value);
|
|
94
|
+
watch([options, plugins], () => {
|
|
95
|
+
emblaApi.value?.reInit(options.value, plugins.value);
|
|
96
|
+
});
|
|
97
|
+
function scrollPrev() {
|
|
98
|
+
emblaApi.value?.scrollPrev();
|
|
99
|
+
}
|
|
100
|
+
function scrollNext() {
|
|
101
|
+
emblaApi.value?.scrollNext();
|
|
102
|
+
}
|
|
103
|
+
function scrollTo(index) {
|
|
104
|
+
emblaApi.value?.scrollTo(index);
|
|
105
|
+
}
|
|
106
|
+
function onKeyDown(event) {
|
|
107
|
+
const prevKey = props.orientation === "vertical" ? "ArrowUp" : "ArrowLeft";
|
|
108
|
+
const nextKey = props.orientation === "vertical" ? "ArrowDown" : "ArrowRight";
|
|
109
|
+
if (event.key === prevKey) {
|
|
110
|
+
event.preventDefault();
|
|
111
|
+
scrollPrev();
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (event.key === nextKey) {
|
|
115
|
+
event.preventDefault();
|
|
116
|
+
scrollNext();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
const canScrollNext = ref(false);
|
|
120
|
+
const canScrollPrev = ref(false);
|
|
121
|
+
const selectedIndex = ref(0);
|
|
122
|
+
const scrollSnaps = ref([]);
|
|
123
|
+
function onInit(api) {
|
|
124
|
+
scrollSnaps.value = api?.scrollSnapList() || [];
|
|
125
|
+
}
|
|
126
|
+
function onSelect(api) {
|
|
127
|
+
canScrollNext.value = api?.canScrollNext() || false;
|
|
128
|
+
canScrollPrev.value = api?.canScrollPrev() || false;
|
|
129
|
+
selectedIndex.value = api?.selectedScrollSnap() || 0;
|
|
130
|
+
emits("select", selectedIndex.value);
|
|
131
|
+
}
|
|
132
|
+
function isCarouselItem(item) {
|
|
133
|
+
return typeof item === "object" && item !== null;
|
|
134
|
+
}
|
|
135
|
+
onMounted(() => {
|
|
136
|
+
if (!emblaApi.value) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
emblaApi.value?.on("init", onInit);
|
|
140
|
+
emblaApi.value?.on("init", onSelect);
|
|
141
|
+
emblaApi.value?.on("reInit", onInit);
|
|
142
|
+
emblaApi.value?.on("reInit", onSelect);
|
|
143
|
+
emblaApi.value?.on("select", onSelect);
|
|
144
|
+
});
|
|
145
|
+
defineExpose({
|
|
146
|
+
emblaRef,
|
|
147
|
+
emblaApi
|
|
148
|
+
});
|
|
149
|
+
</script>
|
|
150
|
+
|
|
151
|
+
<template>
|
|
152
|
+
<Primitive
|
|
153
|
+
:as="as"
|
|
154
|
+
role="region"
|
|
155
|
+
aria-roledescription="carousel"
|
|
156
|
+
tabindex="0"
|
|
157
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
158
|
+
@keydown="onKeyDown"
|
|
159
|
+
>
|
|
160
|
+
<div ref="emblaRef" :class="ui.viewport({ class: props.ui?.viewport })">
|
|
161
|
+
<div :class="ui.container({ class: props.ui?.container })">
|
|
162
|
+
<div
|
|
163
|
+
v-for="(item, index) in items"
|
|
164
|
+
:key="index"
|
|
165
|
+
role="group"
|
|
166
|
+
aria-roledescription="slide"
|
|
167
|
+
:class="ui.item({ class: [props.ui?.item, isCarouselItem(item) && item.ui?.item, isCarouselItem(item) && item.class] })"
|
|
168
|
+
>
|
|
169
|
+
<slot :item="item" :index="index" />
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
|
|
174
|
+
<div v-if="arrows || dots" :class="ui.controls({ class: props.ui?.controls })">
|
|
175
|
+
<div v-if="arrows" :class="ui.arrows({ class: props.ui?.arrows })">
|
|
176
|
+
<UButton
|
|
177
|
+
:disabled="!canScrollPrev"
|
|
178
|
+
:icon="prevIcon"
|
|
179
|
+
color="neutral"
|
|
180
|
+
variant="outline"
|
|
181
|
+
:aria-label="t('carousel.prev')"
|
|
182
|
+
v-bind="typeof prev === 'object' ? prev : void 0"
|
|
183
|
+
:class="ui.prev({ class: props.ui?.prev })"
|
|
184
|
+
@click="scrollPrev"
|
|
185
|
+
/>
|
|
186
|
+
<UButton
|
|
187
|
+
:disabled="!canScrollNext"
|
|
188
|
+
:icon="nextIcon"
|
|
189
|
+
color="neutral"
|
|
190
|
+
variant="outline"
|
|
191
|
+
:aria-label="t('carousel.next')"
|
|
192
|
+
v-bind="typeof next === 'object' ? next : void 0"
|
|
193
|
+
:class="ui.next({ class: props.ui?.next })"
|
|
194
|
+
@click="scrollNext"
|
|
195
|
+
/>
|
|
196
|
+
</div>
|
|
197
|
+
|
|
198
|
+
<div v-if="dots" :class="ui.dots({ class: props.ui?.dots })">
|
|
199
|
+
<template v-for="(_, index) in scrollSnaps" :key="index">
|
|
200
|
+
<button
|
|
201
|
+
:aria-label="t('carousel.goto', { slide: index + 1 })"
|
|
202
|
+
:class="ui.dot({ class: props.ui?.dot, active: selectedIndex === index })"
|
|
203
|
+
:data-state="selectedIndex === index ? 'active' : void 0"
|
|
204
|
+
@click="scrollTo(index)"
|
|
205
|
+
/>
|
|
206
|
+
</template>
|
|
207
|
+
</div>
|
|
208
|
+
</div>
|
|
209
|
+
</Primitive>
|
|
210
|
+
</template>
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
2
|
+
import type { AcceptableValue } from 'reka-ui';
|
|
3
|
+
import type { EmblaCarouselType, EmblaOptionsType } from 'embla-carousel';
|
|
4
|
+
import type { AutoplayOptionsType } from 'embla-carousel-autoplay';
|
|
5
|
+
import type { AutoScrollOptionsType } from 'embla-carousel-auto-scroll';
|
|
6
|
+
import type { AutoHeightOptionsType } from 'embla-carousel-auto-height';
|
|
7
|
+
import type { ClassNamesOptionsType } from 'embla-carousel-class-names';
|
|
8
|
+
import type { FadeOptionsType } from 'embla-carousel-fade';
|
|
9
|
+
import type { WheelGesturesPluginOptions } from 'embla-carousel-wheel-gestures';
|
|
10
|
+
import theme from '#build/ui/carousel';
|
|
11
|
+
import type { ButtonProps } from '../types';
|
|
12
|
+
import type { ComponentConfig } from '../types/utils';
|
|
13
|
+
type Carousel = ComponentConfig<typeof theme, AppConfig, 'carousel'>;
|
|
14
|
+
interface _CarouselItem {
|
|
15
|
+
class?: any;
|
|
16
|
+
ui?: Pick<Carousel['slots'], 'item'>;
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
}
|
|
19
|
+
export type CarouselItem = _CarouselItem | AcceptableValue;
|
|
20
|
+
export interface CarouselProps<T extends CarouselItem = CarouselItem> extends Omit<EmblaOptionsType, 'axis' | 'container' | 'slides' | 'direction'> {
|
|
21
|
+
/**
|
|
22
|
+
* The element or component this component should render as.
|
|
23
|
+
* @defaultValue 'div'
|
|
24
|
+
*/
|
|
25
|
+
as?: any;
|
|
26
|
+
/**
|
|
27
|
+
* Configure the prev button when arrows are enabled.
|
|
28
|
+
* @defaultValue { size: 'md', color: 'neutral', variant: 'link' }
|
|
29
|
+
*/
|
|
30
|
+
prev?: ButtonProps;
|
|
31
|
+
/**
|
|
32
|
+
* The icon displayed in the prev button.
|
|
33
|
+
* @defaultValue appConfig.ui.icons.arrowLeft
|
|
34
|
+
* @IconifyIcon
|
|
35
|
+
*/
|
|
36
|
+
prevIcon?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Configure the next button when arrows are enabled.
|
|
39
|
+
* @defaultValue { size: 'md', color: 'neutral', variant: 'link' }
|
|
40
|
+
*/
|
|
41
|
+
next?: ButtonProps;
|
|
42
|
+
/**
|
|
43
|
+
* The icon displayed in the next button.
|
|
44
|
+
* @defaultValue appConfig.ui.icons.arrowRight
|
|
45
|
+
* @IconifyIcon
|
|
46
|
+
*/
|
|
47
|
+
nextIcon?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Display prev and next buttons to scroll the carousel.
|
|
50
|
+
* @defaultValue false
|
|
51
|
+
*/
|
|
52
|
+
arrows?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Display dots to scroll to a specific slide.
|
|
55
|
+
* @defaultValue false
|
|
56
|
+
*/
|
|
57
|
+
dots?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* The orientation of the carousel.
|
|
60
|
+
* @defaultValue 'horizontal'
|
|
61
|
+
*/
|
|
62
|
+
orientation?: Carousel['variants']['orientation'];
|
|
63
|
+
items?: T[];
|
|
64
|
+
/**
|
|
65
|
+
* Enable Autoplay plugin
|
|
66
|
+
* @link https://www.embla-carousel.com/plugins/autoplay/
|
|
67
|
+
*/
|
|
68
|
+
autoplay?: boolean | AutoplayOptionsType;
|
|
69
|
+
/**
|
|
70
|
+
* Enable Auto Scroll plugin
|
|
71
|
+
* @link https://www.embla-carousel.com/plugins/auto-scroll/
|
|
72
|
+
*/
|
|
73
|
+
autoScroll?: boolean | AutoScrollOptionsType;
|
|
74
|
+
/**
|
|
75
|
+
* Enable Auto Height plugin
|
|
76
|
+
* @link https://www.embla-carousel.com/plugins/auto-height/
|
|
77
|
+
*/
|
|
78
|
+
autoHeight?: boolean | AutoHeightOptionsType;
|
|
79
|
+
/**
|
|
80
|
+
* Enable Class Names plugin
|
|
81
|
+
* @link https://www.embla-carousel.com/plugins/class-names/
|
|
82
|
+
*/
|
|
83
|
+
classNames?: boolean | ClassNamesOptionsType;
|
|
84
|
+
/**
|
|
85
|
+
* Enable Fade plugin
|
|
86
|
+
* @link https://www.embla-carousel.com/plugins/fade/
|
|
87
|
+
*/
|
|
88
|
+
fade?: boolean | FadeOptionsType;
|
|
89
|
+
/**
|
|
90
|
+
* Enable Wheel Gestures plugin
|
|
91
|
+
* @link https://www.embla-carousel.com/plugins/wheel-gestures/
|
|
92
|
+
*/
|
|
93
|
+
wheelGestures?: boolean | WheelGesturesPluginOptions;
|
|
94
|
+
class?: any;
|
|
95
|
+
ui?: Carousel['slots'];
|
|
96
|
+
}
|
|
97
|
+
export type CarouselSlots<T extends CarouselItem = CarouselItem> = {
|
|
98
|
+
default(props: {
|
|
99
|
+
item: T;
|
|
100
|
+
index: number;
|
|
101
|
+
}): any;
|
|
102
|
+
};
|
|
103
|
+
export interface CarouselEmits {
|
|
104
|
+
/**
|
|
105
|
+
* Emitted when the selected slide changes
|
|
106
|
+
* @param selectedIndex The index of the selected slide
|
|
107
|
+
*/
|
|
108
|
+
select: [selectedIndex: number];
|
|
109
|
+
}
|
|
110
|
+
declare const _default: <T extends CarouselItem>(__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<{
|
|
111
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
112
|
+
readonly onSelect?: ((selectedIndex: number) => any) | undefined;
|
|
113
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onSelect"> & CarouselProps<T> & Partial<{}>> & import("vue").PublicProps;
|
|
114
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{
|
|
115
|
+
emblaRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
116
|
+
emblaApi: import("vue").Ref<EmblaCarouselType | undefined, EmblaCarouselType | undefined>;
|
|
117
|
+
}>): void;
|
|
118
|
+
attrs: any;
|
|
119
|
+
slots: CarouselSlots<T>;
|
|
120
|
+
emit: (evt: "select", selectedIndex: number) => void;
|
|
121
|
+
}>) => import("vue").VNode & {
|
|
122
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
123
|
+
};
|
|
124
|
+
export default _default;
|
|
125
|
+
type __VLS_PrettifyLocal<T> = {
|
|
126
|
+
[K in keyof T]: T[K];
|
|
127
|
+
} & {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/chat-message";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { Primitive } from "reka-ui";
|
|
8
|
+
import { useAppConfig } from "#imports";
|
|
9
|
+
import { tv } from "../utils/tv";
|
|
10
|
+
import UButton from "./Button.vue";
|
|
11
|
+
import UIcon from "./Icon.vue";
|
|
12
|
+
import UAvatar from "./Avatar.vue";
|
|
13
|
+
const props = defineProps({
|
|
14
|
+
as: { type: null, required: false, default: "article" },
|
|
15
|
+
id: { type: String, required: false },
|
|
16
|
+
content: { type: String, required: false },
|
|
17
|
+
role: { type: String, required: false },
|
|
18
|
+
icon: { type: String, required: false },
|
|
19
|
+
avatar: { type: Object, required: false },
|
|
20
|
+
variant: { type: String, required: false, default: "naked" },
|
|
21
|
+
side: { type: String, required: false, default: "left" },
|
|
22
|
+
actions: { type: Array, required: false },
|
|
23
|
+
compact: { type: Boolean, required: false, default: false },
|
|
24
|
+
createdAt: { type: Date, required: false },
|
|
25
|
+
reasoning: { type: String, required: false },
|
|
26
|
+
experimentalAttachments: { type: Array, required: false },
|
|
27
|
+
data: { type: [null, String, Number, Boolean, Object, Array], required: false },
|
|
28
|
+
annotations: { type: Array, required: false },
|
|
29
|
+
toolInvocations: { type: Array, required: false },
|
|
30
|
+
parts: { type: Array, required: false },
|
|
31
|
+
class: { type: null, required: false },
|
|
32
|
+
ui: { type: null, required: false }
|
|
33
|
+
});
|
|
34
|
+
const hasLeading = computed(() => Boolean(props.icon || props.avatar));
|
|
35
|
+
const hasActions = computed(() => Boolean(props.actions && props.actions.length > 0));
|
|
36
|
+
const appConfig = useAppConfig();
|
|
37
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.chatMessage || {} })({
|
|
38
|
+
variant: props.variant,
|
|
39
|
+
side: props.side,
|
|
40
|
+
compact: props.compact,
|
|
41
|
+
leading: hasLeading.value,
|
|
42
|
+
actions: hasActions.value
|
|
43
|
+
}));
|
|
44
|
+
const handleActionClick = (e, action) => {
|
|
45
|
+
if (action.onClick) {
|
|
46
|
+
action.onClick(e, props);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<template>
|
|
52
|
+
<Primitive :id="id" :as="as" :data-role="role" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
53
|
+
<div :class="ui.container({ class: props.ui?.container })">
|
|
54
|
+
<slot name="leading" :avatar="avatar">
|
|
55
|
+
<div v-if="hasLeading" :class="ui.leading({ class: props.ui?.leading })">
|
|
56
|
+
<UIcon v-if="icon" :name="icon" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
|
|
57
|
+
<UAvatar
|
|
58
|
+
v-else-if="avatar"
|
|
59
|
+
:size="ui.leadingAvatar()"
|
|
60
|
+
v-bind="avatar"
|
|
61
|
+
:class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })"
|
|
62
|
+
/>
|
|
63
|
+
</div>
|
|
64
|
+
</slot>
|
|
65
|
+
<slot name="content" :content="content">
|
|
66
|
+
<div :class="ui.content({ class: props.ui?.content })">
|
|
67
|
+
<slot name="default">
|
|
68
|
+
{{ content }}
|
|
69
|
+
</slot>
|
|
70
|
+
</div>
|
|
71
|
+
</slot>
|
|
72
|
+
<slot name="actions" :actions="actions">
|
|
73
|
+
<div v-if="hasActions" :class="ui.actions({ class: props.ui?.actions })">
|
|
74
|
+
<UButton
|
|
75
|
+
v-for="action in actions"
|
|
76
|
+
:key="action.label"
|
|
77
|
+
v-bind="action"
|
|
78
|
+
:size="action.size || 'xs'"
|
|
79
|
+
:color="action.color || 'neutral'"
|
|
80
|
+
:variant="action.variant || 'ghost'"
|
|
81
|
+
@click="(e) => handleActionClick(e, action)"
|
|
82
|
+
/>
|
|
83
|
+
</div>
|
|
84
|
+
</slot>
|
|
85
|
+
</div>
|
|
86
|
+
</Primitive>
|
|
87
|
+
</template>
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
2
|
+
import type { ComponentConfig } from '../types/utils';
|
|
3
|
+
import theme from '#build/ui/chat-message';
|
|
4
|
+
import type { AvatarProps, ButtonProps } from '../types';
|
|
5
|
+
export type ChatMessage = ComponentConfig<typeof theme, AppConfig, 'chatMessage'>;
|
|
6
|
+
export interface ChatMessageProps {
|
|
7
|
+
/**
|
|
8
|
+
* The element or component this component should render as.
|
|
9
|
+
* @defaultValue 'article'
|
|
10
|
+
*/
|
|
11
|
+
as?: any;
|
|
12
|
+
/**
|
|
13
|
+
* A unique identifier for the message.
|
|
14
|
+
*/
|
|
15
|
+
id?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Text content of the message. Use parts when possible.
|
|
18
|
+
*/
|
|
19
|
+
content?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The 'data' role is deprecated.
|
|
22
|
+
*/
|
|
23
|
+
role?: 'data' | 'user' | 'system' | 'assistant';
|
|
24
|
+
/**
|
|
25
|
+
* Icon to display next to the message.
|
|
26
|
+
*/
|
|
27
|
+
icon?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Avatar to display next to the message.
|
|
30
|
+
*/
|
|
31
|
+
avatar?: AvatarProps & {
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* @defaultValue 'naked'
|
|
36
|
+
*/
|
|
37
|
+
variant?: 'solid' | 'outline' | 'soft' | 'subtle' | 'naked';
|
|
38
|
+
/**
|
|
39
|
+
* @defaultValue 'left'
|
|
40
|
+
*/
|
|
41
|
+
side?: 'right' | 'left';
|
|
42
|
+
/**
|
|
43
|
+
* Display a list of actions under the message. The label will be used in a tooltip. { size: 'xs', color: 'neutral', variant: 'ghost' }
|
|
44
|
+
*/
|
|
45
|
+
actions?: (Omit<ButtonProps, 'onClick'> & {
|
|
46
|
+
onClick?: ((e: MouseEvent, message: any) => void) | undefined;
|
|
47
|
+
})[];
|
|
48
|
+
/**
|
|
49
|
+
* Render the message in a compact style. This is done automatically when used inside a UChatPalette.
|
|
50
|
+
* @defaultValue false
|
|
51
|
+
*/
|
|
52
|
+
compact?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* The timestamp of the message.
|
|
55
|
+
*/
|
|
56
|
+
createdAt?: Date;
|
|
57
|
+
/**
|
|
58
|
+
* Reasoning for the message.
|
|
59
|
+
*/
|
|
60
|
+
reasoning?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Additional attachments to be sent along with the message.
|
|
63
|
+
*/
|
|
64
|
+
experimentalAttachments?: any[];
|
|
65
|
+
/**
|
|
66
|
+
* For data messages.
|
|
67
|
+
*/
|
|
68
|
+
data?: null | string | number | false | true | {
|
|
69
|
+
[value: string]: any;
|
|
70
|
+
} | any[];
|
|
71
|
+
/**
|
|
72
|
+
* Additional message-specific information added on the server via StreamData
|
|
73
|
+
*/
|
|
74
|
+
annotations?: any[];
|
|
75
|
+
/**
|
|
76
|
+
* Tool invocations (that can be tool calls or tool results, depending on whether or not the invocation has finished) that the assistant made as part of this message.
|
|
77
|
+
*/
|
|
78
|
+
toolInvocations?: any[];
|
|
79
|
+
/**
|
|
80
|
+
* The parts of the message. Use this for rendering the message in the UI.
|
|
81
|
+
*/
|
|
82
|
+
parts?: any[];
|
|
83
|
+
class?: any;
|
|
84
|
+
ui?: ChatMessage['slots'];
|
|
85
|
+
}
|
|
86
|
+
export interface ChatMessageSlots {
|
|
87
|
+
leading(props?: {
|
|
88
|
+
avatar: (AvatarProps & {
|
|
89
|
+
[key: string]: any;
|
|
90
|
+
}) | undefined;
|
|
91
|
+
}): any;
|
|
92
|
+
content(props?: {
|
|
93
|
+
content: string;
|
|
94
|
+
}): any;
|
|
95
|
+
actions(props?: {
|
|
96
|
+
actions: (Omit<ButtonProps, 'onClick'> & {
|
|
97
|
+
onClick?: ((e: MouseEvent, message: any) => void) | undefined;
|
|
98
|
+
})[] | undefined;
|
|
99
|
+
}): any;
|
|
100
|
+
}
|
|
101
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ChatMessageProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ChatMessageProps> & Readonly<{}>, {
|
|
102
|
+
as: any;
|
|
103
|
+
variant: "solid" | "outline" | "soft" | "subtle" | "naked";
|
|
104
|
+
side: "right" | "left";
|
|
105
|
+
compact: boolean;
|
|
106
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
107
|
+
leading?: (props: {
|
|
108
|
+
avatar: (AvatarProps & {
|
|
109
|
+
[key: string]: any;
|
|
110
|
+
}) | undefined;
|
|
111
|
+
}) => any;
|
|
112
|
+
} & {
|
|
113
|
+
content?: (props: {
|
|
114
|
+
content: string | undefined;
|
|
115
|
+
}) => any;
|
|
116
|
+
} & {
|
|
117
|
+
default?: (props: {}) => any;
|
|
118
|
+
} & {
|
|
119
|
+
actions?: (props: {
|
|
120
|
+
actions: (Omit<ButtonProps, "onClick"> & {
|
|
121
|
+
onClick?: ((e: MouseEvent, message: any) => void) | undefined;
|
|
122
|
+
})[] | undefined;
|
|
123
|
+
}) => any;
|
|
124
|
+
}>;
|
|
125
|
+
export default _default;
|
|
126
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
127
|
+
new (): {
|
|
128
|
+
$slots: S;
|
|
129
|
+
};
|
|
130
|
+
};
|