@rimelight/ui 0.0.43 → 0.0.45

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 (154) hide show
  1. package/README.md +14 -12
  2. package/package.json +8 -10
  3. package/src/components/avatar/RLAAvatar.astro +4 -12
  4. package/src/components/badge/RLABadge.astro +2 -1
  5. package/src/components/badge/badge.theme.ts +0 -4
  6. package/src/components/banner/RLABanner.astro +1 -1
  7. package/src/components/banner/banner.theme.ts +1 -1
  8. package/src/components/breadcrumb/RLABreadcrumb.astro +2 -2
  9. package/src/components/button/RLAButton.astro +4 -1
  10. package/src/components/button/RLSButton.tsx +1 -1
  11. package/src/components/button/button.theme.ts +1 -5
  12. package/src/components/callout/RLACallout.astro +7 -5
  13. package/src/components/callout/callout.theme.ts +1 -5
  14. package/src/components/card/card.theme.ts +3 -3
  15. package/src/components/carousel/RLACarousel.astro +2 -2
  16. package/src/components/carousel/carousel.theme.ts +2 -2
  17. package/src/components/chart/RLAChart.astro +1 -1
  18. package/src/components/checkbox/RLACheckbox.astro +2 -1
  19. package/src/components/checkbox/checkbox.theme.ts +0 -4
  20. package/src/components/chip/RLAChip.astro +2 -1
  21. package/src/components/chip/chip.theme.ts +0 -4
  22. package/src/components/collapsible/RLACollapsible.astro +1 -1
  23. package/src/components/color-area/RLAColorArea.astro +1 -0
  24. package/src/components/color-area/color-area.theme.ts +1 -5
  25. package/src/components/color-field/RLAColorField.astro +1 -0
  26. package/src/components/color-field/color-field.theme.ts +1 -5
  27. package/src/components/color-slider/RLAColorSlider.astro +1 -0
  28. package/src/components/color-slider/color-slider.theme.ts +1 -5
  29. package/src/components/dashboard-group/RLADashboardGroup.astro +5 -7
  30. package/src/components/dashboard-group/dashboard-group.theme.ts +1 -1
  31. package/src/components/dashboard-group/dashboard-group.ts +1 -1
  32. package/src/components/dashboard-navbar/RLADashboardNavbar.astro +4 -4
  33. package/src/components/dashboard-navbar/dashboard-navbar.theme.ts +3 -3
  34. package/src/components/dashboard-navbar/dashboard-navbar.ts +1 -1
  35. package/src/components/dashboard-panel/RLADashboardPanel.astro +9 -8
  36. package/src/components/dashboard-panel/dashboard-panel.theme.ts +1 -1
  37. package/src/components/dashboard-sidebar/RLADashboardSidebar.astro +52 -20
  38. package/src/components/dashboard-sidebar/dashboard-sidebar.theme.ts +6 -5
  39. package/src/components/dashboard-sidebar-collapse/RLADashboardSidebarCollapse.astro +1 -0
  40. package/src/components/drawer/RLADrawer.astro +1 -1
  41. package/src/components/dropdown-menu/dropdown-menu.theme.ts +2 -2
  42. package/src/components/footer/RLAFooter.astro +2 -0
  43. package/src/components/footer/footer.theme.ts +0 -8
  44. package/src/components/gamepad/RLAGamepad.astro +1 -1
  45. package/src/components/head/UIHead.astro +1 -2
  46. package/src/components/header/header.theme.ts +1 -1
  47. package/src/components/icon/RLAIcon.astro +2 -5
  48. package/src/components/icon/RLSIcon.tsx +2 -2
  49. package/src/components/icon/RLVIcon.vue +18 -6
  50. package/src/components/icon/icon.theme.ts +1 -1
  51. package/src/components/image/image.theme.ts +1 -1
  52. package/src/components/input/RLAInput.astro +2 -1
  53. package/src/components/input/input.theme.ts +0 -4
  54. package/src/components/input-menu/RLAInputMenu.astro +2 -2
  55. package/src/components/input-menu/input-menu.theme.ts +1 -1
  56. package/src/components/input-rating/input-rating.theme.ts +2 -2
  57. package/src/components/kbd/RLAKbd.astro +2 -1
  58. package/src/components/kbd/kbd.theme.ts +0 -4
  59. package/src/components/keyboard/RLAKeyboard.astro +1 -1
  60. package/src/components/link/RLALink.astro +1 -0
  61. package/src/components/link/link.theme.ts +0 -4
  62. package/src/components/link-group/RLALinkGroup.astro +1 -1
  63. package/src/components/link-group/link-group.theme.ts +1 -10
  64. package/src/components/locale-selector/RLALocaleSelector.astro +4 -36
  65. package/src/components/locale-selector/locale-selector.theme.ts +3 -11
  66. package/src/components/logo/RLALogo.astro +1 -2
  67. package/src/components/modal/RLAModal.astro +8 -5
  68. package/src/components/modal/RLSModal.tsx +17 -12
  69. package/src/components/modal/modal.theme.ts +5 -4
  70. package/src/components/navigation-menu/RLANavigationMenu.astro +17 -21
  71. package/src/components/navigation-menu/navigation-menu.theme.ts +3 -7
  72. package/src/components/pagination/RLAPagination.astro +2 -2
  73. package/src/components/pagination/pagination.theme.ts +1 -1
  74. package/src/components/popover/RLAPopover.astro +39 -0
  75. package/src/components/progress/RLAProgress.astro +2 -0
  76. package/src/components/progress/progress.theme.ts +0 -4
  77. package/src/components/scroll-area/scroll-area.theme.ts +1 -1
  78. package/src/components/scroll-to-top/RLAScrollToTop.astro +6 -5
  79. package/src/components/scroll-to-top/RLVScrollToTop.vue +7 -7
  80. package/src/components/scroll-to-top/scroll-to-top.theme.ts +3 -7
  81. package/src/components/search/RLASearch.astro +3 -3
  82. package/src/components/select/RLASelect.astro +96 -528
  83. package/src/components/select/RLSSelect.tsx +68 -14
  84. package/src/components/select/RLVSelect.vue +57 -0
  85. package/src/components/select/select.theme.ts +11 -96
  86. package/src/components/shortcuts/RLAShortcuts.astro +9 -9
  87. package/src/components/sidebar/RLASidebar.astro +3 -3
  88. package/src/components/slideover/RLASlideover.astro +1 -1
  89. package/src/components/slider/RLASlider.astro +2 -1
  90. package/src/components/slider/slider.theme.ts +1 -5
  91. package/src/components/spinner/RLASpinner.astro +2 -1
  92. package/src/components/spinner/spinner.theme.ts +1 -5
  93. package/src/components/splitter/splitter.theme.ts +1 -1
  94. package/src/components/stepper/RLAStepper.astro +8 -8
  95. package/src/components/stepper/stepper.theme.ts +6 -7
  96. package/src/components/steps/RLASteps.astro +3 -3
  97. package/src/components/switch/RLASwitch.astro +2 -1
  98. package/src/components/switch/switch.theme.ts +0 -4
  99. package/src/components/table/table.theme.ts +1 -1
  100. package/src/components/table-of-contents/RLATableOfContents.astro +5 -5
  101. package/src/components/theme-selector/RLAThemeSelector.astro +16 -14
  102. package/src/components/theme-selector/theme-selector.theme.ts +2 -2
  103. package/src/components/toast/RLAToast.astro +6 -6
  104. package/src/components/toast/store.ts +1 -1
  105. package/src/components/tooltip/tooltip.theme.ts +1 -1
  106. package/src/icons.raw.ts +67 -0
  107. package/src/icons.ts +31 -64
  108. package/src/index.ts +19 -18
  109. package/src/preset.ts +110 -108
  110. package/src/resolver.ts +127 -15
  111. package/src/shortcuts.ts +103 -84
  112. package/src/stores.ts +22 -0
  113. package/src/types.ts +27 -9
  114. package/src/virtual.d.ts +4 -0
  115. package/src/components/editor/PageEditor.vue +0 -459
  116. package/src/components/editor/PageMention.vue +0 -87
  117. package/src/components/editor/PagePropertiesEditor.vue +0 -358
  118. package/src/components/editor/PagePropertiesRenderer.vue +0 -285
  119. package/src/components/editor/PageRenderer.vue +0 -155
  120. package/src/components/editor/PageSurround.vue +0 -130
  121. package/src/components/editor/PageVersionSelector.vue +0 -371
  122. package/src/components/editor/blocks/AddBlockModal.vue +0 -196
  123. package/src/components/editor/blocks/Block.vue +0 -142
  124. package/src/components/editor/blocks/BlockEditRenderer.vue +0 -26
  125. package/src/components/editor/blocks/BlockEditor.vue +0 -141
  126. package/src/components/editor/blocks/BlockViewRenderer.vue +0 -71
  127. package/src/components/editor/blocks/TextRenderer.vue +0 -31
  128. package/src/components/editor/blocks/editor/CalloutBlockEditor.vue +0 -53
  129. package/src/components/editor/blocks/editor/ImageBlockEditor.vue +0 -55
  130. package/src/components/editor/blocks/editor/ParagraphBlockEditor.vue +0 -31
  131. package/src/components/editor/blocks/editor/SectionBlockEditor.vue +0 -65
  132. package/src/components/editor/blocks/nodes/LinkNode.vue +0 -28
  133. package/src/components/editor/blocks/nodes/TextNode.vue +0 -22
  134. package/src/components/editor/blocks/renderer/CalloutBlockRenderer.vue +0 -65
  135. package/src/components/editor/blocks/renderer/ImageBlockRenderer.vue +0 -20
  136. package/src/components/editor/blocks/renderer/ParagraphBlockRenderer.vue +0 -21
  137. package/src/components/editor/blocks/renderer/SectionBlockRenderer.vue +0 -55
  138. package/src/components/editor/composables/injectionKeys.ts +0 -3
  139. package/src/components/editor/composables/useBlockEditor.ts +0 -261
  140. package/src/components/editor/composables/usePageEditor.ts +0 -97
  141. package/src/components/editor/modals/CreatePageModal.vue +0 -160
  142. package/src/components/editor/modals/DeletePageModal.vue +0 -116
  143. package/src/components/editor/modals/PageTreeModal.vue +0 -275
  144. package/src/components/editor/types/blocks.ts +0 -100
  145. package/src/components/editor/types/pages.ts +0 -89
  146. package/src/components/editor/types/schemas.ts +0 -36
  147. package/src/components/editor/utils/blocks.ts +0 -42
  148. package/src/components/editor/utils/editorHelpers.ts +0 -24
  149. package/src/components/editor/utils/page.ts +0 -219
  150. package/src/components/editor/utils/richTextHelpers.ts +0 -35
  151. package/src/components/editor/views/PageEditView.vue +0 -195
  152. package/src/components/editor/views/PageLiveView.vue +0 -90
  153. package/src/components/editor/views/PageReviewView.vue +0 -308
  154. package/src/components/icon/resolver.ts +0 -23
