@rimelight/ui 0.0.23 → 0.0.25
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 +8 -3
- package/src/components/Head.astro +199 -156
- package/src/components/astro/RLAAccordion.astro +22 -0
- package/src/components/astro/RLAButton.astro +104 -85
- package/src/components/astro/RLAFooter.astro +14 -40
- package/src/components/astro/RLAHeader.astro +18 -78
- package/src/components/astro/RLAIcon.astro +11 -36
- package/src/components/astro/RLALogo.astro +9 -44
- package/src/components/astro/RLAPlaceholder.astro +8 -33
- package/src/components/astro/RLAQuote.astro +15 -0
- package/src/components/astro/RLAScrollToTop.astro +171 -221
- package/src/components/astro/RLASection.astro +181 -0
- package/src/components/vue/RLVButton.vue +125 -50
- package/src/components/vue/RLVFooter.vue +12 -49
- package/src/components/vue/RLVHeader.vue +15 -98
- package/src/components/vue/RLVIcon.vue +11 -37
- package/src/components/vue/RLVLogo.vue +8 -56
- package/src/components/vue/RLVPlaceholder.vue +11 -33
- package/src/components/vue/RLVScrollToTop.vue +17 -88
- package/src/components/vue/RLVSection.vue +98 -0
- package/src/composables/index.ts +0 -1
- package/src/env.d.ts +5 -0
- package/src/integrations/ui.ts +2 -6
- package/src/nuxt-types.ts +3 -0
- package/src/plugins/index.ts +5 -2
- package/src/plugins/starlightAddons/index.ts +3 -64
- package/src/plugins/starlightDocsApi/components/ApiEmits.astro +46 -0
- package/src/plugins/starlightDocsApi/components/ApiProps.astro +47 -0
- package/src/plugins/starlightDocsApi/components/ApiSlots.astro +50 -0
- package/src/plugins/starlightDocsApi/components/ApiTheme.astro +27 -0
- package/src/plugins/starlightDocsApi/extract-vue.ts +286 -0
- package/src/plugins/starlightDocsApi/index.ts +265 -0
- package/src/plugins/starlightDocsApi/types.ts +40 -0
- package/src/plugins/starlightDocsApi/utils.ts +45 -0
- package/src/themes/button.theme.ts +179 -23
- package/src/themes/footer.theme.ts +4 -6
- package/src/themes/header.theme.ts +4 -28
- package/src/themes/icon.theme.ts +4 -2
- package/src/themes/index.ts +15 -20
- package/src/themes/logo.theme.ts +4 -2
- package/src/themes/placeholder.theme.ts +4 -6
- package/src/themes/scroll-to-top.theme.ts +4 -6
- package/src/themes/section.theme.ts +185 -0
- package/src/types/componentVariant.ts +10 -0
- package/src/types/index.ts +1 -0
- package/src/utils/defineTheme.ts +11 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/resolveClasses.ts +21 -0
- package/src/utils/useUi.ts +19 -0
- package/src/composables/useUi.ts +0 -27
- package/src/plugins/starlightAddons/Sidebar.astro +0 -89
- package/src/plugins/starlightAddons/data.ts +0 -39
- package/src/plugins/starlightAddons/libs/config.ts +0 -107
- package/src/plugins/starlightAddons/libs/content.ts +0 -20
- package/src/plugins/starlightAddons/libs/i18n.ts +0 -51
- package/src/plugins/starlightAddons/libs/locals.ts +0 -12
- package/src/plugins/starlightAddons/libs/pathname.ts +0 -22
- package/src/plugins/starlightAddons/libs/plugin.ts +0 -9
- package/src/plugins/starlightAddons/libs/sidebar.ts +0 -183
- package/src/plugins/starlightAddons/libs/vite.ts +0 -46
- package/src/plugins/starlightAddons/locals.d.ts +0 -14
- package/src/plugins/starlightAddons/middleware.ts +0 -132
- package/src/plugins/starlightAddons/overrides/Sidebar.astro +0 -8
- package/src/plugins/starlightAddons/schema.ts +0 -13
- package/src/plugins/starlightAddons/virtual.d.ts +0 -13
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export const buttonTheme = {
|
|
6
|
-
slots: ["root"],
|
|
1
|
+
import { defineTheme } from "../utils/defineTheme"
|
|
2
|
+
|
|
3
|
+
export default defineTheme({
|
|
4
|
+
slots: ["root", "label", "leadingIcon", "trailingIcon"],
|
|
7
5
|
base: {
|
|
8
6
|
root: [
|
|
9
7
|
"inline-flex items-center justify-center gap-4xs rounded-md font-medium ws-nowrap",
|
|
@@ -11,12 +9,16 @@ export const buttonTheme = {
|
|
|
11
9
|
"transition-all outline-none focus-visible:ring-3",
|
|
12
10
|
"disabled:pointer-events-none disabled:op-50",
|
|
13
11
|
"aria-invalid:border-error-500 aria-invalid:ring-error-500/20"
|
|
14
|
-
]
|
|
12
|
+
],
|
|
13
|
+
label: "truncate",
|
|
14
|
+
leadingIcon: "shrink-0",
|
|
15
|
+
trailingIcon: "shrink-0"
|
|
15
16
|
},
|
|
16
17
|
variants: {
|
|
17
18
|
variant: {
|
|
18
19
|
solid: { root: "b shadow-xs" },
|
|
19
|
-
|
|
20
|
+
outline: { root: "b shadow-xs border" },
|
|
21
|
+
soft: { root: "" },
|
|
20
22
|
subtle: { root: "" },
|
|
21
23
|
ghost: { root: "" },
|
|
22
24
|
link: { root: "p-0 h-auto" }
|
|
@@ -33,11 +35,44 @@ export const buttonTheme = {
|
|
|
33
35
|
source: { root: "" }
|
|
34
36
|
},
|
|
35
37
|
size: {
|
|
36
|
-
xs: {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
xs: {
|
|
39
|
+
root: "h-7 px-2xs text-xs [&_svg]:size-3.5",
|
|
40
|
+
leadingIcon: "[&_svg]:size-3.5",
|
|
41
|
+
trailingIcon: "[&_svg]:size-3.5"
|
|
42
|
+
},
|
|
43
|
+
sm: {
|
|
44
|
+
root: "h-8 px-xs text-sm [&_svg]:size-4",
|
|
45
|
+
leadingIcon: "[&_svg]:size-4",
|
|
46
|
+
trailingIcon: "[&_svg]:size-4"
|
|
47
|
+
},
|
|
48
|
+
md: {
|
|
49
|
+
root: "h-9 px-sm text-sm [&_svg]:size-4",
|
|
50
|
+
leadingIcon: "[&_svg]:size-4",
|
|
51
|
+
trailingIcon: "[&_svg]:size-4"
|
|
52
|
+
},
|
|
53
|
+
lg: {
|
|
54
|
+
root: "h-10 px-md text-base [&_svg]:size-4.5",
|
|
55
|
+
leadingIcon: "[&_svg]:size-4.5",
|
|
56
|
+
trailingIcon: "[&_svg]:size-4.5"
|
|
57
|
+
},
|
|
58
|
+
xl: {
|
|
59
|
+
root: "h-11 px-lg text-base [&_svg]:size-5",
|
|
60
|
+
leadingIcon: "[&_svg]:size-5",
|
|
61
|
+
trailingIcon: "[&_svg]:size-5"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
block: {
|
|
65
|
+
true: { root: "w-full justify-center", trailingIcon: "ms-auto" }
|
|
66
|
+
},
|
|
67
|
+
square: {
|
|
68
|
+
true: { root: "" }
|
|
69
|
+
},
|
|
70
|
+
leading: { true: {} },
|
|
71
|
+
trailing: { true: {} },
|
|
72
|
+
loading: { true: {} },
|
|
73
|
+
active: {
|
|
74
|
+
true: { root: "" },
|
|
75
|
+
false: { root: "" }
|
|
41
76
|
}
|
|
42
77
|
},
|
|
43
78
|
compoundVariants: [
|
|
@@ -105,63 +140,63 @@ export const buttonTheme = {
|
|
|
105
140
|
}
|
|
106
141
|
},
|
|
107
142
|
{
|
|
108
|
-
variant: "
|
|
143
|
+
variant: "outline",
|
|
109
144
|
color: "primary",
|
|
110
145
|
classNames: {
|
|
111
146
|
root: "border-primary/20 text-primary-600 bg-primary/5 hover:bg-primary/10 hover:border-primary/30 focus-visible:ring-primary/40"
|
|
112
147
|
}
|
|
113
148
|
},
|
|
114
149
|
{
|
|
115
|
-
variant: "
|
|
150
|
+
variant: "outline",
|
|
116
151
|
color: "secondary",
|
|
117
152
|
classNames: {
|
|
118
153
|
root: "border-secondary/20 text-secondary-600 bg-secondary/5 hover:bg-secondary/10 hover:border-secondary/30 focus-visible:ring-secondary/40"
|
|
119
154
|
}
|
|
120
155
|
},
|
|
121
156
|
{
|
|
122
|
-
variant: "
|
|
157
|
+
variant: "outline",
|
|
123
158
|
color: "info",
|
|
124
159
|
classNames: {
|
|
125
160
|
root: "border-info/20 text-info-600 bg-info/5 hover:bg-info/10 hover:border-info/30 focus-visible:ring-info/40"
|
|
126
161
|
}
|
|
127
162
|
},
|
|
128
163
|
{
|
|
129
|
-
variant: "
|
|
164
|
+
variant: "outline",
|
|
130
165
|
color: "success",
|
|
131
166
|
classNames: {
|
|
132
167
|
root: "border-success/20 text-success-600 bg-success/5 hover:bg-success/10 hover:border-success/30 focus-visible:ring-success/40"
|
|
133
168
|
}
|
|
134
169
|
},
|
|
135
170
|
{
|
|
136
|
-
variant: "
|
|
171
|
+
variant: "outline",
|
|
137
172
|
color: "warning",
|
|
138
173
|
classNames: {
|
|
139
174
|
root: "border-warning/20 text-warning-600 bg-warning/5 hover:bg-warning/10 hover:border-warning/30 focus-visible:ring-warning/40"
|
|
140
175
|
}
|
|
141
176
|
},
|
|
142
177
|
{
|
|
143
|
-
variant: "
|
|
178
|
+
variant: "outline",
|
|
144
179
|
color: "error",
|
|
145
180
|
classNames: {
|
|
146
181
|
root: "border-error/20 text-error-600 bg-error/5 hover:bg-error/10 hover:border-error/30 focus-visible:ring-error/40"
|
|
147
182
|
}
|
|
148
183
|
},
|
|
149
184
|
{
|
|
150
|
-
variant: "
|
|
185
|
+
variant: "outline",
|
|
151
186
|
color: "commentary",
|
|
152
187
|
classNames: {
|
|
153
188
|
root: "border-commentary/20 text-commentary-600 bg-commentary/5 hover:bg-commentary/10 hover:border-commentary/30 focus-visible:ring-commentary/40"
|
|
154
189
|
}
|
|
155
190
|
},
|
|
156
191
|
{
|
|
157
|
-
variant: "
|
|
192
|
+
variant: "outline",
|
|
158
193
|
color: "ideation",
|
|
159
194
|
classNames: {
|
|
160
195
|
root: "border-ideation/20 text-ideation-600 bg-ideation/5 hover:bg-ideation/10 hover:border-ideation/30 focus-visible:ring-ideation/40"
|
|
161
196
|
}
|
|
162
197
|
},
|
|
163
198
|
{
|
|
164
|
-
variant: "
|
|
199
|
+
variant: "outline",
|
|
165
200
|
color: "source",
|
|
166
201
|
classNames: {
|
|
167
202
|
root: "border-source/20 text-source-600 bg-source/5 hover:bg-source/10 hover:border-source/30 focus-visible:ring-source/40"
|
|
@@ -355,6 +390,127 @@ export const buttonTheme = {
|
|
|
355
390
|
classNames: {
|
|
356
391
|
root: "text-source-600 hover:underline hover:decoration-source/30"
|
|
357
392
|
}
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
variant: "soft",
|
|
396
|
+
color: "primary",
|
|
397
|
+
classNames: {
|
|
398
|
+
root: "text-primary-600 bg-primary/10 hover:bg-primary/20 focus-visible:ring-primary/40"
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
variant: "soft",
|
|
403
|
+
color: "secondary",
|
|
404
|
+
classNames: {
|
|
405
|
+
root: "text-secondary-600 bg-secondary/10 hover:bg-secondary/20 focus-visible:ring-secondary/40"
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
variant: "soft",
|
|
410
|
+
color: "info",
|
|
411
|
+
classNames: {
|
|
412
|
+
root: "text-info-600 bg-info/10 hover:bg-info/20 focus-visible:ring-info/40"
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
variant: "soft",
|
|
417
|
+
color: "success",
|
|
418
|
+
classNames: {
|
|
419
|
+
root: "text-success-600 bg-success/10 hover:bg-success/20 focus-visible:ring-success/40"
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
variant: "soft",
|
|
424
|
+
color: "warning",
|
|
425
|
+
classNames: {
|
|
426
|
+
root: "text-warning-600 bg-warning/10 hover:bg-warning/20 focus-visible:ring-warning/40"
|
|
427
|
+
}
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
variant: "soft",
|
|
431
|
+
color: "error",
|
|
432
|
+
classNames: {
|
|
433
|
+
root: "text-error-600 bg-error/10 hover:bg-error/20 focus-visible:ring-error/40"
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
variant: "soft",
|
|
438
|
+
color: "commentary",
|
|
439
|
+
classNames: {
|
|
440
|
+
root: "text-commentary-600 bg-commentary/10 hover:bg-commentary/20 focus-visible:ring-commentary/40"
|
|
441
|
+
}
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
variant: "soft",
|
|
445
|
+
color: "ideation",
|
|
446
|
+
classNames: {
|
|
447
|
+
root: "text-ideation-600 bg-ideation/10 hover:bg-ideation/20 focus-visible:ring-ideation/40"
|
|
448
|
+
}
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
variant: "soft",
|
|
452
|
+
color: "source",
|
|
453
|
+
classNames: {
|
|
454
|
+
root: "text-source-600 bg-source/10 hover:bg-source/20 focus-visible:ring-source/40"
|
|
455
|
+
}
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
square: true,
|
|
459
|
+
size: "xs",
|
|
460
|
+
classNames: {
|
|
461
|
+
root: "p-1 w-7"
|
|
462
|
+
}
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
square: true,
|
|
466
|
+
size: "sm",
|
|
467
|
+
classNames: {
|
|
468
|
+
root: "p-1.5 w-8"
|
|
469
|
+
}
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
square: true,
|
|
473
|
+
size: "md",
|
|
474
|
+
classNames: {
|
|
475
|
+
root: "p-1.5 w-9"
|
|
476
|
+
}
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
square: true,
|
|
480
|
+
size: "lg",
|
|
481
|
+
classNames: {
|
|
482
|
+
root: "p-2 w-10"
|
|
483
|
+
}
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
square: true,
|
|
487
|
+
size: "xl",
|
|
488
|
+
classNames: {
|
|
489
|
+
root: "p-2 w-11"
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
loading: true,
|
|
494
|
+
leading: true,
|
|
495
|
+
classNames: {
|
|
496
|
+
leadingIcon: "animate-spin"
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
loading: true,
|
|
501
|
+
leading: false,
|
|
502
|
+
trailing: true,
|
|
503
|
+
classNames: {
|
|
504
|
+
trailingIcon: "animate-spin"
|
|
505
|
+
}
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
loading: true,
|
|
509
|
+
leading: false,
|
|
510
|
+
trailing: false,
|
|
511
|
+
classNames: {
|
|
512
|
+
trailingIcon: "animate-spin"
|
|
513
|
+
}
|
|
358
514
|
}
|
|
359
515
|
],
|
|
360
516
|
defaultVariants: {
|
|
@@ -362,4 +518,4 @@ export const buttonTheme = {
|
|
|
362
518
|
color: "primary",
|
|
363
519
|
size: "md"
|
|
364
520
|
}
|
|
365
|
-
}
|
|
521
|
+
})
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
export const footerTheme = {
|
|
1
|
+
import { defineTheme } from "../utils/defineTheme"
|
|
2
|
+
|
|
3
|
+
export default defineTheme({
|
|
6
4
|
slots: ["root", "container", "left", "center", "right"],
|
|
7
5
|
base: {
|
|
8
6
|
root: "py-8 lg:py-12",
|
|
@@ -26,4 +24,4 @@ export const footerTheme = {
|
|
|
26
24
|
defaultVariants: {
|
|
27
25
|
contain: false
|
|
28
26
|
}
|
|
29
|
-
}
|
|
27
|
+
})
|
|
@@ -1,25 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
* Slots:
|
|
6
|
-
*
|
|
7
|
-
* - `root` — the `<header>` element
|
|
8
|
-
* - `content` — inner wrapper div used for height measurement (fixed/hideOnScroll mode)
|
|
9
|
-
* - `container` — max-width flex row
|
|
10
|
-
* - `left` — left region
|
|
11
|
-
* - `center` — center region
|
|
12
|
-
* - `right` — right region
|
|
13
|
-
*
|
|
14
|
-
* Variants:
|
|
15
|
-
*
|
|
16
|
-
* - `contain` — constrains container to max-w-7xl
|
|
17
|
-
* - `sticky` — sticky positioning (ignored when `fixed` variant is true)
|
|
18
|
-
* - `fixed` — position: fixed with left/right 0 and smooth top/opacity transition; used for stacked
|
|
19
|
-
* header layers. Top offset and z-index are applied via inline style (top prop + stackIndex prop)
|
|
20
|
-
* rather than theme classes.
|
|
21
|
-
*/
|
|
22
|
-
export const headerTheme = {
|
|
1
|
+
import { defineTheme } from "../utils/defineTheme"
|
|
2
|
+
|
|
3
|
+
export default defineTheme({
|
|
23
4
|
slots: ["root", "content", "container", "left", "center", "right"],
|
|
24
5
|
base: {
|
|
25
6
|
root: "w-full",
|
|
@@ -47,11 +28,6 @@ export const headerTheme = {
|
|
|
47
28
|
root: "relative"
|
|
48
29
|
}
|
|
49
30
|
},
|
|
50
|
-
/**
|
|
51
|
-
* Fixed-layer mode. When true, overrides sticky/relative positioning with `position: fixed` and
|
|
52
|
-
* enables smooth transitions. `top` and `z-index` are applied via inline `:style` on the
|
|
53
|
-
* component.
|
|
54
|
-
*/
|
|
55
31
|
fixed: {
|
|
56
32
|
true: {
|
|
57
33
|
root: "fixed left-0 right-0 transition-[top,opacity] duration-200 ease-in-out"
|
|
@@ -64,4 +40,4 @@ export const headerTheme = {
|
|
|
64
40
|
sticky: true,
|
|
65
41
|
fixed: false
|
|
66
42
|
}
|
|
67
|
-
}
|
|
43
|
+
})
|
package/src/themes/icon.theme.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { defineTheme } from "../utils/defineTheme"
|
|
2
|
+
|
|
3
|
+
export default defineTheme({
|
|
2
4
|
slots: ["root"],
|
|
3
5
|
base: {
|
|
4
6
|
root: ["inline-block", "align-middle"]
|
|
@@ -15,4 +17,4 @@ export const iconTheme = {
|
|
|
15
17
|
defaultVariants: {
|
|
16
18
|
size: "md"
|
|
17
19
|
}
|
|
18
|
-
}
|
|
20
|
+
})
|
package/src/themes/index.ts
CHANGED
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { footerTheme } from "./footer.theme"
|
|
3
|
-
import { scrollToTopTheme } from "./scroll-to-top.theme"
|
|
4
|
-
import { buttonTheme } from "./button.theme"
|
|
5
|
-
import { logoTheme } from "./logo.theme"
|
|
6
|
-
import { iconTheme } from "./icon.theme"
|
|
7
|
-
import { placeholderTheme } from "./placeholder.theme"
|
|
1
|
+
import type { ComponentTheme } from "../utils/defineTheme"
|
|
8
2
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
3
|
+
const themeModules = import.meta.glob<{ default: ComponentTheme }>("./*.theme.ts", { eager: true })
|
|
4
|
+
|
|
5
|
+
function kebabToCamel(str: string): string {
|
|
6
|
+
return str.replace(/-([a-z])/g, (_, char) => char.toUpperCase())
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function themeNameFromFile(path: string): string {
|
|
10
|
+
const fileName = path.replace(/^\.\/|\.theme\.ts$/g, "")
|
|
11
|
+
return kebabToCamel(fileName)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const defaultUIConfig: Record<string, ComponentTheme> = Object.fromEntries(
|
|
15
|
+
Object.entries(themeModules).map(([path, module]) => [themeNameFromFile(path), module.default])
|
|
16
|
+
)
|
|
22
17
|
|
|
23
18
|
export type DefaultUIConfig = typeof defaultUIConfig
|
package/src/themes/logo.theme.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { defineTheme } from "../utils/defineTheme"
|
|
2
|
+
|
|
3
|
+
export default defineTheme({
|
|
2
4
|
slots: ["root"],
|
|
3
5
|
base: {
|
|
4
6
|
root: "flex items-center justify-center transition-opacity hover:opacity-80 shrink-0 select-none overflow-hidden"
|
|
5
7
|
},
|
|
6
8
|
variants: {},
|
|
7
9
|
defaultVariants: {}
|
|
8
|
-
}
|
|
10
|
+
})
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
export const placeholderTheme = {
|
|
1
|
+
import { defineTheme } from "../utils/defineTheme"
|
|
2
|
+
|
|
3
|
+
export default defineTheme({
|
|
6
4
|
slots: ["base", "svg"],
|
|
7
5
|
base: {
|
|
8
6
|
base: "relative flex items-center justify-center overflow-hidden rounded-sm border-1 border-dashed border-primary px-4 opacity-75",
|
|
@@ -11,4 +9,4 @@ export const placeholderTheme = {
|
|
|
11
9
|
variants: {},
|
|
12
10
|
compoundVariants: [],
|
|
13
11
|
defaultVariants: {}
|
|
14
|
-
}
|
|
12
|
+
})
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
export const scrollToTopTheme = {
|
|
1
|
+
import { defineTheme } from "../utils/defineTheme"
|
|
2
|
+
|
|
3
|
+
export default defineTheme({
|
|
6
4
|
slots: ["root", "button", "progressBase", "svg", "iconContainer", "icon"],
|
|
7
5
|
base: {
|
|
8
6
|
root: "fixed bottom-6 right-6 z-50",
|
|
@@ -45,4 +43,4 @@ export const scrollToTopTheme = {
|
|
|
45
43
|
defaultVariants: {
|
|
46
44
|
color: "primary"
|
|
47
45
|
}
|
|
48
|
-
}
|
|
46
|
+
})
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { defineTheme } from "../utils/defineTheme"
|
|
2
|
+
|
|
3
|
+
export default defineTheme({
|
|
4
|
+
slots: [
|
|
5
|
+
"root",
|
|
6
|
+
"background",
|
|
7
|
+
"container",
|
|
8
|
+
"wrapper",
|
|
9
|
+
"header",
|
|
10
|
+
"leading",
|
|
11
|
+
"leadingIcon",
|
|
12
|
+
"headline",
|
|
13
|
+
"title",
|
|
14
|
+
"description",
|
|
15
|
+
"body",
|
|
16
|
+
"features",
|
|
17
|
+
"footer",
|
|
18
|
+
"links"
|
|
19
|
+
],
|
|
20
|
+
base: {
|
|
21
|
+
root: "relative isolate",
|
|
22
|
+
background: "absolute inset-0 -z-1 overflow-hidden",
|
|
23
|
+
container: "flex flex-col lg:grid gap-8 sm:gap-16",
|
|
24
|
+
wrapper: "",
|
|
25
|
+
header: "",
|
|
26
|
+
leading: "flex items-center mb-6",
|
|
27
|
+
leadingIcon: "size-10 shrink-0 text-primary",
|
|
28
|
+
headline: "mb-3",
|
|
29
|
+
title: "text-pretty tracking-tight font-bold text-highlighted",
|
|
30
|
+
description: "text-muted",
|
|
31
|
+
body: "mt-8",
|
|
32
|
+
features: "grid gap-8",
|
|
33
|
+
footer: "mt-8",
|
|
34
|
+
links: "flex flex-wrap gap-x-6 gap-y-3"
|
|
35
|
+
},
|
|
36
|
+
variants: {
|
|
37
|
+
variant: {
|
|
38
|
+
default: {
|
|
39
|
+
container: "py-16 sm:py-24 lg:py-32",
|
|
40
|
+
title: "text-3xl sm:text-4xl lg:text-5xl",
|
|
41
|
+
description: "text-base sm:text-lg",
|
|
42
|
+
features: "sm:grid-cols-2 lg:grid-cols-3"
|
|
43
|
+
},
|
|
44
|
+
hero: {
|
|
45
|
+
container: "py-24 sm:py-32 lg:py-40 gap-16 sm:gap-y-24",
|
|
46
|
+
title: "text-5xl sm:text-7xl",
|
|
47
|
+
description: "text-lg sm:text-xl/8",
|
|
48
|
+
headline: "mb-4",
|
|
49
|
+
leading: "mb-6",
|
|
50
|
+
body: "mt-10",
|
|
51
|
+
footer: "mt-10",
|
|
52
|
+
links: "mt-10"
|
|
53
|
+
},
|
|
54
|
+
cta: {
|
|
55
|
+
root: "rounded-xl overflow-hidden",
|
|
56
|
+
container: "px-6 py-12 sm:px-12 sm:py-24 lg:px-16 lg:py-24 gap-8 sm:gap-16",
|
|
57
|
+
title: "text-3xl sm:text-4xl",
|
|
58
|
+
description: "text-base sm:text-lg"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
orientation: {
|
|
62
|
+
horizontal: {
|
|
63
|
+
container: "lg:grid-cols-2 lg:items-center",
|
|
64
|
+
description: "text-pretty",
|
|
65
|
+
features: "gap-4"
|
|
66
|
+
},
|
|
67
|
+
vertical: {
|
|
68
|
+
container: "",
|
|
69
|
+
headline: "justify-center",
|
|
70
|
+
leading: "justify-center",
|
|
71
|
+
title: "text-center",
|
|
72
|
+
description: "text-center text-balance",
|
|
73
|
+
links: "justify-center",
|
|
74
|
+
features: ""
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
reverse: {
|
|
78
|
+
true: {
|
|
79
|
+
wrapper: "order-last"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
ctaVariant: {
|
|
83
|
+
solid: {
|
|
84
|
+
root: "bg-inverted text-inverted",
|
|
85
|
+
title: "text-inverted",
|
|
86
|
+
description: "text-dimmed"
|
|
87
|
+
},
|
|
88
|
+
outline: {
|
|
89
|
+
root: "bg-default ring ring-default",
|
|
90
|
+
description: "text-muted"
|
|
91
|
+
},
|
|
92
|
+
soft: {
|
|
93
|
+
root: "bg-elevated/50",
|
|
94
|
+
description: "text-toned"
|
|
95
|
+
},
|
|
96
|
+
subtle: {
|
|
97
|
+
root: "bg-elevated/50 ring ring-default",
|
|
98
|
+
description: "text-toned"
|
|
99
|
+
},
|
|
100
|
+
naked: {
|
|
101
|
+
description: "text-muted"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
headline: {
|
|
105
|
+
true: {
|
|
106
|
+
headline: "font-semibold text-primary flex items-center gap-1.5"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
title: {
|
|
110
|
+
true: {
|
|
111
|
+
description: "mt-6"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
description: {
|
|
115
|
+
true: {}
|
|
116
|
+
},
|
|
117
|
+
body: {
|
|
118
|
+
true: {}
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
compoundVariants: [
|
|
122
|
+
{
|
|
123
|
+
variant: "default",
|
|
124
|
+
orientation: "vertical",
|
|
125
|
+
title: true,
|
|
126
|
+
classNames: {
|
|
127
|
+
body: "mt-16"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
variant: "default",
|
|
132
|
+
orientation: "vertical",
|
|
133
|
+
description: true,
|
|
134
|
+
classNames: {
|
|
135
|
+
body: "mt-16"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
variant: "default",
|
|
140
|
+
orientation: "vertical",
|
|
141
|
+
body: true,
|
|
142
|
+
classNames: {
|
|
143
|
+
footer: "mt-16"
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
variant: "cta",
|
|
148
|
+
ctaVariant: "outline",
|
|
149
|
+
classNames: {
|
|
150
|
+
root: "bg-default ring ring-default",
|
|
151
|
+
description: "text-muted"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
variant: "cta",
|
|
156
|
+
ctaVariant: "solid",
|
|
157
|
+
classNames: {
|
|
158
|
+
root: "bg-inverted text-inverted",
|
|
159
|
+
title: "text-inverted",
|
|
160
|
+
description: "text-dimmed"
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
variant: "cta",
|
|
165
|
+
ctaVariant: "soft",
|
|
166
|
+
classNames: {
|
|
167
|
+
root: "bg-elevated/50",
|
|
168
|
+
description: "text-toned"
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
variant: "cta",
|
|
173
|
+
ctaVariant: "subtle",
|
|
174
|
+
classNames: {
|
|
175
|
+
root: "bg-elevated/50 ring ring-default",
|
|
176
|
+
description: "text-toned"
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
],
|
|
180
|
+
defaultVariants: {
|
|
181
|
+
variant: "default",
|
|
182
|
+
orientation: "vertical",
|
|
183
|
+
ctaVariant: "outline"
|
|
184
|
+
}
|
|
185
|
+
})
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type ComponentVariants<T extends { variants?: Record<string, Record<string, unknown>> }> =
|
|
2
|
+
T["variants"] extends Record<string, Record<string, unknown>>
|
|
3
|
+
? {
|
|
4
|
+
[K in keyof T["variants"]]?: T["variants"][K] extends { true: unknown; false: unknown }
|
|
5
|
+
? boolean
|
|
6
|
+
: T["variants"][K] extends { true: unknown }
|
|
7
|
+
? boolean
|
|
8
|
+
: keyof T["variants"][K]
|
|
9
|
+
}
|
|
10
|
+
: never
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./componentVariant"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ComponentTheme {
|
|
2
|
+
slots: string[]
|
|
3
|
+
base: Record<string, string | string[]>
|
|
4
|
+
variants?: Record<string, Record<string, Record<string, string | string[]>>>
|
|
5
|
+
compoundVariants?: Record<string, unknown>[]
|
|
6
|
+
defaultVariants?: Record<string, unknown>
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function defineTheme<const T extends ComponentTheme>(theme: T): T {
|
|
10
|
+
return theme
|
|
11
|
+
}
|
package/src/utils/index.ts
CHANGED