@rimelight/ui 0.0.58 → 0.0.61
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rimelight/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.61",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Rimelight Entertainment's UI Package",
|
|
6
6
|
"homepage": "https://rimelight.com/docs",
|
|
@@ -54,6 +54,12 @@
|
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "vp pack",
|
|
59
|
+
"prepack": "pnpm run build",
|
|
60
|
+
"astro": "astro",
|
|
61
|
+
"check": "vp check --fix && astro check"
|
|
62
|
+
},
|
|
57
63
|
"dependencies": {
|
|
58
64
|
"@unocss/vite": "66.10.5",
|
|
59
65
|
"unocss": "66.10.5"
|
|
@@ -61,9 +67,8 @@
|
|
|
61
67
|
"devDependencies": {
|
|
62
68
|
"@astrojs/check": "0.9.10",
|
|
63
69
|
"@astrojs/solid-js": "7.0.2",
|
|
64
|
-
"@astrojs/ts-plugin": "1.10.12",
|
|
65
70
|
"@astrojs/vue": "7.0.3",
|
|
66
|
-
"@rimelight/config": "
|
|
71
|
+
"@rimelight/config": "workspace:*",
|
|
67
72
|
"@vitejs/plugin-vue": "6.0.9",
|
|
68
73
|
"astro": "7.3.3",
|
|
69
74
|
"solid-js": "1.9.15",
|
|
@@ -95,9 +100,5 @@
|
|
|
95
100
|
"engines": {
|
|
96
101
|
"node": ">=26.9.0"
|
|
97
102
|
},
|
|
98
|
-
"
|
|
99
|
-
|
|
100
|
-
"astro": "astro",
|
|
101
|
-
"check": "vp check --fix && astro check"
|
|
102
|
-
}
|
|
103
|
-
}
|
|
103
|
+
"packageManager": "pnpm@12.4.2"
|
|
104
|
+
}
|
|
@@ -62,7 +62,7 @@ function getSlotName(item: TimelineItem, base: string) {
|
|
|
62
62
|
{...rest}
|
|
63
63
|
>
|
|
64
64
|
{items && items.length > 0 ? (
|
|
65
|
-
items.map((item, index) => {
|
|
65
|
+
items.map(async (item, index) => {
|
|
66
66
|
const state = getItemState(item, index)
|
|
67
67
|
const isLast = index === items.length - 1
|
|
68
68
|
|
|
@@ -72,6 +72,7 @@ function getSlotName(item: TimelineItem, base: string) {
|
|
|
72
72
|
const itemTitleSlot = getSlotName(item, "title")
|
|
73
73
|
const itemDescriptionSlot = getSlotName(item, "description")
|
|
74
74
|
|
|
75
|
+
const hasDefaultSlot = Astro.slots.has("default")
|
|
75
76
|
const hasCustomIndicator = Astro.slots.has(itemIndicatorSlot) || (item.slot && Astro.slots.has("indicator"))
|
|
76
77
|
const hasCustomWrapper = Astro.slots.has(itemWrapperSlot) || (item.slot && Astro.slots.has("wrapper"))
|
|
77
78
|
const hasCustomDate = Astro.slots.has(itemDateSlot) || (item.slot && Astro.slots.has("date"))
|
|
@@ -98,9 +99,12 @@ function getSlotName(item: TimelineItem, base: string) {
|
|
|
98
99
|
ui={{ icon: "text-highlighted group-data-[state=completed]:text-inverted group-data-[state=active]:text-inverted", fallback: "text-highlighted group-data-[state=completed]:text-inverted group-data-[state=active]:text-inverted" }}
|
|
99
100
|
>
|
|
100
101
|
{hasCustomIndicator ? (
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
<Fragment
|
|
103
|
+
set:html={await Astro.slots.render(
|
|
104
|
+
Astro.slots.has(itemIndicatorSlot) ? itemIndicatorSlot : "indicator",
|
|
105
|
+
[item, index]
|
|
106
|
+
)}
|
|
107
|
+
/>
|
|
104
108
|
) : item.icon ? (
|
|
105
109
|
<RLAIcon name={item.icon} class="text-inherit" />
|
|
106
110
|
) : null}
|
|
@@ -120,9 +124,12 @@ function getSlotName(item: TimelineItem, base: string) {
|
|
|
120
124
|
class:list={[classes.wrapper, item.ui?.wrapper]}
|
|
121
125
|
>
|
|
122
126
|
{hasCustomWrapper ? (
|
|
123
|
-
<
|
|
124
|
-
|
|
125
|
-
|
|
127
|
+
<Fragment
|
|
128
|
+
set:html={await Astro.slots.render(
|
|
129
|
+
Astro.slots.has(itemWrapperSlot) ? itemWrapperSlot : "wrapper",
|
|
130
|
+
[item, index]
|
|
131
|
+
)}
|
|
132
|
+
/>
|
|
126
133
|
) : (
|
|
127
134
|
<>
|
|
128
135
|
{(item.date || hasCustomDate) && (
|
|
@@ -130,11 +137,16 @@ function getSlotName(item: TimelineItem, base: string) {
|
|
|
130
137
|
data-slot="date"
|
|
131
138
|
class:list={[classes.date, item.ui?.date]}
|
|
132
139
|
>
|
|
133
|
-
|
|
134
|
-
<
|
|
135
|
-
{
|
|
136
|
-
|
|
137
|
-
|
|
140
|
+
{hasCustomDate ? (
|
|
141
|
+
<Fragment
|
|
142
|
+
set:html={await Astro.slots.render(
|
|
143
|
+
Astro.slots.has(itemDateSlot) ? itemDateSlot : "date",
|
|
144
|
+
[item, index]
|
|
145
|
+
)}
|
|
146
|
+
/>
|
|
147
|
+
) : (
|
|
148
|
+
item.date
|
|
149
|
+
)}
|
|
138
150
|
</div>
|
|
139
151
|
)}
|
|
140
152
|
|
|
@@ -143,24 +155,38 @@ function getSlotName(item: TimelineItem, base: string) {
|
|
|
143
155
|
data-slot="title"
|
|
144
156
|
class:list={[classes.title, item.ui?.title]}
|
|
145
157
|
>
|
|
146
|
-
|
|
147
|
-
<
|
|
148
|
-
{
|
|
149
|
-
|
|
150
|
-
|
|
158
|
+
{hasCustomTitle ? (
|
|
159
|
+
<Fragment
|
|
160
|
+
set:html={await Astro.slots.render(
|
|
161
|
+
Astro.slots.has(itemTitleSlot) ? itemTitleSlot : "title",
|
|
162
|
+
[item, index]
|
|
163
|
+
)}
|
|
164
|
+
/>
|
|
165
|
+
) : (
|
|
166
|
+
item.title
|
|
167
|
+
)}
|
|
151
168
|
</div>
|
|
152
169
|
)}
|
|
153
170
|
|
|
154
|
-
{(item.description || hasCustomDescription) && (
|
|
171
|
+
{(item.description || hasCustomDescription || hasDefaultSlot) && (
|
|
155
172
|
<div
|
|
156
173
|
data-slot="description"
|
|
157
174
|
class:list={[classes.description, item.ui?.description]}
|
|
158
175
|
>
|
|
159
|
-
|
|
160
|
-
<
|
|
161
|
-
{item
|
|
162
|
-
|
|
163
|
-
|
|
176
|
+
{hasDefaultSlot ? (
|
|
177
|
+
<Fragment
|
|
178
|
+
set:html={await Astro.slots.render("default", [item, index])}
|
|
179
|
+
/>
|
|
180
|
+
) : hasCustomDescription ? (
|
|
181
|
+
<Fragment
|
|
182
|
+
set:html={await Astro.slots.render(
|
|
183
|
+
Astro.slots.has(itemDescriptionSlot) ? itemDescriptionSlot : "description",
|
|
184
|
+
[item, index]
|
|
185
|
+
)}
|
|
186
|
+
/>
|
|
187
|
+
) : (
|
|
188
|
+
item.description
|
|
189
|
+
)}
|
|
164
190
|
</div>
|
|
165
191
|
)}
|
|
166
192
|
</>
|
|
@@ -6,9 +6,14 @@ import RLSAvatar from "../avatar/RLSAvatar"
|
|
|
6
6
|
import RLSIcon from "../icon/RLSIcon"
|
|
7
7
|
|
|
8
8
|
export interface RLSTimelineProps extends TimelineProps {
|
|
9
|
-
children?:
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
children?:
|
|
10
|
+
| JSX.Element
|
|
11
|
+
| ((ctx: { item: TimelineItem; index: number } & TimelineItem) => JSX.Element)
|
|
12
|
+
indicator?: (ctx: { item: TimelineItem; index: number } & TimelineItem) => JSX.Element
|
|
13
|
+
wrapper?: (ctx: { item: TimelineItem; index: number } & TimelineItem) => JSX.Element
|
|
14
|
+
date?: (ctx: { item: TimelineItem; index: number } & TimelineItem) => JSX.Element
|
|
15
|
+
title?: (ctx: { item: TimelineItem; index: number } & TimelineItem) => JSX.Element
|
|
16
|
+
description?: (ctx: { item: TimelineItem; index: number } & TimelineItem) => JSX.Element
|
|
12
17
|
}
|
|
13
18
|
|
|
14
19
|
const RLSTimeline: Component<RLSTimelineProps> = (allProps) => {
|
|
@@ -26,7 +31,10 @@ const RLSTimeline: Component<RLSTimelineProps> = (allProps) => {
|
|
|
26
31
|
"class",
|
|
27
32
|
"children",
|
|
28
33
|
"indicator",
|
|
29
|
-
"wrapper"
|
|
34
|
+
"wrapper",
|
|
35
|
+
"date",
|
|
36
|
+
"title",
|
|
37
|
+
"description"
|
|
30
38
|
])
|
|
31
39
|
|
|
32
40
|
const items = (): TimelineItem[] => props.items ?? []
|
|
@@ -67,6 +75,19 @@ const RLSTimeline: Component<RLSTimelineProps> = (allProps) => {
|
|
|
67
75
|
})
|
|
68
76
|
)
|
|
69
77
|
|
|
78
|
+
const renderSlot = (
|
|
79
|
+
slotFn: any,
|
|
80
|
+
item: TimelineItem,
|
|
81
|
+
index: number,
|
|
82
|
+
fallback?: () => JSX.Element
|
|
83
|
+
) => {
|
|
84
|
+
if (typeof slotFn === "function") {
|
|
85
|
+
const ctx = { ...item, item, index }
|
|
86
|
+
return slotFn(ctx)
|
|
87
|
+
}
|
|
88
|
+
return fallback ? fallback() : null
|
|
89
|
+
}
|
|
90
|
+
|
|
70
91
|
return (
|
|
71
92
|
<Dynamic
|
|
72
93
|
component={props.as || "div"}
|
|
@@ -107,7 +128,7 @@ const RLSTimeline: Component<RLSTimelineProps> = (allProps) => {
|
|
|
107
128
|
}}
|
|
108
129
|
>
|
|
109
130
|
{props.indicator ? (
|
|
110
|
-
props.indicator
|
|
131
|
+
renderSlot(props.indicator, item, index())
|
|
111
132
|
) : item.icon ? (
|
|
112
133
|
<RLSIcon name={item.icon} class="text-inherit" />
|
|
113
134
|
) : null}
|
|
@@ -127,31 +148,35 @@ const RLSTimeline: Component<RLSTimelineProps> = (allProps) => {
|
|
|
127
148
|
class={`${resolvedClasses().wrapper} ${item.ui?.wrapper || ""}`}
|
|
128
149
|
>
|
|
129
150
|
{props.wrapper ? (
|
|
130
|
-
props.wrapper
|
|
151
|
+
renderSlot(props.wrapper, item, index())
|
|
131
152
|
) : (
|
|
132
153
|
<>
|
|
133
|
-
{item.date ? (
|
|
154
|
+
{item.date || props.date ? (
|
|
134
155
|
<div
|
|
135
156
|
data-slot="date"
|
|
136
157
|
class={`${resolvedClasses().date} ${item.ui?.date || ""}`}
|
|
137
158
|
>
|
|
138
|
-
{item.date}
|
|
159
|
+
{renderSlot(props.date, item, index(), () => item.date)}
|
|
139
160
|
</div>
|
|
140
161
|
) : null}
|
|
141
|
-
{item.title ? (
|
|
162
|
+
{item.title || props.title ? (
|
|
142
163
|
<div
|
|
143
164
|
data-slot="title"
|
|
144
165
|
class={`${resolvedClasses().title} ${item.ui?.title || ""}`}
|
|
145
166
|
>
|
|
146
|
-
{item.title}
|
|
167
|
+
{renderSlot(props.title, item, index(), () => item.title)}
|
|
147
168
|
</div>
|
|
148
169
|
) : null}
|
|
149
|
-
{item.description
|
|
170
|
+
{item.description ||
|
|
171
|
+
props.description ||
|
|
172
|
+
typeof props.children === "function" ? (
|
|
150
173
|
<div
|
|
151
174
|
data-slot="description"
|
|
152
175
|
class={`${resolvedClasses().description} ${item.ui?.description || ""}`}
|
|
153
176
|
>
|
|
154
|
-
{
|
|
177
|
+
{typeof props.children === "function"
|
|
178
|
+
? renderSlot(props.children, item, index(), () => item.description)
|
|
179
|
+
: renderSlot(props.description, item, index(), () => item.description)}
|
|
155
180
|
</div>
|
|
156
181
|
) : null}
|
|
157
182
|
</>
|
|
@@ -161,7 +186,7 @@ const RLSTimeline: Component<RLSTimelineProps> = (allProps) => {
|
|
|
161
186
|
)
|
|
162
187
|
}}
|
|
163
188
|
</For>
|
|
164
|
-
) : props.children ? (
|
|
189
|
+
) : typeof props.children !== "function" ? (
|
|
165
190
|
props.children
|
|
166
191
|
) : null}
|
|
167
192
|
</Dynamic>
|
|
@@ -21,6 +21,16 @@ export interface TimelineItem {
|
|
|
21
21
|
[key: string]: any
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
export interface TimelineItemProps extends TimelineItem {
|
|
25
|
+
as?: any
|
|
26
|
+
isLast?: boolean
|
|
27
|
+
state?: "active" | "completed"
|
|
28
|
+
size?: "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl"
|
|
29
|
+
color?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral"
|
|
30
|
+
orientation?: "horizontal" | "vertical"
|
|
31
|
+
class?: any
|
|
32
|
+
}
|
|
33
|
+
|
|
24
34
|
export interface TimelineProps<T extends TimelineItem = TimelineItem> {
|
|
25
35
|
/**
|
|
26
36
|
* The element or component this component should render as.
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Rimelight Entertainment
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|