@eslamdevui/ui 3.2.0-beta.1 → 3.2.0-beta.2
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/alert.ts +5 -0
- package/.nuxt/ui/badge.ts +5 -0
- package/.nuxt/ui/button-group.ts +13 -0
- package/.nuxt/ui/button.ts +5 -0
- package/.nuxt/ui/carousel.ts +5 -0
- package/.nuxt/ui/content/content-navigation.ts +339 -0
- package/.nuxt/ui/content/content-search-button.ts +6 -0
- package/.nuxt/ui/content/content-search.ts +6 -0
- package/.nuxt/ui/content/content-surround.ts +39 -0
- package/.nuxt/ui/content/content-toc.ts +150 -0
- package/.nuxt/ui/content/index.ts +5 -0
- package/.nuxt/ui/content-surround.ts +5 -0
- package/.nuxt/ui/content-toc.ts +6 -6
- package/.nuxt/ui/dashboard-navbar.ts +5 -0
- package/.nuxt/ui/dashboard-sidebar-collapse.ts +5 -0
- package/.nuxt/ui/dashboard-sidebar-toggle.ts +5 -0
- package/.nuxt/ui/dashboard-sidebar.ts +10 -0
- package/.nuxt/ui/error.ts +9 -0
- package/.nuxt/ui/index.ts +48 -1
- package/.nuxt/ui/input-menu.ts +9 -0
- package/.nuxt/ui/input-number.ts +5 -0
- package/.nuxt/ui/input-tags.ts +9 -0
- package/.nuxt/ui/input.ts +9 -0
- package/.nuxt/ui/prose/a.ts +6 -0
- package/.nuxt/ui/prose/accordion-item.ts +3 -0
- package/.nuxt/ui/prose/accordion.ts +6 -0
- package/.nuxt/ui/prose/badge.ts +3 -0
- package/.nuxt/ui/prose/blockquote.ts +3 -0
- package/.nuxt/ui/prose/callout.ts +129 -0
- package/.nuxt/ui/prose/card-group.ts +3 -0
- package/.nuxt/ui/prose/card.ts +119 -0
- package/.nuxt/ui/prose/code-collapse.ts +19 -0
- package/.nuxt/ui/prose/code-group.ts +13 -0
- package/.nuxt/ui/prose/code-icon.ts +66 -0
- package/.nuxt/ui/prose/code-preview.ts +14 -0
- package/.nuxt/ui/prose/code-tree.ts +28 -0
- package/.nuxt/ui/prose/code.ts +27 -0
- package/.nuxt/ui/prose/collapsible.ts +12 -0
- package/.nuxt/ui/prose/em.ts +3 -0
- package/.nuxt/ui/prose/field-group.ts +3 -0
- package/.nuxt/ui/prose/field.ts +11 -0
- package/.nuxt/ui/prose/h1.ts +6 -0
- package/.nuxt/ui/prose/h2.ts +14 -0
- package/.nuxt/ui/prose/h3.ts +14 -0
- package/.nuxt/ui/prose/h4.ts +6 -0
- package/.nuxt/ui/prose/hr.ts +3 -0
- package/.nuxt/ui/prose/icon.ts +3 -0
- package/.nuxt/ui/prose/img.ts +3 -0
- package/.nuxt/ui/prose/index.ts +41 -0
- package/.nuxt/ui/prose/kbd.ts +3 -0
- package/.nuxt/ui/prose/li.ts +3 -0
- package/.nuxt/ui/prose/ol.ts +3 -0
- package/.nuxt/ui/prose/p.ts +3 -0
- package/.nuxt/ui/prose/pre.ts +17 -0
- package/.nuxt/ui/prose/steps.ts +19 -0
- package/.nuxt/ui/prose/strong.ts +3 -0
- package/.nuxt/ui/prose/table.ts +6 -0
- package/.nuxt/ui/prose/tabs-item.ts +3 -0
- package/.nuxt/ui/prose/tabs.ts +5 -0
- package/.nuxt/ui/prose/tbody.ts +3 -0
- package/.nuxt/ui/prose/td.ts +3 -0
- package/.nuxt/ui/prose/th.ts +3 -0
- package/.nuxt/ui/prose/thead.ts +3 -0
- package/.nuxt/ui/prose/tr.ts +3 -0
- package/.nuxt/ui/prose/ul.ts +3 -0
- package/.nuxt/ui/select-menu.ts +9 -0
- package/.nuxt/ui/select.ts +9 -0
- package/.nuxt/ui/textarea.ts +9 -0
- package/.nuxt/ui/toast.ts +5 -0
- package/LICENSE.md +9 -9
- package/README.md +147 -147
- package/cli/commands/make/component.mjs +95 -95
- package/cli/commands/make/index.mjs +14 -14
- package/cli/commands/make/locale.mjs +64 -64
- package/cli/index.mjs +15 -15
- package/cli/package.json +13 -13
- package/cli/templates.mjs +236 -228
- package/cli/utils.mjs +31 -31
- package/dist/module.json +1 -1
- package/dist/module.mjs +18 -13
- package/dist/runtime/components/Accordion.vue +36 -36
- package/dist/runtime/components/Alert.vue +46 -46
- package/dist/runtime/components/App.vue +10 -10
- package/dist/runtime/components/Avatar.vue +27 -27
- package/dist/runtime/components/AvatarGroup.vue +4 -4
- package/dist/runtime/components/Badge.vue +16 -16
- package/dist/runtime/components/Breadcrumb.vue +32 -32
- package/dist/runtime/components/Button.vue +28 -28
- package/dist/runtime/components/ButtonGroup.vue +3 -3
- package/dist/runtime/components/Calendar.vue +74 -74
- package/dist/runtime/components/Card.vue +13 -13
- package/dist/runtime/components/Carousel.vue +58 -58
- package/dist/runtime/components/ChatMessage.vue +35 -35
- package/dist/runtime/components/ChatMessages.vue +71 -71
- package/dist/runtime/components/ChatMessages.vue.d.ts +1 -2
- package/dist/runtime/components/ChatPrompt.vue +30 -31
- package/dist/runtime/components/ChatPrompt.vue.d.ts +4 -4
- package/dist/runtime/components/ChatPromptSubmit.vue +10 -10
- package/dist/runtime/components/Checkbox.vue +33 -33
- package/dist/runtime/components/CheckboxGroup.vue +32 -32
- package/dist/runtime/components/Chip.vue +11 -11
- package/dist/runtime/components/Collapsible.vue +9 -9
- package/dist/runtime/components/ColorPicker.vue +30 -30
- package/dist/runtime/components/CommandPalette.vue +117 -117
- package/dist/runtime/components/Container.vue +3 -3
- package/dist/runtime/components/ContextMenu.vue +22 -22
- package/dist/runtime/components/ContextMenuContent.vue +105 -105
- package/dist/runtime/components/DashboardGroup.vue +3 -3
- package/dist/runtime/components/DashboardNavbar.vue +41 -41
- package/dist/runtime/components/DashboardNavbar.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardPanel.vue +29 -29
- package/dist/runtime/components/DashboardPanel.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardResizeHandle.vue +7 -7
- package/dist/runtime/components/DashboardSearch.vue +24 -25
- package/dist/runtime/components/DashboardSearch.vue.d.ts +3 -3
- package/dist/runtime/components/DashboardSearchButton.vue +63 -41
- package/dist/runtime/components/DashboardSearchButton.vue.d.ts +7 -1
- package/dist/runtime/components/DashboardSidebar.vue +77 -77
- package/dist/runtime/components/DashboardSidebarCollapse.vue +7 -7
- package/dist/runtime/components/DashboardSidebarCollapse.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardSidebarToggle.vue +14 -17
- package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +4 -6
- package/dist/runtime/components/Drawer.vue +55 -55
- package/dist/runtime/components/DropdownMenu.vue +24 -24
- package/dist/runtime/components/DropdownMenuContent.vue +107 -107
- package/dist/runtime/components/Error.vue +57 -0
- package/dist/runtime/components/Error.vue.d.ts +52 -0
- package/dist/runtime/components/Form.vue +8 -8
- package/dist/runtime/components/Form.vue.d.ts +1 -1
- package/dist/runtime/components/FormField.vue +37 -37
- package/dist/runtime/components/Icon.vue +1 -1
- package/dist/runtime/components/Input.vue +34 -34
- package/dist/runtime/components/InputMenu.vue +163 -163
- package/dist/runtime/components/InputNumber.vue +49 -49
- package/dist/runtime/components/InputTags.vue +55 -55
- package/dist/runtime/components/Kbd.vue +5 -5
- package/dist/runtime/components/Link.vue +14 -14
- package/dist/runtime/components/LinkBase.vue +8 -8
- package/dist/runtime/components/Modal.vue +69 -69
- package/dist/runtime/components/NavigationMenu.vue +166 -166
- package/dist/runtime/components/OverlayProvider.vue +9 -9
- package/dist/runtime/components/Pagination.vue +47 -47
- package/dist/runtime/components/PinInput.vue +20 -20
- package/dist/runtime/components/Popover.vue +17 -17
- package/dist/runtime/components/Progress.vue +19 -19
- package/dist/runtime/components/RadioGroup.vue +43 -43
- package/dist/runtime/components/Select.vue +96 -96
- package/dist/runtime/components/SelectMenu.vue +130 -130
- package/dist/runtime/components/Separator.vue +15 -15
- package/dist/runtime/components/Skeleton.vue +10 -10
- package/dist/runtime/components/Slideover.vue +76 -76
- package/dist/runtime/components/Slider.vue +27 -27
- package/dist/runtime/components/Stepper.vue +51 -51
- package/dist/runtime/components/Switch.vue +33 -33
- package/dist/runtime/components/Table.vue +77 -77
- package/dist/runtime/components/Tabs.vue +37 -37
- package/dist/runtime/components/Textarea.vue +33 -33
- package/dist/runtime/components/Timeline.vue +38 -38
- package/dist/runtime/components/Toast.vue +69 -69
- package/dist/runtime/components/Toaster.vue +28 -28
- package/dist/runtime/components/Tooltip.vue +19 -19
- package/dist/runtime/components/Tree.vue +60 -60
- package/dist/runtime/components/color-mode/ColorModeAvatar.vue +2 -2
- package/dist/runtime/components/color-mode/ColorModeAvatar.vue.d.ts +2 -2
- package/dist/runtime/components/color-mode/ColorModeButton.vue +16 -16
- package/dist/runtime/components/color-mode/ColorModeButton.vue.d.ts +3 -3
- package/dist/runtime/components/color-mode/ColorModeImage.vue +2 -2
- package/dist/runtime/components/color-mode/ColorModeSelect.vue +19 -19
- package/dist/runtime/components/color-mode/ColorModeSelect.vue.d.ts +1 -1
- package/dist/runtime/components/color-mode/ColorModeSwitch.vue +19 -19
- package/dist/runtime/components/color-mode/ColorModeSwitch.vue.d.ts +1 -1
- package/dist/runtime/components/content/ContentNavigation.vue +175 -0
- package/dist/runtime/components/content/ContentNavigation.vue.d.ts +53 -0
- package/dist/runtime/components/content/ContentSearch.vue +184 -0
- package/dist/runtime/components/content/ContentSearch.vue.d.ts +111 -0
- package/dist/runtime/components/content/ContentSearchButton.vue +95 -0
- package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +12 -0
- package/dist/runtime/components/content/ContentSurround.vue +61 -0
- package/dist/runtime/components/content/ContentSurround.vue.d.ts +59 -0
- package/dist/runtime/components/content/ContentToc.vue +146 -0
- package/dist/runtime/components/content/ContentToc.vue.d.ts +88 -0
- package/dist/runtime/components/locale/LocaleSelect.vue +20 -20
- package/dist/runtime/components/locale/LocaleSelect.vue.d.ts +1 -1
- package/dist/runtime/components/prose/A.vue +24 -0
- package/dist/runtime/components/prose/A.vue.d.ts +15 -0
- package/dist/runtime/components/prose/Accordion.vue +43 -0
- package/dist/runtime/components/prose/Accordion.vue.d.ts +16 -0
- package/dist/runtime/components/prose/AccordionItem.vue +25 -0
- package/dist/runtime/components/prose/AccordionItem.vue.d.ts +15 -0
- package/dist/runtime/components/prose/Badge.vue +21 -0
- package/dist/runtime/components/prose/Badge.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Blockquote.vue +21 -0
- package/dist/runtime/components/prose/Blockquote.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Callout.vue +60 -0
- package/dist/runtime/components/prose/Callout.vue.d.ts +26 -0
- package/dist/runtime/components/prose/Card.vue +83 -0
- package/dist/runtime/components/prose/Card.vue.d.ts +30 -0
- package/dist/runtime/components/prose/CardGroup.vue +21 -0
- package/dist/runtime/components/prose/CardGroup.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Code.vue +23 -0
- package/dist/runtime/components/prose/Code.vue.d.ts +22 -0
- package/dist/runtime/components/prose/CodeCollapse.vue +44 -0
- package/dist/runtime/components/prose/CodeCollapse.vue.d.ts +46 -0
- package/dist/runtime/components/prose/CodeGroup.vue +70 -0
- package/dist/runtime/components/prose/CodeGroup.vue.d.ts +37 -0
- package/dist/runtime/components/prose/CodeIcon.vue +28 -0
- package/dist/runtime/components/prose/CodeIcon.vue.d.ts +24 -0
- package/dist/runtime/components/prose/CodePreview.vue +28 -0
- package/dist/runtime/components/prose/CodePreview.vue.d.ts +19 -0
- package/dist/runtime/components/prose/CodeTree.vue +160 -0
- package/dist/runtime/components/prose/CodeTree.vue.d.ts +30 -0
- package/dist/runtime/components/prose/Collapsible.vue +41 -0
- package/dist/runtime/components/prose/Collapsible.vue.d.ts +38 -0
- package/dist/runtime/components/prose/Em.vue +19 -0
- package/dist/runtime/components/prose/Em.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Field.vue +48 -0
- package/dist/runtime/components/prose/Field.vue.d.ts +39 -0
- package/dist/runtime/components/prose/FieldGroup.vue +23 -0
- package/dist/runtime/components/prose/FieldGroup.vue.d.ts +18 -0
- package/dist/runtime/components/prose/H1.vue +28 -0
- package/dist/runtime/components/prose/H1.vue.d.ts +19 -0
- package/dist/runtime/components/prose/H2.vue +32 -0
- package/dist/runtime/components/prose/H2.vue.d.ts +19 -0
- package/dist/runtime/components/prose/H3.vue +32 -0
- package/dist/runtime/components/prose/H3.vue.d.ts +19 -0
- package/dist/runtime/components/prose/H4.vue +28 -0
- package/dist/runtime/components/prose/H4.vue.d.ts +19 -0
- package/dist/runtime/components/prose/Hr.vue +18 -0
- package/dist/runtime/components/prose/Hr.vue.d.ts +5 -0
- package/dist/runtime/components/prose/Icon.vue +19 -0
- package/dist/runtime/components/prose/Icon.vue.d.ts +6 -0
- package/dist/runtime/components/prose/Img.vue +40 -0
- package/dist/runtime/components/prose/Img.vue.d.ts +9 -0
- package/dist/runtime/components/prose/Kbd.vue +19 -0
- package/dist/runtime/components/prose/Kbd.vue.d.ts +6 -0
- package/dist/runtime/components/prose/Li.vue +21 -0
- package/dist/runtime/components/prose/Li.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Ol.vue +21 -0
- package/dist/runtime/components/prose/Ol.vue.d.ts +13 -0
- package/dist/runtime/components/prose/P.vue +21 -0
- package/dist/runtime/components/prose/P.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Pre.vue +63 -0
- package/dist/runtime/components/prose/Pre.vue.d.ts +25 -0
- package/dist/runtime/components/prose/Script.vue +12 -0
- package/dist/runtime/components/prose/Script.vue.d.ts +12 -0
- package/dist/runtime/components/prose/Steps.vue +22 -0
- package/dist/runtime/components/prose/Steps.vue.d.ts +22 -0
- package/dist/runtime/components/prose/Strong.vue +21 -0
- package/dist/runtime/components/prose/Strong.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Table.vue +24 -0
- package/dist/runtime/components/prose/Table.vue.d.ts +18 -0
- package/dist/runtime/components/prose/Tabs.vue +78 -0
- package/dist/runtime/components/prose/Tabs.vue.d.ts +36 -0
- package/dist/runtime/components/prose/TabsItem.vue +25 -0
- package/dist/runtime/components/prose/TabsItem.vue.d.ts +15 -0
- package/dist/runtime/components/prose/Tbody.vue +21 -0
- package/dist/runtime/components/prose/Tbody.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Td.vue +21 -0
- package/dist/runtime/components/prose/Td.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Th.vue +21 -0
- package/dist/runtime/components/prose/Th.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Thead.vue +21 -0
- package/dist/runtime/components/prose/Thead.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Tr.vue +21 -0
- package/dist/runtime/components/prose/Tr.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Ul.vue +21 -0
- package/dist/runtime/components/prose/Ul.vue.d.ts +13 -0
- package/dist/runtime/components/prose/callout/Caution.vue +11 -0
- package/dist/runtime/components/prose/callout/Caution.vue.d.ts +14 -0
- package/dist/runtime/components/prose/callout/Note.vue +11 -0
- package/dist/runtime/components/prose/callout/Note.vue.d.ts +14 -0
- package/dist/runtime/components/prose/callout/Tip.vue +11 -0
- package/dist/runtime/components/prose/callout/Tip.vue.d.ts +14 -0
- package/dist/runtime/components/prose/callout/Warning.vue +11 -0
- package/dist/runtime/components/prose/callout/Warning.vue.d.ts +14 -0
- package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
- package/dist/runtime/composables/useComponentIcons.d.ts +1 -1
- package/dist/runtime/composables/useFormField.d.ts +2 -2
- package/dist/runtime/composables/usePortal.d.ts +1 -1
- package/dist/runtime/composables/useResizable.d.ts +1 -1
- package/dist/runtime/inertia/components/Link.vue +12 -12
- package/dist/runtime/inertia/components/LinkBase.vue +15 -15
- package/dist/runtime/types/app.config.d.ts +6 -6
- package/dist/runtime/types/content.d.ts +4 -1
- package/dist/runtime/types/content.js +4 -0
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/types/prose.d.ts +42 -1
- package/dist/runtime/types/prose.js +42 -0
- package/dist/runtime/types/tv.d.ts +2 -2
- package/dist/runtime/utils/index.d.ts +1 -1
- package/dist/runtime/utils/index.js +13 -4
- package/dist/runtime/vue/components/Icon.vue +1 -1
- package/dist/runtime/vue/components/Link.vue +31 -31
- package/dist/runtime/vue/components/color-mode/ColorModeButton.vue +7 -7
- package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue +7 -7
- package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue +7 -7
- package/dist/shared/{ui.BcVNrqyb.mjs → ui.DQZ75GCP.mjs} +183 -180
- package/dist/unplugin.mjs +9 -9
- package/dist/vite.mjs +1 -1
- package/package.json +8 -9
- package/vue-plugin.d.ts +5 -5
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export interface ProseHrProps {
|
|
2
|
+
class?: any;
|
|
3
|
+
}
|
|
4
|
+
declare const _default: import("vue").DefineComponent<ProseHrProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ProseHrProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/prose/icon";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { useAppConfig } from "#imports";
|
|
8
|
+
import { tv } from "../../utils/tv";
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
name: { type: String, required: true },
|
|
11
|
+
class: { type: null, required: false }
|
|
12
|
+
});
|
|
13
|
+
const appConfig = useAppConfig();
|
|
14
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.prose?.icon || {} }));
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<UIcon :name="name" :class="ui({ class: props.class })" />
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface ProseIconProps {
|
|
2
|
+
name: string;
|
|
3
|
+
class?: any;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: import("vue").DefineComponent<ProseIconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ProseIconProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/prose/img";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { withTrailingSlash, withLeadingSlash, joinURL } from "ufo";
|
|
8
|
+
import { useRuntimeConfig, useAppConfig } from "#imports";
|
|
9
|
+
import ImageComponent from "#build/ui-image-component";
|
|
10
|
+
import { tv } from "../../utils/tv";
|
|
11
|
+
const props = defineProps({
|
|
12
|
+
src: { type: String, required: true },
|
|
13
|
+
alt: { type: String, required: true },
|
|
14
|
+
width: { type: [String, Number], required: false },
|
|
15
|
+
height: { type: [String, Number], required: false },
|
|
16
|
+
class: { type: null, required: false }
|
|
17
|
+
});
|
|
18
|
+
const appConfig = useAppConfig();
|
|
19
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.prose?.img || {} }));
|
|
20
|
+
const refinedSrc = computed(() => {
|
|
21
|
+
if (props.src?.startsWith("/") && !props.src.startsWith("//")) {
|
|
22
|
+
const _base = withLeadingSlash(withTrailingSlash(useRuntimeConfig().app.baseURL));
|
|
23
|
+
if (_base !== "/" && !props.src.startsWith(_base)) {
|
|
24
|
+
return joinURL(_base, props.src);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return props.src;
|
|
28
|
+
});
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<component
|
|
33
|
+
:is="ImageComponent"
|
|
34
|
+
:src="refinedSrc"
|
|
35
|
+
:alt="alt"
|
|
36
|
+
:width="width"
|
|
37
|
+
:height="height"
|
|
38
|
+
:class="ui({ class: props.class })"
|
|
39
|
+
/>
|
|
40
|
+
</template>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface ProseImgProps {
|
|
2
|
+
src: string;
|
|
3
|
+
alt: string;
|
|
4
|
+
width?: string | number;
|
|
5
|
+
height?: string | number;
|
|
6
|
+
class?: any;
|
|
7
|
+
}
|
|
8
|
+
declare const _default: import("vue").DefineComponent<ProseImgProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ProseImgProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/prose/kbd";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { useAppConfig } from "#imports";
|
|
8
|
+
import { tv } from "../../utils/tv";
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
value: { type: String, required: true },
|
|
11
|
+
class: { type: null, required: false }
|
|
12
|
+
});
|
|
13
|
+
const appConfig = useAppConfig();
|
|
14
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.prose?.kbd || {} }));
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<UKbd :value="value" :class="ui({ class: props.class })" />
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface ProseKbdProps {
|
|
2
|
+
value: string;
|
|
3
|
+
class?: any;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: import("vue").DefineComponent<ProseKbdProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ProseKbdProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/prose/li";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { useAppConfig } from "#imports";
|
|
8
|
+
import { tv } from "../../utils/tv";
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
class: { type: null, required: false }
|
|
11
|
+
});
|
|
12
|
+
defineSlots();
|
|
13
|
+
const appConfig = useAppConfig();
|
|
14
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.prose?.li || {} }));
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<li :class="ui({ class: props.class })">
|
|
19
|
+
<slot />
|
|
20
|
+
</li>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ProseLiProps {
|
|
2
|
+
class?: any;
|
|
3
|
+
}
|
|
4
|
+
export interface ProseLiSlots {
|
|
5
|
+
default(props?: {}): any;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ProseLiProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ProseLiProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ProseLiSlots>;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/prose/ol";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { useAppConfig } from "#imports";
|
|
8
|
+
import { tv } from "../../utils/tv";
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
class: { type: null, required: false }
|
|
11
|
+
});
|
|
12
|
+
defineSlots();
|
|
13
|
+
const appConfig = useAppConfig();
|
|
14
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.prose?.ol || {} }));
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<ol :class="ui({ class: props.class })">
|
|
19
|
+
<slot />
|
|
20
|
+
</ol>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ProseOlProps {
|
|
2
|
+
class?: any;
|
|
3
|
+
}
|
|
4
|
+
export interface ProseOlSlots {
|
|
5
|
+
default(props?: {}): any;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ProseOlProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ProseOlProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ProseOlSlots>;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/prose/p";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { useAppConfig } from "#imports";
|
|
8
|
+
import { tv } from "../../utils/tv";
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
class: { type: null, required: false }
|
|
11
|
+
});
|
|
12
|
+
defineSlots();
|
|
13
|
+
const appConfig = useAppConfig();
|
|
14
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.prose?.p || {} }));
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<p :class="ui({ class: props.class })">
|
|
19
|
+
<slot />
|
|
20
|
+
</p>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ProsePProps {
|
|
2
|
+
class?: any;
|
|
3
|
+
}
|
|
4
|
+
export interface ProsePSlots {
|
|
5
|
+
default(props?: {}): any;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ProsePProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ProsePProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ProsePSlots>;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/prose/pre";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { ref, computed } from "vue";
|
|
7
|
+
import { useClipboard } from "@vueuse/core";
|
|
8
|
+
import { useAppConfig } from "#imports";
|
|
9
|
+
import { useLocalePro } from "../../composables/useLocalePro";
|
|
10
|
+
import CodeIcon from "./CodeIcon.vue";
|
|
11
|
+
import { tv } from "../../utils/tv";
|
|
12
|
+
const props = defineProps({
|
|
13
|
+
icon: { type: String, required: false },
|
|
14
|
+
code: { type: String, required: false },
|
|
15
|
+
language: { type: String, required: false },
|
|
16
|
+
filename: { type: String, required: false },
|
|
17
|
+
highlights: { type: Array, required: false },
|
|
18
|
+
hideHeader: { type: Boolean, required: false },
|
|
19
|
+
meta: { type: String, required: false },
|
|
20
|
+
class: { type: null, required: false },
|
|
21
|
+
ui: { type: null, required: false }
|
|
22
|
+
});
|
|
23
|
+
defineSlots();
|
|
24
|
+
const { t } = useLocalePro();
|
|
25
|
+
const clipboard = useClipboard();
|
|
26
|
+
const appConfig = useAppConfig();
|
|
27
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.prose?.pre || {} })());
|
|
28
|
+
const copied = ref(false);
|
|
29
|
+
function copy() {
|
|
30
|
+
clipboard.copy(props.code || "");
|
|
31
|
+
copied.value = true;
|
|
32
|
+
setTimeout(() => {
|
|
33
|
+
copied.value = false;
|
|
34
|
+
}, 2e3);
|
|
35
|
+
}
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
<div :class="ui.root({ class: [props.ui?.root], filename: !!filename })">
|
|
40
|
+
<div v-if="filename && !hideHeader" :class="ui.header({ class: props.ui?.header })">
|
|
41
|
+
<CodeIcon :icon="icon" :filename="filename" :class="ui.icon({ class: props.ui?.icon })" />
|
|
42
|
+
|
|
43
|
+
<span :class="ui.filename({ class: props.ui?.filename })">{{ filename }}</span>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<UButton
|
|
47
|
+
:icon="copied ? appConfig.ui.icons.copyCheck : appConfig.ui.icons.copy"
|
|
48
|
+
color="neutral"
|
|
49
|
+
variant="outline"
|
|
50
|
+
size="sm"
|
|
51
|
+
:aria-label="t('prose.pre.copy')"
|
|
52
|
+
:class="ui.copy({ class: props.ui?.copy })"
|
|
53
|
+
tabindex="-1"
|
|
54
|
+
@click="copy"
|
|
55
|
+
/>
|
|
56
|
+
|
|
57
|
+
<pre :class="ui.base({ class: [props.ui?.base, props.class] })" v-bind="$attrs"><slot /></pre>
|
|
58
|
+
</div>
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<style>
|
|
62
|
+
.shiki span.line{display:block}.shiki span.line.highlight{margin:0 -16px;padding:0 16px;@apply bg-(--ui-bg-accented)/50}
|
|
63
|
+
</style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
2
|
+
import type { ComponentConfig } from '../../types';
|
|
3
|
+
import theme from '#build/ui/prose/pre';
|
|
4
|
+
type ProsePre = ComponentConfig<typeof theme, AppConfig, 'pre', 'ui.prose'>;
|
|
5
|
+
export interface ProsePreProps {
|
|
6
|
+
icon?: string;
|
|
7
|
+
code?: string;
|
|
8
|
+
language?: string;
|
|
9
|
+
filename?: string;
|
|
10
|
+
highlights?: number[];
|
|
11
|
+
hideHeader?: boolean;
|
|
12
|
+
meta?: string;
|
|
13
|
+
class?: any;
|
|
14
|
+
ui?: ProsePre['slots'];
|
|
15
|
+
}
|
|
16
|
+
export interface ProsePreSlots {
|
|
17
|
+
default(props?: {}): any;
|
|
18
|
+
}
|
|
19
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ProsePreProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ProsePreProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ProsePreSlots>;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
defineProps({
|
|
3
|
+
src: { type: String, required: true }
|
|
4
|
+
});
|
|
5
|
+
const isDev = import.meta.dev;
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<div v-if="isDev">
|
|
10
|
+
Rendering the <code>script</code> element is dangerous and is disabled by default. Consider implementing your own <code>ProseScript</code> element to have control over script rendering.
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
src: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
+
src: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/prose/steps";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { useAppConfig } from "#imports";
|
|
8
|
+
import { tv } from "../../utils/tv";
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
level: { type: null, required: false },
|
|
11
|
+
class: { type: null, required: false }
|
|
12
|
+
});
|
|
13
|
+
defineSlots();
|
|
14
|
+
const appConfig = useAppConfig();
|
|
15
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.prose?.steps || {} }));
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<div :class="ui({ class: props.class, level: props.level })">
|
|
20
|
+
<slot />
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
2
|
+
import type { ComponentConfig } from '../../types';
|
|
3
|
+
import theme from '#build/ui/prose/steps';
|
|
4
|
+
type ProseSteps = ComponentConfig<typeof theme, AppConfig, 'steps', 'ui.prose'>;
|
|
5
|
+
export interface ProseStepsProps {
|
|
6
|
+
/**
|
|
7
|
+
* The heading level to apply to the steps.
|
|
8
|
+
* @defaultValue '3'
|
|
9
|
+
*/
|
|
10
|
+
level?: ProseSteps['variants']['level'];
|
|
11
|
+
class?: any;
|
|
12
|
+
}
|
|
13
|
+
export interface ProseStepsSlots {
|
|
14
|
+
default(props?: {}): any;
|
|
15
|
+
}
|
|
16
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ProseStepsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ProseStepsProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ProseStepsSlots>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/prose/strong";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { useAppConfig } from "#imports";
|
|
8
|
+
import { tv } from "../../utils/tv";
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
class: { type: null, required: false }
|
|
11
|
+
});
|
|
12
|
+
defineSlots();
|
|
13
|
+
const appConfig = useAppConfig();
|
|
14
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.prose?.strong || {} }));
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<strong :class="ui({ class: props.class })">
|
|
19
|
+
<slot />
|
|
20
|
+
</strong>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ProseStrongProps {
|
|
2
|
+
class?: any;
|
|
3
|
+
}
|
|
4
|
+
export interface ProseStrongSlots {
|
|
5
|
+
default(props?: {}): any;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ProseStrongProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ProseStrongProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ProseStrongSlots>;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/prose/table";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { useAppConfig } from "#imports";
|
|
8
|
+
import { tv } from "../../utils/tv";
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
class: { type: null, required: false },
|
|
11
|
+
ui: { type: null, required: false }
|
|
12
|
+
});
|
|
13
|
+
defineSlots();
|
|
14
|
+
const appConfig = useAppConfig();
|
|
15
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.prose?.table || {} })());
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<div :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
20
|
+
<table :class="ui.base({ class: props.ui?.base })">
|
|
21
|
+
<slot />
|
|
22
|
+
</table>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import theme from '#build/ui/prose/table';
|
|
2
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
3
|
+
import type { ComponentConfig } from '../../types';
|
|
4
|
+
type ProseTable = ComponentConfig<typeof theme, AppConfig, 'table', 'ui.prose'>;
|
|
5
|
+
export interface ProseTableProps {
|
|
6
|
+
class?: any;
|
|
7
|
+
ui?: ProseTable['slots'];
|
|
8
|
+
}
|
|
9
|
+
export interface ProseTableSlots {
|
|
10
|
+
default(props?: {}): any;
|
|
11
|
+
}
|
|
12
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ProseTableProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ProseTableProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ProseTableSlots>;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/prose/tabs";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed, watch, onMounted, ref, onBeforeUpdate } from "vue";
|
|
7
|
+
import { useState, useAppConfig } from "#imports";
|
|
8
|
+
import { transformUI } from "../../utils";
|
|
9
|
+
import { tv } from "../../utils/tv";
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
defaultValue: { type: String, required: false, default: "0" },
|
|
12
|
+
sync: { type: String, required: false },
|
|
13
|
+
hash: { type: String, required: false },
|
|
14
|
+
class: { type: null, required: false }
|
|
15
|
+
});
|
|
16
|
+
const slots = defineSlots();
|
|
17
|
+
const model = defineModel({ type: String });
|
|
18
|
+
const appConfig = useAppConfig();
|
|
19
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.prose?.tabs || {} }));
|
|
20
|
+
const rerenderCount = ref(1);
|
|
21
|
+
const items = computed(() => {
|
|
22
|
+
const _ = rerenderCount.value;
|
|
23
|
+
return slots.default?.()?.flatMap(transformSlot).filter(Boolean) || [];
|
|
24
|
+
});
|
|
25
|
+
function transformSlot(slot, index) {
|
|
26
|
+
if (typeof slot.type === "symbol") {
|
|
27
|
+
return slot.children?.map(transformSlot);
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
index,
|
|
31
|
+
label: slot.props?.label || `${index}`,
|
|
32
|
+
description: slot.props?.description,
|
|
33
|
+
icon: slot.props?.icon,
|
|
34
|
+
component: slot
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
onMounted(() => {
|
|
38
|
+
if (props.sync) {
|
|
39
|
+
const syncKey = `tabs-${props.sync}`;
|
|
40
|
+
const syncValue = useState(syncKey, () => localStorage.getItem(syncKey));
|
|
41
|
+
watch(syncValue, () => {
|
|
42
|
+
if (!syncValue.value) return;
|
|
43
|
+
model.value = syncValue.value;
|
|
44
|
+
}, { immediate: true });
|
|
45
|
+
watch(model, () => {
|
|
46
|
+
if (!model.value) return;
|
|
47
|
+
syncValue.value = model.value;
|
|
48
|
+
localStorage.setItem(syncKey, model.value);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
async function onUpdateModelValue() {
|
|
53
|
+
if (props.hash) {
|
|
54
|
+
const hash = props.hash.startsWith("#") ? props.hash : `#${props.hash}`;
|
|
55
|
+
setTimeout(() => {
|
|
56
|
+
document.querySelector(hash)?.scrollIntoView();
|
|
57
|
+
}, 200);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
onBeforeUpdate(() => rerenderCount.value++);
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<template>
|
|
64
|
+
<UTabs
|
|
65
|
+
v-model="model"
|
|
66
|
+
color="primary"
|
|
67
|
+
variant="link"
|
|
68
|
+
:items="items"
|
|
69
|
+
:class="props.class"
|
|
70
|
+
:unmount-on-hide="false"
|
|
71
|
+
:ui="transformUI(ui())"
|
|
72
|
+
@update:model-value="onUpdateModelValue"
|
|
73
|
+
>
|
|
74
|
+
<template #content="{ item }">
|
|
75
|
+
<component :is="item.component" />
|
|
76
|
+
</template>
|
|
77
|
+
</UTabs>
|
|
78
|
+
</template>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface ProseTabsProps {
|
|
2
|
+
/**
|
|
3
|
+
* The default tab to select.
|
|
4
|
+
* @example '1'
|
|
5
|
+
*/
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Sync the selected tab with a local storage key.
|
|
9
|
+
*/
|
|
10
|
+
sync?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The hash to scroll to when the tab is selected.
|
|
13
|
+
*/
|
|
14
|
+
hash?: string;
|
|
15
|
+
class?: any;
|
|
16
|
+
}
|
|
17
|
+
export interface ProseTabsSlots {
|
|
18
|
+
default(props?: {}): any;
|
|
19
|
+
}
|
|
20
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ProseTabsProps & {
|
|
21
|
+
modelValue?: string | undefined;
|
|
22
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
24
|
+
}, string, import("vue").PublicProps, Readonly<ProseTabsProps & {
|
|
25
|
+
modelValue?: string | undefined;
|
|
26
|
+
}> & Readonly<{
|
|
27
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
28
|
+
}>, {
|
|
29
|
+
defaultValue: string;
|
|
30
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ProseTabsSlots>;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
33
|
+
new (): {
|
|
34
|
+
$slots: S;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/prose/tabs-item";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { useAppConfig } from "#imports";
|
|
8
|
+
import { tv } from "../../utils/tv";
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
label: { type: String, required: true },
|
|
11
|
+
description: { type: String, required: false },
|
|
12
|
+
class: { type: null, required: false }
|
|
13
|
+
});
|
|
14
|
+
defineSlots();
|
|
15
|
+
const appConfig = useAppConfig();
|
|
16
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.prose?.tabsItem || {} }));
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<div :class="ui({ class: props.class })">
|
|
21
|
+
<slot>
|
|
22
|
+
{{ description }}
|
|
23
|
+
</slot>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface ProseTabsItemProps {
|
|
2
|
+
label: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
class?: any;
|
|
5
|
+
}
|
|
6
|
+
export interface ProseTabsItemSlots {
|
|
7
|
+
default(props?: {}): any;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ProseTabsItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ProseTabsItemProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ProseTabsItemSlots>;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
12
|
+
new (): {
|
|
13
|
+
$slots: S;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/prose/tbody";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { useAppConfig } from "#imports";
|
|
8
|
+
import { tv } from "../../utils/tv";
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
class: { type: null, required: false }
|
|
11
|
+
});
|
|
12
|
+
defineSlots();
|
|
13
|
+
const appConfig = useAppConfig();
|
|
14
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.prose?.tbody || {} }));
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<tbody :class="ui({ class: props.class })">
|
|
19
|
+
<slot />
|
|
20
|
+
</tbody>
|
|
21
|
+
</template>
|