@rimelight/ui 0.0.56 → 0.0.58
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 +5 -5
- package/src/components/avatar/avatar.theme.ts +58 -1
- package/src/components/avatar/avatar.ts +21 -1
- package/src/components/avatar-group/RLAAvatarGroup.astro +37 -161
- package/src/components/avatar-group/RLSAvatarGroup.tsx +37 -121
- package/src/components/breadcrumb/RLABreadcrumb.astro +59 -196
- package/src/components/breadcrumb/RLSBreadcrumb.tsx +57 -120
- package/src/components/card/RLSCard.tsx +1 -2
- package/src/components/card/RLVCard.vue +1 -2
- package/src/components/carousel/RLACarousel.astro +2 -1
- package/src/components/carousel/RLSCarousel.tsx +3 -11
- package/src/components/chart/RLAChart.astro +211 -219
- package/src/components/dashboard-navbar/RLADashboardNavbar.astro +1 -1
- package/src/components/dashboard-navbar/RLSDashboardNavbar.tsx +1 -15
- package/src/components/dashboard-panel/RLADashboardPanel.astro +1 -1
- package/src/components/dashboard-panel/RLSDashboardPanel.tsx +1 -6
- package/src/components/dashboard-search/RLADashboardSearch.astro +1 -1
- package/src/components/head/UIHead.astro +0 -11
- package/src/components/image/RLAImage.astro +15 -20
- package/src/components/image/RLSImage.tsx +5 -12
- package/src/components/image/image.theme.ts +4 -4
- package/src/components/input-rating/RLAInputRating.astro +19 -14
- package/src/components/input-rating/RLSInputRating.tsx +39 -32
- package/src/components/input-tags/RLAInputTags.astro +27 -137
- package/src/components/layout-grid/RLALayoutGrid.astro +4 -4
- package/src/components/logo/RLALogo.astro +0 -16
- package/src/components/logo/RLSLogo.tsx +1 -8
- package/src/components/marquee/RLAMarquee.astro +55 -62
- package/src/components/page-section/RLAPageSection.astro +2 -2
- package/src/components/progress/RLAProgress.astro +39 -38
- package/src/components/progress/RLSProgress.tsx +16 -5
- package/src/components/progress/progress.theme.ts +1 -1
- package/src/components/scroll-area/RLAScrollArea.astro +4 -5
- package/src/components/scroll-area/RLSScrollArea.tsx +5 -6
- package/src/components/splitter/RLASplitter.astro +217 -230
- package/src/components/splitter/RLSSplitter.tsx +2 -6
- package/src/components/steps/RLASteps.astro +110 -110
- package/src/components/sticky-surface/RLAStickySurface.astro +49 -67
- package/src/components/table/RLATable.astro +16 -46
- package/src/components/tabs/RLATabs.astro +352 -385
- package/src/components/textarea/RLATextarea.astro +1 -2
- package/src/components/theme-selector/RLAThemeSelector.astro +6 -6
- package/src/components/tooltip/RLATooltip.astro +7 -11
|
@@ -3,171 +3,86 @@ import type { BreadcrumbProps } from "./breadcrumb"
|
|
|
3
3
|
import { breadcrumbTheme } from "./breadcrumb.theme"
|
|
4
4
|
import RLAIcon from "../icon/RLAIcon.astro"
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
6
|
const {
|
|
9
7
|
items,
|
|
10
8
|
maxVisible,
|
|
11
|
-
estimatedItemWidth = 120,
|
|
12
9
|
separatorIcon = "chevronRight",
|
|
13
10
|
...rest
|
|
14
11
|
} = Astro.props as BreadcrumbProps
|
|
15
12
|
|
|
16
13
|
const classes = breadcrumbTheme(Astro.props)
|
|
17
14
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
//
|
|
22
|
-
// • First and last items are ALWAYS visible.
|
|
23
|
-
// • Middle items (everything between first and last) get `.hidable` class.
|
|
24
|
-
// • Server-side: if `maxVisible` is set, excess middle items are pre-hidden
|
|
25
|
-
// (not rendered) and counted in --base-hidden.
|
|
26
|
-
// • Client-side: container queries progressively hide rendered middle items
|
|
27
|
-
// from left to right (oldest ancestors first), updating --hidden-items.
|
|
28
|
-
// • The overflow `<li>` always lives in the DOM between the first item and
|
|
29
|
-
// the first middle item. CSS shows/hides it based on whether any items
|
|
30
|
-
// are hidden.
|
|
31
|
-
// • CSS counter: "…+N" = counter-reset: calc(--base-hidden + --hidden-items).
|
|
32
|
-
//
|
|
33
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
34
|
-
|
|
35
|
-
const uid = Math.random().toString(36).substring(2, 9)
|
|
36
|
-
const cName = `rla-bc-${uid}`
|
|
37
|
-
|
|
38
|
-
// Restructure items into: first | midItems | last
|
|
39
|
-
const allItems = items ?? []
|
|
40
|
-
const firstItem = allItems[0]
|
|
41
|
-
const lastItem = allItems.length > 1 ? allItems[allItems.length - 1] : null
|
|
15
|
+
const allItems = items ?? []
|
|
16
|
+
const firstItem = allItems[0]
|
|
17
|
+
const lastItem = allItems.length > 1 ? allItems[allItems.length - 1] : null
|
|
42
18
|
const allMidItems = allItems.length > 2 ? allItems.slice(1, allItems.length - 1) : []
|
|
43
19
|
|
|
44
|
-
// If maxVisible is provided, pre-truncate middle items:
|
|
45
|
-
// always keep the last (maxVisible - 2) mid items (closest to current page).
|
|
46
|
-
// The rest are base-hidden.
|
|
47
20
|
const effectiveMaxMid = maxVisible !== undefined
|
|
48
|
-
? Math.max(0, maxVisible - 2)
|
|
49
|
-
: allMidItems.length
|
|
21
|
+
? Math.max(0, maxVisible - 2)
|
|
22
|
+
: allMidItems.length
|
|
50
23
|
|
|
51
|
-
// Keep mid items closest to the last page (most recent ancestors)
|
|
52
24
|
const renderedMidItems = allMidItems.slice(allMidItems.length - effectiveMaxMid)
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
// We show the overflow indicator when:
|
|
56
|
-
// a) There are already pre-hidden items (base-hidden > 0), OR
|
|
57
|
-
// b) There are rendered mid items that could be collapsed by container queries
|
|
58
|
-
const hasMidItems = renderedMidItems.length > 0
|
|
59
|
-
const needsOverflow = allItems.length > 2 // need both first AND last to have a middle
|
|
60
|
-
|
|
61
|
-
// ── Generate per-instance container-query CSS ─────────────────────────────────
|
|
62
|
-
//
|
|
63
|
-
// DOM layout (positions):
|
|
64
|
-
// 1 = first item
|
|
65
|
-
// 2 = overflow indicator (always in DOM)
|
|
66
|
-
// 3..N = rendered mid items (hidable, starting from leftmost = oldest ancestor)
|
|
67
|
-
// N+1 = last item
|
|
68
|
-
//
|
|
69
|
-
// We hide mid items from left to right (oldest ancestor first), so breakpoints
|
|
70
|
-
// target nth-child(3), then nth-child(4), etc.
|
|
71
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
72
|
-
let instanceCss = ""
|
|
73
|
-
if (needsOverflow && hasMidItems) {
|
|
74
|
-
for (let i = 0; i < renderedMidItems.length; i++) {
|
|
75
|
-
const hiddenItems = i + 1
|
|
76
|
-
// Visible items after hiding: first + (midItems - hiddenItems) + last
|
|
77
|
-
const visibleMids = renderedMidItems.length - hiddenItems
|
|
78
|
-
const visibleTotal = 2 + visibleMids // first + last always shown
|
|
79
|
-
// Min container width for the visible breadcrumb items
|
|
80
|
-
const maxWidth = visibleTotal * estimatedItemWidth + 60 // 60px for overflow indicator
|
|
81
|
-
// The mid item to newly hide at this breakpoint (nth-child position):
|
|
82
|
-
// overflow indicator is at position 2, mids start at position 3
|
|
83
|
-
// we hide from the leftmost (position 3) first
|
|
84
|
-
const hideNthChild = 3 + i
|
|
85
|
-
|
|
86
|
-
instanceCss += `\n@container ${cName} (max-width: ${maxWidth}px) {`
|
|
87
|
-
instanceCss += `\n [data-bc="${uid}"] { --hidden-items: ${hiddenItems}; }`
|
|
88
|
-
instanceCss += `\n [data-bc="${uid}"] > li.hidable:nth-child(${hideNthChild}) { display: none; }`
|
|
89
|
-
// Always show the overflow indicator when any mid item is hidden
|
|
90
|
-
instanceCss += `\n [data-bc="${uid}"] > .rla-bc-overflow { display: flex; }`
|
|
91
|
-
instanceCss += `\n}`
|
|
92
|
-
}
|
|
93
|
-
}
|
|
25
|
+
const hiddenMidCount = Math.max(0, allMidItems.length - effectiveMaxMid)
|
|
26
|
+
const hasMidItems = renderedMidItems.length > 0
|
|
94
27
|
---
|
|
95
28
|
|
|
96
29
|
<nav class={classes.root} data-slot="breadcrumb-root" {...rest}>
|
|
97
30
|
{items ? (
|
|
98
|
-
<
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
<li class={classes.item} data-slot="item">
|
|
111
|
-
{firstItem.href ? (
|
|
112
|
-
<a href={firstItem.href} class={classes.link} data-slot="link">
|
|
113
|
-
{firstItem.label}
|
|
114
|
-
</a>
|
|
115
|
-
) : (
|
|
116
|
-
<span class={classes.page} data-slot="page">{firstItem.label}</span>
|
|
117
|
-
)}
|
|
118
|
-
{(hasMidItems || lastItem) && (
|
|
119
|
-
<span class={classes.separator} data-slot="separator" aria-hidden="true">
|
|
120
|
-
<RLAIcon name={separatorIcon} />
|
|
121
|
-
</span>
|
|
122
|
-
)}
|
|
123
|
-
</li>
|
|
124
|
-
)}
|
|
125
|
-
|
|
126
|
-
{/* ── Overflow indicator (always in DOM; shown by CSS when items are hidden) */}
|
|
127
|
-
{needsOverflow && (
|
|
128
|
-
<li
|
|
129
|
-
class:list={[
|
|
130
|
-
"rla-bc-overflow",
|
|
131
|
-
// Shown by default only when there are pre-hidden base items
|
|
132
|
-
baseHiddenCount === 0 && "rla-bc-overflow-hidden"
|
|
133
|
-
]}
|
|
134
|
-
aria-hidden="true"
|
|
135
|
-
data-slot="overflow"
|
|
136
|
-
>
|
|
137
|
-
<span class="rla-bc-ellipsis">…</span>
|
|
138
|
-
<span class="rla-bc-more-count" />
|
|
139
|
-
<span class={classes.separator} data-slot="separator" aria-hidden="true">
|
|
140
|
-
<RLAIcon name={separatorIcon} />
|
|
141
|
-
</span>
|
|
142
|
-
</li>
|
|
143
|
-
)}
|
|
144
|
-
|
|
145
|
-
{/* ── Middle items (hidable — oldest ancestors first) ─────────── */}
|
|
146
|
-
{renderedMidItems.map((item) => (
|
|
147
|
-
<li class:list={[classes.item, "hidable"]} data-slot="item">
|
|
148
|
-
{item.href ? (
|
|
149
|
-
<a href={item.href} class={classes.link} data-slot="link">
|
|
150
|
-
{item.label}
|
|
151
|
-
</a>
|
|
152
|
-
) : (
|
|
153
|
-
<span class={classes.page} data-slot="page">{item.label}</span>
|
|
154
|
-
)}
|
|
31
|
+
<ol class={classes.list} data-slot="list">
|
|
32
|
+
{/* ── First item ─────────────────────────────── */}
|
|
33
|
+
{firstItem && (
|
|
34
|
+
<li class={classes.item} data-slot="item">
|
|
35
|
+
{firstItem.href ? (
|
|
36
|
+
<a href={firstItem.href} class={classes.link} data-slot="link">
|
|
37
|
+
{firstItem.label}
|
|
38
|
+
</a>
|
|
39
|
+
) : (
|
|
40
|
+
<span class={classes.page} data-slot="page">{firstItem.label}</span>
|
|
41
|
+
)}
|
|
42
|
+
{(hasMidItems || hiddenMidCount > 0 || lastItem) && (
|
|
155
43
|
<span class={classes.separator} data-slot="separator" aria-hidden="true">
|
|
156
44
|
<RLAIcon name={separatorIcon} />
|
|
157
45
|
</span>
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
46
|
+
)}
|
|
47
|
+
</li>
|
|
48
|
+
)}
|
|
49
|
+
|
|
50
|
+
{/* ── Truncation overflow indicator if maxVisible was exceeded */}
|
|
51
|
+
{hiddenMidCount > 0 && (
|
|
52
|
+
<li class="inline-flex items-center gap-1 list-none shrink-0" aria-hidden="true" data-slot="overflow">
|
|
53
|
+
<span class="text-muted tracking-wider font-medium">…</span>
|
|
54
|
+
<span class="text-muted text-[11px] font-semibold">+{hiddenMidCount}</span>
|
|
55
|
+
<span class={classes.separator} data-slot="separator" aria-hidden="true">
|
|
56
|
+
<RLAIcon name={separatorIcon} />
|
|
57
|
+
</span>
|
|
58
|
+
</li>
|
|
59
|
+
)}
|
|
60
|
+
|
|
61
|
+
{/* ── Middle items ─────────── */}
|
|
62
|
+
{renderedMidItems.map((item) => (
|
|
63
|
+
<li class={classes.item} data-slot="item">
|
|
64
|
+
{item.href ? (
|
|
65
|
+
<a href={item.href} class={classes.link} data-slot="link">
|
|
66
|
+
{item.label}
|
|
67
|
+
</a>
|
|
68
|
+
) : (
|
|
69
|
+
<span class={classes.page} data-slot="page">{item.label}</span>
|
|
70
|
+
)}
|
|
71
|
+
<span class={classes.separator} data-slot="separator" aria-hidden="true">
|
|
72
|
+
<RLAIcon name={separatorIcon} />
|
|
73
|
+
</span>
|
|
74
|
+
</li>
|
|
75
|
+
))}
|
|
76
|
+
|
|
77
|
+
{/* ── Last item ─────────────────── */}
|
|
78
|
+
{lastItem && (
|
|
79
|
+
<li class={classes.item} data-slot="item">
|
|
80
|
+
<span class={classes.page} data-slot="page" aria-current="page">
|
|
81
|
+
{lastItem.label}
|
|
82
|
+
</span>
|
|
83
|
+
</li>
|
|
84
|
+
)}
|
|
85
|
+
</ol>
|
|
171
86
|
) : (
|
|
172
87
|
<ol class={classes.list} data-slot="list">
|
|
173
88
|
<slot />
|
|
@@ -175,58 +90,6 @@ if (needsOverflow && hasMidItems) {
|
|
|
175
90
|
)}
|
|
176
91
|
</nav>
|
|
177
92
|
|
|
178
|
-
<!-- Per-instance container-query CSS scoped via data-bc attribute -->
|
|
179
|
-
<style is:inline set:html={instanceCss} />
|
|
180
|
-
|
|
181
|
-
<style>
|
|
182
|
-
.rla-bc-host {
|
|
183
|
-
display: block;
|
|
184
|
-
width: 100%;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/* Overflow indicator: shown by CSS, hidden by default when base-hidden is 0 */
|
|
188
|
-
.rla-bc-overflow {
|
|
189
|
-
display: flex;
|
|
190
|
-
align-items: center;
|
|
191
|
-
gap: 0.25rem;
|
|
192
|
-
list-style: none;
|
|
193
|
-
flex-shrink: 0;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
/* When base-hidden is 0 AND no container query has fired yet */
|
|
197
|
-
.rla-bc-overflow-hidden {
|
|
198
|
-
display: none;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
.rla-bc-ellipsis {
|
|
202
|
-
color: var(--rl-neutral-600);
|
|
203
|
-
letter-spacing: 0.05em;
|
|
204
|
-
font-weight: 500;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/*
|
|
208
|
-
* CSS Counter — sums --base-hidden (render-time, from maxVisible prop) +
|
|
209
|
-
* --hidden-items (set by container queries as width shrinks).
|
|
210
|
-
*
|
|
211
|
-
* Shows nothing when the count is 0.
|
|
212
|
-
* Shows "+N" when N > 0.
|
|
213
|
-
*/
|
|
214
|
-
.rla-bc-more-count::after {
|
|
215
|
-
counter-reset: rla-bc-cnt calc(var(--base-hidden, 0) + var(--hidden-items, 0));
|
|
216
|
-
content: "+" counter(rla-bc-cnt);
|
|
217
|
-
/* Hide the "+0" case by using color:transparent when counter is 0.
|
|
218
|
-
CSS cannot conditionally suppress content based on counter value,
|
|
219
|
-
so we rely on the counter never being 0 when this element is visible
|
|
220
|
-
(the overflow li is only shown when --base-hidden > 0 or a container
|
|
221
|
-
query is active). */
|
|
222
|
-
color: var(--rl-neutral-600);
|
|
223
|
-
font-size: 0.6875rem;
|
|
224
|
-
font-weight: 600;
|
|
225
|
-
vertical-align: super;
|
|
226
|
-
line-height: 1;
|
|
227
|
-
}
|
|
228
|
-
</style>
|
|
229
|
-
|
|
230
93
|
{items && (
|
|
231
94
|
<script type="application/ld+json" is:inline set:html={JSON.stringify({
|
|
232
95
|
"@context": "https://schema.org",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createMemo, splitProps, type Component, type JSX } from "solid-js"
|
|
1
|
+
import { createMemo, splitProps, For, type Component, type JSX } from "solid-js"
|
|
2
2
|
import type { BreadcrumbItem, BreadcrumbProps } from "./breadcrumb"
|
|
3
3
|
import { breadcrumbTheme } from "./breadcrumb.theme"
|
|
4
4
|
import RLSIcon from "../icon/RLSIcon"
|
|
@@ -27,39 +27,18 @@ const RLSBreadcrumb: Component<RLSBreadcrumbProps> = (allProps) => {
|
|
|
27
27
|
})
|
|
28
28
|
)
|
|
29
29
|
|
|
30
|
-
const allItems = props.items ?? []
|
|
31
|
-
const firstItem = allItems[0]
|
|
32
|
-
const lastItem = allItems.length > 1 ? allItems[allItems.length - 1] : null
|
|
33
|
-
const allMidItems =
|
|
30
|
+
const allItems = () => props.items ?? []
|
|
31
|
+
const firstItem = () => allItems()[0]
|
|
32
|
+
const lastItem = () => (allItems().length > 1 ? allItems()[allItems().length - 1] : null)
|
|
33
|
+
const allMidItems = () =>
|
|
34
|
+
allItems().length > 2 ? allItems().slice(1, allItems().length - 1) : []
|
|
34
35
|
|
|
35
|
-
const effectiveMaxMid =
|
|
36
|
-
props.maxVisible !== undefined ? Math.max(0, props.maxVisible - 2) : allMidItems.length
|
|
36
|
+
const effectiveMaxMid = () =>
|
|
37
|
+
props.maxVisible !== undefined ? Math.max(0, props.maxVisible - 2) : allMidItems().length
|
|
37
38
|
|
|
38
|
-
const renderedMidItems = allMidItems.slice(allMidItems.length - effectiveMaxMid)
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
const hasMidItems = renderedMidItems.length > 0
|
|
42
|
-
const needsOverflow = allItems.length > 2
|
|
43
|
-
|
|
44
|
-
const uid = Math.random().toString(36).substring(2, 9)
|
|
45
|
-
const cName = `rla-bc-${uid}`
|
|
46
|
-
|
|
47
|
-
let instanceCss = ""
|
|
48
|
-
if (needsOverflow && hasMidItems) {
|
|
49
|
-
for (let i = 0; i < renderedMidItems.length; i++) {
|
|
50
|
-
const hiddenItems = i + 1
|
|
51
|
-
const visibleMids = renderedMidItems.length - hiddenItems
|
|
52
|
-
const visibleTotal = 2 + visibleMids
|
|
53
|
-
const maxWidth = visibleTotal * (props.estimatedItemWidth ?? 120) + 60
|
|
54
|
-
const hideNthChild = 3 + i
|
|
55
|
-
|
|
56
|
-
instanceCss += `\n@container ${cName} (max-width: ${maxWidth}px) {`
|
|
57
|
-
instanceCss += `\n [data-bc="${uid}"] { --hidden-items: ${hiddenItems}; }`
|
|
58
|
-
instanceCss += `\n [data-bc="${uid}"] > li.hidable:nth-child(${hideNthChild}) { display: none; }`
|
|
59
|
-
instanceCss += `\n [data-bc="${uid}"] > .rla-bc-overflow { display: flex; }`
|
|
60
|
-
instanceCss += `\n}`
|
|
61
|
-
}
|
|
62
|
-
}
|
|
39
|
+
const renderedMidItems = () => allMidItems().slice(allMidItems().length - effectiveMaxMid())
|
|
40
|
+
const hiddenMidCount = () => Math.max(0, allMidItems().length - effectiveMaxMid())
|
|
41
|
+
const hasMidItems = () => renderedMidItems().length > 0
|
|
63
42
|
|
|
64
43
|
const separatorEl = () => (
|
|
65
44
|
<span class={classes()["separator"]} data-slot="separator" aria-hidden="true">
|
|
@@ -82,101 +61,61 @@ const RLSBreadcrumb: Component<RLSBreadcrumbProps> = (allProps) => {
|
|
|
82
61
|
</span>
|
|
83
62
|
)
|
|
84
63
|
|
|
85
|
-
const ldJson =
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
"
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
display: block;
|
|
99
|
-
width: 100%;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.rla-bc-overflow {
|
|
103
|
-
display: flex;
|
|
104
|
-
align-items: center;
|
|
105
|
-
gap: 0.25rem;
|
|
106
|
-
list-style: none;
|
|
107
|
-
flex-shrink: 0;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.rla-bc-overflow-hidden {
|
|
111
|
-
display: none;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.rla-bc-ellipsis {
|
|
115
|
-
color: var(--rl-neutral-600);
|
|
116
|
-
letter-spacing: 0.05em;
|
|
117
|
-
font-weight: 500;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.rla-bc-more-count::after {
|
|
121
|
-
counter-reset: rla-bc-cnt calc(var(--base-hidden, 0) + var(--hidden-items, 0));
|
|
122
|
-
content: "+" counter(rla-bc-cnt);
|
|
123
|
-
color: var(--rl-neutral-600);
|
|
124
|
-
font-size: 0.6875rem;
|
|
125
|
-
font-weight: 600;
|
|
126
|
-
vertical-align: super;
|
|
127
|
-
line-height: 1;
|
|
128
|
-
}`
|
|
64
|
+
const ldJson = () =>
|
|
65
|
+
JSON.stringify({
|
|
66
|
+
"@context": "https://schema.org",
|
|
67
|
+
"@type": "BreadcrumbList",
|
|
68
|
+
"itemListElement": allItems().map((item, idx) => ({
|
|
69
|
+
"@type": "ListItem",
|
|
70
|
+
"position": idx + 1,
|
|
71
|
+
"name": item.label,
|
|
72
|
+
"item": item.href
|
|
73
|
+
? new URL(item.href, "https://starter.rimelight.com").toString()
|
|
74
|
+
: undefined
|
|
75
|
+
}))
|
|
76
|
+
})
|
|
129
77
|
|
|
130
78
|
return (
|
|
131
79
|
<>
|
|
132
80
|
<nav aria-label="breadcrumb" class={classes()["root"]} data-slot="breadcrumb-root" {...rest}>
|
|
133
81
|
{props.items ? (
|
|
134
|
-
<
|
|
135
|
-
|
|
136
|
-
class={classes()["
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
82
|
+
<ol class={classes()["list"]} data-slot="list">
|
|
83
|
+
{firstItem() && (
|
|
84
|
+
<li class={classes()["item"]} data-slot="item">
|
|
85
|
+
{itemMarker(firstItem()!)}
|
|
86
|
+
{(hasMidItems() || hiddenMidCount() > 0 || lastItem()) && separatorEl()}
|
|
87
|
+
</li>
|
|
88
|
+
)}
|
|
89
|
+
|
|
90
|
+
{hiddenMidCount() > 0 && (
|
|
91
|
+
<li
|
|
92
|
+
class="inline-flex items-center gap-1 list-none shrink-0"
|
|
93
|
+
aria-hidden="true"
|
|
94
|
+
data-slot="overflow"
|
|
95
|
+
>
|
|
96
|
+
<span class="text-muted tracking-wider font-medium">…</span>
|
|
97
|
+
<span class="text-muted text-[11px] font-semibold">+{hiddenMidCount()}</span>
|
|
98
|
+
{separatorEl()}
|
|
99
|
+
</li>
|
|
100
|
+
)}
|
|
101
|
+
|
|
102
|
+
<For each={renderedMidItems()}>
|
|
103
|
+
{(item) => (
|
|
142
104
|
<li class={classes()["item"]} data-slot="item">
|
|
143
|
-
{itemMarker(firstItem)}
|
|
144
|
-
{(hasMidItems || lastItem) && separatorEl()}
|
|
145
|
-
</li>
|
|
146
|
-
)}
|
|
147
|
-
|
|
148
|
-
{needsOverflow && (
|
|
149
|
-
<li
|
|
150
|
-
class={
|
|
151
|
-
baseHiddenCount === 0
|
|
152
|
-
? "rla-bc-overflow rla-bc-overflow-hidden"
|
|
153
|
-
: "rla-bc-overflow"
|
|
154
|
-
}
|
|
155
|
-
aria-hidden="true"
|
|
156
|
-
data-slot="overflow"
|
|
157
|
-
>
|
|
158
|
-
<span class="rla-bc-ellipsis">…</span>
|
|
159
|
-
<span class="rla-bc-more-count" />
|
|
160
|
-
{separatorEl()}
|
|
161
|
-
</li>
|
|
162
|
-
)}
|
|
163
|
-
|
|
164
|
-
{renderedMidItems.map((item) => (
|
|
165
|
-
<li class={`${classes()["item"]} hidable`} data-slot="item">
|
|
166
105
|
{itemMarker(item)}
|
|
167
106
|
{separatorEl()}
|
|
168
107
|
</li>
|
|
169
|
-
))}
|
|
170
|
-
|
|
171
|
-
{lastItem && (
|
|
172
|
-
<li class={classes()["item"]} data-slot="item">
|
|
173
|
-
<span class={classes()["page"]} data-slot="page" aria-current="page">
|
|
174
|
-
{lastItem.label}
|
|
175
|
-
</span>
|
|
176
|
-
</li>
|
|
177
108
|
)}
|
|
178
|
-
</
|
|
179
|
-
|
|
109
|
+
</For>
|
|
110
|
+
|
|
111
|
+
{lastItem() && (
|
|
112
|
+
<li class={classes()["item"]} data-slot="item">
|
|
113
|
+
<span class={classes()["page"]} data-slot="page" aria-current="page">
|
|
114
|
+
{lastItem()!.label}
|
|
115
|
+
</span>
|
|
116
|
+
</li>
|
|
117
|
+
)}
|
|
118
|
+
</ol>
|
|
180
119
|
) : (
|
|
181
120
|
<ol class={classes()["list"]} data-slot="list">
|
|
182
121
|
{props.children}
|
|
@@ -184,9 +123,7 @@ const RLSBreadcrumb: Component<RLSBreadcrumbProps> = (allProps) => {
|
|
|
184
123
|
)}
|
|
185
124
|
</nav>
|
|
186
125
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
{props.items && <script type="application/ld+json" innerHTML={ldJson} />}
|
|
126
|
+
{props.items && <script type="application/ld+json" innerHTML={ldJson()} />}
|
|
190
127
|
</>
|
|
191
128
|
)
|
|
192
129
|
}
|
|
@@ -100,9 +100,8 @@ const RLSCard: Component<RLSCardProps> = (allProps) => {
|
|
|
100
100
|
return (
|
|
101
101
|
<a
|
|
102
102
|
href={props.href}
|
|
103
|
-
class={resolvedClasses().root}
|
|
103
|
+
class={`${resolvedClasses().root} no-underline`}
|
|
104
104
|
data-slot="card-root"
|
|
105
|
-
style={{ "text-decoration": "none" }}
|
|
106
105
|
{...rest}
|
|
107
106
|
>
|
|
108
107
|
{content()}
|
|
@@ -32,9 +32,8 @@ const Tag = computed(() => (props.href ? "a" : "div"))
|
|
|
32
32
|
:is="Tag"
|
|
33
33
|
v-bind="attrs"
|
|
34
34
|
:href="href"
|
|
35
|
-
:class="resolvedClasses.root"
|
|
35
|
+
:class="[resolvedClasses.root, href && 'no-underline']"
|
|
36
36
|
data-slot="card-root"
|
|
37
|
-
:style="href ? { textDecoration: 'none' } : undefined"
|
|
38
37
|
>
|
|
39
38
|
<slot name="media">
|
|
40
39
|
<div v-if="mediaSrc" :class="resolvedClasses.media" data-slot="media">
|
|
@@ -23,7 +23,6 @@ const carouselId = `rla-carousel-${Math.random().toString(36).substring(2, 9)}`
|
|
|
23
23
|
<div
|
|
24
24
|
class={`${classes.slide} rla-carousel-slide`}
|
|
25
25
|
data-slot="slide"
|
|
26
|
-
style="container-type: scroll-state; container-name: rla-slide;"
|
|
27
26
|
>
|
|
28
27
|
<div class="relative w-full aspect-video">
|
|
29
28
|
{slide.imageSrc && <img src={slide.imageSrc} alt={slide.title || ""} class="w-full h-full object-cover rounded-lg" draggable="false" />}
|
|
@@ -325,6 +324,8 @@ const carouselId = `rla-carousel-${Math.random().toString(36).substring(2, 9)}`
|
|
|
325
324
|
|
|
326
325
|
/* Smooth transition between states */
|
|
327
326
|
.rla-carousel-slide {
|
|
327
|
+
container-type: scroll-state;
|
|
328
|
+
container-name: rla-slide;
|
|
328
329
|
transition: opacity 0.35s ease, scale 0.35s ease;
|
|
329
330
|
}
|
|
330
331
|
</style>
|
|
@@ -157,11 +157,7 @@ const RLSCarousel: Component<RLSCarouselProps> = (allProps) => {
|
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
const renderSlide = (slide: CarouselSlide) => (
|
|
160
|
-
<div
|
|
161
|
-
class={`${resolvedClasses().slide} rla-carousel-slide`}
|
|
162
|
-
data-slot="slide"
|
|
163
|
-
style="container-type: scroll-state; container-name: rla-slide;"
|
|
164
|
-
>
|
|
160
|
+
<div class={`${resolvedClasses().slide} rla-carousel-slide`} data-slot="slide">
|
|
165
161
|
<div class="relative w-full aspect-video">
|
|
166
162
|
{slide.imageSrc ? (
|
|
167
163
|
<img
|
|
@@ -182,7 +178,7 @@ const RLSCarousel: Component<RLSCarouselProps> = (allProps) => {
|
|
|
182
178
|
)
|
|
183
179
|
|
|
184
180
|
return (
|
|
185
|
-
<div data-autoplay={props.autoplay ? "true" : "false"}
|
|
181
|
+
<div data-autoplay={props.autoplay ? "true" : "false"} class="contents" {...rest}>
|
|
186
182
|
<div id={carouselId} class={resolvedClasses().root} data-slot="root">
|
|
187
183
|
<div
|
|
188
184
|
ref={(el) => (viewportRef = el)}
|
|
@@ -206,11 +202,7 @@ const RLSCarousel: Component<RLSCarouselProps> = (allProps) => {
|
|
|
206
202
|
<For each={props.slides}>{(slide) => renderSlide(slide)}</For>
|
|
207
203
|
) : (
|
|
208
204
|
childrenContent.toArray().map((child) => (
|
|
209
|
-
<div
|
|
210
|
-
class={`${resolvedClasses().slide} rla-carousel-slide`}
|
|
211
|
-
data-slot="slide"
|
|
212
|
-
style="container-type: scroll-state; container-name: rla-slide;"
|
|
213
|
-
>
|
|
205
|
+
<div class={`${resolvedClasses().slide} rla-carousel-slide`} data-slot="slide">
|
|
214
206
|
{child}
|
|
215
207
|
</div>
|
|
216
208
|
))
|