@glass-sdk/liquid-glass 0.0.0-stage → 0.0.2
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/LICENSE +21 -0
- package/README.md +235 -2
- package/dist/core/concentric.js +86 -0
- package/dist/core/materials.js +41 -0
- package/dist/core/morph-path.js +206 -0
- package/dist/core/optics.js +7 -0
- package/dist/core/progressive.js +35 -0
- package/dist/core/shape.js +95 -0
- package/dist/core/spring.js +78 -0
- package/dist/core/union.js +117 -0
- package/dist/core.js +6 -0
- package/dist/dom/compose-layers.js +54 -0
- package/dist/dom/compound-field.js +23 -0
- package/dist/dom/control-motion.js +101 -0
- package/dist/dom/engine.js +7 -0
- package/dist/dom/exit-handoff.js +14 -0
- package/dist/dom/filter-bounds.js +87 -0
- package/dist/dom/filter-budget.js +45 -0
- package/dist/dom/filter-groups.js +38 -0
- package/dist/dom/filter-paint-root.js +41 -0
- package/dist/dom/filter-patch.js +129 -0
- package/dist/dom/filter-reach.js +36 -0
- package/dist/dom/filter-stages.js +7 -0
- package/dist/dom/fixed-shape.js +20 -0
- package/dist/dom/foreground.js +36 -0
- package/dist/dom/interaction.js +129 -0
- package/dist/dom/lens-layers.js +163 -0
- package/dist/dom/map-blend.js +8 -0
- package/dist/dom/map-encoder.js +47 -0
- package/dist/dom/map-encoder.worker.js +16 -0
- package/dist/dom/map-encoding.js +17 -0
- package/dist/dom/map-image.js +34 -0
- package/dist/dom/map-store.js +189 -0
- package/dist/dom/maps.js +131 -0
- package/dist/dom/material-graph.js +52 -0
- package/dist/dom/morph.js +296 -0
- package/dist/dom/page-zoom.js +46 -0
- package/dist/dom/png.js +105 -0
- package/dist/dom/progressive.js +299 -0
- package/dist/dom/renderer.js +6 -0
- package/dist/dom/sampling-bounds.js +22 -0
- package/dist/dom/selection.js +106 -0
- package/dist/dom/shape-layout.js +199 -0
- package/dist/dom/shared-backdrop.js +41 -0
- package/dist/dom/ticker.js +103 -0
- package/dist/dom/warm.js +108 -0
- package/dist/dom.js +694 -0
- package/dist/gpu/geometry.js +9 -0
- package/dist/gpu/maps.js +8 -0
- package/dist/gpu/planes.js +4 -0
- package/dist/gpu.js +213 -0
- package/dist/index.js +11 -0
- package/dist/react/button.js +23 -0
- package/dist/react/control-thumb.js +50 -0
- package/dist/react/menu.js +159 -0
- package/dist/react/merged-ref.js +18 -0
- package/dist/react/progressive.js +73 -0
- package/dist/react/scene.js +122 -0
- package/dist/react/shape.js +93 -0
- package/dist/react/surface.js +69 -0
- package/dist/react/tabs.js +94 -0
- package/dist/react/toolbar.js +145 -0
- package/dist/react/value-control-motion.js +9 -0
- package/dist/react/value-controls.js +176 -0
- package/dist/styles.css +360 -0
- package/dist/styles.d.css.ts +2 -0
- package/dist/types/core/concentric.d.ts +32 -0
- package/dist/types/core/index.d.ts +10 -0
- package/dist/types/core/materials.d.ts +43 -0
- package/dist/types/core/morph-path.d.ts +110 -0
- package/dist/types/core/optics.d.ts +1 -0
- package/dist/types/core/progressive.d.ts +17 -0
- package/dist/types/core/shape.d.ts +16 -0
- package/dist/types/core/spring.d.ts +60 -0
- package/dist/types/core/union.d.ts +20 -0
- package/dist/types/dom/compose-layers.d.ts +15 -0
- package/dist/types/dom/compound-field.d.ts +35 -0
- package/dist/types/dom/control-motion.d.ts +13 -0
- package/dist/types/dom/engine.d.ts +9 -0
- package/dist/types/dom/exit-handoff.d.ts +7 -0
- package/dist/types/dom/filter-bounds.d.ts +30 -0
- package/dist/types/dom/filter-budget.d.ts +20 -0
- package/dist/types/dom/filter-groups.d.ts +25 -0
- package/dist/types/dom/filter-paint-root.d.ts +9 -0
- package/dist/types/dom/filter-patch.d.ts +4 -0
- package/dist/types/dom/filter-reach.d.ts +23 -0
- package/dist/types/dom/filter-stages.d.ts +5 -0
- package/dist/types/dom/fixed-shape.d.ts +3 -0
- package/dist/types/dom/foreground.d.ts +20 -0
- package/dist/types/dom/index.d.ts +64 -0
- package/dist/types/dom/interaction.d.ts +16 -0
- package/dist/types/dom/lens-layers.d.ts +68 -0
- package/dist/types/dom/map-blend.d.ts +22 -0
- package/dist/types/dom/map-encoder.d.ts +5 -0
- package/dist/types/dom/map-encoder.worker.d.ts +1 -0
- package/dist/types/dom/map-encoding.d.ts +5 -0
- package/dist/types/dom/map-image.d.ts +17 -0
- package/dist/types/dom/map-store.d.ts +22 -0
- package/dist/types/dom/maps.d.ts +31 -0
- package/dist/types/dom/material-graph.d.ts +22 -0
- package/dist/types/dom/morph.d.ts +78 -0
- package/dist/types/dom/page-zoom.d.ts +18 -0
- package/dist/types/dom/png.d.ts +9 -0
- package/dist/types/dom/progressive.d.ts +42 -0
- package/dist/types/dom/renderer.d.ts +4 -0
- package/dist/types/dom/sampling-bounds.d.ts +10 -0
- package/dist/types/dom/selection.d.ts +5 -0
- package/dist/types/dom/shape-layout.d.ts +29 -0
- package/dist/types/dom/shared-backdrop.d.ts +19 -0
- package/dist/types/dom/ticker.d.ts +36 -0
- package/dist/types/dom/warm.d.ts +17 -0
- package/dist/types/gpu/geometry.d.ts +17 -0
- package/dist/types/gpu/index.d.ts +36 -0
- package/dist/types/gpu/planes.d.ts +2 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/react/button.d.ts +11 -0
- package/dist/types/react/control-thumb.d.ts +11 -0
- package/dist/types/react/index.d.ts +20 -0
- package/dist/types/react/menu.d.ts +29 -0
- package/dist/types/react/merged-ref.d.ts +3 -0
- package/dist/types/react/progressive.d.ts +15 -0
- package/dist/types/react/scene.d.ts +35 -0
- package/dist/types/react/shape.d.ts +23 -0
- package/dist/types/react/surface.d.ts +35 -0
- package/dist/types/react/tabs.d.ts +29 -0
- package/dist/types/react/toolbar.d.ts +21 -0
- package/dist/types/react/value-control-motion.d.ts +9 -0
- package/dist/types/react/value-controls.d.ts +20 -0
- package/package.json +80 -4
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { HTMLAttributes, Ref, RefObject } from "react";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
import type { GlassMotion, GlassMorph } from "../dom/index.js";
|
|
4
|
+
import type { MaterialOptions } from "../core/materials.js";
|
|
5
|
+
/** How a glass surface moves. Every option is available to any surface. */
|
|
6
|
+
export interface GlassMotionProps {
|
|
7
|
+
/** Respond to touch and pointer input: grow under a press, stretch toward a
|
|
8
|
+
* drag, settle with overshoot on release, and light up beneath the pointer. */
|
|
9
|
+
interactive?: boolean;
|
|
10
|
+
/** Grow out of this element when mounted, and shrink back into it when a
|
|
11
|
+
* Base UI popup closes. */
|
|
12
|
+
morphFrom?: RefObject<Element | null> | (() => Element | null | undefined);
|
|
13
|
+
/** How the surface relates to the glass it grows from. `become`: the
|
|
14
|
+
* source's glass is this surface; its content withdraws while the surface
|
|
15
|
+
* is present. `detach`: the surface leaves the source's glass as a drop,
|
|
16
|
+
* joined by a liquid neck until they part. Default: a glass source is
|
|
17
|
+
* become; a source inside glass, such as a toolbar button, is detached from. */
|
|
18
|
+
morph?: GlassMorph;
|
|
19
|
+
/** How far a detaching surface stays joined to its glass by a liquid neck,
|
|
20
|
+
* in pixels. `0` grows a plain shape with no union. Default: 18. */
|
|
21
|
+
neck?: number;
|
|
22
|
+
/** Grow out of `morphFrom` when mounted. `false` keeps only the exit, for
|
|
23
|
+
* an element that is already in place. Default: true. */
|
|
24
|
+
morphEnter?: boolean;
|
|
25
|
+
/** Spring the glass outline when the surface's layout box changes. */
|
|
26
|
+
fluid?: boolean;
|
|
27
|
+
/** Override the scene's motion level for this surface. */
|
|
28
|
+
motion?: GlassMotion;
|
|
29
|
+
}
|
|
30
|
+
export interface GlassSurfaceProps extends HTMLAttributes<HTMLElement>, MaterialOptions, GlassMotionProps {
|
|
31
|
+
render?: useRender.RenderProp;
|
|
32
|
+
ref?: Ref<HTMLElement>;
|
|
33
|
+
}
|
|
34
|
+
/** Pass a shadcn component with render={<Button/>}; geometry follows its real DOM. */
|
|
35
|
+
export declare function GlassSurface({ material, appearance, radius, concentric, refraction, tint, interactive, morphFrom, morph, neck, morphEnter, fluid, motion, render, ref, children, className, style, ...props }: GlassSurfaceProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
|
|
2
|
+
import { Tabs } from "@base-ui/react/tabs";
|
|
3
|
+
import type { MaterialOptions } from "../core/materials.js";
|
|
4
|
+
import type { GlassMotionProps } from "./surface.js";
|
|
5
|
+
export declare const GlassTabsRoot: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react/tabs").TabsRootProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export declare const GlassTabsContent: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react/tabs").TabsPanelProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export interface GlassTabsListProps extends Omit<ComponentPropsWithRef<typeof Tabs.List>, "className" | "style">, MaterialOptions, Pick<GlassMotionProps, "interactive" | "motion"> {
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: CSSProperties;
|
|
10
|
+
size?: "default" | "sm" | "lg";
|
|
11
|
+
}
|
|
12
|
+
export declare function GlassTabsList({ material, appearance, radius, refraction, tint, interactive, motion, size, className, style, children, ...props }: GlassTabsListProps): import("react").JSX.Element;
|
|
13
|
+
export declare function GlassTabsIndicator({ material, appearance, radius, refraction, tint, motion, className, style, ref, ...props }: Omit<ComponentPropsWithRef<typeof Tabs.Indicator>, "className" | "style"> & MaterialOptions & Pick<GlassMotionProps, "motion"> & {
|
|
14
|
+
className?: string;
|
|
15
|
+
style?: CSSProperties;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
export declare function GlassTabsTrigger({ children, className, ...props }: ComponentPropsWithRef<typeof Tabs.Tab>): import("react").JSX.Element;
|
|
18
|
+
export interface GlassTabsProps extends Omit<ComponentPropsWithRef<typeof Tabs.Root>, "children" | "className" | "style">, MaterialOptions, Pick<GlassMotionProps, "interactive" | "motion"> {
|
|
19
|
+
items: readonly {
|
|
20
|
+
value: string;
|
|
21
|
+
label: ReactNode;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
}[];
|
|
24
|
+
"aria-label"?: string;
|
|
25
|
+
className?: string;
|
|
26
|
+
style?: CSSProperties;
|
|
27
|
+
size?: "default" | "sm" | "lg";
|
|
28
|
+
}
|
|
29
|
+
export declare function GlassTabs({ items, defaultValue, material, appearance, radius, refraction, tint, interactive, motion, size, className, "aria-label": label, ...props }: GlassTabsProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { CSSProperties, ComponentPropsWithRef } from "react";
|
|
2
|
+
import { Toolbar } from "@base-ui/react/toolbar";
|
|
3
|
+
import type { MaterialOptions } from "../core/materials.js";
|
|
4
|
+
import type { GlassMotionProps } from "./surface.js";
|
|
5
|
+
export interface GlassToolbarProps extends Omit<ComponentPropsWithRef<typeof Toolbar.Root>, "className" | "style">, MaterialOptions, Pick<GlassMotionProps, "interactive" | "motion"> {
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: CSSProperties;
|
|
8
|
+
}
|
|
9
|
+
export declare function GlassToolbar({ material, appearance, radius, refraction, tint, interactive, motion, className, style, children, ...props }: GlassToolbarProps): import("react").JSX.Element;
|
|
10
|
+
export interface GlassToolbarButtonProps extends ComponentPropsWithRef<typeof Toolbar.Button> {
|
|
11
|
+
/** Icon controls remain square; default controls fit their text. */
|
|
12
|
+
size?: "icon" | "default";
|
|
13
|
+
}
|
|
14
|
+
export declare function GlassToolbarButton({ className, size, ...props }: GlassToolbarButtonProps): import("react").JSX.Element;
|
|
15
|
+
export declare const GlassToolbarLink: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react/toolbar").ToolbarLinkProps, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
16
|
+
export declare const GlassToolbarGroup: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react/toolbar").ToolbarGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
17
|
+
export interface GlassToolbarSpacerProps extends Omit<ComponentPropsWithRef<"span">, "children"> {
|
|
18
|
+
/** Flexible spacers fill available space; fixed spacers keep a standard gap. */
|
|
19
|
+
sizing?: "fixed" | "flexible";
|
|
20
|
+
}
|
|
21
|
+
export declare function GlassToolbarSpacer({ sizing, className, ...props }: GlassToolbarSpacerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Native AppKit tracking: midpoint crossing, or 40% travel from an opposite-half press. */
|
|
2
|
+
export declare function switchDragState(drag: {
|
|
3
|
+
start: number;
|
|
4
|
+
x: number;
|
|
5
|
+
left: number;
|
|
6
|
+
width: number;
|
|
7
|
+
rtl: boolean;
|
|
8
|
+
oppositeHalf: boolean;
|
|
9
|
+
}, x: number): boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, CSSProperties } from "react";
|
|
2
|
+
import { Slider } from "@base-ui/react/slider";
|
|
3
|
+
import { Switch } from "@base-ui/react/switch";
|
|
4
|
+
import type { ControlMotionOptions } from "../dom/control-motion.js";
|
|
5
|
+
import type { MaterialOptions } from "../core/materials.js";
|
|
6
|
+
export interface GlassSliderProps extends Omit<Slider.Root.Props<number>, "className" | "style" | "children" | "disabled">, MaterialOptions, ControlMotionOptions {
|
|
7
|
+
className?: string;
|
|
8
|
+
style?: CSSProperties;
|
|
9
|
+
/** Visible marks at each step. Limited to 101 marks. */
|
|
10
|
+
ticks?: boolean;
|
|
11
|
+
/** Props and accessible name forwarded to the slider input. */
|
|
12
|
+
thumbProps?: Omit<ComponentPropsWithRef<typeof Slider.Thumb>, "render" | "children" | "disabled">;
|
|
13
|
+
}
|
|
14
|
+
/** Single-value slider; use a small numeric step for continuous pointer travel. */
|
|
15
|
+
export declare function GlassSlider({ material, appearance, tint, refraction, radius, motion, interactive, className, style, ticks, min, max, step, thumbProps, "aria-label": ariaLabel, "aria-labelledby": labelledBy, ...props }: GlassSliderProps): import("react").JSX.Element;
|
|
16
|
+
export interface GlassSwitchProps extends Omit<ComponentPropsWithRef<typeof Switch.Root>, "className" | "style" | "children" | "render" | "nativeButton" | "disabled">, MaterialOptions, ControlMotionOptions {
|
|
17
|
+
className?: string;
|
|
18
|
+
style?: CSSProperties;
|
|
19
|
+
}
|
|
20
|
+
export declare function GlassSwitch({ material, appearance, tint, refraction, radius, motion, interactive, className, style, ...props }: GlassSwitchProps): import("react").JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,82 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glass-sdk/liquid-glass",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist",
|
|
8
|
+
"README.md",
|
|
9
|
+
"LICENSE"
|
|
10
|
+
],
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/types/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./core": {
|
|
17
|
+
"types": "./dist/types/core/index.d.ts",
|
|
18
|
+
"import": "./dist/core.js"
|
|
19
|
+
},
|
|
20
|
+
"./gpu": {
|
|
21
|
+
"types": "./dist/types/gpu/index.d.ts",
|
|
22
|
+
"import": "./dist/gpu.js"
|
|
23
|
+
},
|
|
24
|
+
"./dom": {
|
|
25
|
+
"types": "./dist/types/dom/index.d.ts",
|
|
26
|
+
"import": "./dist/dom.js"
|
|
27
|
+
},
|
|
28
|
+
"./styles.css": {
|
|
29
|
+
"types": "./dist/styles.d.css.ts",
|
|
30
|
+
"default": "./dist/styles.css"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "vite build && tsc -p tsconfig.json && cp src/styles.css dist/styles.css && cp src/styles.d.css.ts dist/styles.d.css.ts",
|
|
35
|
+
"typecheck": "tsc -p tsconfig.json --noEmit --emitDeclarationOnly false",
|
|
36
|
+
"dev": "vite build --watch --emptyOutDir false",
|
|
37
|
+
"prepack": "bun run build",
|
|
38
|
+
"prepublishOnly": "node scripts/check-version.mjs"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@base-ui/react": "^1.8.0",
|
|
42
|
+
"@lisse/core": "^0.7.2",
|
|
43
|
+
"vgpu": "^0.5.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/react": "^19.3.0",
|
|
47
|
+
"@types/react-dom": "^19.3.0",
|
|
48
|
+
"@vgpu/wgsl": "^0.5.0",
|
|
49
|
+
"typescript": "^7.0.2",
|
|
50
|
+
"vite": "^8.3.2",
|
|
51
|
+
"react": "^19.3.0",
|
|
52
|
+
"react-dom": "^19.3.0"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"react": ">=19.0.0",
|
|
56
|
+
"react-dom": ">=19.0.0"
|
|
57
|
+
},
|
|
58
|
+
"description": "Liquid Glass materials and accessible React components for the web and Electron, built with vgpu and WGSL.",
|
|
59
|
+
"homepage": "https://liquid-glass.glassapp.dev",
|
|
60
|
+
"repository": {
|
|
61
|
+
"type": "git",
|
|
62
|
+
"url": "git+https://github.com/Glass-HQ/liquid-glass.git",
|
|
63
|
+
"directory": "packages/liquid-glass"
|
|
64
|
+
},
|
|
65
|
+
"bugs": {
|
|
66
|
+
"url": "https://github.com/Glass-HQ/liquid-glass/issues"
|
|
67
|
+
},
|
|
68
|
+
"publishConfig": {
|
|
69
|
+
"access": "public"
|
|
70
|
+
},
|
|
71
|
+
"sideEffects": [
|
|
72
|
+
"**/*.css"
|
|
73
|
+
],
|
|
74
|
+
"keywords": [
|
|
75
|
+
"liquid-glass",
|
|
76
|
+
"vgpu",
|
|
77
|
+
"webgpu",
|
|
78
|
+
"react",
|
|
79
|
+
"electron",
|
|
80
|
+
"refraction"
|
|
81
|
+
]
|
|
82
|
+
}
|