@rimelight/ui 0.0.26 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +9 -7
- package/src/components/astro/RLAButton.astro +108 -104
- package/src/components/astro/RLAEmbedYoutube.astro +219 -0
- package/src/components/astro/RLASection.astro +0 -10
- package/src/env.d.ts +1 -1
- package/src/integrations/ui.ts +7 -1
- package/src/presets/index.ts +53 -193
- package/src/themes/button.theme.ts +49 -389
- package/src/themes/embedYoutube.theme.ts +19 -0
- package/src/themes/section.theme.ts +1 -1
package/src/presets/index.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { dirname, join } from "node:path"
|
|
2
|
+
import { fileURLToPath } from "node:url"
|
|
1
3
|
import {
|
|
2
4
|
definePreset,
|
|
3
5
|
presetTypography,
|
|
@@ -7,9 +9,55 @@ import {
|
|
|
7
9
|
transformerVariantGroup
|
|
8
10
|
} from "unocss"
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
13
|
+
const uiSrcGlob = join(__dirname, "../**/*.{js,ts,jsx,tsx,vue,svelte,astro}")
|
|
14
|
+
const uiFilesystemGlob = join(__dirname, "../**/*")
|
|
15
|
+
|
|
16
|
+
const createScale = (colorName: string) => ({
|
|
17
|
+
DEFAULT: `var(--${colorName})`,
|
|
18
|
+
foreground: `var(--${colorName}-foreground)`,
|
|
19
|
+
accent: `var(--${colorName}-accent)`,
|
|
20
|
+
"50": `var(--color-${colorName}-50)`,
|
|
21
|
+
"100": `var(--color-${colorName}-100)`,
|
|
22
|
+
"200": `var(--color-${colorName}-200)`,
|
|
23
|
+
"300": `var(--color-${colorName}-300)`,
|
|
24
|
+
"400": `var(--color-${colorName}-400)`,
|
|
25
|
+
"500": `var(--color-${colorName}-500)`,
|
|
26
|
+
"600": `var(--color-${colorName}-600)`,
|
|
27
|
+
"700": `var(--color-${colorName}-700)`,
|
|
28
|
+
"800": `var(--color-${colorName}-800)`,
|
|
29
|
+
"900": `var(--color-${colorName}-900)`,
|
|
30
|
+
"950": `var(--color-${colorName}-950)`
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
export interface RimelightPresetOptions {
|
|
34
|
+
colors?: string[]
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export default definePreset((options?: RimelightPresetOptions) => {
|
|
38
|
+
const customColors = options?.colors || []
|
|
39
|
+
const coreColors = ["primary", "secondary", "info", "success", "warning", "error", "commentary", "ideation", "source"]
|
|
40
|
+
const allColors = [...new Set([...coreColors, ...customColors])]
|
|
41
|
+
|
|
42
|
+
const safelist = allColors.flatMap(color => [
|
|
43
|
+
`bg-${color}-500`,
|
|
44
|
+
`hover:bg-${color}-600`,
|
|
45
|
+
`focus-visible:ring-${color}-500/50`,
|
|
46
|
+
`border-${color}-500/20`,
|
|
47
|
+
`text-${color}-600`,
|
|
48
|
+
`bg-${color}-500/5`,
|
|
49
|
+
`hover:bg-${color}-500/10`,
|
|
50
|
+
`hover:border-${color}-500/30`,
|
|
51
|
+
`focus-visible:ring-${color}-500/40`,
|
|
52
|
+
`bg-${color}-500/10`,
|
|
53
|
+
`hover:bg-${color}-500/20`,
|
|
54
|
+
`hover:underline`,
|
|
55
|
+
`hover:decoration-${color}-300`
|
|
56
|
+
])
|
|
57
|
+
|
|
11
58
|
return {
|
|
12
59
|
name: "rimelight-ui",
|
|
60
|
+
safelist,
|
|
13
61
|
presets: [
|
|
14
62
|
presetWind4(),
|
|
15
63
|
presetTypography({
|
|
@@ -47,10 +95,11 @@ export default definePreset(() => {
|
|
|
47
95
|
include: [
|
|
48
96
|
/\.(vue|svelte|[jt]sx|mdx?|astro|elm|php|phtml|html)($|\?)/,
|
|
49
97
|
"src/**/*.{js,ts,jsx,tsx,vue,svelte,astro}",
|
|
98
|
+
uiSrcGlob,
|
|
50
99
|
"../ui/src/**/*.{js,ts,jsx,tsx,vue,svelte,astro}"
|
|
51
100
|
]
|
|
52
101
|
},
|
|
53
|
-
filesystem: ["../ui/src/**/*", "src/components/**/*", "src/pages/**/*"]
|
|
102
|
+
filesystem: [uiFilesystemGlob, "../ui/src/**/*", "src/components/**/*", "src/pages/**/*"]
|
|
54
103
|
},
|
|
55
104
|
|
|
56
105
|
shortcuts: {
|
|
@@ -94,16 +143,7 @@ export default definePreset(() => {
|
|
|
94
143
|
DEFAULT: "var(--popover)",
|
|
95
144
|
foreground: "var(--popover-foreground)"
|
|
96
145
|
},
|
|
97
|
-
|
|
98
|
-
DEFAULT: "var(--primary)",
|
|
99
|
-
foreground: "var(--primary-foreground)",
|
|
100
|
-
accent: "var(--primary-accent)"
|
|
101
|
-
},
|
|
102
|
-
"secondary": {
|
|
103
|
-
DEFAULT: "var(--secondary)",
|
|
104
|
-
foreground: "var(--secondary-foreground)",
|
|
105
|
-
accent: "var(--secondary-accent)"
|
|
106
|
-
},
|
|
146
|
+
...Object.fromEntries(allColors.map(color => [color, createScale(color)])),
|
|
107
147
|
"muted": {
|
|
108
148
|
DEFAULT: "var(--muted)",
|
|
109
149
|
foreground: "var(--muted-foreground)"
|
|
@@ -112,34 +152,6 @@ export default definePreset(() => {
|
|
|
112
152
|
DEFAULT: "var(--accent)",
|
|
113
153
|
foreground: "var(--accent-foreground)"
|
|
114
154
|
},
|
|
115
|
-
"info": {
|
|
116
|
-
DEFAULT: "var(--info)",
|
|
117
|
-
foreground: "var(--info-foreground)"
|
|
118
|
-
},
|
|
119
|
-
"success": {
|
|
120
|
-
DEFAULT: "var(--success)",
|
|
121
|
-
foreground: "var(--success-foreground)"
|
|
122
|
-
},
|
|
123
|
-
"warning": {
|
|
124
|
-
DEFAULT: "var(--warning)",
|
|
125
|
-
foreground: "var(--warning-foreground)"
|
|
126
|
-
},
|
|
127
|
-
"error": {
|
|
128
|
-
DEFAULT: "var(--error)",
|
|
129
|
-
foreground: "var(--error-foreground)"
|
|
130
|
-
},
|
|
131
|
-
"commentary": {
|
|
132
|
-
DEFAULT: "var(--commentary)",
|
|
133
|
-
foreground: "var(--commentary-foreground)"
|
|
134
|
-
},
|
|
135
|
-
"ideation": {
|
|
136
|
-
DEFAULT: "var(--ideation)",
|
|
137
|
-
foreground: "var(--ideation-foreground)"
|
|
138
|
-
},
|
|
139
|
-
"source": {
|
|
140
|
-
DEFAULT: "var(--source)",
|
|
141
|
-
foreground: "var(--source-foreground)"
|
|
142
|
-
},
|
|
143
155
|
"border": "var(--border)",
|
|
144
156
|
"input": "var(--input)",
|
|
145
157
|
"outline": "var(--outline)",
|
|
@@ -209,159 +221,7 @@ export default definePreset(() => {
|
|
|
209
221
|
}
|
|
210
222
|
},
|
|
211
223
|
|
|
212
|
-
preflights: [
|
|
213
|
-
{
|
|
214
|
-
getCSS: () => `
|
|
215
|
-
:root {
|
|
216
|
-
--background: #ffffff;
|
|
217
|
-
--foreground: #030712;
|
|
218
|
-
--card: #ffffff;
|
|
219
|
-
--card-foreground: #030712;
|
|
220
|
-
--popover: #ffffff;
|
|
221
|
-
--popover-foreground: #030712;
|
|
222
|
-
--primary: #f97316;
|
|
223
|
-
--primary-foreground: #f9fafb;
|
|
224
|
-
--primary-accent: #ea580c;
|
|
225
|
-
--secondary: #8b5cf6;
|
|
226
|
-
--secondary-foreground: #f9fafb;
|
|
227
|
-
--secondary-accent: #7c3aed;
|
|
228
|
-
--muted: #f3f4f6;
|
|
229
|
-
--muted-foreground: #4b5563;
|
|
230
|
-
--accent: #f3f4f6;
|
|
231
|
-
--accent-foreground: #111827;
|
|
232
|
-
--info: #3b82f6;
|
|
233
|
-
--info-foreground: #ffffff;
|
|
234
|
-
--success: #22c55e;
|
|
235
|
-
--success-foreground: #ffffff;
|
|
236
|
-
--warning: #f59e0b;
|
|
237
|
-
--warning-foreground: #000000;
|
|
238
|
-
--error: #ef4444;
|
|
239
|
-
--error-foreground: #f9fafb;
|
|
240
|
-
--commentary: #ec4899;
|
|
241
|
-
--commentary-foreground: #f9fafb;
|
|
242
|
-
--ideation: #8b5cf6;
|
|
243
|
-
--ideation-foreground: #f9fafb;
|
|
244
|
-
--source: #38bdf8;
|
|
245
|
-
--source-foreground: #0f172a;
|
|
246
|
-
--border: #e5e7eb;
|
|
247
|
-
--input: #e5e7eb;
|
|
248
|
-
--outline: #9ca3af;
|
|
249
|
-
--ring: #9ca3af;
|
|
250
|
-
--radius: 0.625rem;
|
|
251
|
-
--sidebar: #f9fafb;
|
|
252
|
-
--sidebar-foreground: #030712;
|
|
253
|
-
--sidebar-primary: #1d4ed8;
|
|
254
|
-
--sidebar-primary-foreground: #f9fafb;
|
|
255
|
-
--sidebar-accent: #f3f4f6;
|
|
256
|
-
--sidebar-accent-foreground: #111827;
|
|
257
|
-
--sidebar-border: #e5e7eb;
|
|
258
|
-
--sidebar-ring: #9ca3af;
|
|
259
|
-
--chart-1: #3b82f6;
|
|
260
|
-
--chart-2: #6366f1;
|
|
261
|
-
--chart-3: #8b5cf6;
|
|
262
|
-
--chart-4: #a855f7;
|
|
263
|
-
--chart-5: #ec4899;
|
|
264
|
-
--destructive: #ef4444;
|
|
265
|
-
--color-surface: #ffffff;
|
|
266
|
-
--color-muted-strong: #e5e7eb;
|
|
267
|
-
--color-foreground-secondary: #4b5563;
|
|
268
|
-
--color-foreground-tertiary: #6b7280;
|
|
269
|
-
--color-placeholder: #9ca3af;
|
|
270
|
-
--color-input-border: #d1d5db;
|
|
271
|
-
--color-hover: #f3f4f6;
|
|
272
|
-
--color-destructive-subtle: #fef2f2;
|
|
273
|
-
--color-accent-subtle: #eff6ff;
|
|
274
|
-
--font-sans: "Noto Sans", sans-serif;
|
|
275
|
-
--font-serif: "Noto Serif", serif;
|
|
276
|
-
--font-mono: "Noto Sans Mono", monospace;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
.dark {
|
|
280
|
-
--background: #030712;
|
|
281
|
-
--foreground: #f9fafb;
|
|
282
|
-
--card: #111827;
|
|
283
|
-
--card-foreground: #f9fafb;
|
|
284
|
-
--popover: #1f2937;
|
|
285
|
-
--popover-foreground: #f9fafb;
|
|
286
|
-
--primary: #f97316;
|
|
287
|
-
--primary-foreground: #f9fafb;
|
|
288
|
-
--primary-accent: #fb923c;
|
|
289
|
-
--secondary: #8b5cf6;
|
|
290
|
-
--secondary-foreground: #f9fafb;
|
|
291
|
-
--secondary-accent: #a78bfa;
|
|
292
|
-
--muted: #1f2937;
|
|
293
|
-
--muted-foreground: #9ca3af;
|
|
294
|
-
--accent: #374151;
|
|
295
|
-
--accent-foreground: #f3f4f6;
|
|
296
|
-
--info: #3b82f6;
|
|
297
|
-
--info-foreground: #ffffff;
|
|
298
|
-
--success: #22c55e;
|
|
299
|
-
--success-foreground: #ffffff;
|
|
300
|
-
--warning: #f59e0b;
|
|
301
|
-
--warning-foreground: #000000;
|
|
302
|
-
--error: #ef4444;
|
|
303
|
-
--error-foreground: #f9fafb;
|
|
304
|
-
--commentary: #f472b6;
|
|
305
|
-
--commentary-foreground: #0f172a;
|
|
306
|
-
--ideation: #a78bfa;
|
|
307
|
-
--ideation-foreground: #0f172a;
|
|
308
|
-
--source: #7dd3fc;
|
|
309
|
-
--source-foreground: #0f172a;
|
|
310
|
-
--border: rgba(249, 250, 251, 0.1);
|
|
311
|
-
--input: rgba(249, 250, 251, 0.15);
|
|
312
|
-
--outline: #6b7280;
|
|
313
|
-
--ring: #6b7280;
|
|
314
|
-
--sidebar: #111827;
|
|
315
|
-
--sidebar-foreground: #f9fafb;
|
|
316
|
-
--sidebar-primary: #1d4ed8;
|
|
317
|
-
--sidebar-primary-foreground: #f9fafb;
|
|
318
|
-
--sidebar-accent: #1f2937;
|
|
319
|
-
--sidebar-accent-foreground: #f3f4f6;
|
|
320
|
-
--sidebar-border: #1f2937;
|
|
321
|
-
--sidebar-ring: #6b7280;
|
|
322
|
-
--chart-1: #60a5fa;
|
|
323
|
-
--chart-2: #818cf8;
|
|
324
|
-
--chart-3: #a78bfa;
|
|
325
|
-
--chart-4: #c084fc;
|
|
326
|
-
--chart-5: #f472b6;
|
|
327
|
-
--destructive: #f87171;
|
|
328
|
-
--color-surface: #1f2937;
|
|
329
|
-
--color-muted-strong: #374151;
|
|
330
|
-
--color-foreground-secondary: #d1d5db;
|
|
331
|
-
--color-foreground-tertiary: #9ca3af;
|
|
332
|
-
--color-placeholder: #6b7280;
|
|
333
|
-
--color-input-border: #4b5563;
|
|
334
|
-
--color-hover: #374151;
|
|
335
|
-
--color-destructive-subtle: #451a1a;
|
|
336
|
-
--color-accent-subtle: #1e293b;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
* {
|
|
340
|
-
border-color: var(--border);
|
|
341
|
-
outline-color: rgba(156, 163, 175, 0.5);
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
body {
|
|
345
|
-
background-color: var(--background);
|
|
346
|
-
color: var(--foreground);
|
|
347
|
-
font-family: var(--font-sans);
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
button {
|
|
351
|
-
cursor: pointer;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
::selection {
|
|
355
|
-
background-color: var(--primary);
|
|
356
|
-
color: var(--primary-foreground);
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
@view-transition {
|
|
360
|
-
navigation: auto;
|
|
361
|
-
}
|
|
362
|
-
`
|
|
363
|
-
}
|
|
364
|
-
],
|
|
224
|
+
preflights: [],
|
|
365
225
|
|
|
366
226
|
async configResolved(config) {
|
|
367
227
|
if (process.env.NODE_ENV === "development" && !process.env.UNO_CONFIG_LOGGED) {
|