@eslamdevui/ui 3.2.1 → 3.3.0
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/dashboard-toolbar.ts +7 -0
- package/.nuxt/ui/index.ts +2 -47
- package/dist/module.json +1 -1
- package/dist/module.mjs +37 -29
- package/dist/runtime/components/DashboardSidebarToggle.vue +7 -16
- package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +10 -5
- package/dist/runtime/components/DashboardToolbar.vue +32 -0
- package/dist/runtime/components/DashboardToolbar.vue.d.ts +25 -0
- package/dist/runtime/components/PageMarquee.vue +3 -3
- package/dist/runtime/components/PageMarquee.vue.d.ts +2 -0
- package/dist/runtime/components/PricingTable.vue +37 -35
- package/dist/runtime/components/content/ContentSearch.vue +74 -76
- package/dist/runtime/components/content/ContentSearch.vue.d.ts +5 -1
- package/dist/runtime/components/content/ContentSurround.vue +5 -9
- package/dist/runtime/composables/useAvatarGroup.js +1 -1
- package/dist/runtime/composables/useBreakpoint.d.ts +11 -0
- package/dist/runtime/composables/useBreakpoint.js +53 -0
- package/dist/runtime/composables/useButtonGroup.js +1 -1
- package/dist/runtime/composables/useFormField.js +6 -6
- package/dist/runtime/composables/useLocale.js +1 -1
- package/dist/runtime/composables/usePortal.js +1 -1
- package/dist/runtime/plugins/colors.js +3 -3
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/shared/{ui.DErCA3YU.mjs → ui.i6pGHFq6.mjs} +9 -6
- package/dist/unplugin.mjs +7 -7
- package/dist/vite.mjs +1 -1
- package/package.json +20 -35
package/.nuxt/ui/index.ts
CHANGED
|
@@ -42,6 +42,7 @@ export { default as dashboardSearchButton } from './dashboard-search-button'
|
|
|
42
42
|
export { default as dashboardSidebar } from './dashboard-sidebar'
|
|
43
43
|
export { default as dashboardSidebarCollapse } from './dashboard-sidebar-collapse'
|
|
44
44
|
export { default as dashboardSidebarToggle } from './dashboard-sidebar-toggle'
|
|
45
|
+
export { default as dashboardToolbar } from './dashboard-toolbar'
|
|
45
46
|
export { default as drawer } from './drawer'
|
|
46
47
|
export { default as dropdownMenu } from './dropdown-menu'
|
|
47
48
|
export { default as error } from './error'
|
|
@@ -100,50 +101,4 @@ export { default as toast } from './toast'
|
|
|
100
101
|
export { default as toaster } from './toaster'
|
|
101
102
|
export { default as tooltip } from './tooltip'
|
|
102
103
|
export { default as tree } from './tree'
|
|
103
|
-
export { default as user } from './user'
|
|
104
|
-
export { default as contentNavigation } from './content/content-navigation'
|
|
105
|
-
export { default as contentSearch } from './content/content-search'
|
|
106
|
-
export { default as contentSearchButton } from './content/content-search-button'
|
|
107
|
-
export { default as contentSurround } from './content/content-surround'
|
|
108
|
-
export { default as contentToc } from './content/content-toc'
|
|
109
|
-
export { default as a } from './prose/a'
|
|
110
|
-
export { default as accordion } from './prose/accordion'
|
|
111
|
-
export { default as accordionItem } from './prose/accordion-item'
|
|
112
|
-
export { default as badge } from './prose/badge'
|
|
113
|
-
export { default as blockquote } from './prose/blockquote'
|
|
114
|
-
export { default as callout } from './prose/callout'
|
|
115
|
-
export { default as card } from './prose/card'
|
|
116
|
-
export { default as cardGroup } from './prose/card-group'
|
|
117
|
-
export { default as code } from './prose/code'
|
|
118
|
-
export { default as codeCollapse } from './prose/code-collapse'
|
|
119
|
-
export { default as codeGroup } from './prose/code-group'
|
|
120
|
-
export { default as codeIcon } from './prose/code-icon'
|
|
121
|
-
export { default as codePreview } from './prose/code-preview'
|
|
122
|
-
export { default as codeTree } from './prose/code-tree'
|
|
123
|
-
export { default as collapsible } from './prose/collapsible'
|
|
124
|
-
export { default as em } from './prose/em'
|
|
125
|
-
export { default as field } from './prose/field'
|
|
126
|
-
export { default as fieldGroup } from './prose/field-group'
|
|
127
|
-
export { default as h1 } from './prose/h1'
|
|
128
|
-
export { default as h2 } from './prose/h2'
|
|
129
|
-
export { default as h3 } from './prose/h3'
|
|
130
|
-
export { default as h4 } from './prose/h4'
|
|
131
|
-
export { default as hr } from './prose/hr'
|
|
132
|
-
export { default as icon } from './prose/icon'
|
|
133
|
-
export { default as img } from './prose/img'
|
|
134
|
-
export { default as kbd } from './prose/kbd'
|
|
135
|
-
export { default as li } from './prose/li'
|
|
136
|
-
export { default as ol } from './prose/ol'
|
|
137
|
-
export { default as p } from './prose/p'
|
|
138
|
-
export { default as pre } from './prose/pre'
|
|
139
|
-
export { default as steps } from './prose/steps'
|
|
140
|
-
export { default as strong } from './prose/strong'
|
|
141
|
-
export { default as table } from './prose/table'
|
|
142
|
-
export { default as tabs } from './prose/tabs'
|
|
143
|
-
export { default as tabsItem } from './prose/tabs-item'
|
|
144
|
-
export { default as tbody } from './prose/tbody'
|
|
145
|
-
export { default as td } from './prose/td'
|
|
146
|
-
export { default as th } from './prose/th'
|
|
147
|
-
export { default as thead } from './prose/thead'
|
|
148
|
-
export { default as tr } from './prose/tr'
|
|
149
|
-
export { default as ul } from './prose/ul'
|
|
104
|
+
export { default as user } from './user'
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defu } from 'defu';
|
|
2
1
|
import { defineNuxtModule, createResolver, addVitePlugin, addPlugin, hasNuxtModule, addComponentsDir, addImportsDir, installModule } from '@nuxt/kit';
|
|
3
|
-
import {
|
|
2
|
+
import { defu } from 'defu';
|
|
3
|
+
import { d as defaultOptions, r as resolveColors, a as getDefaultUiConfig, b as addTemplates } from './shared/ui.i6pGHFq6.mjs';
|
|
4
4
|
import '../dist/runtime/utils/index.js';
|
|
5
5
|
import 'node:url';
|
|
6
6
|
import 'scule';
|
|
@@ -8,8 +8,40 @@ import 'tailwindcss/colors';
|
|
|
8
8
|
import 'knitwork';
|
|
9
9
|
|
|
10
10
|
const name = "@eslamdevui/ui";
|
|
11
|
-
const version = "3.
|
|
11
|
+
const version = "3.3.0";
|
|
12
12
|
|
|
13
|
+
function generateProseComponentMap(components) {
|
|
14
|
+
return components.reduce((map, component) => {
|
|
15
|
+
const pascalCase = component.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
|
|
16
|
+
map[component] = `Prose${pascalCase}`;
|
|
17
|
+
return map;
|
|
18
|
+
}, {});
|
|
19
|
+
}
|
|
20
|
+
const proseComponents = [
|
|
21
|
+
"accordion",
|
|
22
|
+
"accordion-item",
|
|
23
|
+
"badge",
|
|
24
|
+
"callout",
|
|
25
|
+
"card",
|
|
26
|
+
"card-group",
|
|
27
|
+
"caution",
|
|
28
|
+
"code-collapse",
|
|
29
|
+
"code-group",
|
|
30
|
+
"code-icon",
|
|
31
|
+
"code-preview",
|
|
32
|
+
"code-tree",
|
|
33
|
+
"collapsible",
|
|
34
|
+
"field",
|
|
35
|
+
"field-group",
|
|
36
|
+
"icon",
|
|
37
|
+
"kbd",
|
|
38
|
+
"note",
|
|
39
|
+
"steps",
|
|
40
|
+
"tabs",
|
|
41
|
+
"tabs-item",
|
|
42
|
+
"tip",
|
|
43
|
+
"warning"
|
|
44
|
+
];
|
|
13
45
|
const module = defineNuxtModule({
|
|
14
46
|
meta: {
|
|
15
47
|
name,
|
|
@@ -67,7 +99,7 @@ const module = defineNuxtModule({
|
|
|
67
99
|
}
|
|
68
100
|
addPlugin({ src: resolve("./runtime/plugins/colors") });
|
|
69
101
|
if (hasNuxtModule("@nuxtjs/mdc") || options.mdc || hasNuxtModule("@nuxt/content") || options.content) {
|
|
70
|
-
nuxt.options.mdc = defu(options.mdc, {
|
|
102
|
+
nuxt.options.mdc = defu(nuxt.options.mdc, {
|
|
71
103
|
highlight: {
|
|
72
104
|
theme: {
|
|
73
105
|
light: "material-theme-lighter",
|
|
@@ -76,31 +108,7 @@ const module = defineNuxtModule({
|
|
|
76
108
|
}
|
|
77
109
|
},
|
|
78
110
|
components: {
|
|
79
|
-
map:
|
|
80
|
-
"accordion": "ProseAccordion",
|
|
81
|
-
"accordion-item": "ProseAccordionItem",
|
|
82
|
-
"badge": "ProseBadge",
|
|
83
|
-
"callout": "ProseCallout",
|
|
84
|
-
"card": "ProseCard",
|
|
85
|
-
"card-group": "ProseCardGroup",
|
|
86
|
-
"caution": "ProseCaution",
|
|
87
|
-
"code-collapse": "ProseCodeCollapse",
|
|
88
|
-
"code-group": "ProseCodeGroup",
|
|
89
|
-
"code-icon": "ProseCodeIcon",
|
|
90
|
-
"code-preview": "ProseCodePreview",
|
|
91
|
-
"code-tree": "ProseCodeTree",
|
|
92
|
-
"collapsible": "ProseCollapsible",
|
|
93
|
-
"field": "ProseField",
|
|
94
|
-
"field-group": "ProseFieldGroup",
|
|
95
|
-
"icon": "ProseIcon",
|
|
96
|
-
"kbd": "ProseKbd",
|
|
97
|
-
"note": "ProseNote",
|
|
98
|
-
"steps": "ProseSteps",
|
|
99
|
-
"tabs": "ProseTabs",
|
|
100
|
-
"tabs-item": "ProseTabsItem",
|
|
101
|
-
"tip": "ProseTip",
|
|
102
|
-
"warning": "ProseWarning"
|
|
103
|
-
}
|
|
111
|
+
map: generateProseComponentMap(proseComponents)
|
|
104
112
|
}
|
|
105
113
|
});
|
|
106
114
|
}
|
|
@@ -11,30 +11,21 @@ import { useLocalePro } from "../composables/useLocalePro";
|
|
|
11
11
|
import { useDashboard } from "../utils/dashboard";
|
|
12
12
|
import { tv } from "../utils/tv";
|
|
13
13
|
const props = defineProps({
|
|
14
|
-
side: { type: String, required: false },
|
|
15
|
-
color: { type: null, required: false },
|
|
16
|
-
variant: { type: null, required: false },
|
|
14
|
+
side: { type: String, required: false, default: "left" },
|
|
15
|
+
color: { type: null, required: false, default: "neutral" },
|
|
16
|
+
variant: { type: null, required: false, default: "ghost" },
|
|
17
17
|
class: { type: null, required: false }
|
|
18
18
|
});
|
|
19
|
-
const rootProps = useForwardProps(reactivePick(props, "color", "variant", "size"
|
|
19
|
+
const rootProps = useForwardProps(reactivePick(props, "color", "variant", "size"));
|
|
20
20
|
const { t } = useLocalePro();
|
|
21
21
|
const appConfig = useAppConfig();
|
|
22
22
|
const { sidebarOpen, toggleSidebar } = useDashboard();
|
|
23
|
-
const ui = computed(() => {
|
|
24
|
-
const baseTheme = typeof theme === "string" ? { base: theme } : theme;
|
|
25
|
-
return tv({
|
|
26
|
-
extend: tv(baseTheme),
|
|
27
|
-
...appConfig.ui?.dashboardSidebarToggle
|
|
28
|
-
});
|
|
29
|
-
});
|
|
23
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.dashboardSidebarToggle || {} }));
|
|
30
24
|
</script>
|
|
31
25
|
|
|
32
26
|
<template>
|
|
33
|
-
<UButton
|
|
34
|
-
v-bind="rootProps"
|
|
27
|
+
<UButton v-bind="rootProps"
|
|
35
28
|
:aria-label="sidebarOpen ? t('dashboardSidebarToggle.close') : t('dashboardSidebarToggle.open')"
|
|
36
29
|
:icon="sidebarOpen ? appConfig.ui.icons.close : appConfig.ui.icons.menu"
|
|
37
|
-
:class="
|
|
38
|
-
@click="toggleSidebar"
|
|
39
|
-
/>
|
|
30
|
+
:class="ui({ class: props.class, side: props.side })" @click="toggleSidebar" />
|
|
40
31
|
</template>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { ButtonProps } from '../types';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { ButtonProps, ComponentConfig } from '../types';
|
|
2
|
+
import theme from '#build/ui/dashboard-sidebar-toggle';
|
|
3
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
4
|
+
export type DashboardSidebarToggle = ComponentConfig<typeof theme, AppConfig, 'dashboardSidebarToggle'>;
|
|
5
|
+
export interface DashboardSidebarToggleProps extends /** @vue-ignore */ Pick<ButtonProps, 'as' | 'size' | 'disabled' | 'ui'> {
|
|
5
6
|
side?: 'left' | 'right';
|
|
6
7
|
/**
|
|
7
8
|
* @defaultValue 'neutral'
|
|
@@ -13,5 +14,9 @@ Pick<ButtonProps, 'as' | 'size' | 'disabled' | 'ui'> {
|
|
|
13
14
|
variant?: ButtonProps['variant'];
|
|
14
15
|
class?: any;
|
|
15
16
|
}
|
|
16
|
-
declare const _default: import("vue").DefineComponent<DashboardSidebarToggleProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DashboardSidebarToggleProps> & Readonly<{}>, {
|
|
17
|
+
declare const _default: import("vue").DefineComponent<DashboardSidebarToggleProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DashboardSidebarToggleProps> & Readonly<{}>, {
|
|
18
|
+
color: "error" | "info" | "primary" | "secondary" | "success" | "warning" | "neutral";
|
|
19
|
+
variant: "link" | "solid" | "outline" | "soft" | "subtle" | "ghost";
|
|
20
|
+
side: "left" | "right";
|
|
21
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
22
|
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/dashboard-toolbar";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { Primitive } from "reka-ui";
|
|
8
|
+
import { useAppConfig } from "#imports";
|
|
9
|
+
import { tv } from "../utils/tv";
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
as: { type: null, required: false },
|
|
12
|
+
class: { type: null, required: false },
|
|
13
|
+
ui: { type: null, required: false }
|
|
14
|
+
});
|
|
15
|
+
defineSlots();
|
|
16
|
+
const appConfig = useAppConfig();
|
|
17
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.dashboardToolbar || {} })());
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
22
|
+
<slot>
|
|
23
|
+
<div :class="ui.left({ class: [props.ui?.left] })">
|
|
24
|
+
<slot name="left" />
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<div :class="ui.right({ class: [props.ui?.right] })">
|
|
28
|
+
<slot name="right" />
|
|
29
|
+
</div>
|
|
30
|
+
</slot>
|
|
31
|
+
</Primitive>
|
|
32
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import theme from "#build/ui/dashboard-toolbar";
|
|
2
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
3
|
+
import type { ComponentConfig } from "../types";
|
|
4
|
+
type DashboardToolbar = ComponentConfig<typeof theme, AppConfig, 'dashboardToolbar'>;
|
|
5
|
+
export interface DashboardToolbarProps {
|
|
6
|
+
/**
|
|
7
|
+
* The element or component this component should render as.
|
|
8
|
+
* @defaultValue 'div'
|
|
9
|
+
*/
|
|
10
|
+
as?: any;
|
|
11
|
+
class?: any;
|
|
12
|
+
ui?: DashboardToolbar['slots'];
|
|
13
|
+
}
|
|
14
|
+
export interface DashboardToolbarSlots {
|
|
15
|
+
default(props?: {}): any;
|
|
16
|
+
left(props?: {}): any;
|
|
17
|
+
right(props?: {}): any;
|
|
18
|
+
}
|
|
19
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<DashboardToolbarProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DashboardToolbarProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, DashboardToolbarSlots>;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -12,8 +12,8 @@ const props = defineProps({
|
|
|
12
12
|
pauseOnHover: { type: Boolean, required: false },
|
|
13
13
|
reverse: { type: Boolean, required: false },
|
|
14
14
|
orientation: { type: null, required: false, default: "horizontal" },
|
|
15
|
-
repeat: { type: Number, required: false },
|
|
16
|
-
overlay: { type: Boolean, required: false },
|
|
15
|
+
repeat: { type: Number, required: false, default: 4 },
|
|
16
|
+
overlay: { type: Boolean, required: false, default: true },
|
|
17
17
|
class: { type: null, required: false },
|
|
18
18
|
ui: { type: null, required: false }
|
|
19
19
|
});
|
|
@@ -28,7 +28,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.pageMarquee |
|
|
|
28
28
|
</script>
|
|
29
29
|
|
|
30
30
|
<template>
|
|
31
|
-
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
31
|
+
<Primitive :as="props.as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
32
32
|
<div v-for="i in repeat" :key="i" :class="ui.content({ class: [props.ui?.content] })">
|
|
33
33
|
<slot />
|
|
34
34
|
</div>
|
|
@@ -20,7 +20,9 @@ export interface PageMarqueeSlots {
|
|
|
20
20
|
default(props?: {}): any;
|
|
21
21
|
}
|
|
22
22
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PageMarqueeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PageMarqueeProps> & Readonly<{}>, {
|
|
23
|
+
repeat: number;
|
|
23
24
|
orientation: PageMarquee["variants"]["orientation"];
|
|
25
|
+
overlay: boolean;
|
|
24
26
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, PageMarqueeSlots>;
|
|
25
27
|
export default _default;
|
|
26
28
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -53,18 +53,15 @@ const [DefineFeatureTemplate, ReuseFeatureTemplate] = createReusableTemplate({
|
|
|
53
53
|
|
|
54
54
|
<slot :name="`${tier.id}-badge`" :tier="tier">
|
|
55
55
|
<slot name="tier-badge" :tier="tier">
|
|
56
|
-
<UBadge
|
|
57
|
-
v-if="tier.badge"
|
|
58
|
-
color="primary"
|
|
59
|
-
variant="subtle"
|
|
56
|
+
<UBadge v-if="tier.badge" color="primary" variant="subtle"
|
|
60
57
|
v-bind="typeof tier.badge === 'string' ? { label: tier.badge } : tier.badge"
|
|
61
|
-
:class="ui.tierBadge({ class: props.ui?.tierBadge })"
|
|
62
|
-
/>
|
|
58
|
+
:class="ui.tierBadge({ class: props.ui?.tierBadge })" />
|
|
63
59
|
</slot>
|
|
64
60
|
</slot>
|
|
65
61
|
</div>
|
|
66
62
|
|
|
67
|
-
<div v-if="tier.description || !!slots['tier-description'] || !!slots[`${tier.id}-description`]"
|
|
63
|
+
<div v-if="tier.description || !!slots['tier-description'] || !!slots[`${tier.id}-description`]"
|
|
64
|
+
:class="ui.tierDescription({ class: props.ui?.tierDescription })">
|
|
68
65
|
<slot :name="`${tier.id}-description`" :tier="tier">
|
|
69
66
|
<slot name="tier-description" :tier="tier">
|
|
70
67
|
{{ tier.description }}
|
|
@@ -72,8 +69,11 @@ const [DefineFeatureTemplate, ReuseFeatureTemplate] = createReusableTemplate({
|
|
|
72
69
|
</slot>
|
|
73
70
|
</div>
|
|
74
71
|
|
|
75
|
-
<div
|
|
76
|
-
|
|
72
|
+
<div
|
|
73
|
+
v-if="tier.discount || tier.price || !!slots['tier-discount'] || !!slots[`${tier.id}-discount`] || !!slots['tier-price'] || !!slots[`${tier.id}-price`] || tier.billingCycle || tier.billingPeriod || !!slots['tier-billing'] || !!slots[`${tier.id}-billing`]"
|
|
74
|
+
:class="ui.tierPriceWrapper({ class: props.ui?.tierPriceWrapper })">
|
|
75
|
+
<div v-if="tier.discount && tier.price || !!slots[`${tier.id}-discount`] || !!slots['tier-discount']"
|
|
76
|
+
:class="ui.tierDiscount({ class: props.ui?.tierDiscount })">
|
|
77
77
|
<slot :name="`${tier.id}-discount`" :tier="tier">
|
|
78
78
|
<slot name="tier-discount" :tier="tier">
|
|
79
79
|
{{ tier.price }}
|
|
@@ -81,7 +81,8 @@ const [DefineFeatureTemplate, ReuseFeatureTemplate] = createReusableTemplate({
|
|
|
81
81
|
</slot>
|
|
82
82
|
</div>
|
|
83
83
|
|
|
84
|
-
<div v-if="tier.discount || tier.price || !!slots[`${tier.id}-price`] || !!slots['tier-price']"
|
|
84
|
+
<div v-if="tier.discount || tier.price || !!slots[`${tier.id}-price`] || !!slots['tier-price']"
|
|
85
|
+
:class="ui.tierPrice({ class: props.ui?.tierPrice })">
|
|
85
86
|
<slot :name="`${tier.id}-price`" :tier="tier">
|
|
86
87
|
<slot name="tier-price" :tier="tier">
|
|
87
88
|
{{ tier.discount || tier.price }}
|
|
@@ -89,7 +90,9 @@ const [DefineFeatureTemplate, ReuseFeatureTemplate] = createReusableTemplate({
|
|
|
89
90
|
</slot>
|
|
90
91
|
</div>
|
|
91
92
|
|
|
92
|
-
<div
|
|
93
|
+
<div
|
|
94
|
+
v-if="tier.billingCycle || tier.billingPeriod || !!slots[`${tier.id}-billing`] || !!slots['tier-billing']"
|
|
95
|
+
:class="ui.tierBilling({ class: props.ui?.tierBilling })">
|
|
93
96
|
<slot :name="`${tier.id}-billing`" :tier="tier">
|
|
94
97
|
<slot name="tier-billing" :tier="tier">
|
|
95
98
|
<span :class="ui.tierBillingPeriod({ class: props.ui?.tierBillingPeriod })">
|
|
@@ -104,7 +107,8 @@ const [DefineFeatureTemplate, ReuseFeatureTemplate] = createReusableTemplate({
|
|
|
104
107
|
</div>
|
|
105
108
|
</div>
|
|
106
109
|
|
|
107
|
-
<div v-if="!!slots[`${tier.id}-button`] || !!slots['tier-button'] || tier.button"
|
|
110
|
+
<div v-if="!!slots[`${tier.id}-button`] || !!slots['tier-button'] || tier.button"
|
|
111
|
+
:class="ui.tierButton({ class: props.ui?.tierButton })">
|
|
108
112
|
<slot :name="`${tier.id}-button`" :tier="tier">
|
|
109
113
|
<slot name="tier-button" :tier="tier">
|
|
110
114
|
<UButton v-if="tier.button" block size="lg" v-bind="tier.button" />
|
|
@@ -117,7 +121,8 @@ const [DefineFeatureTemplate, ReuseFeatureTemplate] = createReusableTemplate({
|
|
|
117
121
|
|
|
118
122
|
<DefineFeatureTemplate v-slot="{ feature, tier }">
|
|
119
123
|
<template v-if="feature.tiers?.[tier.id]">
|
|
120
|
-
<UIcon v-if="typeof feature.tiers[tier.id] === 'boolean'" :name="appConfig.ui.icons.success"
|
|
124
|
+
<UIcon v-if="typeof feature.tiers[tier.id] === 'boolean'" :name="appConfig.ui.icons.success"
|
|
125
|
+
:class="ui.tierFeatureIcon({ class: props.ui?.tierFeatureIcon, active: true })" />
|
|
121
126
|
<template v-else>
|
|
122
127
|
{{ feature.tiers[tier.id] }}
|
|
123
128
|
</template>
|
|
@@ -138,12 +143,8 @@ const [DefineFeatureTemplate, ReuseFeatureTemplate] = createReusableTemplate({
|
|
|
138
143
|
<tr :class="ui.tr({ class: props.ui?.tr })">
|
|
139
144
|
<td />
|
|
140
145
|
|
|
141
|
-
<th
|
|
142
|
-
|
|
143
|
-
:key="index"
|
|
144
|
-
scope="col"
|
|
145
|
-
:class="ui.tier({ class: props.ui?.tier, highlight: tier.highlight })"
|
|
146
|
-
>
|
|
146
|
+
<th v-for="(tier, index) in tiers" :key="index" scope="col"
|
|
147
|
+
:class="ui.tier({ class: props.ui?.tier, highlight: tier.highlight })">
|
|
147
148
|
<ReuseTierTemplate :tier="tier" />
|
|
148
149
|
</th>
|
|
149
150
|
</tr>
|
|
@@ -153,7 +154,9 @@ const [DefineFeatureTemplate, ReuseFeatureTemplate] = createReusableTemplate({
|
|
|
153
154
|
<template v-for="(section, sectionIndex) in sections" :key="sectionIndex">
|
|
154
155
|
<tr :class="ui.tr({ class: props.ui?.tr, section: sectionIndex > 0 })">
|
|
155
156
|
<th scope="row" :class="ui.th({ class: props.ui?.th })">
|
|
156
|
-
<div
|
|
157
|
+
<div
|
|
158
|
+
v-if="section.title || !!slots['section-title'] || !!slots[`section-${formatSlotName(section)}-title`]"
|
|
159
|
+
:class="ui.sectionTitle({ class: props.ui?.sectionTitle })">
|
|
157
160
|
<slot :name="`section-${formatSlotName(section)}-title`" :section="section">
|
|
158
161
|
<slot name="section-title" :section="section">
|
|
159
162
|
{{ section.title }}
|
|
@@ -162,11 +165,8 @@ const [DefineFeatureTemplate, ReuseFeatureTemplate] = createReusableTemplate({
|
|
|
162
165
|
</div>
|
|
163
166
|
</th>
|
|
164
167
|
|
|
165
|
-
<td
|
|
166
|
-
|
|
167
|
-
:key="`${sectionIndex}-tier-${index}`"
|
|
168
|
-
:class="ui.td({ class: props.ui?.td, highlight: tier.highlight })"
|
|
169
|
-
/>
|
|
168
|
+
<td v-for="(tier, index) in tiers" :key="`${sectionIndex}-tier-${index}`"
|
|
169
|
+
:class="ui.td({ class: props.ui?.td, highlight: tier.highlight })" />
|
|
170
170
|
</tr>
|
|
171
171
|
|
|
172
172
|
<tr v-for="(feature, featureIndex) in section.features" :key="`${sectionIndex}-feature-${featureIndex}`">
|
|
@@ -180,13 +180,11 @@ const [DefineFeatureTemplate, ReuseFeatureTemplate] = createReusableTemplate({
|
|
|
180
180
|
</div>
|
|
181
181
|
</th>
|
|
182
182
|
|
|
183
|
-
<td
|
|
184
|
-
|
|
185
|
-
:key="`${sectionIndex}-feature-${featureIndex}-tier-${index}`"
|
|
186
|
-
:class="ui.td({ class: props.ui?.td, highlight: tier.highlight })"
|
|
187
|
-
>
|
|
183
|
+
<td v-for="(tier, index) in tiers" :key="`${sectionIndex}-feature-${featureIndex}-tier-${index}`"
|
|
184
|
+
:class="ui.td({ class: props.ui?.td, highlight: tier.highlight })">
|
|
188
185
|
<div :class="ui.featureValue({ class: props.ui?.featureValue })">
|
|
189
|
-
<slot :name="`feature-${formatSlotName(feature)}-value`" :feature="feature" :tier="tier"
|
|
186
|
+
<slot :name="`feature-${formatSlotName(feature)}-value`" :feature="feature" :tier="tier"
|
|
187
|
+
:section="section">
|
|
190
188
|
<slot name="feature-value" :feature="feature" :tier="tier" :section="section">
|
|
191
189
|
<ReuseFeatureTemplate :tier="tier" :feature="feature" />
|
|
192
190
|
</slot>
|
|
@@ -199,10 +197,12 @@ const [DefineFeatureTemplate, ReuseFeatureTemplate] = createReusableTemplate({
|
|
|
199
197
|
</table>
|
|
200
198
|
|
|
201
199
|
<ul :class="ui.list({ class: props.ui?.list })">
|
|
202
|
-
<li v-for="(tier, index) in tiers" :key="index"
|
|
200
|
+
<li v-for="(tier, index) in tiers" :key="index"
|
|
201
|
+
:class="ui.item({ class: props.ui?.item, highlight: tier.highlight })">
|
|
203
202
|
<ReuseTierTemplate :tier="tier" />
|
|
204
203
|
|
|
205
|
-
<div v-for="(section, sectionIndex) in sections" :key="`section-${sectionIndex}`"
|
|
204
|
+
<div v-for="(section, sectionIndex) in sections" :key="`section-${sectionIndex}`"
|
|
205
|
+
:class="ui.section({ class: props.ui?.section })">
|
|
206
206
|
<div v-if="section.title" :class="ui.sectionTitle({ class: props.ui?.sectionTitle })">
|
|
207
207
|
<slot :name="`section-${formatSlotName(section)}-title`" :section="section">
|
|
208
208
|
<slot name="section-title" :section="section">
|
|
@@ -211,7 +211,8 @@ const [DefineFeatureTemplate, ReuseFeatureTemplate] = createReusableTemplate({
|
|
|
211
211
|
</slot>
|
|
212
212
|
</div>
|
|
213
213
|
|
|
214
|
-
<div v-for="(feature, featureIndex) in section.features"
|
|
214
|
+
<div v-for="(feature, featureIndex) in section.features"
|
|
215
|
+
:key="`section-${sectionIndex}-feature-${featureIndex}`" :class="ui.feature({ class: props.ui?.feature })">
|
|
215
216
|
<div :class="ui.featureTitle({ class: props.ui?.featureTitle })">
|
|
216
217
|
<slot :name="`feature-${formatSlotName(feature)}-title`" :feature="feature" :section="section">
|
|
217
218
|
<slot name="feature-title" :feature="feature" :section="section">
|
|
@@ -221,7 +222,8 @@ const [DefineFeatureTemplate, ReuseFeatureTemplate] = createReusableTemplate({
|
|
|
221
222
|
</div>
|
|
222
223
|
|
|
223
224
|
<div :class="ui.featureValue({ class: props.ui?.featureValue })">
|
|
224
|
-
<slot :name="`feature-${formatSlotName(feature)}-value`" :feature="feature" :tier="tier"
|
|
225
|
+
<slot :name="`feature-${formatSlotName(feature)}-value`" :feature="feature" :tier="tier"
|
|
226
|
+
:section="section">
|
|
225
227
|
<slot name="feature-value" :feature="feature" :tier="tier" :section="section">
|
|
226
228
|
<ReuseFeatureTemplate :tier="tier" :feature="feature" />
|
|
227
229
|
</slot>
|
|
@@ -3,30 +3,15 @@ import theme from "#build/ui/content/content-search";
|
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from "
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} from "#imports";
|
|
16
|
-
import {
|
|
17
|
-
reactivePick,
|
|
18
|
-
defu
|
|
19
|
-
} from "@vueuse/core";
|
|
20
|
-
import {
|
|
21
|
-
useContentSearch
|
|
22
|
-
} from "../../composables/useContentSearch";
|
|
23
|
-
import {
|
|
24
|
-
useLocalePro
|
|
25
|
-
} from "../../composables/useLocalePro";
|
|
26
|
-
import {
|
|
27
|
-
transformUI,
|
|
28
|
-
omit
|
|
29
|
-
} from "../../utils";
|
|
6
|
+
import { computed, useTemplateRef } from "vue";
|
|
7
|
+
import { useForwardProps } from "reka-ui";
|
|
8
|
+
import { defu } from "defu";
|
|
9
|
+
import { reactivePick } from "@vueuse/core";
|
|
10
|
+
import { omit } from "@nuxt/ui/utils";
|
|
11
|
+
import { useAppConfig, useColorMode, defineShortcuts } from "#imports";
|
|
12
|
+
import { useContentSearch } from "../../composables/useContentSearch";
|
|
13
|
+
import { useLocalePro } from "../../composables/useLocalePro";
|
|
14
|
+
import { transformUI } from "../../utils";
|
|
30
15
|
import { tv } from "../../utils/tv";
|
|
31
16
|
import UModal from "../Modal.vue";
|
|
32
17
|
import UCommandPalette from "../CommandPalette.vue";
|
|
@@ -36,15 +21,15 @@ const props = defineProps({
|
|
|
36
21
|
autofocus: { type: Boolean, required: false },
|
|
37
22
|
loading: { type: Boolean, required: false },
|
|
38
23
|
loadingIcon: { type: String, required: false },
|
|
39
|
-
close: { type: [Boolean, Object], required: false },
|
|
24
|
+
close: { type: [Boolean, Object], required: false, default: true },
|
|
40
25
|
closeIcon: { type: String, required: false },
|
|
41
|
-
shortcut: { type: String, required: false },
|
|
26
|
+
shortcut: { type: String, required: false, default: "meta_k" },
|
|
42
27
|
links: { type: Array, required: false },
|
|
43
28
|
navigation: { type: Array, required: false },
|
|
44
29
|
groups: { type: Array, required: false },
|
|
45
30
|
files: { type: Array, required: false },
|
|
46
31
|
fuse: { type: Object, required: false },
|
|
47
|
-
colorMode: { type: Boolean, required: false },
|
|
32
|
+
colorMode: { type: Boolean, required: false, default: true },
|
|
48
33
|
class: { type: null, required: false },
|
|
49
34
|
ui: { type: void 0, required: false }
|
|
50
35
|
});
|
|
@@ -87,9 +72,14 @@ function mapLinksItems(links) {
|
|
|
87
72
|
]);
|
|
88
73
|
}
|
|
89
74
|
function mapNavigationItems(children, parent) {
|
|
90
|
-
return children.flatMap(
|
|
91
|
-
(link
|
|
92
|
-
|
|
75
|
+
return children.flatMap((link) => {
|
|
76
|
+
if (link.children?.length) {
|
|
77
|
+
return mapNavigationItems(link.children, link);
|
|
78
|
+
}
|
|
79
|
+
return props.files?.filter(
|
|
80
|
+
(file) => file.id === link.path || file.id.startsWith(`${link.path}#`)
|
|
81
|
+
)?.map((file) => mapFile(file, link, parent)) || [];
|
|
82
|
+
});
|
|
93
83
|
}
|
|
94
84
|
function mapFile(file, link, parent) {
|
|
95
85
|
const prefix = [...new Set([parent?.title, ...file.titles].filter(Boolean))].join(" > ");
|
|
@@ -102,78 +92,86 @@ function mapFile(file, link, parent) {
|
|
|
102
92
|
level: file.level
|
|
103
93
|
};
|
|
104
94
|
}
|
|
105
|
-
function postFilter(query, items) {
|
|
106
|
-
return query ? items : items?.filter((item) => item.level === 1);
|
|
107
|
-
}
|
|
108
|
-
function onSelect(item) {
|
|
109
|
-
if (!item.disabled) {
|
|
110
|
-
open.value = false;
|
|
111
|
-
searchTerm.value = "";
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
defineShortcuts({
|
|
115
|
-
[props.shortcut || "meta_k"]: {
|
|
116
|
-
usingInput: true,
|
|
117
|
-
handler: () => open.value = !open.value
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
95
|
const groups = computed(() => {
|
|
121
|
-
const
|
|
96
|
+
const groups2 = [];
|
|
122
97
|
if (props.links?.length) {
|
|
123
|
-
|
|
98
|
+
groups2.push({ id: "links", label: t("contentSearch.links"), items: mapLinksItems(props.links) });
|
|
124
99
|
}
|
|
125
100
|
if (props.navigation?.length) {
|
|
126
|
-
if (props.navigation.some((link) => link.children?.length)) {
|
|
127
|
-
|
|
101
|
+
if (props.navigation.some((link) => !!link.children?.length)) {
|
|
102
|
+
groups2.push(...props.navigation.map((group) => ({
|
|
128
103
|
id: group.path,
|
|
129
104
|
label: group.title,
|
|
130
|
-
items: mapNavigationItems(group.children || []),
|
|
105
|
+
items: mapNavigationItems(group.children || [], group),
|
|
131
106
|
postFilter
|
|
132
107
|
})));
|
|
133
108
|
} else {
|
|
134
|
-
|
|
109
|
+
groups2.push({
|
|
110
|
+
id: "docs",
|
|
111
|
+
items: mapNavigationItems(props.navigation, { title: "", path: "", children: [] }),
|
|
112
|
+
postFilter
|
|
113
|
+
});
|
|
135
114
|
}
|
|
136
115
|
}
|
|
137
|
-
|
|
116
|
+
groups2.push(...props.groups || []);
|
|
138
117
|
if (props.colorMode && !colorMode?.forced) {
|
|
139
|
-
|
|
118
|
+
groups2.push({
|
|
140
119
|
id: "theme",
|
|
141
120
|
label: t("contentSearch.theme"),
|
|
142
|
-
items: [
|
|
143
|
-
label: t(
|
|
144
|
-
icon: appConfig.ui.icons
|
|
145
|
-
active: colorMode.preference ===
|
|
121
|
+
items: [{
|
|
122
|
+
label: t("colorMode.system"),
|
|
123
|
+
icon: appConfig.ui.icons.system,
|
|
124
|
+
active: colorMode.preference === "system",
|
|
125
|
+
onSelect: () => {
|
|
126
|
+
colorMode.preference = "system";
|
|
127
|
+
}
|
|
128
|
+
}, {
|
|
129
|
+
label: t("colorMode.light"),
|
|
130
|
+
icon: appConfig.ui.icons.light,
|
|
131
|
+
active: colorMode.preference === "light",
|
|
132
|
+
onSelect: () => {
|
|
133
|
+
colorMode.preference = "light";
|
|
134
|
+
}
|
|
135
|
+
}, {
|
|
136
|
+
label: t("colorMode.dark"),
|
|
137
|
+
icon: appConfig.ui.icons.dark,
|
|
138
|
+
active: colorMode.preference === "dark",
|
|
146
139
|
onSelect: () => {
|
|
147
|
-
colorMode.preference =
|
|
140
|
+
colorMode.preference = "dark";
|
|
148
141
|
}
|
|
149
|
-
}
|
|
142
|
+
}]
|
|
150
143
|
});
|
|
151
144
|
}
|
|
152
|
-
return
|
|
145
|
+
return groups2;
|
|
146
|
+
});
|
|
147
|
+
function postFilter(query, items) {
|
|
148
|
+
return query ? items : items?.filter((item) => item.level === 1);
|
|
149
|
+
}
|
|
150
|
+
function onSelect(item) {
|
|
151
|
+
if (item.disabled) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
open.value = false;
|
|
155
|
+
searchTerm.value = "";
|
|
156
|
+
}
|
|
157
|
+
defineShortcuts({
|
|
158
|
+
[props.shortcut || "meta_k"]: {
|
|
159
|
+
usingInput: true,
|
|
160
|
+
handler: () => open.value = !open.value
|
|
161
|
+
}
|
|
153
162
|
});
|
|
154
163
|
const commandPaletteRef = useTemplateRef("commandPaletteRef");
|
|
155
164
|
defineExpose({ commandPaletteRef });
|
|
156
165
|
</script>
|
|
157
166
|
|
|
158
167
|
<template>
|
|
159
|
-
<UModal
|
|
160
|
-
|
|
161
|
-
:title="t('contentSearch.title')"
|
|
162
|
-
:description="t('contentSearch.description')"
|
|
163
|
-
:class="ui.modal({ class: props.class })"
|
|
164
|
-
>
|
|
168
|
+
<UModal v-model:open="open" :title="t('contentSearch.title')" :description="t('contentSearch.description')"
|
|
169
|
+
:class="ui.modal({ class: props.class })">
|
|
165
170
|
<template #content>
|
|
166
171
|
<slot name="content">
|
|
167
|
-
<UCommandPalette
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
v-bind="commandPaletteProps"
|
|
171
|
-
:groups="groups"
|
|
172
|
-
:fuse="fuse"
|
|
173
|
-
:ui="transformUI(omit(ui, ['modal']), props.ui)"
|
|
174
|
-
@update:model-value="onSelect"
|
|
175
|
-
@update:open="open = $event"
|
|
176
|
-
>
|
|
172
|
+
<UCommandPalette ref="commandPaletteRef" v-model:search-term="searchTerm" v-bind="commandPaletteProps"
|
|
173
|
+
:groups="groups" :fuse="fuse" :ui="transformUI(omit(ui, ['modal']), props.ui)" @update:model-value="onSelect"
|
|
174
|
+
@update:open="open = $event">
|
|
177
175
|
<template v-for="(_, name) in proxySlots" #[name]="slotData">
|
|
178
176
|
<slot :name="name" v-bind="slotData" />
|
|
179
177
|
</template>
|
|
@@ -102,7 +102,11 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ContentSea
|
|
|
102
102
|
searchTerm?: string;
|
|
103
103
|
}> & Readonly<{
|
|
104
104
|
"onUpdate:searchTerm"?: ((value: string) => any) | undefined;
|
|
105
|
-
}>, {
|
|
105
|
+
}>, {
|
|
106
|
+
close: boolean | Partial<ButtonProps>;
|
|
107
|
+
colorMode: boolean;
|
|
108
|
+
shortcut: string;
|
|
109
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ContentSearchSlots>;
|
|
106
110
|
export default _default;
|
|
107
111
|
type __VLS_WithSlots<T, S> = T & {
|
|
108
112
|
new (): {
|
|
@@ -18,23 +18,19 @@ const props = defineProps({
|
|
|
18
18
|
});
|
|
19
19
|
defineSlots();
|
|
20
20
|
const appConfig = useAppConfig();
|
|
21
|
-
const [DefineLinkTemplate, ReuseLinkTemplate] = createReusableTemplate(
|
|
22
|
-
props: {
|
|
23
|
-
link: Object,
|
|
24
|
-
icon: String,
|
|
25
|
-
direction: String
|
|
26
|
-
}
|
|
27
|
-
});
|
|
21
|
+
const [DefineLinkTemplate, ReuseLinkTemplate] = createReusableTemplate();
|
|
28
22
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.contentSurround || {} })());
|
|
29
23
|
</script>
|
|
30
24
|
|
|
31
25
|
<template>
|
|
32
26
|
<DefineLinkTemplate v-slot="{ link, icon, direction }">
|
|
33
|
-
<ULink v-if="link" :to="link.path" raw
|
|
27
|
+
<ULink v-if="link" :to="link.path" raw
|
|
28
|
+
:class="ui.link({ class: [props.ui?.link, link.ui?.link, link.class], direction })">
|
|
34
29
|
<slot name="link" :link="link">
|
|
35
30
|
<div :class="ui.linkLeading({ class: [props.ui?.linkLeading, link.ui?.linkLeading] })">
|
|
36
31
|
<slot name="link-leading" :link="link">
|
|
37
|
-
<UIcon :name="link.icon || icon"
|
|
32
|
+
<UIcon :name="link.icon || icon"
|
|
33
|
+
:class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, link.ui?.linkLeadingIcon], direction })" />
|
|
38
34
|
</slot>
|
|
39
35
|
</div>
|
|
40
36
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { inject, provide, computed } from "vue";
|
|
2
|
-
export const avatarGroupInjectionKey = Symbol("
|
|
2
|
+
export const avatarGroupInjectionKey = Symbol("eslamdevui-ui.avatar-group");
|
|
3
3
|
export function useAvatarGroup(props) {
|
|
4
4
|
const avatarGroup = inject(avatarGroupInjectionKey, void 0);
|
|
5
5
|
const size = computed(() => props.size ?? avatarGroup?.value.size);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function useBreakpoint(): {
|
|
2
|
+
isSm: import("vue").ComputedRef<boolean>;
|
|
3
|
+
isMd: import("vue").ComputedRef<boolean>;
|
|
4
|
+
isLg: import("vue").ComputedRef<boolean>;
|
|
5
|
+
isXl: import("vue").ComputedRef<boolean>;
|
|
6
|
+
is2xl: import("vue").ComputedRef<boolean>;
|
|
7
|
+
isMobile: import("vue").ComputedRef<boolean>;
|
|
8
|
+
isTablet: import("vue").ComputedRef<boolean>;
|
|
9
|
+
isDesktop: import("vue").ComputedRef<boolean>;
|
|
10
|
+
current: import("vue").ComputedRef<"sm" | "md" | "lg" | "xl" | "2xl">;
|
|
11
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { useMediaQuery } from "@vueuse/core";
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useAppConfig } from "#imports";
|
|
4
|
+
const defaultBreakpoints = {
|
|
5
|
+
sm: "640px",
|
|
6
|
+
md: "768px",
|
|
7
|
+
lg: "1024px",
|
|
8
|
+
xl: "1280px",
|
|
9
|
+
"2xl": "1536px"
|
|
10
|
+
};
|
|
11
|
+
export function useBreakpoint() {
|
|
12
|
+
const config = useAppConfig();
|
|
13
|
+
const breakpoints = {
|
|
14
|
+
...defaultBreakpoints,
|
|
15
|
+
...config.ui?.breakpoints || {}
|
|
16
|
+
};
|
|
17
|
+
const queries = {
|
|
18
|
+
sm: useMediaQuery(`(min-width: ${breakpoints.sm})`),
|
|
19
|
+
md: useMediaQuery(`(min-width: ${breakpoints.md})`),
|
|
20
|
+
lg: useMediaQuery(`(min-width: ${breakpoints.lg})`),
|
|
21
|
+
xl: useMediaQuery(`(min-width: ${breakpoints.xl})`),
|
|
22
|
+
"2xl": useMediaQuery(`(min-width: ${breakpoints["2xl"]})`)
|
|
23
|
+
};
|
|
24
|
+
const current = computed(() => {
|
|
25
|
+
const order = ["2xl", "xl", "lg", "md", "sm"];
|
|
26
|
+
for (const key of order) {
|
|
27
|
+
if (queries[key].value) return key;
|
|
28
|
+
}
|
|
29
|
+
return "sm";
|
|
30
|
+
});
|
|
31
|
+
const isSm = queries.sm;
|
|
32
|
+
const isMd = queries.md;
|
|
33
|
+
const isLg = queries.lg;
|
|
34
|
+
const isXl = queries.xl;
|
|
35
|
+
const is2xl = queries["2xl"];
|
|
36
|
+
const isMobile = computed(() => !isMd.value);
|
|
37
|
+
const isTablet = computed(() => isMd.value && !isLg.value);
|
|
38
|
+
const isDesktop = computed(() => isLg.value);
|
|
39
|
+
return {
|
|
40
|
+
// individual breakpoints
|
|
41
|
+
isSm,
|
|
42
|
+
isMd,
|
|
43
|
+
isLg,
|
|
44
|
+
isXl,
|
|
45
|
+
is2xl,
|
|
46
|
+
// helpers
|
|
47
|
+
isMobile,
|
|
48
|
+
isTablet,
|
|
49
|
+
isDesktop,
|
|
50
|
+
// current active key
|
|
51
|
+
current
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { inject, computed } from "vue";
|
|
2
|
-
export const buttonGroupInjectionKey = Symbol("
|
|
2
|
+
export const buttonGroupInjectionKey = Symbol("eslamdevui-ui.button-group");
|
|
3
3
|
export function useButtonGroup(props) {
|
|
4
4
|
const buttonGroup = inject(buttonGroupInjectionKey, void 0);
|
|
5
5
|
return {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { inject, computed, provide } from "vue";
|
|
2
2
|
import { useDebounceFn } from "@vueuse/core";
|
|
3
|
-
export const formOptionsInjectionKey = Symbol("
|
|
4
|
-
export const formBusInjectionKey = Symbol("
|
|
5
|
-
export const formFieldInjectionKey = Symbol("
|
|
6
|
-
export const inputIdInjectionKey = Symbol("
|
|
7
|
-
export const formInputsInjectionKey = Symbol("
|
|
8
|
-
export const formLoadingInjectionKey = Symbol("
|
|
3
|
+
export const formOptionsInjectionKey = Symbol("eslamdevui-ui.form-options");
|
|
4
|
+
export const formBusInjectionKey = Symbol("eslamdevui-ui.form-events");
|
|
5
|
+
export const formFieldInjectionKey = Symbol("eslamdevui-ui.form-field");
|
|
6
|
+
export const inputIdInjectionKey = Symbol("eslamdevui-ui.input-id");
|
|
7
|
+
export const formInputsInjectionKey = Symbol("eslamdevui-ui.form-inputs");
|
|
8
|
+
export const formLoadingInjectionKey = Symbol("eslamdevui-ui.form-loading");
|
|
9
9
|
export function useFormField(props, opts) {
|
|
10
10
|
const formOptions = inject(formOptionsInjectionKey, void 0);
|
|
11
11
|
const formBus = inject(formBusInjectionKey, void 0);
|
|
@@ -2,7 +2,7 @@ import { computed, inject, toRef } from "vue";
|
|
|
2
2
|
import { createSharedComposable } from "@vueuse/core";
|
|
3
3
|
import { buildLocaleContext } from "../utils/locale.js";
|
|
4
4
|
import en from "../locale/en.js";
|
|
5
|
-
export const localeContextInjectionKey = Symbol.for("
|
|
5
|
+
export const localeContextInjectionKey = Symbol.for("eslamdevui-ui.locale-context");
|
|
6
6
|
const _useLocale = (localeOverrides) => {
|
|
7
7
|
const locale = localeOverrides || toRef(inject(localeContextInjectionKey));
|
|
8
8
|
return buildLocaleContext(computed(() => locale.value || en));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { inject, provide, computed } from "vue";
|
|
2
|
-
export const portalTargetInjectionKey = Symbol("
|
|
2
|
+
export const portalTargetInjectionKey = Symbol("eslamdevui-ui.portal-target");
|
|
3
3
|
export function usePortal(portal) {
|
|
4
4
|
const portalTarget = inject(portalTargetInjectionKey, void 0);
|
|
5
5
|
const to = computed(() => {
|
|
@@ -35,16 +35,16 @@ export default defineNuxtPlugin(() => {
|
|
|
35
35
|
style: [{
|
|
36
36
|
innerHTML: () => root.value,
|
|
37
37
|
tagPriority: -2,
|
|
38
|
-
id: "
|
|
38
|
+
id: "eslamdevui-ui-colors"
|
|
39
39
|
}]
|
|
40
40
|
};
|
|
41
41
|
if (import.meta.client && nuxtApp.isHydrating && !nuxtApp.payload.serverRendered) {
|
|
42
42
|
const style = document.createElement("style");
|
|
43
43
|
style.innerHTML = root.value;
|
|
44
|
-
style.setAttribute("data-
|
|
44
|
+
style.setAttribute("data-eslamdevui-ui-colors", "");
|
|
45
45
|
document.head.appendChild(style);
|
|
46
46
|
headData.script = [{
|
|
47
|
-
innerHTML: "document.head.removeChild(document.querySelector('[data-
|
|
47
|
+
innerHTML: "document.head.removeChild(document.querySelector('[data-eslamdevui-ui-colors]'))"
|
|
48
48
|
}];
|
|
49
49
|
}
|
|
50
50
|
useHead(headData);
|
|
@@ -43,6 +43,7 @@ export * from '../components/DashboardSearchButton.vue';
|
|
|
43
43
|
export * from '../components/DashboardSidebar.vue';
|
|
44
44
|
export * from '../components/DashboardSidebarCollapse.vue';
|
|
45
45
|
export * from '../components/DashboardSidebarToggle.vue';
|
|
46
|
+
export * from '../components/DashboardToolbar.vue';
|
|
46
47
|
export * from '../components/Drawer.vue';
|
|
47
48
|
export * from '../components/DropdownMenu.vue';
|
|
48
49
|
export * from '../components/Error.vue';
|
|
@@ -43,6 +43,7 @@ export * from "../components/DashboardSearchButton.vue";
|
|
|
43
43
|
export * from "../components/DashboardSidebar.vue";
|
|
44
44
|
export * from "../components/DashboardSidebarCollapse.vue";
|
|
45
45
|
export * from "../components/DashboardSidebarToggle.vue";
|
|
46
|
+
export * from "../components/DashboardToolbar.vue";
|
|
46
47
|
export * from "../components/Drawer.vue";
|
|
47
48
|
export * from "../components/DropdownMenu.vue";
|
|
48
49
|
export * from "../components/Error.vue";
|
|
@@ -2083,6 +2083,14 @@ const dashboardSidebarToggle = {
|
|
|
2083
2083
|
}
|
|
2084
2084
|
};
|
|
2085
2085
|
|
|
2086
|
+
const dashboardToolbar = {
|
|
2087
|
+
slots: {
|
|
2088
|
+
root: "shrink-0 flex items-center justify-between border-b border-default px-4 sm:px-6 gap-1.5 overflow-x-auto min-h-[49px]",
|
|
2089
|
+
left: "flex items-center gap-1.5",
|
|
2090
|
+
right: "flex items-center gap-1.5"
|
|
2091
|
+
}
|
|
2092
|
+
};
|
|
2093
|
+
|
|
2086
2094
|
const drawer = (options) => ({
|
|
2087
2095
|
slots: {
|
|
2088
2096
|
overlay: "fixed inset-0 bg-elevated/75",
|
|
@@ -5738,6 +5746,7 @@ const theme = {
|
|
|
5738
5746
|
dashboardSidebar: dashboardSidebar,
|
|
5739
5747
|
dashboardSidebarCollapse: dashboardSidebarCollapse,
|
|
5740
5748
|
dashboardSidebarToggle: dashboardSidebarToggle,
|
|
5749
|
+
dashboardToolbar: dashboardToolbar,
|
|
5741
5750
|
drawer: drawer,
|
|
5742
5751
|
dropdownMenu: dropdownMenu,
|
|
5743
5752
|
error: error,
|
|
@@ -6494,12 +6503,6 @@ function getTemplates(options, uiConfig) {
|
|
|
6494
6503
|
for (const component of Object.keys(theme)) {
|
|
6495
6504
|
exports.push(`export { default as ${component} } from './${kebabCase(component)}'`);
|
|
6496
6505
|
}
|
|
6497
|
-
for (const component of Object.keys(contentTheme)) {
|
|
6498
|
-
exports.push(`export { default as ${component} } from './content/${kebabCase(component)}'`);
|
|
6499
|
-
}
|
|
6500
|
-
for (const component of Object.keys(proseTheme)) {
|
|
6501
|
-
exports.push(`export { default as ${component} } from './prose/${kebabCase(component)}'`);
|
|
6502
|
-
}
|
|
6503
6506
|
return exports.join("\n");
|
|
6504
6507
|
}
|
|
6505
6508
|
});
|
package/dist/unplugin.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { join, normalize } from 'pathe';
|
|
|
3
3
|
import { createUnplugin } from 'unplugin';
|
|
4
4
|
import { defu } from 'defu';
|
|
5
5
|
import tailwind from '@tailwindcss/vite';
|
|
6
|
-
import { g as getTemplates, d as defaultOptions, r as resolveColors, a as getDefaultUiConfig } from './shared/ui.
|
|
6
|
+
import { g as getTemplates, d as defaultOptions, r as resolveColors, a as getDefaultUiConfig } from './shared/ui.i6pGHFq6.mjs';
|
|
7
7
|
import { globSync } from 'tinyglobby';
|
|
8
8
|
import { genSafeVariableName } from 'knitwork';
|
|
9
9
|
import MagicString from 'magic-string';
|
|
@@ -88,14 +88,14 @@ ${plugins.map((p) => ` app.use(${genSafeVariableName(p)})`).join("\n")}
|
|
|
88
88
|
|
|
89
89
|
function AppConfigPlugin(options, appConfig) {
|
|
90
90
|
return {
|
|
91
|
-
name: "
|
|
91
|
+
name: "eslamdevui:ui:app-config",
|
|
92
92
|
enforce: "pre",
|
|
93
93
|
resolveId(id) {
|
|
94
94
|
if (id === "#build/app.config") {
|
|
95
|
-
return "virtual:
|
|
95
|
+
return "virtual:eslamdevui-ui-app-config";
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
|
-
loadInclude: (id) => id === "virtual:
|
|
98
|
+
loadInclude: (id) => id === "virtual:eslamdevui-ui-app-config",
|
|
99
99
|
load() {
|
|
100
100
|
return `
|
|
101
101
|
export default ${JSON.stringify(appConfig)}
|
|
@@ -149,7 +149,7 @@ function ComponentImportPlugin(options, meta) {
|
|
|
149
149
|
* <UIcon> and <ULink> currently.
|
|
150
150
|
*/
|
|
151
151
|
{
|
|
152
|
-
name: "
|
|
152
|
+
name: "eslamdevui:ui:components",
|
|
153
153
|
enforce: "pre",
|
|
154
154
|
resolveId(id, importer) {
|
|
155
155
|
if (!importer || !normalize(importer).includes(runtimeDir)) {
|
|
@@ -175,7 +175,7 @@ const RELATIVE_IMPORT_RE = /^\.{1,2}\//;
|
|
|
175
175
|
function NuxtEnvironmentPlugin(options) {
|
|
176
176
|
const stubPath = resolvePathSync(options.inertia ? "../runtime/inertia/stubs" : "../runtime/vue/stubs", { extensions: [".ts", ".mjs", ".js"], url: import.meta.url });
|
|
177
177
|
return {
|
|
178
|
-
name: "
|
|
178
|
+
name: "eslamdevui:ui",
|
|
179
179
|
enforce: "pre",
|
|
180
180
|
resolveId(id) {
|
|
181
181
|
if (id === "#imports") {
|
|
@@ -223,7 +223,7 @@ const NuxtUIPlugin = createUnplugin((_options = {}, meta) => {
|
|
|
223
223
|
TemplatePlugin(options, appConfig),
|
|
224
224
|
AppConfigPlugin(options, appConfig),
|
|
225
225
|
{
|
|
226
|
-
name: "
|
|
226
|
+
name: "eslamdevui:ui:plugins-duplication-detection",
|
|
227
227
|
vite: {
|
|
228
228
|
configResolved(config) {
|
|
229
229
|
const plugins = config.plugins || [];
|
package/dist/vite.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslamdevui/ui",
|
|
3
3
|
"description": "A UI Library for Modern Web Apps, powered by Vue & Tailwind CSS.",
|
|
4
|
-
"version": "3.
|
|
5
|
-
"packageManager": "pnpm@10.12.2",
|
|
4
|
+
"version": "3.3.0",
|
|
6
5
|
"repository": {
|
|
7
6
|
"type": "git",
|
|
8
7
|
"url": "git+https://github.com/MohamedEslam04/ui.git"
|
|
@@ -96,24 +95,6 @@
|
|
|
96
95
|
"cli",
|
|
97
96
|
"vue-plugin.d.ts"
|
|
98
97
|
],
|
|
99
|
-
"scripts": {
|
|
100
|
-
"build": "nuxt-module-build build",
|
|
101
|
-
"prepack": "pnpm build",
|
|
102
|
-
"dev": "nuxt dev playground --uiDev",
|
|
103
|
-
"dev:build": "nuxt build playground",
|
|
104
|
-
"dev:vue": "vite playground-vue -- --uiDev",
|
|
105
|
-
"dev:vue:build": "vite build playground-vue",
|
|
106
|
-
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playground && vite build playground-vue",
|
|
107
|
-
"docs": "nuxt dev docs --uiDev",
|
|
108
|
-
"docs:build": "nuxt build docs",
|
|
109
|
-
"lint": "eslint .",
|
|
110
|
-
"lint:fix": "eslint . --fix",
|
|
111
|
-
"typecheck": "vue-tsc --noEmit && nuxt typecheck playground && nuxt typecheck docs && cd playground-vue && vue-tsc --noEmit",
|
|
112
|
-
"test": "vitest",
|
|
113
|
-
"test:vue": "vitest -c vitest.vue.config.ts",
|
|
114
|
-
"release": "release-it",
|
|
115
|
-
"clean": "rm -rf dist .nuxt playground/.nuxt playground-vue/dist docs/.nuxt"
|
|
116
|
-
},
|
|
117
98
|
"dependencies": {
|
|
118
99
|
"@ai-sdk/vue": "^1.2.12",
|
|
119
100
|
"@iconify/vue": "^5.0.0",
|
|
@@ -222,19 +203,6 @@
|
|
|
222
203
|
"unimport": "4.1.1",
|
|
223
204
|
"unplugin": "^2.3.5"
|
|
224
205
|
},
|
|
225
|
-
"pnpm": {
|
|
226
|
-
"onlyBuiltDependencies": [
|
|
227
|
-
"better-sqlite3",
|
|
228
|
-
"puppeteer",
|
|
229
|
-
"sharp"
|
|
230
|
-
],
|
|
231
|
-
"ignoredBuiltDependencies": [
|
|
232
|
-
"@parcel/watcher",
|
|
233
|
-
"esbuild",
|
|
234
|
-
"vue-demi",
|
|
235
|
-
"workerd"
|
|
236
|
-
]
|
|
237
|
-
},
|
|
238
206
|
"keywords": [
|
|
239
207
|
"nuxt-ui",
|
|
240
208
|
"nuxt",
|
|
@@ -250,5 +218,22 @@
|
|
|
250
218
|
"tailwind",
|
|
251
219
|
"framework",
|
|
252
220
|
"ui-framework"
|
|
253
|
-
]
|
|
254
|
-
|
|
221
|
+
],
|
|
222
|
+
"scripts": {
|
|
223
|
+
"build": "nuxt-module-build build",
|
|
224
|
+
"dev": "nuxt dev playground --uiDev",
|
|
225
|
+
"dev:build": "nuxt build playground",
|
|
226
|
+
"dev:vue": "vite playground-vue -- --uiDev",
|
|
227
|
+
"dev:vue:build": "vite build playground-vue",
|
|
228
|
+
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playground && vite build playground-vue",
|
|
229
|
+
"docs": "nuxt dev docs --uiDev",
|
|
230
|
+
"docs:build": "nuxt build docs",
|
|
231
|
+
"lint": "eslint .",
|
|
232
|
+
"lint:fix": "eslint . --fix",
|
|
233
|
+
"typecheck": "vue-tsc --noEmit && nuxt typecheck playground && nuxt typecheck docs && cd playground-vue && vue-tsc --noEmit",
|
|
234
|
+
"test": "vitest",
|
|
235
|
+
"test:vue": "vitest -c vitest.vue.config.ts",
|
|
236
|
+
"release": "release-it",
|
|
237
|
+
"clean": "rm -rf dist .nuxt playground/.nuxt playground-vue/dist docs/.nuxt"
|
|
238
|
+
}
|
|
239
|
+
}
|