@rimelight/ui 0.0.47 → 0.0.49
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/index.d.mts +4 -5
- package/dist/preset.mjs +73 -1
- package/dist/resolver.d.mts +3 -4
- package/dist/resolver.mjs +2 -4
- package/dist/shortcuts.d.mts +10 -11
- package/dist/stores.d.mts +3 -4
- 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/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 +49 -40
- 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/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/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/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/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/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/RLSLayoutGrid.tsx +402 -0
- package/src/components/layout-grid/layout-grid.ts +25 -1
- package/src/components/link/RLSLink.tsx +2 -1
- 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 +2 -1
- package/src/components/locale-selector/RLSLocaleSelector.tsx +178 -0
- package/src/components/logo/RLALogo.astro +69 -4
- 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/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/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/RLSScrollArea.tsx +210 -0
- package/src/components/scroll-to-top/RLAScrollToTop.astro +1 -0
- package/src/components/scroll-to-top/RLSScrollToTop.tsx +145 -0
- 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/RLSShortcuts.tsx +393 -0
- 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/RLSSplitter.tsx +178 -0
- package/src/components/spoiler/RLSSpoiler.tsx +26 -0
- 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/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/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
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createMemo, splitProps, type Component, type JSX } from "solid-js"
|
|
2
|
+
import type { PageProps } from "./page"
|
|
3
|
+
import { pageTheme } from "./page.theme"
|
|
4
|
+
|
|
5
|
+
export interface RLSPageProps extends PageProps {
|
|
6
|
+
children?: JSX.Element
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const RLSPage: Component<RLSPageProps> = (allProps) => {
|
|
10
|
+
const [props, rest] = splitProps(allProps, ["ui", "class", "children"])
|
|
11
|
+
|
|
12
|
+
const resolvedClasses = createMemo(() => pageTheme({ ui: props.ui, class: props.class }))
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div class={resolvedClasses().root} data-slot="root" {...rest}>
|
|
16
|
+
{props.children}
|
|
17
|
+
</div>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default RLSPage
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createMemo, splitProps, type Component, type JSX } from "solid-js"
|
|
2
|
+
import type { PageAsideProps } from "./page-aside"
|
|
3
|
+
import { pageAsideTheme } from "./page-aside.theme"
|
|
4
|
+
|
|
5
|
+
export interface RLSPageAsideProps extends PageAsideProps {
|
|
6
|
+
children?: JSX.Element
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const RLSPageAside: Component<RLSPageAsideProps> = (allProps) => {
|
|
10
|
+
const [props, rest] = splitProps(allProps, ["ui", "class", "children"])
|
|
11
|
+
|
|
12
|
+
const resolvedClasses = createMemo(() => pageAsideTheme({ ui: props.ui, class: props.class }))
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div class={resolvedClasses().root} data-slot="root" {...rest}>
|
|
16
|
+
{props.children}
|
|
17
|
+
</div>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default RLSPageAside
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createMemo, splitProps, type Component, type JSX } from "solid-js"
|
|
2
|
+
import type { PageBodyProps } from "./page-body"
|
|
3
|
+
import { pageBodyTheme } from "./page-body.theme"
|
|
4
|
+
|
|
5
|
+
export interface RLSPageBodyProps extends PageBodyProps {
|
|
6
|
+
children?: JSX.Element
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const RLSPageBody: Component<RLSPageBodyProps> = (allProps) => {
|
|
10
|
+
const [props, rest] = splitProps(allProps, ["ui", "class", "children"])
|
|
11
|
+
|
|
12
|
+
const resolvedClasses = createMemo(() => pageBodyTheme({ ui: props.ui, class: props.class }))
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div class={resolvedClasses().root} data-slot="root" {...rest}>
|
|
16
|
+
{props.children}
|
|
17
|
+
</div>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default RLSPageBody
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createMemo, splitProps, type Component, type JSX } from "solid-js"
|
|
2
|
+
import type { PageHeaderProps } from "./page-header"
|
|
3
|
+
import { pageHeaderTheme } from "./page-header.theme"
|
|
4
|
+
|
|
5
|
+
export interface RLSPageHeaderProps extends PageHeaderProps {
|
|
6
|
+
children?: JSX.Element
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const RLSPageHeader: Component<RLSPageHeaderProps> = (allProps) => {
|
|
10
|
+
const [props, rest] = splitProps(allProps, ["ui", "class", "children"])
|
|
11
|
+
|
|
12
|
+
const resolvedClasses = createMemo(() => pageHeaderTheme({ ui: props.ui, class: props.class }))
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div class={resolvedClasses().root} data-slot="root" {...rest}>
|
|
16
|
+
{props.children}
|
|
17
|
+
</div>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default RLSPageHeader
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { createMemo, splitProps, For, type Component, type JSX } from "solid-js"
|
|
2
|
+
import { Dynamic } from "solid-js/web"
|
|
3
|
+
import type { PageSectionProps } from "./page-section"
|
|
4
|
+
import { pageSectionTheme } from "./page-section.theme"
|
|
5
|
+
import RLSIcon from "../icon/RLSIcon"
|
|
6
|
+
import RLSButton from "../button/RLSButton"
|
|
7
|
+
|
|
8
|
+
export interface RLSPageSectionProps extends PageSectionProps {
|
|
9
|
+
background?: JSX.Element
|
|
10
|
+
top?: JSX.Element
|
|
11
|
+
header?: JSX.Element
|
|
12
|
+
leading?: JSX.Element
|
|
13
|
+
headlineSlot?: JSX.Element
|
|
14
|
+
titleSlot?: JSX.Element
|
|
15
|
+
descriptionSlot?: JSX.Element
|
|
16
|
+
body?: JSX.Element
|
|
17
|
+
footer?: JSX.Element
|
|
18
|
+
linksSlot?: JSX.Element
|
|
19
|
+
content?: JSX.Element
|
|
20
|
+
bottom?: JSX.Element
|
|
21
|
+
children?: JSX.Element
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const RLSPageSection: Component<RLSPageSectionProps> = (allProps) => {
|
|
25
|
+
const [props, rest] = splitProps(allProps, [
|
|
26
|
+
"as",
|
|
27
|
+
"variant",
|
|
28
|
+
"ctaVariant",
|
|
29
|
+
"headline",
|
|
30
|
+
"icon",
|
|
31
|
+
"title",
|
|
32
|
+
"description",
|
|
33
|
+
"links",
|
|
34
|
+
"orientation",
|
|
35
|
+
"reverse",
|
|
36
|
+
"contentVisibility",
|
|
37
|
+
"containIntrinsicSize",
|
|
38
|
+
"ui",
|
|
39
|
+
"class",
|
|
40
|
+
"background",
|
|
41
|
+
"top",
|
|
42
|
+
"header",
|
|
43
|
+
"leading",
|
|
44
|
+
"headlineSlot",
|
|
45
|
+
"titleSlot",
|
|
46
|
+
"descriptionSlot",
|
|
47
|
+
"body",
|
|
48
|
+
"footer",
|
|
49
|
+
"linksSlot",
|
|
50
|
+
"content",
|
|
51
|
+
"bottom",
|
|
52
|
+
"children"
|
|
53
|
+
])
|
|
54
|
+
|
|
55
|
+
const resolvedVariant = () =>
|
|
56
|
+
props.variant === "default" || props.variant === "hero" || props.variant === "cta"
|
|
57
|
+
? props.variant
|
|
58
|
+
: "default"
|
|
59
|
+
|
|
60
|
+
const resolvedClasses = createMemo(() =>
|
|
61
|
+
pageSectionTheme({
|
|
62
|
+
variant: resolvedVariant(),
|
|
63
|
+
...(resolvedVariant() === "cta" ? { ctaVariant: props.ctaVariant ?? "solid" } : {}),
|
|
64
|
+
orientation: props.orientation ?? "vertical",
|
|
65
|
+
reverse: !!props.reverse,
|
|
66
|
+
headline: !!(props.headlineSlot || props.headline),
|
|
67
|
+
title: !!(props.titleSlot || props.title),
|
|
68
|
+
description: !!(props.descriptionSlot || props.description),
|
|
69
|
+
body: !!props.body,
|
|
70
|
+
ui: props.ui,
|
|
71
|
+
class: props.class
|
|
72
|
+
})
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
const tag = () => props.as ?? "section"
|
|
76
|
+
const titleTag = () => (resolvedVariant() === "hero" ? "h1" : "h2")
|
|
77
|
+
|
|
78
|
+
const showHeader = () =>
|
|
79
|
+
!!(
|
|
80
|
+
props.header ||
|
|
81
|
+
props.icon ||
|
|
82
|
+
props.headline ||
|
|
83
|
+
props.headlineSlot ||
|
|
84
|
+
props.title ||
|
|
85
|
+
props.titleSlot ||
|
|
86
|
+
props.description ||
|
|
87
|
+
props.descriptionSlot
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
const showWrapper = () =>
|
|
91
|
+
!!(
|
|
92
|
+
showHeader() ||
|
|
93
|
+
props.body ||
|
|
94
|
+
props.footer ||
|
|
95
|
+
props.linksSlot ||
|
|
96
|
+
(props.links?.length ?? 0) > 0
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
return (
|
|
100
|
+
<Dynamic
|
|
101
|
+
component={tag()}
|
|
102
|
+
data-orientation={props.orientation ?? "vertical"}
|
|
103
|
+
class={`${resolvedClasses().root} ${
|
|
104
|
+
props.contentVisibility === "auto"
|
|
105
|
+
? "[content-visibility:auto] [contain-intrinsic-size:var(--rla-contain-intrinsic-size,auto_500px)]"
|
|
106
|
+
: ""
|
|
107
|
+
}`}
|
|
108
|
+
style={
|
|
109
|
+
props.containIntrinsicSize
|
|
110
|
+
? { "--rla-contain-intrinsic-size": props.containIntrinsicSize }
|
|
111
|
+
: undefined
|
|
112
|
+
}
|
|
113
|
+
{...rest}
|
|
114
|
+
>
|
|
115
|
+
{props.background ? (
|
|
116
|
+
<div class={resolvedClasses().background} data-slot="background">
|
|
117
|
+
{props.background}
|
|
118
|
+
</div>
|
|
119
|
+
) : null}
|
|
120
|
+
|
|
121
|
+
{props.top}
|
|
122
|
+
|
|
123
|
+
<div class={resolvedClasses().container}>
|
|
124
|
+
{showWrapper() ? (
|
|
125
|
+
<div class={resolvedClasses().wrapper}>
|
|
126
|
+
{showHeader() ? (
|
|
127
|
+
<div class={resolvedClasses().header}>
|
|
128
|
+
{props.header ? (
|
|
129
|
+
props.header
|
|
130
|
+
) : (
|
|
131
|
+
<>
|
|
132
|
+
{props.icon || props.leading ? (
|
|
133
|
+
<div class={resolvedClasses().leading}>
|
|
134
|
+
{props.leading ? (
|
|
135
|
+
props.leading
|
|
136
|
+
) : props.icon ? (
|
|
137
|
+
<RLSIcon
|
|
138
|
+
name={props.icon}
|
|
139
|
+
size="md"
|
|
140
|
+
ui={{ root: resolvedClasses().leadingIcon }}
|
|
141
|
+
/>
|
|
142
|
+
) : null}
|
|
143
|
+
</div>
|
|
144
|
+
) : null}
|
|
145
|
+
|
|
146
|
+
{props.headline || props.headlineSlot ? (
|
|
147
|
+
<div class={resolvedClasses().headline}>
|
|
148
|
+
{props.headlineSlot ?? props.headline}
|
|
149
|
+
</div>
|
|
150
|
+
) : null}
|
|
151
|
+
|
|
152
|
+
{props.title || props.titleSlot ? (
|
|
153
|
+
<Dynamic component={titleTag()} class={resolvedClasses().title}>
|
|
154
|
+
{props.titleSlot ?? props.title}
|
|
155
|
+
</Dynamic>
|
|
156
|
+
) : null}
|
|
157
|
+
|
|
158
|
+
{props.description || props.descriptionSlot ? (
|
|
159
|
+
<div class={resolvedClasses().description}>
|
|
160
|
+
{props.descriptionSlot ?? props.description}
|
|
161
|
+
</div>
|
|
162
|
+
) : null}
|
|
163
|
+
</>
|
|
164
|
+
)}
|
|
165
|
+
</div>
|
|
166
|
+
) : null}
|
|
167
|
+
|
|
168
|
+
{props.body ? <div class={resolvedClasses().body}>{props.body}</div> : null}
|
|
169
|
+
|
|
170
|
+
{props.footer || props.linksSlot || (props.links?.length ?? 0) > 0 ? (
|
|
171
|
+
<div class={resolvedClasses().footer}>
|
|
172
|
+
{props.footer ? (
|
|
173
|
+
props.footer
|
|
174
|
+
) : (
|
|
175
|
+
<div class={resolvedClasses().links}>
|
|
176
|
+
<For each={props.links ?? []}>
|
|
177
|
+
{(link) => <RLSButton size="lg" {...link} />}
|
|
178
|
+
</For>
|
|
179
|
+
{props.linksSlot}
|
|
180
|
+
</div>
|
|
181
|
+
)}
|
|
182
|
+
</div>
|
|
183
|
+
) : null}
|
|
184
|
+
</div>
|
|
185
|
+
) : null}
|
|
186
|
+
|
|
187
|
+
{props.children !== undefined && props.children !== null ? (
|
|
188
|
+
props.children
|
|
189
|
+
) : (props.orientation ?? "vertical") === "horizontal" ? (
|
|
190
|
+
<div class="hidden lg:block" />
|
|
191
|
+
) : null}
|
|
192
|
+
|
|
193
|
+
{props.content ? <div class="col-span-full w-full">{props.content}</div> : null}
|
|
194
|
+
</div>
|
|
195
|
+
|
|
196
|
+
{props.bottom}
|
|
197
|
+
</Dynamic>
|
|
198
|
+
)
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export default RLSPageSection
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { createMemo, splitProps, For, type Component } from "solid-js"
|
|
2
|
+
import type { PaginationProps } from "./pagination"
|
|
3
|
+
import { paginationTheme } from "./pagination.theme"
|
|
4
|
+
import RLSIcon from "../icon/RLSIcon"
|
|
5
|
+
|
|
6
|
+
export interface RLSPaginationProps extends PaginationProps {
|
|
7
|
+
page?: number
|
|
8
|
+
onPageChange?: (page: number) => void
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const RLSPagination: Component<RLSPaginationProps> = (allProps) => {
|
|
12
|
+
const [props, rest] = splitProps(allProps, [
|
|
13
|
+
"currentPage",
|
|
14
|
+
"page",
|
|
15
|
+
"totalPages",
|
|
16
|
+
"baseUrl",
|
|
17
|
+
"onPageChange",
|
|
18
|
+
"ui",
|
|
19
|
+
"class"
|
|
20
|
+
])
|
|
21
|
+
|
|
22
|
+
const currentPage = () => props.page ?? props.currentPage ?? 1
|
|
23
|
+
const totalPages = () => props.totalPages ?? 1
|
|
24
|
+
|
|
25
|
+
const resolvedClasses = createMemo(() =>
|
|
26
|
+
paginationTheme({
|
|
27
|
+
ui: props.ui,
|
|
28
|
+
class: props.class
|
|
29
|
+
})
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
const pageNumbers = createMemo<(number | "ellipsis")[]>(() => {
|
|
33
|
+
const total = totalPages()
|
|
34
|
+
const current = currentPage()
|
|
35
|
+
const pages: (number | "ellipsis")[] = []
|
|
36
|
+
const maxVisible = 5
|
|
37
|
+
if (total <= maxVisible) {
|
|
38
|
+
for (let i = 1; i <= total; i++) pages.push(i)
|
|
39
|
+
} else {
|
|
40
|
+
pages.push(1)
|
|
41
|
+
if (current > 3) pages.push("ellipsis")
|
|
42
|
+
const start = Math.max(2, current - 1)
|
|
43
|
+
const end = Math.min(total - 1, current + 1)
|
|
44
|
+
for (let i = start; i <= end; i++) {
|
|
45
|
+
if (!pages.includes(i)) pages.push(i)
|
|
46
|
+
}
|
|
47
|
+
if (current < total - 2) pages.push("ellipsis")
|
|
48
|
+
if (!pages.includes(total)) pages.push(total)
|
|
49
|
+
}
|
|
50
|
+
return pages
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
const itemLinkClasses = (isActive: boolean) => paginationTheme({ active: isActive }).link
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<nav
|
|
57
|
+
class={resolvedClasses().root}
|
|
58
|
+
data-slot="pagination-root"
|
|
59
|
+
aria-label="pagination"
|
|
60
|
+
{...rest}
|
|
61
|
+
>
|
|
62
|
+
<ul class={resolvedClasses().list} data-slot="list">
|
|
63
|
+
<li class={resolvedClasses().item}>
|
|
64
|
+
<button
|
|
65
|
+
type="button"
|
|
66
|
+
class={`${resolvedClasses().link} ${currentPage() === 1 ? "pointer-events-none opacity-50" : ""}`}
|
|
67
|
+
aria-label="Go to previous page"
|
|
68
|
+
aria-disabled={currentPage() === 1}
|
|
69
|
+
disabled={currentPage() === 1}
|
|
70
|
+
onClick={() => props.onPageChange?.(currentPage() - 1)}
|
|
71
|
+
>
|
|
72
|
+
<RLSIcon name="chevronLeft" size="sm" aria-hidden="true" />
|
|
73
|
+
</button>
|
|
74
|
+
</li>
|
|
75
|
+
|
|
76
|
+
<For each={pageNumbers()}>
|
|
77
|
+
{(p) => (
|
|
78
|
+
<li class={resolvedClasses().item}>
|
|
79
|
+
{p === "ellipsis" ? (
|
|
80
|
+
<span class={resolvedClasses().ellipsis} aria-hidden="true">
|
|
81
|
+
…
|
|
82
|
+
</span>
|
|
83
|
+
) : (
|
|
84
|
+
<button
|
|
85
|
+
type="button"
|
|
86
|
+
class={itemLinkClasses(p === currentPage())}
|
|
87
|
+
aria-current={p === currentPage() ? "page" : undefined}
|
|
88
|
+
onClick={() => props.onPageChange?.(p)}
|
|
89
|
+
>
|
|
90
|
+
{p}
|
|
91
|
+
</button>
|
|
92
|
+
)}
|
|
93
|
+
</li>
|
|
94
|
+
)}
|
|
95
|
+
</For>
|
|
96
|
+
|
|
97
|
+
<li class={resolvedClasses().item}>
|
|
98
|
+
<button
|
|
99
|
+
type="button"
|
|
100
|
+
class={`${resolvedClasses().link} ${currentPage() === totalPages() ? "pointer-events-none opacity-50" : ""}`}
|
|
101
|
+
aria-label="Go to next page"
|
|
102
|
+
aria-disabled={currentPage() === totalPages()}
|
|
103
|
+
disabled={currentPage() === totalPages()}
|
|
104
|
+
onClick={() => props.onPageChange?.(currentPage() + 1)}
|
|
105
|
+
>
|
|
106
|
+
<RLSIcon name="chevronRight" size="sm" aria-hidden="true" />
|
|
107
|
+
</button>
|
|
108
|
+
</li>
|
|
109
|
+
</ul>
|
|
110
|
+
</nav>
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export default RLSPagination
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createMemo, splitProps, type Component, type JSX } from "solid-js"
|
|
2
|
+
import type { PasswordProps } from "./password"
|
|
3
|
+
import { passwordTheme } from "./password.theme"
|
|
4
|
+
|
|
5
|
+
export interface RLSPasswordProps extends PasswordProps {
|
|
6
|
+
children?: JSX.Element
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const RLSPassword: Component<RLSPasswordProps> = (allProps) => {
|
|
10
|
+
const [props, rest] = splitProps(allProps, ["ui", "class", "children"])
|
|
11
|
+
|
|
12
|
+
const resolvedClasses = createMemo(() =>
|
|
13
|
+
passwordTheme({
|
|
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 RLSPassword
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createMemo, splitProps, type Component, type JSX } from "solid-js"
|
|
2
|
+
import type { PhoneMockupProps } from "./phone-mockup"
|
|
3
|
+
import { phoneMockupTheme } from "./phone-mockup.theme"
|
|
4
|
+
|
|
5
|
+
export interface RLSPhoneMockupProps extends PhoneMockupProps {
|
|
6
|
+
children?: JSX.Element
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const RLSPhoneMockup: Component<RLSPhoneMockupProps> = (allProps) => {
|
|
10
|
+
const [props, rest] = splitProps(allProps, ["ui", "class", "children"])
|
|
11
|
+
|
|
12
|
+
const resolvedClasses = createMemo(() =>
|
|
13
|
+
phoneMockupTheme({
|
|
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 RLSPhoneMockup
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { createMemo, splitProps, type Component, type JSX } from "solid-js"
|
|
2
|
+
import type { PlaceholderProps } from "./placeholder"
|
|
3
|
+
import { placeholderTheme } from "./placeholder.theme"
|
|
4
|
+
|
|
5
|
+
export interface RLSPlaceholderProps extends PlaceholderProps {
|
|
6
|
+
children?: JSX.Element
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const RLSPlaceholder: Component<RLSPlaceholderProps> = (allProps) => {
|
|
10
|
+
const [props, rest] = splitProps(allProps, ["ui", "class", "children"])
|
|
11
|
+
|
|
12
|
+
const classes = createMemo(() =>
|
|
13
|
+
placeholderTheme({
|
|
14
|
+
ui: props.ui,
|
|
15
|
+
class: props.class
|
|
16
|
+
})
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<div class={classes()["base"]} {...rest}>
|
|
21
|
+
<svg class={classes()["svg"]}>
|
|
22
|
+
<defs>
|
|
23
|
+
<pattern
|
|
24
|
+
id="pattern-5c1e4f0e-62d5-498b-8ff0-cf77bb448c8e"
|
|
25
|
+
x="0"
|
|
26
|
+
y="0"
|
|
27
|
+
width="10"
|
|
28
|
+
height="10"
|
|
29
|
+
patternUnits="userSpaceOnUse"
|
|
30
|
+
>
|
|
31
|
+
<path d="M-3 13 15-5M-5 5l18-18M-1 21 17 3" />
|
|
32
|
+
</pattern>
|
|
33
|
+
</defs>
|
|
34
|
+
<rect
|
|
35
|
+
stroke="none"
|
|
36
|
+
fill="url(#pattern-5c1e4f0e-62d5-498b-8ff0-cf77bb448c8e)"
|
|
37
|
+
width="100%"
|
|
38
|
+
height="100%"
|
|
39
|
+
/>
|
|
40
|
+
</svg>
|
|
41
|
+
|
|
42
|
+
{props.children}
|
|
43
|
+
</div>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export default RLSPlaceholder
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createMemo,
|
|
3
|
+
createSignal,
|
|
4
|
+
splitProps,
|
|
5
|
+
Show,
|
|
6
|
+
onMount,
|
|
7
|
+
onCleanup,
|
|
8
|
+
type Component,
|
|
9
|
+
type JSX
|
|
10
|
+
} from "solid-js"
|
|
11
|
+
import type { PopoverProps } from "./popover"
|
|
12
|
+
import { popoverTheme } from "./popover.theme"
|
|
13
|
+
|
|
14
|
+
export interface RLSPopoverProps extends PopoverProps {
|
|
15
|
+
children?: JSX.Element
|
|
16
|
+
trigger?: JSX.Element
|
|
17
|
+
defaultOpen?: boolean
|
|
18
|
+
onOpenChange?: (open: boolean) => void
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const RLSPopover: Component<RLSPopoverProps> = (allProps) => {
|
|
22
|
+
const [props, rest] = splitProps(allProps, [
|
|
23
|
+
"open",
|
|
24
|
+
"defaultOpen",
|
|
25
|
+
"triggerLabel",
|
|
26
|
+
"placement",
|
|
27
|
+
"mode",
|
|
28
|
+
"ui",
|
|
29
|
+
"class",
|
|
30
|
+
"children",
|
|
31
|
+
"trigger",
|
|
32
|
+
"onOpenChange"
|
|
33
|
+
])
|
|
34
|
+
|
|
35
|
+
const [isOpen, setIsOpen] = createSignal(props.open ?? props.defaultOpen ?? false)
|
|
36
|
+
const [isHovered, setIsHovered] = createSignal(false)
|
|
37
|
+
|
|
38
|
+
const mode = () => props.mode ?? "both"
|
|
39
|
+
const isVisible = () => isOpen() || isHovered()
|
|
40
|
+
|
|
41
|
+
let containerRef: HTMLDivElement | undefined
|
|
42
|
+
let hoverTimer: ReturnType<typeof setTimeout> | undefined
|
|
43
|
+
|
|
44
|
+
const handleOpenChange = (next: boolean) => {
|
|
45
|
+
setIsOpen(next)
|
|
46
|
+
props.onOpenChange?.(next)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const handleHoverShow = () => {
|
|
50
|
+
if (hoverTimer) clearTimeout(hoverTimer)
|
|
51
|
+
setIsHovered(true)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const handleHoverHide = () => {
|
|
55
|
+
if (hoverTimer) clearTimeout(hoverTimer)
|
|
56
|
+
hoverTimer = setTimeout(() => {
|
|
57
|
+
setIsHovered(false)
|
|
58
|
+
}, 150)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
onMount(() => {
|
|
62
|
+
const handleOutsideClick = (e: MouseEvent) => {
|
|
63
|
+
if (isOpen() && containerRef && !containerRef.contains(e.target as Node)) {
|
|
64
|
+
handleOpenChange(false)
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
document.addEventListener("click", handleOutsideClick)
|
|
68
|
+
onCleanup(() => document.removeEventListener("click", handleOutsideClick))
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
onCleanup(() => {
|
|
72
|
+
if (hoverTimer) clearTimeout(hoverTimer)
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
const resolvedClasses = createMemo(() =>
|
|
76
|
+
popoverTheme({
|
|
77
|
+
placement: props.placement ?? "bottom",
|
|
78
|
+
ui: props.ui,
|
|
79
|
+
class: props.class
|
|
80
|
+
})
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<div
|
|
85
|
+
ref={(el) => (containerRef = el)}
|
|
86
|
+
class={`rla-popover-host ${resolvedClasses().root}`}
|
|
87
|
+
data-slot="popover-container"
|
|
88
|
+
data-placement={props.placement ?? "bottom"}
|
|
89
|
+
data-mode={mode()}
|
|
90
|
+
{...rest}
|
|
91
|
+
>
|
|
92
|
+
<div
|
|
93
|
+
class={resolvedClasses().trigger}
|
|
94
|
+
data-slot="trigger"
|
|
95
|
+
onClick={(e) => {
|
|
96
|
+
e.stopPropagation()
|
|
97
|
+
if (mode() === "click" || mode() === "both") handleOpenChange(!isOpen())
|
|
98
|
+
}}
|
|
99
|
+
onMouseEnter={() => {
|
|
100
|
+
if (mode() === "hover" || mode() === "both") handleHoverShow()
|
|
101
|
+
}}
|
|
102
|
+
onMouseLeave={() => {
|
|
103
|
+
if (mode() === "hover" || mode() === "both") handleHoverHide()
|
|
104
|
+
}}
|
|
105
|
+
>
|
|
106
|
+
{props.trigger ? (
|
|
107
|
+
props.trigger
|
|
108
|
+
) : props.triggerLabel ? (
|
|
109
|
+
<button type="button" class="cursor-pointer">
|
|
110
|
+
{props.triggerLabel}
|
|
111
|
+
</button>
|
|
112
|
+
) : null}
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
<Show when={isVisible()}>
|
|
116
|
+
<div class={resolvedClasses().content} data-slot="content">
|
|
117
|
+
{props.children}
|
|
118
|
+
</div>
|
|
119
|
+
</Show>
|
|
120
|
+
</div>
|
|
121
|
+
)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export default RLSPopover
|