@@ -1,5 +1,7 @@
1
1
  import { createMemo, splitProps, For, type Component, type JSX } from "solid-js"
2
2
  import type { SelectItem } from "./select"
3
+ import { selectTheme } from "./select.theme"
4
+ import RLSIcon from "../icon/RLSIcon"
3
5
 
4
6
  export interface RLSSelectProps {
5
7
  id?: string
@@ -17,14 +19,6 @@ export interface RLSSelectProps {
17
19
  onBlur?: (e: FocusEvent & { currentTarget: HTMLSelectElement }) => void
18
20
  }
19
21
 
20
- const SIZE_CLASSES = {
21
- xs: "py-0.5 pl-2 pr-6 text-xs",
22
- sm: "py-1 pl-2.5 pr-7 text-xs",
23
- md: "py-1.5 pl-3 pr-8 text-sm",
24
- lg: "py-2 pl-3.5 pr-9 text-base",
25
- xl: "py-2.5 pl-4 pr-10 text-base"
26
- } as const
27
-
28
22
  const RLSSelect: Component<RLSSelectProps> = (allProps) => {
29
23
  const [props, rest] = splitProps(allProps, [
30
24
  "id",
@@ -42,7 +36,12 @@ const RLSSelect: Component<RLSSelectProps> = (allProps) => {
42
36
  "onBlur"
43
37
  ])
44
38
 
45
- const sizeClass = createMemo(() => SIZE_CLASSES[props.size ?? "md"])
39
+ const classes = createMemo(() =>
40
+ selectTheme({
41
+ size: props.size,
42
+ class: props.class
43
+ })
44
+ )
46
45
 
47
46
  const normalizedItems = createMemo(() => {
48
47
  if (!props.items) return []
@@ -50,11 +49,19 @@ const RLSSelect: Component<RLSSelectProps> = (allProps) => {
50
49
  if (typeof item === "string" || typeof item === "number" || typeof item === "boolean") {
51
50
  return { label: String(item), value: String(item), disabled: false }
52
51
  }
53
- const i = item as { label?: string; value?: any; disabled?: boolean }
52
+ const i = item as {
53
+ label?: string
54
+ value?: any
55
+ disabled?: boolean
56
+ icon?: string
57
+ avatar?: { src?: string; alt?: string; loading?: "lazy" | "eager" }
58
+ }
54
59
  return {
55
60
  label: String(i.label ?? i.value ?? ""),
56
61
  value: String(i.value ?? ""),
57
- disabled: !!i.disabled
62
+ disabled: !!i.disabled,
63
+ icon: i.icon,
64
+ avatar: i.avatar
58
65
  }
59
66
  })
60
67
  })
@@ -68,7 +75,7 @@ const RLSSelect: Component<RLSSelectProps> = (allProps) => {
68
75
  )
69
76
 
70
77
  return (
71
- <div class={`relative inline-flex items-center w-full ${props.class || ""}`}>
78
+ <div class={`${classes().root}`}>
72
79
  <select
73
80
  id={props.id}
74
81
  name={props.name}
@@ -76,7 +83,8 @@ const RLSSelect: Component<RLSSelectProps> = (allProps) => {
76
83
  required={props.required}
77
84
  onChange={props.onChange}
78
85
  onBlur={props.onBlur}
79
- class={`rl-select w-full cursor-pointer rounded-md border border-default bg-default ${sizeClass()} text-foreground shadow-sm outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50`}
86
+ class={classes().select}
87
+ data-slot="select"
80
88
  {...rest}
81
89
  >
82
90
  {props.placeholder ? (
@@ -95,6 +103,10 @@ const RLSSelect: Component<RLSSelectProps> = (allProps) => {
95
103
  disabled={item.disabled}
96
104
  selected={currentValue() !== undefined ? currentValue() === item.value : undefined}
97
105
  >
106
+ {item.icon ? <RLSIcon name={item.icon} class="rl-select-item-icon" /> : null}
107
+ {item.avatar ? (
108
+ <img src={item.avatar.src} alt={item.avatar.alt} class="rl-select-item-icon" />
109
+ ) : null}
98
110
  {item.label}
99
111
  </option>
100
112
  )}
@@ -103,7 +115,7 @@ const RLSSelect: Component<RLSSelectProps> = (allProps) => {
103
115
  </select>
104
116
 
105
117
  {/* Custom Chevron arrow */}
106
- <span class="pointer-events-none absolute right-2 flex items-center text-muted-foreground">
118
+ <span class={classes().icon} data-slot="icon">
107
119
  <svg
108
120
  xmlns="http://www.w3.org/2000/svg"
109
121
  width="14"
@@ -119,6 +131,48 @@ const RLSSelect: Component<RLSSelectProps> = (allProps) => {
119
131
  <path d="M6 9l6 6 6-6" />
120
132
  </svg>
121
133
  </span>
134
+
135
+ <style>{`
136
+ select.rl-select,
137
+ select.rl-select::picker(select) { appearance: base-select; }
138
+ select.rl-select::picker-icon { display: none; }
139
+ select.rl-select::picker(select) {
140
+ border: 1px solid var(--rl-neutral-200);
141
+ border-radius: var(--radius-md, 0.375rem);
142
+ background-color: var(--rl-neutral-100);
143
+ color: var(--rl-neutral-950);
144
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.25), 0 4px 6px -4px rgba(0, 0, 0, 0.15);
145
+ padding: 0.25rem;
146
+ margin-top: 0.25rem;
147
+ }
148
+ select.rl-select option {
149
+ display: flex;
150
+ align-items: center;
151
+ gap: 0.375rem;
152
+ padding: 0.375rem 0.625rem;
153
+ border-radius: calc(var(--radius-md, 0.375rem) - 0.125rem);
154
+ background-color: var(--rl-neutral-100);
155
+ color: var(--rl-neutral-950);
156
+ font-size: 0.875rem;
157
+ cursor: pointer;
158
+ transition: background-color 0.15s ease, color 0.15s ease;
159
+ }
160
+ select.rl-select .rl-select-item-icon {
161
+ width: 1rem;
162
+ height: 1rem;
163
+ flex-shrink: 0;
164
+ }
165
+ select.rl-select option:hover,
166
+ select.rl-select option:focus {
167
+ background-color: var(--rl-neutral-200);
168
+ color: var(--rl-neutral-950);
169
+ }
170
+ select.rl-select option:checked {
171
+ background-color: var(--rl-primary-500);
172
+ color: var(--rl-neutral-50);
173
+ font-weight: 500;
174
+ }
175
+ `}</style>
122
176
  </div>
123
177
  )
124
178
  }
@@ -55,6 +55,13 @@ const normalizedItems = computed(() => {
55
55
  :value="item.value"
56
56
  :disabled="item.disabled"
57
57
  >
58
+ <RLVIcon v-if="item.icon" :name="item.icon" class="rl-select-item-icon" />
59
+ <img
60
+ v-else-if="item.avatar"
61
+ :src="item.avatar.src"
62
+ :alt="item.avatar.alt"
63
+ class="rl-select-item-icon"
64
+ />
58
65
  {{ item.label }}
59
66
  </option>
60
67
  </select>
@@ -63,3 +70,53 @@ const normalizedItems = computed(() => {
63
70
  </span>
64
71
  </div>
65
72
  </template>
73
+
74
+ <style>
75
+ select.rl-select,
76
+ select.rl-select::picker(select) {
77
+ appearance: base-select;
78
+ }
79
+ select.rl-select::picker-icon {
80
+ display: none;
81
+ }
82
+ select.rl-select::picker(select) {
83
+ border: 1px solid var(--rl-neutral-200);
84
+ border-radius: var(--radius-md, 0.375rem);
85
+ background-color: var(--rl-neutral-100);
86
+ color: var(--rl-neutral-950);
87
+ box-shadow:
88
+ 0 10px 15px -3px rgba(0, 0, 0, 0.25),
89
+ 0 4px 6px -4px rgba(0, 0, 0, 0.15);
90
+ padding: 0.25rem;
91
+ margin-top: 0.25rem;
92
+ }
93
+ select.rl-select option {
94
+ display: flex;
95
+ align-items: center;
96
+ gap: 0.375rem;
97
+ padding: 0.375rem 0.625rem;
98
+ border-radius: calc(var(--radius-md, 0.375rem) - 0.125rem);
99
+ background-color: var(--rl-neutral-100);
100
+ color: var(--rl-neutral-950);
101
+ font-size: 0.875rem;
102
+ cursor: pointer;
103
+ transition:
104
+ background-color 0.15s ease,
105
+ color 0.15s ease;
106
+ }
107
+ select.rl-select .rl-select-item-icon {
108
+ width: 1rem;
109
+ height: 1rem;
110
+ flex-shrink: 0;
111
+ }
112
+ select.rl-select option:hover,
113
+ select.rl-select option:focus {
114
+ background-color: var(--rl-neutral-200);
115
+ color: var(--rl-neutral-950);
116
+ }
117
+ select.rl-select option:checked {
118
+ background-color: var(--rl-primary-500);
119
+ color: var(--primary-foreground, #ffffff);
120
+ font-weight: 500;
121
+ }
122
+ </style>
@@ -1,108 +1,23 @@
1
1
  import { defineTheme } from "../../resolver"
2
2
 
3
3
  export const selectTheme = defineTheme("select", {
4
- slots: [
5
- "root",
6
- "label",
7
- "trigger",
8
- "leading",
9
- "leadingIcon",
10
- "leadingAvatar",
11
- "trailing",
12
- "trailingIcon",
13
- "trailingClear",
14
- "value",
15
- "placeholder",
16
- "content",
17
- "viewport",
18
- "group",
19
- "empty",
20
- "separator",
21
- "item",
22
- "itemLeadingIcon",
23
- "itemLeadingAvatar",
24
- "itemLeadingChip",
25
- "itemWrapper",
26
- "itemLabel",
27
- "itemDescription",
28
- "itemTrailingIcon",
29
- "input",
30
- "createOption"
31
- ],
4
+ slots: ["root", "select", "icon"],
32
5
  base: {
33
- root: "relative w-full flex flex-col gap-1.5",
34
- label: "text-sm font-medium text-highlighted",
35
- trigger:
36
- "relative group w-full inline-flex items-center justify-between rounded-md border border-default bg-default px-3 py-2 text-sm shadow-sm transition-colors focus:outline-none focus:ring-2 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-75 cursor-pointer",
37
- leading: "inline-flex items-center gap-1.5 shrink-0 me-2",
38
- leadingIcon: "shrink-0 size-4 text-muted",
39
- leadingAvatar: "shrink-0 size-4 rounded-full object-cover",
40
- trailing: "inline-flex items-center gap-1.5 shrink-0 ms-auto",
41
- trailingIcon: "shrink-0 size-4 text-muted transition-transform duration-200",
42
- trailingClear: "p-0 text-muted hover:text-highlighted cursor-pointer",
43
- value: "truncate text-highlighted",
44
- placeholder: "truncate text-muted",
45
- content:
46
- "absolute z-50 left-0 right-0 min-w-[12rem] bg-default shadow-lg rounded-md border border-default overflow-hidden mt-1 flex flex-col max-h-60",
47
- viewport: "relative p-1 scroll-py-1 overflow-y-auto flex-1 divide-y divide-border/50",
48
- group: "p-1 isolate",
49
- empty: "p-3 text-center text-sm text-muted",
50
- separator: "-mx-1 my-1 h-px bg-border",
51
- item: "group relative w-full flex items-center justify-between select-none outline-none rounded-md px-2 py-1.5 text-sm cursor-pointer transition-colors hover:bg-accent hover:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
52
- itemLeadingIcon: "shrink-0 size-4 me-2 text-muted group-hover:text-highlighted",
53
- itemLeadingAvatar: "shrink-0 size-4 me-2 rounded-full object-cover",
54
- itemLeadingChip: "shrink-0 size-2.5 me-2 rounded-full",
55
- itemWrapper: "flex-1 flex flex-col min-w-0",
56
- itemLabel: "truncate font-normal",
57
- itemDescription: "truncate text-xs text-muted",
58
- itemTrailingIcon: "shrink-0 size-4 ms-auto text-primary",
59
- input:
60
- "w-full border-b border-default bg-transparent px-3 py-2 text-sm outline-none placeholder:text-muted",
61
- createOption:
62
- "p-2 text-sm font-medium text-primary hover:bg-accent cursor-pointer flex items-center gap-2 border-t border-default"
6
+ root: "relative inline-flex items-center w-full",
7
+ select:
8
+ "rl-select w-full cursor-pointer rounded-md border border-default bg-default text-highlighted shadow-sm outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50",
9
+ icon: "pointer-events-none absolute right-2 flex items-center text-muted"
63
10
  },
64
11
  variants: {
65
12
  size: {
66
- xs: {
67
- trigger: "h-7 px-2 text-xs",
68
- item: "py-1 px-1.5 text-xs",
69
- input: "py-1 px-2 text-xs"
70
- },
71
- sm: {
72
- trigger: "h-8 px-2.5 text-xs",
73
- item: "py-1 px-2 text-xs",
74
- input: "py-1.5 px-2.5 text-xs"
75
- },
76
- md: {
77
- trigger: "h-9 px-3 text-sm",
78
- item: "py-1.5 px-2 text-sm",
79
- input: "py-2 px-3 text-sm"
80
- },
81
- lg: {
82
- trigger: "h-10 px-3.5 text-sm",
83
- item: "py-2 px-2.5 text-sm",
84
- input: "py-2.5 px-3.5 text-sm"
85
- },
86
- xl: {
87
- trigger: "h-11 px-4 text-base",
88
- item: "py-2.5 px-3 text-base",
89
- input: "py-3 px-4 text-base"
90
- }
91
- },
92
- variant: {
93
- outline: { trigger: "bg-default border border-default hover:bg-accent/50" },
94
- soft: { trigger: "bg-accent/50 border-transparent hover:bg-accent" },
95
- subtle: { trigger: "bg-accent border border-default hover:bg-accent/80" },
96
- ghost: { trigger: "bg-transparent border-transparent hover:bg-accent" },
97
- none: { trigger: "bg-transparent border-transparent px-0 shadow-none" }
98
- },
99
- theme: {
100
- dark: { root: "rl-dark" },
101
- light: { root: "rl-light" }
13
+ xs: { select: "py-0.5 pl-2 pr-6 text-xs" },
14
+ sm: { select: "py-1 pl-2.5 pr-7 text-xs" },
15
+ md: { select: "py-1.5 pl-3 pr-8 text-sm" },
16
+ lg: { select: "py-2 pl-3.5 pr-9 text-base" },
17
+ xl: { select: "py-2.5 pl-4 pr-10 text-base" }
102
18
  }
103
19
  },
104
20
  defaultVariants: {
105
- size: "md",
106
- variant: "outline"
21
+ size: "md"
107
22
  }
108
23
  })
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  import RLAIcon from "../icon/RLAIcon.astro"
3
- import { uiConfig } from "../../resolver"
3
+ import uiConfig from "virtual:rimelight/ui"
4
4
 
5
5
  interface Props {
6
6
  categories?: Record<string, string>
@@ -40,7 +40,7 @@ const modalId = `rla-shortcuts-${Math.random().toString(36).substring(2, 9)}`
40
40
  <div class="rla-shortcuts-header">
41
41
  <h3 id={`${modalId}-title`} class="rla-shortcuts-title">Keyboard Shortcuts</h3>
42
42
  <button class="rla-shortcuts-close" aria-label="Close shortcuts help">
43
- <RLAIcon name="close" class="w-4 h-4" />
43
+ <RLAIcon name="i-rl-close" class="w-4 h-4" />
44
44
  </button>
45
45
  </div>
46
46
 
@@ -300,7 +300,7 @@ const modalId = `rla-shortcuts-${Math.random().toString(36).substring(2, 9)}`
300
300
  .rla-shortcuts-close {
301
301
  background: transparent;
302
302
  border: none;
303
- color: var(--color-neutral-400, #a3a3a3);
303
+ color: var(--rl-neutral-400, #a3a3a3);
304
304
  cursor: pointer;
305
305
  padding: 6px;
306
306
  border-radius: 6px;
@@ -312,7 +312,7 @@ const modalId = `rla-shortcuts-${Math.random().toString(36).substring(2, 9)}`
312
312
 
313
313
  .rla-shortcuts-close:hover {
314
314
  color: #fff;
315
- background-color: var(--color-neutral-800, #262626);
315
+ background-color: var(--rl-neutral-800, #262626);
316
316
  }
317
317
 
318
318
  .rla-shortcuts-close:focus {
@@ -320,7 +320,7 @@ const modalId = `rla-shortcuts-${Math.random().toString(36).substring(2, 9)}`
320
320
  }
321
321
 
322
322
  .rla-shortcuts-close:focus-visible {
323
- outline: 2px solid var(--color-primary-500, #3b82f6) !important;
323
+ outline: 2px solid var(--rl-primary-500, #3b82f6) !important;
324
324
  }
325
325
 
326
326
  .rla-shortcuts-body {
@@ -343,7 +343,7 @@ const modalId = `rla-shortcuts-${Math.random().toString(36).substring(2, 9)}`
343
343
  font-size: 0.75rem;
344
344
  text-transform: uppercase;
345
345
  letter-spacing: 0.05em;
346
- color: var(--color-primary-500, #3b82f6);
346
+ color: var(--rl-primary-500, #3b82f6);
347
347
  font-weight: 700;
348
348
  }
349
349
 
@@ -376,7 +376,7 @@ const modalId = `rla-shortcuts-${Math.random().toString(36).substring(2, 9)}`
376
376
 
377
377
  .rla-shortcuts-desc {
378
378
  font-size: 0.75rem;
379
- color: var(--color-neutral-400, #a3a3a3);
379
+ color: var(--rl-neutral-400, #a3a3a3);
380
380
  }
381
381
 
382
382
  .rla-shortcuts-keys {
@@ -403,7 +403,7 @@ const modalId = `rla-shortcuts-${Math.random().toString(36).substring(2, 9)}`
403
403
 
404
404
  .rla-shortcuts-empty {
405
405
  font-size: 0.875rem;
406
- color: var(--color-neutral-500, #737373);
406
+ color: var(--rl-neutral-500, #737373);
407
407
  text-align: center;
408
408
  padding: 16px 0;
409
409
  }
@@ -413,7 +413,7 @@ const modalId = `rla-shortcuts-${Math.random().toString(36).substring(2, 9)}`
413
413
  background-color: #09090b !important;
414
414
  border-top: 1px solid #27272a;
415
415
  font-size: 0.75rem;
416
- color: var(--color-neutral-400, #a3a3a3);
416
+ color: var(--rl-neutral-400, #a3a3a3);
417
417
  display: flex;
418
418
  justify-content: flex-end;
419
419
  }
@@ -55,7 +55,7 @@ const textSizeClass = _depth === 0 ? "" : "text-xs"
55
55
  <slot name="header">
56
56
  {logo && (
57
57
  <span data-slot="sidebar-logo" class="flex items-center gap-2">
58
- <RLAIcon name="layers" class="size-5 text-primary" />
58
+ <RLAIcon name="i-rl-layers" class="size-5 text-primary" />
59
59
  <span class="truncate">{logo}</span>
60
60
  </span>
61
61
  )}
@@ -82,7 +82,7 @@ const textSizeClass = _depth === 0 ? "" : "text-xs"
82
82
  class="fixed top-4 left-4 z-50 flex size-9 items-center justify-center rounded-md bg-default border border-default shadow-sm hover:bg-muted transition-colors"
83
83
  aria-label="Toggle sidebar"
84
84
  >
85
- <RLAIcon name="panelLeft" class="size-4" />
85
+ <RLAIcon name="i-rl-panelLeft" class="size-4" />
86
86
  </button>
87
87
  )}
88
88
 
@@ -121,7 +121,7 @@ const textSizeClass = _depth === 0 ? "" : "text-xs"
121
121
  {t(b.text)}
122
122
  </RLABadge>
123
123
  )}
124
- <RLAIcon name="chevronRight" class="size-3 ml-auto transition-transform group-open/details:rotate-90" />
124
+ <RLAIcon name="i-rl-chevronRight" class="size-3 ml-auto transition-transform group-open/details:rotate-90" />
125
125
  </summary>
126
126
  <div class={`mt-0.5 ${indentClass} flex flex-col gap-0.5`}>
127
127
  <Astro.self items={item.children} t={t} _depth={_depth + 1} />
@@ -49,7 +49,7 @@ const dialogId = `rla-slideover-${Math.random().toString(36).substring(2, 9)}`
49
49
  data-dialog-close={dialogId}
50
50
  aria-label="Close slideover"
51
51
  >
52
- <RLAIcon name="close" class="size-4" aria-hidden="true" />
52
+ <RLAIcon name="i-rl-close" class="size-4" aria-hidden="true" />
53
53
  </button>
54
54
 
55
55
  <div class={classes.header} data-slot="header">
@@ -9,6 +9,7 @@ const {
9
9
  max = 100,
10
10
  step = 1,
11
11
  name,
12
+ theme,
12
13
  ...rest
13
14
  } = Astro.props as SliderProps
14
15
 
@@ -16,7 +17,7 @@ const classes = sliderTheme(Astro.props)
16
17
 
17
18
  const percentage = Math.min(100, Math.max(0, ((value - min) / (max - min)) * 100))
18
19
  ---
19
- <div class={classes.root} data-slot="slider-root" {...rest}>
20
+ <div class={classes.root} data-slot="slider-root" data-theme={theme} {...rest}>
20
21
  <div class={classes.track} data-slot="track">
21
22
  <svg class="h-full w-full overflow-visible pointer-events-none">
22
23
  <rect class:list={[classes.range, "h-full"]} width={`${percentage}%`} fill="currentColor" rx="2" />
@@ -10,11 +10,7 @@ export const sliderTheme = defineTheme("slider", {
10
10
  "block size-4.5 rounded-full border border-default bg-default shadow transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--rl-ring)]/50 hover:border-[var(--rl-border)] disabled:pointer-events-none disabled:opacity-50 cursor-pointer"
11
11
  },
12
12
  variants: {
13
- color: "auto",
14
- theme: {
15
- light: { root: "rl-light" },
16
- dark: { root: "rl-dark" }
17
- }
13
+ color: "auto"
18
14
  },
19
15
  defaultVariants: {
20
16
  color: "primary"
@@ -4,9 +4,10 @@ import { spinnerTheme } from "./spinner.theme"
4
4
 
5
5
 
6
6
  const {
7
+ theme,
7
8
  ...rest
8
9
  } = Astro.props as SpinnerProps
9
10
 
10
11
  const classes = spinnerTheme(Astro.props)
11
12
  ---
12
- <div class={classes.root} data-slot="root" {...rest} />
13
+ <div class={classes.root} data-slot="root" data-theme={theme} {...rest} />
@@ -13,11 +13,7 @@ export const spinnerTheme = defineTheme("spinner", {
13
13
  lg: { root: "size-8" },
14
14
  xl: { root: "size-10" }
15
15
  },
16
- color: "auto",
17
- theme: {
18
- light: { root: "rl-light" },
19
- dark: { root: "rl-dark" }
20
- }
16
+ color: "auto"
21
17
  },
22
18
  compoundVariants: [
23
19
  {
@@ -6,7 +6,7 @@ export const splitterTheme = defineTheme("splitter", {
6
6
  root: "flex w-full h-full",
7
7
  panel: "overflow-auto transition-all",
8
8
  handle:
9
- "flex items-center justify-center bg-border hover:bg-primary/50 transition-colors cursor-col-resize select-none"
9
+ "flex items-center justify-center bg-neutral-200 hover:bg-primary/50 transition-colors cursor-col-resize select-none"
10
10
  },
11
11
  variants: {
12
12
  direction: {
@@ -75,7 +75,7 @@ const currentIndex = activeIndex >= 0 ? activeIndex : 0
75
75
  size="sm"
76
76
  class:list={[
77
77
  classes.icon,
78
- (isActive || isCompleted) ? "!text-white" : "text-neutral-400 dark:text-neutral-500"
78
+ (isActive || isCompleted) ? "!text-white" : "text-neutral-400"
79
79
  ]}
80
80
  data-slot="icon"
81
81
  />
@@ -110,7 +110,7 @@ const currentIndex = activeIndex >= 0 ? activeIndex : 0
110
110
  class:list={[
111
111
  classes.separator,
112
112
  "flex-1 h-0.5 mx-2 self-start mt-4 transition-colors",
113
- index < currentIndex ? "bg-primary-600 dark:bg-primary-500" : "bg-neutral-200 dark:bg-neutral-800"
113
+ index < currentIndex ? "bg-primary-600" : "bg-neutral-200"
114
114
  ]}
115
115
  data-slot="separator"
116
116
  data-separator-index={index}
@@ -251,10 +251,10 @@ const currentIndex = activeIndex >= 0 ? activeIndex : 0
251
251
  if (icon) {
252
252
  if (isActive || isCompleted) {
253
253
  icon.classList.add('!text-white')
254
- icon.classList.remove('text-neutral-400', 'dark:text-neutral-500')
254
+ icon.classList.remove('text-neutral-400')
255
255
  } else {
256
256
  icon.classList.remove('!text-white')
257
- icon.classList.add('text-neutral-400', 'dark:text-neutral-500')
257
+ icon.classList.add('text-neutral-400')
258
258
  }
259
259
  }
260
260
 
@@ -263,11 +263,11 @@ const currentIndex = activeIndex >= 0 ? activeIndex : 0
263
263
  const sep = sepNode as HTMLElement
264
264
  const sepIdx = Number(sep.dataset.separatorIndex)
265
265
  if (sepIdx < this.currentIndex) {
266
- sep.classList.add('!bg-primary-600', 'dark:!bg-primary-500')
267
- sep.classList.remove('bg-neutral-200', 'dark:bg-neutral-800')
266
+ sep.classList.add('!bg-primary-600')
267
+ sep.classList.remove('bg-neutral-200')
268
268
  } else {
269
- sep.classList.remove('!bg-primary-600', 'dark:!bg-primary-500')
270
- sep.classList.add('bg-neutral-200', 'dark:bg-neutral-800')
269
+ sep.classList.remove('!bg-primary-600')
270
+ sep.classList.add('bg-neutral-200')
271
271
  }
272
272
  })
273
273
  })
@@ -21,14 +21,14 @@ export const stepperTheme = defineTheme("stepper", {
21
21
  item: "group flex-1 flex flex-col items-center text-center relative",
22
22
  container: "flex items-center justify-center relative w-full",
23
23
  trigger:
24
- "rounded-full font-medium text-center align-middle flex items-center justify-center font-semibold group-data-[state=completed]:bg-primary-600 group-data-[state=completed]:border-primary-600 group-data-[state=completed]:!text-white group-data-[state=active]:bg-primary-600 group-data-[state=active]:border-primary-600 group-data-[state=active]:!text-white text-neutral-400 dark:text-neutral-500 bg-neutral-100 dark:bg-neutral-800 border border-neutral-300 dark:border-neutral-700 transition-all cursor-pointer z-10",
24
+ "rounded-full font-medium text-center align-middle flex items-center justify-center font-semibold group-data-[state=completed]:bg-primary-600 group-data-[state=completed]:border-primary-600 group-data-[state=completed]:!text-white group-data-[state=active]:bg-primary-600 group-data-[state=active]:border-primary-600 group-data-[state=active]:!text-white text-neutral-400 bg-neutral-100 border border-neutral-300 transition-all cursor-pointer z-10",
25
25
  indicator: "flex items-center justify-center size-full text-current",
26
26
  icon: "shrink-0 size-4 text-current transition-colors",
27
27
  separator: "flex-1 h-0.5 mx-2 self-start mt-4 transition-colors rounded-full",
28
28
  wrapper: "mt-2 text-center",
29
29
  title:
30
- "text-xs font-semibold group-data-[state=active]:font-bold group-data-[state=active]:text-primary-600 dark:group-data-[state=active]:text-primary-400 group-data-[state=completed]:text-primary-600 dark:group-data-[state=completed]:text-primary-400 text-neutral-400 dark:text-neutral-500 transition-colors",
31
- description: "text-neutral-500 dark:text-neutral-400 text-wrap text-xs",
30
+ "text-xs font-semibold group-data-[state=active]:font-bold group-data-[state=active]:text-primary-600 group-data-[state=completed]:text-primary-600 text-neutral-400 transition-colors",
31
+ description: "text-neutral-500 text-wrap text-xs",
32
32
  content: "size-full"
33
33
  },
34
34
  variants: {
@@ -123,10 +123,9 @@ export const stepperTheme = defineTheme("stepper", {
123
123
  },
124
124
  neutral: {
125
125
  trigger:
126
- "group-data-[state=completed]:bg-neutral-900 dark:group-data-[state=completed]:bg-neutral-100 group-data-[state=completed]:border-neutral-900 dark:group-data-[state=completed]:border-neutral-100 group-data-[state=completed]:text-neutral-100 dark:group-data-[state=completed]:text-neutral-900 group-data-[state=active]:bg-neutral-900 dark:group-data-[state=active]:bg-neutral-100 group-data-[state=active]:border-neutral-900 dark:group-data-[state=active]:border-neutral-100 group-data-[state=active]:text-neutral-100 dark:group-data-[state=active]:text-neutral-900",
127
- icon: "group-data-[state=completed]:text-neutral-100 dark:group-data-[state=completed]:text-neutral-900 group-data-[state=active]:text-neutral-100 dark:group-data-[state=active]:text-neutral-900",
128
- separator:
129
- "group-data-[state=completed]:bg-neutral-900 dark:group-data-[state=completed]:bg-neutral-100"
126
+ "group-data-[state=completed]:bg-neutral-950 group-data-[state=completed]:border-neutral-950 group-data-[state=active]:bg-neutral-950 group-data-[state=active]:border-neutral-950",
127
+ icon: "group-data-[state=completed]:text-neutral-50 group-data-[state=active]:text-neutral-50",
128
+ separator: "group-data-[state=completed]:bg-neutral-950"
130
129
  }
131
130
  }
132
131
  },
@@ -54,8 +54,8 @@ const classes = stepsTheme(Astro.props)
54
54
  font-size: 0.75rem;
55
55
  font-weight: 700;
56
56
  line-height: 1;
57
- color: var(--color-primary-foreground, #fff);
58
- background-color: var(--color-primary, #3b82f6);
57
+ color: var(--rl-neutral-50);
58
+ background-color: var(--primary, #3b82f6);
59
59
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
60
60
  z-index: 1;
61
61
  }
@@ -67,7 +67,7 @@ const classes = stepsTheme(Astro.props)
67
67
  top: calc(1.75rem + 0.375rem);
68
68
  bottom: 0;
69
69
  width: 2px;
70
- background-color: var(--color-border, #e5e7eb);
70
+ background-color: var(--rl-neutral-200);
71
71
  }
72
72
 
73
73
  .rl-steps-list > li:last-child::after {
@@ -9,12 +9,13 @@ const {
9
9
  disabled = false,
10
10
  name,
11
11
  label,
12
+ theme,
12
13
  ...rest
13
14
  } = Astro.props as SwitchProps
14
15
 
15
16
  const classes = switchTheme(Astro.props);
16
17
  ---
17
- <label class={classes.root} data-slot="root">
18
+ <label class={classes.root} data-slot="root" data-theme={theme}>
18
19
  <input
19
20
  type="checkbox"
20
21
  class={classes.input}
@@ -24,10 +24,6 @@ export const switchTheme = defineTheme("switch", {
24
24
  checked: {
25
25
  true: { thumb: "translate-x-full" },
26
26
  false: { thumb: "translate-x-0" }
27
- },
28
- theme: {
29
- light: { root: "rl-light" },
30
- dark: { root: "rl-dark" }
31
27
  }
32
28
  },
33
29
  compoundVariants: [
@@ -27,7 +27,7 @@ export const tableTheme = defineTheme("table", {
27
27
  tr: "transition-colors data-[selected=true]:bg-primary/10 data-[expanded=true]:bg-muted/40 hover:bg-muted/30",
28
28
  th: "px-4 py-3.5 text-xs font-semibold text-muted text-left uppercase tracking-wider [&:has([role=checkbox])]:pe-0",
29
29
  td: "p-4 text-sm text-highlighted align-middle whitespace-nowrap [&:has([role=checkbox])]:pe-0",
30
- separator: "absolute z-10 start-0 w-full h-px bg-border",
30
+ separator: "absolute z-10 start-0 w-full h-px bg-neutral-200",
31
31
  empty: "py-8 text-center text-sm text-muted",
32
32
  loading: "py-8 text-center text-sm text-muted"
33
33
  },