rimelight-components 1.3.3 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.d.mts +13 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +34 -1
- package/dist/runtime/components/app/ScrollToTop.vue +1 -1
- package/dist/runtime/components/backgrounds/FlickeringGrid.vue +9 -3
- package/dist/runtime/components/content/Callout.d.vue.ts +17 -0
- package/dist/runtime/components/content/Callout.vue +24 -0
- package/dist/runtime/components/content/Callout.vue.d.ts +17 -0
- package/dist/runtime/components/content/Section.d.vue.ts +18 -0
- package/dist/runtime/components/content/Section.vue +46 -0
- package/dist/runtime/components/content/Section.vue.d.ts +18 -0
- package/dist/types.d.mts +6 -2
- package/package.json +1 -1
package/dist/module.d.mts
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
2
|
|
|
3
|
+
interface CalloutOptions {
|
|
4
|
+
icon: string;
|
|
5
|
+
title: string;
|
|
6
|
+
}
|
|
3
7
|
interface ModuleOptions {
|
|
8
|
+
callouts: {
|
|
9
|
+
info: CalloutOptions;
|
|
10
|
+
success: CalloutOptions;
|
|
11
|
+
warning: CalloutOptions;
|
|
12
|
+
error: CalloutOptions;
|
|
13
|
+
commentary: CalloutOptions;
|
|
14
|
+
ideation: CalloutOptions;
|
|
15
|
+
source: CalloutOptions;
|
|
16
|
+
};
|
|
4
17
|
}
|
|
5
18
|
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
6
19
|
|
|
7
20
|
export { _default as default };
|
|
8
|
-
export type { ModuleOptions };
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
import { defineNuxtModule, createResolver, addComponentsDir, addImportsDir } from '@nuxt/kit';
|
|
2
2
|
|
|
3
|
+
const defaultOptions = {
|
|
4
|
+
callouts: {
|
|
5
|
+
info: {
|
|
6
|
+
icon: "lucide:shield-alert",
|
|
7
|
+
title: "Note"
|
|
8
|
+
},
|
|
9
|
+
success: {
|
|
10
|
+
icon: "lucide:circle-alert",
|
|
11
|
+
title: "Tip"
|
|
12
|
+
},
|
|
13
|
+
warning: {
|
|
14
|
+
icon: "lucide:triangle-alert",
|
|
15
|
+
title: "Warning"
|
|
16
|
+
},
|
|
17
|
+
error: {
|
|
18
|
+
icon: "lucide:octagon-alert",
|
|
19
|
+
title: "Danger"
|
|
20
|
+
},
|
|
21
|
+
commentary: {
|
|
22
|
+
icon: "lucide:message-circle-warning",
|
|
23
|
+
title: "Commentary"
|
|
24
|
+
},
|
|
25
|
+
ideation: {
|
|
26
|
+
icon: "lucide:badge-alert",
|
|
27
|
+
title: "Ideation"
|
|
28
|
+
},
|
|
29
|
+
source: {
|
|
30
|
+
icon: "lucide:book-alert",
|
|
31
|
+
title: "Creator's Remarks"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
3
35
|
const module = defineNuxtModule({
|
|
4
36
|
meta: {
|
|
5
37
|
name: "rimelight-components",
|
|
@@ -9,7 +41,7 @@ const module = defineNuxtModule({
|
|
|
9
41
|
nuxt: ">=4.0.0"
|
|
10
42
|
}
|
|
11
43
|
},
|
|
12
|
-
defaults:
|
|
44
|
+
defaults: defaultOptions,
|
|
13
45
|
hooks: {},
|
|
14
46
|
moduleDependencies: {
|
|
15
47
|
"@nuxt/image": {
|
|
@@ -55,6 +87,7 @@ const module = defineNuxtModule({
|
|
|
55
87
|
},
|
|
56
88
|
setup(options, nuxt) {
|
|
57
89
|
const resolver = createResolver(import.meta.url);
|
|
90
|
+
nuxt.options.appConfig.rimelightComponents = options;
|
|
58
91
|
addComponentsDir({
|
|
59
92
|
path: resolver.resolve("./runtime/components/"),
|
|
60
93
|
pathPrefix: false,
|
|
@@ -55,7 +55,7 @@ const durationInSeconds = computed(() => `${props.duration}s`);
|
|
|
55
55
|
<div v-if="isVisible">
|
|
56
56
|
<UButton
|
|
57
57
|
variant="ghost"
|
|
58
|
-
class="fixed
|
|
58
|
+
class="fixed bottom-4 right-4 z-50 size-20 lg:size-16"
|
|
59
59
|
@click="scrollToTop"
|
|
60
60
|
>
|
|
61
61
|
<div class="progress-circle-base size-full">
|
|
@@ -100,9 +100,15 @@ onMounted(() => {
|
|
|
100
100
|
updateCanvasSize();
|
|
101
101
|
});
|
|
102
102
|
intersectionObserver = new IntersectionObserver(
|
|
103
|
-
(
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
(entries) => {
|
|
104
|
+
const entry = entries[0];
|
|
105
|
+
if (entry) {
|
|
106
|
+
isInView.value = entry.isIntersecting;
|
|
107
|
+
if (isInView.value && !animationFrameId) {
|
|
108
|
+
lastTime = performance.now();
|
|
109
|
+
animationFrameId = requestAnimationFrame(animate);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
106
112
|
},
|
|
107
113
|
{ threshold: 0 }
|
|
108
114
|
);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type CalloutVariant = "info" | "success" | "warning" | "error" | "commentary" | "ideation" | "source";
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
variant: CalloutVariant;
|
|
4
|
+
};
|
|
5
|
+
declare var __VLS_8: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
default?: (props: typeof __VLS_8) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useAppConfig } from "nuxt/app";
|
|
3
|
+
import { computed } from "#imports";
|
|
4
|
+
const appConfig = useAppConfig();
|
|
5
|
+
const { variant } = defineProps({
|
|
6
|
+
variant: { type: String, required: true }
|
|
7
|
+
});
|
|
8
|
+
const config = computed(() => {
|
|
9
|
+
return appConfig.rimelightComponents?.callouts?.[variant] ?? {
|
|
10
|
+
icon: "lucide:alert-circle",
|
|
11
|
+
title: "Unknown"
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
const icon = computed(() => config.value.icon);
|
|
15
|
+
const title = computed(() => config.value.title);
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<UAlert :icon="icon" :title="title" :color="variant" variant="subtle">
|
|
20
|
+
<template #description>
|
|
21
|
+
<slot />
|
|
22
|
+
</template>
|
|
23
|
+
</UAlert>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type CalloutVariant = "info" | "success" | "warning" | "error" | "commentary" | "ideation" | "source";
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
variant: CalloutVariant;
|
|
4
|
+
};
|
|
5
|
+
declare var __VLS_8: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
default?: (props: typeof __VLS_8) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type SectionLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
level?: SectionLevel;
|
|
4
|
+
title: string;
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_11: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_11) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { tv } from "tailwind-variants";
|
|
3
|
+
const sectionVariants = tv({
|
|
4
|
+
slots: {
|
|
5
|
+
sectionSlot: "flex flex-col gap-md lg:gap-lg",
|
|
6
|
+
headingSlot: ""
|
|
7
|
+
},
|
|
8
|
+
variants: {
|
|
9
|
+
level: {
|
|
10
|
+
1: {
|
|
11
|
+
headingSlot: "text-4xl font-bold"
|
|
12
|
+
},
|
|
13
|
+
2: {
|
|
14
|
+
headingSlot: "text-3xl font-bold"
|
|
15
|
+
},
|
|
16
|
+
3: {
|
|
17
|
+
headingSlot: "text-2xl font-bold"
|
|
18
|
+
},
|
|
19
|
+
4: {
|
|
20
|
+
headingSlot: "text-xl font-bold"
|
|
21
|
+
},
|
|
22
|
+
5: {
|
|
23
|
+
headingSlot: "text-lg font-bold"
|
|
24
|
+
},
|
|
25
|
+
6: {
|
|
26
|
+
headingSlot: "text-base font-bold"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const { level = 1 } = defineProps({
|
|
32
|
+
level: { type: Number, required: false },
|
|
33
|
+
title: { type: String, required: true }
|
|
34
|
+
});
|
|
35
|
+
const { sectionSlot, headingSlot } = sectionVariants({ level });
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
<section :class="sectionSlot()" v-bind="$attrs">
|
|
40
|
+
<component :is="`h${level}`" :class="headingSlot()">
|
|
41
|
+
{{ title }}
|
|
42
|
+
</component>
|
|
43
|
+
<USeparator />
|
|
44
|
+
<slot />
|
|
45
|
+
</section>
|
|
46
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type SectionLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
level?: SectionLevel;
|
|
4
|
+
title: string;
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_11: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_11) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
package/dist/types.d.mts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import type { NuxtModule } from '@nuxt/schema'
|
|
2
|
+
|
|
3
|
+
import type { default as Module } from './module.mjs'
|
|
2
4
|
|
|
3
|
-
export
|
|
5
|
+
export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
|
|
6
|
+
|
|
7
|
+
export { default } from './module.mjs'
|