@xingxingmofashu/ui 0.2.0 → 0.3.0
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/README.md +17 -6
- package/dist/components/accordion.d.ts +5 -5
- package/dist/components/accordion.mjs +2 -2
- package/dist/components/alert-dialog.d.ts +3 -1
- package/dist/components/alert-dialog.mjs +3 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/card.d.ts +1 -1
- package/dist/components/checkbox-group.d.ts +8 -8
- package/dist/components/checkbox-group.mjs +3 -3
- package/dist/components/checkbox.d.ts +1 -1
- package/dist/components/dialog.d.ts +3 -1
- package/dist/components/dialog.mjs +3 -1
- package/dist/components/drawer.d.ts +4 -2
- package/dist/components/drawer.mjs +3 -1
- package/dist/components/field.d.ts +1 -1
- package/dist/components/fieldset.d.ts +1 -1
- package/dist/components/form.d.ts +1 -1
- package/dist/components/input.d.ts +3 -1
- package/dist/components/input.mjs +3 -1
- package/dist/components/menu.d.ts +10 -8
- package/dist/components/menu.mjs +6 -4
- package/dist/components/popover.d.ts +3 -1
- package/dist/components/popover.mjs +3 -1
- package/dist/components/progress.d.ts +1 -1
- package/dist/components/radio-group.d.ts +3 -3
- package/dist/components/radio-group.mjs +2 -2
- package/dist/components/scroll-area.d.ts +1 -1
- package/dist/components/select.d.ts +25 -13
- package/dist/components/select.mjs +130 -118
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/switch.d.ts +1 -1
- package/dist/components/switch.mjs +22 -69
- package/dist/components/tabs.d.ts +9 -9
- package/dist/components/tabs.mjs +4 -4
- package/dist/components/toggle-group.d.ts +3 -3
- package/dist/components/toggle.d.ts +2 -2
- package/dist/components/tooltip.d.ts +3 -1
- package/dist/components/tooltip.mjs +3 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/theme/accordion.mjs +4 -1
- package/dist/theme/select.d.ts +2 -0
- package/dist/theme/select.mjs +2 -0
- package/dist/theme/switch.d.ts +5 -5
- package/dist/theme/switch.mjs +23 -49
- package/package.json +2 -3
package/dist/theme/accordion.mjs
CHANGED
|
@@ -11,7 +11,10 @@ export default tv({
|
|
|
11
11
|
],
|
|
12
12
|
glass: [
|
|
13
13
|
"ui-glass ui-glass-inner ui-glass-highlight",
|
|
14
|
-
"pointer-events-none absolute inset-0 z-0 overflow-hidden rounded-[inherit]"
|
|
14
|
+
"pointer-events-none absolute inset-0 z-0 overflow-hidden rounded-[inherit]",
|
|
15
|
+
// Keep the filtered glass on a stable compositor layer so the panel
|
|
16
|
+
// height transition does not re-rasterize the whole surface each frame.
|
|
17
|
+
"will-change-transform"
|
|
15
18
|
],
|
|
16
19
|
overlay: "ui-glass-rim",
|
|
17
20
|
content: "relative z-10 overflow-hidden rounded-[inherit]",
|
package/dist/theme/select.d.ts
CHANGED
package/dist/theme/select.mjs
CHANGED
|
@@ -58,6 +58,8 @@ export default tv({
|
|
|
58
58
|
"relative z-10 flex min-w-0 flex-col gap-0.5",
|
|
59
59
|
"max-h-[min(24rem,var(--available-height))] overflow-y-auto scroll-py-2"
|
|
60
60
|
],
|
|
61
|
+
group: "flex min-w-0 flex-col gap-0.5",
|
|
62
|
+
groupLabel: "px-2.5 pb-0.5 pt-1 text-xs font-medium text-ui-ink/55",
|
|
61
63
|
item: [
|
|
62
64
|
"relative flex min-h-8 cursor-default select-none items-center gap-2 rounded-xl px-2.5",
|
|
63
65
|
"text-sm text-ui-ink outline-none",
|
package/dist/theme/switch.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
declare const theme: import("tailwind-variants").TVReturnType<{
|
|
2
2
|
size: {
|
|
3
3
|
xs: {
|
|
4
|
-
|
|
4
|
+
root: string;
|
|
5
5
|
wrapper: string;
|
|
6
6
|
};
|
|
7
7
|
sm: {
|
|
8
|
-
|
|
8
|
+
root: string;
|
|
9
9
|
wrapper: string;
|
|
10
10
|
};
|
|
11
11
|
md: {
|
|
12
|
-
|
|
12
|
+
root: string;
|
|
13
13
|
wrapper: string;
|
|
14
14
|
};
|
|
15
15
|
lg: {
|
|
16
|
-
|
|
16
|
+
root: string;
|
|
17
17
|
wrapper: string;
|
|
18
18
|
};
|
|
19
19
|
xl: {
|
|
20
|
-
|
|
20
|
+
root: string;
|
|
21
21
|
wrapper: string;
|
|
22
22
|
};
|
|
23
23
|
};
|
package/dist/theme/switch.mjs
CHANGED
|
@@ -6,80 +6,54 @@ const theme = tv({
|
|
|
6
6
|
"touch-none [-webkit-tap-highlight-color:transparent]",
|
|
7
7
|
"focus:outline-none",
|
|
8
8
|
"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-75",
|
|
9
|
-
"data-[readonly]:cursor-default"
|
|
9
|
+
"data-[readonly]:cursor-default",
|
|
10
|
+
"[--ui-switch-thumb-size:calc(var(--ui-switch-height)_-_2*var(--ui-switch-inset))]",
|
|
11
|
+
"[--ui-switch-travel:calc(var(--ui-switch-width)_-_var(--ui-switch-thumb-size)_-_2*var(--ui-switch-inset))]"
|
|
10
12
|
],
|
|
11
13
|
container: "flex items-center",
|
|
12
14
|
base: [
|
|
13
|
-
"relative inline-flex h-[var(--ui-switch-height)] w-[var(--ui-switch-width)] shrink-0 select-none overflow-
|
|
14
|
-
"[
|
|
15
|
-
"[
|
|
16
|
-
"[
|
|
15
|
+
"relative inline-flex h-[var(--ui-switch-height)] w-[var(--ui-switch-width)] shrink-0 select-none overflow-hidden rounded-full",
|
|
16
|
+
"border-0 bg-[var(--ui-switch-off)] p-0 text-inherit",
|
|
17
|
+
"[background-image:linear-gradient(180deg,rgb(255_255_255/0.14),transparent_55%)]",
|
|
18
|
+
"[box-shadow:inset_0_1px_1px_rgb(255_255_255/0.3),inset_0_-1px_2px_rgb(0_0_0/0.14)]",
|
|
19
|
+
"transition-[background-color,box-shadow] duration-200 ease-out",
|
|
20
|
+
"group-data-[checked]:bg-[var(--ui-switch-on)]",
|
|
17
21
|
"group-focus-visible:outline-2 group-focus-visible:outline-offset-4 group-focus-visible:outline-ui-glass-focus",
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"[&_[data-layer=filter]]:pointer-events-none [&_[data-layer=filter]]:absolute [&_[data-layer=filter]]:h-0 [&_[data-layer=filter]]:w-0 [&_[data-layer=filter]]:overflow-hidden",
|
|
21
|
-
"[&_[data-layer=mask]]:absolute [&_[data-layer=mask]]:inset-0 [&_[data-layer=mask]]:rounded-[100px]",
|
|
22
|
-
"[&_[data-layer=mask]]:[filter:var(--ui-switch-remove-black-filter)] [&_[data-layer=mask]]:[transform:translate3d(0,0,0)]",
|
|
23
|
-
"[&_[data-layer=track]]:absolute [&_[data-layer=track]]:left-1/2 [&_[data-layer=track]]:top-1/2 [&_[data-layer=track]]:z-[12] [&_[data-layer=track]]:h-full [&_[data-layer=track]]:w-full [&_[data-layer=track]]:rounded-[100px] [&_[data-layer=track]]:bg-[var(--ui-switch-off)]",
|
|
24
|
-
"[&_[data-layer=track]]:[container-type:inline-size] [&_[data-layer=track]]:[translate:-50%_-50%] [&_[data-layer=track]]:[box-shadow:inset_0_1px_1px_rgb(255_255_255/0.35),inset_0_-1px_2px_rgb(0_0_0/0.12)]",
|
|
25
|
-
"[&_[data-layer=track]]:[transition:background-color_120ms_ease-out_180ms] group-data-[checked]:[&_[data-layer=track]]:bg-[var(--ui-switch-on)]",
|
|
26
|
-
"[&_[data-layer=track-mask]]:absolute [&_[data-layer=track-mask]]:left-[var(--ui-switch-border)] [&_[data-layer=track-mask]]:top-1/2 [&_[data-layer=track-mask]]:h-[calc(100%_-_2*var(--ui-switch-border))] [&_[data-layer=track-mask]]:w-[calc(60%_-_2*var(--ui-switch-border))] [&_[data-layer=track-mask]]:rounded-[100px] [&_[data-layer=track-mask]]:bg-black",
|
|
27
|
-
"[&_[data-layer=track-mask]]:[translate:0_-50%] group-data-[checked]:[&_[data-layer=track-mask]]:[translate:calc(100cqi_-_100%_-_2*var(--ui-switch-border))_-50%]",
|
|
28
|
-
"[&_[data-layer=track-mask]]:[transition:translate_120ms_ease-out_180ms,scale_300ms_ease-out]",
|
|
29
|
-
"group-active:[&_[data-layer=track-mask]]:[scale:1.65] group-data-[animating=true]:[&_[data-layer=track-mask]]:[scale:1.65]",
|
|
30
|
-
"[&_[data-layer=glass-rim]]:absolute [&_[data-layer=glass-rim]]:inset-0 [&_[data-layer=glass-rim]]:z-[20] [&_[data-layer=glass-rim]]:rounded-[100px] [&_[data-layer=glass-rim]]:[box-shadow:var(--ui-glass-edge-shadow)] [&_[data-layer=glass-rim]]:opacity-0",
|
|
31
|
-
"[&_[data-layer=glass-rim]]:transition-opacity [&_[data-layer=glass-rim]]:duration-200 [&_[data-layer=glass-rim]]:ease-out",
|
|
32
|
-
"group-active:[&_[data-layer=glass-rim]]:opacity-100 group-data-[animating=true]:[&_[data-layer=glass-rim]]:opacity-100",
|
|
33
|
-
"[&_[data-layer=glass-lens]]:absolute [&_[data-layer=glass-lens]]:inset-0 [&_[data-layer=glass-lens]]:rounded-[100px] [&_[data-layer=glass-lens]]:[clip-path:inset(0_0_0_0_round_100px)]",
|
|
34
|
-
"[&_[data-layer=glass-lens]]:[filter:blur(calc(var(--ui-switch-height)*0.1))] [&_[data-layer=glass-lens]]:transition-[filter] [&_[data-layer=glass-lens]]:duration-200 [&_[data-layer=glass-lens]]:ease-out",
|
|
35
|
-
"group-active:[&_[data-layer=glass-lens]]:[filter:blur(0)] group-data-[animating=true]:[&_[data-layer=glass-lens]]:[filter:blur(0)]",
|
|
36
|
-
"[&_[data-layer=goo]]:absolute [&_[data-layer=goo]]:inset-0 [&_[data-layer=goo]]:overflow-hidden [&_[data-layer=goo]]:rounded-[100px]",
|
|
37
|
-
"[&_[data-layer=goo]]:[filter:var(--ui-switch-goo-filter)] [&_[data-layer=goo]]:[transform:translate3d(0,0,0)]",
|
|
38
|
-
"[&_[data-layer=inner-glow]]:absolute [&_[data-layer=inner-glow]]:inset-0 [&_[data-layer=inner-glow]]:rounded-[100px]",
|
|
39
|
-
"[&_[data-layer=inner-glow]]:[--ui-switch-glow-color:var(--ui-switch-off)] group-data-[checked]:[&_[data-layer=inner-glow]]:[--ui-switch-glow-color:var(--ui-switch-on)]",
|
|
40
|
-
"[&_[data-layer=inner-glow]]:[transition:box-shadow_120ms_ease-out_180ms]",
|
|
41
|
-
"[&_[data-layer=inner-glow]]:[box-shadow:inset_0_0_calc(var(--ui-switch-height)*0.05)_calc(var(--ui-switch-height)*0.0667)_var(--ui-switch-glow-color),inset_calc(var(--ui-switch-height)*0.133)_0_calc(var(--ui-switch-height)*0.05)_calc(var(--ui-switch-height)*0.0667)_var(--ui-switch-glow-color)]",
|
|
42
|
-
"[&_[data-layer=fill]]:absolute [&_[data-layer=fill]]:left-0 [&_[data-layer=fill]]:top-1/2 [&_[data-layer=fill]]:h-[var(--ui-switch-height)] [&_[data-layer=fill]]:w-[var(--ui-switch-width)] [&_[data-layer=fill]]:rounded-r-[100px] [&_[data-layer=fill]]:bg-[var(--ui-switch-off)]",
|
|
43
|
-
"[&_[data-layer=fill]]:[translate:0_-50%] group-data-[checked]:[&_[data-layer=fill]]:[translate:calc(100cqi_-_100%)_-50%]",
|
|
44
|
-
"[&_[data-layer=fill]]:[transition:height_200ms_ease-out,translate_120ms_ease-out_180ms,background-color_120ms_ease-out_180ms]",
|
|
45
|
-
"group-active:[&_[data-layer=fill]]:h-[calc(var(--ui-switch-height)_-_6*var(--ui-switch-border))] group-data-[animating=true]:[&_[data-layer=fill]]:h-[calc(var(--ui-switch-height)_-_6*var(--ui-switch-border))]",
|
|
46
|
-
"group-data-[checked]:[&_[data-layer=fill]]:bg-[var(--ui-switch-on)]",
|
|
47
|
-
"[&_[data-layer=cover]]:absolute [&_[data-layer=cover]]:inset-0 [&_[data-layer=cover]]:rounded-[100px] [&_[data-layer=cover]]:bg-white",
|
|
48
|
-
"[&_[data-layer=cover]]:transition-opacity [&_[data-layer=cover]]:duration-200 [&_[data-layer=cover]]:ease-out",
|
|
49
|
-
"group-active:[&_[data-layer=cover]]:opacity-0 group-data-[animating=true]:[&_[data-layer=cover]]:opacity-0"
|
|
22
|
+
"motion-reduce:transition-none",
|
|
23
|
+
"[--ui-switch-off:color-mix(in_srgb,var(--ui-ink)_20%,transparent)] [--ui-switch-on:var(--ui-ink)]"
|
|
50
24
|
],
|
|
51
25
|
thumb: [
|
|
52
|
-
"absolute left-[var(--ui-switch-
|
|
53
|
-
"[
|
|
54
|
-
"[
|
|
55
|
-
"[translate
|
|
56
|
-
"
|
|
57
|
-
"
|
|
26
|
+
"absolute left-[var(--ui-switch-inset)] top-1/2 z-10 block h-[var(--ui-switch-thumb-size)] w-[var(--ui-switch-thumb-size)] rounded-full bg-ui-surface",
|
|
27
|
+
"[box-shadow:0_1px_3px_rgb(0_0_0/0.22),inset_0_0_0_1px_rgb(255_255_255/0.5),inset_0_1px_1px_rgb(255_255_255/0.65),inset_0_-1px_2px_rgb(0_0_0/0.08)]",
|
|
28
|
+
"[translate:0_-50%] group-data-[checked]:[translate:var(--ui-switch-travel)_-50%]",
|
|
29
|
+
"transition-[translate,scale] duration-200 ease-out",
|
|
30
|
+
"group-active:scale-95",
|
|
31
|
+
"motion-reduce:transition-none"
|
|
58
32
|
],
|
|
59
33
|
wrapper: "ms-2 min-w-0",
|
|
60
|
-
label: "block font-medium text-ui-ink",
|
|
34
|
+
label: "block font-medium text-ui-ink leading-[var(--ui-switch-height)]",
|
|
61
35
|
description: "block text-ui-ink opacity-60"
|
|
62
36
|
},
|
|
63
37
|
variants: {
|
|
64
38
|
size: {
|
|
65
39
|
xs: {
|
|
66
|
-
|
|
40
|
+
root: "[--ui-switch-width:48px] [--ui-switch-height:24px] [--ui-switch-inset:2px]",
|
|
67
41
|
wrapper: "text-xs"
|
|
68
42
|
},
|
|
69
43
|
sm: {
|
|
70
|
-
|
|
44
|
+
root: "[--ui-switch-width:56px] [--ui-switch-height:28px] [--ui-switch-inset:2px]",
|
|
71
45
|
wrapper: "text-xs"
|
|
72
46
|
},
|
|
73
47
|
md: {
|
|
74
|
-
|
|
48
|
+
root: "[--ui-switch-width:64px] [--ui-switch-height:32px] [--ui-switch-inset:3px]",
|
|
75
49
|
wrapper: "text-sm"
|
|
76
50
|
},
|
|
77
51
|
lg: {
|
|
78
|
-
|
|
52
|
+
root: "[--ui-switch-width:72px] [--ui-switch-height:36px] [--ui-switch-inset:3px]",
|
|
79
53
|
wrapper: "text-sm"
|
|
80
54
|
},
|
|
81
55
|
xl: {
|
|
82
|
-
|
|
56
|
+
root: "[--ui-switch-width:80px] [--ui-switch-height:40px] [--ui-switch-inset:3px]",
|
|
83
57
|
wrapper: "text-base"
|
|
84
58
|
}
|
|
85
59
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xingxingmofashu/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "React components with a CSS-only Liquid Glass visual style for React 19 and Tailwind CSS 4.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "xingxingmofashu",
|
|
@@ -109,8 +109,7 @@
|
|
|
109
109
|
"lint": "oxlint",
|
|
110
110
|
"lint:fix": "oxlint --fix",
|
|
111
111
|
"test": "vitest run",
|
|
112
|
-
"test:
|
|
113
|
-
"test:visual:update": "playwright test --update-snapshots",
|
|
112
|
+
"test:e2e": "playwright test",
|
|
114
113
|
"typecheck": "tsc --noEmit",
|
|
115
114
|
"docs:dev": "pnpm --filter @xingxingmofashu/docs dev",
|
|
116
115
|
"docs:build": "pnpm --filter @xingxingmofashu/docs build",
|