@rimelight/ui 0.0.47 → 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 (197) hide show
  1. package/dist/index.d.mts +4 -5
  2. package/dist/preset.mjs +73 -1
  3. package/dist/resolver.d.mts +3 -4
  4. package/dist/resolver.mjs +2 -4
  5. package/dist/shortcuts.d.mts +10 -11
  6. package/dist/stores.d.mts +3 -4
  7. package/package.json +8 -6
  8. package/src/components/3d-hover/RLS3dHover.tsx +21 -0
  9. package/src/components/accordion/RLSAccordion.tsx +112 -0
  10. package/src/components/app/RLSApp.tsx +21 -0
  11. package/src/components/aspect-ratio/RLSAspectRatio.tsx +30 -0
  12. package/src/components/audio/RLSAudio.tsx +27 -0
  13. package/src/components/avatar/RLSAvatar.tsx +142 -0
  14. package/src/components/avatar/avatar.ts +22 -21
  15. package/src/components/avatar-group/RLSAvatarGroup.tsx +163 -0
  16. package/src/components/badge/RLSBadge.tsx +1 -1
  17. package/src/components/badge/RLVBadge.vue +5 -3
  18. package/src/components/banner/RLSBanner.tsx +151 -0
  19. package/src/components/breadcrumb/RLSBreadcrumb.tsx +194 -0
  20. package/src/components/browser-mockup/RLSBrowserMockup.tsx +21 -0
  21. package/src/components/button/RLSButton.tsx +49 -40
  22. package/src/components/button/RLVButton.vue +44 -32
  23. package/src/components/calendar/RLSCalendar.tsx +26 -0
  24. package/src/components/callout/RLSCallout.tsx +151 -0
  25. package/src/components/card/RLSCard.tsx +4 -0
  26. package/src/components/card/RLVCard.vue +4 -0
  27. package/src/components/card/card.ts +10 -0
  28. package/src/components/carousel/RLACarousel.astro +14 -1
  29. package/src/components/carousel/RLSCarousel.tsx +260 -0
  30. package/src/components/chart/RLSChart.tsx +299 -0
  31. package/src/components/chat/RLSChat.tsx +27 -0
  32. package/src/components/chat-message/RLSChatMessage.tsx +27 -0
  33. package/src/components/chat-messages/RLSChatMessages.tsx +27 -0
  34. package/src/components/chat-palette/RLSChatPalette.tsx +27 -0
  35. package/src/components/chat-prompt/RLSChatPrompt.tsx +27 -0
  36. package/src/components/chat-prompt-submit/RLSChatPromptSubmit.tsx +27 -0
  37. package/src/components/chat-reasoning/RLSChatReasoning.tsx +27 -0
  38. package/src/components/chat-shimmer/RLSChatShimmer.tsx +27 -0
  39. package/src/components/chat-tool/RLSChatTool.tsx +27 -0
  40. package/src/components/checkbox/RLACheckbox.astro +1 -0
  41. package/src/components/checkbox/RLSCheckbox.tsx +1 -1
  42. package/src/components/checkbox/checkbox.theme.ts +2 -2
  43. package/src/components/chip/RLSChip.tsx +65 -0
  44. package/src/components/collapsible/RLSCollapsible.tsx +89 -0
  45. package/src/components/color-area/RLSColorArea.tsx +554 -0
  46. package/src/components/color-field/RLSColorField.tsx +236 -0
  47. package/src/components/color-picker/RLSColorPicker.tsx +26 -0
  48. package/src/components/color-slider/RLSColorSlider.tsx +373 -0
  49. package/src/components/command-palette/RLSCommandPalette.tsx +26 -0
  50. package/src/components/compare/RLSCompare.tsx +26 -0
  51. package/src/components/confirm/RLSConfirm.tsx +173 -0
  52. package/src/components/container/RLSContainer.tsx +24 -0
  53. package/src/components/context-menu/RLSContextMenu.tsx +26 -0
  54. package/src/components/copy-markdown/RLSCopyMarkdown.tsx +57 -0
  55. package/src/components/dashboard-group/RLSDashboardGroup.tsx +29 -0
  56. package/src/components/dashboard-navbar/RLSDashboardNavbar.tsx +116 -0
  57. package/src/components/dashboard-panel/RLSDashboardPanel.tsx +84 -0
  58. package/src/components/dashboard-resize-handle/RLSDashboardResizeHandle.tsx +35 -0
  59. package/src/components/dashboard-search/RLADashboardSearch.astro +1 -1
  60. package/src/components/dashboard-search/RLSDashboardSearch.tsx +125 -0
  61. package/src/components/dashboard-search-button/RLSDashboardSearchButton.tsx +82 -0
  62. package/src/components/dashboard-sidebar/RLSDashboardSidebar.tsx +184 -0
  63. package/src/components/dashboard-sidebar-collapse/RLSDashboardSidebarCollapse.tsx +46 -0
  64. package/src/components/dashboard-sidebar-toggle/RLSDashboardSidebarToggle.tsx +35 -0
  65. package/src/components/dashboard-toolbar/RLSDashboardToolbar.tsx +49 -0
  66. package/src/components/date/RLSDate.tsx +34 -0
  67. package/src/components/dock/RLSDock.tsx +26 -0
  68. package/src/components/drawer/RLSDrawer.tsx +177 -0
  69. package/src/components/dropdown-menu/RLADropdownMenu.astro +250 -241
  70. package/src/components/dropdown-menu/RLSDropdownMenu.tsx +183 -86
  71. package/src/components/editor/RLSEditor.tsx +26 -0
  72. package/src/components/empty/RLSEmpty.tsx +132 -0
  73. package/src/components/error/RLSError.tsx +26 -0
  74. package/src/components/field-group/RLSFieldGroup.tsx +46 -0
  75. package/src/components/fieldset/RLSFieldset.tsx +26 -0
  76. package/src/components/file-upload/RLSFileUpload.tsx +163 -0
  77. package/src/components/floating-action/RLSFloatingAction.tsx +26 -0
  78. package/src/components/footer/RLSFooter.tsx +56 -0
  79. package/src/components/form/RLSForm.tsx +34 -0
  80. package/src/components/gallery/RLSGallery.tsx +21 -0
  81. package/src/components/gamepad/RLSGamepad.tsx +269 -0
  82. package/src/components/grid/RLSGrid.tsx +29 -0
  83. package/src/components/head/RLAHead.astro +9 -0
  84. package/src/components/head/RLSHead.tsx +42 -0
  85. package/src/components/head/UIHead.astro +3 -0
  86. package/src/components/header/RLSHeader.tsx +87 -0
  87. package/src/components/hover-card/RLSHoverCard.tsx +72 -0
  88. package/src/components/icon/RLSIcon.tsx +3 -1
  89. package/src/components/image/RLAImage.astro +447 -138
  90. package/src/components/image/RLSImage.tsx +545 -0
  91. package/src/components/image/image.theme.ts +19 -3
  92. package/src/components/image/image.ts +31 -1
  93. package/src/components/input/RLAInput.astro +62 -51
  94. package/src/components/input/RLSInput.tsx +1 -1
  95. package/src/components/input-date/RLSInputDate.tsx +92 -0
  96. package/src/components/input-menu/RLSInputMenu.tsx +199 -0
  97. package/src/components/input-number/RLSInputNumber.tsx +184 -0
  98. package/src/components/input-pin/RLSInputPin.tsx +185 -0
  99. package/src/components/input-rating/RLSInputRating.tsx +198 -0
  100. package/src/components/input-rating/input-rating.ts +4 -0
  101. package/src/components/input-tags/RLSInputTags.tsx +94 -0
  102. package/src/components/input-time/RLSInputTime.tsx +92 -0
  103. package/src/components/kbd/RLSKbd.tsx +37 -0
  104. package/src/components/keyboard/RLSKeyboard.tsx +476 -0
  105. package/src/components/knob/RLSKnob.tsx +27 -0
  106. package/src/components/label/RLSLabel.tsx +27 -0
  107. package/src/components/layout-grid/RLSLayoutGrid.tsx +402 -0
  108. package/src/components/layout-grid/layout-grid.ts +25 -1
  109. package/src/components/link/RLSLink.tsx +2 -1
  110. package/src/components/link/link.ts +21 -12
  111. package/src/components/link-group/RLSLinkGroup.tsx +76 -0
  112. package/src/components/listbox/RLSListbox.tsx +27 -0
  113. package/src/components/locale-selector/RLALocaleSelector.astro +2 -1
  114. package/src/components/locale-selector/RLSLocaleSelector.tsx +178 -0
  115. package/src/components/logo/RLALogo.astro +69 -4
  116. package/src/components/logo/RLSLogo.tsx +129 -0
  117. package/src/components/main/RLSMain.tsx +40 -0
  118. package/src/components/marquee/RLSMarquee.tsx +80 -0
  119. package/src/components/meter/RLSMeter.tsx +27 -0
  120. package/src/components/modal/RLAModal.astro +1 -1
  121. package/src/components/modal/RLSModal.tsx +109 -72
  122. package/src/components/navigation-menu/RLSNavigationMenu.tsx +228 -0
  123. package/src/components/navigation-menu/navigation-menu.ts +2 -2
  124. package/src/components/package-managers/RLSPackageManagers.tsx +204 -0
  125. package/src/components/page/RLSPage.tsx +21 -0
  126. package/src/components/page-aside/RLSPageAside.tsx +21 -0
  127. package/src/components/page-body/RLSPageBody.tsx +21 -0
  128. package/src/components/page-header/RLSPageHeader.tsx +21 -0
  129. package/src/components/page-section/RLSPageSection.tsx +201 -0
  130. package/src/components/pagination/RLSPagination.tsx +114 -0
  131. package/src/components/password/RLSPassword.tsx +27 -0
  132. package/src/components/phone-mockup/RLSPhoneMockup.tsx +27 -0
  133. package/src/components/placeholder/RLSPlaceholder.tsx +47 -0
  134. package/src/components/popover/RLSPopover.tsx +124 -0
  135. package/src/components/post/RLSPost.tsx +134 -0
  136. package/src/components/pricing-plan/RLSPricingPlan.tsx +26 -0
  137. package/src/components/pricing-table/RLSPricingTable.tsx +26 -0
  138. package/src/components/progress/RLSProgress.tsx +53 -0
  139. package/src/components/prose/RLSProse.tsx +26 -0
  140. package/src/components/qr-code/RLSQrCode.tsx +26 -0
  141. package/src/components/quote/RLAQuote.astro +10 -6
  142. package/src/components/quote/RLSQuote.tsx +37 -0
  143. package/src/components/quote/quote.theme.ts +5 -2
  144. package/src/components/radio-group/RLSRadioGroup.tsx +37 -0
  145. package/src/components/rating/RLSRating.tsx +27 -0
  146. package/src/components/scroll-area/RLSScrollArea.tsx +210 -0
  147. package/src/components/scroll-to-top/RLAScrollToTop.astro +1 -0
  148. package/src/components/scroll-to-top/RLSScrollToTop.tsx +145 -0
  149. package/src/components/search/RLSSearch.tsx +237 -0
  150. package/src/components/select/RLASelect.astro +67 -4
  151. package/src/components/select/RLSSelect.tsx +107 -39
  152. package/src/components/select/RLVSelect.vue +50 -1
  153. package/src/components/select/select.theme.ts +30 -10
  154. package/src/components/select/select.ts +20 -1
  155. package/src/components/separator/RLSSeparator.tsx +92 -0
  156. package/src/components/share/RLSShare.tsx +66 -0
  157. package/src/components/shortcuts/RLSShortcuts.tsx +393 -0
  158. package/src/components/sidebar/RLSSidebar.tsx +271 -0
  159. package/src/components/skeleton/RLSSkeleton.tsx +21 -0
  160. package/src/components/slideover/RLASlideover.astro +1 -1
  161. package/src/components/slideover/RLSSlideover.tsx +159 -0
  162. package/src/components/slider/RLSSlider.tsx +112 -0
  163. package/src/components/speed-dial/RLSSpeedDial.tsx +27 -0
  164. package/src/components/spinner/RLSSpinner.tsx +22 -0
  165. package/src/components/splitter/RLSSplitter.tsx +178 -0
  166. package/src/components/spoiler/RLSSpoiler.tsx +26 -0
  167. package/src/components/stepper/RLSStepper.tsx +205 -0
  168. package/src/components/steps/RLSSteps.tsx +108 -0
  169. package/src/components/sticky-surface/RLSStickySurface.tsx +63 -0
  170. package/src/components/surround/RLSSurround.tsx +57 -0
  171. package/src/components/switch/RLSSwitch.tsx +56 -0
  172. package/src/components/table/RLATable.astro +1044 -579
  173. package/src/components/table/RLSTable.tsx +893 -0
  174. package/src/components/table/table.theme.ts +47 -16
  175. package/src/components/table/table.ts +104 -66
  176. package/src/components/table-of-contents/RLSTableOfContents.tsx +196 -0
  177. package/src/components/tabs/RLSTabs.tsx +298 -0
  178. package/src/components/textarea/RLATextarea.astro +1 -0
  179. package/src/components/textarea/RLSTextarea.tsx +3 -1
  180. package/src/components/theme-selector/RLAThemeSelector.astro +85 -56
  181. package/src/components/theme-selector/RLSThemeSelector.tsx +131 -0
  182. package/src/components/theme-selector/theme-selector.theme.ts +5 -7
  183. package/src/components/theme-selector/theme-selector.ts +11 -1
  184. package/src/components/timeline/RLSTimeline.tsx +171 -0
  185. package/src/components/toast/RLSToast.tsx +179 -0
  186. package/src/components/toaster/RLSToaster.tsx +82 -0
  187. package/src/components/tooltip/RLSTooltip.tsx +48 -0
  188. package/src/components/tour/RLSTour.tsx +26 -0
  189. package/src/components/tree/RLSTree.tsx +26 -0
  190. package/src/components/user/RLSUser.tsx +26 -0
  191. package/src/components/video/RLAVideo.astro +4 -1
  192. package/src/components/video/RLSVideo.tsx +158 -0
  193. package/src/components/watermark/RLSWatermark.tsx +27 -0
  194. package/src/components/window-mockup/RLSWindowMockup.tsx +27 -0
  195. package/src/preset.ts +73 -1
  196. package/src/resolver.ts +6 -1
  197. package/src/virtual.d.ts +6 -0
