@rimelight/ui 0.0.28 → 0.0.29
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/RLAPlaceholder.astro +2 -8
- package/src/components/astro/RLAScrollToTop.astro +2 -14
- package/src/components/astro/RLASection.astro +24 -72
- 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/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 +12 -0
- package/src/types/components/link.ts +23 -0
- package/src/types/components/logo.ts +27 -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
|
@@ -2,20 +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 { IconProps } from "../../types/components/icon"
|
|
6
6
|
import iconTheme from "../../themes/icon.theme"
|
|
7
7
|
|
|
8
8
|
const icon = scv(iconTheme)
|
|
9
|
-
type IconVariants = ComponentVariants<typeof iconTheme>
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
name: string
|
|
13
|
-
size?: IconVariants["size"]
|
|
14
|
-
ui?: ComponentSlots<typeof iconTheme>
|
|
15
|
-
class?: any
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const { name, size = "md", ui: uiProp, class: className } = defineProps<RLVIconProps>()
|
|
10
|
+
const { name, size = "md", ui: uiProp, class: className } = defineProps<IconProps>()
|
|
19
11
|
|
|
20
12
|
const resolvedClasses = computed(() =>
|
|
21
13
|
resolveClasses(icon, { size }, useUi("icon", uiProp), className)
|
|
@@ -2,34 +2,26 @@
|
|
|
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 { LogoProps } from "../../types/components/logo"
|
|
6
6
|
import logoTheme from "../../themes/logo.theme"
|
|
7
7
|
import { getUIConfig } from "virtual:rimelight-ui"
|
|
8
8
|
|
|
9
9
|
const logo = scv(logoTheme)
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
variant
|
|
13
|
-
mode
|
|
14
|
-
href
|
|
15
|
-
alt
|
|
16
|
-
ui
|
|
17
|
-
class
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const props = withDefaults(defineProps<RLVLogoProps>(), {
|
|
22
|
-
variant: "logomark",
|
|
23
|
-
href: "/"
|
|
24
|
-
})
|
|
11
|
+
const {
|
|
12
|
+
variant = "logomark",
|
|
13
|
+
mode,
|
|
14
|
+
href = "/",
|
|
15
|
+
alt,
|
|
16
|
+
ui: uiProp,
|
|
17
|
+
class: className
|
|
18
|
+
} = defineProps<LogoProps>()
|
|
25
19
|
|
|
26
20
|
defineSlots<{
|
|
27
21
|
default(props: {}): any
|
|
28
22
|
}>()
|
|
29
23
|
|
|
30
|
-
const resolvedClasses = computed(() =>
|
|
31
|
-
resolveClasses(logo, {}, useUi("logo", props.ui), props.class)
|
|
32
|
-
)
|
|
24
|
+
const resolvedClasses = computed(() => resolveClasses(logo, {}, useUi("logo", uiProp), className))
|
|
33
25
|
|
|
34
26
|
const logoSrc = computed<string | null>(() => {
|
|
35
27
|
const globalConfig = getUIConfig()
|
|
@@ -37,9 +29,9 @@ const logoSrc = computed<string | null>(() => {
|
|
|
37
29
|
let src: any = null
|
|
38
30
|
|
|
39
31
|
if (rcLogos && typeof rcLogos === "object") {
|
|
40
|
-
src = rcLogos[
|
|
32
|
+
src = rcLogos[variant]
|
|
41
33
|
if (src && typeof src === "object") {
|
|
42
|
-
src = src[
|
|
34
|
+
src = src[mode || "color"] || src.black || src.color
|
|
43
35
|
}
|
|
44
36
|
}
|
|
45
37
|
|
|
@@ -55,7 +47,7 @@ const isIcon = computed(() => {
|
|
|
55
47
|
return src.includes(":") || src.startsWith("i-")
|
|
56
48
|
})
|
|
57
49
|
|
|
58
|
-
const Tag = computed(() => (
|
|
50
|
+
const Tag = computed(() => (href ? "a" : "div"))
|
|
59
51
|
</script>
|
|
60
52
|
|
|
61
53
|
<template>
|
|
@@ -2,18 +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 { PlaceholderProps } from "../../types/components/placeholder"
|
|
6
6
|
import placeholderTheme from "../../themes/placeholder.theme"
|
|
7
7
|
|
|
8
8
|
const placeholder = scv(placeholderTheme)
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
ui?: ComponentSlots<typeof placeholderTheme>
|
|
12
|
-
class?: any
|
|
13
|
-
[key: string]: unknown
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const { ui: uiProp, class: className } = defineProps<RLVPlaceholderProps>()
|
|
10
|
+
const { ui: uiProp, class: className } = defineProps<PlaceholderProps>()
|
|
17
11
|
|
|
18
12
|
defineSlots<{
|
|
19
13
|
/**
|
|
@@ -1,23 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { scv } from "css-variants"
|
|
3
3
|
import { useUi, resolveClasses } from "../../utils"
|
|
4
|
-
import type {
|
|
4
|
+
import type { ScrollToTopProps } from "../../types/components/scroll-to-top"
|
|
5
5
|
import scrollToTopTheme from "../../themes/scroll-to-top.theme"
|
|
6
6
|
import { useScrollToTop } from "../../composables/useScrollToTop"
|
|
7
7
|
import { computed } from "vue"
|
|
8
8
|
|
|
9
9
|
const scrollToTop = scv(scrollToTopTheme)
|
|
10
|
-
type ScrollToTopVariants = ComponentVariants<typeof scrollToTopTheme>
|
|
11
|
-
|
|
12
|
-
export interface RLVScrollToTopProps {
|
|
13
|
-
color?: ScrollToTopVariants["color"]
|
|
14
|
-
progressWidth?: number
|
|
15
|
-
duration?: number
|
|
16
|
-
threshold?: number
|
|
17
|
-
showProgress?: boolean
|
|
18
|
-
ui?: ComponentSlots<typeof scrollToTopTheme>
|
|
19
|
-
class?: any
|
|
20
|
-
}
|
|
21
10
|
|
|
22
11
|
const {
|
|
23
12
|
color = "primary",
|
|
@@ -27,7 +16,7 @@ const {
|
|
|
27
16
|
showProgress = false,
|
|
28
17
|
ui: uiProp,
|
|
29
18
|
class: className
|
|
30
|
-
} = defineProps<
|
|
19
|
+
} = defineProps<ScrollToTopProps>()
|
|
31
20
|
|
|
32
21
|
const classes = resolveClasses(scrollToTop, { color }, useUi("scrollToTop", uiProp), className)
|
|
33
22
|
|
|
@@ -2,29 +2,12 @@
|
|
|
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 { SectionProps } from "../../types/components/section"
|
|
6
6
|
import sectionTheme from "../../themes/section.theme"
|
|
7
|
-
import type { RLVButtonProps } from "./RLVButton.vue"
|
|
8
7
|
import RLVIcon from "./RLVIcon.vue"
|
|
9
8
|
import RLVButton from "./RLVButton.vue"
|
|
10
9
|
|
|
11
10
|
const section = scv(sectionTheme)
|
|
12
|
-
type SectionVariants = ComponentVariants<typeof sectionTheme>
|
|
13
|
-
|
|
14
|
-
export interface RLVSectionProps {
|
|
15
|
-
as?: any
|
|
16
|
-
variant?: SectionVariants["variant"]
|
|
17
|
-
headline?: string
|
|
18
|
-
icon?: string
|
|
19
|
-
title?: string
|
|
20
|
-
description?: string
|
|
21
|
-
links?: RLVButtonProps[]
|
|
22
|
-
orientation?: SectionVariants["orientation"]
|
|
23
|
-
reverse?: boolean
|
|
24
|
-
ctaVariant?: SectionVariants["ctaVariant"]
|
|
25
|
-
ui?: ComponentSlots<typeof sectionTheme>
|
|
26
|
-
class?: any
|
|
27
|
-
}
|
|
28
11
|
|
|
29
12
|
const {
|
|
30
13
|
as = "div",
|
|
@@ -38,7 +21,7 @@ const {
|
|
|
38
21
|
title,
|
|
39
22
|
description,
|
|
40
23
|
links
|
|
41
|
-
} = defineProps<
|
|
24
|
+
} = defineProps<SectionProps>()
|
|
42
25
|
|
|
43
26
|
const slots = useSlots()
|
|
44
27
|
|
package/src/integrations/ui.ts
CHANGED
|
@@ -63,7 +63,17 @@ export interface UIOptions {
|
|
|
63
63
|
*/
|
|
64
64
|
export function ui(options: UIOptions = {}): AstroIntegration[] {
|
|
65
65
|
const resolvedUI = defu(options.ui ?? {}, defaultUIConfig)
|
|
66
|
-
const coreColors = [
|
|
66
|
+
const coreColors = [
|
|
67
|
+
"primary",
|
|
68
|
+
"secondary",
|
|
69
|
+
"info",
|
|
70
|
+
"success",
|
|
71
|
+
"warning",
|
|
72
|
+
"error",
|
|
73
|
+
"commentary",
|
|
74
|
+
"ideation",
|
|
75
|
+
"source"
|
|
76
|
+
]
|
|
67
77
|
const mergedColors = [...new Set([...coreColors, ...(options.colors || [])])]
|
|
68
78
|
const resolvedConfig = { ...resolvedUI, logos: options.logos ?? {}, colors: mergedColors }
|
|
69
79
|
|
package/src/presets/index.ts
CHANGED
|
@@ -14,9 +14,9 @@ const uiSrcGlob = join(__dirname, "../**/*.{js,ts,jsx,tsx,vue,svelte,astro}")
|
|
|
14
14
|
const uiFilesystemGlob = join(__dirname, "../**/*")
|
|
15
15
|
|
|
16
16
|
const createScale = (colorName: string) => ({
|
|
17
|
-
DEFAULT: `var(--${colorName})`,
|
|
18
|
-
foreground: `var(--${colorName}-foreground)`,
|
|
19
|
-
accent: `var(--${colorName}-accent)`,
|
|
17
|
+
"DEFAULT": `var(--${colorName})`,
|
|
18
|
+
"foreground": `var(--${colorName}-foreground)`,
|
|
19
|
+
"accent": `var(--${colorName}-accent)`,
|
|
20
20
|
"50": `var(--color-${colorName}-50)`,
|
|
21
21
|
"100": `var(--color-${colorName}-100)`,
|
|
22
22
|
"200": `var(--color-${colorName}-200)`,
|
|
@@ -36,10 +36,20 @@ export interface RimelightPresetOptions {
|
|
|
36
36
|
|
|
37
37
|
export default definePreset((options?: RimelightPresetOptions) => {
|
|
38
38
|
const customColors = options?.colors || []
|
|
39
|
-
const coreColors = [
|
|
39
|
+
const coreColors = [
|
|
40
|
+
"primary",
|
|
41
|
+
"secondary",
|
|
42
|
+
"info",
|
|
43
|
+
"success",
|
|
44
|
+
"warning",
|
|
45
|
+
"error",
|
|
46
|
+
"commentary",
|
|
47
|
+
"ideation",
|
|
48
|
+
"source"
|
|
49
|
+
]
|
|
40
50
|
const allColors = [...new Set([...coreColors, ...customColors])]
|
|
41
51
|
|
|
42
|
-
const safelist = allColors.flatMap(color => [
|
|
52
|
+
const safelist = allColors.flatMap((color) => [
|
|
43
53
|
`bg-${color}-500`,
|
|
44
54
|
`hover:bg-${color}-600`,
|
|
45
55
|
`focus-visible:ring-${color}-500/50`,
|
|
@@ -143,7 +153,7 @@ export default definePreset((options?: RimelightPresetOptions) => {
|
|
|
143
153
|
DEFAULT: "var(--popover)",
|
|
144
154
|
foreground: "var(--popover-foreground)"
|
|
145
155
|
},
|
|
146
|
-
...Object.fromEntries(allColors.map(color => [color, createScale(color)])),
|
|
156
|
+
...Object.fromEntries(allColors.map((color) => [color, createScale(color)])),
|
|
147
157
|
"muted": {
|
|
148
158
|
DEFAULT: "var(--muted)",
|
|
149
159
|
foreground: "var(--muted-foreground)"
|
|
@@ -1,181 +1,190 @@
|
|
|
1
1
|
import { defineTheme } from "../utils/defineTheme"
|
|
2
2
|
|
|
3
|
-
const defaultColors = [
|
|
3
|
+
const defaultColors = [
|
|
4
|
+
"primary",
|
|
5
|
+
"secondary",
|
|
6
|
+
"info",
|
|
7
|
+
"success",
|
|
8
|
+
"warning",
|
|
9
|
+
"error",
|
|
10
|
+
"commentary",
|
|
11
|
+
"ideation",
|
|
12
|
+
"source"
|
|
13
|
+
]
|
|
4
14
|
|
|
5
|
-
export const createButtonTheme = (colors: string[] = defaultColors) =>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
variants: {
|
|
20
|
-
variant: {
|
|
21
|
-
solid: { root: "shadow-sm border border-transparent" },
|
|
22
|
-
outline: { root: "b shadow-sm border" },
|
|
23
|
-
soft: { root: "" },
|
|
24
|
-
subtle: { root: "" },
|
|
25
|
-
ghost: { root: "" },
|
|
26
|
-
link: { root: "p-0 h-auto no-underline" }
|
|
27
|
-
},
|
|
28
|
-
color: {
|
|
29
|
-
...Object.fromEntries(colors.map(color => [color, { root: "" }]))
|
|
15
|
+
export const createButtonTheme = (colors: string[] = defaultColors) =>
|
|
16
|
+
defineTheme({
|
|
17
|
+
slots: ["root", "label", "leadingIcon", "trailingIcon"],
|
|
18
|
+
base: {
|
|
19
|
+
root: [
|
|
20
|
+
"inline-flex items-center justify-center gap-4xs rounded-md font-medium ws-nowrap",
|
|
21
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
22
|
+
"transition-all outline-none focus-visible:ring-3",
|
|
23
|
+
"disabled:pointer-events-none disabled:op-50",
|
|
24
|
+
"aria-invalid:border-error-500 aria-invalid:ring-error-500/20"
|
|
25
|
+
],
|
|
26
|
+
label: "truncate",
|
|
27
|
+
leadingIcon: "shrink-0",
|
|
28
|
+
trailingIcon: "shrink-0"
|
|
30
29
|
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
root: "
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
variants: {
|
|
31
|
+
variant: {
|
|
32
|
+
solid: { root: "shadow-sm border border-transparent" },
|
|
33
|
+
outline: { root: "b shadow-sm border" },
|
|
34
|
+
soft: { root: "" },
|
|
35
|
+
subtle: { root: "" },
|
|
36
|
+
ghost: { root: "" },
|
|
37
|
+
link: { root: "p-0 h-auto no-underline" }
|
|
36
38
|
},
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
color: Object.fromEntries(colors.map((color) => [color, { root: "" }])),
|
|
40
|
+
size: {
|
|
41
|
+
xs: {
|
|
42
|
+
root: "h-7 px-2xs text-xs [&_svg]:size-3.5",
|
|
43
|
+
leadingIcon: "[&_svg]:size-3.5 [&_span]:size-3.5",
|
|
44
|
+
trailingIcon: "[&_svg]:size-3.5 [&_span]:size-3.5"
|
|
45
|
+
},
|
|
46
|
+
sm: {
|
|
47
|
+
root: "h-8 px-xs text-sm [&_svg]:size-4",
|
|
48
|
+
leadingIcon: "[&_svg]:size-4 [&_span]:size-4",
|
|
49
|
+
trailingIcon: "[&_svg]:size-4 [&_span]:size-4"
|
|
50
|
+
},
|
|
51
|
+
md: {
|
|
52
|
+
root: "h-9 px-sm text-sm [&_svg]:size-4",
|
|
53
|
+
leadingIcon: "[&_svg]:size-4 [&_span]:size-4",
|
|
54
|
+
trailingIcon: "[&_svg]:size-4 [&_span]:size-4"
|
|
55
|
+
},
|
|
56
|
+
lg: {
|
|
57
|
+
root: "h-10 px-md text-base [&_svg]:size-4.5",
|
|
58
|
+
leadingIcon: "[&_svg]:size-4.5 [&_span]:size-4.5",
|
|
59
|
+
trailingIcon: "[&_svg]:size-4.5 [&_span]:size-4.5"
|
|
60
|
+
},
|
|
61
|
+
xl: {
|
|
62
|
+
root: "h-11 px-lg text-base [&_svg]:size-5",
|
|
63
|
+
leadingIcon: "[&_svg]:size-5 [&_span]:size-5",
|
|
64
|
+
trailingIcon: "[&_svg]:size-5 [&_span]:size-5"
|
|
65
|
+
}
|
|
41
66
|
},
|
|
42
|
-
|
|
43
|
-
root: "
|
|
44
|
-
leadingIcon: "[&_svg]:size-4 [&_span]:size-4",
|
|
45
|
-
trailingIcon: "[&_svg]:size-4 [&_span]:size-4"
|
|
67
|
+
block: {
|
|
68
|
+
true: { root: "w-full justify-center", trailingIcon: "ms-auto" }
|
|
46
69
|
},
|
|
47
|
-
|
|
48
|
-
root: "
|
|
49
|
-
leadingIcon: "[&_svg]:size-4.5 [&_span]:size-4.5",
|
|
50
|
-
trailingIcon: "[&_svg]:size-4.5 [&_span]:size-4.5"
|
|
70
|
+
square: {
|
|
71
|
+
true: { root: "" }
|
|
51
72
|
},
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
block: {
|
|
59
|
-
true: { root: "w-full justify-center", trailingIcon: "ms-auto" }
|
|
60
|
-
},
|
|
61
|
-
square: {
|
|
62
|
-
true: { root: "" }
|
|
63
|
-
},
|
|
64
|
-
leading: { true: {} },
|
|
65
|
-
trailing: { true: {} },
|
|
66
|
-
loading: { true: {} },
|
|
67
|
-
active: {
|
|
68
|
-
true: { root: "" },
|
|
69
|
-
false: { root: "" }
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
compoundVariants: [
|
|
73
|
-
...colors.map(color => ({
|
|
74
|
-
variant: "solid" as const,
|
|
75
|
-
color,
|
|
76
|
-
classNames: {
|
|
77
|
-
root: `bg-${color}-500 text-white hover:bg-${color}-600 focus-visible:ring-${color}-500/50`
|
|
78
|
-
}
|
|
79
|
-
})),
|
|
80
|
-
...colors.map(color => ({
|
|
81
|
-
variant: "outline" as const,
|
|
82
|
-
color,
|
|
83
|
-
classNames: {
|
|
84
|
-
root: `border-${color}-500/20 text-${color}-600 bg-${color}-500/5 hover:bg-${color}-500/10 hover:border-${color}-500/30 focus-visible:ring-${color}-500/40`
|
|
85
|
-
}
|
|
86
|
-
})),
|
|
87
|
-
...colors.map(color => ({
|
|
88
|
-
variant: "soft" as const,
|
|
89
|
-
color,
|
|
90
|
-
classNames: {
|
|
91
|
-
root: `text-${color}-600 bg-${color}-500/10 hover:bg-${color}-500/20 focus-visible:ring-${color}-500/40`
|
|
92
|
-
}
|
|
93
|
-
})),
|
|
94
|
-
...colors.map(color => ({
|
|
95
|
-
variant: "subtle" as const,
|
|
96
|
-
color,
|
|
97
|
-
classNames: {
|
|
98
|
-
root: `text-${color}-600 bg-${color}-500/10 hover:bg-${color}-500/20 focus-visible:ring-${color}-500/40`
|
|
99
|
-
}
|
|
100
|
-
})),
|
|
101
|
-
...colors.map(color => ({
|
|
102
|
-
variant: "ghost" as const,
|
|
103
|
-
color,
|
|
104
|
-
classNames: {
|
|
105
|
-
root: `text-${color}-600 hover:bg-${color}-500/10 focus-visible:ring-${color}-500/40`
|
|
106
|
-
}
|
|
107
|
-
})),
|
|
108
|
-
...colors.map(color => ({
|
|
109
|
-
variant: "link" as const,
|
|
110
|
-
color,
|
|
111
|
-
classNames: {
|
|
112
|
-
root: `text-${color}-600 hover:underline hover:decoration-${color}-300`
|
|
113
|
-
}
|
|
114
|
-
})),
|
|
115
|
-
{
|
|
116
|
-
square: true,
|
|
117
|
-
size: "xs",
|
|
118
|
-
classNames: {
|
|
119
|
-
root: "p-1 w-7"
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
square: true,
|
|
124
|
-
size: "sm",
|
|
125
|
-
classNames: {
|
|
126
|
-
root: "p-1.5 w-8"
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
square: true,
|
|
131
|
-
size: "md",
|
|
132
|
-
classNames: {
|
|
133
|
-
root: "p-1.5 w-9"
|
|
73
|
+
leading: { true: {} },
|
|
74
|
+
trailing: { true: {} },
|
|
75
|
+
loading: { true: {} },
|
|
76
|
+
active: {
|
|
77
|
+
true: { root: "" },
|
|
78
|
+
false: { root: "" }
|
|
134
79
|
}
|
|
135
80
|
},
|
|
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
|
-
|
|
81
|
+
compoundVariants: [
|
|
82
|
+
...colors.map((color) => ({
|
|
83
|
+
variant: "solid" as const,
|
|
84
|
+
color,
|
|
85
|
+
classNames: {
|
|
86
|
+
root: `bg-${color}-500 text-white hover:bg-${color}-600 focus-visible:ring-${color}-500/50`
|
|
87
|
+
}
|
|
88
|
+
})),
|
|
89
|
+
...colors.map((color) => ({
|
|
90
|
+
variant: "outline" as const,
|
|
91
|
+
color,
|
|
92
|
+
classNames: {
|
|
93
|
+
root: `border-${color}-500/20 text-${color}-600 bg-${color}-500/5 hover:bg-${color}-500/10 hover:border-${color}-500/30 focus-visible:ring-${color}-500/40`
|
|
94
|
+
}
|
|
95
|
+
})),
|
|
96
|
+
...colors.map((color) => ({
|
|
97
|
+
variant: "soft" as const,
|
|
98
|
+
color,
|
|
99
|
+
classNames: {
|
|
100
|
+
root: `text-${color}-600 bg-${color}-500/10 hover:bg-${color}-500/20 focus-visible:ring-${color}-500/40`
|
|
101
|
+
}
|
|
102
|
+
})),
|
|
103
|
+
...colors.map((color) => ({
|
|
104
|
+
variant: "subtle" as const,
|
|
105
|
+
color,
|
|
106
|
+
classNames: {
|
|
107
|
+
root: `text-${color}-600 bg-${color}-500/10 hover:bg-${color}-500/20 focus-visible:ring-${color}-500/40`
|
|
108
|
+
}
|
|
109
|
+
})),
|
|
110
|
+
...colors.map((color) => ({
|
|
111
|
+
variant: "ghost" as const,
|
|
112
|
+
color,
|
|
113
|
+
classNames: {
|
|
114
|
+
root: `text-${color}-600 hover:bg-${color}-500/10 focus-visible:ring-${color}-500/40`
|
|
115
|
+
}
|
|
116
|
+
})),
|
|
117
|
+
...colors.map((color) => ({
|
|
118
|
+
variant: "link" as const,
|
|
119
|
+
color,
|
|
120
|
+
classNames: {
|
|
121
|
+
root: `text-${color}-600 hover:underline hover:decoration-${color}-300`
|
|
122
|
+
}
|
|
123
|
+
})),
|
|
124
|
+
{
|
|
125
|
+
square: true,
|
|
126
|
+
size: "xs",
|
|
127
|
+
classNames: {
|
|
128
|
+
root: "p-1 w-7"
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
square: true,
|
|
133
|
+
size: "sm",
|
|
134
|
+
classNames: {
|
|
135
|
+
root: "p-1.5 w-8"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
square: true,
|
|
140
|
+
size: "md",
|
|
141
|
+
classNames: {
|
|
142
|
+
root: "p-1.5 w-9"
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
square: true,
|
|
147
|
+
size: "lg",
|
|
148
|
+
classNames: {
|
|
149
|
+
root: "p-2 w-10"
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
square: true,
|
|
154
|
+
size: "xl",
|
|
155
|
+
classNames: {
|
|
156
|
+
root: "p-2 w-11"
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
loading: true,
|
|
161
|
+
leading: true,
|
|
162
|
+
classNames: {
|
|
163
|
+
leadingIcon: "animate-spin"
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
loading: true,
|
|
168
|
+
leading: false,
|
|
169
|
+
trailing: true,
|
|
170
|
+
classNames: {
|
|
171
|
+
trailingIcon: "animate-spin"
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
loading: true,
|
|
176
|
+
leading: false,
|
|
177
|
+
trailing: false,
|
|
178
|
+
classNames: {
|
|
179
|
+
trailingIcon: "animate-spin"
|
|
180
|
+
}
|
|
171
181
|
}
|
|
182
|
+
],
|
|
183
|
+
defaultVariants: {
|
|
184
|
+
variant: "solid",
|
|
185
|
+
color: "primary",
|
|
186
|
+
size: "md"
|
|
172
187
|
}
|
|
173
|
-
|
|
174
|
-
defaultVariants: {
|
|
175
|
-
variant: "solid",
|
|
176
|
-
color: "primary",
|
|
177
|
-
size: "md"
|
|
178
|
-
}
|
|
179
|
-
})
|
|
188
|
+
})
|
|
180
189
|
|
|
181
190
|
export default createButtonTheme()
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import { defineTheme } from "../utils/defineTheme"
|
|
2
|
-
|
|
3
|
-
export default defineTheme({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
variants: {},
|
|
17
|
-
compoundVariants: [],
|
|
18
|
-
defaultVariants: {}
|
|
19
|
-
})
|
|
1
|
+
import { defineTheme } from "../utils/defineTheme"
|
|
2
|
+
|
|
3
|
+
export default defineTheme({
|
|
4
|
+
slots: ["root", "trigger", "image", "icon"],
|
|
5
|
+
base: {
|
|
6
|
+
root: "relative aspect-video h-full w-full cursor-pointer overflow-hidden",
|
|
7
|
+
trigger: "group absolute inset-0 aspect-video h-full w-full overflow-hidden",
|
|
8
|
+
image: "h-full w-full object-cover",
|
|
9
|
+
icon: "absolute inset-0 m-auto h-24 w-24 text-white opacity-75 transition-opacity group-hover:opacity-100"
|
|
10
|
+
},
|
|
11
|
+
variants: {},
|
|
12
|
+
compoundVariants: [],
|
|
13
|
+
defaultVariants: {}
|
|
14
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface AccordionProps {
|
|
2
|
+
/**
|
|
3
|
+
* The summary text displayed when the accordion is collapsed.
|
|
4
|
+
*/
|
|
5
|
+
summary: string
|
|
6
|
+
/**
|
|
7
|
+
* Slot-specific CSS class overrides.
|
|
8
|
+
*/
|
|
9
|
+
ui?: any
|
|
10
|
+
/**
|
|
11
|
+
* Additional CSS classes to apply to the root component.
|
|
12
|
+
*/
|
|
13
|
+
class?: any
|
|
14
|
+
[key: string]: unknown
|
|
15
|
+
}
|