@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.
Files changed (222) hide show
  1. package/dist/icons-DPnFQCts.d.mts +72 -0
  2. package/dist/icons.d.mts +1 -1
  3. package/dist/index.d.mts +5 -6
  4. package/dist/preset.d.mts +1 -1
  5. package/dist/preset.mjs +73 -1
  6. package/dist/resolver.d.mts +4 -5
  7. package/dist/resolver.mjs +2 -4
  8. package/dist/shortcuts.d.mts +10 -11
  9. package/dist/stores.d.mts +3 -4
  10. package/dist/{types-DqAgCNcm.d.mts → types-DWmKMcYC.d.mts} +1 -1
  11. package/dist/types.d.mts +1 -1
  12. package/package.json +8 -6
  13. package/src/components/3d-hover/RLS3dHover.tsx +21 -0
  14. package/src/components/accordion/RLSAccordion.tsx +112 -0
  15. package/src/components/app/RLSApp.tsx +21 -0
  16. package/src/components/aspect-ratio/RLSAspectRatio.tsx +30 -0
  17. package/src/components/audio/RLSAudio.tsx +27 -0
  18. package/src/components/avatar/RLSAvatar.tsx +142 -0
  19. package/src/components/avatar/avatar.ts +22 -21
  20. package/src/components/avatar-group/RLSAvatarGroup.tsx +163 -0
  21. package/src/components/badge/RLSBadge.tsx +1 -1
  22. package/src/components/badge/RLVBadge.vue +5 -3
  23. package/src/components/banner/RLABanner.astro +1 -1
  24. package/src/components/banner/RLSBanner.tsx +151 -0
  25. package/src/components/breadcrumb/RLSBreadcrumb.tsx +194 -0
  26. package/src/components/browser-mockup/RLSBrowserMockup.tsx +21 -0
  27. package/src/components/button/RLSButton.tsx +53 -38
  28. package/src/components/button/RLVButton.vue +44 -32
  29. package/src/components/calendar/RLSCalendar.tsx +26 -0
  30. package/src/components/callout/RLSCallout.tsx +151 -0
  31. package/src/components/card/RLSCard.tsx +4 -0
  32. package/src/components/card/RLVCard.vue +4 -0
  33. package/src/components/card/card.ts +10 -0
  34. package/src/components/carousel/RLACarousel.astro +14 -1
  35. package/src/components/carousel/RLSCarousel.tsx +260 -0
  36. package/src/components/chart/RLSChart.tsx +299 -0
  37. package/src/components/chat/RLSChat.tsx +27 -0
  38. package/src/components/chat-message/RLSChatMessage.tsx +27 -0
  39. package/src/components/chat-messages/RLSChatMessages.tsx +27 -0
  40. package/src/components/chat-palette/RLSChatPalette.tsx +27 -0
  41. package/src/components/chat-prompt/RLSChatPrompt.tsx +27 -0
  42. package/src/components/chat-prompt-submit/RLSChatPromptSubmit.tsx +27 -0
  43. package/src/components/chat-reasoning/RLSChatReasoning.tsx +27 -0
  44. package/src/components/chat-shimmer/RLSChatShimmer.tsx +27 -0
  45. package/src/components/chat-tool/RLSChatTool.tsx +27 -0
  46. package/src/components/checkbox/RLACheckbox.astro +1 -0
  47. package/src/components/checkbox/RLSCheckbox.tsx +1 -1
  48. package/src/components/checkbox/checkbox.theme.ts +2 -2
  49. package/src/components/chip/RLSChip.tsx +65 -0
  50. package/src/components/collapsible/RLSCollapsible.tsx +89 -0
  51. package/src/components/color-area/RLSColorArea.tsx +554 -0
  52. package/src/components/color-field/RLSColorField.tsx +236 -0
  53. package/src/components/color-picker/RLSColorPicker.tsx +26 -0
  54. package/src/components/color-slider/RLSColorSlider.tsx +373 -0
  55. package/src/components/command-palette/RLSCommandPalette.tsx +26 -0
  56. package/src/components/compare/RLSCompare.tsx +26 -0
  57. package/src/components/confirm/RLSConfirm.tsx +173 -0
  58. package/src/components/container/RLSContainer.tsx +24 -0
  59. package/src/components/context-menu/RLSContextMenu.tsx +26 -0
  60. package/src/components/copy-markdown/RLSCopyMarkdown.tsx +57 -0
  61. package/src/components/dashboard-group/RLSDashboardGroup.tsx +29 -0
  62. package/src/components/dashboard-navbar/RLSDashboardNavbar.tsx +116 -0
  63. package/src/components/dashboard-panel/RLSDashboardPanel.tsx +84 -0
  64. package/src/components/dashboard-resize-handle/RLSDashboardResizeHandle.tsx +35 -0
  65. package/src/components/dashboard-search/RLADashboardSearch.astro +1 -1
  66. package/src/components/dashboard-search/RLSDashboardSearch.tsx +125 -0
  67. package/src/components/dashboard-search-button/RLSDashboardSearchButton.tsx +82 -0
  68. package/src/components/dashboard-sidebar/RLADashboardSidebar.astro +4 -4
  69. package/src/components/dashboard-sidebar/RLSDashboardSidebar.tsx +184 -0
  70. package/src/components/dashboard-sidebar-collapse/RLSDashboardSidebarCollapse.tsx +46 -0
  71. package/src/components/dashboard-sidebar-toggle/RLSDashboardSidebarToggle.tsx +35 -0
  72. package/src/components/dashboard-toolbar/RLSDashboardToolbar.tsx +49 -0
  73. package/src/components/date/RLSDate.tsx +34 -0
  74. package/src/components/dock/RLSDock.tsx +26 -0
  75. package/src/components/drawer/RLSDrawer.tsx +177 -0
  76. package/src/components/dropdown-menu/RLADropdownMenu.astro +250 -241
  77. package/src/components/dropdown-menu/RLSDropdownMenu.tsx +183 -86
  78. package/src/components/editor/RLSEditor.tsx +26 -0
  79. package/src/components/empty/RLSEmpty.tsx +132 -0
  80. package/src/components/error/RLSError.tsx +26 -0
  81. package/src/components/field-group/RLSFieldGroup.tsx +46 -0
  82. package/src/components/fieldset/RLSFieldset.tsx +26 -0
  83. package/src/components/file-upload/RLAFileUpload.astro +1 -1
  84. package/src/components/file-upload/RLSFileUpload.tsx +163 -0
  85. package/src/components/floating-action/RLSFloatingAction.tsx +26 -0
  86. package/src/components/footer/RLSFooter.tsx +56 -0
  87. package/src/components/form/RLSForm.tsx +34 -0
  88. package/src/components/gallery/RLSGallery.tsx +21 -0
  89. package/src/components/gamepad/RLSGamepad.tsx +269 -0
  90. package/src/components/grid/RLSGrid.tsx +29 -0
  91. package/src/components/head/RLAHead.astro +9 -0
  92. package/src/components/head/RLSHead.tsx +42 -0
  93. package/src/components/head/UIHead.astro +3 -0
  94. package/src/components/header/HeaderLayer.astro +1 -1
  95. package/src/components/header/RLSHeader.tsx +87 -0
  96. package/src/components/hover-card/RLSHoverCard.tsx +72 -0
  97. package/src/components/icon/RLSIcon.tsx +3 -1
  98. package/src/components/image/RLAImage.astro +447 -138
  99. package/src/components/image/RLSImage.tsx +545 -0
  100. package/src/components/image/image.theme.ts +19 -3
  101. package/src/components/image/image.ts +31 -1
  102. package/src/components/input/RLAInput.astro +62 -51
  103. package/src/components/input/RLSInput.tsx +1 -1
  104. package/src/components/input-date/RLSInputDate.tsx +92 -0
  105. package/src/components/input-menu/RLAInputMenu.astro +3 -3
  106. package/src/components/input-menu/RLSInputMenu.tsx +199 -0
  107. package/src/components/input-number/RLSInputNumber.tsx +184 -0
  108. package/src/components/input-pin/RLSInputPin.tsx +185 -0
  109. package/src/components/input-rating/RLAInputRating.astro +8 -8
  110. package/src/components/input-rating/RLSInputRating.tsx +198 -0
  111. package/src/components/input-rating/input-rating.ts +4 -0
  112. package/src/components/input-tags/RLSInputTags.tsx +94 -0
  113. package/src/components/input-time/RLSInputTime.tsx +92 -0
  114. package/src/components/kbd/RLSKbd.tsx +37 -0
  115. package/src/components/keyboard/RLSKeyboard.tsx +476 -0
  116. package/src/components/knob/RLSKnob.tsx +27 -0
  117. package/src/components/label/RLSLabel.tsx +27 -0
  118. package/src/components/layout-grid/RLALayoutGrid.astro +29 -29
  119. package/src/components/layout-grid/RLSLayoutGrid.tsx +402 -0
  120. package/src/components/layout-grid/layout-grid.ts +25 -1
  121. package/src/components/link/RLALink.astro +5 -5
  122. package/src/components/link/RLSLink.tsx +6 -5
  123. package/src/components/link/link.ts +21 -12
  124. package/src/components/link-group/RLSLinkGroup.tsx +76 -0
  125. package/src/components/listbox/RLSListbox.tsx +27 -0
  126. package/src/components/locale-selector/RLALocaleSelector.astro +110 -102
  127. package/src/components/locale-selector/RLSLocaleSelector.tsx +178 -0
  128. package/src/components/locale-selector/locale-selector.ts +2 -7
  129. package/src/components/logo/RLALogo.astro +153 -102
  130. package/src/components/logo/RLSLogo.tsx +129 -0
  131. package/src/components/main/RLSMain.tsx +40 -0
  132. package/src/components/marquee/RLSMarquee.tsx +80 -0
  133. package/src/components/meter/RLSMeter.tsx +27 -0
  134. package/src/components/modal/RLAModal.astro +1 -1
  135. package/src/components/modal/RLSModal.tsx +109 -72
  136. package/src/components/navigation-menu/RLANavigationMenu.astro +6 -6
  137. package/src/components/navigation-menu/RLSNavigationMenu.tsx +228 -0
  138. package/src/components/navigation-menu/navigation-menu.ts +2 -2
  139. package/src/components/package-managers/RLSPackageManagers.tsx +204 -0
  140. package/src/components/page/RLSPage.tsx +21 -0
  141. package/src/components/page-aside/RLSPageAside.tsx +21 -0
  142. package/src/components/page-body/RLSPageBody.tsx +21 -0
  143. package/src/components/page-header/RLSPageHeader.tsx +21 -0
  144. package/src/components/page-section/RLSPageSection.tsx +201 -0
  145. package/src/components/pagination/RLSPagination.tsx +114 -0
  146. package/src/components/password/RLSPassword.tsx +27 -0
  147. package/src/components/phone-mockup/RLSPhoneMockup.tsx +27 -0
  148. package/src/components/placeholder/RLSPlaceholder.tsx +47 -0
  149. package/src/components/popover/RLAPopover.astro +2 -2
  150. package/src/components/popover/RLSPopover.tsx +124 -0
  151. package/src/components/post/RLSPost.tsx +134 -0
  152. package/src/components/pricing-plan/RLSPricingPlan.tsx +26 -0
  153. package/src/components/pricing-table/RLSPricingTable.tsx +26 -0
  154. package/src/components/progress/RLSProgress.tsx +53 -0
  155. package/src/components/prose/RLSProse.tsx +26 -0
  156. package/src/components/qr-code/RLSQrCode.tsx +26 -0
  157. package/src/components/quote/RLAQuote.astro +10 -6
  158. package/src/components/quote/RLSQuote.tsx +37 -0
  159. package/src/components/quote/quote.theme.ts +5 -2
  160. package/src/components/radio-group/RLSRadioGroup.tsx +37 -0
  161. package/src/components/rating/RLSRating.tsx +27 -0
  162. package/src/components/scroll-area/RLAScrollArea.astro +1 -1
  163. package/src/components/scroll-area/RLSScrollArea.tsx +210 -0
  164. package/src/components/scroll-to-top/RLAScrollToTop.astro +5 -4
  165. package/src/components/scroll-to-top/RLSScrollToTop.tsx +145 -0
  166. package/src/components/search/RLASearch.astro +6 -6
  167. package/src/components/search/RLSSearch.tsx +237 -0
  168. package/src/components/select/RLASelect.astro +67 -4
  169. package/src/components/select/RLSSelect.tsx +107 -39
  170. package/src/components/select/RLVSelect.vue +50 -1
  171. package/src/components/select/select.theme.ts +30 -10
  172. package/src/components/select/select.ts +20 -1
  173. package/src/components/separator/RLSSeparator.tsx +92 -0
  174. package/src/components/share/RLSShare.tsx +66 -0
  175. package/src/components/shortcuts/RLAShortcuts.astro +2 -2
  176. package/src/components/shortcuts/RLSShortcuts.tsx +393 -0
  177. package/src/components/sidebar/RLASidebar.astro +1 -1
  178. package/src/components/sidebar/RLSSidebar.tsx +271 -0
  179. package/src/components/skeleton/RLSSkeleton.tsx +21 -0
  180. package/src/components/slideover/RLASlideover.astro +1 -1
  181. package/src/components/slideover/RLSSlideover.tsx +159 -0
  182. package/src/components/slider/RLSSlider.tsx +112 -0
  183. package/src/components/speed-dial/RLSSpeedDial.tsx +27 -0
  184. package/src/components/spinner/RLSSpinner.tsx +22 -0
  185. package/src/components/splitter/RLASplitter.astro +1 -1
  186. package/src/components/splitter/RLSSplitter.tsx +178 -0
  187. package/src/components/spoiler/RLSSpoiler.tsx +26 -0
  188. package/src/components/stepper/RLAStepper.astro +9 -9
  189. package/src/components/stepper/RLSStepper.tsx +205 -0
  190. package/src/components/steps/RLSSteps.tsx +108 -0
  191. package/src/components/sticky-surface/RLSStickySurface.tsx +63 -0
  192. package/src/components/surround/RLSSurround.tsx +57 -0
  193. package/src/components/switch/RLSSwitch.tsx +56 -0
  194. package/src/components/table/RLATable.astro +1044 -579
  195. package/src/components/table/RLSTable.tsx +893 -0
  196. package/src/components/table/table.theme.ts +47 -16
  197. package/src/components/table/table.ts +104 -66
  198. package/src/components/table-of-contents/RLSTableOfContents.tsx +196 -0
  199. package/src/components/tabs/RLATabs.astro +8 -8
  200. package/src/components/tabs/RLSTabs.tsx +298 -0
  201. package/src/components/textarea/RLATextarea.astro +1 -0
  202. package/src/components/textarea/RLSTextarea.tsx +3 -1
  203. package/src/components/theme-selector/RLAThemeSelector.astro +85 -56
  204. package/src/components/theme-selector/RLSThemeSelector.tsx +131 -0
  205. package/src/components/theme-selector/theme-selector.theme.ts +5 -7
  206. package/src/components/theme-selector/theme-selector.ts +11 -1
  207. package/src/components/timeline/RLSTimeline.tsx +171 -0
  208. package/src/components/toast/RLAToast.astro +2 -2
  209. package/src/components/toast/RLSToast.tsx +179 -0
  210. package/src/components/toaster/RLSToaster.tsx +82 -0
  211. package/src/components/tooltip/RLSTooltip.tsx +48 -0
  212. package/src/components/tour/RLSTour.tsx +26 -0
  213. package/src/components/tree/RLSTree.tsx +26 -0
  214. package/src/components/user/RLSUser.tsx +26 -0
  215. package/src/components/video/RLAVideo.astro +4 -1
  216. package/src/components/video/RLSVideo.tsx +158 -0
  217. package/src/components/watermark/RLSWatermark.tsx +27 -0
  218. package/src/components/window-mockup/RLSWindowMockup.tsx +27 -0
  219. package/src/preset.ts +73 -1
  220. package/src/resolver.ts +6 -1
  221. package/src/virtual.d.ts +6 -0
  222. package/dist/icons--RzV1RTU.d.mts +0 -72
