@rimelight/ui 0.0.43 → 0.0.44
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/LICENSE +21 -0
- package/README.md +14 -12
- package/package.json +11 -14
- package/src/components/avatar/RLAAvatar.astro +4 -12
- package/src/components/badge/RLABadge.astro +2 -1
- package/src/components/badge/badge.theme.ts +0 -4
- package/src/components/banner/RLABanner.astro +1 -1
- package/src/components/banner/banner.theme.ts +1 -1
- package/src/components/breadcrumb/RLABreadcrumb.astro +2 -2
- package/src/components/button/RLAButton.astro +4 -1
- package/src/components/button/button.theme.ts +1 -5
- package/src/components/callout/RLACallout.astro +7 -5
- package/src/components/callout/callout.theme.ts +1 -5
- package/src/components/card/card.theme.ts +3 -3
- package/src/components/carousel/RLACarousel.astro +2 -2
- package/src/components/carousel/carousel.theme.ts +2 -2
- package/src/components/chart/RLAChart.astro +1 -1
- package/src/components/checkbox/RLACheckbox.astro +2 -1
- package/src/components/checkbox/checkbox.theme.ts +0 -4
- package/src/components/chip/RLAChip.astro +2 -1
- package/src/components/chip/chip.theme.ts +0 -4
- package/src/components/collapsible/RLACollapsible.astro +1 -1
- package/src/components/color-area/RLAColorArea.astro +1 -0
- package/src/components/color-area/color-area.theme.ts +1 -5
- package/src/components/color-field/RLAColorField.astro +1 -0
- package/src/components/color-field/color-field.theme.ts +1 -5
- package/src/components/color-slider/RLAColorSlider.astro +1 -0
- package/src/components/color-slider/color-slider.theme.ts +1 -5
- package/src/components/dashboard-group/RLADashboardGroup.astro +5 -7
- package/src/components/dashboard-group/dashboard-group.theme.ts +1 -1
- package/src/components/dashboard-group/dashboard-group.ts +1 -1
- package/src/components/dashboard-navbar/RLADashboardNavbar.astro +4 -4
- package/src/components/dashboard-navbar/dashboard-navbar.theme.ts +3 -3
- package/src/components/dashboard-navbar/dashboard-navbar.ts +1 -1
- package/src/components/dashboard-panel/RLADashboardPanel.astro +9 -8
- package/src/components/dashboard-panel/dashboard-panel.theme.ts +1 -1
- package/src/components/dashboard-sidebar/RLADashboardSidebar.astro +7 -4
- package/src/components/dashboard-sidebar/dashboard-sidebar.theme.ts +6 -5
- package/src/components/dashboard-sidebar-collapse/RLADashboardSidebarCollapse.astro +1 -0
- package/src/components/drawer/RLADrawer.astro +1 -1
- package/src/components/dropdown-menu/dropdown-menu.theme.ts +2 -2
- package/src/components/footer/RLAFooter.astro +2 -0
- package/src/components/footer/footer.theme.ts +0 -8
- package/src/components/gamepad/RLAGamepad.astro +1 -1
- package/src/components/head/UIHead.astro +1 -2
- package/src/components/header/header.theme.ts +1 -1
- package/src/components/icon/RLAIcon.astro +2 -5
- package/src/components/icon/RLSIcon.tsx +2 -2
- package/src/components/icon/RLVIcon.vue +18 -6
- package/src/components/icon/icon.theme.ts +1 -1
- package/src/components/image/image.theme.ts +1 -1
- package/src/components/input/RLAInput.astro +2 -1
- package/src/components/input/input.theme.ts +0 -4
- package/src/components/input-menu/RLAInputMenu.astro +2 -2
- package/src/components/input-menu/input-menu.theme.ts +1 -1
- package/src/components/input-rating/input-rating.theme.ts +2 -2
- package/src/components/kbd/RLAKbd.astro +2 -1
- package/src/components/kbd/kbd.theme.ts +0 -4
- package/src/components/keyboard/RLAKeyboard.astro +1 -1
- package/src/components/link/RLALink.astro +1 -0
- package/src/components/link/link.theme.ts +0 -4
- package/src/components/link-group/RLALinkGroup.astro +1 -1
- package/src/components/link-group/link-group.theme.ts +1 -10
- package/src/components/locale-selector/RLALocaleSelector.astro +4 -36
- package/src/components/locale-selector/locale-selector.theme.ts +3 -11
- package/src/components/logo/RLALogo.astro +1 -2
- package/src/components/modal/RLAModal.astro +1 -1
- package/src/components/modal/RLSModal.tsx +2 -2
- package/src/components/navigation-menu/RLANavigationMenu.astro +17 -21
- package/src/components/navigation-menu/navigation-menu.theme.ts +3 -7
- package/src/components/pagination/RLAPagination.astro +2 -2
- package/src/components/pagination/pagination.theme.ts +1 -1
- package/src/components/popover/RLAPopover.astro +39 -0
- package/src/components/progress/RLAProgress.astro +2 -0
- package/src/components/progress/progress.theme.ts +0 -4
- package/src/components/scroll-area/scroll-area.theme.ts +1 -1
- package/src/components/scroll-to-top/RLAScrollToTop.astro +6 -5
- package/src/components/scroll-to-top/RLVScrollToTop.vue +7 -7
- package/src/components/scroll-to-top/scroll-to-top.theme.ts +3 -7
- package/src/components/search/RLASearch.astro +3 -3
- package/src/components/select/RLASelect.astro +96 -528
- package/src/components/select/RLSSelect.tsx +68 -14
- package/src/components/select/RLVSelect.vue +57 -0
- package/src/components/select/select.theme.ts +11 -96
- package/src/components/shortcuts/RLAShortcuts.astro +9 -9
- package/src/components/sidebar/RLASidebar.astro +3 -3
- package/src/components/slideover/RLASlideover.astro +1 -1
- package/src/components/slider/RLASlider.astro +2 -1
- package/src/components/slider/slider.theme.ts +1 -5
- package/src/components/spinner/RLASpinner.astro +2 -1
- package/src/components/spinner/spinner.theme.ts +1 -5
- package/src/components/splitter/splitter.theme.ts +1 -1
- package/src/components/stepper/RLAStepper.astro +8 -8
- package/src/components/stepper/stepper.theme.ts +6 -7
- package/src/components/steps/RLASteps.astro +3 -3
- package/src/components/switch/RLASwitch.astro +2 -1
- package/src/components/switch/switch.theme.ts +0 -4
- package/src/components/table/table.theme.ts +1 -1
- package/src/components/table-of-contents/RLATableOfContents.astro +5 -5
- package/src/components/theme-selector/RLAThemeSelector.astro +16 -14
- package/src/components/theme-selector/theme-selector.theme.ts +2 -2
- package/src/components/toast/RLAToast.astro +6 -6
- package/src/components/toast/store.ts +1 -1
- package/src/components/tooltip/tooltip.theme.ts +1 -1
- package/src/icons.raw.ts +67 -0
- package/src/icons.ts +31 -64
- package/src/index.ts +19 -18
- package/src/preset.ts +110 -108
- package/src/resolver.ts +127 -15
- package/src/shortcuts.ts +103 -84
- package/src/stores.ts +22 -0
- package/src/types.ts +27 -9
- package/src/virtual.d.ts +4 -0
- package/src/components/editor/PageEditor.vue +0 -459
- package/src/components/editor/PageMention.vue +0 -87
- package/src/components/editor/PagePropertiesEditor.vue +0 -358
- package/src/components/editor/PagePropertiesRenderer.vue +0 -285
- package/src/components/editor/PageRenderer.vue +0 -155
- package/src/components/editor/PageSurround.vue +0 -130
- package/src/components/editor/PageVersionSelector.vue +0 -371
- package/src/components/editor/blocks/AddBlockModal.vue +0 -196
- package/src/components/editor/blocks/Block.vue +0 -142
- package/src/components/editor/blocks/BlockEditRenderer.vue +0 -26
- package/src/components/editor/blocks/BlockEditor.vue +0 -141
- package/src/components/editor/blocks/BlockViewRenderer.vue +0 -71
- package/src/components/editor/blocks/TextRenderer.vue +0 -31
- package/src/components/editor/blocks/editor/CalloutBlockEditor.vue +0 -53
- package/src/components/editor/blocks/editor/ImageBlockEditor.vue +0 -55
- package/src/components/editor/blocks/editor/ParagraphBlockEditor.vue +0 -31
- package/src/components/editor/blocks/editor/SectionBlockEditor.vue +0 -65
- package/src/components/editor/blocks/nodes/LinkNode.vue +0 -28
- package/src/components/editor/blocks/nodes/TextNode.vue +0 -22
- package/src/components/editor/blocks/renderer/CalloutBlockRenderer.vue +0 -65
- package/src/components/editor/blocks/renderer/ImageBlockRenderer.vue +0 -20
- package/src/components/editor/blocks/renderer/ParagraphBlockRenderer.vue +0 -21
- package/src/components/editor/blocks/renderer/SectionBlockRenderer.vue +0 -55
- package/src/components/editor/composables/injectionKeys.ts +0 -3
- package/src/components/editor/composables/useBlockEditor.ts +0 -261
- package/src/components/editor/composables/usePageEditor.ts +0 -97
- package/src/components/editor/modals/CreatePageModal.vue +0 -160
- package/src/components/editor/modals/DeletePageModal.vue +0 -116
- package/src/components/editor/modals/PageTreeModal.vue +0 -275
- package/src/components/editor/types/blocks.ts +0 -100
- package/src/components/editor/types/pages.ts +0 -89
- package/src/components/editor/types/schemas.ts +0 -36
- package/src/components/editor/utils/blocks.ts +0 -42
- package/src/components/editor/utils/editorHelpers.ts +0 -24
- package/src/components/editor/utils/page.ts +0 -219
- package/src/components/editor/utils/richTextHelpers.ts +0 -35
- package/src/components/editor/views/PageEditView.vue +0 -195
- package/src/components/editor/views/PageLiveView.vue +0 -90
- package/src/components/editor/views/PageReviewView.vue +0 -308
- package/src/components/icon/resolver.ts +0 -23
|
@@ -3,17 +3,14 @@ import RLAIcon from "../icon/RLAIcon.astro"
|
|
|
3
3
|
import type { NavigationMenuProps } from "./navigation-menu"
|
|
4
4
|
import { navigationMenuTheme } from "./navigation-menu.theme"
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
6
|
const {
|
|
9
7
|
items = [],
|
|
10
8
|
color = "primary",
|
|
11
9
|
orientation = "horizontal",
|
|
10
|
+
theme,
|
|
12
11
|
...rest
|
|
13
12
|
} = Astro.props as NavigationMenuProps
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
14
|
const classes = navigationMenuTheme(Astro.props)
|
|
18
15
|
|
|
19
16
|
const slotContents: Record<string, string> = {}
|
|
@@ -26,22 +23,22 @@ await Promise.all(
|
|
|
26
23
|
)
|
|
27
24
|
---
|
|
28
25
|
|
|
29
|
-
<rla-navigation-menu orientation={orientation} {...rest}>
|
|
26
|
+
<rla-navigation-menu orientation={orientation} data-theme={theme} {...rest}>
|
|
30
27
|
<nav class={classes.root} data-slot="root" data-nav-menu data-orientation={orientation}>
|
|
31
28
|
<ul class={classes.list} data-slot="list" role="list">
|
|
32
29
|
{items.map((item, i) => {
|
|
33
30
|
const hasChildren = item.children && item.children.length > 0
|
|
34
|
-
|
|
31
|
+
|
|
35
32
|
const itemPath = (item.href ?? item.to ?? "#") as string
|
|
36
33
|
const normalizedPath = itemPath.replace(/^\/[a-z]{2}(?:-[a-zA-Z]{2})?(?=\/|$)/, '').replace(/\/+$/, '') || '/'
|
|
37
34
|
const currentPath = Astro.url.pathname.replace(/^\/[a-z]{2}(?:-[a-zA-Z]{2})?(?=\/|$)/, '').replace(/\/+$/, '') || '/'
|
|
38
|
-
|
|
35
|
+
|
|
39
36
|
const isActive = item.active ?? (
|
|
40
|
-
normalizedPath !== '' && normalizedPath !== '/'
|
|
37
|
+
normalizedPath !== '' && normalizedPath !== '/'
|
|
41
38
|
? currentPath.startsWith(normalizedPath)
|
|
42
39
|
: currentPath === '/'
|
|
43
40
|
)
|
|
44
|
-
|
|
41
|
+
|
|
45
42
|
return (
|
|
46
43
|
<li class={classes.item} data-slot="item" data-nav-item data-index={i}>
|
|
47
44
|
{hasChildren ? (
|
|
@@ -55,7 +52,7 @@ await Promise.all(
|
|
|
55
52
|
>
|
|
56
53
|
{item.icon && <span class={item.icon + " mr-1.5 size-4"} />}
|
|
57
54
|
{item.label}
|
|
58
|
-
<RLAIcon name="chevronDown" class="ml-1 size-3.5 transition-transform duration-200" aria-hidden="true" data-chevron />
|
|
55
|
+
<RLAIcon name="i-rl-chevronDown" class="ml-1 size-3.5 transition-transform duration-200" aria-hidden="true" data-chevron />
|
|
59
56
|
</button>
|
|
60
57
|
) : (
|
|
61
58
|
<a
|
|
@@ -70,10 +67,10 @@ await Promise.all(
|
|
|
70
67
|
)}
|
|
71
68
|
|
|
72
69
|
{hasChildren && (
|
|
73
|
-
<div
|
|
74
|
-
class={classes.content + " hidden"}
|
|
75
|
-
data-slot="content"
|
|
76
|
-
data-nav-content
|
|
70
|
+
<div
|
|
71
|
+
class={classes.content + " hidden"}
|
|
72
|
+
data-slot="content"
|
|
73
|
+
data-nav-content
|
|
77
74
|
data-item-index={i}
|
|
78
75
|
role="region"
|
|
79
76
|
>
|
|
@@ -85,7 +82,7 @@ await Promise.all(
|
|
|
85
82
|
<li>
|
|
86
83
|
<a
|
|
87
84
|
href={typeof child.href === "string" ? child.href : (typeof child.to === "string" ? child.to : "#")}
|
|
88
|
-
class="flex items-start gap-3 rounded-sm px-3 py-2 text-sm hover:bg-
|
|
85
|
+
class="flex items-start gap-3 rounded-sm px-3 py-2 text-sm hover:bg-accented hover:text-highlighted transition-colors"
|
|
89
86
|
>
|
|
90
87
|
{child.icon && <span class={child.icon + " mt-0.5 size-4 shrink-0 text-muted"} />}
|
|
91
88
|
<div>
|
|
@@ -151,7 +148,7 @@ await Promise.all(
|
|
|
151
148
|
|
|
152
149
|
const open = (item: HTMLElement, trigger: HTMLElement, content: HTMLElement) => {
|
|
153
150
|
clearTimeout(hoverTimeout);
|
|
154
|
-
|
|
151
|
+
|
|
155
152
|
if (orientation === "horizontal" && activeItem && activeItem !== item) {
|
|
156
153
|
close(activeItem);
|
|
157
154
|
}
|
|
@@ -182,7 +179,7 @@ await Promise.all(
|
|
|
182
179
|
const close = (item: HTMLElement) => {
|
|
183
180
|
const trigger = item.querySelector("[data-nav-trigger]") as HTMLElement | null;
|
|
184
181
|
const itemIndex = item.getAttribute("data-index");
|
|
185
|
-
|
|
182
|
+
|
|
186
183
|
let content = item.querySelector("[data-nav-content]") as HTMLElement | null;
|
|
187
184
|
if (!content && viewport) {
|
|
188
185
|
content = viewport.querySelector(`[data-nav-content][data-item-index="${itemIndex}"]`) as HTMLElement | null;
|
|
@@ -329,7 +326,7 @@ await Promise.all(
|
|
|
329
326
|
outline: none !important;
|
|
330
327
|
outline-width: 0px !important;
|
|
331
328
|
outline-color: transparent !important;
|
|
332
|
-
|
|
329
|
+
|
|
333
330
|
/* Wiping out any UnoCSS/Tailwind rings on the viewport container */
|
|
334
331
|
--un-ring-width: 0px !important;
|
|
335
332
|
--tw-ring-width: 0px !important;
|
|
@@ -341,7 +338,7 @@ await Promise.all(
|
|
|
341
338
|
--tw-ring-shadow: none !important;
|
|
342
339
|
--un-ring-offset-shadow: none !important;
|
|
343
340
|
--tw-ring-offset-shadow: none !important;
|
|
344
|
-
|
|
341
|
+
|
|
345
342
|
/* Premium card shadow */
|
|
346
343
|
box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.35), 0 8px 10px -6px rgb(0 0 0 / 0.35) !important; /* Premium shadow-xl */
|
|
347
344
|
}
|
|
@@ -356,8 +353,7 @@ await Promise.all(
|
|
|
356
353
|
border-width: 0px !important;
|
|
357
354
|
box-shadow: none !important;
|
|
358
355
|
padding: 0 !important;
|
|
359
|
-
|
|
360
|
-
|
|
356
|
+
|
|
361
357
|
/* Wiping out any UnoCSS/Tailwind rings on content */
|
|
362
358
|
--un-ring-width: 0px !important;
|
|
363
359
|
--tw-ring-width: 0px !important;
|
|
@@ -6,20 +6,16 @@ export const navigationMenuTheme = defineTheme("navigation-menu", {
|
|
|
6
6
|
root: "relative z-10 flex w-full",
|
|
7
7
|
list: "group flex flex-1 list-none",
|
|
8
8
|
item: "relative",
|
|
9
|
-
link: "text-highlighted inline-flex items-center px-4 py-2 text-sm font-medium transition-colors hover:text-
|
|
9
|
+
link: "text-highlighted inline-flex items-center px-4 py-2 text-sm font-medium transition-colors hover:text-highlighted focus:text-highlighted focus:outline-none disabled:pointer-events-none disabled:opacity-50",
|
|
10
10
|
trigger:
|
|
11
|
-
"group inline-flex h-10 items-center rounded-md bg-default px-4 py-2 text-sm font-medium transition-colors hover:bg-
|
|
11
|
+
"group inline-flex h-10 items-center rounded-md bg-default px-4 py-2 text-sm font-medium transition-colors hover:bg-accented hover:text-highlighted focus:bg-accented focus:text-highlighted focus:outline-none disabled:pointer-events-none disabled:opacity-50 gap-1",
|
|
12
12
|
content:
|
|
13
13
|
"absolute left-0 top-full z-50 mt-1.5 w-56 rounded-md border bg-elevated p-1 text-highlighted shadow-md origin-top-left",
|
|
14
14
|
viewportWrapper: "absolute left-0 top-full flex justify-center w-full",
|
|
15
15
|
viewport:
|
|
16
|
-
"relative mt-1.5 h-auto w-full origin-top overflow-hidden rounded-md
|
|
16
|
+
"relative mt-1.5 h-auto w-full origin-top overflow-hidden rounded-md bg-default text-highlighted shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90"
|
|
17
17
|
},
|
|
18
18
|
variants: {
|
|
19
|
-
theme: {
|
|
20
|
-
light: { link: "rl-light", trigger: "rl-light" },
|
|
21
|
-
dark: { link: "rl-dark", trigger: "rl-dark" }
|
|
22
|
-
},
|
|
23
19
|
orientation: {
|
|
24
20
|
horizontal: {
|
|
25
21
|
root: "max-w-max flex-1 items-center justify-center",
|
|
@@ -44,7 +44,7 @@ const pages = getPageNumbers()
|
|
|
44
44
|
aria-label="Go to previous page"
|
|
45
45
|
aria-disabled={currentPage === 1}
|
|
46
46
|
>
|
|
47
|
-
<RLAIcon name="chevronLeft" class="size-4" aria-hidden="true" />
|
|
47
|
+
<RLAIcon name="i-rl-chevronLeft" class="size-4" aria-hidden="true" />
|
|
48
48
|
</a>
|
|
49
49
|
</li>
|
|
50
50
|
|
|
@@ -84,7 +84,7 @@ const pages = getPageNumbers()
|
|
|
84
84
|
aria-label="Go to next page"
|
|
85
85
|
aria-disabled={currentPage === totalPages}
|
|
86
86
|
>
|
|
87
|
-
<RLAIcon name="chevronRight" class="size-4" aria-hidden="true" />
|
|
87
|
+
<RLAIcon name="i-rl-chevronRight" class="size-4" aria-hidden="true" />
|
|
88
88
|
</a>
|
|
89
89
|
</li>
|
|
90
90
|
</ul>
|
|
@@ -14,7 +14,7 @@ export const paginationTheme = defineTheme("pagination", {
|
|
|
14
14
|
},
|
|
15
15
|
variants: {
|
|
16
16
|
active: {
|
|
17
|
-
true: { link: "border-primary bg-primary text-
|
|
17
|
+
true: { link: "border-primary bg-primary text-neutral-50 hover:bg-primary/95" },
|
|
18
18
|
false: { link: "" }
|
|
19
19
|
}
|
|
20
20
|
},
|
|
@@ -87,6 +87,10 @@ const popoverId = `rla-popover-${Math.random().toString(36).substring(2, 9)}`
|
|
|
87
87
|
[popover][data-slot="content"] {
|
|
88
88
|
position: absolute;
|
|
89
89
|
position-anchor: --rla-popover-anchor;
|
|
90
|
+
/* The theme adds `top-full left-1/2 -translate-x-1/2` for non-popover
|
|
91
|
+
dropdowns; that transform shifts a top-layer popover off its anchor,
|
|
92
|
+
so neutralize it when we position via CSS anchor properties. */
|
|
93
|
+
transform: none;
|
|
90
94
|
}
|
|
91
95
|
|
|
92
96
|
/* bottom (default) */
|
|
@@ -234,6 +238,41 @@ const popoverId = `rla-popover-${Math.random().toString(36).substring(2, 9)}`
|
|
|
234
238
|
});
|
|
235
239
|
panel.addEventListener('mouseleave', hide);
|
|
236
240
|
}
|
|
241
|
+
|
|
242
|
+
// Deterministic positioning: anchor positioning is a progressive
|
|
243
|
+
// enhancement, but we always place the popover next to its trigger
|
|
244
|
+
// via JS so it is reliably visible (no off-screen / scrollbar issues).
|
|
245
|
+
const positionPopover = () => {
|
|
246
|
+
if (!trigger) return;
|
|
247
|
+
const pw = panel.offsetWidth;
|
|
248
|
+
const ph = panel.offsetHeight;
|
|
249
|
+
if (pw === 0 || ph === 0) return; // closed or not yet rendered
|
|
250
|
+
|
|
251
|
+
const parts = (container.dataset.placement || 'bottom').split('-');
|
|
252
|
+
const vert = parts[0]; // top | bottom
|
|
253
|
+
const horiz = parts[1] || 'center'; // start | end | center
|
|
254
|
+
const gap = 8;
|
|
255
|
+
const r = trigger.getBoundingClientRect();
|
|
256
|
+
|
|
257
|
+
let top = vert === 'top' ? r.top - ph - gap : r.bottom + gap;
|
|
258
|
+
let left =
|
|
259
|
+
horiz === 'end' ? r.right - pw :
|
|
260
|
+
horiz === 'start' ? r.left :
|
|
261
|
+
r.left + r.width / 2 - pw / 2;
|
|
262
|
+
|
|
263
|
+
left = Math.max(8, Math.min(left, window.innerWidth - pw - 8));
|
|
264
|
+
top = Math.max(8, Math.min(top, window.innerHeight - ph - 8));
|
|
265
|
+
|
|
266
|
+
panel.style.position = 'fixed';
|
|
267
|
+
panel.style.transform = 'none';
|
|
268
|
+
panel.style.top = `${top}px`;
|
|
269
|
+
panel.style.left = `${left}px`;
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
panel.addEventListener('toggle', () => positionPopover());
|
|
273
|
+
const reposition = () => positionPopover();
|
|
274
|
+
window.addEventListener('scroll', reposition, true);
|
|
275
|
+
window.addEventListener('resize', reposition);
|
|
237
276
|
});
|
|
238
277
|
}
|
|
239
278
|
|
|
@@ -6,6 +6,7 @@ import { progressTheme } from "./progress.theme"
|
|
|
6
6
|
const {
|
|
7
7
|
value = 0,
|
|
8
8
|
max = 100,
|
|
9
|
+
theme,
|
|
9
10
|
...rest
|
|
10
11
|
} = Astro.props as ProgressProps
|
|
11
12
|
|
|
@@ -21,6 +22,7 @@ const id = `progress-${Math.random().toString(36).substring(2, 9)}`
|
|
|
21
22
|
aria-valuemin={0}
|
|
22
23
|
aria-valuemax={max}
|
|
23
24
|
aria-valuenow={value}
|
|
25
|
+
data-theme={theme}
|
|
24
26
|
{...rest}
|
|
25
27
|
>
|
|
26
28
|
<div
|
|
@@ -8,7 +8,7 @@ export const scrollAreaTheme = defineTheme("scroll-area", {
|
|
|
8
8
|
"h-full w-full rounded-[inherit] overflow-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
|
|
9
9
|
scrollbar:
|
|
10
10
|
"absolute flex user-select-none touch-action-none p-0.5 bg-transparent transition-colors duration-150 ease-out hover:bg-muted/10",
|
|
11
|
-
thumb: "relative flex-1 rounded-full bg-
|
|
11
|
+
thumb: "relative flex-1 rounded-full bg-neutral-200 transition-colors hover:bg-muted/45"
|
|
12
12
|
},
|
|
13
13
|
variants: {
|
|
14
14
|
orientation: {
|
|
@@ -10,6 +10,7 @@ const {
|
|
|
10
10
|
duration = 0.1,
|
|
11
11
|
threshold = 200,
|
|
12
12
|
showProgress = false,
|
|
13
|
+
theme,
|
|
13
14
|
...rest
|
|
14
15
|
} = Astro.props as ScrollToTopProps
|
|
15
16
|
|
|
@@ -17,7 +18,7 @@ const classes = scrollToTopTheme(Astro.props)
|
|
|
17
18
|
|
|
18
19
|
---
|
|
19
20
|
|
|
20
|
-
<rla-scroll-to-top data-threshold={threshold} data-duration={duration} data-color={color} data-progress-width={progressWidth} {...rest}>
|
|
21
|
+
<rla-scroll-to-top data-threshold={threshold} data-duration={duration} data-color={color} data-progress-width={progressWidth} data-theme={theme} {...rest}>
|
|
21
22
|
<div
|
|
22
23
|
class:list={["rla-scroll-to-top-inner", "fixed bottom-6 right-6 z-50", classes.root]}
|
|
23
24
|
>
|
|
@@ -110,12 +111,12 @@ const classes = scrollToTopTheme(Astro.props)
|
|
|
110
111
|
const gaugeProgressEl = innerElement.querySelector('[data-gauge-progress]') as HTMLElement | null;
|
|
111
112
|
if (gaugeProgressEl) {
|
|
112
113
|
gaugeProgressEl.style.setProperty('--gauge-stroke-width', `${gaugeBorderWidth}px`);
|
|
113
|
-
gaugeProgressEl.style.setProperty('--gauge-color', `var(--
|
|
114
|
+
gaugeProgressEl.style.setProperty('--gauge-color', `var(--rl-${color}-500)`);
|
|
114
115
|
}
|
|
115
116
|
const gaugeTrackEl = innerElement.querySelector('.gauge-track') as HTMLElement | null;
|
|
116
117
|
if (gaugeTrackEl) {
|
|
117
118
|
gaugeTrackEl.style.setProperty('border-width', `${gaugeBorderWidth}px`);
|
|
118
|
-
gaugeTrackEl.style.setProperty('border-color', `var(--
|
|
119
|
+
gaugeTrackEl.style.setProperty('border-color', `var(--rl-${color}-900)`);
|
|
119
120
|
gaugeTrackEl.style.setProperty('background-color', '#000');
|
|
120
121
|
}
|
|
121
122
|
|
|
@@ -195,8 +196,8 @@ const classes = scrollToTopTheme(Astro.props)
|
|
|
195
196
|
border-radius: 50%;
|
|
196
197
|
background: conic-gradient(
|
|
197
198
|
from 0deg,
|
|
198
|
-
var(--gauge-color, var(--
|
|
199
|
-
var(--gauge-color, var(--
|
|
199
|
+
var(--gauge-color, var(--rl-primary-500)) 0deg,
|
|
200
|
+
var(--gauge-color, var(--rl-primary-500)) calc(var(--gauge-progress, 0) * 3.6deg),
|
|
200
201
|
transparent calc(var(--gauge-progress, 0) * 3.6deg)
|
|
201
202
|
);
|
|
202
203
|
-webkit-mask: radial-gradient(
|
|
@@ -30,10 +30,10 @@ function updateCssVars() {
|
|
|
30
30
|
if (!styleEl) return
|
|
31
31
|
styleEl.textContent = `
|
|
32
32
|
[data-rla-instance="${instanceId}"] {
|
|
33
|
-
--gauge-track-border-color: var(--
|
|
34
|
-
--gauge-track-bg: var(--
|
|
33
|
+
--gauge-track-border-color: var(--rl-${color}-900);
|
|
34
|
+
--gauge-track-bg: var(--rl-${color}-950);
|
|
35
35
|
--gauge-stroke-width: ${gaugeBorderWidth}px;
|
|
36
|
-
--gauge-color: var(--
|
|
36
|
+
--gauge-color: var(--rl-${color}-500);
|
|
37
37
|
--gauge-progress: ${scrollPercentage.value};
|
|
38
38
|
}
|
|
39
39
|
`
|
|
@@ -116,8 +116,8 @@ onUnmounted(() => {
|
|
|
116
116
|
border-radius: 50%;
|
|
117
117
|
border-style: solid;
|
|
118
118
|
border-width: var(--gauge-stroke-width, 3px);
|
|
119
|
-
border-color: var(--gauge-track-border-color, var(--
|
|
120
|
-
background-color: var(--gauge-track-bg, var(--
|
|
119
|
+
border-color: var(--gauge-track-border-color, var(--rl-primary-900));
|
|
120
|
+
background-color: var(--gauge-track-bg, var(--rl-primary-950));
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
.gauge-progress {
|
|
@@ -126,8 +126,8 @@ onUnmounted(() => {
|
|
|
126
126
|
border-radius: 50%;
|
|
127
127
|
background: conic-gradient(
|
|
128
128
|
from 0deg,
|
|
129
|
-
var(--gauge-color, var(--
|
|
130
|
-
var(--gauge-color, var(--
|
|
129
|
+
var(--gauge-color, var(--rl-primary-500)) 0deg,
|
|
130
|
+
var(--gauge-color, var(--rl-primary-500)) calc(var(--gauge-progress, 0) * 3.6deg),
|
|
131
131
|
transparent calc(var(--gauge-progress, 0) * 3.6deg)
|
|
132
132
|
);
|
|
133
133
|
-webkit-mask: radial-gradient(
|
|
@@ -11,23 +11,19 @@ export const scrollToTopTheme = defineTheme("scroll-to-top", {
|
|
|
11
11
|
icon: "size-6 text-white"
|
|
12
12
|
},
|
|
13
13
|
variants: {
|
|
14
|
-
color: "auto"
|
|
15
|
-
theme: {
|
|
16
|
-
light: { root: "rl-light" },
|
|
17
|
-
dark: { root: "rl-dark" }
|
|
18
|
-
}
|
|
14
|
+
color: "auto"
|
|
19
15
|
},
|
|
20
16
|
compoundVariants: [
|
|
21
17
|
{
|
|
22
18
|
color: "primary",
|
|
23
19
|
classNames: {
|
|
24
|
-
icon: "text-
|
|
20
|
+
icon: "text-neutral-50"
|
|
25
21
|
}
|
|
26
22
|
},
|
|
27
23
|
{
|
|
28
24
|
color: "secondary",
|
|
29
25
|
classNames: {
|
|
30
|
-
icon: "text-
|
|
26
|
+
icon: "text-neutral-50"
|
|
31
27
|
}
|
|
32
28
|
}
|
|
33
29
|
],
|
|
@@ -55,7 +55,7 @@ const emptyId = `search-empty-${uniqueId}`
|
|
|
55
55
|
square
|
|
56
56
|
aria-label="Open Search"
|
|
57
57
|
>
|
|
58
|
-
<RLAIcon name="search" class="w-5 h-5" />
|
|
58
|
+
<RLAIcon name="i-rl-search" class="w-5 h-5" />
|
|
59
59
|
</RLAButton>
|
|
60
60
|
)}
|
|
61
61
|
|
|
@@ -77,11 +77,11 @@ const emptyId = `search-empty-${uniqueId}`
|
|
|
77
77
|
trailing: "absolute right-0 flex items-center gap-2"
|
|
78
78
|
}}
|
|
79
79
|
>
|
|
80
|
-
<RLAIcon name="search" class={classes.headerIcon} slot="leading" />
|
|
80
|
+
<RLAIcon name="i-rl-search" class={classes.headerIcon} slot="leading" />
|
|
81
81
|
<div slot="trailing" class="flex items-center gap-2">
|
|
82
82
|
<RLAKbd size="sm">Esc</RLAKbd>
|
|
83
83
|
<button id={`${modalId}-close`} class={classes.close} aria-label="Close search">
|
|
84
|
-
<RLAIcon name="close" class={classes.closeIcon} />
|
|
84
|
+
<RLAIcon name="i-rl-close" class={classes.closeIcon} />
|
|
85
85
|
</button>
|
|
86
86
|
</div>
|
|
87
87
|
</RLAInput>
|