rimelight-components 2.1.17 → 2.1.19
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/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/app/Footer.d.vue.ts +18 -9
- package/dist/runtime/components/app/Footer.vue +25 -12
- package/dist/runtime/components/app/Footer.vue.d.ts +18 -9
- package/dist/runtime/components/app/Header.d.vue.ts +24 -15
- package/dist/runtime/components/app/Header.vue +18 -11
- package/dist/runtime/components/app/Header.vue.d.ts +24 -15
- package/dist/runtime/components/app/HeaderLayer.d.vue.ts +13 -7
- package/dist/runtime/components/app/HeaderLayer.vue +21 -9
- package/dist/runtime/components/app/HeaderLayer.vue.d.ts +13 -7
- package/dist/runtime/components/app/Image.d.vue.ts +18 -4
- package/dist/runtime/components/app/Image.vue +34 -16
- package/dist/runtime/components/app/Image.vue.d.ts +18 -4
- package/dist/runtime/components/app/Logo.d.vue.ts +17 -3
- package/dist/runtime/components/app/Logo.vue +16 -4
- package/dist/runtime/components/app/Logo.vue.d.ts +17 -3
- package/dist/runtime/components/app/NewsletterSignup.d.vue.ts +17 -3
- package/dist/runtime/components/app/NewsletterSignup.vue +16 -3
- package/dist/runtime/components/app/NewsletterSignup.vue.d.ts +17 -3
- package/dist/runtime/components/app/ScrollToTop.d.vue.ts +20 -5
- package/dist/runtime/components/app/ScrollToTop.vue +31 -15
- package/dist/runtime/components/app/ScrollToTop.vue.d.ts +20 -5
- package/dist/runtime/components/blocks/Block.d.vue.ts +13 -7
- package/dist/runtime/components/blocks/Block.vue +20 -7
- package/dist/runtime/components/blocks/Block.vue.d.ts +13 -7
- package/dist/runtime/components/blocks/BlockEditRenderer.d.vue.ts +17 -3
- package/dist/runtime/components/blocks/BlockEditRenderer.vue +15 -3
- package/dist/runtime/components/blocks/BlockEditRenderer.vue.d.ts +17 -3
- package/dist/runtime/components/blocks/BlockEditor.d.vue.ts +13 -4
- package/dist/runtime/components/blocks/BlockEditor.vue +11 -35
- package/dist/runtime/components/blocks/BlockEditor.vue.d.ts +13 -4
- package/dist/runtime/components/blocks/BlockViewRenderer.d.vue.ts +17 -3
- package/dist/runtime/components/blocks/BlockViewRenderer.vue +15 -3
- package/dist/runtime/components/blocks/BlockViewRenderer.vue.d.ts +17 -3
- package/dist/runtime/components/blocks/TextRenderer.d.vue.ts +17 -3
- package/dist/runtime/components/blocks/TextRenderer.vue +19 -5
- package/dist/runtime/components/blocks/TextRenderer.vue.d.ts +17 -3
- package/dist/runtime/components/blocks/editor/CalloutBlockEditor.d.vue.ts +17 -1
- package/dist/runtime/components/blocks/editor/CalloutBlockEditor.vue +18 -4
- package/dist/runtime/components/blocks/editor/CalloutBlockEditor.vue.d.ts +17 -1
- package/dist/runtime/components/blocks/editor/CardBlockEditor.d.vue.ts +17 -1
- package/dist/runtime/components/blocks/editor/CardBlockEditor.vue +14 -2
- package/dist/runtime/components/blocks/editor/CardBlockEditor.vue.d.ts +17 -1
- package/dist/runtime/components/blocks/editor/ImageBlockEditor.d.vue.ts +27 -3
- package/dist/runtime/components/blocks/editor/ImageBlockEditor.vue +25 -9
- package/dist/runtime/components/blocks/editor/ImageBlockEditor.vue.d.ts +27 -3
- package/dist/runtime/components/blocks/editor/ParagraphBlockEditor.d.vue.ts +17 -3
- package/dist/runtime/components/blocks/editor/ParagraphBlockEditor.vue +21 -13
- package/dist/runtime/components/blocks/editor/ParagraphBlockEditor.vue.d.ts +17 -3
- package/dist/runtime/components/blocks/editor/SectionBlockEditor.d.vue.ts +19 -3
- package/dist/runtime/components/blocks/editor/SectionBlockEditor.vue +20 -6
- package/dist/runtime/components/blocks/editor/SectionBlockEditor.vue.d.ts +19 -3
- package/dist/runtime/components/blocks/editor/TestBlockEditor.d.vue.ts +17 -3
- package/dist/runtime/components/blocks/editor/TestBlockEditor.vue +16 -4
- package/dist/runtime/components/blocks/editor/TestBlockEditor.vue.d.ts +17 -3
- package/dist/runtime/components/blocks/renderer/CalloutBlockRenderer.d.vue.ts +17 -1
- package/dist/runtime/components/blocks/renderer/CalloutBlockRenderer.vue +18 -4
- package/dist/runtime/components/blocks/renderer/CalloutBlockRenderer.vue.d.ts +17 -1
- package/dist/runtime/components/blocks/renderer/CardBlockRenderer.d.vue.ts +17 -1
- package/dist/runtime/components/blocks/renderer/CardBlockRenderer.vue +14 -2
- package/dist/runtime/components/blocks/renderer/CardBlockRenderer.vue.d.ts +17 -1
- package/dist/runtime/components/blocks/renderer/ImageBlockRenderer.d.vue.ts +19 -1
- package/dist/runtime/components/blocks/renderer/ImageBlockRenderer.vue +18 -4
- package/dist/runtime/components/blocks/renderer/ImageBlockRenderer.vue.d.ts +19 -1
- package/dist/runtime/components/blocks/renderer/ParagraphBlockRenderer.d.vue.ts +17 -1
- package/dist/runtime/components/blocks/renderer/ParagraphBlockRenderer.vue +16 -2
- package/dist/runtime/components/blocks/renderer/ParagraphBlockRenderer.vue.d.ts +17 -1
- package/dist/runtime/components/blocks/renderer/SectionBlockRenderer.d.vue.ts +17 -1
- package/dist/runtime/components/blocks/renderer/SectionBlockRenderer.vue +18 -4
- package/dist/runtime/components/blocks/renderer/SectionBlockRenderer.vue.d.ts +17 -1
- package/dist/runtime/components/blocks/renderer/TestBlockRenderer.d.vue.ts +17 -1
- package/dist/runtime/components/blocks/renderer/TestBlockRenderer.vue +16 -2
- package/dist/runtime/components/blocks/renderer/TestBlockRenderer.vue.d.ts +17 -1
- package/dist/runtime/components/cards/TeamCard.d.vue.ts +16 -7
- package/dist/runtime/components/cards/TeamCard.vue +29 -7
- package/dist/runtime/components/cards/TeamCard.vue.d.ts +16 -7
- package/dist/runtime/components/content/Callout.d.vue.ts +13 -7
- package/dist/runtime/components/content/Callout.vue +19 -6
- package/dist/runtime/components/content/Callout.vue.d.ts +13 -7
- package/dist/runtime/components/content/Section.d.vue.ts +19 -13
- package/dist/runtime/components/content/Section.vue +93 -87
- package/dist/runtime/components/content/Section.vue.d.ts +19 -13
- package/dist/runtime/components/content/Test.d.vue.ts +12 -7
- package/dist/runtime/components/content/Test.vue +15 -3
- package/dist/runtime/components/content/Test.vue.d.ts +12 -7
- package/dist/runtime/components/nodes/LinkNode.d.vue.ts +17 -3
- package/dist/runtime/components/nodes/LinkNode.vue +17 -3
- package/dist/runtime/components/nodes/LinkNode.vue.d.ts +17 -3
- package/dist/runtime/components/nodes/TextNode.d.vue.ts +17 -3
- package/dist/runtime/components/nodes/TextNode.vue +15 -3
- package/dist/runtime/components/nodes/TextNode.vue.d.ts +17 -3
- package/dist/runtime/components/page/PageEditor.d.vue.ts +35 -5
- package/dist/runtime/components/page/PageEditor.vue +80 -31
- package/dist/runtime/components/page/PageEditor.vue.d.ts +35 -5
- package/dist/runtime/components/page/PageMention.d.vue.ts +19 -2
- package/dist/runtime/components/page/PageMention.vue +21 -6
- package/dist/runtime/components/page/PageMention.vue.d.ts +19 -2
- package/dist/runtime/components/page/PagePropertiesEditor.d.vue.ts +30 -2
- package/dist/runtime/components/page/PagePropertiesEditor.vue +113 -76
- package/dist/runtime/components/page/PagePropertiesEditor.vue.d.ts +30 -2
- package/dist/runtime/components/page/PagePropertiesRenderer.d.vue.ts +38 -2
- package/dist/runtime/components/page/PagePropertiesRenderer.vue +80 -29
- package/dist/runtime/components/page/PagePropertiesRenderer.vue.d.ts +38 -2
- package/dist/runtime/components/page/PageRenderer.d.vue.ts +26 -2
- package/dist/runtime/components/page/PageRenderer.vue +56 -18
- package/dist/runtime/components/page/PageRenderer.vue.d.ts +26 -2
- package/dist/runtime/components/page/PageSurround.d.vue.ts +25 -3
- package/dist/runtime/components/page/PageSurround.vue +61 -26
- package/dist/runtime/components/page/PageSurround.vue.d.ts +25 -3
- package/dist/runtime/components/page/PageTOC.d.vue.ts +15 -7
- package/dist/runtime/components/page/PageTOC.vue +23 -9
- package/dist/runtime/components/page/PageTOC.vue.d.ts +15 -7
- package/dist/runtime/components/page/modals/CreatePageModal.d.vue.ts +12 -4
- package/dist/runtime/components/page/modals/CreatePageModal.vue +34 -24
- package/dist/runtime/components/page/modals/CreatePageModal.vue.d.ts +12 -4
- package/dist/runtime/components/page/modals/DeletePageModal.d.vue.ts +14 -7
- package/dist/runtime/components/page/modals/DeletePageModal.vue +28 -7
- package/dist/runtime/components/page/modals/DeletePageModal.vue.d.ts +14 -7
- package/dist/runtime/components/swatches/ColorSwatch.d.vue.ts +23 -3
- package/dist/runtime/components/swatches/ColorSwatch.vue +41 -15
- package/dist/runtime/components/swatches/ColorSwatch.vue.d.ts +23 -3
- package/dist/runtime/components/swatches/FontSwatch.d.vue.ts +22 -3
- package/dist/runtime/components/swatches/FontSwatch.vue +29 -12
- package/dist/runtime/components/swatches/FontSwatch.vue.d.ts +22 -3
- package/dist/runtime/components/swatches/ImageSwatch.d.vue.ts +22 -3
- package/dist/runtime/components/swatches/ImageSwatch.vue +29 -12
- package/dist/runtime/components/swatches/ImageSwatch.vue.d.ts +22 -3
- package/dist/runtime/components/utilities/Placeholder.d.vue.ts +13 -5
- package/dist/runtime/components/utilities/Placeholder.vue +19 -5
- package/dist/runtime/components/utilities/Placeholder.vue.d.ts +13 -5
- package/dist/runtime/composables/index.d.ts +1 -0
- package/dist/runtime/composables/index.js +1 -0
- package/dist/runtime/composables/index.mjs +1 -0
- package/dist/runtime/composables/useRC.d.ts +3 -0
- package/dist/runtime/composables/useRC.js +14 -0
- package/dist/runtime/composables/useRC.mjs +14 -0
- package/dist/runtime/types/app.config.d.ts +6 -0
- package/dist/runtime/types/schemas.d.ts +2 -2
- package/dist/runtime/types/tv.d.ts +66 -0
- package/dist/runtime/types/tv.js +0 -0
- package/dist/runtime/types/tv.mjs +0 -0
- package/dist/runtime/utils/index.d.ts +1 -0
- package/dist/runtime/utils/index.js +1 -0
- package/dist/runtime/utils/index.mjs +1 -0
- package/dist/runtime/utils/tv.d.ts +1 -0
- package/dist/runtime/utils/tv.js +4 -0
- package/dist/runtime/utils/tv.mjs +4 -0
- package/package.json +1 -1
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed } from "
|
|
3
|
-
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { tv } from "../../utils/tv";
|
|
4
|
+
import { useRC } from "../../composables/useRC";
|
|
5
|
+
const { name, jpg, png, webp, svg, rc: rcProp } = defineProps({
|
|
4
6
|
name: { type: String, required: false },
|
|
5
7
|
jpg: { type: String, required: false },
|
|
6
8
|
png: { type: String, required: false },
|
|
7
9
|
webp: { type: String, required: false },
|
|
8
|
-
svg: { type: String, required: false }
|
|
10
|
+
svg: { type: String, required: false },
|
|
11
|
+
rc: { type: Object, required: false }
|
|
9
12
|
});
|
|
13
|
+
const emit = defineEmits([]);
|
|
14
|
+
const slots = defineSlots();
|
|
15
|
+
const { rc } = useRC("ImageSwatch", rcProp);
|
|
16
|
+
const imageSwatchStyles = tv({
|
|
17
|
+
slots: {
|
|
18
|
+
card: "w-full rounded-none xl:w-fit",
|
|
19
|
+
title: "text-lg font-bold",
|
|
20
|
+
content: "flex flex-col items-center gap-sm xl:flex-row xl:items-start",
|
|
21
|
+
image: "size-48",
|
|
22
|
+
buttonGroup: "flex w-full flex-col justify-center gap-sm",
|
|
23
|
+
button: "w-full xl:w-36"
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
const { card, title: titleStyle, content, image: imageStyle, buttonGroup, button } = imageSwatchStyles();
|
|
10
27
|
const image = computed(() => {
|
|
11
28
|
if (webp) return webp;
|
|
12
29
|
if (png) return png;
|
|
@@ -17,20 +34,20 @@ const image = computed(() => {
|
|
|
17
34
|
</script>
|
|
18
35
|
|
|
19
36
|
<template>
|
|
20
|
-
<UCard variant="subtle" class="
|
|
37
|
+
<UCard variant="subtle" :class="card({ class: rc.card })">
|
|
21
38
|
<template #header v-if="name">
|
|
22
|
-
<h3 class="
|
|
39
|
+
<h3 :class="titleStyle({ class: rc.title })">{{ name }}</h3>
|
|
23
40
|
</template>
|
|
24
|
-
<div class="
|
|
25
|
-
<NuxtImg :src="image" class="
|
|
26
|
-
<div class="
|
|
41
|
+
<div :class="content({ class: rc.content })">
|
|
42
|
+
<NuxtImg :src="image" :class="imageStyle({ class: rc.image })" />
|
|
43
|
+
<div :class="buttonGroup({ class: rc.buttonGroup })">
|
|
27
44
|
<UButton
|
|
28
45
|
v-if="jpg"
|
|
29
46
|
variant="outline"
|
|
30
47
|
size="sm"
|
|
31
48
|
icon="lucide:download"
|
|
32
49
|
label="Download JPG"
|
|
33
|
-
class="
|
|
50
|
+
:class="button({ class: rc.button })"
|
|
34
51
|
:to="jpg"
|
|
35
52
|
target="_blank"
|
|
36
53
|
/>
|
|
@@ -40,7 +57,7 @@ const image = computed(() => {
|
|
|
40
57
|
size="sm"
|
|
41
58
|
icon="lucide:download"
|
|
42
59
|
label="Download PNG"
|
|
43
|
-
class="
|
|
60
|
+
:class="button({ class: rc.button })"
|
|
44
61
|
:to="png"
|
|
45
62
|
target="_blank"
|
|
46
63
|
/>
|
|
@@ -50,7 +67,7 @@ const image = computed(() => {
|
|
|
50
67
|
size="sm"
|
|
51
68
|
icon="lucide:download"
|
|
52
69
|
label="Download WEBP"
|
|
53
|
-
class="
|
|
70
|
+
:class="button({ class: rc.button })"
|
|
54
71
|
:to="webp"
|
|
55
72
|
target="_blank"
|
|
56
73
|
/>
|
|
@@ -60,7 +77,7 @@ const image = computed(() => {
|
|
|
60
77
|
size="sm"
|
|
61
78
|
icon="lucide:download"
|
|
62
79
|
label="Download SVG"
|
|
63
|
-
class="
|
|
80
|
+
:class="button({ class: rc.button })"
|
|
64
81
|
:to="svg"
|
|
65
82
|
target="_blank"
|
|
66
83
|
/>
|
|
@@ -1,10 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
export interface ImageSwatchProps {
|
|
2
2
|
name?: string;
|
|
3
3
|
jpg?: string;
|
|
4
4
|
png?: string;
|
|
5
5
|
webp?: string;
|
|
6
6
|
svg?: string;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
rc?: {
|
|
8
|
+
card?: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
content?: string;
|
|
11
|
+
image?: string;
|
|
12
|
+
buttonGroup?: string;
|
|
13
|
+
button?: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface ImageSwatchEmits {
|
|
17
|
+
}
|
|
18
|
+
export interface ImageSwatchSlots {
|
|
19
|
+
}
|
|
20
|
+
type __VLS_Slots = ImageSwatchSlots;
|
|
21
|
+
declare const __VLS_base: import("vue").DefineComponent<ImageSwatchProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ImageSwatchProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
9
23
|
declare const _default: typeof __VLS_export;
|
|
10
24
|
export default _default;
|
|
25
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
26
|
+
new (): {
|
|
27
|
+
$slots: S;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
export interface PlaceholderProps {
|
|
2
|
+
rc?: {
|
|
3
|
+
base?: string;
|
|
4
|
+
svg?: string;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
export interface PlaceholderEmits {
|
|
8
|
+
}
|
|
9
|
+
export interface PlaceholderSlots {
|
|
10
|
+
default: (props: {}) => any;
|
|
11
|
+
}
|
|
12
|
+
type __VLS_Slots = PlaceholderSlots;
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<PlaceholderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PlaceholderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
14
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
15
|
declare const _default: typeof __VLS_export;
|
|
8
16
|
export default _default;
|
|
@@ -1,10 +1,24 @@
|
|
|
1
|
-
<script setup
|
|
1
|
+
<script setup>
|
|
2
|
+
import { tv } from "../../utils/tv";
|
|
3
|
+
import { useRC } from "../../composables/useRC";
|
|
4
|
+
const { rc: rcProp } = defineProps({
|
|
5
|
+
rc: { type: Object, required: false }
|
|
6
|
+
});
|
|
7
|
+
const emit = defineEmits([]);
|
|
8
|
+
const slots = defineSlots();
|
|
9
|
+
const { rc } = useRC("Placeholder", rcProp);
|
|
10
|
+
const placeholderStyles = tv({
|
|
11
|
+
slots: {
|
|
12
|
+
base: "relative flex items-center justify-center overflow-hidden rounded-sm border border-dashed border-accented px-4 opacity-75",
|
|
13
|
+
svg: "absolute inset-0 h-full w-full stroke-inverted/10"
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
const { base, svg } = placeholderStyles();
|
|
17
|
+
</script>
|
|
2
18
|
|
|
3
19
|
<template>
|
|
4
|
-
<div
|
|
5
|
-
class="
|
|
6
|
-
>
|
|
7
|
-
<svg class="absolute inset-0 h-full w-full stroke-inverted/10">
|
|
20
|
+
<div :class="base({ class: rc.base })">
|
|
21
|
+
<svg :class="svg({ class: rc.svg })">
|
|
8
22
|
<defs>
|
|
9
23
|
<pattern
|
|
10
24
|
id="pattern-5c1e4f0e-62d5-498b-8ff0-cf77bb448c8e"
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
export interface PlaceholderProps {
|
|
2
|
+
rc?: {
|
|
3
|
+
base?: string;
|
|
4
|
+
svg?: string;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
export interface PlaceholderEmits {
|
|
8
|
+
}
|
|
9
|
+
export interface PlaceholderSlots {
|
|
10
|
+
default: (props: {}) => any;
|
|
11
|
+
}
|
|
12
|
+
type __VLS_Slots = PlaceholderSlots;
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<PlaceholderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PlaceholderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
14
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
15
|
declare const _default: typeof __VLS_export;
|
|
8
16
|
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function useRC<T extends Record<string, any>>(namespace: string, propsProp: T | undefined): {
|
|
2
|
+
rc: import("vue").ComputedRef<T | (T extends any ? T : Omit<T, keyof T & (string | number | symbol)> & Omit<any, keyof T & (string | number | symbol)> & { -readonly [Key in keyof T & (string | number | symbol)]: T[Key] extends void | null | undefined ? any : T[Key] | (T[Key] extends infer T_1 ? T_1 extends T[Key] ? T_1 extends void | null | undefined ? any : T_1 | (T_1 extends any[] ? any : T_1 extends Function ? any : T_1 extends RegExp ? any : T_1 extends Promise<any> ? any : any) : never : never); })>;
|
|
3
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
import { useAppConfig } from "#imports";
|
|
3
|
+
import { defu } from "defu";
|
|
4
|
+
export function useRC(namespace, propsProp) {
|
|
5
|
+
const appConfig = useAppConfig();
|
|
6
|
+
const rc = computed(() => {
|
|
7
|
+
const config = appConfig.rimelightComponents || {};
|
|
8
|
+
const conf = config[namespace] || config[namespace.toLowerCase()] || {};
|
|
9
|
+
return defu(propsProp || {}, conf.slots || conf);
|
|
10
|
+
});
|
|
11
|
+
return {
|
|
12
|
+
rc
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
import { useAppConfig } from "#imports";
|
|
3
|
+
import { defu } from "defu";
|
|
4
|
+
export function useRC(namespace, propsProp) {
|
|
5
|
+
const appConfig = useAppConfig();
|
|
6
|
+
const rc = computed(() => {
|
|
7
|
+
const config = appConfig.rimelightComponents || {};
|
|
8
|
+
const conf = config[namespace] || config[namespace.toLowerCase()] || {};
|
|
9
|
+
return defu(propsProp || {}, conf.slots || conf);
|
|
10
|
+
});
|
|
11
|
+
return {
|
|
12
|
+
rc
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -5,12 +5,12 @@ import { type Localized } from "./index.js";
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const LocalizedSchema: <T extends z.ZodTypeAny>(schema: T) => z.ZodType<Localized<z.infer<T>>>;
|
|
7
7
|
export declare const linkVariantEnum: z.ZodEnum<{
|
|
8
|
-
link: "link";
|
|
9
8
|
solid: "solid";
|
|
10
9
|
outline: "outline";
|
|
11
10
|
soft: "soft";
|
|
12
11
|
subtle: "subtle";
|
|
13
12
|
ghost: "ghost";
|
|
13
|
+
link: "link";
|
|
14
14
|
}>;
|
|
15
15
|
export declare const linkColorEnum: z.ZodEnum<{
|
|
16
16
|
primary: "primary";
|
|
@@ -44,12 +44,12 @@ export declare const LinkSchema: z.ZodObject<{
|
|
|
44
44
|
error: "error";
|
|
45
45
|
}>>;
|
|
46
46
|
variant: z.ZodOptional<z.ZodEnum<{
|
|
47
|
-
link: "link";
|
|
48
47
|
solid: "solid";
|
|
49
48
|
outline: "outline";
|
|
50
49
|
soft: "soft";
|
|
51
50
|
subtle: "subtle";
|
|
52
51
|
ghost: "ghost";
|
|
52
|
+
link: "link";
|
|
53
53
|
}>>;
|
|
54
54
|
}, z.core.$strip>;
|
|
55
55
|
export type Link = z.infer<typeof LinkSchema>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { ClassValue, TVVariants, TVCompoundVariants, TVDefaultVariants } from 'tailwind-variants';
|
|
2
|
+
/**
|
|
3
|
+
* Defines the AppConfig object based on the tailwind-variants configuration.
|
|
4
|
+
*/
|
|
5
|
+
export type TVConfig<T extends Record<string, any>> = {
|
|
6
|
+
[P in keyof T]?: {
|
|
7
|
+
[K in keyof T[P] as K extends 'base' | 'slots' | 'variants' | 'defaultVariants' ? K : never]?: K extends 'base' ? ClassValue : K extends 'slots' ? {
|
|
8
|
+
[S in keyof T[P]['slots']]?: ClassValue;
|
|
9
|
+
} : K extends 'variants' ? TVVariants<T[P]['slots'], ClassValue, WidenVariantsValues<T[P]['variants']>> : K extends 'defaultVariants' ? TVDefaultVariants<WidenVariantsValues<T[P]['variants']>, T[P]['slots'], object, undefined> : never;
|
|
10
|
+
};
|
|
11
|
+
} & {
|
|
12
|
+
[P in keyof T]?: {
|
|
13
|
+
compoundVariants?: TVCompoundVariants<WidenVariantsValues<T[P]['variants']>, T[P]['slots'], ClassValue, object, undefined>;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
type WidenVariantsValues<V extends Record<string, any> | undefined> = V extends Record<string, any> ? V & {
|
|
17
|
+
[K in keyof V]: V[K] extends Record<string, any> ? V[K] & Record<string & {}, any> : V[K];
|
|
18
|
+
} : V;
|
|
19
|
+
/**
|
|
20
|
+
* Utility type to flatten intersection types for better IDE hover information.
|
|
21
|
+
* @template T The type to flatten.
|
|
22
|
+
*/
|
|
23
|
+
type Id<T> = {} & {
|
|
24
|
+
[P in keyof T]: T[P];
|
|
25
|
+
};
|
|
26
|
+
type ComponentVariants<T extends {
|
|
27
|
+
variants?: Record<string, Record<string, any>>;
|
|
28
|
+
}> = {
|
|
29
|
+
[K in keyof T['variants']]: keyof T['variants'][K];
|
|
30
|
+
};
|
|
31
|
+
type ComponentSlots<T extends {
|
|
32
|
+
slots?: Record<string, any>;
|
|
33
|
+
}> = Id<{
|
|
34
|
+
[K in keyof T['slots']]?: ClassValue;
|
|
35
|
+
}>;
|
|
36
|
+
type ComponentUI<T extends {
|
|
37
|
+
slots?: Record<string, any>;
|
|
38
|
+
}> = Id<{
|
|
39
|
+
[K in keyof Required<T['slots']>]: (props?: Record<string, any>) => string;
|
|
40
|
+
}>;
|
|
41
|
+
type GetComponentAppConfig<A, U extends string, K extends string> = A extends Record<U, Record<K, any>> ? A[U][K] : {};
|
|
42
|
+
type ComponentAppConfig<T, A extends Record<string, any>, K extends string, U extends string = 'ui' | 'ui.prose'> = A & (U extends 'ui.prose' ? {
|
|
43
|
+
ui?: {
|
|
44
|
+
prose?: {
|
|
45
|
+
[k in K]?: Partial<T>;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
} : {
|
|
49
|
+
[key in Exclude<U, 'ui.prose'>]?: {
|
|
50
|
+
[k in K]?: Partial<T>;
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* Defines the configuration shape expected for a component.
|
|
55
|
+
* @template T The component's theme imported from `#build/rimelight-components/*`.
|
|
56
|
+
* @template A The base AppConfig type from `@nuxt/schema`.
|
|
57
|
+
* @template K The key identifying the component (e.g., 'badge').
|
|
58
|
+
* @template U The top-level key in AppConfig ('rimelightComponents').
|
|
59
|
+
*/
|
|
60
|
+
export type ComponentConfig<T extends Record<string, any>, A extends Record<string, any>, K extends string, U extends 'rimelightComponents'> = {
|
|
61
|
+
AppConfig: ComponentAppConfig<T, A, K, U>;
|
|
62
|
+
variants: ComponentVariants<T & GetComponentAppConfig<A, U, K>>;
|
|
63
|
+
slots: ComponentSlots<T>;
|
|
64
|
+
ui: ComponentUI<T>;
|
|
65
|
+
};
|
|
66
|
+
export {};
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const tv: import("tailwind-variants").TV;
|