@phreshos/react-ui 0.1.5 → 0.1.6
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 +2 -0
- package/dist/surface.js +6 -10
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -105,6 +105,8 @@ same source and a direct color remains an explicit local override. `grain`,
|
|
|
105
105
|
their semantic levels or direct values, and remain bounded by Core's Theme
|
|
106
106
|
limits. Radius and foreground remain ordinary Theme styles. Grain intensity
|
|
107
107
|
controls tonal distance while grain amount controls retained cell density.
|
|
108
|
+
Each Surface owns one uniform one-pixel inset edge derived from its resolved
|
|
109
|
+
material color; consumers supply only their radius and do not redraw the edge.
|
|
108
110
|
When either is zero, Surface creates no grain pattern or paths. Refraction and
|
|
109
111
|
native frost use independent backdrop layers so blur does not soften the
|
|
110
112
|
displaced image. Enabled organic, wave, and ripple fields are combined
|
package/dist/surface.js
CHANGED
|
@@ -9,7 +9,6 @@ const layerStyle = {
|
|
|
9
9
|
borderRadius: "inherit",
|
|
10
10
|
pointerEvents: "none"
|
|
11
11
|
};
|
|
12
|
-
const borderOpacity = 0.3;
|
|
13
12
|
/** Contains content above locally owned Surface material layers. */
|
|
14
13
|
export const Surface = forwardRef(function Surface({ animation, backdrop, brightness, children, color, distortion, grain, grainAmount, opacity, ripples, saturation, style, waves, ...properties }, forwardedRef) {
|
|
15
14
|
const theme = useTheme();
|
|
@@ -32,20 +31,17 @@ export const Surface = forwardRef(function Surface({ animation, backdrop, bright
|
|
|
32
31
|
borderRadius: theme.radius,
|
|
33
32
|
color: theme.foreground,
|
|
34
33
|
...style
|
|
35
|
-
}, children: [resolved.refracts && _jsx(BackdropLayer, { name: "refraction", filter: `url("#${identity}-distortion")`, zIndex: -3 }), resolved.frost && _jsx(BackdropLayer, { name: "frost", filter: resolved.frost, zIndex: -2 }), _jsx(SurfaceBorder, { color: resolved.material.color }), _jsx(SurfaceMaterial, { identity: identity, ...resolved.material }), children] });
|
|
34
|
+
}, children: [resolved.refracts && _jsx(BackdropLayer, { name: "refraction", filter: `url("#${identity}-distortion")`, zIndex: -3 }), resolved.frost && _jsx(BackdropLayer, { name: "frost", filter: resolved.frost, zIndex: -2 }), _jsx(SurfaceBorder, { color: resolved.material.color, opacity: resolveScale("large", resolved.material.opacity, themeLimits.surface.opacity) }), _jsx(SurfaceMaterial, { identity: identity, ...resolved.material }), children] });
|
|
36
35
|
});
|
|
37
|
-
/** Draws one
|
|
38
|
-
function SurfaceBorder({ color }) {
|
|
39
|
-
const
|
|
40
|
-
const shade = `color-mix(in oklch, ${color} 94%, black)`;
|
|
36
|
+
/** Draws one uniform inset edge from the same color as the Surface material. */
|
|
37
|
+
function SurfaceBorder({ color, opacity }) {
|
|
38
|
+
const edge = `color-mix(in oklch, ${color} 94%, black)`;
|
|
41
39
|
return _jsx("div", { "data-surface-border": "", "aria-hidden": "true", style: {
|
|
42
40
|
...layerStyle,
|
|
43
41
|
zIndex: 0,
|
|
44
|
-
borderStyle: "solid",
|
|
45
|
-
borderWidth: 1,
|
|
46
|
-
borderColor: `${highlight} ${shade} ${shade} ${highlight}`,
|
|
47
42
|
boxSizing: "border-box",
|
|
48
|
-
|
|
43
|
+
boxShadow: `inset 0 0 0 1px ${edge}`,
|
|
44
|
+
opacity
|
|
49
45
|
} });
|
|
50
46
|
}
|
|
51
47
|
/** Keeps refraction and native frost in independent compositor passes. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phreshos/react-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "React components for coherent PhreshOS Program interfaces.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"prepack": "node --run test && node --run build"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@phreshos/core": "^0.1.
|
|
55
|
+
"@phreshos/core": "^0.1.13",
|
|
56
56
|
"react": "^19.2.0",
|
|
57
57
|
"react-dom": "^19.2.0"
|
|
58
58
|
},
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@base-ui/react": "^1.7.0",
|
|
64
|
-
"@phreshos/core": "^0.1.
|
|
64
|
+
"@phreshos/core": "^0.1.13",
|
|
65
65
|
"@testing-library/dom": "^10.4.1",
|
|
66
66
|
"@testing-library/react": "^16.3.0",
|
|
67
67
|
"@testing-library/user-event": "^14.6.1",
|