@rimelight/ui 0.0.39 → 0.0.40
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 +1 -1
- package/src/components/button/RLAButton.astro +2 -0
- package/src/components/button/button.theme.ts +12 -3
- package/src/components/button/button.ts +4 -0
- package/src/components/tabs/tabs.theme.ts +13 -3
- package/src/components/tabs/tabs.ts +14 -8
- package/src/presets/index.ts +38 -8
package/package.json
CHANGED
|
@@ -28,6 +28,7 @@ const {
|
|
|
28
28
|
square = false,
|
|
29
29
|
rounded = false,
|
|
30
30
|
block = false,
|
|
31
|
+
justify = "center",
|
|
31
32
|
active = false,
|
|
32
33
|
theme,
|
|
33
34
|
activeColor,
|
|
@@ -60,6 +61,7 @@ const classes = resolveClasses(button, {
|
|
|
60
61
|
color: (active && activeColor ? activeColor : color) as "neutral",
|
|
61
62
|
size,
|
|
62
63
|
block,
|
|
64
|
+
justify,
|
|
63
65
|
square: square || (!label && !Astro.slots.has("default")),
|
|
64
66
|
rounded,
|
|
65
67
|
leading: isLeading,
|
|
@@ -11,7 +11,7 @@ export const createButtonTheme = (colors: readonly string[] = colorConfig.colors
|
|
|
11
11
|
slots: ["root", "label", "leadingIcon", "leadingAvatar", "leadingAvatarSize", "trailingIcon"],
|
|
12
12
|
base: {
|
|
13
13
|
root: [
|
|
14
|
-
"group inline-flex items-center
|
|
14
|
+
"group inline-flex items-center font-medium ws-nowrap no-underline disabled:cursor-not-allowed aria-disabled:cursor-not-allowed disabled:opacity-75 aria-disabled:opacity-75",
|
|
15
15
|
"transition-colors outline-none",
|
|
16
16
|
"aria-invalid:border-error-500 aria-invalid:ring-error-500/20"
|
|
17
17
|
],
|
|
@@ -63,8 +63,16 @@ export const createButtonTheme = (colors: readonly string[] = colorConfig.colors
|
|
|
63
63
|
trailingIcon: "size-7"
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
|
+
justify: {
|
|
67
|
+
start: { root: "justify-start" },
|
|
68
|
+
center: { root: "justify-center" },
|
|
69
|
+
end: { root: "justify-end" },
|
|
70
|
+
between: { root: "justify-between" },
|
|
71
|
+
around: { root: "justify-around" },
|
|
72
|
+
evenly: { root: "justify-evenly" }
|
|
73
|
+
},
|
|
66
74
|
block: {
|
|
67
|
-
true: { root: "w-full
|
|
75
|
+
true: { root: "w-full", trailingIcon: "ms-auto" }
|
|
68
76
|
},
|
|
69
77
|
square: {
|
|
70
78
|
true: {},
|
|
@@ -218,7 +226,8 @@ export const createButtonTheme = (colors: readonly string[] = colorConfig.colors
|
|
|
218
226
|
defaultVariants: {
|
|
219
227
|
variant: "solid",
|
|
220
228
|
color: "primary",
|
|
221
|
-
size: "md"
|
|
229
|
+
size: "md",
|
|
230
|
+
justify: "center"
|
|
222
231
|
}
|
|
223
232
|
})
|
|
224
233
|
}
|
|
@@ -46,6 +46,10 @@ export interface ButtonProps extends LinkProps {
|
|
|
46
46
|
* Makes the button stretch to full width
|
|
47
47
|
*/
|
|
48
48
|
block?: boolean
|
|
49
|
+
/**
|
|
50
|
+
* Horizontal alignment of content inside the button flex container
|
|
51
|
+
*/
|
|
52
|
+
justify?: "start" | "center" | "end" | "between" | "around" | "evenly"
|
|
49
53
|
/**
|
|
50
54
|
* Applies active state styling
|
|
51
55
|
*/
|
|
@@ -2,11 +2,22 @@ import { defineTheme } from "../../utils/defineTheme"
|
|
|
2
2
|
|
|
3
3
|
export const createTabsTheme = () =>
|
|
4
4
|
defineTheme({
|
|
5
|
-
slots: [
|
|
5
|
+
slots: [
|
|
6
|
+
"root",
|
|
7
|
+
"list",
|
|
8
|
+
"indicator",
|
|
9
|
+
"trigger",
|
|
10
|
+
"leadingIcon",
|
|
11
|
+
"leadingAvatar",
|
|
12
|
+
"label",
|
|
13
|
+
"trailingBadge",
|
|
14
|
+
"content"
|
|
15
|
+
],
|
|
6
16
|
base: {
|
|
7
17
|
root: "flex gap-2 w-full",
|
|
8
18
|
list: "relative flex p-1 group items-center min-w-0",
|
|
9
|
-
indicator:
|
|
19
|
+
indicator:
|
|
20
|
+
"absolute transition-[translate,width,height,top,left] duration-200 ease-out pointer-events-none",
|
|
10
21
|
trigger:
|
|
11
22
|
"group relative inline-flex items-center justify-center min-w-0 whitespace-nowrap font-medium transition-colors cursor-pointer disabled:cursor-not-allowed disabled:opacity-75 focus-visible:outline-none data-[state=inactive]:text-muted-foreground hover:data-[state=inactive]:text-foreground",
|
|
12
23
|
leadingIcon: "shrink-0",
|
|
@@ -77,4 +88,3 @@ export const createTabsTheme = () =>
|
|
|
77
88
|
})
|
|
78
89
|
|
|
79
90
|
export default createTabsTheme()
|
|
80
|
-
|
|
@@ -28,17 +28,20 @@ export interface TabsProps<T extends TabItem = TabItem> {
|
|
|
28
28
|
defaultValue?: string
|
|
29
29
|
/**
|
|
30
30
|
* Tab variant.
|
|
31
|
-
*
|
|
31
|
+
*
|
|
32
|
+
* @defaultValue "pill"
|
|
32
33
|
*/
|
|
33
34
|
variant?: "pill" | "underline" | "link" | "solid" | "pills"
|
|
34
35
|
/**
|
|
35
36
|
* Layout orientation.
|
|
36
|
-
*
|
|
37
|
+
*
|
|
38
|
+
* @defaultValue "horizontal"
|
|
37
39
|
*/
|
|
38
40
|
orientation?: "horizontal" | "vertical"
|
|
39
41
|
/**
|
|
40
42
|
* Size scale.
|
|
41
|
-
*
|
|
43
|
+
*
|
|
44
|
+
* @defaultValue "md"
|
|
42
45
|
*/
|
|
43
46
|
size?: "xs" | "sm" | "md" | "lg" | "xl"
|
|
44
47
|
/**
|
|
@@ -47,23 +50,27 @@ export interface TabsProps<T extends TabItem = TabItem> {
|
|
|
47
50
|
color?: ThemeColor
|
|
48
51
|
/**
|
|
49
52
|
* Whether to render content panels automatically. Set to false for tab bar only.
|
|
53
|
+
*
|
|
50
54
|
* @defaultValue true
|
|
51
55
|
*/
|
|
52
56
|
content?: boolean
|
|
53
57
|
/**
|
|
54
|
-
* Unmount hidden tab panels from DOM. Defaults to true.
|
|
55
|
-
*
|
|
58
|
+
* Unmount hidden tab panels from DOM. Defaults to true. If false, panel is hidden via
|
|
59
|
+
* CSS/attribute.
|
|
60
|
+
*
|
|
56
61
|
* @defaultValue true
|
|
57
62
|
*/
|
|
58
63
|
unmountOnHide?: boolean
|
|
59
64
|
/**
|
|
60
65
|
* Property key for value on item object.
|
|
61
|
-
*
|
|
66
|
+
*
|
|
67
|
+
* @defaultValue "value"
|
|
62
68
|
*/
|
|
63
69
|
valueKey?: string
|
|
64
70
|
/**
|
|
65
71
|
* Property key for label on item object.
|
|
66
|
-
*
|
|
72
|
+
*
|
|
73
|
+
* @defaultValue "label"
|
|
67
74
|
*/
|
|
68
75
|
labelKey?: string
|
|
69
76
|
/**
|
|
@@ -76,4 +83,3 @@ export interface TabsProps<T extends TabItem = TabItem> {
|
|
|
76
83
|
class?: any
|
|
77
84
|
[key: string]: unknown
|
|
78
85
|
}
|
|
79
|
-
|
package/src/presets/index.ts
CHANGED
|
@@ -202,14 +202,14 @@ export default definePreset((options?: RimelightPresetOptions) => {
|
|
|
202
202
|
}
|
|
203
203
|
],
|
|
204
204
|
[
|
|
205
|
-
/^(text)-(default|
|
|
205
|
+
/^(text)-(default|muted|dimmed|toned|highlighted|elevated|accented|inverted)(?:\/(\d+))?$/,
|
|
206
206
|
([, , name, opacity]) =>
|
|
207
207
|
opacity
|
|
208
208
|
? { color: `color-mix(in srgb, var(--text-color-${name}) ${opacity}%, transparent)` }
|
|
209
209
|
: { color: `var(--text-color-${name})` }
|
|
210
210
|
],
|
|
211
211
|
[
|
|
212
|
-
/^(bg)-(default|
|
|
212
|
+
/^(bg)-(default|muted|elevated|accented|dimmed|toned|highlighted)(?:\/(\d+))?$/,
|
|
213
213
|
([, , name, opacity]) =>
|
|
214
214
|
opacity
|
|
215
215
|
? {
|
|
@@ -218,7 +218,20 @@ export default definePreset((options?: RimelightPresetOptions) => {
|
|
|
218
218
|
: { "background-color": `var(--background-color-${name})` }
|
|
219
219
|
],
|
|
220
220
|
[
|
|
221
|
-
/^
|
|
221
|
+
/^bg-inverted(?:\/(\d+))?$/,
|
|
222
|
+
([, opacity]) =>
|
|
223
|
+
opacity
|
|
224
|
+
? {
|
|
225
|
+
"background-color": `color-mix(in srgb, var(--background-color-inverted) ${opacity}%, transparent)`,
|
|
226
|
+
"color": "var(--text-color-inverted)"
|
|
227
|
+
}
|
|
228
|
+
: {
|
|
229
|
+
"background-color": "var(--background-color-inverted)",
|
|
230
|
+
"color": "var(--text-color-inverted)"
|
|
231
|
+
}
|
|
232
|
+
],
|
|
233
|
+
[
|
|
234
|
+
/^(ring)-(default|muted|elevated|accented|dimmed|toned|highlighted|inverted)(?:\/(\d+))?$/,
|
|
222
235
|
([, , name, opacity]) =>
|
|
223
236
|
opacity
|
|
224
237
|
? {
|
|
@@ -227,7 +240,7 @@ export default definePreset((options?: RimelightPresetOptions) => {
|
|
|
227
240
|
: { "--un-ring-color": `var(--ring-color-${name})` }
|
|
228
241
|
],
|
|
229
242
|
[
|
|
230
|
-
/^(border)-(default|
|
|
243
|
+
/^(border)-(default|muted|elevated|accented|dimmed|toned|highlighted|inverted)(?:\/(\d+))?$/,
|
|
231
244
|
([, , name, opacity]) =>
|
|
232
245
|
opacity
|
|
233
246
|
? {
|
|
@@ -460,24 +473,41 @@ export default definePreset((options?: RimelightPresetOptions) => {
|
|
|
460
473
|
|
|
461
474
|
/* Text / background / border / ring semantic tokens using responsive neutral variables */
|
|
462
475
|
--text-color-default: var(--color-neutral-700);
|
|
463
|
-
--text-color-muted: var(--color-neutral-
|
|
464
|
-
--text-color-dimmed: var(--color-neutral-
|
|
465
|
-
--text-color-toned: var(--color-neutral-
|
|
476
|
+
--text-color-muted: var(--color-neutral-600);
|
|
477
|
+
--text-color-dimmed: var(--color-neutral-500);
|
|
478
|
+
--text-color-toned: var(--color-neutral-800);
|
|
466
479
|
--text-color-highlighted: var(--color-neutral-950);
|
|
467
|
-
--text-color-
|
|
480
|
+
--text-color-elevated: var(--color-neutral-800);
|
|
481
|
+
--text-color-accented: var(--color-neutral-900);
|
|
482
|
+
--text-color-inverted: var(--color-neutral-50);
|
|
483
|
+
|
|
468
484
|
--background-color-default: light-dark(#ffffff, var(--color-neutral-50));
|
|
469
485
|
--background-color-muted: var(--color-neutral-100);
|
|
470
486
|
--background-color-elevated: var(--color-neutral-200);
|
|
471
487
|
--background-color-accented: var(--color-neutral-300);
|
|
488
|
+
--background-color-dimmed: var(--color-neutral-400);
|
|
489
|
+
--background-color-toned: var(--color-neutral-800);
|
|
490
|
+
--background-color-highlighted: var(--color-neutral-900);
|
|
472
491
|
--background-color-inverted: var(--color-neutral-950);
|
|
492
|
+
|
|
473
493
|
--border-color-default: var(--color-neutral-200);
|
|
474
494
|
--border-color-muted: var(--color-neutral-100);
|
|
495
|
+
--border-color-elevated: var(--color-neutral-200);
|
|
475
496
|
--border-color-accented: var(--color-neutral-300);
|
|
497
|
+
--border-color-dimmed: var(--color-neutral-400);
|
|
498
|
+
--border-color-toned: var(--color-neutral-800);
|
|
499
|
+
--border-color-highlighted: var(--color-neutral-900);
|
|
476
500
|
--border-color-inverted: var(--color-neutral-950);
|
|
501
|
+
|
|
477
502
|
--ring-color-default: var(--color-neutral-200);
|
|
478
503
|
--ring-color-muted: var(--color-neutral-100);
|
|
504
|
+
--ring-color-elevated: var(--color-neutral-200);
|
|
479
505
|
--ring-color-accented: var(--color-neutral-300);
|
|
506
|
+
--ring-color-dimmed: var(--color-neutral-400);
|
|
507
|
+
--ring-color-toned: var(--color-neutral-800);
|
|
508
|
+
--ring-color-highlighted: var(--color-neutral-900);
|
|
480
509
|
--ring-color-inverted: var(--color-neutral-950);
|
|
510
|
+
|
|
481
511
|
--divide-color-default: var(--color-neutral-200);
|
|
482
512
|
--divide-color-inverted: var(--color-neutral-950);
|
|
483
513
|
|