@rimelight/ui 0.0.28 → 0.0.30
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 +14 -13
- package/src/components/astro/RLAAccordion.astro +2 -6
- package/src/components/astro/RLAButton.astro +2 -22
- package/src/components/astro/RLAEmbedYoutube.astro +4 -26
- package/src/components/astro/RLAFooter.astro +2 -10
- package/src/components/astro/RLAHeader.astro +2 -14
- package/src/components/astro/RLAIcon.astro +2 -11
- package/src/components/astro/RLALogo.astro +2 -12
- package/src/components/astro/RLAMain.astro +28 -0
- package/src/components/astro/RLAPlaceholder.astro +2 -8
- package/src/components/astro/RLAScrollToTop.astro +2 -14
- package/src/components/astro/RLASection.astro +24 -73
- package/src/components/vue/RLVButton.vue +2 -64
- package/src/components/vue/RLVFooter.vue +2 -9
- package/src/components/vue/RLVHeader.vue +2 -13
- package/src/components/vue/RLVIcon.vue +2 -10
- package/src/components/vue/RLVLogo.vue +13 -21
- package/src/components/vue/RLVPlaceholder.vue +2 -8
- package/src/components/vue/RLVScrollToTop.vue +2 -13
- package/src/components/vue/RLVSection.vue +2 -19
- package/src/integrations/ui.ts +11 -1
- package/src/presets/index.ts +16 -6
- package/src/themes/button.theme.ts +176 -167
- package/src/themes/embedYoutube.theme.ts +14 -19
- package/src/themes/main.theme.ts +12 -0
- package/src/types/components/accordion.ts +15 -0
- package/src/types/components/button.ts +71 -0
- package/src/types/components/embed-youtube.ts +27 -0
- package/src/types/components/footer.ts +15 -0
- package/src/types/components/header.ts +31 -0
- package/src/types/components/icon.ts +19 -0
- package/src/types/components/index.ts +13 -0
- package/src/types/components/link.ts +23 -0
- package/src/types/components/logo.ts +27 -0
- package/src/types/components/main.ts +17 -0
- package/src/types/components/navigation.ts +34 -0
- package/src/types/components/placeholder.ts +11 -0
- package/src/types/components/scroll-to-top.ts +31 -0
- package/src/types/components/section.ts +63 -0
- package/src/types/index.ts +1 -0
- package/src/nuxt-types.ts +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rimelight/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.30",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Rimelight Entertainment UI Library.",
|
|
6
6
|
"keywords": [
|
|
@@ -48,7 +48,8 @@
|
|
|
48
48
|
"./middleware": "./src/middleware/index.ts",
|
|
49
49
|
"./middleware/*": "./src/middleware/*",
|
|
50
50
|
"./nuxt": "./src/nuxt.ts",
|
|
51
|
-
"./
|
|
51
|
+
"./types": "./src/types/index.ts",
|
|
52
|
+
"./types/*": "./src/types/*",
|
|
52
53
|
"./presets": "./src/presets/index.ts",
|
|
53
54
|
"./presets/*": "./src/presets/*",
|
|
54
55
|
"./*": "./src/*"
|
|
@@ -63,14 +64,14 @@
|
|
|
63
64
|
"docs:meta": "tsx scripts/extract-meta.ts"
|
|
64
65
|
},
|
|
65
66
|
"dependencies": {
|
|
66
|
-
"@astrojs/prism": "^4.0.
|
|
67
|
+
"@astrojs/prism": "^4.0.2",
|
|
67
68
|
"@astrojs/vue": "6.0.1",
|
|
68
|
-
"@iconify-json/lucide": "^1.2.
|
|
69
|
-
"@nuxt/ui": "4.
|
|
70
|
-
"@tailwindcss/vite": "^4.
|
|
69
|
+
"@iconify-json/lucide": "^1.2.108",
|
|
70
|
+
"@nuxt/ui": "4.7.1",
|
|
71
|
+
"@tailwindcss/vite": "^4.3.0",
|
|
71
72
|
"@unocss/astro": "^66.6.8",
|
|
72
73
|
"css-variants": "2.3.5",
|
|
73
|
-
"defu": "6.1.
|
|
74
|
+
"defu": "6.1.7",
|
|
74
75
|
"embla-carousel": "8.6.0",
|
|
75
76
|
"picomatch": "^4.0.4",
|
|
76
77
|
"tailwindcss": "^4.2.3",
|
|
@@ -80,18 +81,18 @@
|
|
|
80
81
|
},
|
|
81
82
|
"devDependencies": {
|
|
82
83
|
"@astrojs/check": "0.9.8",
|
|
83
|
-
"@astrojs/ts-plugin": "1.10.
|
|
84
|
+
"@astrojs/ts-plugin": "1.10.8",
|
|
84
85
|
"@e18e/eslint-plugin": "0.3.0",
|
|
85
|
-
"@types/node": "25.
|
|
86
|
+
"@types/node": "25.8.0",
|
|
86
87
|
"@types/picomatch": "^4.0.3",
|
|
87
88
|
"@unocss/eslint-plugin": "66.6.8",
|
|
88
|
-
"astro": "6.
|
|
89
|
+
"astro": "6.3.6",
|
|
89
90
|
"eslint-plugin-regexp": "3.1.0",
|
|
90
|
-
"knip": "6.
|
|
91
|
-
"tsx": "4.
|
|
91
|
+
"knip": "6.14.1",
|
|
92
|
+
"tsx": "4.22.1",
|
|
92
93
|
"typescript": "6.0.3",
|
|
93
94
|
"unocss": "66.6.8",
|
|
94
|
-
"vite-plus": "0.1.
|
|
95
|
+
"vite-plus": "0.1.21"
|
|
95
96
|
},
|
|
96
97
|
"peerDependencies": {
|
|
97
98
|
"@astrojs/starlight": ">=0.5.0",
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { AccordionProps } from "../../types";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
summary: string;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
const { summary, class: className, ...attrs } = Astro.props;
|
|
4
|
+
const { summary, class: className, ...attrs } = Astro.props as AccordionProps;
|
|
9
5
|
---
|
|
10
6
|
|
|
11
7
|
<details class:list={['group', className]} {...attrs}>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { scv, cx } from "css-variants"
|
|
3
3
|
import { useUi, resolveClasses } from "../../utils"
|
|
4
|
-
import type {
|
|
4
|
+
import type { ButtonProps } from "../../types"
|
|
5
5
|
import buttonThemeDefault, { createButtonTheme } from "../../themes/button.theme"
|
|
6
6
|
import { getUIConfig } from "virtual:rimelight-ui"
|
|
7
7
|
|
|
@@ -9,26 +9,6 @@ const uiConfig = getUIConfig()
|
|
|
9
9
|
const buttonTheme = uiConfig.colors ? createButtonTheme(uiConfig.colors) : buttonThemeDefault
|
|
10
10
|
|
|
11
11
|
const button = scv(buttonTheme)
|
|
12
|
-
type ButtonVariants = ComponentVariants<typeof buttonThemeDefault>
|
|
13
|
-
|
|
14
|
-
export interface RLAButtonProps {
|
|
15
|
-
variant?: ButtonVariants['variant'];
|
|
16
|
-
color?: ButtonVariants['color'];
|
|
17
|
-
size?: ButtonVariants['size'];
|
|
18
|
-
href?: string;
|
|
19
|
-
label?: string;
|
|
20
|
-
leadingIcon?: string;
|
|
21
|
-
trailingIcon?: string;
|
|
22
|
-
loading?: boolean;
|
|
23
|
-
square?: boolean;
|
|
24
|
-
block?: boolean;
|
|
25
|
-
active?: boolean;
|
|
26
|
-
activeColor?: ButtonVariants['color'];
|
|
27
|
-
activeVariant?: ButtonVariants['variant'];
|
|
28
|
-
ui?: ComponentSlots<typeof buttonTheme>;
|
|
29
|
-
class?: any;
|
|
30
|
-
[key: string]: unknown;
|
|
31
|
-
}
|
|
32
12
|
|
|
33
13
|
const {
|
|
34
14
|
variant = "solid",
|
|
@@ -47,7 +27,7 @@ const {
|
|
|
47
27
|
ui: uiProp,
|
|
48
28
|
class: className,
|
|
49
29
|
...rest
|
|
50
|
-
} = Astro.props as
|
|
30
|
+
} = Astro.props as ButtonProps
|
|
51
31
|
|
|
52
32
|
const isLeading = !!(leadingIcon || Astro.slots.has("leading")) || loading
|
|
53
33
|
const isTrailing = !!(trailingIcon || Astro.slots.has("trailing")) || (loading && !isLeading)
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { scv } from "css-variants"
|
|
3
3
|
import { useUi, resolveClasses } from "../../utils"
|
|
4
|
-
import type {
|
|
4
|
+
import type { EmbedYoutubeProps } from "../../types"
|
|
5
5
|
import embedYoutubeTheme from "../../themes/embedYoutube.theme"
|
|
6
|
-
import type { RLAIconProps } from "./RLAIcon.astro"
|
|
7
6
|
import { Image } from "astro:assets"
|
|
8
7
|
|
|
9
8
|
const PLACEHOLDER_THUMBNAIL = "/assets/placeholder.webp";
|
|
@@ -111,27 +110,6 @@ function getYoutubeEmbedUrl(rawUrl: string): string | null {
|
|
|
111
110
|
}
|
|
112
111
|
|
|
113
112
|
const embedYoutube = scv(embedYoutubeTheme)
|
|
114
|
-
type EmbedYoutubeVariants = ComponentVariants<typeof embedYoutubeTheme>
|
|
115
|
-
|
|
116
|
-
export interface RLAEmbedYoutubeProps {
|
|
117
|
-
/**
|
|
118
|
-
* The URL of the YouTube video to embed.
|
|
119
|
-
*/
|
|
120
|
-
src: string;
|
|
121
|
-
/**
|
|
122
|
-
* The title of the video to display.
|
|
123
|
-
* @default "YouTube Video Player"
|
|
124
|
-
*/
|
|
125
|
-
title?: string;
|
|
126
|
-
/**
|
|
127
|
-
* The name of the icon to display in the play trigger overlay.
|
|
128
|
-
* @default "i-lucide-play"
|
|
129
|
-
*/
|
|
130
|
-
icon?: RLAIconProps["name"];
|
|
131
|
-
ui?: ComponentSlots<typeof embedYoutubeTheme>;
|
|
132
|
-
class?: any;
|
|
133
|
-
[key: string]: unknown;
|
|
134
|
-
}
|
|
135
113
|
|
|
136
114
|
const {
|
|
137
115
|
src,
|
|
@@ -140,11 +118,11 @@ const {
|
|
|
140
118
|
ui: uiProp,
|
|
141
119
|
class: className,
|
|
142
120
|
...rest
|
|
143
|
-
} = Astro.props as
|
|
121
|
+
} = Astro.props as EmbedYoutubeProps
|
|
144
122
|
|
|
145
123
|
const classes = resolveClasses(embedYoutube, {
|
|
146
|
-
title: !!(Astro.slots.has("title") ||
|
|
147
|
-
icon: !!(Astro.slots.has("icon") ||
|
|
124
|
+
title: !!(Astro.slots.has("title") || title),
|
|
125
|
+
icon: !!(Astro.slots.has("icon") || icon),
|
|
148
126
|
}, useUi("embedYoutube", uiProp), className);
|
|
149
127
|
|
|
150
128
|
const embedUrl = getYoutubeEmbedUrl(src);
|
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { scv } from "css-variants"
|
|
3
3
|
import { useUi, resolveClasses } from "../../utils"
|
|
4
|
-
import type {
|
|
4
|
+
import type { FooterProps } from "../../types"
|
|
5
5
|
import footerTheme from "../../themes/footer.theme"
|
|
6
6
|
|
|
7
7
|
const footer = scv(footerTheme)
|
|
8
|
-
type FooterVariants = ComponentVariants<typeof footerTheme>
|
|
9
|
-
|
|
10
|
-
export interface RLAFooterProps {
|
|
11
|
-
contain?: FooterVariants['contain'];
|
|
12
|
-
ui?: ComponentSlots<typeof footerTheme>;
|
|
13
|
-
class?: any;
|
|
14
|
-
[key: string]: unknown;
|
|
15
|
-
}
|
|
16
8
|
|
|
17
9
|
const {
|
|
18
10
|
contain = false,
|
|
19
11
|
ui: uiProp,
|
|
20
12
|
class: className,
|
|
21
13
|
...rest
|
|
22
|
-
} = Astro.props as
|
|
14
|
+
} = Astro.props as FooterProps
|
|
23
15
|
|
|
24
16
|
const classes = resolveClasses(footer, { contain }, useUi("footer", uiProp), className)
|
|
25
17
|
---
|
|
@@ -1,22 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { scv } from "css-variants"
|
|
3
3
|
import { useUi, resolveClasses } from "../../utils"
|
|
4
|
-
import type {
|
|
4
|
+
import type { HeaderProps } from "../../types"
|
|
5
5
|
import headerTheme from "../../themes/header.theme"
|
|
6
6
|
|
|
7
7
|
const header = scv(headerTheme)
|
|
8
|
-
type HeaderVariants = ComponentVariants<typeof headerTheme>
|
|
9
|
-
|
|
10
|
-
export interface RLAHeaderProps {
|
|
11
|
-
contain?: HeaderVariants['contain'];
|
|
12
|
-
sticky?: HeaderVariants['sticky'];
|
|
13
|
-
fixed?: HeaderVariants['fixed'];
|
|
14
|
-
stackIndex?: number;
|
|
15
|
-
hideOnScroll?: boolean;
|
|
16
|
-
ui?: ComponentSlots<typeof headerTheme>;
|
|
17
|
-
class?: any;
|
|
18
|
-
[key: string]: unknown;
|
|
19
|
-
}
|
|
20
8
|
|
|
21
9
|
const {
|
|
22
10
|
contain = true,
|
|
@@ -27,7 +15,7 @@ const {
|
|
|
27
15
|
ui: uiProp,
|
|
28
16
|
class: className,
|
|
29
17
|
...rest
|
|
30
|
-
} = Astro.props as
|
|
18
|
+
} = Astro.props as HeaderProps;
|
|
31
19
|
|
|
32
20
|
const classes = resolveClasses(header, {
|
|
33
21
|
contain,
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { scv } from "css-variants"
|
|
3
3
|
import { useUi, resolveClasses } from "../../utils"
|
|
4
|
-
import type {
|
|
4
|
+
import type { IconProps } from "../../types"
|
|
5
5
|
import iconTheme from "../../themes/icon.theme"
|
|
6
6
|
|
|
7
7
|
const icon = scv(iconTheme)
|
|
8
|
-
type IconVariants = ComponentVariants<typeof iconTheme>
|
|
9
|
-
|
|
10
|
-
export interface RLAIconProps {
|
|
11
|
-
name: string
|
|
12
|
-
size?: IconVariants['size']
|
|
13
|
-
ui?: ComponentSlots<typeof iconTheme>
|
|
14
|
-
class?: any
|
|
15
|
-
[key: string]: unknown
|
|
16
|
-
}
|
|
17
8
|
|
|
18
9
|
const {
|
|
19
10
|
name,
|
|
@@ -21,7 +12,7 @@ const {
|
|
|
21
12
|
ui: uiProp,
|
|
22
13
|
class: className,
|
|
23
14
|
...rest
|
|
24
|
-
} = Astro.props as
|
|
15
|
+
} = Astro.props as IconProps
|
|
25
16
|
|
|
26
17
|
const classes = resolveClasses(icon, { size }, useUi("icon", uiProp), className)
|
|
27
18
|
---
|
|
@@ -1,22 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { scv } from "css-variants"
|
|
3
3
|
import { useUi, resolveClasses } from "../../utils"
|
|
4
|
-
import type {
|
|
4
|
+
import type { LogoProps } from "../../types"
|
|
5
5
|
import logoTheme from "../../themes/logo.theme"
|
|
6
6
|
import { getUIConfig } from "virtual:rimelight-ui"
|
|
7
7
|
|
|
8
8
|
const logo = scv(logoTheme)
|
|
9
9
|
|
|
10
|
-
export interface RLALogoProps {
|
|
11
|
-
variant?: string;
|
|
12
|
-
mode?: "color" | "white" | "black";
|
|
13
|
-
href?: string;
|
|
14
|
-
alt?: string;
|
|
15
|
-
ui?: ComponentSlots<typeof logoTheme>;
|
|
16
|
-
class?: any;
|
|
17
|
-
[key: string]: unknown;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
10
|
const {
|
|
21
11
|
variant = "logomark",
|
|
22
12
|
mode,
|
|
@@ -25,7 +15,7 @@ const {
|
|
|
25
15
|
ui: uiProp,
|
|
26
16
|
class: className,
|
|
27
17
|
...rest
|
|
28
|
-
} = Astro.props as
|
|
18
|
+
} = Astro.props as LogoProps;
|
|
29
19
|
|
|
30
20
|
const classes = resolveClasses(logo, {}, useUi("logo", uiProp), className);
|
|
31
21
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { scv } from "css-variants"
|
|
3
|
+
import { useUi, resolveClasses } from "../../utils"
|
|
4
|
+
import type { MainProps } from "../../types"
|
|
5
|
+
import mainTheme from "../../themes/main.theme"
|
|
6
|
+
|
|
7
|
+
const main = scv(mainTheme)
|
|
8
|
+
|
|
9
|
+
const {
|
|
10
|
+
as = "main",
|
|
11
|
+
ui: uiProp,
|
|
12
|
+
class: className,
|
|
13
|
+
...rest
|
|
14
|
+
} = Astro.props as MainProps;
|
|
15
|
+
|
|
16
|
+
const classes = resolveClasses(main, {
|
|
17
|
+
hasContent: Astro.slots.has("default")
|
|
18
|
+
}, useUi("main", uiProp), className);
|
|
19
|
+
|
|
20
|
+
const Tag = as;
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
<Tag
|
|
24
|
+
class:list={[classes.root]}
|
|
25
|
+
{...rest}
|
|
26
|
+
>
|
|
27
|
+
<slot />
|
|
28
|
+
</Tag>
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { scv } from "css-variants"
|
|
3
3
|
import { useUi, resolveClasses } from "../../utils"
|
|
4
|
-
import type {
|
|
4
|
+
import type { PlaceholderProps } from "../../types"
|
|
5
5
|
import placeholderTheme from "../../themes/placeholder.theme"
|
|
6
6
|
|
|
7
7
|
const placeholder = scv(placeholderTheme)
|
|
8
8
|
|
|
9
|
-
export interface RLAPlaceholderProps {
|
|
10
|
-
ui?: ComponentSlots<typeof placeholderTheme>
|
|
11
|
-
class?: any
|
|
12
|
-
[key: string]: unknown
|
|
13
|
-
}
|
|
14
|
-
|
|
15
9
|
const {
|
|
16
10
|
ui: uiProp,
|
|
17
11
|
class: className,
|
|
18
12
|
...rest
|
|
19
|
-
} = Astro.props as
|
|
13
|
+
} = Astro.props as PlaceholderProps
|
|
20
14
|
|
|
21
15
|
const classes = resolveClasses(placeholder, {}, useUi("placeholder", uiProp), className)
|
|
22
16
|
---
|
|
@@ -1,22 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { scv } from "css-variants"
|
|
3
3
|
import { useUi, resolveClasses } from "../../utils"
|
|
4
|
-
import type {
|
|
4
|
+
import type { ScrollToTopProps } from "../../types"
|
|
5
5
|
import scrollToTopTheme from "../../themes/scroll-to-top.theme"
|
|
6
6
|
|
|
7
7
|
const scrollToTop = scv(scrollToTopTheme)
|
|
8
|
-
type ScrollToTopVariants = ComponentVariants<typeof scrollToTopTheme>
|
|
9
|
-
|
|
10
|
-
export interface RLAScrollToTopProps {
|
|
11
|
-
color?: ScrollToTopVariants['color'];
|
|
12
|
-
progressWidth?: number;
|
|
13
|
-
duration?: number;
|
|
14
|
-
threshold?: number;
|
|
15
|
-
showProgress?: boolean;
|
|
16
|
-
ui?: ComponentSlots<typeof scrollToTopTheme>;
|
|
17
|
-
class?: any;
|
|
18
|
-
[key: string]: unknown;
|
|
19
|
-
}
|
|
20
8
|
|
|
21
9
|
const {
|
|
22
10
|
color = "primary",
|
|
@@ -27,7 +15,7 @@ const {
|
|
|
27
15
|
ui: uiProp,
|
|
28
16
|
class: className,
|
|
29
17
|
...rest
|
|
30
|
-
} = Astro.props as
|
|
18
|
+
} = Astro.props as ScrollToTopProps
|
|
31
19
|
|
|
32
20
|
const classes = resolveClasses(scrollToTop, { color }, useUi("scrollToTop", uiProp), className)
|
|
33
21
|
|
|
@@ -1,65 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { scv } from "css-variants"
|
|
3
3
|
import { useUi, resolveClasses } from "../../utils"
|
|
4
|
-
import type {
|
|
4
|
+
import type { SectionProps } from "../../types"
|
|
5
5
|
import sectionTheme from "../../themes/section.theme"
|
|
6
|
-
import type { RLAIconProps } from "./RLAIcon.astro"
|
|
7
|
-
import type { RLAButtonProps } from "./RLAButton.astro"
|
|
8
6
|
import RLAIcon from "./RLAIcon.astro"
|
|
9
7
|
import RLAButton from "./RLAButton.astro"
|
|
10
8
|
|
|
11
9
|
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
10
|
|
|
64
11
|
const {
|
|
65
12
|
as = "section",
|
|
@@ -67,19 +14,24 @@ const {
|
|
|
67
14
|
orientation = "vertical",
|
|
68
15
|
reverse = false,
|
|
69
16
|
ctaVariant = "solid",
|
|
17
|
+
headline,
|
|
18
|
+
title,
|
|
19
|
+
description,
|
|
20
|
+
icon,
|
|
21
|
+
links,
|
|
70
22
|
ui: uiProp,
|
|
71
23
|
class: className,
|
|
72
24
|
...rest
|
|
73
|
-
} = Astro.props as
|
|
25
|
+
} = Astro.props as SectionProps;
|
|
74
26
|
|
|
75
27
|
const classes = resolveClasses(section, {
|
|
76
28
|
variant,
|
|
77
29
|
orientation,
|
|
78
30
|
reverse,
|
|
79
31
|
...(variant === "cta" && { ctaVariant }),
|
|
80
|
-
headline: !!(Astro.slots.has("headline") ||
|
|
81
|
-
title: !!(Astro.slots.has("title") ||
|
|
82
|
-
description: !!(Astro.slots.has("description") ||
|
|
32
|
+
headline: !!(Astro.slots.has("headline") || headline),
|
|
33
|
+
title: !!(Astro.slots.has("title") || title),
|
|
34
|
+
description: !!(Astro.slots.has("description") || description),
|
|
83
35
|
body: Astro.slots.has("body")
|
|
84
36
|
}, useUi("section", uiProp), className);
|
|
85
37
|
|
|
@@ -91,7 +43,6 @@ const TitleTag = variant === "hero" ? "h1" : "h2";
|
|
|
91
43
|
|
|
92
44
|
<Tag
|
|
93
45
|
data-orientation={orientation}
|
|
94
|
-
data-slot="root"
|
|
95
46
|
class:list={[classes.root]}
|
|
96
47
|
{...rest}
|
|
97
48
|
>
|
|
@@ -106,53 +57,53 @@ const TitleTag = variant === "hero" ? "h1" : "h2";
|
|
|
106
57
|
<div
|
|
107
58
|
class:list={[classes.container]}
|
|
108
59
|
>
|
|
109
|
-
{(Astro.slots.has("header") ||
|
|
60
|
+
{(Astro.slots.has("header") || icon || headline || title || description || Astro.slots.has("body") || Astro.slots.has("footer") || Astro.slots.has("links") || links?.length) && (
|
|
110
61
|
<div
|
|
111
62
|
class:list={[classes.wrapper]}
|
|
112
63
|
>
|
|
113
|
-
{(Astro.slots.has("header") ||
|
|
64
|
+
{(Astro.slots.has("header") || icon || headline || title || description) && (
|
|
114
65
|
<div
|
|
115
66
|
class:list={[classes.header]}
|
|
116
67
|
>
|
|
117
68
|
<slot name="header">
|
|
118
|
-
{(
|
|
69
|
+
{(icon || Astro.slots.has("leading")) && (
|
|
119
70
|
<div
|
|
120
71
|
class:list={[classes.leading]}
|
|
121
72
|
>
|
|
122
73
|
<slot name="leading" {...{ ui: classes }}>
|
|
123
|
-
{
|
|
124
|
-
<RLAIcon name={
|
|
74
|
+
{icon && (
|
|
75
|
+
<RLAIcon name={icon} size="md" ui={{ root: classes.leadingIcon }} />
|
|
125
76
|
)}
|
|
126
77
|
</slot>
|
|
127
78
|
</div>
|
|
128
79
|
)}
|
|
129
80
|
|
|
130
|
-
{(
|
|
81
|
+
{(headline || Astro.slots.has("headline")) && (
|
|
131
82
|
<div
|
|
132
83
|
class:list={[classes.headline]}
|
|
133
84
|
>
|
|
134
85
|
<slot name="headline">
|
|
135
|
-
{
|
|
86
|
+
{headline}
|
|
136
87
|
</slot>
|
|
137
88
|
</div>
|
|
138
89
|
)}
|
|
139
90
|
|
|
140
|
-
{(
|
|
91
|
+
{(title || Astro.slots.has("title")) && (
|
|
141
92
|
<TitleTag
|
|
142
93
|
class:list={[classes.title]}
|
|
143
94
|
>
|
|
144
95
|
<slot name="title">
|
|
145
|
-
{
|
|
96
|
+
{title}
|
|
146
97
|
</slot>
|
|
147
98
|
</TitleTag>
|
|
148
99
|
)}
|
|
149
100
|
|
|
150
|
-
{(
|
|
101
|
+
{(description || Astro.slots.has("description")) && (
|
|
151
102
|
<div
|
|
152
103
|
class:list={[classes.description]}
|
|
153
104
|
>
|
|
154
105
|
<slot name="description">
|
|
155
|
-
{
|
|
106
|
+
{description}
|
|
156
107
|
</slot>
|
|
157
108
|
</div>
|
|
158
109
|
)}
|
|
@@ -168,16 +119,16 @@ const TitleTag = variant === "hero" ? "h1" : "h2";
|
|
|
168
119
|
</div>
|
|
169
120
|
)}
|
|
170
121
|
|
|
171
|
-
{(Astro.slots.has("footer") || Astro.slots.has("links") ||
|
|
122
|
+
{(Astro.slots.has("footer") || Astro.slots.has("links") || links?.length) && (
|
|
172
123
|
<div
|
|
173
124
|
class:list={[classes.footer]}
|
|
174
125
|
>
|
|
175
126
|
<slot name="footer">
|
|
176
|
-
{(
|
|
127
|
+
{(links?.length || Astro.slots.has("links")) && (
|
|
177
128
|
<div
|
|
178
129
|
class:list={[classes.links]}
|
|
179
130
|
>
|
|
180
|
-
{
|
|
131
|
+
{links?.map((link) => (
|
|
181
132
|
<RLAButton size="lg" {...link} />
|
|
182
133
|
))}
|
|
183
134
|
<slot name="links" />
|
|
@@ -2,72 +2,10 @@
|
|
|
2
2
|
import { computed, useSlots } from "vue"
|
|
3
3
|
import { scv } from "css-variants"
|
|
4
4
|
import { useUi, resolveClasses } from "../../utils"
|
|
5
|
-
import type {
|
|
5
|
+
import type { ButtonProps } from "../../types/components/button"
|
|
6
6
|
import buttonTheme from "../../themes/button.theme"
|
|
7
7
|
|
|
8
8
|
const button = scv(buttonTheme)
|
|
9
|
-
type ButtonVariants = ComponentVariants<typeof buttonTheme>
|
|
10
|
-
|
|
11
|
-
export interface RLVButtonProps {
|
|
12
|
-
/**
|
|
13
|
-
* The visual style variant of the button
|
|
14
|
-
*/
|
|
15
|
-
variant?: ButtonVariants["variant"]
|
|
16
|
-
/**
|
|
17
|
-
* The color scheme applied to the button
|
|
18
|
-
*/
|
|
19
|
-
color?: ButtonVariants["color"]
|
|
20
|
-
/**
|
|
21
|
-
* The size scale of the button
|
|
22
|
-
*/
|
|
23
|
-
size?: ButtonVariants["size"]
|
|
24
|
-
/**
|
|
25
|
-
* When provided, renders the button as an anchor link
|
|
26
|
-
*/
|
|
27
|
-
href?: string
|
|
28
|
-
/**
|
|
29
|
-
* The text label displayed inside the button
|
|
30
|
-
*/
|
|
31
|
-
label?: string
|
|
32
|
-
/**
|
|
33
|
-
* Icon name displayed before the label
|
|
34
|
-
*/
|
|
35
|
-
leadingIcon?: string
|
|
36
|
-
/**
|
|
37
|
-
* Icon name displayed after the label
|
|
38
|
-
*/
|
|
39
|
-
trailingIcon?: string
|
|
40
|
-
/**
|
|
41
|
-
* Shows a loading spinner animation
|
|
42
|
-
*/
|
|
43
|
-
loading?: boolean
|
|
44
|
-
/**
|
|
45
|
-
* Renders a square button with equal padding
|
|
46
|
-
*/
|
|
47
|
-
square?: boolean
|
|
48
|
-
/**
|
|
49
|
-
* Makes the button stretch to full width
|
|
50
|
-
*/
|
|
51
|
-
block?: boolean
|
|
52
|
-
/**
|
|
53
|
-
* Applies active state styling
|
|
54
|
-
*/
|
|
55
|
-
active?: boolean
|
|
56
|
-
/**
|
|
57
|
-
* Color used when button is in active state
|
|
58
|
-
*/
|
|
59
|
-
activeColor?: ButtonVariants["color"]
|
|
60
|
-
/**
|
|
61
|
-
* Variant used when button is in active state
|
|
62
|
-
*/
|
|
63
|
-
activeVariant?: ButtonVariants["variant"]
|
|
64
|
-
/**
|
|
65
|
-
* Component-specific CSS class overrides
|
|
66
|
-
*/
|
|
67
|
-
ui?: ComponentSlots<typeof buttonTheme>
|
|
68
|
-
class?: any
|
|
69
|
-
[key: string]: unknown
|
|
70
|
-
}
|
|
71
9
|
|
|
72
10
|
const {
|
|
73
11
|
variant = "solid",
|
|
@@ -85,7 +23,7 @@ const {
|
|
|
85
23
|
activeVariant,
|
|
86
24
|
ui: uiProp,
|
|
87
25
|
class: className
|
|
88
|
-
} = defineProps<
|
|
26
|
+
} = defineProps<ButtonProps>()
|
|
89
27
|
|
|
90
28
|
const slots = useSlots()
|
|
91
29
|
|
|
@@ -2,19 +2,12 @@
|
|
|
2
2
|
import { computed } from "vue"
|
|
3
3
|
import { scv } from "css-variants"
|
|
4
4
|
import { useUi, resolveClasses } from "../../utils"
|
|
5
|
-
import type {
|
|
5
|
+
import type { FooterProps } from "../../types/components/footer"
|
|
6
6
|
import footerTheme from "../../themes/footer.theme"
|
|
7
7
|
|
|
8
8
|
const footer = scv(footerTheme)
|
|
9
|
-
type FooterVariants = ComponentVariants<typeof footerTheme>
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
contain?: FooterVariants["contain"]
|
|
13
|
-
ui?: ComponentSlots<typeof footerTheme>
|
|
14
|
-
class?: any
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const { contain = false, ui: uiProp, class: className } = defineProps<RLVFooterProps>()
|
|
10
|
+
const { contain = false, ui: uiProp, class: className } = defineProps<FooterProps>()
|
|
18
11
|
|
|
19
12
|
defineSlots<{
|
|
20
13
|
left(props: {}): any
|