@xingxingmofashu/ui 0.1.8 → 0.1.10

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 (52) hide show
  1. package/README.md +8 -7
  2. package/dist/components/button.d.ts +1 -1
  3. package/dist/components/button.mjs +7 -2
  4. package/dist/components/card.d.ts +1 -1
  5. package/dist/components/checkbox-group.d.ts +41 -0
  6. package/dist/components/checkbox-group.mjs +223 -0
  7. package/dist/components/checkbox.d.ts +1 -1
  8. package/dist/components/checkbox.mjs +4 -0
  9. package/dist/components/field.d.ts +23 -0
  10. package/dist/components/field.mjs +62 -0
  11. package/dist/components/fieldset.d.ts +18 -0
  12. package/dist/components/fieldset.mjs +45 -0
  13. package/dist/components/form.d.ts +14 -0
  14. package/dist/components/form.mjs +21 -0
  15. package/dist/components/input.d.ts +1 -5
  16. package/dist/components/input.mjs +5 -35
  17. package/dist/components/menu.d.ts +8 -23
  18. package/dist/components/menu.mjs +11 -2
  19. package/dist/components/popover.d.ts +1 -12
  20. package/dist/components/radio-group.d.ts +1 -1
  21. package/dist/components/radio-group.mjs +7 -1
  22. package/dist/components/select.d.ts +1 -14
  23. package/dist/components/select.mjs +5 -3
  24. package/dist/components/slider.d.ts +2 -6
  25. package/dist/components/slider.mjs +4 -0
  26. package/dist/components/switch.mjs +3 -1
  27. package/dist/components/tabs.d.ts +1 -5
  28. package/dist/components/toggle-group.d.ts +1 -1
  29. package/dist/components/toggle-group.mjs +4 -0
  30. package/dist/components/toggle.d.ts +1 -1
  31. package/dist/components/toggle.mjs +4 -0
  32. package/dist/components/tooltip.d.ts +3 -18
  33. package/dist/components/tooltip.mjs +2 -2
  34. package/dist/index.d.ts +5 -1
  35. package/dist/index.mjs +6 -0
  36. package/dist/internal/fieldset.d.ts +8 -0
  37. package/dist/internal/fieldset.mjs +13 -0
  38. package/dist/theme/alert-dialog.mjs +2 -2
  39. package/dist/theme/card.mjs +1 -1
  40. package/dist/theme/checkbox-group.d.ts +41 -0
  41. package/dist/theme/checkbox-group.mjs +111 -0
  42. package/dist/theme/dialog.mjs +2 -2
  43. package/dist/theme/field.d.ts +25 -0
  44. package/dist/theme/field.mjs +66 -0
  45. package/dist/theme/fieldset.d.ts +5 -0
  46. package/dist/theme/fieldset.mjs +14 -0
  47. package/dist/theme/form.d.ts +4 -0
  48. package/dist/theme/form.mjs +6 -0
  49. package/dist/theme/input.d.ts +0 -2
  50. package/dist/theme/input.mjs +10 -10
  51. package/dist/theme/tabs.mjs +1 -1
  52. package/package.json +6 -3
