@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,225 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/chat-messages";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { ref, computed, watch, nextTick, toRef, onMounted } from "vue";
|
|
7
|
+
import { defu } from "defu";
|
|
8
|
+
import { Presence } from "reka-ui";
|
|
9
|
+
import { useElementBounding, useEventListener, watchThrottled } from "@vueuse/core";
|
|
10
|
+
import { omit } from "@eslamdevui/ui/utils";
|
|
11
|
+
import { useAppConfig } from "#imports";
|
|
12
|
+
import { tv } from "../utils/tv";
|
|
13
|
+
import UChatMessage from "./ChatMessage.vue";
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
messages: { type: Array, required: false },
|
|
16
|
+
status: { type: null, required: false },
|
|
17
|
+
shouldAutoScroll: { type: Boolean, required: false, default: false },
|
|
18
|
+
shouldScrollToBottom: { type: Boolean, required: false, default: true },
|
|
19
|
+
autoScroll: { type: [Boolean, Object], required: false, default: true },
|
|
20
|
+
autoScrollIcon: { type: String, required: false },
|
|
21
|
+
user: { type: Object, required: false },
|
|
22
|
+
assistant: { type: Object, required: false },
|
|
23
|
+
compact: { type: Boolean, required: false },
|
|
24
|
+
spacingOffset: { type: Number, required: false, default: 0 },
|
|
25
|
+
class: { type: null, required: false },
|
|
26
|
+
ui: { type: null, required: false }
|
|
27
|
+
});
|
|
28
|
+
const slots = defineSlots();
|
|
29
|
+
const proxySlots = omit(slots, ["default", "indicator", "viewport"]);
|
|
30
|
+
const appConfig = useAppConfig();
|
|
31
|
+
function getValidVariant(variant) {
|
|
32
|
+
const allowed = ["solid", "outline", "soft", "subtle", "naked"];
|
|
33
|
+
return allowed.includes(variant) ? variant : "soft";
|
|
34
|
+
}
|
|
35
|
+
const userProps = toRef(
|
|
36
|
+
() => defu(
|
|
37
|
+
{ ...props.user, variant: getValidVariant(props.user?.variant) },
|
|
38
|
+
{ side: "right", variant: "soft" }
|
|
39
|
+
)
|
|
40
|
+
);
|
|
41
|
+
const assistantProps = toRef(
|
|
42
|
+
() => defu(
|
|
43
|
+
{ ...props.assistant, variant: getValidVariant(props.assistant?.variant) },
|
|
44
|
+
{ side: "left", variant: "naked" }
|
|
45
|
+
)
|
|
46
|
+
);
|
|
47
|
+
const ui = computed(
|
|
48
|
+
() => tv({ extend: tv(theme), ...appConfig.ui?.chatMessages || {} })({
|
|
49
|
+
compact: props.compact
|
|
50
|
+
})
|
|
51
|
+
);
|
|
52
|
+
const el = ref();
|
|
53
|
+
const parent = ref();
|
|
54
|
+
const messagesRefs = ref(/* @__PURE__ */ new Map());
|
|
55
|
+
const showAutoScroll = ref(false);
|
|
56
|
+
const lastMessageHeight = ref(0);
|
|
57
|
+
const lastMessageSubmitted = ref(false);
|
|
58
|
+
function registerMessageRef(id, element) {
|
|
59
|
+
const elInstance = element?.$el;
|
|
60
|
+
if (elInstance) {
|
|
61
|
+
messagesRefs.value.set(id, elInstance);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function scrollToMessage(id) {
|
|
65
|
+
const element = messagesRefs.value.get(id);
|
|
66
|
+
if (element) {
|
|
67
|
+
element.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function scrollToBottom(smooth = true) {
|
|
71
|
+
if (!parent.value) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (smooth) {
|
|
75
|
+
parent.value.scrollTo({ top: parent.value.scrollHeight, behavior: "smooth" });
|
|
76
|
+
} else {
|
|
77
|
+
parent.value.scrollTop = parent.value.scrollHeight;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
watchThrottled([() => props.messages, () => props.status], ([_, status]) => {
|
|
81
|
+
if (status !== "streaming") {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (props.shouldAutoScroll) {
|
|
85
|
+
requestAnimationFrame(() => nextTick(scrollToBottom));
|
|
86
|
+
} else {
|
|
87
|
+
checkScrollPosition();
|
|
88
|
+
}
|
|
89
|
+
}, { throttle: 100, leading: true });
|
|
90
|
+
watch(() => props.status, (status) => {
|
|
91
|
+
if (status !== "submitted") {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const lastMessage = props.messages?.[props.messages.length - 1];
|
|
95
|
+
if (!lastMessage || lastMessage.role !== "user") {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
nextTick(() => {
|
|
99
|
+
lastMessageSubmitted.value = true;
|
|
100
|
+
updateLastMessageHeight();
|
|
101
|
+
nextTick(() => {
|
|
102
|
+
scrollToMessage(lastMessage.id);
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
function checkScrollPosition() {
|
|
107
|
+
if (!parent.value) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const scrollPosition = parent.value.scrollTop + parent.value.clientHeight;
|
|
111
|
+
const scrollHeight = parent.value.scrollHeight;
|
|
112
|
+
const threshold = 100;
|
|
113
|
+
showAutoScroll.value = scrollHeight - scrollPosition >= threshold;
|
|
114
|
+
}
|
|
115
|
+
function onAutoScrollClick() {
|
|
116
|
+
scrollToBottom();
|
|
117
|
+
}
|
|
118
|
+
function getScrollParent(node) {
|
|
119
|
+
if (!node) {
|
|
120
|
+
return document.documentElement;
|
|
121
|
+
}
|
|
122
|
+
const overflowRegex = /auto|scroll/;
|
|
123
|
+
let current = node;
|
|
124
|
+
while (current && current !== document.body && current !== document.documentElement) {
|
|
125
|
+
const style = window.getComputedStyle(current);
|
|
126
|
+
if (overflowRegex.test(style.overflowY)) {
|
|
127
|
+
return current;
|
|
128
|
+
}
|
|
129
|
+
current = current.parentElement;
|
|
130
|
+
}
|
|
131
|
+
return document.documentElement;
|
|
132
|
+
}
|
|
133
|
+
function updateLastMessageHeight() {
|
|
134
|
+
if (!el.value || !parent.value || !props.messages?.length || !lastMessageSubmitted.value) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const { height: parentHeight } = useElementBounding(parent.value);
|
|
138
|
+
const lastMessage = props.messages.findLast((m) => m.role === "user");
|
|
139
|
+
if (!lastMessage) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const lastMessageEl = messagesRefs.value.get(lastMessage.id);
|
|
143
|
+
if (!lastMessageEl) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
let spacingOffset = props.spacingOffset || 0;
|
|
147
|
+
const elComputedStyle = window.getComputedStyle(el.value);
|
|
148
|
+
const parentComputedStyle = window.getComputedStyle(parent.value);
|
|
149
|
+
spacingOffset += Number.parseFloat(elComputedStyle.rowGap) || Number.parseFloat(elComputedStyle.gap) || 0;
|
|
150
|
+
spacingOffset += Number.parseFloat(parentComputedStyle.paddingTop) || 0;
|
|
151
|
+
spacingOffset += Number.parseFloat(parentComputedStyle.paddingBottom) || 0;
|
|
152
|
+
lastMessageHeight.value = Math.max(parentHeight.value - lastMessageEl.offsetHeight - spacingOffset, 0);
|
|
153
|
+
}
|
|
154
|
+
onMounted(() => {
|
|
155
|
+
parent.value = getScrollParent(el.value || null);
|
|
156
|
+
if (!parent.value) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
if (props.shouldScrollToBottom) {
|
|
160
|
+
nextTick(() => scrollToBottom(false));
|
|
161
|
+
} else {
|
|
162
|
+
checkScrollPosition();
|
|
163
|
+
}
|
|
164
|
+
useEventListener(parent, "scroll", checkScrollPosition);
|
|
165
|
+
useEventListener(window, "resize", () => nextTick(updateLastMessageHeight));
|
|
166
|
+
});
|
|
167
|
+
</script>
|
|
168
|
+
|
|
169
|
+
<template>
|
|
170
|
+
<div
|
|
171
|
+
ref="el"
|
|
172
|
+
:data-status="status"
|
|
173
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
174
|
+
:style="{ '--last-message-height': `${lastMessageHeight}px` }"
|
|
175
|
+
>
|
|
176
|
+
<slot>
|
|
177
|
+
<UChatMessage
|
|
178
|
+
v-for="message in messages"
|
|
179
|
+
:key="message.id"
|
|
180
|
+
v-bind="{ ...message, ...message.role === 'user' ? userProps : assistantProps }"
|
|
181
|
+
:ref="(el) => registerMessageRef(message.id, el)"
|
|
182
|
+
:compact="compact"
|
|
183
|
+
>
|
|
184
|
+
<template v-for="(_, name) in proxySlots" #[name]>
|
|
185
|
+
<slot :name="name" v-bind="{ message }" />
|
|
186
|
+
</template>
|
|
187
|
+
</UChatMessage>
|
|
188
|
+
</slot>
|
|
189
|
+
|
|
190
|
+
<UChatMessage
|
|
191
|
+
v-if="status === 'submitted'"
|
|
192
|
+
id="indicator"
|
|
193
|
+
content=""
|
|
194
|
+
role="assistant"
|
|
195
|
+
v-bind="{ ...assistantProps, actions: void 0 }"
|
|
196
|
+
:compact="compact"
|
|
197
|
+
>
|
|
198
|
+
<template #content>
|
|
199
|
+
<div :class="ui.indicator({ class: props.ui?.indicator })">
|
|
200
|
+
<slot name="indicator">
|
|
201
|
+
<span />
|
|
202
|
+
<span />
|
|
203
|
+
<span />
|
|
204
|
+
</slot>
|
|
205
|
+
</div>
|
|
206
|
+
</template>
|
|
207
|
+
</UChatMessage>
|
|
208
|
+
|
|
209
|
+
<Presence :present="showAutoScroll">
|
|
210
|
+
<div :data-state="showAutoScroll ? 'open' : 'closed'" :class="ui.viewport({ class: props.ui?.viewport })">
|
|
211
|
+
<slot name="viewport" :on-click="onAutoScrollClick">
|
|
212
|
+
<UButton
|
|
213
|
+
v-if="autoScroll"
|
|
214
|
+
:icon="autoScrollIcon || appConfig.ui.icons.arrowDown"
|
|
215
|
+
color="neutral"
|
|
216
|
+
variant="outline"
|
|
217
|
+
v-bind="typeof autoScroll === 'object' ? autoScroll : {}"
|
|
218
|
+
:class="ui.autoScroll({ class: props.ui?.autoScroll })"
|
|
219
|
+
@click="onAutoScrollClick"
|
|
220
|
+
/>
|
|
221
|
+
</slot>
|
|
222
|
+
</div>
|
|
223
|
+
</Presence>
|
|
224
|
+
</div>
|
|
225
|
+
</template>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
2
|
+
import type { ButtonProps, ComponentConfig } from '@eslamdevui/ui';
|
|
3
|
+
import type { Message, UseChatHelpers } from '@ai-sdk/vue';
|
|
4
|
+
import theme from '#build/ui/chat-messages';
|
|
5
|
+
import type { ChatMessageProps } from '../types';
|
|
6
|
+
type ChatMessages = ComponentConfig<typeof theme, AppConfig, 'chatMessages'>;
|
|
7
|
+
export interface ChatMessagesProps {
|
|
8
|
+
messages?: Message[];
|
|
9
|
+
status?: UseChatHelpers['status']['value'];
|
|
10
|
+
/**
|
|
11
|
+
* Whether to automatically scroll to the bottom when a message is streaming.
|
|
12
|
+
* @defaultValue false
|
|
13
|
+
*/
|
|
14
|
+
shouldAutoScroll?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Whether to scroll to the bottom on mounted.
|
|
17
|
+
* @defaultValue true
|
|
18
|
+
*/
|
|
19
|
+
shouldScrollToBottom?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Display an auto scroll button.
|
|
22
|
+
* `{ size: 'md', color: 'neutral', variant: 'outline' }`{lang="ts-type"}
|
|
23
|
+
* @defaultValue true
|
|
24
|
+
*/
|
|
25
|
+
autoScroll?: boolean | Partial<ButtonProps>;
|
|
26
|
+
/**
|
|
27
|
+
* The icon displayed in the auto scroll button.
|
|
28
|
+
* @defaultValue appConfig.ui.icons.arrowDown
|
|
29
|
+
* @IconifyIcon
|
|
30
|
+
*/
|
|
31
|
+
autoScrollIcon?: string;
|
|
32
|
+
/**
|
|
33
|
+
* The `user` messages props.
|
|
34
|
+
* `{ side: 'right', variant: 'soft' }`{lang="ts-type"}
|
|
35
|
+
*/
|
|
36
|
+
user?: Pick<ChatMessageProps, 'icon' | 'avatar' | 'variant' | 'side' | 'actions'>;
|
|
37
|
+
/**
|
|
38
|
+
* The `assistant` messages props.
|
|
39
|
+
* `{ side: 'left', variant: 'naked' }`{lang="ts-type"}
|
|
40
|
+
*/
|
|
41
|
+
assistant?: Pick<ChatMessageProps, 'icon' | 'avatar' | 'variant' | 'side' | 'actions'>;
|
|
42
|
+
/**
|
|
43
|
+
* Render the messages in a compact style.
|
|
44
|
+
* This is done automatically when used inside a `UChatPalette`{lang="ts-type"}.
|
|
45
|
+
* @defaultValue false
|
|
46
|
+
*/
|
|
47
|
+
compact?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* The spacing offset for the last message in px. Can be useful when the prompt is sticky for example.
|
|
50
|
+
* @defaultValue 0
|
|
51
|
+
*/
|
|
52
|
+
spacingOffset?: number;
|
|
53
|
+
class?: any;
|
|
54
|
+
ui?: ChatMessages['slots'];
|
|
55
|
+
}
|
|
56
|
+
export interface ChatMessagesSlots {
|
|
57
|
+
default(props?: {}): any;
|
|
58
|
+
indicator(props?: {}): any;
|
|
59
|
+
viewport(props: {
|
|
60
|
+
onClick: () => void;
|
|
61
|
+
}): any;
|
|
62
|
+
content(props: {
|
|
63
|
+
message: Message;
|
|
64
|
+
}): any;
|
|
65
|
+
leading(props: {
|
|
66
|
+
message: Message;
|
|
67
|
+
}): any;
|
|
68
|
+
actions(props: {
|
|
69
|
+
message: Message;
|
|
70
|
+
}): any;
|
|
71
|
+
}
|
|
72
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ChatMessagesProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ChatMessagesProps> & Readonly<{}>, {
|
|
73
|
+
autoScroll: boolean | Partial<ButtonProps>;
|
|
74
|
+
shouldAutoScroll: boolean;
|
|
75
|
+
shouldScrollToBottom: boolean;
|
|
76
|
+
spacingOffset: number;
|
|
77
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ChatMessagesSlots>;
|
|
78
|
+
export default _default;
|
|
79
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
80
|
+
new (): {
|
|
81
|
+
$slots: S;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/chat-prompt";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed, useTemplateRef } from "vue";
|
|
7
|
+
import { Primitive, useForwardProps } from "reka-ui";
|
|
8
|
+
import { reactivePick } from "@vueuse/core";
|
|
9
|
+
import { omit } from "@eslamdevui/ui/utils";
|
|
10
|
+
import { useAppConfig } from "#imports";
|
|
11
|
+
import { useLocalePro } from "../composables/useLocalePro";
|
|
12
|
+
import { transformUI } from "../utils";
|
|
13
|
+
import { tv } from "../utils/tv";
|
|
14
|
+
defineOptions({ inheritAttrs: false });
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
as: { type: null, required: false, default: "form" },
|
|
17
|
+
placeholder: { type: String, required: false },
|
|
18
|
+
autofocus: { type: null, required: false, default: true },
|
|
19
|
+
autoresize: { type: null, required: false, default: true },
|
|
20
|
+
rows: { type: null, required: false, default: 1 },
|
|
21
|
+
variant: { type: null, required: false },
|
|
22
|
+
error: { type: Error, required: false },
|
|
23
|
+
class: { type: null, required: false },
|
|
24
|
+
ui: { type: void 0, required: false }
|
|
25
|
+
});
|
|
26
|
+
const emits = defineEmits(["submit", "close"]);
|
|
27
|
+
const slots = defineSlots();
|
|
28
|
+
const model = defineModel({ type: String, ...{ default: "" } });
|
|
29
|
+
const { t } = useLocalePro();
|
|
30
|
+
const appConfig = useAppConfig();
|
|
31
|
+
const textareaProps = useForwardProps(reactivePick(props, "autofocus", "autoresize", "rows"));
|
|
32
|
+
const proxySlots = omit(slots, ["header", "footer"]);
|
|
33
|
+
const uiPro = computed(
|
|
34
|
+
() => tv({ extend: tv(theme), ...appConfig.ui?.chatPrompt || {} })({
|
|
35
|
+
variant: props.variant
|
|
36
|
+
})
|
|
37
|
+
);
|
|
38
|
+
const textarea = useTemplateRef("textarea");
|
|
39
|
+
const submit = (e) => {
|
|
40
|
+
if (!model.value?.trim()) return;
|
|
41
|
+
emits("submit", e);
|
|
42
|
+
};
|
|
43
|
+
const blur = (e) => {
|
|
44
|
+
textarea.value?.textareaRef?.blur();
|
|
45
|
+
emits("close", e);
|
|
46
|
+
};
|
|
47
|
+
defineExpose({ textareaRef: textarea.value?.textareaRef });
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<template>
|
|
51
|
+
<Primitive :as="as" :class="uiPro.root({ class: [props.ui?.root, props.class] })" @submit.prevent="submit">
|
|
52
|
+
<div v-if="!!slots.header" :class="uiPro.header({ class: props.ui?.header })">
|
|
53
|
+
<slot name="header" />
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<UTextarea
|
|
57
|
+
ref="textarea"
|
|
58
|
+
v-model="model"
|
|
59
|
+
:placeholder="placeholder || t('chatPrompt.placeholder')"
|
|
60
|
+
:disabled="Boolean(error)"
|
|
61
|
+
variant="none"
|
|
62
|
+
v-bind="{ ...textareaProps, ...$attrs }"
|
|
63
|
+
:ui="transformUI(omit(uiPro, ['root', 'body', 'header', 'footer']), props.ui)"
|
|
64
|
+
:class="uiPro.body({ class: props.ui?.body })"
|
|
65
|
+
@keydown.enter.exact.prevent="submit"
|
|
66
|
+
@keydown.esc="blur"
|
|
67
|
+
>
|
|
68
|
+
<template v-for="(_, name) in proxySlots" #[name]="slotData">
|
|
69
|
+
<slot :name="name" v-bind="slotData" />
|
|
70
|
+
</template>
|
|
71
|
+
</UTextarea>
|
|
72
|
+
|
|
73
|
+
<div v-if="!!slots.footer" :class="uiPro.footer({ class: props.ui?.footer })">
|
|
74
|
+
<slot name="footer" />
|
|
75
|
+
</div>
|
|
76
|
+
</Primitive>
|
|
77
|
+
</template>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
2
|
+
import type { TextareaProps, TextareaSlots, ComponentConfig } from '@eslamdevui/ui';
|
|
3
|
+
import theme from '#build/ui/chat-prompt';
|
|
4
|
+
type ChatPrompt = ComponentConfig<typeof theme, AppConfig, 'chatPrompt', 'ui'>;
|
|
5
|
+
export interface ChatPromptProps extends /** @vue-ignore */ Pick<TextareaProps, 'autofocusDelay' | 'autoresizeDelay' | 'maxrows' | 'icon' | 'avatar' | 'loading' | 'loadingIcon'> {
|
|
6
|
+
/**
|
|
7
|
+
* The element or component this component should render as.
|
|
8
|
+
* @defaultValue 'form'
|
|
9
|
+
*/
|
|
10
|
+
as?: any;
|
|
11
|
+
/**
|
|
12
|
+
* The placeholder text for the textarea.
|
|
13
|
+
* @defaultValue t('chatPrompt.placeholder')
|
|
14
|
+
*/
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
autofocus?: TextareaProps['autofocus'];
|
|
17
|
+
autoresize?: TextareaProps['autoresize'];
|
|
18
|
+
rows?: TextareaProps['rows'];
|
|
19
|
+
/**
|
|
20
|
+
* @defaultValue 'outline'
|
|
21
|
+
*/
|
|
22
|
+
variant?: ChatPrompt['variants']['variant'];
|
|
23
|
+
error?: Error;
|
|
24
|
+
class?: any;
|
|
25
|
+
ui?: ChatPrompt['slots'] & TextareaProps['ui'];
|
|
26
|
+
}
|
|
27
|
+
export interface ChatPromptEmits {
|
|
28
|
+
(e: 'submit' | 'close', event: Event): void;
|
|
29
|
+
}
|
|
30
|
+
export interface ChatPromptSlots extends TextareaSlots {
|
|
31
|
+
header(props?: {}): any;
|
|
32
|
+
footer(props?: {}): any;
|
|
33
|
+
}
|
|
34
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ChatPromptProps & {
|
|
35
|
+
modelValue?: string;
|
|
36
|
+
}, {
|
|
37
|
+
textareaRef: any;
|
|
38
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
39
|
+
"update:modelValue": (value: string) => any;
|
|
40
|
+
} & {
|
|
41
|
+
close: (event: Event) => any;
|
|
42
|
+
submit: (event: Event) => any;
|
|
43
|
+
}, string, import("vue").PublicProps, Readonly<ChatPromptProps & {
|
|
44
|
+
modelValue?: string;
|
|
45
|
+
}> & Readonly<{
|
|
46
|
+
onClose?: ((event: Event) => any) | undefined;
|
|
47
|
+
onSubmit?: ((event: Event) => any) | undefined;
|
|
48
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
49
|
+
}>, {
|
|
50
|
+
as: any;
|
|
51
|
+
autofocus: TextareaProps["autofocus"];
|
|
52
|
+
autoresize: TextareaProps["autoresize"];
|
|
53
|
+
rows: TextareaProps["rows"];
|
|
54
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ChatPromptSlots>;
|
|
55
|
+
export default _default;
|
|
56
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
57
|
+
new (): {
|
|
58
|
+
$slots: S;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/chat-prompt-submit";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { useAppConfig } from "#imports";
|
|
8
|
+
import { useLocalePro } from "../composables/useLocalePro";
|
|
9
|
+
import { transformUI } from "../utils";
|
|
10
|
+
import { tv } from "../utils/tv";
|
|
11
|
+
const props = defineProps({
|
|
12
|
+
status: { type: null, required: false, default: "ready" },
|
|
13
|
+
icon: { type: String, required: false },
|
|
14
|
+
color: { type: null, required: false },
|
|
15
|
+
variant: { type: null, required: false },
|
|
16
|
+
streamingIcon: { type: String, required: false },
|
|
17
|
+
streamingColor: { type: null, required: false, default: "neutral" },
|
|
18
|
+
streamingVariant: { type: null, required: false, default: "subtle" },
|
|
19
|
+
submittedIcon: { type: String, required: false },
|
|
20
|
+
submittedColor: { type: null, required: false, default: "neutral" },
|
|
21
|
+
submittedVariant: { type: null, required: false, default: "subtle" },
|
|
22
|
+
errorIcon: { type: String, required: false },
|
|
23
|
+
errorColor: { type: null, required: false, default: "error" },
|
|
24
|
+
errorVariant: { type: null, required: false, default: "soft" },
|
|
25
|
+
ui: { type: void 0, required: false },
|
|
26
|
+
class: { type: null, required: false }
|
|
27
|
+
});
|
|
28
|
+
const emit = defineEmits(["stop", "reload"]);
|
|
29
|
+
const slots = defineSlots();
|
|
30
|
+
const { t } = useLocalePro();
|
|
31
|
+
const appConfig = useAppConfig();
|
|
32
|
+
const buttonProps = computed(() => {
|
|
33
|
+
return {
|
|
34
|
+
ready: {
|
|
35
|
+
icon: props.icon || appConfig.ui.icons.arrowUp,
|
|
36
|
+
color: props.color ?? "primary",
|
|
37
|
+
variant: props.variant ?? "solid",
|
|
38
|
+
type: "submit"
|
|
39
|
+
},
|
|
40
|
+
submitted: {
|
|
41
|
+
icon: props.submittedIcon || appConfig.ui.icons.stop,
|
|
42
|
+
color: props.submittedColor,
|
|
43
|
+
variant: props.submittedVariant,
|
|
44
|
+
onClick: () => emit("stop")
|
|
45
|
+
},
|
|
46
|
+
streaming: {
|
|
47
|
+
icon: props.streamingIcon || appConfig.ui.icons.stop,
|
|
48
|
+
color: props.streamingColor,
|
|
49
|
+
variant: props.streamingVariant,
|
|
50
|
+
onClick: () => emit("stop")
|
|
51
|
+
},
|
|
52
|
+
error: {
|
|
53
|
+
icon: props.errorIcon || appConfig.ui.icons.reload,
|
|
54
|
+
color: props.errorColor,
|
|
55
|
+
variant: props.errorVariant,
|
|
56
|
+
onClick: () => emit("reload")
|
|
57
|
+
}
|
|
58
|
+
}[props.status || "ready"];
|
|
59
|
+
});
|
|
60
|
+
const uiPro = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.chatPromptSubmit || {} })());
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<template>
|
|
64
|
+
<UButton
|
|
65
|
+
:aria-label="t('chatPromptSubmit.label')"
|
|
66
|
+
v-bind="buttonProps"
|
|
67
|
+
:class="uiPro.base({ class: [props.ui?.base, props.class] })"
|
|
68
|
+
:ui="transformUI(uiPro, props.ui)"
|
|
69
|
+
>
|
|
70
|
+
<template v-for="(_, name) in slots" #[name]="slotData">
|
|
71
|
+
<slot :name="name" v-bind="slotData" />
|
|
72
|
+
</template>
|
|
73
|
+
</UButton>
|
|
74
|
+
</template>
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
2
|
+
import theme from '#build/ui/chat-prompt-submit';
|
|
3
|
+
import type { ButtonProps, ButtonSlots } from '../types';
|
|
4
|
+
import type { UseChatHelpers } from '@ai-sdk/vue';
|
|
5
|
+
import type { ComponentConfig } from '../types/utils';
|
|
6
|
+
type ChatPromptSubmit = ComponentConfig<typeof theme, AppConfig, 'chatPromptSubmit'>;
|
|
7
|
+
export interface ChatPromptSubmitProps extends /** @vue-ignore */ Pick<ButtonProps, 'size' | 'label'> {
|
|
8
|
+
status?: UseChatHelpers['status']['value'];
|
|
9
|
+
/**
|
|
10
|
+
* The icon displayed in the button when the status is `ready`.
|
|
11
|
+
* @defaultValue appConfig.ui.icons.arrowUp
|
|
12
|
+
* @IconifyIcon
|
|
13
|
+
*/
|
|
14
|
+
icon?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The color of the button when the status is `ready`.
|
|
17
|
+
* @defaultValue 'primary'
|
|
18
|
+
*/
|
|
19
|
+
color?: ButtonProps['color'];
|
|
20
|
+
/**
|
|
21
|
+
* The variant of the button when the status is `ready`.
|
|
22
|
+
* @defaultValue 'solid'
|
|
23
|
+
*/
|
|
24
|
+
variant?: ButtonProps['variant'];
|
|
25
|
+
/**
|
|
26
|
+
* The icon displayed in the button when the status is `streaming`.
|
|
27
|
+
* @defaultValue appConfig.ui.icons.stop
|
|
28
|
+
* @IconifyIcon
|
|
29
|
+
*/
|
|
30
|
+
streamingIcon?: string;
|
|
31
|
+
/**
|
|
32
|
+
* The color of the button when the status is `streaming`.
|
|
33
|
+
* @defaultValue 'neutral'
|
|
34
|
+
*/
|
|
35
|
+
streamingColor?: ButtonProps['color'];
|
|
36
|
+
/**
|
|
37
|
+
* The variant of the button when the status is `streaming`.
|
|
38
|
+
* @defaultValue 'subtle'
|
|
39
|
+
*/
|
|
40
|
+
streamingVariant?: ButtonProps['variant'];
|
|
41
|
+
/**
|
|
42
|
+
* The icon displayed in the button when the status is `submitted`.
|
|
43
|
+
* @defaultValue appConfig.ui.icons.stop
|
|
44
|
+
* @IconifyIcon
|
|
45
|
+
*/
|
|
46
|
+
submittedIcon?: string;
|
|
47
|
+
/**
|
|
48
|
+
* The color of the button when the status is `submitted`.
|
|
49
|
+
* @defaultValue 'neutral'
|
|
50
|
+
*/
|
|
51
|
+
submittedColor?: ButtonProps['color'];
|
|
52
|
+
/**
|
|
53
|
+
* The variant of the button when the status is `submitted`.
|
|
54
|
+
* @defaultValue 'subtle'
|
|
55
|
+
*/
|
|
56
|
+
submittedVariant?: ButtonProps['variant'];
|
|
57
|
+
/**
|
|
58
|
+
* The icon displayed in the button when the status is `error`.
|
|
59
|
+
* @defaultValue appConfig.ui.icons.reload
|
|
60
|
+
* @IconifyIcon
|
|
61
|
+
*/
|
|
62
|
+
errorIcon?: string;
|
|
63
|
+
/**
|
|
64
|
+
* The color of the button when the status is `error`.
|
|
65
|
+
* @defaultValue 'error'
|
|
66
|
+
*/
|
|
67
|
+
errorColor?: ButtonProps['color'];
|
|
68
|
+
/**
|
|
69
|
+
* The variant of the button when the status is `error`.
|
|
70
|
+
* @defaultValue 'soft'
|
|
71
|
+
*/
|
|
72
|
+
errorVariant?: ButtonProps['variant'];
|
|
73
|
+
ui?: ChatPromptSubmit['slots'] & ButtonProps['ui'];
|
|
74
|
+
class?: any;
|
|
75
|
+
}
|
|
76
|
+
export interface ChatPromptSubmitEmits {
|
|
77
|
+
(e: 'stop' | 'reload'): void;
|
|
78
|
+
}
|
|
79
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ChatPromptSubmitProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
80
|
+
stop: () => any;
|
|
81
|
+
reload: () => any;
|
|
82
|
+
}, string, import("vue").PublicProps, Readonly<ChatPromptSubmitProps> & Readonly<{
|
|
83
|
+
onStop?: (() => any) | undefined;
|
|
84
|
+
onReload?: (() => any) | undefined;
|
|
85
|
+
}>, {
|
|
86
|
+
status: UseChatHelpers["status"]["value"];
|
|
87
|
+
streamingColor: "error" | "info" | "primary" | "secondary" | "success" | "warning" | "neutral";
|
|
88
|
+
streamingVariant: "link" | "solid" | "outline" | "soft" | "subtle" | "ghost";
|
|
89
|
+
submittedColor: "error" | "info" | "primary" | "secondary" | "success" | "warning" | "neutral";
|
|
90
|
+
submittedVariant: "link" | "solid" | "outline" | "soft" | "subtle" | "ghost";
|
|
91
|
+
errorColor: "error" | "info" | "primary" | "secondary" | "success" | "warning" | "neutral";
|
|
92
|
+
errorVariant: "link" | "solid" | "outline" | "soft" | "subtle" | "ghost";
|
|
93
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ButtonSlots>;
|
|
94
|
+
export default _default;
|
|
95
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
96
|
+
new (): {
|
|
97
|
+
$slots: S;
|
|
98
|
+
};
|
|
99
|
+
};
|