@@ -0,0 +1,194 @@
1
+ import { createMemo, splitProps, type Component, type JSX } from "solid-js"
2
+ import type { BreadcrumbItem, BreadcrumbProps } from "./breadcrumb"
3
+ import { breadcrumbTheme } from "./breadcrumb.theme"
4
+ import RLSIcon from "../icon/RLSIcon"
5
+
6
+ export interface RLSBreadcrumbProps extends BreadcrumbProps {
7
+ children?: JSX.Element
8
+ separator?: JSX.Element
9
+ }
10
+
11
+ const RLSBreadcrumb: Component<RLSBreadcrumbProps> = (allProps) => {
12
+ const [props, rest] = splitProps(allProps, [
13
+ "items",
14
+ "maxVisible",
15
+ "estimatedItemWidth",
16
+ "separatorIcon",
17
+ "separator",
18
+ "children",
19
+ "ui",
20
+ "class"
21
+ ])
22
+
23
+ const classes = createMemo(() =>
24
+ breadcrumbTheme({
25
+ ui: props.ui,
26
+ class: props.class
27
+ })
28
+ )
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 = allItems.length > 2 ? allItems.slice(1, allItems.length - 1) : []
34
+
35
+ const effectiveMaxMid =
36
+ props.maxVisible !== undefined ? Math.max(0, props.maxVisible - 2) : allMidItems.length
37
+
38
+ const renderedMidItems = allMidItems.slice(allMidItems.length - effectiveMaxMid)
39
+ const baseHiddenCount = Math.max(0, allMidItems.length - effectiveMaxMid)
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
+ }
63
+
64
+ const separatorEl = () => (
65
+ <span class={classes()["separator"]} data-slot="separator" aria-hidden="true">
66
+ {props.separator !== undefined ? (
67
+ props.separator
68
+ ) : (
69
+ <RLSIcon name={props.separatorIcon ?? "chevronRight"} />
70
+ )}
71
+ </span>
72
+ )
73
+
74
+ const itemMarker = (item: BreadcrumbItem) =>
75
+ item.href ? (
76
+ <a href={item.href} class={classes()["link"]} data-slot="link">
77
+ {item.label}
78
+ </a>
79
+ ) : (
80
+ <span class={classes()["page"]} data-slot="page">
81
+ {item.label}
82
+ </span>
83
+ )
84
+
85
+ const ldJson = JSON.stringify({
86
+ "@context": "https://schema.org",
87
+ "@type": "BreadcrumbList",
88
+ "itemListElement": allItems.map((item, idx) => ({
89
+ "@type": "ListItem",
90
+ "position": idx + 1,
91
+ "name": item.label,
92
+ "item": item.href ? new URL(item.href, "https://starter.rimelight.com").toString() : undefined
93
+ }))
94
+ })
95
+
96
+ const staticCss = `
97
+ .rla-bc-host {
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
+ }`
129
+
130
+ return (
131
+ <>
132
+ <nav aria-label="breadcrumb" class={classes()["root"]} data-slot="breadcrumb-root" {...rest}>
133
+ {props.items ? (
134
+ <div class="rla-bc-host" style={`container-type: inline-size; container-name: ${cName};`}>
135
+ <ol
136
+ class={classes()["list"]}
137
+ data-slot="list"
138
+ data-bc={uid}
139
+ style={`--base-hidden: ${baseHiddenCount}; --hidden-items: 0;`}
140
+ >
141
+ {firstItem && (
142
+ <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
+ {itemMarker(item)}
167
+ {separatorEl()}
168
+ </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
+ )}
178
+ </ol>
179
+ </div>
180
+ ) : (
181
+ <ol class={classes()["list"]} data-slot="list">
182
+ {props.children}
183
+ </ol>
184
+ )}
185
+ </nav>
186
+
187
+ <style>{staticCss + instanceCss}</style>
188
+
189
+ {props.items && <script type="application/ld+json" innerHTML={ldJson} />}
190
+ </>
191
+ )
192
+ }
193
+
194
+ export default RLSBreadcrumb
@@ -0,0 +1,21 @@
1
+ import { createMemo, splitProps, type Component, type JSX } from "solid-js"
2
+ import type { BrowserMockupProps } from "./browser-mockup"
3
+ import { browserMockupTheme } from "./browser-mockup.theme"
4
+
5
+ export interface RLSBrowserMockupProps extends BrowserMockupProps {
6
+ children?: JSX.Element
7
+ }
8
+
9
+ const RLSBrowserMockup: Component<RLSBrowserMockupProps> = (allProps) => {
10
+ const [props, rest] = splitProps(allProps, ["ui", "class", "children"])
11
+
12
+ const resolvedClasses = createMemo(() => browserMockupTheme({ 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 RLSBrowserMockup
@@ -2,11 +2,13 @@ import { createMemo, splitProps, type Component, type JSX } from "solid-js"
2
2
  import type { ButtonProps } from "./button"
3
3
  import { buttonTheme } from "./button.theme"
4
4
  import RLSIcon from "../icon/RLSIcon"
5
+ import RLSAvatar from "../avatar/RLSAvatar"
5
6
 
6
7
  export interface RLSButtonProps extends ButtonProps {
7
8
  children?: JSX.Element
8
9
  leading?: JSX.Element
9
10
  trailing?: JSX.Element
11
+ avatar?: any
10
12
  onClick?: (e: MouseEvent) => void
11
13
  type?: "button" | "submit" | "reset"
12
14
  }
@@ -17,9 +19,11 @@ const RLSButton: Component<RLSButtonProps> = (allProps) => {
17
19
  "color",
18
20
  "size",
19
21
  "href",
22
+ "to",
20
23
  "label",
21
24
  "leadingIcon",
22
25
  "trailingIcon",
26
+ "avatar",
23
27
  "loading",
24
28
  "loadingAuto",
25
29
  "square",
@@ -49,7 +53,8 @@ const RLSButton: Component<RLSButtonProps> = (allProps) => {
49
53
  "ariaCurrentValue"
50
54
  ])
51
55
 
52
- const isLeading = () => !!(props.leadingIcon || props.leading) || !!props.loading
56
+ const href = () => props.href || (props.to as string | undefined)
57
+ const isLeading = () => !!(props.leadingIcon || props.avatar || props.leading) || !!props.loading
53
58
  const isTrailing = () =>
54
59
  !!(props.trailingIcon || props.trailing) || (!!props.loading && !isLeading())
55
60
 
@@ -86,45 +91,64 @@ const RLSButton: Component<RLSButtonProps> = (allProps) => {
86
91
  })
87
92
  )
88
93
 
89
- if (props.href) {
94
+ const renderLeading = () => {
95
+ if (props.leading) return props.leading
96
+ if (!isLeading()) return null
97
+
98
+ return (
99
+ <span class={`${classes()["leadingIcon"]} ${leadingIconClass()}`} data-slot="leading-icon">
100
+ {props.loading || props.leadingIcon ? (
101
+ <RLSIcon name={showLeadingIcon()!} size={props.size ?? "md"} aria-hidden="true" />
102
+ ) : props.avatar ? (
103
+ <RLSAvatar
104
+ {...(typeof props.avatar === "string" ? { src: props.avatar } : props.avatar)}
105
+ size={classes()["leadingAvatarSize"] as any}
106
+ class={classes()["leadingAvatar"]}
107
+ data-slot="leading-avatar"
108
+ />
109
+ ) : null}
110
+ </span>
111
+ )
112
+ }
113
+
114
+ const renderTrailing = () => {
115
+ if (props.trailing) return props.trailing
116
+ if (!isTrailing() || !showTrailingIcon()) return null
117
+
118
+ return (
119
+ <span class={`${classes()["trailingIcon"]} ${trailingIconClass()}`} data-slot="trailing-icon">
120
+ <RLSIcon name={showTrailingIcon()!} size={props.size ?? "md"} aria-hidden="true" />
121
+ </span>
122
+ )
123
+ }
124
+
125
+ if (href()) {
90
126
  return (
91
127
  <a
92
- href={props.href}
128
+ href={href()}
93
129
  target={props.target}
94
130
  rel={props.rel || undefined}
95
- class={classes().root}
131
+ class={classes()["root"]}
96
132
  data-slot="root"
133
+ data-theme={props.theme}
134
+ data-loading={props.loading ? "true" : undefined}
135
+ data-loading-auto={props.loadingAuto ? "true" : undefined}
97
136
  aria-label={props.ariaLabel}
98
137
  aria-disabled={props.disabled ? "true" : undefined}
99
138
  onClick={props.onClick}
100
139
  {...rest}
101
140
  >
102
- {props.leading ? (
103
- props.leading
104
- ) : isLeading() && showLeadingIcon() ? (
105
- <span class={`${classes().leadingIcon} ${leadingIconClass()}`} data-slot="leading-icon">
106
- <RLSIcon name={showLeadingIcon()!} size={props.size ?? "md"} aria-hidden="true" />
107
- </span>
108
- ) : null}
141
+ {renderLeading()}
109
142
 
110
143
  {props.children !== undefined && props.children !== null ? (
111
144
  props.children
112
145
  ) : props.label !== undefined && props.label !== null ? (
113
- <span class={classes().label} data-slot="label">
146
+ <span class={classes()["label"]} data-slot="label">
114
147
  {props.label}
115
148
  </span>
116
149
  ) : null}
117
150
 
118
- {props.trailing ? (
119
- props.trailing
120
- ) : isTrailing() && showTrailingIcon() ? (
121
- <span
122
- class={`${classes().trailingIcon} ${trailingIconClass()}`}
123
- data-slot="trailing-icon"
124
- >
125
- <RLSIcon name={showTrailingIcon()!} size={props.size ?? "md"} aria-hidden="true" />
126
- </span>
127
- ) : null}
151
+ {renderTrailing()}
128
152
  </a>
129
153
  )
130
154
  }
@@ -133,35 +157,26 @@ const RLSButton: Component<RLSButtonProps> = (allProps) => {
133
157
  <button
134
158
  type={props.type || "button"}
135
159
  disabled={props.disabled}
136
- class={classes().root}
160
+ class={classes()["root"]}
137
161
  data-slot="root"
162
+ data-theme={props.theme}
163
+ data-loading={props.loading ? "true" : undefined}
164
+ data-loading-auto={props.loadingAuto ? "true" : undefined}
138
165
  aria-label={props.ariaLabel}
139
166
  onClick={props.onClick}
140
167
  {...rest}
141
168
  >
142
- {props.leading ? (
143
- props.leading
144
- ) : isLeading() && showLeadingIcon() ? (
145
- <span class={`${classes().leadingIcon} ${leadingIconClass()}`} data-slot="leading-icon">
146
- <RLSIcon name={showLeadingIcon()!} size={props.size ?? "md"} aria-hidden="true" />
147
- </span>
148
- ) : null}
169
+ {renderLeading()}
149
170
 
150
171
  {props.children !== undefined && props.children !== null ? (
151
172
  props.children
152
173
  ) : props.label !== undefined && props.label !== null ? (
153
- <span class={classes().label} data-slot="label">
174
+ <span class={classes()["label"]} data-slot="label">
154
175
  {props.label}
155
176
  </span>
156
177
  ) : null}
157
178
 
158
- {props.trailing ? (
159
- props.trailing
160
- ) : isTrailing() && showTrailingIcon() ? (
161
- <span class={`${classes().trailingIcon} ${trailingIconClass()}`} data-slot="trailing-icon">
162
- <RLSIcon name={showTrailingIcon()!} size={props.size ?? "md"} aria-hidden="true" />
163
- </span>
164
- ) : null}
179
+ {renderTrailing()}
165
180
  </button>
166
181
  )
167
182
  }
@@ -5,45 +5,43 @@ import { buttonTheme } from "./button.theme"
5
5
  import RLVIcon from "../icon/RLVIcon.vue"
6
6
  const attrs = useAttrs()
7
7
 
8
- const {
9
- variant = "solid",
10
- color = "primary",
11
- size = "md",
12
- href,
13
- label,
14
- leadingIcon,
15
- trailingIcon,
16
- loading = false,
17
- square = false,
18
- block = false,
19
- active = false,
20
- activeColor,
21
- activeVariant
22
- } = defineProps<ButtonProps>()
8
+ const props = withDefaults(defineProps<ButtonProps>(), {
9
+ variant: "solid",
10
+ color: "primary",
11
+ size: "md",
12
+ justify: "center",
13
+ loading: false,
14
+ square: undefined,
15
+ block: false,
16
+ active: false,
17
+ rounded: false
18
+ })
23
19
 
24
20
  const slots = useSlots()
25
21
 
26
- const isLeading = computed(() => !!(leadingIcon || slots.leading) || loading)
22
+ const isLeading = computed(
23
+ () => !!(props.leadingIcon || props.avatar || slots.leading) || props.loading
24
+ )
27
25
  const isTrailing = computed(
28
- () => !!(trailingIcon || slots.trailing) || (loading && !isLeading.value)
26
+ () => !!(props.trailingIcon || slots.trailing) || (props.loading && !isLeading.value)
29
27
  )
30
28
 
31
29
  const showLeadingIcon = computed(() => {
32
- if (loading) return "loaderCircle"
33
- return leadingIcon
30
+ if (props.loading) return "loaderCircle"
31
+ return props.leadingIcon
34
32
  })
35
33
 
36
34
  const showTrailingIcon = computed(() => {
37
- if (loading) return "loaderCircle"
38
- return trailingIcon
35
+ if (props.loading) return "loaderCircle"
36
+ return props.trailingIcon
39
37
  })
40
38
 
41
39
  const leadingIconClass = computed(() => {
42
- return loading && isLeading.value ? "animate-spin" : ""
40
+ return props.loading && isLeading.value ? "animate-spin" : ""
43
41
  })
44
42
 
45
43
  const trailingIconClass = computed(() => {
46
- return loading && isTrailing.value ? "animate-spin" : ""
44
+ return props.loading && isTrailing.value ? "animate-spin" : ""
47
45
  })
48
46
 
49
47
  defineSlots<{
@@ -54,23 +52,37 @@ defineSlots<{
54
52
 
55
53
  const resolvedClasses = computed(() =>
56
54
  buttonTheme({
57
- variant: active && activeVariant ? activeVariant : variant,
58
- color: active && activeColor ? activeColor : color,
59
- size,
60
- block,
61
- square: square || (!label && !slots.default),
55
+ variant: props.active && props.activeVariant ? props.activeVariant : props.variant,
56
+ color: props.active && props.activeColor ? props.activeColor : props.color,
57
+ size: props.size,
58
+ justify: props.justify,
59
+ block: props.block,
60
+ square: props.square !== undefined ? props.square : !props.label && !slots.default,
61
+ rounded: props.rounded,
62
62
  leading: isLeading.value,
63
63
  trailing: isTrailing.value,
64
- loading,
65
- active
64
+ loading: props.loading,
65
+ active: props.active,
66
+ theme: props.theme,
67
+ ui: props.ui,
68
+ class: props.class
66
69
  })
67
70
  )
68
71
 
69
- const Tag = href ? "a" : "button"
72
+ const Tag = props.href ? "a" : "button"
70
73
  </script>
71
74
 
72
75
  <template>
73
- <component v-bind="attrs" :is="Tag" :href="href" :class="resolvedClasses.root" data-slot="root">
76
+ <component
77
+ v-bind="attrs"
78
+ :is="Tag"
79
+ :href="props.href"
80
+ :type="!props.href ? (props.type as any) || 'button' : undefined"
81
+ :disabled="!props.href ? (props.disabled as any) : undefined"
82
+ :class="resolvedClasses.root"
83
+ data-slot="root"
84
+ :data-theme="props.theme"
85
+ >
74
86
  <slot name="leading" :ui="resolvedClasses">
75
87
  <span v-if="isLeading" :class="resolvedClasses.leadingIcon" data-slot="leading-icon">
76
88
  <RLVIcon :name="showLeadingIcon" :class="leadingIconClass" />
@@ -0,0 +1,26 @@
1
+ import { createMemo, splitProps, type Component, type JSX } from "solid-js"
2
+ import type { CalendarProps } from "./calendar"
3
+ import { calendarTheme } from "./calendar.theme"
4
+
5
+ export interface RLSCalendarProps extends CalendarProps {
6
+ children?: JSX.Element
7
+ }
8
+
9
+ const RLSCalendar: Component<RLSCalendarProps> = (allProps) => {
10
+ const [props, rest] = splitProps(allProps, ["ui", "class", "children"])
11
+
12
+ const resolvedClasses = createMemo(() =>
13
+ calendarTheme({
14
+ ui: props.ui,
15
+ class: props.class
16
+ })
17
+ )
18
+
19
+ return (
20
+ <div class={resolvedClasses().root} data-slot="root" {...rest}>
21
+ {props.children}
22
+ </div>
23
+ )
24
+ }
25
+
26
+ export default RLSCalendar
@@ -0,0 +1,151 @@
1
+ import { createMemo, splitProps, type Component, type JSX } from "solid-js"
2
+ import type { CalloutProps } from "./callout"
3
+ import { calloutTheme } from "./callout.theme"
4
+ import RLSAvatar from "../avatar/RLSAvatar"
5
+ import RLSIcon from "../icon/RLSIcon"
6
+
7
+ export interface RLSCalloutProps extends CalloutProps {
8
+ children?: JSX.Element
9
+ iconSlot?: JSX.Element
10
+ titleSlot?: JSX.Element
11
+ headerSlot?: JSX.Element
12
+ avatarSlot?: JSX.Element
13
+ closeSlot?: JSX.Element
14
+ actionsSlot?: JSX.Element
15
+ avatar?: string | Record<string, any>
16
+ close?: boolean
17
+ actions?: boolean
18
+ onClose?: () => void
19
+ }
20
+
21
+ const colorToIcon: Record<string, string | undefined> = {
22
+ error: "i-rl-circleCheck",
23
+ warning: "i-rl-alertTriangle",
24
+ info: "i-rl-info",
25
+ success: "i-rl-circleCheck",
26
+ primary: undefined,
27
+ secondary: undefined,
28
+ commentary: undefined,
29
+ ideation: undefined,
30
+ source: undefined,
31
+ neutral: undefined
32
+ }
33
+
34
+ const RLSCallout: Component<RLSCalloutProps> = (allProps) => {
35
+ const [props, rest] = splitProps(allProps, [
36
+ "variant",
37
+ "color",
38
+ "title",
39
+ "description",
40
+ "icon",
41
+ "avatar",
42
+ "actions",
43
+ "close",
44
+ "theme",
45
+ "ui",
46
+ "class",
47
+ "children",
48
+ "iconSlot",
49
+ "titleSlot",
50
+ "headerSlot",
51
+ "avatarSlot",
52
+ "closeSlot",
53
+ "actionsSlot",
54
+ "onClose"
55
+ ])
56
+
57
+ const resolvedColor = props.variant === "destructive" ? "error" : (props.color ?? "primary")
58
+ const resolvedVariant =
59
+ props.variant === "solid" ||
60
+ props.variant === "outline" ||
61
+ props.variant === "soft" ||
62
+ props.variant === "subtle"
63
+ ? props.variant
64
+ : "solid"
65
+ const resolvedIcon = props.icon ?? colorToIcon[resolvedColor]
66
+ const hasTitleRow = !!(
67
+ props.title ||
68
+ props.titleSlot ||
69
+ props.headerSlot ||
70
+ props.avatar ||
71
+ props.avatarSlot ||
72
+ props.close ||
73
+ props.closeSlot
74
+ )
75
+
76
+ const classes = createMemo(() =>
77
+ calloutTheme({
78
+ variant: resolvedVariant,
79
+ color: resolvedColor as any,
80
+ theme: props.theme,
81
+ ui: props.ui,
82
+ class: props.class
83
+ })
84
+ )
85
+
86
+ return (
87
+ <div class={classes()["root"]} data-slot="root" role="alert" data-theme={props.theme} {...rest}>
88
+ {props.iconSlot !== undefined ? (
89
+ props.iconSlot
90
+ ) : resolvedIcon ? (
91
+ <span class={classes()["icon"]} data-slot="icon">
92
+ <RLSIcon name={resolvedIcon} />
93
+ </span>
94
+ ) : null}
95
+
96
+ <div class={classes()["body"]} data-slot="body">
97
+ {hasTitleRow && (
98
+ <div class="flex items-center gap-2.5">
99
+ {props.avatarSlot !== undefined ? (
100
+ props.avatarSlot
101
+ ) : props.avatar ? (
102
+ <RLSAvatar
103
+ {...(typeof props.avatar === "string" ? { src: props.avatar } : props.avatar)}
104
+ size={classes()["avatarSize"] as any}
105
+ class={classes()["avatar"]}
106
+ data-slot="avatar"
107
+ />
108
+ ) : null}
109
+
110
+ {(props.title !== undefined || props.titleSlot !== undefined) && (
111
+ <h5 class={classes()["title"]} data-slot="title">
112
+ {props.title}
113
+ {props.titleSlot}
114
+ </h5>
115
+ )}
116
+
117
+ {props.headerSlot}
118
+
119
+ {props.closeSlot !== undefined ? (
120
+ props.closeSlot
121
+ ) : props.close ? (
122
+ <button
123
+ type="button"
124
+ class={classes()["close"]}
125
+ data-slot="close"
126
+ onClick={props.onClose}
127
+ >
128
+ <RLSIcon name="i-rl-close" class="size-4" />
129
+ </button>
130
+ ) : null}
131
+ </div>
132
+ )}
133
+
134
+ {(props.description !== undefined || props.children !== undefined) && (
135
+ <div class={classes()["content"]} data-slot="content">
136
+ {props.description}
137
+ {props.children}
138
+ </div>
139
+ )}
140
+
141
+ {(props.actions === true || props.actionsSlot !== undefined) && (
142
+ <div class={classes()["actions"]} data-slot="actions">
143
+ {props.actionsSlot}
144
+ </div>
145
+ )}
146
+ </div>
147
+ </div>
148
+ )
149
+ }
150
+
151
+ export default RLSCallout
@@ -16,6 +16,8 @@ const RLSCard: Component<RLSCardProps> = (allProps) => {
16
16
  "mediaSrc",
17
17
  "href",
18
18
  "overlay",
19
+ "variant",
20
+ "theme",
19
21
  "ui",
20
22
  "class",
21
23
  "children",
@@ -26,8 +28,10 @@ const RLSCard: Component<RLSCardProps> = (allProps) => {
26
28
 
27
29
  const resolvedClasses = createMemo(() =>
28
30
  cardTheme({
31
+ variant: props.variant,
29
32
  interactive: !!props.href,
30
33
  overlay: !!props.overlay,
34
+ theme: props.theme,
31
35
  ui: props.ui,
32
36
  class: props.class
33
37
  })