@@ -0,0 +1,41 @@
1
+ declare const _default: import("tailwind-variants").TVReturnType<{
2
+ size: {
3
+ xs: {
4
+ root: string[];
5
+ wrapper: string;
6
+ };
7
+ sm: {
8
+ root: string[];
9
+ wrapper: string;
10
+ };
11
+ md: {
12
+ root: string[];
13
+ wrapper: string;
14
+ };
15
+ lg: {
16
+ root: string[];
17
+ wrapper: string;
18
+ };
19
+ xl: {
20
+ root: string[];
21
+ wrapper: string;
22
+ };
23
+ };
24
+ }, {
25
+ root: string[];
26
+ header: string;
27
+ label: string[];
28
+ description: string[];
29
+ items: string;
30
+ item: string[];
31
+ box: string[];
32
+ fill: string[];
33
+ glass: string[];
34
+ overlay: string;
35
+ indicator: string[];
36
+ indicatorIcon: string;
37
+ wrapper: string;
38
+ itemLabel: string;
39
+ itemDescription: string;
40
+ }, undefined, undefined, undefined, undefined>;
41
+ export default _default;
@@ -0,0 +1,111 @@
1
+ import { tv } from "tailwind-variants";
2
+ export default tv({
3
+ slots: {
4
+ root: [
5
+ "flex w-full min-w-0 flex-col text-ui-ink",
6
+ "gap-[var(--ui-checkbox-group-gap)]"
7
+ ],
8
+ header: "flex min-w-0 flex-col gap-1",
9
+ label: [
10
+ "font-medium text-ui-ink",
11
+ "text-[length:var(--ui-checkbox-group-label-size)]",
12
+ "[filter:var(--ui-drop-shadow-label)]"
13
+ ],
14
+ description: [
15
+ "text-ui-ink opacity-60 leading-relaxed",
16
+ "text-[length:var(--ui-checkbox-group-description-size)]"
17
+ ],
18
+ items: "flex min-w-0 flex-col gap-[var(--ui-checkbox-group-item-gap)]",
19
+ item: [
20
+ "group relative inline-flex min-w-0 cursor-pointer select-none items-start align-top text-ui-ink",
21
+ "touch-none [-webkit-tap-highlight-color:transparent]",
22
+ "focus:outline-none",
23
+ "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-60",
24
+ "data-[readonly]:cursor-default"
25
+ ],
26
+ box: [
27
+ "relative inline-flex shrink-0 items-center justify-center overflow-hidden",
28
+ "h-[var(--ui-checkbox-size)] w-[var(--ui-checkbox-size)]",
29
+ "rounded-[var(--ui-checkbox-radius)]",
30
+ "group-focus-visible:outline-2 group-focus-visible:outline-offset-4 group-focus-visible:outline-ui-glass-focus",
31
+ "transition-[scale] duration-200 ease-out group-active:scale-95",
32
+ "motion-reduce:transition-none",
33
+ "[--ui-glass-tone:brightness(1)] [--ui-glass-contrast:1.1]",
34
+ "[--ui-glass-border:color-mix(in_srgb,var(--ui-ink)_26%,transparent)]",
35
+ "[--ui-glass-rim:rgb(255_255_255/0.16)]",
36
+ "[--ui-glass-surface:color-mix(in_srgb,var(--ui-ink)_5%,transparent)]",
37
+ "[--ui-shadow-glass:inset_0_0_0_1px_color-mix(in_srgb,var(--ui-ink)_6%,transparent),0_1px_2px_rgb(0_0_0/0.3)]",
38
+ "[--ui-glass-rim-inset:2px]"
39
+ ],
40
+ fill: [
41
+ "absolute inset-0 z-0 rounded-[inherit] bg-ui-ink",
42
+ "[background-image:linear-gradient(145deg,color-mix(in_srgb,var(--ui-ink)_88%,var(--ui-surface)),var(--ui-ink))]",
43
+ "scale-0 transition-transform duration-200 ease-out",
44
+ "group-data-[checked]:scale-100 group-data-[indeterminate]:scale-100",
45
+ "motion-reduce:transition-none"
46
+ ],
47
+ glass: [
48
+ "ui-glass",
49
+ "pointer-events-none absolute inset-0 z-[1] overflow-hidden rounded-[inherit]"
50
+ ],
51
+ overlay: "ui-glass-rim",
52
+ indicator: [
53
+ "relative z-10 flex items-center justify-center text-ui-surface",
54
+ "scale-50 opacity-0 transition-[opacity,scale] duration-200 ease-out",
55
+ "group-data-[checked]:scale-100 group-data-[checked]:opacity-100",
56
+ "group-data-[indeterminate]:scale-100 group-data-[indeterminate]:opacity-100",
57
+ "motion-reduce:transition-none"
58
+ ],
59
+ indicatorIcon: "block size-[var(--ui-checkbox-icon-size)]",
60
+ wrapper: "ms-[var(--ui-checkbox-gap)] min-w-0",
61
+ itemLabel: "block font-medium text-ui-ink leading-[var(--ui-checkbox-size)]",
62
+ itemDescription: "block text-ui-ink opacity-60"
63
+ },
64
+ variants: {
65
+ size: {
66
+ xs: {
67
+ root: [
68
+ "[--ui-checkbox-size:16px] [--ui-checkbox-radius:5px] [--ui-checkbox-icon-size:10px] [--ui-checkbox-gap:6px]",
69
+ "[--ui-checkbox-group-gap:10px] [--ui-checkbox-group-item-gap:10px]",
70
+ "[--ui-checkbox-group-label-size:0.75rem] [--ui-checkbox-group-description-size:0.75rem]"
71
+ ],
72
+ wrapper: "text-xs"
73
+ },
74
+ sm: {
75
+ root: [
76
+ "[--ui-checkbox-size:18px] [--ui-checkbox-radius:5px] [--ui-checkbox-icon-size:11px] [--ui-checkbox-gap:7px]",
77
+ "[--ui-checkbox-group-gap:10px] [--ui-checkbox-group-item-gap:10px]",
78
+ "[--ui-checkbox-group-label-size:0.75rem] [--ui-checkbox-group-description-size:0.75rem]"
79
+ ],
80
+ wrapper: "text-xs"
81
+ },
82
+ md: {
83
+ root: [
84
+ "[--ui-checkbox-size:20px] [--ui-checkbox-radius:6px] [--ui-checkbox-icon-size:12px] [--ui-checkbox-gap:8px]",
85
+ "[--ui-checkbox-group-gap:12px] [--ui-checkbox-group-item-gap:12px]",
86
+ "[--ui-checkbox-group-label-size:0.875rem] [--ui-checkbox-group-description-size:0.875rem]"
87
+ ],
88
+ wrapper: "text-sm"
89
+ },
90
+ lg: {
91
+ root: [
92
+ "[--ui-checkbox-size:24px] [--ui-checkbox-radius:7px] [--ui-checkbox-icon-size:14px] [--ui-checkbox-gap:9px]",
93
+ "[--ui-checkbox-group-gap:12px] [--ui-checkbox-group-item-gap:14px]",
94
+ "[--ui-checkbox-group-label-size:0.875rem] [--ui-checkbox-group-description-size:0.875rem]"
95
+ ],
96
+ wrapper: "text-sm"
97
+ },
98
+ xl: {
99
+ root: [
100
+ "[--ui-checkbox-size:28px] [--ui-checkbox-radius:8px] [--ui-checkbox-icon-size:16px] [--ui-checkbox-gap:10px]",
101
+ "[--ui-checkbox-group-gap:14px] [--ui-checkbox-group-item-gap:16px]",
102
+ "[--ui-checkbox-group-label-size:1rem] [--ui-checkbox-group-description-size:1rem]"
103
+ ],
104
+ wrapper: "text-base"
105
+ }
106
+ }
107
+ },
108
+ defaultVariants: {
109
+ size: "md"
110
+ }
111
+ });
@@ -7,9 +7,9 @@ export default tv({
7
7
  "data-[starting-style]:opacity-0 data-[ending-style]:opacity-0",
8
8
  "motion-reduce:transition-none"
9
9
  ],
10
- viewport: "fixed inset-0 z-50 flex items-center justify-center overflow-y-auto p-4",
10
+ viewport: "fixed inset-0 z-50 flex overflow-y-auto overscroll-contain p-4",
11
11
  popup: [
12
- "relative isolate w-full max-w-md bg-ui-surface",
12
+ "relative isolate m-auto w-full max-w-md bg-ui-surface",
13
13
  "rounded-[1.75rem] text-ui-ink outline-none",
14
14
  "transition-[opacity,scale,translate] duration-200 ease-out",
15
15
  "data-[starting-style]:translate-y-2 data-[starting-style]:scale-95 data-[starting-style]:opacity-0",
@@ -0,0 +1,25 @@
1
+ declare const _default: import("tailwind-variants").TVReturnType<{
2
+ size: {
3
+ xs: {
4
+ root: string[];
5
+ };
6
+ sm: {
7
+ root: string[];
8
+ };
9
+ md: {
10
+ root: string[];
11
+ };
12
+ lg: {
13
+ root: string[];
14
+ };
15
+ xl: {
16
+ root: string[];
17
+ };
18
+ };
19
+ }, {
20
+ root: string[];
21
+ label: string[];
22
+ error: string[];
23
+ description: string[];
24
+ }, undefined, undefined, undefined, undefined>;
25
+ export default _default;
@@ -0,0 +1,66 @@
1
+ import { tv } from "tailwind-variants";
2
+ export default tv({
3
+ slots: {
4
+ root: [
5
+ "group/field flex w-full min-w-0 flex-col text-ui-ink",
6
+ "gap-[var(--ui-field-gap)]"
7
+ ],
8
+ label: [
9
+ "w-fit font-medium text-ui-ink",
10
+ "text-[length:var(--ui-field-label-size)]",
11
+ "[filter:var(--ui-drop-shadow-label)]",
12
+ "group-data-[disabled]/field:opacity-60"
13
+ ],
14
+ error: [
15
+ "min-w-0 font-medium leading-relaxed",
16
+ "text-red-700 ui-dark:text-red-400",
17
+ "text-[length:var(--ui-field-message-size)]",
18
+ "transition-opacity duration-150 ease-out",
19
+ "data-[starting-style]:opacity-0 data-[ending-style]:opacity-0",
20
+ "motion-reduce:transition-none",
21
+ "group-data-[disabled]/field:opacity-60"
22
+ ],
23
+ description: [
24
+ "text-ui-ink opacity-60 leading-relaxed",
25
+ "text-[length:var(--ui-field-message-size)]",
26
+ "group-data-[disabled]/field:opacity-50"
27
+ ]
28
+ },
29
+ variants: {
30
+ size: {
31
+ xs: {
32
+ root: [
33
+ "[--ui-field-gap:4px] [--ui-field-label-size:0.75rem]",
34
+ "[--ui-field-message-size:0.75rem]"
35
+ ]
36
+ },
37
+ sm: {
38
+ root: [
39
+ "[--ui-field-gap:4px] [--ui-field-label-size:0.75rem]",
40
+ "[--ui-field-message-size:0.75rem]"
41
+ ]
42
+ },
43
+ md: {
44
+ root: [
45
+ "[--ui-field-gap:6px] [--ui-field-label-size:0.875rem]",
46
+ "[--ui-field-message-size:0.875rem]"
47
+ ]
48
+ },
49
+ lg: {
50
+ root: [
51
+ "[--ui-field-gap:6px] [--ui-field-label-size:0.875rem]",
52
+ "[--ui-field-message-size:0.875rem]"
53
+ ]
54
+ },
55
+ xl: {
56
+ root: [
57
+ "[--ui-field-gap:8px] [--ui-field-label-size:1rem]",
58
+ "[--ui-field-message-size:1rem]"
59
+ ]
60
+ }
61
+ }
62
+ },
63
+ defaultVariants: {
64
+ size: "md"
65
+ }
66
+ });
@@ -0,0 +1,5 @@
1
+ declare const _default: import("tailwind-variants").TVReturnType<{}, {
2
+ root: string[];
3
+ legend: string[];
4
+ }, undefined, undefined, undefined, undefined>;
5
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import { tv } from "tailwind-variants";
2
+ export default tv({
3
+ slots: {
4
+ root: [
5
+ "m-0 flex w-full min-w-0 flex-col gap-4",
6
+ "border-0 p-0 text-ui-ink"
7
+ ],
8
+ legend: [
9
+ "w-fit font-medium text-base text-ui-ink",
10
+ "[filter:var(--ui-drop-shadow-label)]",
11
+ "data-[disabled]:opacity-60"
12
+ ]
13
+ }
14
+ });
@@ -0,0 +1,4 @@
1
+ declare const _default: import("tailwind-variants").TVReturnType<{}, {
2
+ root: string[];
3
+ }, undefined, undefined, undefined, undefined>;
4
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import { tv } from "tailwind-variants";
2
+ export default tv({
3
+ slots: {
4
+ root: ["flex w-full min-w-0 flex-col gap-4", "text-ui-ink"]
5
+ }
6
+ });
@@ -33,13 +33,11 @@ declare const _default: import("tailwind-variants").TVReturnType<{
33
33
  };
34
34
  }, {
35
35
  root: string[];
36
- label: string;
37
36
  control: string[];
38
37
  glass: string[];
39
38
  overlay: string;
40
39
  leadingIcon: string[];
41
40
  input: string[];
42
41
  trailingIcon: string[];
43
- description: string;
44
42
  }, undefined, undefined, undefined, undefined>;
45
43
  export default _default;
@@ -2,10 +2,11 @@ import { tv } from "tailwind-variants";
2
2
  export default tv({
3
3
  slots: {
4
4
  root: [
5
- "group flex w-full min-w-0 flex-col gap-1.5 text-ui-ink",
6
- "data-[disabled]:cursor-not-allowed"
5
+ "group w-full min-w-0 text-ui-ink",
6
+ "data-[disabled]:cursor-not-allowed",
7
+ "has-[:disabled]:cursor-not-allowed",
8
+ "has-[:disabled]:[&:not([data-disabled])]:opacity-60"
7
9
  ],
8
- label: "w-fit font-medium text-ui-ink group-data-[disabled]:opacity-60",
9
10
  control: [
10
11
  "relative isolate flex w-full min-w-0 items-center overflow-hidden",
11
12
  "h-[var(--ui-input-height)] rounded-[var(--ui-input-radius)]",
@@ -39,37 +40,36 @@ export default tv({
39
40
  trailingIcon: [
40
41
  "relative z-[1] inline-flex shrink-0 items-center justify-center text-ui-ink opacity-55",
41
42
  "[&_svg]:block [&_svg]:shrink-0"
42
- ],
43
- description: "text-ui-ink opacity-60 group-data-[disabled]:opacity-50"
43
+ ]
44
44
  },
45
45
  variants: {
46
46
  size: {
47
47
  xs: {
48
- root: "gap-1 text-xs",
48
+ root: "text-xs",
49
49
  control: "[--ui-input-height:28px] [--ui-input-radius:8px] [--ui-input-padding:10px] [--ui-input-gap:6px]",
50
50
  leadingIcon: "[&_svg]:size-4",
51
51
  trailingIcon: "[&_svg]:size-4"
52
52
  },
53
53
  sm: {
54
- root: "gap-1 text-xs",
54
+ root: "text-xs",
55
55
  control: "[--ui-input-height:32px] [--ui-input-radius:9px] [--ui-input-padding:12px] [--ui-input-gap:7px]",
56
56
  leadingIcon: "[&_svg]:size-4",
57
57
  trailingIcon: "[&_svg]:size-4"
58
58
  },
59
59
  md: {
60
- root: "gap-1.5 text-sm",
60
+ root: "text-sm",
61
61
  control: "[--ui-input-height:36px] [--ui-input-radius:10px] [--ui-input-padding:12px] [--ui-input-gap:8px]",
62
62
  leadingIcon: "[&_svg]:size-5",
63
63
  trailingIcon: "[&_svg]:size-5"
64
64
  },
65
65
  lg: {
66
- root: "gap-1.5 text-sm",
66
+ root: "text-sm",
67
67
  control: "[--ui-input-height:40px] [--ui-input-radius:11px] [--ui-input-padding:14px] [--ui-input-gap:8px]",
68
68
  leadingIcon: "[&_svg]:size-5",
69
69
  trailingIcon: "[&_svg]:size-5"
70
70
  },
71
71
  xl: {
72
- root: "gap-2 text-base",
72
+ root: "text-base",
73
73
  control: "[--ui-input-height:44px] [--ui-input-radius:12px] [--ui-input-padding:14px] [--ui-input-gap:10px]",
74
74
  leadingIcon: "[&_svg]:size-6",
75
75
  trailingIcon: "[&_svg]:size-6"
@@ -50,7 +50,7 @@ export default tv({
50
50
  "text-[length:var(--ui-tabs-panel-font-size)]",
51
51
  "transition-[opacity,translate] duration-200 ease-out",
52
52
  "data-[starting-style]:translate-y-1 data-[starting-style]:opacity-0",
53
- "data-[ending-style]:translate-y-1 data-[ending-style]:opacity-0",
53
+ "data-[ending-style]:pointer-events-none data-[ending-style]:absolute data-[ending-style]:inset-x-0 data-[ending-style]:top-0 data-[ending-style]:translate-y-1 data-[ending-style]:opacity-0",
54
54
  "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ui-glass-focus"
55
55
  ],
56
56
  panelContent: "leading-relaxed text-ui-ink/70"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xingxingmofashu/ui",
3
- "version": "0.1.8",
4
- "description": "Accessible React components with a Liquid Glass visual style for React 19 and Tailwind CSS 4.",
3
+ "version": "0.1.10",
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",
7
7
  "type": "module",
@@ -80,6 +80,7 @@
80
80
  },
81
81
  "devDependencies": {
82
82
  "@playwright/test": "1.64.1",
83
+ "@release-it/conventional-changelog": "12.0.2",
83
84
  "@tailwindcss/node": "4.3.3",
84
85
  "@testing-library/dom": "10.4.2",
85
86
  "@testing-library/jest-dom": "7.0.1",
@@ -91,6 +92,7 @@
91
92
  "husky": "9.1.7",
92
93
  "jsdom": "30.1.3",
93
94
  "oxlint": "1.90.0",
95
+ "release-it": "21.1.2",
94
96
  "tailwindcss": "4.3.3",
95
97
  "typescript": "5.9.3",
96
98
  "unbuild": "3.6.1",
@@ -115,6 +117,7 @@
115
117
  "docs:typecheck": "pnpm --filter @xingxingmofashu/docs typecheck",
116
118
  "playground:dev": "pnpm --filter @xingxingmofashu/playground dev",
117
119
  "playground:build": "pnpm --filter @xingxingmofashu/playground build",
118
- "playground:typecheck": "pnpm --filter @xingxingmofashu/playground typecheck"
120
+ "playground:typecheck": "pnpm --filter @xingxingmofashu/playground typecheck",
121
+ "release": "release-it"
119
122
  }
120
123
  }