@@ -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,29 +91,54 @@ 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
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
106
- class={`${classes()["leadingIcon"]} ${leadingIconClass()}`}
107
- data-slot="leading-icon"
108
- >
109
- <RLSIcon name={showLeadingIcon()!} size={props.size ?? "md"} aria-hidden="true" />
110
- </span>
111
- ) : null}
141
+ {renderLeading()}
112
142
 
113
143
  {props.children !== undefined && props.children !== null ? (
114
144
  props.children
@@ -118,16 +148,7 @@ const RLSButton: Component<RLSButtonProps> = (allProps) => {
118
148
  </span>
119
149
  ) : null}
120
150
 
121
- {props.trailing ? (
122
- props.trailing
123
- ) : isTrailing() && showTrailingIcon() ? (
124
- <span
125
- class={`${classes()["trailingIcon"]} ${trailingIconClass()}`}
126
- data-slot="trailing-icon"
127
- >
128
- <RLSIcon name={showTrailingIcon()!} size={props.size ?? "md"} aria-hidden="true" />
129
- </span>
130
- ) : null}
151
+ {renderTrailing()}
131
152
  </a>
132
153
  )
133
154
  }
@@ -138,17 +159,14 @@ const RLSButton: Component<RLSButtonProps> = (allProps) => {
138
159
  disabled={props.disabled}
139
160
  class={classes()["root"]}
140
161
  data-slot="root"
162
+ data-theme={props.theme}
163
+ data-loading={props.loading ? "true" : undefined}
164
+ data-loading-auto={props.loadingAuto ? "true" : undefined}
141
165
  aria-label={props.ariaLabel}
142
166
  onClick={props.onClick}
143
167
  {...rest}
144
168
  >
145
- {props.leading ? (
146
- props.leading
147
- ) : isLeading() && showLeadingIcon() ? (
148
- <span class={`${classes()["leadingIcon"]} ${leadingIconClass()}`} data-slot="leading-icon">
149
- <RLSIcon name={showLeadingIcon()!} size={props.size ?? "md"} aria-hidden="true" />
150
- </span>
151
- ) : null}
169
+ {renderLeading()}
152
170
 
153
171
  {props.children !== undefined && props.children !== null ? (
154
172
  props.children
@@ -158,16 +176,7 @@ const RLSButton: Component<RLSButtonProps> = (allProps) => {
158
176
  </span>
159
177
  ) : null}
160
178
 
161
- {props.trailing ? (
162
- props.trailing
163
- ) : isTrailing() && showTrailingIcon() ? (
164
- <span
165
- class={`${classes()["trailingIcon"]} ${trailingIconClass()}`}
166
- data-slot="trailing-icon"
167
- >
168
- <RLSIcon name={showTrailingIcon()!} size={props.size ?? "md"} aria-hidden="true" />
169
- </span>
170
- ) : null}
179
+ {renderTrailing()}
171
180
  </button>
172
181
  )
173
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
  })
