@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,228 @@
|
|
|
1
|
+
import { splitByCase, upperFirst, camelCase, kebabCase } from 'scule'
|
|
2
|
+
|
|
3
|
+
const playground = ({ name }) => {
|
|
4
|
+
const upperName = splitByCase(name)
|
|
5
|
+
.map(p => upperFirst(p))
|
|
6
|
+
.join('')
|
|
7
|
+
const kebabName = kebabCase(name)
|
|
8
|
+
|
|
9
|
+
return {
|
|
10
|
+
filename: `playground/app/pages/components/${kebabName}.vue`,
|
|
11
|
+
contents: `
|
|
12
|
+
<template>
|
|
13
|
+
<div>
|
|
14
|
+
<U${upperName} />
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
`
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const component = ({ name, primitive, prose, content }) => {
|
|
22
|
+
const upperName = splitByCase(name)
|
|
23
|
+
.map(p => upperFirst(p))
|
|
24
|
+
.join('')
|
|
25
|
+
const camelName = camelCase(name)
|
|
26
|
+
const kebabName = kebabCase(name)
|
|
27
|
+
const path = 'ui'
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
filename: `src/runtime/components/${prose ? 'prose/' : ''}${content ? 'content/' : ''}${upperName}.vue`,
|
|
31
|
+
contents: primitive
|
|
32
|
+
? `
|
|
33
|
+
<script lang="ts">
|
|
34
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
35
|
+
import type { ComponentConfig } from '@eslamdevui/ui'
|
|
36
|
+
import theme from '#build/${path}/${prose ? 'prose/' : ''}${content ? 'content/' : ''}${kebabName}'
|
|
37
|
+
import type { ComponentConfig as LocalConfig } from '../types/utils'
|
|
38
|
+
|
|
39
|
+
type ${upperName} = ComponentConfig<typeof theme, AppConfig, '${camelName}'>
|
|
40
|
+
|
|
41
|
+
export interface ${upperName}Props {
|
|
42
|
+
/**
|
|
43
|
+
* The element or component this component should render as.
|
|
44
|
+
* @defaultValue 'div'
|
|
45
|
+
*/
|
|
46
|
+
as?: any
|
|
47
|
+
class?: any
|
|
48
|
+
ui?: ${upperName}['slots']
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface ${upperName}Slots {
|
|
52
|
+
default(props?: {}): any
|
|
53
|
+
}
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<script setup lang="ts">
|
|
57
|
+
import { computed } from 'vue'
|
|
58
|
+
import { Primitive } from 'reka-ui'
|
|
59
|
+
import { useAppConfig } from '#imports'
|
|
60
|
+
import { tv } from '../utils/tv'
|
|
61
|
+
|
|
62
|
+
const props = defineProps<${upperName}Props>()
|
|
63
|
+
defineSlots<${upperName}Slots>()
|
|
64
|
+
|
|
65
|
+
const appConfig = useAppConfig() as ${upperName}['AppConfig']
|
|
66
|
+
|
|
67
|
+
const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.${camelName} || {}) })())
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<template>
|
|
71
|
+
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
72
|
+
<slot />
|
|
73
|
+
</Primitive>
|
|
74
|
+
</template>
|
|
75
|
+
`
|
|
76
|
+
: `
|
|
77
|
+
<script lang="ts">
|
|
78
|
+
import type { ${upperName}RootProps, ${upperName}RootEmits } from 'reka-ui'
|
|
79
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
80
|
+
import type { ComponentConfig } from '@eslamdevui/ui'
|
|
81
|
+
import theme from '#build/${path}/${prose ? 'prose/' : ''}${content ? 'content/' : ''}${kebabName}'
|
|
82
|
+
import type { ComponentConfig as LocalConfig } from '../types/utils'
|
|
83
|
+
|
|
84
|
+
type ${upperName} = ComponentConfig<typeof theme, AppConfig, '${camelName}'>
|
|
85
|
+
|
|
86
|
+
export interface ${upperName}Props extends Pick<${upperName}RootProps> {
|
|
87
|
+
class?: any
|
|
88
|
+
ui?: ${upperName}['slots']
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface ${upperName}Emits extends ${upperName}RootEmits {}
|
|
92
|
+
|
|
93
|
+
export interface ${upperName}Slots {}
|
|
94
|
+
</script>
|
|
95
|
+
|
|
96
|
+
<script setup lang="ts">
|
|
97
|
+
import { computed } from 'vue'
|
|
98
|
+
import { ${upperName}Root, useForwardPropsEmits } from 'reka-ui'
|
|
99
|
+
import { reactivePick } from '@vueuse/core'
|
|
100
|
+
import { useAppConfig } from '#imports'
|
|
101
|
+
import { tv } from '../utils/tv'
|
|
102
|
+
|
|
103
|
+
const props = defineProps<${upperName}Props>()
|
|
104
|
+
const emits = defineEmits<${upperName}Emits>()
|
|
105
|
+
const slots = defineSlots<${upperName}Slots>()
|
|
106
|
+
|
|
107
|
+
const appConfig = useAppConfig() as ${upperName}['AppConfig']
|
|
108
|
+
|
|
109
|
+
const rootProps = useForwardPropsEmits(reactivePick(props), emits)
|
|
110
|
+
|
|
111
|
+
const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.${camelName} || {}) })())
|
|
112
|
+
</script>
|
|
113
|
+
|
|
114
|
+
<template>
|
|
115
|
+
<${upperName}Root v-bind="rootProps" :class="ui.root({ class: [props.ui?.root, props.class] })" />
|
|
116
|
+
</template>
|
|
117
|
+
`
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const theme = ({ name, prose, content }) => {
|
|
122
|
+
const kebabName = kebabCase(name)
|
|
123
|
+
|
|
124
|
+
return {
|
|
125
|
+
filename: `src/theme/${prose ? 'prose/' : ''}${content ? 'content/' : ''}${kebabName}.ts`,
|
|
126
|
+
contents: prose
|
|
127
|
+
? `
|
|
128
|
+
export default {
|
|
129
|
+
base: ''
|
|
130
|
+
}
|
|
131
|
+
`
|
|
132
|
+
: `
|
|
133
|
+
export default {
|
|
134
|
+
slots: {
|
|
135
|
+
root: ''
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
`
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const test = ({ name, prose, content }) => {
|
|
143
|
+
const upperName = splitByCase(name)
|
|
144
|
+
.map(p => upperFirst(p))
|
|
145
|
+
.join('')
|
|
146
|
+
|
|
147
|
+
return {
|
|
148
|
+
filename: `test/components/${content ? 'content/' : ''}${upperName}.spec.ts`,
|
|
149
|
+
contents: prose
|
|
150
|
+
? undefined
|
|
151
|
+
: `
|
|
152
|
+
import { describe, it, expect } from 'vitest'
|
|
153
|
+
import ${upperName}, { type ${upperName}Props, type ${upperName}Slots } from '../../${content ? '../' : ''}src/runtime/components/${content ? 'content/' : ''}${upperName}.vue'
|
|
154
|
+
import ComponentRender from '../${content ? '../' : ''}component-render'
|
|
155
|
+
|
|
156
|
+
describe('${upperName}', () => {
|
|
157
|
+
it.each([
|
|
158
|
+
// Props
|
|
159
|
+
['with as', { props: { as: 'section' } }],
|
|
160
|
+
['with class', { props: { class: '' } }],
|
|
161
|
+
['with ui', { props: { ui: {} } }],
|
|
162
|
+
// Slots
|
|
163
|
+
['with default slot', { slots: { default: () => 'Default slot' } }]
|
|
164
|
+
])('renders %s correctly', async (nameOrHtml: string, options: { props?: ${upperName}Props, slots?: Partial<${upperName}Slots> }) => {
|
|
165
|
+
const html = await ComponentRender(nameOrHtml, options, ${upperName})
|
|
166
|
+
expect(html).toMatchSnapshot()
|
|
167
|
+
})
|
|
168
|
+
})
|
|
169
|
+
`
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const docs = ({ name, primitive }) => {
|
|
174
|
+
const kebabName = kebabCase(name)
|
|
175
|
+
const upperName = splitByCase(name)
|
|
176
|
+
.map(p => upperFirst(p))
|
|
177
|
+
.join('')
|
|
178
|
+
|
|
179
|
+
return {
|
|
180
|
+
filename: `docs/content/3.components/${kebabName}.md`,
|
|
181
|
+
contents: `---
|
|
182
|
+
title: ${upperName}
|
|
183
|
+
description: ''
|
|
184
|
+
links:${
|
|
185
|
+
primitive
|
|
186
|
+
? ''
|
|
187
|
+
: `
|
|
188
|
+
- label: ${upperName}
|
|
189
|
+
icon: i-custom-reka-ui
|
|
190
|
+
to: https://reka-ui.com/docs/components/${kebabName}`
|
|
191
|
+
}
|
|
192
|
+
- label: GitHub
|
|
193
|
+
icon: i-simple-icons-github
|
|
194
|
+
to: https://github.com/MohamedEslam04/ui/tree/v3/src/runtime/components/${upperName}.vue
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Usage
|
|
198
|
+
|
|
199
|
+
## Examples
|
|
200
|
+
|
|
201
|
+
## API
|
|
202
|
+
|
|
203
|
+
### Props
|
|
204
|
+
|
|
205
|
+
:component-props
|
|
206
|
+
|
|
207
|
+
### Slots
|
|
208
|
+
|
|
209
|
+
:component-slots
|
|
210
|
+
|
|
211
|
+
### Emits
|
|
212
|
+
|
|
213
|
+
:component-emits
|
|
214
|
+
|
|
215
|
+
## Theme
|
|
216
|
+
|
|
217
|
+
:component-theme
|
|
218
|
+
`
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export default {
|
|
223
|
+
playground,
|
|
224
|
+
component,
|
|
225
|
+
theme,
|
|
226
|
+
test,
|
|
227
|
+
docs
|
|
228
|
+
}
|
package/cli/utils.mjs
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { promises as fsp } from 'node:fs'
|
|
2
|
+
|
|
3
|
+
export async function sortFile(path) {
|
|
4
|
+
const file = await fsp.readFile(path, 'utf-8')
|
|
5
|
+
|
|
6
|
+
const lines = file.trim().split('\n').sort()
|
|
7
|
+
|
|
8
|
+
await fsp.writeFile(path, lines.join('\n') + '\n')
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export async function appendFile(path, contents) {
|
|
12
|
+
const file = await fsp.readFile(path, 'utf-8')
|
|
13
|
+
|
|
14
|
+
if (!file.includes(contents)) {
|
|
15
|
+
await fsp.writeFile(path, file.trim() + '\n' + contents + '\n')
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function normalizeLocale(locale) {
|
|
20
|
+
if (!locale) {
|
|
21
|
+
return ''
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (locale.includes('_')) {
|
|
25
|
+
return locale.split('_')
|
|
26
|
+
.map((part, index) => index === 0 ? part.toLowerCase() : part.toUpperCase())
|
|
27
|
+
.join('-')
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return locale.toLowerCase()
|
|
31
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
+
import { HookResult } from '@nuxt/schema';
|
|
3
|
+
export * from '../dist/runtime/types/index.js';
|
|
4
|
+
|
|
5
|
+
interface ModuleOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Prefix for components
|
|
8
|
+
* @defaultValue `U`
|
|
9
|
+
* @link https://ui.nuxt.com/getting-started/installation/nuxt#prefix
|
|
10
|
+
*/
|
|
11
|
+
prefix?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Enable or disable `@nuxt/fonts` module
|
|
14
|
+
* @defaultValue `true`
|
|
15
|
+
* @link https://ui.nuxt.com/getting-started/installation/nuxt#fonts
|
|
16
|
+
*/
|
|
17
|
+
fonts?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Enable or disable `@nuxtjs/color-mode` module
|
|
20
|
+
* @defaultValue `true`
|
|
21
|
+
* @link https://ui.nuxt.com/getting-started/installation/nuxt#colormode
|
|
22
|
+
*/
|
|
23
|
+
colorMode?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Customize how the theme is generated
|
|
26
|
+
* @link https://ui.nuxt.com/getting-started/theme
|
|
27
|
+
*/
|
|
28
|
+
theme?: {
|
|
29
|
+
/**
|
|
30
|
+
* Define the color aliases available for components
|
|
31
|
+
* @defaultValue `['primary', 'secondary', 'success', 'info', 'warning', 'error']`
|
|
32
|
+
* @link https://ui.nuxt.com/getting-started/installation/nuxt#themecolors
|
|
33
|
+
*/
|
|
34
|
+
colors?: string[];
|
|
35
|
+
/**
|
|
36
|
+
* Enable or disable transitions on components
|
|
37
|
+
* @defaultValue `true`
|
|
38
|
+
* @link https://ui.nuxt.com/getting-started/installation/nuxt#themetransitions
|
|
39
|
+
*/
|
|
40
|
+
transitions?: boolean;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Force the import of prose components even if @nuxtjs/mdc or @nuxt/content is not installed
|
|
44
|
+
* @defaultValue false
|
|
45
|
+
*/
|
|
46
|
+
mdc?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Force the import of content & prose components even if @nuxt/content is not installed
|
|
49
|
+
* @defaultValue false
|
|
50
|
+
*/
|
|
51
|
+
content?: boolean;
|
|
52
|
+
}
|
|
53
|
+
declare module '#app' {
|
|
54
|
+
interface RuntimeNuxtHooks {
|
|
55
|
+
'dashboard:search:toggle': () => HookResult;
|
|
56
|
+
'dashboard:sidebar:toggle': () => HookResult;
|
|
57
|
+
'dashboard:sidebar:collapse': (value: boolean) => HookResult;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
61
|
+
|
|
62
|
+
export { _default as default };
|
|
63
|
+
export type { ModuleOptions };
|
package/dist/module.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@eslamdevui/ui",
|
|
3
|
+
"version": "3.2.0-beta.1",
|
|
4
|
+
"docs": "https://ui.nuxt.com/getting-started/installation/nuxt",
|
|
5
|
+
"configKey": "ui",
|
|
6
|
+
"compatibility": {
|
|
7
|
+
"nuxt": ">=3.16.0"
|
|
8
|
+
},
|
|
9
|
+
"builder": {
|
|
10
|
+
"@nuxt/module-builder": "1.0.1",
|
|
11
|
+
"unbuild": "3.5.0"
|
|
12
|
+
}
|
|
13
|
+
}
|
package/dist/module.mjs
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { defu } from 'defu';
|
|
2
|
+
import { defineNuxtModule, createResolver, addVitePlugin, addPlugin, hasNuxtModule, addComponentsDir, addImportsDir, installModule } from '@nuxt/kit';
|
|
3
|
+
import { d as defaultOptions, r as resolveColors, a as getDefaultUiConfig, b as addTemplates } from './shared/ui.BcVNrqyb.mjs';
|
|
4
|
+
import '../dist/runtime/utils/index.js';
|
|
5
|
+
import 'node:url';
|
|
6
|
+
import 'scule';
|
|
7
|
+
import 'tailwindcss/colors';
|
|
8
|
+
import 'knitwork';
|
|
9
|
+
|
|
10
|
+
const name = "@eslamdevui/ui";
|
|
11
|
+
const version = "3.2.0-beta.1";
|
|
12
|
+
|
|
13
|
+
const module = defineNuxtModule({
|
|
14
|
+
meta: {
|
|
15
|
+
name,
|
|
16
|
+
version,
|
|
17
|
+
docs: "https://ui.nuxt.com/getting-started/installation/nuxt",
|
|
18
|
+
configKey: "ui",
|
|
19
|
+
compatibility: {
|
|
20
|
+
nuxt: ">=3.16.0"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
defaults: defaultOptions,
|
|
24
|
+
async setup(options, nuxt) {
|
|
25
|
+
const { resolve } = createResolver(import.meta.url);
|
|
26
|
+
options.theme = options.theme || {};
|
|
27
|
+
options.theme.colors = resolveColors(options.theme.colors);
|
|
28
|
+
nuxt.options.ui = options;
|
|
29
|
+
nuxt.options.alias["#ui"] = resolve("./runtime");
|
|
30
|
+
nuxt.options.appConfig.ui = defu(nuxt.options.appConfig.ui || {}, getDefaultUiConfig(options.theme.colors));
|
|
31
|
+
nuxt.options.app.rootAttrs = nuxt.options.app.rootAttrs || {};
|
|
32
|
+
nuxt.options.app.rootAttrs.class = [nuxt.options.app.rootAttrs.class, "isolate"].filter(Boolean).join(" ");
|
|
33
|
+
if (nuxt.options.builder === "@nuxt/vite-builder") {
|
|
34
|
+
const plugin = await import('@tailwindcss/vite').then((r) => r.default);
|
|
35
|
+
addVitePlugin(plugin());
|
|
36
|
+
} else {
|
|
37
|
+
nuxt.options.postcss.plugins["@tailwindcss/postcss"] = {};
|
|
38
|
+
}
|
|
39
|
+
async function registerModule(name2, key, options2) {
|
|
40
|
+
if (!hasNuxtModule(name2)) {
|
|
41
|
+
await installModule(name2, options2);
|
|
42
|
+
} else {
|
|
43
|
+
nuxt.options[key] = defu(nuxt.options[key], options2);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
await registerModule("@nuxt/icon", "icon", {
|
|
47
|
+
cssLayer: "components"
|
|
48
|
+
});
|
|
49
|
+
if (options.fonts) {
|
|
50
|
+
await registerModule("@nuxt/fonts", "fonts", {
|
|
51
|
+
defaults: {
|
|
52
|
+
weights: [400, 500, 600, 700]
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
if (options.colorMode) {
|
|
57
|
+
await registerModule("@nuxtjs/color-mode", "colorMode", {
|
|
58
|
+
classSuffix: "",
|
|
59
|
+
disableTransition: true
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
await registerModule("@nuxt/content", "content", {});
|
|
63
|
+
addPlugin({ src: resolve("./runtime/plugins/colors") });
|
|
64
|
+
if (hasNuxtModule("@nuxtjs/mdc") || options.mdc || (hasNuxtModule("@nuxt/content") || options.content)) {
|
|
65
|
+
nuxt.options.mdc = defu(nuxt.options.mdc, {
|
|
66
|
+
highlight: {
|
|
67
|
+
theme: {
|
|
68
|
+
light: "material-theme-lighter",
|
|
69
|
+
default: "material-theme",
|
|
70
|
+
dark: "material-theme-palenight"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
components: {
|
|
74
|
+
map: {
|
|
75
|
+
"accordion": "ProseAccordion",
|
|
76
|
+
"accordion-item": "ProseAccordionItem",
|
|
77
|
+
"badge": "ProseBadge",
|
|
78
|
+
"callout": "ProseCallout",
|
|
79
|
+
"card": "ProseCard",
|
|
80
|
+
"card-group": "ProseCardGroup",
|
|
81
|
+
"caution": "ProseCaution",
|
|
82
|
+
"code-collapse": "ProseCodeCollapse",
|
|
83
|
+
"code-group": "ProseCodeGroup",
|
|
84
|
+
"code-icon": "ProseCodeIcon",
|
|
85
|
+
"code-preview": "ProseCodePreview",
|
|
86
|
+
"code-tree": "ProseCodeTree",
|
|
87
|
+
"collapsible": "ProseCollapsible",
|
|
88
|
+
"field": "ProseField",
|
|
89
|
+
"field-group": "ProseFieldGroup",
|
|
90
|
+
"icon": "ProseIcon",
|
|
91
|
+
"kbd": "ProseKbd",
|
|
92
|
+
"note": "ProseNote",
|
|
93
|
+
"steps": "ProseSteps",
|
|
94
|
+
"tabs": "ProseTabs",
|
|
95
|
+
"tabs-item": "ProseTabsItem",
|
|
96
|
+
"tip": "ProseTip",
|
|
97
|
+
"warning": "ProseWarning"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
addComponentsDir({
|
|
102
|
+
path: resolve("./runtime/components/prose"),
|
|
103
|
+
prefix: "Prose",
|
|
104
|
+
pathPrefix: false,
|
|
105
|
+
global: true
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
if (hasNuxtModule("@nuxt/content") || options.content) {
|
|
109
|
+
addComponentsDir({
|
|
110
|
+
path: resolve("./runtime/components/content"),
|
|
111
|
+
pathPrefix: false,
|
|
112
|
+
prefix: nuxt.options.ui?.prefix || "U"
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
if (hasNuxtModule("@nuxtjs/color-mode")) {
|
|
116
|
+
addComponentsDir({
|
|
117
|
+
path: resolve("./runtime/components/color-mode"),
|
|
118
|
+
pathPrefix: false,
|
|
119
|
+
prefix: nuxt.options.ui?.prefix || "U"
|
|
120
|
+
});
|
|
121
|
+
} else {
|
|
122
|
+
addImportsDir(resolve("./runtime/composables/color-mode"));
|
|
123
|
+
}
|
|
124
|
+
addComponentsDir({
|
|
125
|
+
path: resolve("./runtime/components"),
|
|
126
|
+
prefix: nuxt.options.ui?.prefix || "U",
|
|
127
|
+
pathPrefix: false,
|
|
128
|
+
ignore: ["color-mode/**", "content/**", "prose/**"]
|
|
129
|
+
});
|
|
130
|
+
addImportsDir(resolve("./runtime/composables"));
|
|
131
|
+
addTemplates(options, nuxt, resolve);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
export { module as default };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/accordion";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { AccordionRoot, AccordionItem, AccordionHeader, AccordionTrigger, AccordionContent, useForwardPropsEmits } from "reka-ui";
|
|
8
|
+
import { reactivePick } from "@vueuse/core";
|
|
9
|
+
import { useAppConfig } from "#imports";
|
|
10
|
+
import { get } from "../utils";
|
|
11
|
+
import { tv } from "../utils/tv";
|
|
12
|
+
import UIcon from "./Icon.vue";
|
|
13
|
+
const props = defineProps({
|
|
14
|
+
as: { type: null, required: false },
|
|
15
|
+
items: { type: Array, required: false },
|
|
16
|
+
trailingIcon: { type: String, required: false },
|
|
17
|
+
labelKey: { type: String, required: false, default: "label" },
|
|
18
|
+
class: { type: null, required: false },
|
|
19
|
+
ui: { type: null, required: false },
|
|
20
|
+
collapsible: { type: Boolean, required: false, default: true },
|
|
21
|
+
defaultValue: { type: null, required: false },
|
|
22
|
+
modelValue: { type: null, required: false },
|
|
23
|
+
type: { type: String, required: false, default: "single" },
|
|
24
|
+
disabled: { type: Boolean, required: false },
|
|
25
|
+
unmountOnHide: { type: Boolean, required: false, default: true }
|
|
26
|
+
});
|
|
27
|
+
const emits = defineEmits(["update:modelValue"]);
|
|
28
|
+
const slots = defineSlots();
|
|
29
|
+
const appConfig = useAppConfig();
|
|
30
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, "as", "collapsible", "defaultValue", "disabled", "modelValue", "type", "unmountOnHide"), emits);
|
|
31
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.accordion || {} })({
|
|
32
|
+
disabled: props.disabled
|
|
33
|
+
}));
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<template>
|
|
37
|
+
<AccordionRoot v-bind="rootProps" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
38
|
+
<AccordionItem
|
|
39
|
+
v-for="(item, index) in props.items"
|
|
40
|
+
v-slot="{ open }"
|
|
41
|
+
:key="index"
|
|
42
|
+
:value="item.value || String(index)"
|
|
43
|
+
:disabled="item.disabled"
|
|
44
|
+
:class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class] })"
|
|
45
|
+
>
|
|
46
|
+
<AccordionHeader as="div" :class="ui.header({ class: [props.ui?.header, item.ui?.header] })">
|
|
47
|
+
<AccordionTrigger :class="ui.trigger({ class: [props.ui?.trigger, item.ui?.trigger], disabled: item.disabled })">
|
|
48
|
+
<slot name="leading" :item="item" :index="index" :open="open">
|
|
49
|
+
<UIcon v-if="item.icon" :name="item.icon" :class="ui.leadingIcon({ class: [props.ui?.leadingIcon, item?.ui?.leadingIcon] })" />
|
|
50
|
+
</slot>
|
|
51
|
+
|
|
52
|
+
<span v-if="get(item, props.labelKey) || !!slots.default" :class="ui.label({ class: [props.ui?.label, item.ui?.label] })">
|
|
53
|
+
<slot :item="item" :index="index" :open="open">{{ get(item, props.labelKey) }}</slot>
|
|
54
|
+
</span>
|
|
55
|
+
|
|
56
|
+
<slot name="trailing" :item="item" :index="index" :open="open">
|
|
57
|
+
<UIcon :name="item.trailingIcon || trailingIcon || appConfig.ui.icons.chevronDown" :class="ui.trailingIcon({ class: [props.ui?.trailingIcon, item.ui?.trailingIcon] })" />
|
|
58
|
+
</slot>
|
|
59
|
+
</AccordionTrigger>
|
|
60
|
+
</AccordionHeader>
|
|
61
|
+
|
|
62
|
+
<AccordionContent v-if="item.content || !!slots.content || item.slot && !!slots[item.slot] || !!slots.body || item.slot && !!slots[`${item.slot}-body`]" :class="ui.content({ class: [props.ui?.content, item.ui?.content] })">
|
|
63
|
+
<slot :name="item.slot || 'content'" :item="item" :index="index" :open="open">
|
|
64
|
+
<div :class="ui.body({ class: [props.ui?.body, item.ui?.body] })">
|
|
65
|
+
<slot :name="item.slot ? `${item.slot}-body` : 'body'" :item="item" :index="index" :open="open">
|
|
66
|
+
{{ item.content }}
|
|
67
|
+
</slot>
|
|
68
|
+
</div>
|
|
69
|
+
</slot>
|
|
70
|
+
</AccordionContent>
|
|
71
|
+
</AccordionItem>
|
|
72
|
+
</AccordionRoot>
|
|
73
|
+
</template>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { AccordionRootProps, AccordionRootEmits } from 'reka-ui';
|
|
2
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
3
|
+
import theme from '#build/ui/accordion';
|
|
4
|
+
import type { DynamicSlots, ComponentConfig } from '../types/utils';
|
|
5
|
+
type Accordion = ComponentConfig<typeof theme, AppConfig, 'accordion'>;
|
|
6
|
+
export interface AccordionItem {
|
|
7
|
+
label?: string;
|
|
8
|
+
/**
|
|
9
|
+
* @IconifyIcon
|
|
10
|
+
*/
|
|
11
|
+
icon?: string;
|
|
12
|
+
/**
|
|
13
|
+
* @IconifyIcon
|
|
14
|
+
*/
|
|
15
|
+
trailingIcon?: string;
|
|
16
|
+
slot?: string;
|
|
17
|
+
content?: string;
|
|
18
|
+
/** A unique value for the accordion item. Defaults to the index. */
|
|
19
|
+
value?: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
class?: any;
|
|
22
|
+
ui?: Pick<Accordion['slots'], 'item' | 'header' | 'trigger' | 'leadingIcon' | 'label' | 'trailingIcon' | 'content' | 'body'>;
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
}
|
|
25
|
+
export interface AccordionProps<T extends AccordionItem = AccordionItem> extends Pick<AccordionRootProps, 'collapsible' | 'defaultValue' | 'modelValue' | 'type' | 'disabled' | 'unmountOnHide'> {
|
|
26
|
+
/**
|
|
27
|
+
* The element or component this component should render as.
|
|
28
|
+
* @defaultValue 'div'
|
|
29
|
+
*/
|
|
30
|
+
as?: any;
|
|
31
|
+
items?: T[];
|
|
32
|
+
/**
|
|
33
|
+
* The icon displayed on the right side of the trigger.
|
|
34
|
+
* @defaultValue appConfig.ui.icons.chevronDown
|
|
35
|
+
* @IconifyIcon
|
|
36
|
+
*/
|
|
37
|
+
trailingIcon?: string;
|
|
38
|
+
/**
|
|
39
|
+
* The key used to get the label from the item.
|
|
40
|
+
* @defaultValue 'label'
|
|
41
|
+
*/
|
|
42
|
+
labelKey?: string;
|
|
43
|
+
class?: any;
|
|
44
|
+
ui?: Accordion['slots'];
|
|
45
|
+
}
|
|
46
|
+
export interface AccordionEmits extends AccordionRootEmits {
|
|
47
|
+
}
|
|
48
|
+
type SlotProps<T extends AccordionItem> = (props: {
|
|
49
|
+
item: T;
|
|
50
|
+
index: number;
|
|
51
|
+
open: boolean;
|
|
52
|
+
}) => any;
|
|
53
|
+
export type AccordionSlots<T extends AccordionItem = AccordionItem> = {
|
|
54
|
+
leading: SlotProps<T>;
|
|
55
|
+
default: SlotProps<T>;
|
|
56
|
+
trailing: SlotProps<T>;
|
|
57
|
+
content: SlotProps<T>;
|
|
58
|
+
body: SlotProps<T>;
|
|
59
|
+
} & DynamicSlots<T, 'body', {
|
|
60
|
+
index: number;
|
|
61
|
+
open: boolean;
|
|
62
|
+
}>;
|
|
63
|
+
declare const _default: <T extends AccordionItem>(__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<{
|
|
64
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
65
|
+
readonly "onUpdate:modelValue"?: ((value: string | string[] | undefined) => any) | undefined;
|
|
66
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:modelValue"> & AccordionProps<T> & Partial<{}>> & import("vue").PublicProps;
|
|
67
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
68
|
+
attrs: any;
|
|
69
|
+
slots: AccordionSlots<T>;
|
|
70
|
+
emit: (evt: "update:modelValue", value: string | string[] | undefined) => void;
|
|
71
|
+
}>) => import("vue").VNode & {
|
|
72
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
73
|
+
};
|
|
74
|
+
export default _default;
|
|
75
|
+
type __VLS_PrettifyLocal<T> = {
|
|
76
|
+
[K in keyof T]: T[K];
|
|
77
|
+
} & {};
|