@xingxingmofashu/ui 0.1.2 → 0.1.4
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 +12 -60
- package/dist/components/accordion.d.ts +14 -10
- package/dist/components/accordion.mjs +78 -20
- package/dist/components/alert-dialog.d.ts +7 -2
- package/dist/components/alert-dialog.mjs +74 -33
- package/dist/components/button.d.ts +6 -2
- package/dist/components/button.mjs +20 -11
- package/dist/components/card.d.ts +6 -1
- package/dist/components/card.mjs +27 -4
- package/dist/components/checkbox.d.ts +5 -1
- package/dist/components/checkbox.mjs +53 -14
- package/dist/components/dialog.d.ts +7 -2
- package/dist/components/dialog.mjs +66 -20
- package/dist/components/drawer.d.ts +7 -2
- package/dist/components/drawer.mjs +66 -20
- package/dist/components/input.d.ts +5 -1
- package/dist/components/input.mjs +60 -33
- package/dist/components/popover.d.ts +7 -2
- package/dist/components/popover.mjs +53 -14
- package/dist/components/progress.d.ts +21 -0
- package/dist/components/progress.mjs +71 -0
- package/dist/components/scroll-area.d.ts +7 -2
- package/dist/components/scroll-area.mjs +48 -14
- package/dist/components/slider.d.ts +7 -2
- package/dist/components/slider.mjs +38 -22
- package/dist/components/switch.d.ts +5 -1
- package/dist/components/switch.mjs +47 -23
- package/dist/components/toast.d.ts +6 -1
- package/dist/components/toast.mjs +68 -15
- package/dist/components/toggle-group.d.ts +11 -5
- package/dist/components/toggle-group.mjs +54 -6
- package/dist/components/toggle.d.ts +5 -1
- package/dist/components/toggle.mjs +36 -5
- package/dist/composables/use-toast.d.ts +5 -1
- package/dist/composables/use-toast.mjs +2 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +2 -1
- package/dist/internal/tv.d.ts +13 -0
- package/dist/internal/tv.mjs +0 -0
- package/dist/keyframes.css +1 -1
- package/dist/theme/alert-dialog.mjs +1 -1
- package/dist/theme/checkbox.mjs +4 -4
- package/dist/theme/dialog.mjs +1 -1
- package/dist/theme/drawer.mjs +1 -1
- package/dist/theme/popover.mjs +2 -2
- package/dist/theme/progress.d.ts +80 -0
- package/dist/theme/progress.mjs +64 -0
- package/dist/theme/slider.mjs +8 -0
- package/dist/theme/switch.mjs +2 -0
- package/dist/theme/toast.mjs +1 -1
- package/package.json +7 -2
- package/dist/composables/create-toast-manager.d.ts +0 -6
- package/dist/composables/create-toast-manager.mjs +0 -3
|
@@ -6,29 +6,77 @@ import * as React from "react";
|
|
|
6
6
|
import theme from "../theme/toggle-group.mjs";
|
|
7
7
|
function ToggleGroup({
|
|
8
8
|
className,
|
|
9
|
+
ui,
|
|
9
10
|
size,
|
|
10
11
|
items,
|
|
11
12
|
...props
|
|
12
13
|
}) {
|
|
13
|
-
const
|
|
14
|
+
const styles = theme({ size });
|
|
14
15
|
return /* @__PURE__ */ React.createElement(
|
|
15
16
|
UIToggleGroup,
|
|
16
17
|
{
|
|
17
18
|
...props,
|
|
18
19
|
"data-slot": "root",
|
|
19
|
-
className: cn(
|
|
20
|
+
className: cn(styles.root(), ui?.root, className)
|
|
20
21
|
},
|
|
21
|
-
/* @__PURE__ */ React.createElement(
|
|
22
|
-
|
|
22
|
+
/* @__PURE__ */ React.createElement(
|
|
23
|
+
"span",
|
|
24
|
+
{
|
|
25
|
+
"aria-hidden": "true",
|
|
26
|
+
"data-slot": "glass",
|
|
27
|
+
className: cn(styles.glass(), ui?.glass)
|
|
28
|
+
},
|
|
29
|
+
/* @__PURE__ */ React.createElement(
|
|
30
|
+
"span",
|
|
31
|
+
{
|
|
32
|
+
"aria-hidden": "true",
|
|
33
|
+
"data-slot": "rim",
|
|
34
|
+
"data-layer": "rim",
|
|
35
|
+
className: cn(styles.rim(), ui?.rim)
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
),
|
|
39
|
+
items.map((item) => /* @__PURE__ */ React.createElement(
|
|
40
|
+
ToggleGroupItem,
|
|
41
|
+
{
|
|
42
|
+
key: item.value,
|
|
43
|
+
...item,
|
|
44
|
+
ui: {
|
|
45
|
+
item: cn(ui?.item, item.ui?.item),
|
|
46
|
+
content: cn(ui?.content, item.ui?.content),
|
|
47
|
+
icon: cn(ui?.icon, item.ui?.icon),
|
|
48
|
+
label: cn(ui?.label, item.ui?.label)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
))
|
|
23
52
|
);
|
|
24
53
|
}
|
|
25
54
|
function ToggleGroupItem({
|
|
26
55
|
className,
|
|
56
|
+
ui,
|
|
27
57
|
icon,
|
|
28
58
|
label,
|
|
59
|
+
ref,
|
|
29
60
|
...props
|
|
30
61
|
}) {
|
|
31
|
-
const
|
|
32
|
-
return /* @__PURE__ */ React.createElement(
|
|
62
|
+
const styles = theme();
|
|
63
|
+
return /* @__PURE__ */ React.createElement(
|
|
64
|
+
UIToggle,
|
|
65
|
+
{
|
|
66
|
+
...props,
|
|
67
|
+
ref,
|
|
68
|
+
"data-slot": "item",
|
|
69
|
+
className: cn(styles.item(), ui?.item, className)
|
|
70
|
+
},
|
|
71
|
+
/* @__PURE__ */ React.createElement("span", { "data-slot": "content", className: cn(styles.content(), ui?.content) }, icon ? /* @__PURE__ */ React.createElement(
|
|
72
|
+
"span",
|
|
73
|
+
{
|
|
74
|
+
"aria-hidden": "true",
|
|
75
|
+
"data-slot": "icon",
|
|
76
|
+
className: cn(styles.icon(), ui?.icon)
|
|
77
|
+
},
|
|
78
|
+
icon
|
|
79
|
+
) : null, label ? /* @__PURE__ */ React.createElement("span", { "data-slot": "label", className: cn(styles.label(), ui?.label) }, label) : null)
|
|
80
|
+
);
|
|
33
81
|
}
|
|
34
82
|
export { ToggleGroup };
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import { Toggle as UIToggle } from "@base-ui/react/toggle";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { type VariantProps } from "tailwind-variants";
|
|
4
|
+
import { type ComponentConfig } from "../internal/tv";
|
|
4
5
|
import theme from "../theme/toggle";
|
|
6
|
+
type Toggle = ComponentConfig<typeof theme>;
|
|
5
7
|
type ToggleProps<Value extends string = string> = Omit<UIToggle.Props<Value>, "className" | "children" | "style" | "ref"> & Omit<VariantProps<typeof theme>, "iconOnly"> & {
|
|
6
8
|
/** Ref to the rendered root element. */
|
|
7
9
|
ref?: React.Ref<HTMLButtonElement>;
|
|
8
10
|
/** Tailwind classes merged into the toggle root. */
|
|
9
11
|
className?: string;
|
|
12
|
+
/** Tailwind classes for internal slots, keyed by `data-slot`. */
|
|
13
|
+
ui?: Toggle["slots"];
|
|
10
14
|
/** Visible label rendered inside the toggle. */
|
|
11
15
|
label?: React.ReactNode;
|
|
12
16
|
/** Icon rendered before the label. */
|
|
13
17
|
icon?: React.ReactNode;
|
|
14
18
|
};
|
|
15
|
-
declare function Toggle<Value extends string = string>({ className, icon, label, size, ...props }: ToggleProps<Value>): React.JSX.Element;
|
|
19
|
+
declare function Toggle<Value extends string = string>({ className, ui, icon, label, size, ...props }: ToggleProps<Value>): React.JSX.Element;
|
|
16
20
|
export { Toggle };
|
|
17
21
|
export type { ToggleProps };
|
|
@@ -5,22 +5,53 @@ import * as React from "react";
|
|
|
5
5
|
import theme from "../theme/toggle.mjs";
|
|
6
6
|
function Toggle({
|
|
7
7
|
className,
|
|
8
|
+
ui,
|
|
8
9
|
icon,
|
|
9
10
|
label,
|
|
10
11
|
size,
|
|
11
12
|
...props
|
|
12
13
|
}) {
|
|
13
|
-
const
|
|
14
|
+
const styles = theme({ size, iconOnly: !label });
|
|
14
15
|
return /* @__PURE__ */ React.createElement(
|
|
15
16
|
UIToggle,
|
|
16
17
|
{
|
|
17
18
|
...props,
|
|
18
19
|
"data-slot": "root",
|
|
19
|
-
className: cn(
|
|
20
|
+
className: cn(styles.root(), ui?.root, className)
|
|
20
21
|
},
|
|
21
|
-
/* @__PURE__ */ React.createElement(
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
/* @__PURE__ */ React.createElement(
|
|
23
|
+
"span",
|
|
24
|
+
{
|
|
25
|
+
"aria-hidden": "true",
|
|
26
|
+
"data-slot": "glass",
|
|
27
|
+
className: cn(styles.glass(), ui?.glass)
|
|
28
|
+
},
|
|
29
|
+
/* @__PURE__ */ React.createElement(
|
|
30
|
+
"span",
|
|
31
|
+
{
|
|
32
|
+
"aria-hidden": "true",
|
|
33
|
+
"data-slot": "rim",
|
|
34
|
+
className: cn(styles.rim(), ui?.rim)
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
),
|
|
38
|
+
/* @__PURE__ */ React.createElement(
|
|
39
|
+
"span",
|
|
40
|
+
{
|
|
41
|
+
"aria-hidden": "true",
|
|
42
|
+
"data-slot": "thumb",
|
|
43
|
+
className: cn(styles.thumb(), ui?.thumb)
|
|
44
|
+
}
|
|
45
|
+
),
|
|
46
|
+
/* @__PURE__ */ React.createElement("span", { "data-slot": "content", className: cn(styles.content(), ui?.content) }, icon ? /* @__PURE__ */ React.createElement(
|
|
47
|
+
"span",
|
|
48
|
+
{
|
|
49
|
+
"data-slot": "icon",
|
|
50
|
+
"aria-hidden": "true",
|
|
51
|
+
className: cn(styles.icon(), ui?.icon)
|
|
52
|
+
},
|
|
53
|
+
icon
|
|
54
|
+
) : null, label ? /* @__PURE__ */ React.createElement("span", { "data-slot": "label", className: cn(styles.label(), ui?.label) }, label) : null)
|
|
24
55
|
);
|
|
25
56
|
}
|
|
26
57
|
export { Toggle };
|
|
@@ -3,5 +3,9 @@ import { Toast as UIToast } from "@base-ui/react/toast";
|
|
|
3
3
|
* Returns the toast manager connected to the nearest `ToastProvider`.
|
|
4
4
|
*/
|
|
5
5
|
declare const useToast: typeof UIToast.useToastManager;
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Creates a toast manager for adding notifications outside the React tree.
|
|
8
|
+
*/
|
|
9
|
+
declare const createToastManager: typeof UIToast.createToastManager;
|
|
10
|
+
export { createToastManager, useToast };
|
|
7
11
|
export type { ToastManager, ToastManagerAddOptions, ToastManagerPromiseOptions, ToastManagerUpdateOptions, ToastObject, } from "@base-ui/react/toast";
|
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import "./keyframes.css";@source "./**/*.mjs";@source "./**/*.{ts,tsx}";@custom-variant ui-light (&:where(.light, .light *, [data-theme="light"], [data-theme="light"] *));@custom-variant ui-dark (&:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *));@layer theme{:host,:root{--ui-ink:#1f1f1f;--ui-ink-active:#000;--ui-
|
|
1
|
+
@import "./keyframes.css";@source "./**/*.mjs";@source "./**/*.{ts,tsx}";@custom-variant ui-light (&:where(.light, .light *, [data-theme="light"], [data-theme="light"] *));@custom-variant ui-dark (&:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *));@layer theme{:host,:root{--ui-ink:#1f1f1f;--ui-ink-active:#000;--ui-surface:#fff;--ui-glass-surface:hsla(0,0%,100%,.2);--ui-glass-border:rgba(31,31,31,.16);--ui-glass-focus:rgba(0,0,0,.6);--ui-glass-inner-border:rgba(0,0,0,.9);--ui-glass-rim:hsla(0,0%,100%,.2);--ui-glass-highlight:hsla(0,0%,100%,.8);--ui-glass-glare-stop:15%;--ui-glass-tone:brightness(0.98);--ui-glass-contrast:1.05;--ui-drop-shadow-label:drop-shadow(0 25px 3px hsla(0,0%,40%,.15));--ui-shadow-glass:inset 2px -2px 1px -1px hsla(0,0%,100%,.9),inset -2px 2px 1px -1px hsla(0,0%,100%,.9),inset 6px -6px 1px -6px hsla(0,0%,100%,.55),inset -6px 6px 1px -6px hsla(0,0%,100%,.55),inset 0 0 2px rgba(0,0,0,.8),0 4px 8px rgba(0,0,0,.2)}.dark,[data-theme=dark]{--ui-ink:#f5f5f5;--ui-ink-active:#fff;--ui-surface:#141414;--ui-glass-surface:hsla(0,0%,8%,.62);--ui-glass-border:hsla(0,0%,100%,.2);--ui-glass-focus:hsla(0,0%,100%,.7);--ui-glass-inner-border:hsla(0,0%,100%,.4);--ui-glass-rim:hsla(0,0%,100%,.25);--ui-glass-highlight:hsla(0,0%,100%,.45);--ui-glass-tone:brightness(0.95);--ui-glass-contrast:1;--ui-drop-shadow-label:drop-shadow(0 25px 3px rgba(0,0,0,.45));--ui-shadow-glass:inset 2px -2px 1px -1px hsla(0,0%,100%,.35),inset -2px 2px 1px -1px hsla(0,0%,100%,.35),inset 6px -6px 1px -6px hsla(0,0%,100%,.2),inset -6px 6px 1px -6px hsla(0,0%,100%,.2),inset 0 0 2px rgba(0,0,0,.9),0 4px 8px rgba(0,0,0,.35)}.light,[data-theme=light]{--ui-ink:#1f1f1f;--ui-ink-active:#000;--ui-surface:#fff;--ui-glass-surface:hsla(0,0%,100%,.2);--ui-glass-border:rgba(31,31,31,.16);--ui-glass-focus:rgba(0,0,0,.6);--ui-glass-inner-border:rgba(0,0,0,.9);--ui-glass-rim:hsla(0,0%,100%,.2);--ui-glass-highlight:hsla(0,0%,100%,.8);--ui-glass-glare-stop:15%;--ui-glass-tone:brightness(0.98);--ui-glass-contrast:1.05;--ui-drop-shadow-label:drop-shadow(0 25px 3px hsla(0,0%,40%,.15));--ui-shadow-glass:inset 2px -2px 1px -1px hsla(0,0%,100%,.9),inset -2px 2px 1px -1px hsla(0,0%,100%,.9),inset 6px -6px 1px -6px hsla(0,0%,100%,.55),inset -6px 6px 1px -6px hsla(0,0%,100%,.55),inset 0 0 2px rgba(0,0,0,.8),0 4px 8px rgba(0,0,0,.2)}:host,:root{--ui-glass-blur:4px;--ui-glass-saturate:150%;--ui-glass-chip-blur:8px;--ui-glass-inner-inset:8px;--ui-glass-inner-offset:1px;--ui-glass-inner-blur:8px;--ui-glass-highlight-blur:7px;--ui-glass-rim-inset:9px;--ui-glass-rim-blur:1px}}@theme inline{--color-ui-ink:var(--ui-ink);--color-ui-ink-active:var(--ui-ink-active);--color-ui-surface:var(--ui-surface);--color-ui-glass-surface:var(--ui-glass-surface);--color-ui-glass-border:var(--ui-glass-border);--color-ui-glass-focus:var(--ui-glass-focus);--color-ui-glass-inner-border:var(--ui-glass-inner-border);--color-ui-glass-rim:var(--ui-glass-rim);--color-ui-glass-highlight:var(--ui-glass-highlight)}@layer components{.ui-glass{backdrop-filter:blur(var(--ui-glass-blur,4px)) saturate(var(--ui-glass-saturate,150%));background-color:var(--ui-glass-surface);border:1px double var(--ui-glass-border);box-shadow:var(--ui-shadow-glass);filter:var(--ui-glass-tone,brightness(.98)) contrast(var(--ui-glass-contrast,1.05));position:relative}.ui-glass-inner:before{border:1px solid var(--ui-glass-inner-border);bottom:calc(var(--ui-glass-inner-inset, 8px) - var(--ui-glass-inner-offset, 1px));filter:blur(var(--ui-glass-inner-blur,8px));left:var(--ui-glass-inner-inset,8px);right:var(--ui-glass-inner-inset,8px);top:calc(var(--ui-glass-inner-inset, 8px) + var(--ui-glass-inner-offset, 1px));z-index:1}.ui-glass-highlight:after,.ui-glass-inner:before{border-radius:inherit;content:"";pointer-events:none;position:absolute}.ui-glass-highlight:after{background:linear-gradient(45deg,var(--ui-glass-highlight) 0,transparent var(--ui-glass-glare-stop),transparent calc(100% - var(--ui-glass-glare-stop)),var(--ui-glass-highlight) 100%);filter:blur(var(--ui-glass-highlight-blur,7px));inset:0;z-index:3}.ui-glass-rim{border:1px solid var(--ui-glass-rim);border-radius:inherit;filter:blur(var(--ui-glass-rim-blur,1px));height:calc(100% - var(--ui-glass-rim-inset, 9px));left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);width:calc(100% - var(--ui-glass-rim-inset, 9px));z-index:2}.ui-glass-chip{backdrop-filter:blur(var(--ui-glass-chip-blur,8px)) saturate(var(--ui-glass-saturate,150%));background-color:var(--ui-glass-surface);border:1px solid var(--ui-glass-border);box-shadow:inset 0 1px 0 var(--ui-glass-highlight)}}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,11 +7,11 @@ export { Dialog, type DialogProps } from "./components/dialog";
|
|
|
7
7
|
export { Drawer, type DrawerProps } from "./components/drawer";
|
|
8
8
|
export { Input, type InputProps } from "./components/input";
|
|
9
9
|
export { Popover, type PopoverProps } from "./components/popover";
|
|
10
|
+
export { Progress, type ProgressProps } from "./components/progress";
|
|
10
11
|
export { ScrollArea, type ScrollAreaOrientation, type ScrollAreaProps, } from "./components/scroll-area";
|
|
11
12
|
export { Slider, type SliderProps } from "./components/slider";
|
|
12
13
|
export { Switch, type SwitchProps } from "./components/switch";
|
|
13
14
|
export { Toast, ToastProvider, type ToastPosition, type ToastProps, type ToastProviderProps, } from "./components/toast";
|
|
14
|
-
export { createToastManager } from "./composables/
|
|
15
|
-
export { useToast, type ToastManager, type ToastManagerAddOptions, type ToastManagerPromiseOptions, type ToastManagerUpdateOptions, type ToastObject, } from "./composables/use-toast";
|
|
15
|
+
export { createToastManager, useToast, type ToastManager, type ToastManagerAddOptions, type ToastManagerPromiseOptions, type ToastManagerUpdateOptions, type ToastObject, } from "./composables/use-toast";
|
|
16
16
|
export { Toggle, type ToggleProps } from "./components/toggle";
|
|
17
17
|
export { ToggleGroup, type ToggleGroupItemProps, type ToggleGroupProps, } from "./components/toggle-group";
|
package/dist/index.mjs
CHANGED
|
@@ -9,6 +9,7 @@ export { Dialog } from "./components/dialog.mjs";
|
|
|
9
9
|
export { Drawer } from "./components/drawer.mjs";
|
|
10
10
|
export { Input } from "./components/input.mjs";
|
|
11
11
|
export { Popover } from "./components/popover.mjs";
|
|
12
|
+
export { Progress } from "./components/progress.mjs";
|
|
12
13
|
export {
|
|
13
14
|
ScrollArea
|
|
14
15
|
} from "./components/scroll-area.mjs";
|
|
@@ -18,8 +19,8 @@ export {
|
|
|
18
19
|
Toast,
|
|
19
20
|
ToastProvider
|
|
20
21
|
} from "./components/toast.mjs";
|
|
21
|
-
export { createToastManager } from "./composables/create-toast-manager.mjs";
|
|
22
22
|
export {
|
|
23
|
+
createToastManager,
|
|
23
24
|
useToast
|
|
24
25
|
} from "./composables/use-toast.mjs";
|
|
25
26
|
export { Toggle } from "./components/toggle.mjs";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ClassValue } from "tailwind-variants";
|
|
2
|
+
type Id<T> = {} & {
|
|
3
|
+
[P in keyof T]: T[P];
|
|
4
|
+
};
|
|
5
|
+
type ComponentSlots<T extends {
|
|
6
|
+
slots?: Record<string, any>;
|
|
7
|
+
}> = Id<{
|
|
8
|
+
[K in keyof T["slots"]]?: ClassValue;
|
|
9
|
+
}>;
|
|
10
|
+
export type ComponentConfig<T extends Record<string, any>> = {
|
|
11
|
+
slots: ComponentSlots<T>;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
File without changes
|
package/dist/keyframes.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@keyframes ui-toggle-group-select{0%{opacity:0;scale:.94;translate:0 2px}to{opacity:1;scale:1;translate:0 0}}
|
|
1
|
+
@keyframes ui-toggle-group-select{0%{opacity:0;scale:.94;translate:0 2px}to{opacity:1;scale:1;translate:0 0}}@keyframes ui-progress-indeterminate{0%{translate:-120% 0}to{translate:320% 0}}
|
|
@@ -9,7 +9,7 @@ export default tv({
|
|
|
9
9
|
],
|
|
10
10
|
viewport: "fixed inset-0 z-50 flex items-center justify-center overflow-y-auto p-4",
|
|
11
11
|
popup: [
|
|
12
|
-
"relative isolate w-full max-w-md bg-ui-
|
|
12
|
+
"relative isolate 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/checkbox.mjs
CHANGED
|
@@ -17,14 +17,14 @@ export default tv({
|
|
|
17
17
|
"motion-reduce:transition-none",
|
|
18
18
|
"[--ui-glass-tone:brightness(1)] [--ui-glass-contrast:1.1]",
|
|
19
19
|
"[--ui-glass-border:color-mix(in_srgb,var(--ui-ink)_26%,transparent)]",
|
|
20
|
-
"[--ui-glass-rim:
|
|
20
|
+
"[--ui-glass-rim:rgb(255_255_255/0.16)]",
|
|
21
21
|
"[--ui-glass-surface:color-mix(in_srgb,var(--ui-ink)_5%,transparent)]",
|
|
22
|
-
"[--ui-shadow-glass:var(--ui-
|
|
22
|
+
"[--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)]",
|
|
23
23
|
"[--ui-glass-rim-inset:2px]"
|
|
24
24
|
],
|
|
25
25
|
fill: [
|
|
26
26
|
"absolute inset-0 z-0 rounded-[inherit] bg-ui-ink",
|
|
27
|
-
"[background-image:linear-gradient(145deg,color-mix(in_srgb,var(--ui-ink)_88%,var(--ui-
|
|
27
|
+
"[background-image:linear-gradient(145deg,color-mix(in_srgb,var(--ui-ink)_88%,var(--ui-surface)),var(--ui-ink))]",
|
|
28
28
|
"scale-0 transition-transform duration-200 ease-out",
|
|
29
29
|
"group-data-[checked]:scale-100 group-data-[indeterminate]:scale-100",
|
|
30
30
|
"motion-reduce:transition-none"
|
|
@@ -35,7 +35,7 @@ export default tv({
|
|
|
35
35
|
],
|
|
36
36
|
overlay: "ui-glass-rim",
|
|
37
37
|
indicator: [
|
|
38
|
-
"relative z-10 flex items-center justify-center text-
|
|
38
|
+
"relative z-10 flex items-center justify-center text-ui-surface",
|
|
39
39
|
"scale-50 opacity-0 transition-[opacity,scale] duration-200 ease-out",
|
|
40
40
|
"group-data-[checked]:scale-100 group-data-[checked]:opacity-100",
|
|
41
41
|
"group-data-[indeterminate]:scale-100 group-data-[indeterminate]:opacity-100",
|
package/dist/theme/dialog.mjs
CHANGED
|
@@ -9,7 +9,7 @@ export default tv({
|
|
|
9
9
|
],
|
|
10
10
|
viewport: "fixed inset-0 z-50 flex items-center justify-center overflow-y-auto p-4",
|
|
11
11
|
popup: [
|
|
12
|
-
"relative isolate w-full max-w-md bg-ui-
|
|
12
|
+
"relative isolate 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/drawer.mjs
CHANGED
|
@@ -12,7 +12,7 @@ export default tv({
|
|
|
12
12
|
],
|
|
13
13
|
viewport: "fixed inset-0 z-50 flex overflow-hidden",
|
|
14
14
|
popup: [
|
|
15
|
-
"relative isolate flex min-h-0 flex-col overflow-hidden bg-ui-
|
|
15
|
+
"relative isolate flex min-h-0 flex-col overflow-hidden bg-ui-surface",
|
|
16
16
|
"text-ui-ink outline-none touch-auto overscroll-contain will-change-transform",
|
|
17
17
|
"transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)]",
|
|
18
18
|
"data-[swiping]:select-none",
|
package/dist/theme/popover.mjs
CHANGED
|
@@ -3,7 +3,7 @@ export default tv({
|
|
|
3
3
|
slots: {
|
|
4
4
|
positioner: "z-50 outline-none",
|
|
5
5
|
popup: [
|
|
6
|
-
"relative isolate w-80 max-w-[calc(100vw-2rem)] bg-ui-
|
|
6
|
+
"relative isolate w-80 max-w-[calc(100vw-2rem)] bg-ui-surface",
|
|
7
7
|
"rounded-[1.5rem] text-ui-ink outline-none",
|
|
8
8
|
"transition-[opacity,scale,translate] duration-150 ease-out",
|
|
9
9
|
"data-[starting-style]:scale-95 data-[starting-style]:opacity-0",
|
|
@@ -23,7 +23,7 @@ export default tv({
|
|
|
23
23
|
overlay: "ui-glass-rim",
|
|
24
24
|
arrow: [
|
|
25
25
|
"pointer-events-none absolute z-[1] size-3 rotate-45",
|
|
26
|
-
"border-ui-glass-border bg-ui-
|
|
26
|
+
"border-ui-glass-border bg-ui-surface",
|
|
27
27
|
"drop-shadow-[0_1px_2px_rgb(0_0_0/0.12)]",
|
|
28
28
|
"data-[side=bottom]:-top-[6px] data-[side=bottom]:border-t data-[side=bottom]:border-l",
|
|
29
29
|
"data-[side=top]:-bottom-[6px] data-[side=top]:border-r data-[side=top]:border-b",
|
|
@@ -0,0 +1,80 @@
|
|
|
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
|
+
header: string;
|
|
22
|
+
label: string[];
|
|
23
|
+
value: string[];
|
|
24
|
+
track: string[];
|
|
25
|
+
indicator: string[];
|
|
26
|
+
description: string[];
|
|
27
|
+
}, undefined, {
|
|
28
|
+
size: {
|
|
29
|
+
xs: {
|
|
30
|
+
root: string;
|
|
31
|
+
};
|
|
32
|
+
sm: {
|
|
33
|
+
root: string;
|
|
34
|
+
};
|
|
35
|
+
md: {
|
|
36
|
+
root: string;
|
|
37
|
+
};
|
|
38
|
+
lg: {
|
|
39
|
+
root: string;
|
|
40
|
+
};
|
|
41
|
+
xl: {
|
|
42
|
+
root: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
}, {
|
|
46
|
+
root: string[];
|
|
47
|
+
header: string;
|
|
48
|
+
label: string[];
|
|
49
|
+
value: string[];
|
|
50
|
+
track: string[];
|
|
51
|
+
indicator: string[];
|
|
52
|
+
description: string[];
|
|
53
|
+
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
54
|
+
size: {
|
|
55
|
+
xs: {
|
|
56
|
+
root: string;
|
|
57
|
+
};
|
|
58
|
+
sm: {
|
|
59
|
+
root: string;
|
|
60
|
+
};
|
|
61
|
+
md: {
|
|
62
|
+
root: string;
|
|
63
|
+
};
|
|
64
|
+
lg: {
|
|
65
|
+
root: string;
|
|
66
|
+
};
|
|
67
|
+
xl: {
|
|
68
|
+
root: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
}, {
|
|
72
|
+
root: string[];
|
|
73
|
+
header: string;
|
|
74
|
+
label: string[];
|
|
75
|
+
value: string[];
|
|
76
|
+
track: string[];
|
|
77
|
+
indicator: string[];
|
|
78
|
+
description: string[];
|
|
79
|
+
}>>;
|
|
80
|
+
export default _default;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
|
+
export default tv({
|
|
3
|
+
slots: {
|
|
4
|
+
root: [
|
|
5
|
+
"group/progress relative flex w-full min-w-0 flex-col gap-[var(--ui-progress-gap)] text-ui-ink",
|
|
6
|
+
"[--ui-progress-track:color-mix(in_srgb,var(--ui-ink)_12%,transparent)]",
|
|
7
|
+
"[--ui-progress-fill-from:var(--ui-ink)] [--ui-progress-fill-to:var(--ui-ink-active)]",
|
|
8
|
+
"[--ui-progress-glow:color-mix(in_srgb,var(--ui-ink)_28%,transparent)]",
|
|
9
|
+
"[--ui-progress-height:6px] [--ui-progress-gap:8px] [--ui-progress-font-size:0.875rem]"
|
|
10
|
+
],
|
|
11
|
+
header: "flex min-w-0 items-baseline justify-between gap-3",
|
|
12
|
+
label: [
|
|
13
|
+
"min-w-0 truncate font-medium text-ui-ink",
|
|
14
|
+
"text-[length:var(--ui-progress-font-size)]",
|
|
15
|
+
"[filter:var(--ui-drop-shadow-label)]"
|
|
16
|
+
],
|
|
17
|
+
value: [
|
|
18
|
+
"ms-auto shrink-0 font-mono tabular-nums text-ui-ink opacity-60",
|
|
19
|
+
"text-[length:calc(var(--ui-progress-font-size)*0.875)]"
|
|
20
|
+
],
|
|
21
|
+
track: [
|
|
22
|
+
"relative h-[var(--ui-progress-height)] w-full overflow-hidden rounded-full",
|
|
23
|
+
"border border-ui-glass-border bg-[var(--ui-progress-track)]",
|
|
24
|
+
"shadow-[inset_0_1px_2px_rgb(0_0_0/0.14),inset_0_-1px_0_rgb(255_255_255/0.35)]",
|
|
25
|
+
"[backdrop-filter:blur(2px)] [-webkit-backdrop-filter:blur(2px)]",
|
|
26
|
+
"before:pointer-events-none before:absolute before:inset-0 before:z-[1] before:rounded-full before:bg-[linear-gradient(180deg,rgb(255_255_255/0.24),transparent_60%)] before:content-['']"
|
|
27
|
+
],
|
|
28
|
+
indicator: [
|
|
29
|
+
"relative h-full rounded-full",
|
|
30
|
+
"bg-[linear-gradient(117deg,var(--ui-progress-fill-from)_0%,var(--ui-progress-fill-to)_100%)]",
|
|
31
|
+
"shadow-[0_0_10px_var(--ui-progress-glow),inset_0_1px_0_rgb(255_255_255/0.35)]",
|
|
32
|
+
"transition-[width] duration-500 ease-[cubic-bezier(0.22,1,0.36,1)]",
|
|
33
|
+
"after:pointer-events-none after:absolute after:inset-0 after:rounded-full after:bg-[linear-gradient(180deg,rgb(255_255_255/0.3),transparent_60%)] after:content-['']",
|
|
34
|
+
"data-[indeterminate]:w-[38%] data-[indeterminate]:[animation:ui-progress-indeterminate_1.4s_ease-in-out_infinite]",
|
|
35
|
+
"motion-reduce:transition-none motion-reduce:data-[indeterminate]:[animation:none]"
|
|
36
|
+
],
|
|
37
|
+
description: [
|
|
38
|
+
"min-w-0 leading-relaxed text-ui-ink opacity-60",
|
|
39
|
+
"text-[length:var(--ui-progress-font-size)]"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
variants: {
|
|
43
|
+
size: {
|
|
44
|
+
xs: {
|
|
45
|
+
root: "[--ui-progress-height:4px] [--ui-progress-gap:6px] [--ui-progress-font-size:0.75rem]"
|
|
46
|
+
},
|
|
47
|
+
sm: {
|
|
48
|
+
root: "[--ui-progress-height:5px] [--ui-progress-gap:6px] [--ui-progress-font-size:0.75rem]"
|
|
49
|
+
},
|
|
50
|
+
md: {
|
|
51
|
+
root: "[--ui-progress-height:6px] [--ui-progress-gap:8px] [--ui-progress-font-size:0.875rem]"
|
|
52
|
+
},
|
|
53
|
+
lg: {
|
|
54
|
+
root: "[--ui-progress-height:8px] [--ui-progress-gap:8px] [--ui-progress-font-size:0.875rem]"
|
|
55
|
+
},
|
|
56
|
+
xl: {
|
|
57
|
+
root: "[--ui-progress-height:10px] [--ui-progress-gap:10px] [--ui-progress-font-size:1rem]"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
defaultVariants: {
|
|
62
|
+
size: "md"
|
|
63
|
+
}
|
|
64
|
+
});
|
package/dist/theme/slider.mjs
CHANGED
|
@@ -35,6 +35,14 @@ export default tv({
|
|
|
35
35
|
thumb: [
|
|
36
36
|
"relative z-[2] block h-[var(--ui-slider-thumb-height)] w-[var(--ui-slider-thumb-width)] shrink-0 select-none",
|
|
37
37
|
"cursor-grab touch-none rounded-full bg-transparent p-0",
|
|
38
|
+
"[--ui-glass-lens-blur:1.5px] [--ui-glass-lens-saturate:160%]",
|
|
39
|
+
"[--ui-glass-lens-border:rgb(255_255_255/0.55)]",
|
|
40
|
+
"[--ui-glass-lens-surface:linear-gradient(180deg,rgb(255_255_255/0.72),rgb(255_255_255/0.3))]",
|
|
41
|
+
"[--ui-glass-lens-surface-active:rgb(255_255_255/0.12)]",
|
|
42
|
+
"[--ui-glass-lens-shadow:0_4px_10px_rgb(0_30_63/0.14),0_0_2px_rgb(0_9_20/0.12),inset_1px_1px_0_rgb(255_255_255/0.8),inset_-1px_-1px_0_rgb(69_168_243/0.16)]",
|
|
43
|
+
"[--ui-glass-lens-shadow-active:0_6px_18px_rgb(0_30_63/0.18),0_0_3px_rgb(0_9_20/0.14),inset_1px_1px_0_rgb(255_255_255/0.72),inset_-1px_-1px_0_rgb(69_168_243/0.2)]",
|
|
44
|
+
"[--ui-glass-lens-specular:inset_1px_1px_0_rgb(255_255_255/0.7),inset_1px_3px_0_rgb(28_63_90/0.05),inset_0_0_18px_rgb(255_255_255/0.55),inset_-1px_-1px_0_rgb(69_168_243/0.16)]",
|
|
45
|
+
"[--ui-glass-lens-glare:linear-gradient(180deg,rgb(255_255_255/0.75),rgb(255_255_255/0))]",
|
|
38
46
|
"outline-none transition-[scale] duration-150 ease-out",
|
|
39
47
|
"hover:[scale:1.04] active:[scale:1.08_0.96] data-[dragging]:[scale:1.08_0.96]",
|
|
40
48
|
"[&:has(input:focus-visible)]:outline-2 [&:has(input:focus-visible)]:outline-offset-4 [&:has(input:focus-visible)]:outline-ui-glass-focus",
|
package/dist/theme/switch.mjs
CHANGED
|
@@ -12,6 +12,7 @@ const theme = tv({
|
|
|
12
12
|
base: [
|
|
13
13
|
"relative inline-flex h-[var(--ui-switch-height)] w-[var(--ui-switch-width)] shrink-0 select-none overflow-visible rounded-[100px] border-0 bg-transparent p-0 text-inherit",
|
|
14
14
|
"[container-type:inline-size]",
|
|
15
|
+
"[--ui-glass-edge-shadow:inset_1px_-1px_2px_rgb(255_255_255/0.55),inset_-1px_1px_2px_rgb(0_0_0/0.18),0_1px_3px_rgb(0_0_0/0.2)]",
|
|
15
16
|
"[--ui-switch-off:color-mix(in_srgb,var(--ui-ink)_20%,transparent)] [--ui-switch-on:var(--ui-ink)]",
|
|
16
17
|
"group-focus-visible:outline-2 group-focus-visible:outline-offset-4 group-focus-visible:outline-ui-glass-focus",
|
|
17
18
|
"[&_*]:pointer-events-none",
|
|
@@ -49,6 +50,7 @@ const theme = tv({
|
|
|
49
50
|
],
|
|
50
51
|
thumb: [
|
|
51
52
|
"absolute left-[var(--ui-switch-border)] top-1/2 h-[calc(100%_-_2*var(--ui-switch-border))] w-[calc(60%_-_2*var(--ui-switch-border))] rounded-[100px] bg-transparent [box-shadow:var(--ui-glass-thumb-shadow)]",
|
|
53
|
+
"[--ui-glass-thumb-shadow:0_1px_3px_rgb(0_0_0/0.2),inset_0_0_0_1px_rgb(255_255_255/0.55)]",
|
|
52
54
|
"[container-type:inline-size]",
|
|
53
55
|
"[translate:0_-50%] group-data-[checked]:[translate:calc(100cqi_-_100%_-_2*var(--ui-switch-border))_-50%]",
|
|
54
56
|
"[transition:translate_120ms_ease-out_180ms,scale_300ms_ease-out]",
|
package/dist/theme/toast.mjs
CHANGED
|
@@ -8,7 +8,7 @@ export default tv({
|
|
|
8
8
|
"[--shrink:calc(1_-_var(--scale))]",
|
|
9
9
|
"[--height:var(--toast-frontmost-height,var(--toast-height))]",
|
|
10
10
|
"absolute inset-x-0 isolate h-[var(--height)] w-full rounded-[1.25rem]",
|
|
11
|
-
"bg-ui-
|
|
11
|
+
"bg-ui-surface text-ui-ink select-none",
|
|
12
12
|
"z-[calc(1000-var(--toast-index))]",
|
|
13
13
|
"[transition:transform_500ms_cubic-bezier(0.22,1,0.36,1),opacity_500ms,height_150ms]",
|
|
14
14
|
"data-[expanded]:h-[var(--toast-height)]",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xingxingmofashu/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Accessible React components with a Liquid Glass visual style for React 19 and Tailwind CSS 4.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "xingxingmofashu",
|
|
@@ -55,9 +55,14 @@
|
|
|
55
55
|
"react",
|
|
56
56
|
"ui",
|
|
57
57
|
"components",
|
|
58
|
+
"component-library",
|
|
59
|
+
"react-components",
|
|
60
|
+
"design-system",
|
|
58
61
|
"tailwindcss",
|
|
59
62
|
"liquid-glass",
|
|
60
|
-
"base-ui"
|
|
63
|
+
"base-ui",
|
|
64
|
+
"tailwind-variants",
|
|
65
|
+
"accessible"
|
|
61
66
|
],
|
|
62
67
|
"publishConfig": {
|
|
63
68
|
"access": "public"
|