@rimelight/ui 0.0.46 → 0.0.48
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/dist/icons-DPnFQCts.d.mts +72 -0
- package/dist/icons.d.mts +1 -1
- package/dist/index.d.mts +5 -6
- package/dist/preset.d.mts +1 -1
- package/dist/preset.mjs +73 -1
- package/dist/resolver.d.mts +4 -5
- package/dist/resolver.mjs +2 -4
- package/dist/shortcuts.d.mts +10 -11
- package/dist/stores.d.mts +3 -4
- package/dist/{types-DqAgCNcm.d.mts → types-DWmKMcYC.d.mts} +1 -1
- package/dist/types.d.mts +1 -1
- package/package.json +8 -6
- package/src/components/3d-hover/RLS3dHover.tsx +21 -0
- package/src/components/accordion/RLSAccordion.tsx +112 -0
- package/src/components/app/RLSApp.tsx +21 -0
- package/src/components/aspect-ratio/RLSAspectRatio.tsx +30 -0
- package/src/components/audio/RLSAudio.tsx +27 -0
- package/src/components/avatar/RLSAvatar.tsx +142 -0
- package/src/components/avatar/avatar.ts +22 -21
- package/src/components/avatar-group/RLSAvatarGroup.tsx +163 -0
- package/src/components/badge/RLSBadge.tsx +1 -1
- package/src/components/badge/RLVBadge.vue +5 -3
- package/src/components/banner/RLABanner.astro +1 -1
- package/src/components/banner/RLSBanner.tsx +151 -0
- package/src/components/breadcrumb/RLSBreadcrumb.tsx +194 -0
- package/src/components/browser-mockup/RLSBrowserMockup.tsx +21 -0
- package/src/components/button/RLSButton.tsx +53 -38
- package/src/components/button/RLVButton.vue +44 -32
- package/src/components/calendar/RLSCalendar.tsx +26 -0
- package/src/components/callout/RLSCallout.tsx +151 -0
- package/src/components/card/RLSCard.tsx +4 -0
- package/src/components/card/RLVCard.vue +4 -0
- package/src/components/card/card.ts +10 -0
- package/src/components/carousel/RLACarousel.astro +14 -1
- package/src/components/carousel/RLSCarousel.tsx +260 -0
- package/src/components/chart/RLSChart.tsx +299 -0
- package/src/components/chat/RLSChat.tsx +27 -0
- package/src/components/chat-message/RLSChatMessage.tsx +27 -0
- package/src/components/chat-messages/RLSChatMessages.tsx +27 -0
- package/src/components/chat-palette/RLSChatPalette.tsx +27 -0
- package/src/components/chat-prompt/RLSChatPrompt.tsx +27 -0
- package/src/components/chat-prompt-submit/RLSChatPromptSubmit.tsx +27 -0
- package/src/components/chat-reasoning/RLSChatReasoning.tsx +27 -0
- package/src/components/chat-shimmer/RLSChatShimmer.tsx +27 -0
- package/src/components/chat-tool/RLSChatTool.tsx +27 -0
- package/src/components/checkbox/RLACheckbox.astro +1 -0
- package/src/components/checkbox/RLSCheckbox.tsx +1 -1
- package/src/components/checkbox/checkbox.theme.ts +2 -2
- package/src/components/chip/RLSChip.tsx +65 -0
- package/src/components/collapsible/RLSCollapsible.tsx +89 -0
- package/src/components/color-area/RLSColorArea.tsx +554 -0
- package/src/components/color-field/RLSColorField.tsx +236 -0
- package/src/components/color-picker/RLSColorPicker.tsx +26 -0
- package/src/components/color-slider/RLSColorSlider.tsx +373 -0
- package/src/components/command-palette/RLSCommandPalette.tsx +26 -0
- package/src/components/compare/RLSCompare.tsx +26 -0
- package/src/components/confirm/RLSConfirm.tsx +173 -0
- package/src/components/container/RLSContainer.tsx +24 -0
- package/src/components/context-menu/RLSContextMenu.tsx +26 -0
- package/src/components/copy-markdown/RLSCopyMarkdown.tsx +57 -0
- package/src/components/dashboard-group/RLSDashboardGroup.tsx +29 -0
- package/src/components/dashboard-navbar/RLSDashboardNavbar.tsx +116 -0
- package/src/components/dashboard-panel/RLSDashboardPanel.tsx +84 -0
- package/src/components/dashboard-resize-handle/RLSDashboardResizeHandle.tsx +35 -0
- package/src/components/dashboard-search/RLADashboardSearch.astro +1 -1
- package/src/components/dashboard-search/RLSDashboardSearch.tsx +125 -0
- package/src/components/dashboard-search-button/RLSDashboardSearchButton.tsx +82 -0
- package/src/components/dashboard-sidebar/RLADashboardSidebar.astro +4 -4
- package/src/components/dashboard-sidebar/RLSDashboardSidebar.tsx +184 -0
- package/src/components/dashboard-sidebar-collapse/RLSDashboardSidebarCollapse.tsx +46 -0
- package/src/components/dashboard-sidebar-toggle/RLSDashboardSidebarToggle.tsx +35 -0
- package/src/components/dashboard-toolbar/RLSDashboardToolbar.tsx +49 -0
- package/src/components/date/RLSDate.tsx +34 -0
- package/src/components/dock/RLSDock.tsx +26 -0
- package/src/components/drawer/RLSDrawer.tsx +177 -0
- package/src/components/dropdown-menu/RLADropdownMenu.astro +250 -241
- package/src/components/dropdown-menu/RLSDropdownMenu.tsx +183 -86
- package/src/components/editor/RLSEditor.tsx +26 -0
- package/src/components/empty/RLSEmpty.tsx +132 -0
- package/src/components/error/RLSError.tsx +26 -0
- package/src/components/field-group/RLSFieldGroup.tsx +46 -0
- package/src/components/fieldset/RLSFieldset.tsx +26 -0
- package/src/components/file-upload/RLAFileUpload.astro +1 -1
- package/src/components/file-upload/RLSFileUpload.tsx +163 -0
- package/src/components/floating-action/RLSFloatingAction.tsx +26 -0
- package/src/components/footer/RLSFooter.tsx +56 -0
- package/src/components/form/RLSForm.tsx +34 -0
- package/src/components/gallery/RLSGallery.tsx +21 -0
- package/src/components/gamepad/RLSGamepad.tsx +269 -0
- package/src/components/grid/RLSGrid.tsx +29 -0
- package/src/components/head/RLAHead.astro +9 -0
- package/src/components/head/RLSHead.tsx +42 -0
- package/src/components/head/UIHead.astro +3 -0
- package/src/components/header/HeaderLayer.astro +1 -1
- package/src/components/header/RLSHeader.tsx +87 -0
- package/src/components/hover-card/RLSHoverCard.tsx +72 -0
- package/src/components/icon/RLSIcon.tsx +3 -1
- package/src/components/image/RLAImage.astro +447 -138
- package/src/components/image/RLSImage.tsx +545 -0
- package/src/components/image/image.theme.ts +19 -3
- package/src/components/image/image.ts +31 -1
- package/src/components/input/RLAInput.astro +62 -51
- package/src/components/input/RLSInput.tsx +1 -1
- package/src/components/input-date/RLSInputDate.tsx +92 -0
- package/src/components/input-menu/RLAInputMenu.astro +3 -3
- package/src/components/input-menu/RLSInputMenu.tsx +199 -0
- package/src/components/input-number/RLSInputNumber.tsx +184 -0
- package/src/components/input-pin/RLSInputPin.tsx +185 -0
- package/src/components/input-rating/RLAInputRating.astro +8 -8
- package/src/components/input-rating/RLSInputRating.tsx +198 -0
- package/src/components/input-rating/input-rating.ts +4 -0
- package/src/components/input-tags/RLSInputTags.tsx +94 -0
- package/src/components/input-time/RLSInputTime.tsx +92 -0
- package/src/components/kbd/RLSKbd.tsx +37 -0
- package/src/components/keyboard/RLSKeyboard.tsx +476 -0
- package/src/components/knob/RLSKnob.tsx +27 -0
- package/src/components/label/RLSLabel.tsx +27 -0
- package/src/components/layout-grid/RLALayoutGrid.astro +29 -29
- package/src/components/layout-grid/RLSLayoutGrid.tsx +402 -0
- package/src/components/layout-grid/layout-grid.ts +25 -1
- package/src/components/link/RLALink.astro +5 -5
- package/src/components/link/RLSLink.tsx +6 -5
- package/src/components/link/link.ts +21 -12
- package/src/components/link-group/RLSLinkGroup.tsx +76 -0
- package/src/components/listbox/RLSListbox.tsx +27 -0
- package/src/components/locale-selector/RLALocaleSelector.astro +110 -102
- package/src/components/locale-selector/RLSLocaleSelector.tsx +178 -0
- package/src/components/locale-selector/locale-selector.ts +2 -7
- package/src/components/logo/RLALogo.astro +153 -102
- package/src/components/logo/RLSLogo.tsx +129 -0
- package/src/components/main/RLSMain.tsx +40 -0
- package/src/components/marquee/RLSMarquee.tsx +80 -0
- package/src/components/meter/RLSMeter.tsx +27 -0
- package/src/components/modal/RLAModal.astro +1 -1
- package/src/components/modal/RLSModal.tsx +109 -72
- package/src/components/navigation-menu/RLANavigationMenu.astro +6 -6
- package/src/components/navigation-menu/RLSNavigationMenu.tsx +228 -0
- package/src/components/navigation-menu/navigation-menu.ts +2 -2
- package/src/components/package-managers/RLSPackageManagers.tsx +204 -0
- package/src/components/page/RLSPage.tsx +21 -0
- package/src/components/page-aside/RLSPageAside.tsx +21 -0
- package/src/components/page-body/RLSPageBody.tsx +21 -0
- package/src/components/page-header/RLSPageHeader.tsx +21 -0
- package/src/components/page-section/RLSPageSection.tsx +201 -0
- package/src/components/pagination/RLSPagination.tsx +114 -0
- package/src/components/password/RLSPassword.tsx +27 -0
- package/src/components/phone-mockup/RLSPhoneMockup.tsx +27 -0
- package/src/components/placeholder/RLSPlaceholder.tsx +47 -0
- package/src/components/popover/RLAPopover.astro +2 -2
- package/src/components/popover/RLSPopover.tsx +124 -0
- package/src/components/post/RLSPost.tsx +134 -0
- package/src/components/pricing-plan/RLSPricingPlan.tsx +26 -0
- package/src/components/pricing-table/RLSPricingTable.tsx +26 -0
- package/src/components/progress/RLSProgress.tsx +53 -0
- package/src/components/prose/RLSProse.tsx +26 -0
- package/src/components/qr-code/RLSQrCode.tsx +26 -0
- package/src/components/quote/RLAQuote.astro +10 -6
- package/src/components/quote/RLSQuote.tsx +37 -0
- package/src/components/quote/quote.theme.ts +5 -2
- package/src/components/radio-group/RLSRadioGroup.tsx +37 -0
- package/src/components/rating/RLSRating.tsx +27 -0
- package/src/components/scroll-area/RLAScrollArea.astro +1 -1
- package/src/components/scroll-area/RLSScrollArea.tsx +210 -0
- package/src/components/scroll-to-top/RLAScrollToTop.astro +5 -4
- package/src/components/scroll-to-top/RLSScrollToTop.tsx +145 -0
- package/src/components/search/RLASearch.astro +6 -6
- package/src/components/search/RLSSearch.tsx +237 -0
- package/src/components/select/RLASelect.astro +67 -4
- package/src/components/select/RLSSelect.tsx +107 -39
- package/src/components/select/RLVSelect.vue +50 -1
- package/src/components/select/select.theme.ts +30 -10
- package/src/components/select/select.ts +20 -1
- package/src/components/separator/RLSSeparator.tsx +92 -0
- package/src/components/share/RLSShare.tsx +66 -0
- package/src/components/shortcuts/RLAShortcuts.astro +2 -2
- package/src/components/shortcuts/RLSShortcuts.tsx +393 -0
- package/src/components/sidebar/RLASidebar.astro +1 -1
- package/src/components/sidebar/RLSSidebar.tsx +271 -0
- package/src/components/skeleton/RLSSkeleton.tsx +21 -0
- package/src/components/slideover/RLASlideover.astro +1 -1
- package/src/components/slideover/RLSSlideover.tsx +159 -0
- package/src/components/slider/RLSSlider.tsx +112 -0
- package/src/components/speed-dial/RLSSpeedDial.tsx +27 -0
- package/src/components/spinner/RLSSpinner.tsx +22 -0
- package/src/components/splitter/RLASplitter.astro +1 -1
- package/src/components/splitter/RLSSplitter.tsx +178 -0
- package/src/components/spoiler/RLSSpoiler.tsx +26 -0
- package/src/components/stepper/RLAStepper.astro +9 -9
- package/src/components/stepper/RLSStepper.tsx +205 -0
- package/src/components/steps/RLSSteps.tsx +108 -0
- package/src/components/sticky-surface/RLSStickySurface.tsx +63 -0
- package/src/components/surround/RLSSurround.tsx +57 -0
- package/src/components/switch/RLSSwitch.tsx +56 -0
- package/src/components/table/RLATable.astro +1044 -579
- package/src/components/table/RLSTable.tsx +893 -0
- package/src/components/table/table.theme.ts +47 -16
- package/src/components/table/table.ts +104 -66
- package/src/components/table-of-contents/RLSTableOfContents.tsx +196 -0
- package/src/components/tabs/RLATabs.astro +8 -8
- package/src/components/tabs/RLSTabs.tsx +298 -0
- package/src/components/textarea/RLATextarea.astro +1 -0
- package/src/components/textarea/RLSTextarea.tsx +3 -1
- package/src/components/theme-selector/RLAThemeSelector.astro +85 -56
- package/src/components/theme-selector/RLSThemeSelector.tsx +131 -0
- package/src/components/theme-selector/theme-selector.theme.ts +5 -7
- package/src/components/theme-selector/theme-selector.ts +11 -1
- package/src/components/timeline/RLSTimeline.tsx +171 -0
- package/src/components/toast/RLAToast.astro +2 -2
- package/src/components/toast/RLSToast.tsx +179 -0
- package/src/components/toaster/RLSToaster.tsx +82 -0
- package/src/components/tooltip/RLSTooltip.tsx +48 -0
- package/src/components/tour/RLSTour.tsx +26 -0
- package/src/components/tree/RLSTree.tsx +26 -0
- package/src/components/user/RLSUser.tsx +26 -0
- package/src/components/video/RLAVideo.astro +4 -1
- package/src/components/video/RLSVideo.tsx +158 -0
- package/src/components/watermark/RLSWatermark.tsx +27 -0
- package/src/components/window-mockup/RLSWindowMockup.tsx +27 -0
- package/src/preset.ts +73 -1
- package/src/resolver.ts +6 -1
- package/src/virtual.d.ts +6 -0
- package/dist/icons--RzV1RTU.d.mts +0 -72
|
@@ -1,102 +1,153 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { LogoProps } from "./logo"
|
|
3
|
-
import { logoTheme } from "./logo.theme"
|
|
4
|
-
import uiConfig from "virtual:rimelight/ui"
|
|
5
|
-
|
|
6
|
-
const {
|
|
7
|
-
variant = "logomark",
|
|
8
|
-
mode,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
)
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
1
|
+
---
|
|
2
|
+
import type { LogoProps } from "./logo"
|
|
3
|
+
import { logoTheme } from "./logo.theme"
|
|
4
|
+
import uiConfig from "virtual:rimelight/ui"
|
|
5
|
+
|
|
6
|
+
const {
|
|
7
|
+
variant = "logomark",
|
|
8
|
+
mode,
|
|
9
|
+
theme,
|
|
10
|
+
href = "/",
|
|
11
|
+
alt,
|
|
12
|
+
...rest
|
|
13
|
+
} = Astro.props as LogoProps;
|
|
14
|
+
|
|
15
|
+
const classes = logoTheme(Astro.props);
|
|
16
|
+
|
|
17
|
+
let logoSrc: string | null = null;
|
|
18
|
+
let darkSrc: string | null = null;
|
|
19
|
+
let lightSrc: string | null = null;
|
|
20
|
+
|
|
21
|
+
const logoFiles = import.meta.glob<{ default: any }>("/src/assets/**/*.{svg,png,jpg,jpeg,webp,gif}", { eager: true });
|
|
22
|
+
|
|
23
|
+
function resolveLogo(pathStr: string | null | undefined): any {
|
|
24
|
+
if (!pathStr) return null;
|
|
25
|
+
let lookupPath = pathStr;
|
|
26
|
+
if (lookupPath.startsWith("./")) {
|
|
27
|
+
lookupPath = lookupPath.substring(1);
|
|
28
|
+
} else if (!lookupPath.startsWith("/")) {
|
|
29
|
+
lookupPath = "/" + lookupPath;
|
|
30
|
+
}
|
|
31
|
+
const file = logoFiles[lookupPath];
|
|
32
|
+
if (file) {
|
|
33
|
+
return file.default?.src || file.default;
|
|
34
|
+
}
|
|
35
|
+
return pathStr;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const logoVariant = uiConfig.logos?.[variant];
|
|
39
|
+
if (logoVariant && typeof logoVariant === "object") {
|
|
40
|
+
if (mode) {
|
|
41
|
+
logoSrc = resolveLogo(logoVariant[mode] || logoVariant.color);
|
|
42
|
+
} else {
|
|
43
|
+
logoSrc = resolveLogo(logoVariant.color || logoVariant.black || logoVariant.white);
|
|
44
|
+
darkSrc = resolveLogo(logoVariant.white || logoVariant.color);
|
|
45
|
+
lightSrc = resolveLogo(logoVariant.black || logoVariant.color);
|
|
46
|
+
}
|
|
47
|
+
} else if (typeof logoVariant === "string") {
|
|
48
|
+
logoSrc = resolveLogo(logoVariant);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const startsWithUrlPrefix = logoSrc && (logoSrc.startsWith("http") || logoSrc.startsWith("/") || logoSrc.startsWith("."));
|
|
52
|
+
const isIcon = logoSrc && !startsWithUrlPrefix && (logoSrc.includes(":") || logoSrc.startsWith("i-"));
|
|
53
|
+
const hasAutoMode = darkSrc && lightSrc && darkSrc !== lightSrc && !mode;
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
<a
|
|
57
|
+
class={classes.root}
|
|
58
|
+
href={href}
|
|
59
|
+
aria-label={alt || variant}
|
|
60
|
+
data-slot="root"
|
|
61
|
+
data-theme={theme}
|
|
62
|
+
style={theme ? `color-scheme: ${theme};` : undefined}
|
|
63
|
+
{...rest}
|
|
64
|
+
>
|
|
65
|
+
{logoSrc ? (
|
|
66
|
+
isIcon ? (
|
|
67
|
+
<span class:list={[logoSrc, "size-full block shrink-0"]} aria-hidden="true" />
|
|
68
|
+
) : hasAutoMode ? (
|
|
69
|
+
<span
|
|
70
|
+
class="rla-logo-image size-full flex items-center justify-center shrink-0"
|
|
71
|
+
style={`--rla-logo-light: url('${lightSrc}'); --rla-logo-dark: url('${darkSrc}');`}
|
|
72
|
+
>
|
|
73
|
+
<img
|
|
74
|
+
src={lightSrc}
|
|
75
|
+
alt={alt || ""}
|
|
76
|
+
class="rla-logo-light size-full block object-contain shrink-0"
|
|
77
|
+
/>
|
|
78
|
+
<img
|
|
79
|
+
src={darkSrc}
|
|
80
|
+
alt={alt || ""}
|
|
81
|
+
class="rla-logo-dark size-full hidden object-contain shrink-0"
|
|
82
|
+
/>
|
|
83
|
+
</span>
|
|
84
|
+
) : (
|
|
85
|
+
<img
|
|
86
|
+
src={logoSrc}
|
|
87
|
+
alt={alt || ""}
|
|
88
|
+
class="size-full block object-contain shrink-0"
|
|
89
|
+
/>
|
|
90
|
+
)
|
|
91
|
+
) : (
|
|
92
|
+
<slot />
|
|
93
|
+
)}
|
|
94
|
+
</a>
|
|
95
|
+
|
|
96
|
+
<style>
|
|
97
|
+
:global(:root[data-theme="dark"]) .rla-logo-light,
|
|
98
|
+
:global([data-theme="dark"]) .rla-logo-light,
|
|
99
|
+
:global([data-theme="dark"]) .rla-logo-image .rla-logo-light,
|
|
100
|
+
:global(.rla-logo-image[data-theme="dark"]) .rla-logo-light {
|
|
101
|
+
display: none !important;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
:global(:root[data-theme="dark"]) .rla-logo-dark,
|
|
105
|
+
:global([data-theme="dark"]) .rla-logo-dark,
|
|
106
|
+
:global([data-theme="dark"]) .rla-logo-image .rla-logo-dark,
|
|
107
|
+
:global(.rla-logo-image[data-theme="dark"]) .rla-logo-dark {
|
|
108
|
+
display: block !important;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
:global(:root[data-theme="light"]) .rla-logo-light,
|
|
112
|
+
:global([data-theme="light"]) .rla-logo-light,
|
|
113
|
+
:global([data-theme="light"]) .rla-logo-image .rla-logo-light,
|
|
114
|
+
:global(.rla-logo-image[data-theme="light"]) .rla-logo-light {
|
|
115
|
+
display: block !important;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
:global(:root[data-theme="light"]) .rla-logo-dark,
|
|
119
|
+
:global([data-theme="light"]) .rla-logo-dark,
|
|
120
|
+
:global([data-theme="light"]) .rla-logo-image .rla-logo-dark,
|
|
121
|
+
:global(.rla-logo-image[data-theme="light"]) .rla-logo-dark {
|
|
122
|
+
display: none !important;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@media (prefers-color-scheme: dark) {
|
|
126
|
+
:global(:root:not([data-theme="light"])) .rla-logo-light {
|
|
127
|
+
display: none !important;
|
|
128
|
+
}
|
|
129
|
+
:global(:root:not([data-theme="light"])) .rla-logo-dark {
|
|
130
|
+
display: block !important;
|
|
131
|
+
}
|
|
132
|
+
:global(:root:not([data-theme="light"])) :global([data-theme="light"]) .rla-logo-light {
|
|
133
|
+
display: block !important;
|
|
134
|
+
}
|
|
135
|
+
:global(:root:not([data-theme="light"])) :global([data-theme="light"]) .rla-logo-dark {
|
|
136
|
+
display: none !important;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@supports (background-image: light-dark(none, none)) {
|
|
141
|
+
.rla-logo-image {
|
|
142
|
+
background-image: light-dark(var(--rla-logo-light), var(--rla-logo-dark));
|
|
143
|
+
background-size: contain;
|
|
144
|
+
background-position: center;
|
|
145
|
+
background-repeat: no-repeat;
|
|
146
|
+
}
|
|
147
|
+
.rla-logo-image > .rla-logo-light,
|
|
148
|
+
.rla-logo-image > .rla-logo-dark {
|
|
149
|
+
opacity: 0 !important;
|
|
150
|
+
visibility: hidden !important;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
</style>
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { createMemo, Show, splitProps, type Component, type JSX } from "solid-js"
|
|
2
|
+
import type { LogoProps } from "./logo"
|
|
3
|
+
import { logoTheme } from "./logo.theme"
|
|
4
|
+
import uiConfig from "virtual:rimelight/ui"
|
|
5
|
+
|
|
6
|
+
export interface RLSLogoProps extends LogoProps {
|
|
7
|
+
children?: JSX.Element
|
|
8
|
+
src?: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const RLSLogo: Component<RLSLogoProps> = (allProps) => {
|
|
12
|
+
const [props, rest] = splitProps(allProps, [
|
|
13
|
+
"variant",
|
|
14
|
+
"mode",
|
|
15
|
+
"theme",
|
|
16
|
+
"href",
|
|
17
|
+
"alt",
|
|
18
|
+
"src",
|
|
19
|
+
"ui",
|
|
20
|
+
"class",
|
|
21
|
+
"children"
|
|
22
|
+
])
|
|
23
|
+
|
|
24
|
+
const variant = () => props.variant || "logomark"
|
|
25
|
+
const href = () => props.href ?? "/"
|
|
26
|
+
|
|
27
|
+
const logoInfo = createMemo(() => {
|
|
28
|
+
if (props.src) {
|
|
29
|
+
return { logoSrc: props.src, darkSrc: null, lightSrc: null }
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const cfgLogos = (uiConfig as any)?.logos
|
|
33
|
+
const logoVariant = cfgLogos?.[variant()]
|
|
34
|
+
|
|
35
|
+
let logoSrc: string | null = null
|
|
36
|
+
let darkSrc: string | null = null
|
|
37
|
+
let lightSrc: string | null = null
|
|
38
|
+
|
|
39
|
+
if (logoVariant && typeof logoVariant === "object") {
|
|
40
|
+
if (props.mode) {
|
|
41
|
+
logoSrc = logoVariant[props.mode] || logoVariant.color
|
|
42
|
+
} else {
|
|
43
|
+
logoSrc = logoVariant.color || logoVariant.black || logoVariant.white
|
|
44
|
+
darkSrc = logoVariant.white || logoVariant.color
|
|
45
|
+
lightSrc = logoVariant.black || logoVariant.color
|
|
46
|
+
}
|
|
47
|
+
} else if (typeof logoVariant === "string") {
|
|
48
|
+
logoSrc = logoVariant
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return { logoSrc, darkSrc, lightSrc }
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
const startsWithUrlPrefix = () => {
|
|
55
|
+
const s = logoInfo().logoSrc
|
|
56
|
+
return s && (s.startsWith("http") || s.startsWith("/") || s.startsWith("."))
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const isIcon = () => {
|
|
60
|
+
const s = logoInfo().logoSrc
|
|
61
|
+
return s && !startsWithUrlPrefix() && (s.includes(":") || s.startsWith("i-"))
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const hasAutoMode = () => {
|
|
65
|
+
const { darkSrc, lightSrc } = logoInfo()
|
|
66
|
+
return darkSrc && lightSrc && darkSrc !== lightSrc && !props.mode
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const resolvedClasses = createMemo(() =>
|
|
70
|
+
logoTheme({
|
|
71
|
+
variant: variant(),
|
|
72
|
+
ui: props.ui,
|
|
73
|
+
class: props.class
|
|
74
|
+
})
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<a
|
|
79
|
+
class={resolvedClasses().root}
|
|
80
|
+
href={href()}
|
|
81
|
+
aria-label={props.alt || variant()}
|
|
82
|
+
data-slot="root"
|
|
83
|
+
data-theme={props.theme}
|
|
84
|
+
style={props.theme ? { "color-scheme": props.theme } : undefined}
|
|
85
|
+
{...rest}
|
|
86
|
+
>
|
|
87
|
+
<Show when={logoInfo().logoSrc} fallback={props.children}>
|
|
88
|
+
<Show
|
|
89
|
+
when={!isIcon()}
|
|
90
|
+
fallback={
|
|
91
|
+
<span class={`${logoInfo().logoSrc} size-full block shrink-0`} aria-hidden="true" />
|
|
92
|
+
}
|
|
93
|
+
>
|
|
94
|
+
<Show
|
|
95
|
+
when={!hasAutoMode()}
|
|
96
|
+
fallback={
|
|
97
|
+
<span
|
|
98
|
+
class="rla-logo-image size-full flex items-center justify-center shrink-0"
|
|
99
|
+
style={{
|
|
100
|
+
"--rla-logo-light": `url('${logoInfo().lightSrc}')`,
|
|
101
|
+
"--rla-logo-dark": `url('${logoInfo().darkSrc}')`
|
|
102
|
+
}}
|
|
103
|
+
>
|
|
104
|
+
<img
|
|
105
|
+
src={logoInfo().lightSrc || ""}
|
|
106
|
+
alt={props.alt || ""}
|
|
107
|
+
class="rla-logo-light size-full block object-contain shrink-0"
|
|
108
|
+
/>
|
|
109
|
+
<img
|
|
110
|
+
src={logoInfo().darkSrc || ""}
|
|
111
|
+
alt={props.alt || ""}
|
|
112
|
+
class="rla-logo-dark size-full hidden object-contain shrink-0"
|
|
113
|
+
/>
|
|
114
|
+
</span>
|
|
115
|
+
}
|
|
116
|
+
>
|
|
117
|
+
<img
|
|
118
|
+
src={logoInfo().logoSrc || ""}
|
|
119
|
+
alt={props.alt || ""}
|
|
120
|
+
class="size-full block object-contain shrink-0"
|
|
121
|
+
/>
|
|
122
|
+
</Show>
|
|
123
|
+
</Show>
|
|
124
|
+
</Show>
|
|
125
|
+
</a>
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export default RLSLogo
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { createMemo, splitProps, type Component, type JSX } from "solid-js"
|
|
2
|
+
import { Dynamic } from "solid-js/web"
|
|
3
|
+
import type { MainProps } from "./main"
|
|
4
|
+
import { mainTheme } from "./main.theme"
|
|
5
|
+
|
|
6
|
+
export interface RLSMainProps extends MainProps {
|
|
7
|
+
children?: JSX.Element
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const RLSMain: Component<RLSMainProps> = (allProps) => {
|
|
11
|
+
const [props, rest] = splitProps(allProps, ["as", "ui", "class", "children"])
|
|
12
|
+
|
|
13
|
+
const tag = () => props.as ?? "main"
|
|
14
|
+
|
|
15
|
+
const resolvedClasses = createMemo(() =>
|
|
16
|
+
mainTheme({
|
|
17
|
+
hasContent: props.children !== undefined,
|
|
18
|
+
ui: props.ui,
|
|
19
|
+
class: props.class
|
|
20
|
+
})
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<Dynamic
|
|
25
|
+
component={tag()}
|
|
26
|
+
class={`${resolvedClasses().root} rla-main-container`}
|
|
27
|
+
data-slot="main"
|
|
28
|
+
{...rest}
|
|
29
|
+
>
|
|
30
|
+
{props.children}
|
|
31
|
+
<style>{`
|
|
32
|
+
.rla-main-container {
|
|
33
|
+
padding-top: var(--rl-total-header-height, 4rem);
|
|
34
|
+
}
|
|
35
|
+
`}</style>
|
|
36
|
+
</Dynamic>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default RLSMain
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { createMemo, splitProps, type Component, type JSX } from "solid-js"
|
|
2
|
+
import type { MarqueeProps } from "./marquee"
|
|
3
|
+
import { marqueeTheme } from "./marquee.theme"
|
|
4
|
+
|
|
5
|
+
export interface RLSMarqueeProps extends MarqueeProps {
|
|
6
|
+
children?: JSX.Element
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const MARQUEE_KEYFRAMES = `
|
|
10
|
+
@keyframes marquee-left {
|
|
11
|
+
from { transform: translateX(0); }
|
|
12
|
+
to { transform: translateX(-100%); }
|
|
13
|
+
}
|
|
14
|
+
@keyframes marquee-right {
|
|
15
|
+
from { transform: translateX(-100%); }
|
|
16
|
+
to { transform: translateX(0); }
|
|
17
|
+
}
|
|
18
|
+
@keyframes marquee-up {
|
|
19
|
+
from { transform: translateY(0); }
|
|
20
|
+
to { transform: translateY(-100%); }
|
|
21
|
+
}
|
|
22
|
+
@keyframes marquee-down {
|
|
23
|
+
from { transform: translateY(-100%); }
|
|
24
|
+
to { transform: translateY(0); }
|
|
25
|
+
}
|
|
26
|
+
.animate-marquee,
|
|
27
|
+
.animate-marquee-left {
|
|
28
|
+
animation: marquee-left 30s linear infinite;
|
|
29
|
+
}
|
|
30
|
+
.animate-marquee-right {
|
|
31
|
+
animation: marquee-right 30s linear infinite;
|
|
32
|
+
}
|
|
33
|
+
.animate-marquee-up {
|
|
34
|
+
animation: marquee-up 30s linear infinite;
|
|
35
|
+
}
|
|
36
|
+
.animate-marquee-down {
|
|
37
|
+
animation: marquee-down 30s linear infinite;
|
|
38
|
+
}
|
|
39
|
+
`
|
|
40
|
+
|
|
41
|
+
const RLSMarquee: Component<RLSMarqueeProps> = (allProps) => {
|
|
42
|
+
const [props, rest] = splitProps(allProps, [
|
|
43
|
+
"speed",
|
|
44
|
+
"direction",
|
|
45
|
+
"pauseOnHover",
|
|
46
|
+
"ui",
|
|
47
|
+
"class",
|
|
48
|
+
"children"
|
|
49
|
+
])
|
|
50
|
+
|
|
51
|
+
const resolvedClasses = createMemo(() =>
|
|
52
|
+
marqueeTheme({
|
|
53
|
+
direction: props.direction ?? "left",
|
|
54
|
+
pauseOnHover: props.pauseOnHover ?? true,
|
|
55
|
+
ui: props.ui,
|
|
56
|
+
class: props.class
|
|
57
|
+
})
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
const trackStyle = () => ({ "animation-duration": `${props.speed ?? 40}s` })
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<div class={resolvedClasses().root} data-slot="marquee-root" {...rest}>
|
|
64
|
+
<div class={resolvedClasses().track} data-slot="track" style={trackStyle()}>
|
|
65
|
+
{props.children}
|
|
66
|
+
</div>
|
|
67
|
+
<div
|
|
68
|
+
class={resolvedClasses().track}
|
|
69
|
+
data-slot="track"
|
|
70
|
+
style={trackStyle()}
|
|
71
|
+
aria-hidden="true"
|
|
72
|
+
>
|
|
73
|
+
{props.children}
|
|
74
|
+
</div>
|
|
75
|
+
<style>{MARQUEE_KEYFRAMES}</style>
|
|
76
|
+
</div>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export default RLSMarquee
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createMemo, splitProps, type Component, type JSX } from "solid-js"
|
|
2
|
+
import type { MeterProps } from "./meter"
|
|
3
|
+
import { meterTheme } from "./meter.theme"
|
|
4
|
+
|
|
5
|
+
export interface RLSMeterProps extends MeterProps {
|
|
6
|
+
children?: JSX.Element
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const RLSMeter: Component<RLSMeterProps> = (allProps) => {
|
|
10
|
+
const [props, rest] = splitProps(allProps, ["ui", "class", "children"])
|
|
11
|
+
|
|
12
|
+
const resolvedClasses = createMemo(() =>
|
|
13
|
+
meterTheme({
|
|
14
|
+
ui: props.ui,
|
|
15
|
+
class: props.class,
|
|
16
|
+
...allProps
|
|
17
|
+
})
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<div class={resolvedClasses().root} data-slot="root" {...rest}>
|
|
22
|
+
{props.children}
|
|
23
|
+
</div>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default RLSMeter
|
|
@@ -23,7 +23,7 @@ const classes = modalTheme(Astro.props)
|
|
|
23
23
|
|
|
24
24
|
const modalId = `rla-modal-${Math.random().toString(36).substring(2, 9)}`
|
|
25
25
|
---
|
|
26
|
-
<div class={classes.root} data-slot="
|
|
26
|
+
<div class={classes.root} data-slot="root">
|
|
27
27
|
{triggerLabel ? (
|
|
28
28
|
<button
|
|
29
29
|
class={classes.trigger}
|