@rimelight/ui 0.0.25 → 0.0.27
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/package.json +9 -7
- package/src/components/ThemeToggle.astro +2 -2
- package/src/components/astro/RLAButton.astro +104 -104
- package/src/components/astro/RLAEmbedYoutube.astro +188 -0
- package/src/components/astro/RLAFooter.astro +8 -8
- package/src/components/astro/RLAHeader.astro +8 -7
- package/src/components/astro/RLAIcon.astro +5 -5
- package/src/components/astro/RLALogo.astro +6 -5
- package/src/components/astro/RLAPlaceholder.astro +4 -3
- package/src/components/astro/RLAScrollToTop.astro +3 -3
- package/src/components/astro/RLASection.astro +210 -181
- package/src/components/vue/RLVButton.vue +7 -13
- package/src/components/vue/RLVFooter.vue +8 -8
- package/src/components/vue/RLVHeader.vue +9 -9
- package/src/components/vue/RLVIcon.vue +5 -10
- package/src/components/vue/RLVLogo.vue +4 -3
- package/src/components/vue/RLVPlaceholder.vue +4 -3
- package/src/components/vue/RLVScrollToTop.vue +3 -3
- package/src/components/vue/RLVSection.vue +102 -34
- package/src/themes/button.theme.ts +10 -10
- package/src/themes/section.theme.ts +37 -35
- package/src/types/componentVariant.ts +4 -0
|
@@ -1,181 +1,210 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { scv } from "css-variants"
|
|
3
|
-
import { useUi, resolveClasses } from "../../utils"
|
|
4
|
-
import type { ComponentVariants } from "../../types"
|
|
5
|
-
import sectionTheme from "../../themes/section.theme"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
>
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
)
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
1
|
+
---
|
|
2
|
+
import { scv } from "css-variants"
|
|
3
|
+
import { useUi, resolveClasses } from "../../utils"
|
|
4
|
+
import type { ComponentVariants, ComponentSlots } from "../../types"
|
|
5
|
+
import sectionTheme from "../../themes/section.theme"
|
|
6
|
+
import type { RLAIconProps } from "./RLAIcon.astro"
|
|
7
|
+
import type { RLAButtonProps } from "./RLAButton.astro"
|
|
8
|
+
import RLAIcon from "./RLAIcon.astro"
|
|
9
|
+
import RLAButton from "./RLAButton.astro"
|
|
10
|
+
|
|
11
|
+
const section = scv(sectionTheme)
|
|
12
|
+
type SectionVariants = ComponentVariants<typeof sectionTheme>
|
|
13
|
+
|
|
14
|
+
export interface RLASectionProps {
|
|
15
|
+
/**
|
|
16
|
+
* The element or component this component should render as.
|
|
17
|
+
* @default 'section'
|
|
18
|
+
*/
|
|
19
|
+
as?: any;
|
|
20
|
+
/**
|
|
21
|
+
* The variant of the section.
|
|
22
|
+
* @default 'default'
|
|
23
|
+
*/
|
|
24
|
+
variant?: SectionVariants['variant'];
|
|
25
|
+
/** The variant of the section when it's a CTA.
|
|
26
|
+
* @default 'solid'
|
|
27
|
+
*/
|
|
28
|
+
ctaVariant?: SectionVariants['ctaVariant'];
|
|
29
|
+
/**
|
|
30
|
+
* The headline displayed above the title.
|
|
31
|
+
*/
|
|
32
|
+
headline?: string;
|
|
33
|
+
/**
|
|
34
|
+
* The icon displayed above the title.
|
|
35
|
+
*/
|
|
36
|
+
icon?: RLAIconProps["name"];
|
|
37
|
+
/**
|
|
38
|
+
* The section's title, displayed as a <h1> for the hero variant or <h2> otherwise.
|
|
39
|
+
*/
|
|
40
|
+
title?: string;
|
|
41
|
+
/**
|
|
42
|
+
* The section's description, displayed under the title.
|
|
43
|
+
*/
|
|
44
|
+
description?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Display a list of buttons under the description.
|
|
47
|
+
*/
|
|
48
|
+
links?: RLAButtonProps[]
|
|
49
|
+
/**
|
|
50
|
+
* The orientation of the section.
|
|
51
|
+
* @default 'vertical'
|
|
52
|
+
*/
|
|
53
|
+
orientation?: SectionVariants['orientation'];
|
|
54
|
+
/**
|
|
55
|
+
* Reverse the order of the default slot.
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
reverse?: boolean;
|
|
59
|
+
ui?: ComponentSlots<typeof sectionTheme>;
|
|
60
|
+
class?: any;
|
|
61
|
+
[key: string]: unknown;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const {
|
|
65
|
+
as = "section",
|
|
66
|
+
variant = "default",
|
|
67
|
+
orientation = "vertical",
|
|
68
|
+
reverse = false,
|
|
69
|
+
ctaVariant = "solid",
|
|
70
|
+
ui: uiProp,
|
|
71
|
+
class: className,
|
|
72
|
+
...rest
|
|
73
|
+
} = Astro.props as RLASectionProps;
|
|
74
|
+
|
|
75
|
+
const classes = resolveClasses(section, {
|
|
76
|
+
variant,
|
|
77
|
+
orientation,
|
|
78
|
+
reverse,
|
|
79
|
+
...(variant === "cta" && { ctaVariant }),
|
|
80
|
+
headline: !!(Astro.slots.has("headline") || Astro.props.headline),
|
|
81
|
+
title: !!(Astro.slots.has("title") || Astro.props.title),
|
|
82
|
+
description: !!(Astro.slots.has("description") || Astro.props.description),
|
|
83
|
+
body: Astro.slots.has("body")
|
|
84
|
+
}, useUi("section", uiProp), className);
|
|
85
|
+
|
|
86
|
+
const hasDefaultSlot = Astro.slots.has("default");
|
|
87
|
+
|
|
88
|
+
const Tag = as;
|
|
89
|
+
const TitleTag = variant === "hero" ? "h1" : "h2";
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
<Tag
|
|
93
|
+
data-orientation={orientation}
|
|
94
|
+
data-slot="root"
|
|
95
|
+
class:list={[classes.root]}
|
|
96
|
+
{...rest}
|
|
97
|
+
>
|
|
98
|
+
{Astro.slots.has("background") && (
|
|
99
|
+
<div class:list={[classes.background]} data-slot="background">
|
|
100
|
+
<slot name="background" />
|
|
101
|
+
</div>
|
|
102
|
+
)}
|
|
103
|
+
|
|
104
|
+
<slot name="top" />
|
|
105
|
+
|
|
106
|
+
<div
|
|
107
|
+
data-slot="container"
|
|
108
|
+
class:list={[classes.container]}
|
|
109
|
+
>
|
|
110
|
+
{(Astro.slots.has("header") || Astro.props.icon || Astro.props.headline || Astro.props.title || Astro.props.description || Astro.slots.has("body") || Astro.slots.has("footer") || Astro.slots.has("links") || Astro.props.links?.length) && (
|
|
111
|
+
<div
|
|
112
|
+
data-slot="wrapper"
|
|
113
|
+
class:list={[classes.wrapper]}
|
|
114
|
+
>
|
|
115
|
+
{(Astro.slots.has("header") || Astro.props.icon || Astro.props.headline || Astro.props.title || Astro.props.description) && (
|
|
116
|
+
<div
|
|
117
|
+
data-slot="header"
|
|
118
|
+
class:list={[classes.header]}
|
|
119
|
+
>
|
|
120
|
+
<slot name="header">
|
|
121
|
+
{(Astro.props.icon || Astro.slots.has("leading")) && (
|
|
122
|
+
<div
|
|
123
|
+
data-slot="leading"
|
|
124
|
+
class:list={[classes.leading]}
|
|
125
|
+
>
|
|
126
|
+
<slot name="leading" {...{ ui: classes }}>
|
|
127
|
+
{Astro.props.icon && (
|
|
128
|
+
<RLAIcon name={Astro.props.icon} size="md" ui={{ root: classes.leadingIcon }} />
|
|
129
|
+
)}
|
|
130
|
+
</slot>
|
|
131
|
+
</div>
|
|
132
|
+
)}
|
|
133
|
+
|
|
134
|
+
{(Astro.props.headline || Astro.slots.has("headline")) && (
|
|
135
|
+
<div
|
|
136
|
+
data-slot="headline"
|
|
137
|
+
class:list={[classes.headline]}
|
|
138
|
+
>
|
|
139
|
+
<slot name="headline">
|
|
140
|
+
{Astro.props.headline}
|
|
141
|
+
</slot>
|
|
142
|
+
</div>
|
|
143
|
+
)}
|
|
144
|
+
|
|
145
|
+
{(Astro.props.title || Astro.slots.has("title")) && (
|
|
146
|
+
<TitleTag
|
|
147
|
+
data-slot="title"
|
|
148
|
+
class:list={[classes.title]}
|
|
149
|
+
>
|
|
150
|
+
<slot name="title">
|
|
151
|
+
{Astro.props.title}
|
|
152
|
+
</slot>
|
|
153
|
+
</TitleTag>
|
|
154
|
+
)}
|
|
155
|
+
|
|
156
|
+
{(Astro.props.description || Astro.slots.has("description")) && (
|
|
157
|
+
<div
|
|
158
|
+
data-slot="description"
|
|
159
|
+
class:list={[classes.description]}
|
|
160
|
+
>
|
|
161
|
+
<slot name="description">
|
|
162
|
+
{Astro.props.description}
|
|
163
|
+
</slot>
|
|
164
|
+
</div>
|
|
165
|
+
)}
|
|
166
|
+
</slot>
|
|
167
|
+
</div>
|
|
168
|
+
)}
|
|
169
|
+
|
|
170
|
+
{Astro.slots.has("body") && (
|
|
171
|
+
<div
|
|
172
|
+
data-slot="body"
|
|
173
|
+
class:list={[classes.body]}
|
|
174
|
+
>
|
|
175
|
+
<slot name="body" />
|
|
176
|
+
</div>
|
|
177
|
+
)}
|
|
178
|
+
|
|
179
|
+
{(Astro.slots.has("footer") || Astro.slots.has("links") || Astro.props.links?.length) && (
|
|
180
|
+
<div
|
|
181
|
+
data-slot="footer"
|
|
182
|
+
class:list={[classes.footer]}
|
|
183
|
+
>
|
|
184
|
+
<slot name="footer">
|
|
185
|
+
{(Astro.props.links?.length || Astro.slots.has("links")) && (
|
|
186
|
+
<div
|
|
187
|
+
data-slot="links"
|
|
188
|
+
class:list={[classes.links]}
|
|
189
|
+
>
|
|
190
|
+
{Astro.props.links?.map((link) => (
|
|
191
|
+
<RLAButton size="lg" {...link} />
|
|
192
|
+
))}
|
|
193
|
+
<slot name="links" />
|
|
194
|
+
</div>
|
|
195
|
+
)}
|
|
196
|
+
</slot>
|
|
197
|
+
</div>
|
|
198
|
+
)}
|
|
199
|
+
</div>
|
|
200
|
+
)}
|
|
201
|
+
|
|
202
|
+
{hasDefaultSlot ? (
|
|
203
|
+
<slot />
|
|
204
|
+
) : orientation === "horizontal" ? (
|
|
205
|
+
<div class="hidden lg:block" />
|
|
206
|
+
) : null}
|
|
207
|
+
</div>
|
|
208
|
+
|
|
209
|
+
<slot name="bottom" />
|
|
210
|
+
</Tag>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { computed, useSlots } from "vue"
|
|
3
3
|
import { scv } from "css-variants"
|
|
4
4
|
import { useUi, resolveClasses } from "../../utils"
|
|
5
|
-
import type { ComponentVariants } from "../../types"
|
|
5
|
+
import type { ComponentVariants, ComponentSlots } from "../../types"
|
|
6
6
|
import buttonTheme from "../../themes/button.theme"
|
|
7
7
|
|
|
8
8
|
const button = scv(buttonTheme)
|
|
@@ -64,8 +64,8 @@ export interface RLVButtonProps {
|
|
|
64
64
|
/**
|
|
65
65
|
* Component-specific CSS class overrides
|
|
66
66
|
*/
|
|
67
|
-
ui?:
|
|
68
|
-
class?:
|
|
67
|
+
ui?: ComponentSlots<typeof buttonTheme>
|
|
68
|
+
class?: any
|
|
69
69
|
[key: string]: unknown
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -73,8 +73,6 @@ const {
|
|
|
73
73
|
variant = "solid",
|
|
74
74
|
color = "primary",
|
|
75
75
|
size = "md",
|
|
76
|
-
class: className,
|
|
77
|
-
ui: uiProp,
|
|
78
76
|
href,
|
|
79
77
|
label,
|
|
80
78
|
leadingIcon,
|
|
@@ -84,7 +82,9 @@ const {
|
|
|
84
82
|
block = false,
|
|
85
83
|
active = false,
|
|
86
84
|
activeColor,
|
|
87
|
-
activeVariant
|
|
85
|
+
activeVariant,
|
|
86
|
+
ui: uiProp,
|
|
87
|
+
class: className
|
|
88
88
|
} = defineProps<RLVButtonProps>()
|
|
89
89
|
|
|
90
90
|
const slots = useSlots()
|
|
@@ -141,13 +141,7 @@ const Tag = href ? "a" : "button"
|
|
|
141
141
|
</script>
|
|
142
142
|
|
|
143
143
|
<template>
|
|
144
|
-
<component
|
|
145
|
-
v-bind="$attrs"
|
|
146
|
-
:is="Tag"
|
|
147
|
-
:href="href"
|
|
148
|
-
:class="resolvedClasses.root"
|
|
149
|
-
data-slot="rlv-button"
|
|
150
|
-
>
|
|
144
|
+
<component v-bind="$attrs" :is="Tag" :href="href" :class="resolvedClasses.root" data-slot="root">
|
|
151
145
|
<slot name="leading" :ui="resolvedClasses">
|
|
152
146
|
<span v-if="isLeading" :class="resolvedClasses.leadingIcon" data-slot="leading-icon">
|
|
153
147
|
<span :class="[showLeadingIcon, leadingIconClass]" aria-hidden="true" />
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { computed } from "vue"
|
|
3
3
|
import { scv } from "css-variants"
|
|
4
4
|
import { useUi, resolveClasses } from "../../utils"
|
|
5
|
-
import type { ComponentVariants } from "../../types"
|
|
5
|
+
import type { ComponentVariants, ComponentSlots } from "../../types"
|
|
6
6
|
import footerTheme from "../../themes/footer.theme"
|
|
7
7
|
|
|
8
8
|
const footer = scv(footerTheme)
|
|
@@ -10,11 +10,11 @@ type FooterVariants = ComponentVariants<typeof footerTheme>
|
|
|
10
10
|
|
|
11
11
|
export interface RLVFooterProps {
|
|
12
12
|
contain?: FooterVariants["contain"]
|
|
13
|
-
ui?:
|
|
14
|
-
class?:
|
|
13
|
+
ui?: ComponentSlots<typeof footerTheme>
|
|
14
|
+
class?: any
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
const { contain = false,
|
|
17
|
+
const { contain = false, ui: uiProp, class: className } = defineProps<RLVFooterProps>()
|
|
18
18
|
|
|
19
19
|
defineSlots<{
|
|
20
20
|
left(props: {}): any
|
|
@@ -28,15 +28,15 @@ const resolvedClasses = computed(() =>
|
|
|
28
28
|
</script>
|
|
29
29
|
|
|
30
30
|
<template>
|
|
31
|
-
<footer :class="[resolvedClasses.root]" data-slot="
|
|
31
|
+
<footer :class="[resolvedClasses.root]" data-slot="root" v-bind="$attrs">
|
|
32
32
|
<div :class="resolvedClasses.container">
|
|
33
|
-
<div :class="resolvedClasses.left" data-slot="
|
|
33
|
+
<div :class="resolvedClasses.left" data-slot="left">
|
|
34
34
|
<slot name="left" />
|
|
35
35
|
</div>
|
|
36
|
-
<div :class="resolvedClasses.center" data-slot="
|
|
36
|
+
<div :class="resolvedClasses.center" data-slot="center">
|
|
37
37
|
<slot name="center" />
|
|
38
38
|
</div>
|
|
39
|
-
<div :class="resolvedClasses.right" data-slot="
|
|
39
|
+
<div :class="resolvedClasses.right" data-slot="right">
|
|
40
40
|
<slot name="right" />
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { computed, onMounted, onUnmounted, ref } from "vue"
|
|
3
3
|
import { scv } from "css-variants"
|
|
4
4
|
import { useUi, resolveClasses } from "../../utils"
|
|
5
|
-
import type { ComponentVariants } from "../../types"
|
|
5
|
+
import type { ComponentVariants, ComponentSlots } from "../../types"
|
|
6
6
|
import headerTheme from "../../themes/header.theme"
|
|
7
7
|
import { getHeaderStack } from "../../utils/headerStack"
|
|
8
8
|
|
|
@@ -15,8 +15,8 @@ export interface RLVHeaderProps {
|
|
|
15
15
|
fixed?: HeaderVariants["fixed"]
|
|
16
16
|
stackIndex?: number
|
|
17
17
|
hideOnScroll?: boolean
|
|
18
|
-
ui?:
|
|
19
|
-
class?:
|
|
18
|
+
ui?: ComponentSlots<typeof headerTheme>
|
|
19
|
+
class?: any
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
const {
|
|
@@ -25,8 +25,8 @@ const {
|
|
|
25
25
|
fixed = false,
|
|
26
26
|
stackIndex = 0,
|
|
27
27
|
hideOnScroll = false,
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
ui: uiProp,
|
|
29
|
+
class: className
|
|
30
30
|
} = defineProps<RLVHeaderProps>()
|
|
31
31
|
|
|
32
32
|
defineSlots<{
|
|
@@ -112,18 +112,18 @@ onUnmounted(() => {
|
|
|
112
112
|
:id="id"
|
|
113
113
|
:class="[resolvedClasses.root]"
|
|
114
114
|
:style="fixedStyle"
|
|
115
|
-
data-slot="
|
|
115
|
+
data-slot="root"
|
|
116
116
|
v-bind="$attrs"
|
|
117
117
|
>
|
|
118
118
|
<div ref="contentRef" :class="resolvedClasses.content">
|
|
119
119
|
<div :class="resolvedClasses.container">
|
|
120
|
-
<div :class="resolvedClasses.left" data-slot="
|
|
120
|
+
<div :class="resolvedClasses.left" data-slot="left">
|
|
121
121
|
<slot name="left" />
|
|
122
122
|
</div>
|
|
123
|
-
<div :class="resolvedClasses.center" data-slot="
|
|
123
|
+
<div :class="resolvedClasses.center" data-slot="center">
|
|
124
124
|
<slot name="center" />
|
|
125
125
|
</div>
|
|
126
|
-
<div :class="resolvedClasses.right" data-slot="
|
|
126
|
+
<div :class="resolvedClasses.right" data-slot="right">
|
|
127
127
|
<slot name="right" />
|
|
128
128
|
</div>
|
|
129
129
|
</div>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { computed } from "vue"
|
|
3
3
|
import { scv } from "css-variants"
|
|
4
4
|
import { useUi, resolveClasses } from "../../utils"
|
|
5
|
-
import type { ComponentVariants } from "../../types"
|
|
5
|
+
import type { ComponentVariants, ComponentSlots } from "../../types"
|
|
6
6
|
import iconTheme from "../../themes/icon.theme"
|
|
7
7
|
|
|
8
8
|
const icon = scv(iconTheme)
|
|
@@ -11,11 +11,11 @@ type IconVariants = ComponentVariants<typeof iconTheme>
|
|
|
11
11
|
export interface RLVIconProps {
|
|
12
12
|
name: string
|
|
13
13
|
size?: IconVariants["size"]
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
ui?: ComponentSlots<typeof iconTheme>
|
|
15
|
+
class?: any
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
const { name, size = "md",
|
|
18
|
+
const { name, size = "md", ui: uiProp, class: className } = defineProps<RLVIconProps>()
|
|
19
19
|
|
|
20
20
|
const resolvedClasses = computed(() =>
|
|
21
21
|
resolveClasses(icon, { size }, useUi("icon", uiProp), className)
|
|
@@ -27,12 +27,7 @@ defineSlots<{
|
|
|
27
27
|
</script>
|
|
28
28
|
|
|
29
29
|
<template>
|
|
30
|
-
<span
|
|
31
|
-
v-bind="$attrs"
|
|
32
|
-
:class="[resolvedClasses.root, name]"
|
|
33
|
-
data-slot="rlv-icon"
|
|
34
|
-
aria-hidden="true"
|
|
35
|
-
>
|
|
30
|
+
<span v-bind="$attrs" :class="[resolvedClasses.root, name]" data-slot="root" aria-hidden="true">
|
|
36
31
|
<slot />
|
|
37
32
|
</span>
|
|
38
33
|
</template>
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { computed } from "vue"
|
|
3
3
|
import { scv } from "css-variants"
|
|
4
4
|
import { useUi, resolveClasses } from "../../utils"
|
|
5
|
+
import type { ComponentSlots } from "../../types"
|
|
5
6
|
import logoTheme from "../../themes/logo.theme"
|
|
6
7
|
import { getUIConfig } from "virtual:rimelight-ui"
|
|
7
8
|
|
|
@@ -11,9 +12,9 @@ export interface RLVLogoProps {
|
|
|
11
12
|
variant?: string
|
|
12
13
|
mode?: "color" | "white" | "black"
|
|
13
14
|
href?: string
|
|
14
|
-
ui?: Partial<Record<string, string>>
|
|
15
|
-
class?: string
|
|
16
15
|
alt?: string
|
|
16
|
+
ui?: ComponentSlots<typeof logoTheme>
|
|
17
|
+
class?: any
|
|
17
18
|
[key: string]: unknown
|
|
18
19
|
}
|
|
19
20
|
|
|
@@ -64,7 +65,7 @@ const Tag = computed(() => (props.href ? "a" : "div"))
|
|
|
64
65
|
:href="Tag === 'a' ? href : undefined"
|
|
65
66
|
:aria-label="alt || variant"
|
|
66
67
|
:class="resolvedClasses.root"
|
|
67
|
-
data-slot="
|
|
68
|
+
data-slot="root"
|
|
68
69
|
>
|
|
69
70
|
<template v-if="logoSrc">
|
|
70
71
|
<span v-if="isIcon" :class="[logoSrc, 'size-full block shrink-0']" aria-hidden="true" />
|
|
@@ -2,17 +2,18 @@
|
|
|
2
2
|
import { computed } from "vue"
|
|
3
3
|
import { scv } from "css-variants"
|
|
4
4
|
import { useUi, resolveClasses } from "../../utils"
|
|
5
|
+
import type { ComponentSlots } from "../../types"
|
|
5
6
|
import placeholderTheme from "../../themes/placeholder.theme"
|
|
6
7
|
|
|
7
8
|
const placeholder = scv(placeholderTheme)
|
|
8
9
|
|
|
9
10
|
export interface RLVPlaceholderProps {
|
|
10
|
-
ui?:
|
|
11
|
-
class?:
|
|
11
|
+
ui?: ComponentSlots<typeof placeholderTheme>
|
|
12
|
+
class?: any
|
|
12
13
|
[key: string]: unknown
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
const {
|
|
16
|
+
const { ui: uiProp, class: className } = defineProps<RLVPlaceholderProps>()
|
|
16
17
|
|
|
17
18
|
defineSlots<{
|
|
18
19
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { scv } from "css-variants"
|
|
3
3
|
import { useUi, resolveClasses } from "../../utils"
|
|
4
|
-
import type { ComponentVariants } from "../../types"
|
|
4
|
+
import type { ComponentVariants, ComponentSlots } from "../../types"
|
|
5
5
|
import scrollToTopTheme from "../../themes/scroll-to-top.theme"
|
|
6
6
|
import { useScrollToTop } from "../../composables/useScrollToTop"
|
|
7
7
|
import { computed } from "vue"
|
|
@@ -15,8 +15,8 @@ export interface RLVScrollToTopProps {
|
|
|
15
15
|
duration?: number
|
|
16
16
|
threshold?: number
|
|
17
17
|
showProgress?: boolean
|
|
18
|
-
ui?:
|
|
19
|
-
class?:
|
|
18
|
+
ui?: ComponentSlots<typeof scrollToTopTheme>
|
|
19
|
+
class?: any
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
const {
|