@xingxingmofashu/ui 0.1.9 → 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.
- package/README.md +3 -3
- package/dist/components/card.d.ts +1 -1
- package/dist/components/menu.d.ts +7 -11
- package/dist/components/menu.mjs +11 -2
- package/dist/index.d.ts +1 -1
- package/dist/theme/alert-dialog.mjs +2 -2
- package/dist/theme/card.mjs +1 -1
- package/dist/theme/dialog.mjs +2 -2
- package/dist/theme/tabs.mjs +1 -1
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<picture>
|
|
2
|
-
<source media="(prefers-color-scheme: dark)" srcset=".github/assets/surface-lab-dark.png">
|
|
3
|
-
<source media="(prefers-color-scheme: light)" srcset=".github/assets/surface-lab-light.png">
|
|
4
|
-
<img alt="The Liquid Glass Surface Lab panel showing glass components over the default image background in light mode." width="1024" src=".github/assets/surface-lab-light.png">
|
|
2
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/xingxingmofashu/ui/main/.github/assets/surface-lab-dark.png">
|
|
3
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/xingxingmofashu/ui/main/.github/assets/surface-lab-light.png">
|
|
4
|
+
<img alt="The Liquid Glass Surface Lab panel showing glass components over the default image background in light mode." width="1024" src="https://raw.githubusercontent.com/xingxingmofashu/ui/main/.github/assets/surface-lab-light.png">
|
|
5
5
|
</picture>
|
|
6
6
|
|
|
7
7
|
<div align="center">
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { type ComponentConfig } from "../internal/tv";
|
|
3
3
|
import theme from "../theme/card";
|
|
4
4
|
type Card = ComponentConfig<typeof theme>;
|
|
5
|
-
type CardProps = Omit<React.ComponentProps<"div">, "title"> & {
|
|
5
|
+
type CardProps = Omit<React.ComponentProps<"div">, "style" | "title"> & {
|
|
6
6
|
/** Classes merged into the root element. */
|
|
7
7
|
className?: string;
|
|
8
8
|
/** Tailwind classes for internal slots, keyed by `data-slot`. */
|
|
@@ -3,9 +3,6 @@ import * as React from "react";
|
|
|
3
3
|
import { type ComponentConfig } from "../internal/tv";
|
|
4
4
|
import theme from "../theme/menu";
|
|
5
5
|
type Menu = ComponentConfig<typeof theme>;
|
|
6
|
-
type MenuItemUi = Partial<Pick<Menu["slots"], "item" | "itemIcon" | "itemLabel" | "shortcut">>;
|
|
7
|
-
type MenuGroupUi = Partial<Pick<Menu["slots"], "group" | "groupLabel" | "item" | "itemIcon" | "itemLabel" | "shortcut">>;
|
|
8
|
-
type MenuSeparatorUi = Partial<Pick<Menu["slots"], "separator">>;
|
|
9
6
|
/** One action item in the menu. */
|
|
10
7
|
type MenuItemProps<Value extends string = string> = Omit<UIMenu.Item.Props, "children" | "className" | "style" | "label" | "onClick"> & {
|
|
11
8
|
type?: "item";
|
|
@@ -24,10 +21,10 @@ type MenuItemProps<Value extends string = string> = Omit<UIMenu.Item.Props, "chi
|
|
|
24
21
|
/** Tailwind classes merged into the item. */
|
|
25
22
|
className?: string;
|
|
26
23
|
/** Tailwind classes for this item's internal slots. */
|
|
27
|
-
ui?:
|
|
24
|
+
ui?: Partial<Pick<Menu["slots"], "item" | "itemIcon" | "itemLabel" | "shortcut">>;
|
|
28
25
|
};
|
|
29
26
|
/** A labelled group of menu items. */
|
|
30
|
-
type MenuGroupProps<Value extends string = string> = {
|
|
27
|
+
type MenuGroupProps<Value extends string = string> = Omit<UIMenu.Group.Props, "children" | "className" | "style"> & {
|
|
31
28
|
type: "group";
|
|
32
29
|
/** Group heading. */
|
|
33
30
|
label: React.ReactNode;
|
|
@@ -36,22 +33,21 @@ type MenuGroupProps<Value extends string = string> = {
|
|
|
36
33
|
/** Tailwind classes merged into the group. */
|
|
37
34
|
className?: string;
|
|
38
35
|
/** Tailwind classes for the group slots. */
|
|
39
|
-
ui?:
|
|
36
|
+
ui?: Partial<Pick<Menu["slots"], "group" | "groupLabel" | "item" | "itemIcon" | "itemLabel" | "shortcut">>;
|
|
40
37
|
};
|
|
41
38
|
/** A separator between menu items. */
|
|
42
|
-
type MenuSeparatorProps = {
|
|
39
|
+
type MenuSeparatorProps = Omit<UIMenu.Separator.Props, "children" | "className" | "orientation" | "style"> & {
|
|
43
40
|
type: "separator";
|
|
44
41
|
/** Tailwind classes merged into the separator. */
|
|
45
42
|
className?: string;
|
|
46
43
|
/** Tailwind classes for the separator slot. */
|
|
47
|
-
ui?:
|
|
44
|
+
ui?: Partial<Pick<Menu["slots"], "separator">>;
|
|
48
45
|
};
|
|
49
|
-
type MenuEntry<Value extends string = string> = MenuItemProps<Value> | MenuGroupProps<Value> | MenuSeparatorProps;
|
|
50
46
|
type MenuProps<Value extends string = string> = Omit<UIMenu.Root.Props, "children" | "className" | "style"> & Pick<UIMenu.Positioner.Props, "side" | "align" | "sideOffset" | "alignOffset" | "collisionPadding"> & {
|
|
51
47
|
/** Element that opens the menu. It must forward props and refs. */
|
|
52
48
|
trigger: React.ReactElement;
|
|
53
49
|
/** Items, groups, and separators rendered by the menu. */
|
|
54
|
-
items: readonly
|
|
50
|
+
items: readonly (MenuItemProps<Value> | MenuGroupProps<Value> | MenuSeparatorProps)[];
|
|
55
51
|
/** Tailwind classes merged into the popup. */
|
|
56
52
|
className?: string;
|
|
57
53
|
/** Tailwind classes for internal slots, keyed by `data-slot`. */
|
|
@@ -59,4 +55,4 @@ type MenuProps<Value extends string = string> = Omit<UIMenu.Root.Props, "childre
|
|
|
59
55
|
};
|
|
60
56
|
declare function Menu<Value extends string = string>({ trigger, items, side, align, sideOffset, alignOffset, collisionPadding, className, ui, ...props }: MenuProps<Value>): React.JSX.Element;
|
|
61
57
|
export { Menu };
|
|
62
|
-
export type {
|
|
58
|
+
export type { MenuGroupProps, MenuItemProps, MenuProps, MenuSeparatorProps, };
|
package/dist/components/menu.mjs
CHANGED
|
@@ -152,12 +152,15 @@ function MenuGroup({
|
|
|
152
152
|
className,
|
|
153
153
|
ui,
|
|
154
154
|
label,
|
|
155
|
-
items
|
|
155
|
+
items,
|
|
156
|
+
type: _type,
|
|
157
|
+
...props
|
|
156
158
|
}) {
|
|
157
159
|
const styles = theme();
|
|
158
160
|
return /* @__PURE__ */ React.createElement(
|
|
159
161
|
UIMenu.Group,
|
|
160
162
|
{
|
|
163
|
+
...props,
|
|
161
164
|
"data-slot": "group",
|
|
162
165
|
className: cn(styles.group(), ui?.group, className)
|
|
163
166
|
},
|
|
@@ -184,11 +187,17 @@ function MenuGroup({
|
|
|
184
187
|
))
|
|
185
188
|
);
|
|
186
189
|
}
|
|
187
|
-
function MenuSeparator({
|
|
190
|
+
function MenuSeparator({
|
|
191
|
+
className,
|
|
192
|
+
ui,
|
|
193
|
+
type: _type,
|
|
194
|
+
...props
|
|
195
|
+
}) {
|
|
188
196
|
const styles = theme();
|
|
189
197
|
return /* @__PURE__ */ React.createElement(
|
|
190
198
|
UIMenu.Separator,
|
|
191
199
|
{
|
|
200
|
+
...props,
|
|
192
201
|
"data-slot": "separator",
|
|
193
202
|
className: cn(styles.separator(), ui?.separator, className)
|
|
194
203
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export { Field, type FieldProps } from "./components/field";
|
|
|
10
10
|
export { Fieldset, type FieldsetProps } from "./components/fieldset";
|
|
11
11
|
export { Form, type FormProps } from "./components/form";
|
|
12
12
|
export { Input, type InputProps } from "./components/input";
|
|
13
|
-
export { Menu, type
|
|
13
|
+
export { Menu, type MenuGroupProps, type MenuItemProps, type MenuProps, type MenuSeparatorProps, } from "./components/menu";
|
|
14
14
|
export { Popover, type PopoverProps } from "./components/popover";
|
|
15
15
|
export { Progress, type ProgressProps } from "./components/progress";
|
|
16
16
|
export { RadioGroup, type RadioGroupItemProps, type RadioGroupProps, } from "./components/radio-group";
|
|
@@ -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
|
|
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",
|
package/dist/theme/card.mjs
CHANGED
|
@@ -7,7 +7,7 @@ export default tv({
|
|
|
7
7
|
],
|
|
8
8
|
glass: [
|
|
9
9
|
"ui-glass ui-glass-inner ui-glass-highlight",
|
|
10
|
-
"pointer-events-none relative col-start-1 row-start-1 h-full w-full overflow-hidden rounded-[
|
|
10
|
+
"pointer-events-none relative col-start-1 row-start-1 h-full w-full overflow-hidden rounded-[inherit]"
|
|
11
11
|
],
|
|
12
12
|
overlay: "ui-glass-rim",
|
|
13
13
|
layout: [
|
package/dist/theme/dialog.mjs
CHANGED
|
@@ -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
|
|
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",
|
package/dist/theme/tabs.mjs
CHANGED
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xingxingmofashu/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
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",
|
|
@@ -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
|
}
|