@@ -9,13 +9,17 @@ const attrs = useAttrs()
9
9
  const slots = useSlots()
10
10
 
11
11
  const props = withDefaults(defineProps<CardProps>(), {
12
+ variant: "outline",
12
13
  overlay: false
13
14
  })
14
15
 
15
16
  const resolvedClasses = computed(() =>
16
17
  cardTheme({
18
+ variant: props.variant,
17
19
  interactive: !!props.href,
18
20
  overlay: props.overlay,
21
+ theme: props.theme,
22
+ ui: props.ui,
19
23
  class: props.class
20
24
  })
21
25
  )
@@ -1,4 +1,14 @@
1
+ import type { Theme } from "../../types"
2
+
1
3
  export interface CardProps {
4
+ /**
5
+ * The visual style variant of the card.
6
+ */
7
+ variant?: "solid" | "outline" | "soft" | "subtle"
8
+ /**
9
+ * Theme mode override.
10
+ */
11
+ theme?: Theme
2
12
  /**
3
13
  * Card heading title.
4
14
  */
@@ -15,7 +15,7 @@ const classes = carouselTheme(Astro.props)
15
15
  const carouselId = `rla-carousel-${Math.random().toString(36).substring(2, 9)}`
16
16
  ---
17
17
  <rla-carousel data-autoplay={autoplay ? "true" : "false"} {...rest}>
18
- <div id={carouselId} class={classes.root} data-slot="carousel-root">
18
+ <div id={carouselId} class={classes.root} data-slot="root">
19
19
  <div class={classes.viewport} data-slot="viewport">
20
20
  <div class={classes.container} data-slot="container">
21
21
  {slides ? (
@@ -48,6 +48,19 @@ const carouselId = `rla-carousel-${Math.random().toString(36).substring(2, 9)}`
48
48
  <button class={classes.buttonNext} data-slot="next-button" type="button" aria-label="Next slide">
49
49
  <RLAIcon name="i-rl-chevronRight" class="size-5" aria-hidden="true" />
50
50
  </button>
51
+
52
+ {slides && slides.length > 0 && (
53
+ <div class={classes.dots} data-slot="dots">
54
+ {slides.map((_, i) => (
55
+ <button
56
+ type="button"
57
+ class={classes.dot}
58
+ data-slot="dot"
59
+ aria-label={`Go to slide ${i + 1}`}
60
+ />
61
+ ))}
62
+ </div>
63
+ )}
51
64
  </div>
52
65
  </rla-carousel>
53
66