@plexui/react-native 0.2.20 → 0.2.22

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.
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/build-icons.mjs. Do not edit.
2
+ import { createIcon } from "../../components/Icon/createIcon";
3
+ export default createIcon("Android", "0 0 24 24", [["path", { "d": "M 7.9296875 2.0019531 A 1 1 0 0 0 7.5527344 2.1054688 A 1 1 0 0 0 7.1054688 3.4472656 L 7.7167969 4.6699219 C 6.6752684 5.6871056 6 7.1864755 6 9 L 6 17 C 6 18.092725 6.9072751 19 8 19 L 8 21 A 1 1 0 0 0 9 22 A 1 1 0 0 0 10 21 L 10 19 L 14 19 L 14 21 A 1 1 0 0 0 15 22 A 1 1 0 0 0 16 21 L 16 19 C 17.092725 19 18 18.092725 18 17 L 18 9 C 18 7.1864756 17.324732 5.6871056 16.283203 4.6699219 L 16.894531 3.4472656 A 1 1 0 0 0 16.447266 2.1054688 A 1 1 0 0 0 15.105469 2.5527344 L 14.609375 3.5429688 C 13.787069 3.1769755 12.891329 3 12 3 C 11.108671 3 10.212931 3.1769756 9.390625 3.5429688 L 8.8945312 2.5527344 A 1 1 0 0 0 8.3164062 2.0507812 A 1 1 0 0 0 7.9296875 2.0019531 z M 12 5 C 12.771225 5 13.535546 5.1958755 14.177734 5.5683594 A 1 1 0 0 0 14.552734 5.8945312 A 1 1 0 0 0 14.734375 5.9648438 C 14.747268 5.9759697 14.760715 5.9867378 14.773438 5.9980469 C 15.300388 6.4664477 15.6256 7.161876 15.810547 8 L 8.1894531 8 C 8.3743998 7.161876 8.6996114 6.4664477 9.2265625 5.9980469 C 9.2392854 5.9867377 9.2527322 5.9759699 9.265625 5.9648438 A 1 1 0 0 0 9.4472656 5.8945312 A 1 1 0 0 0 9.8222656 5.5683594 C 10.464454 5.1958754 11.228775 5 12 5 z M 4 9 A 1 1 0 0 0 3 10 L 3 16 A 1 1 0 0 0 4 17 A 1 1 0 0 0 5 16 L 5 10 A 1 1 0 0 0 4 9 z M 20 9 A 1 1 0 0 0 19 10 L 19 16 A 1 1 0 0 0 20 17 A 1 1 0 0 0 21 16 L 21 10 A 1 1 0 0 0 20 9 z M 8 10 L 16 10 L 16 17 L 15 17 L 8 17 L 8 10 z", "fill": 0 }]]);
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/build-icons.mjs. Do not edit.
2
+ import { createIcon } from "../../components/Icon/createIcon";
3
+ export default createIcon("Apple", "0 0 24 24", [["path", { "d": "M 14 1 C 12.35499 1 11 2.3549904 11 4 A 1 1 0 0 0 12 5 C 13.64501 5 15 3.6450096 15 2 A 1.0001 1.0001 0 0 0 14 1 z M 14.939453 6 C 14.054078 6.0164983 13.286046 6.3178084 12.671875 6.5839844 C 12.121436 6.8225391 11.592494 6.9949369 11.484375 7.0585938 C 11.364264 7.0019627 10.940472 6.8581138 10.492188 6.6445312 C 9.9038525 6.3642232 9.1789101 6.0078125 8.2851562 6.0078125 C 6.3423717 6.0078125 4.875047 7.0850187 4.0742188 8.453125 C 3.2733906 9.8212313 3 11.450145 3 12.927734 C 3 14.763459 3.5705956 16.867828 4.4433594 18.621094 C 4.8797412 19.497726 5.3918886 20.283716 6.0039062 20.898438 C 6.615924 21.51316 7.3727535 22 8.2851562 22 A 1.0001 1.0001 0 0 0 8.328125 22 C 9.0421041 21.96936 9.5938728 21.801123 10.056641 21.677734 C 10.519408 21.554346 10.907459 21.462891 11.5 21.462891 C 12.075451 21.462891 12.292867 21.547671 12.730469 21.685547 C 13.16807 21.823427 13.799749 22 14.714844 22 C 15.451483 22 16.063409 21.684809 16.638672 21.279297 C 17.213935 20.873785 17.751743 20.345128 18.236328 19.746094 C 19.205498 18.548025 20 17.110103 20 15.619141 A 1.0001 1.0001 0 0 0 19.34375 14.679688 C 19.343281 14.679516 19.22472 14.645208 19.212891 14.642578 C 19.201061 14.639978 19.197809 14.637719 19.193359 14.636719 C 19.184459 14.634919 19.178905 14.634312 19.171875 14.632812 C 19.157815 14.629812 19.138611 14.625311 19.113281 14.619141 C 19.062611 14.606851 18.986898 14.587981 18.894531 14.556641 C 18.709798 14.493971 18.461868 14.385507 18.228516 14.224609 C 17.761812 13.902815 17.331969 13.465269 17.320312 12.378906 C 17.314312 11.586158 17.716646 11.105099 18.228516 10.710938 C 18.484687 10.513673 18.759281 10.360565 18.970703 10.259766 C 19.076414 10.209366 19.165311 10.171676 19.232422 10.144531 C 19.265972 10.130961 19.294142 10.121598 19.320312 10.111328 C 19.321948 10.110686 19.325087 10.109675 19.326172 10.109375 L 19.328125 10.109375 L 19.330078 10.109375 L 19.332031 10.111328 L 19.333984 10.111328 L 19.335938 10.111328 C 19.345609 10.10951 19.373652 10.096151 19.478516 10.039062 A 1.0001 1.0001 0 0 0 19.826172 8.5976562 C 19.140879 7.5934768 18.191582 6.9729745 17.349609 6.5878906 C 16.511594 6.2046169 15.827858 6.0467596 15.328125 6.0117188 L 15.326172 6.0117188 C 15.195014 6.0015389 15.065935 5.9976431 14.939453 6 z M 14.984375 8.0019531 C 15.048664 7.9999269 15.111282 8.0011224 15.171875 8.0058594 A 1.0001 1.0001 0 0 0 15.181641 8.0058594 C 15.269331 8.0118294 15.907504 8.1263338 16.519531 8.40625 C 16.786935 8.5285493 16.987132 8.7996549 17.242188 8.9824219 C 17.158207 9.0399689 17.095493 9.0589859 17.009766 9.125 C 16.200109 9.7484721 15.307113 10.857498 15.320312 12.398438 A 1.0001 1.0001 0 0 0 15.320312 12.400391 C 15.338653 14.110027 16.235954 15.279639 17.09375 15.871094 C 17.331641 16.035121 17.52177 16.092546 17.736328 16.191406 C 17.572161 16.881284 17.299652 17.724307 16.681641 18.488281 C 16.2956 18.965497 15.865346 19.377355 15.486328 19.644531 C 15.107276 19.91166 14.781705 20 14.714844 20 C 14.022939 20 13.748179 19.908464 13.332031 19.777344 C 12.915883 19.646224 12.330549 19.462891 11.5 19.462891 C 10.677541 19.462891 10.040248 19.612982 9.5410156 19.746094 C 9.0544997 19.875814 8.7099808 19.971185 8.2753906 19.994141 C 8.1146482 19.991469 7.8079929 19.876113 7.4199219 19.486328 C 7.0274083 19.092081 6.6016181 18.466258 6.234375 17.728516 C 5.4998887 16.253031 5 14.32101 5 12.927734 C 5 11.715324 5.2626094 10.384237 5.8007812 9.4648438 C 6.3389532 8.54545 7.0119407 8.0078125 8.2851562 8.0078125 C 8.5694024 8.0078125 9.0889439 8.1910267 9.6308594 8.4492188 C 10.172775 8.7074106 10.643045 9.0859375 11.5 9.0859375 C 12.41471 9.0859375 12.85745 8.6840068 13.466797 8.4199219 C 13.999975 8.1888475 14.534355 8.0161367 14.984375 8.0019531 z", "fill": 0 }]]);
@@ -0,0 +1,3 @@
1
+ // Generated by scripts/build-icons.mjs. Do not edit.
2
+ import { createIcon } from "../../components/Icon/createIcon";
3
+ export default createIcon("DeviceDesktop", "0 0 24 24", [["path", { "d": "M 4 3 C 2.9072751 3 2 3.9072751 2 5 L 2 15 C 2 16.092725 2.9072751 17 4 17 L 8 17 L 8 19 L 7 19 A 1 1 0 0 0 6 20 A 1 1 0 0 0 7 21 L 15 21 L 17 21 A 1 1 0 0 0 18 20 A 1 1 0 0 0 17 19 L 16 19 L 16 17 L 20 17 C 21.092725 17 22 16.092725 22 15 L 22 5 C 22 3.9072751 21.092725 3 20 3 L 4 3 z M 4 5 L 20 5 L 20 15 L 15 15 L 4 15 L 4 5 z M 10 17 L 14 17 L 14 19 L 10 19 L 10 17 z", "fill": 0 }]]);
@@ -10,6 +10,7 @@ export { default as AllGizmos } from "./AllGizmos";
10
10
  export { default as AllProductsExplore } from "./AllProductsExplore";
11
11
  export { default as Analytics } from "./Analytics";
12
12
  export { default as AnalyzeData } from "./AnalyzeData";
13
+ export { default as Android } from "./Android";
13
14
  export { default as ApiKey } from "./ApiKey";
14
15
  export { default as ApiKeyAdmin } from "./ApiKeyAdmin";
15
16
  export { default as ApiKeyPlus } from "./ApiKeyPlus";
@@ -18,6 +19,7 @@ export { default as ApiKeys } from "./ApiKeys";
18
19
  export { default as AppPermission } from "./AppPermission";
19
20
  export { default as AppStore } from "./AppStore";
20
21
  export { default as AppStoreSquare } from "./AppStoreSquare";
22
+ export { default as Apple } from "./Apple";
21
23
  export { default as Archive } from "./Archive";
22
24
  export { default as Array } from "./Array";
23
25
  export { default as ArrowBottomLeftSm } from "./ArrowBottomLeftSm";
@@ -181,6 +183,7 @@ export { default as Customize } from "./Customize";
181
183
  export { default as DarkMode } from "./DarkMode";
182
184
  export { default as DataControls } from "./DataControls";
183
185
  export { default as Desktop } from "./Desktop";
186
+ export { default as DeviceDesktop } from "./DeviceDesktop";
184
187
  export { default as DiceRandomize } from "./DiceRandomize";
185
188
  export { default as DiningEvents } from "./DiningEvents";
186
189
  export { default as DisabledCursor } from "./DisabledCursor";
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
2
3
  import { Animated, Platform, StyleSheet, View } from "react-native";
3
4
  import { useTheme, useThemeOverrides } from "../theme/ThemeProvider";
4
5
  import { blurModule, liquidGlassModule } from "./optional";
@@ -53,9 +54,35 @@ const WEB_LIQUID = {
53
54
  },
54
55
  lens: { token: "--mobile-glass-web-lens-filter", value: "blur(3px) brightness(1.12) saturate(200%)" },
55
56
  };
56
- // The lens: the glass's edge only, 14 in from its sides and 9 from its top and bottom (a small glass keeps a third)
57
- const lensMask = (inline, block) => `linear-gradient(to right, #000 0, transparent ${inline}px, transparent calc(100% - ${inline}px), #000 100%), ` +
58
- `linear-gradient(to bottom, #000 0, transparent ${block}px, transparent calc(100% - ${block}px), #000 100%)`;
57
+ /**
58
+ * The lens: the glass's edge only, fading in over 14 from its sides and 9 from its top and bottom (a small glass keeps
59
+ * a half and a third of its radius), along the glass's own shape. A ring whose hole is the glass's outline drawn
60
+ * smaller, blurred so its inner edge fades; bands across the box would leave a square in a round glass. The outline is
61
+ * the corner radius as the browser draws it, so no larger than half the glass's shorter side (a capsule's 999 is its
62
+ * height's half). A round glass (a bar button, a progress ring) keeps a thin rim of it: a ring as deep as a bar's
63
+ * reads on a small circle as a halo around a darker middle.
64
+ */
65
+ const lensMask = (width, height, radius) => {
66
+ const r = Math.max(0, Math.min(radius, width / 2, height / 2));
67
+ const round = r > 0 && Math.abs(width - height) <= 1 && r >= Math.min(width, height) / 2 - 0.5;
68
+ const inline = round ? r / 6 : Math.min(14, r > 0 ? r / 2 : 14);
69
+ const block = round ? r / 8 : Math.min(9, r > 0 ? r / 3 : 9);
70
+ const x = inline / 2;
71
+ const y = block / 2;
72
+ const w = Math.max(0, width - 2 * x);
73
+ const h = Math.max(0, height - 2 * y);
74
+ const rx = Math.max(0, Math.min(r - x, w / 2));
75
+ const ry = Math.max(0, Math.min(r - y, h / 2));
76
+ const f = (n) => +n.toFixed(2);
77
+ const hole = `M${f(x + rx)} ${f(y)}H${f(x + w - rx)}A${f(rx)} ${f(ry)} 0 0 1 ${f(x + w)} ${f(y + ry)}V${f(y + h - ry)}` +
78
+ `A${f(rx)} ${f(ry)} 0 0 1 ${f(x + w - rx)} ${f(y + h)}H${f(x + rx)}A${f(rx)} ${f(ry)} 0 0 1 ${f(x)} ${f(y + h - ry)}` +
79
+ `V${f(y + ry)}A${f(rx)} ${f(ry)} 0 0 1 ${f(x + rx)} ${f(y)}Z`;
80
+ // The outer edge stands 20 past the box, so the blur fades only the hole's edge; the glass's radius clips the rest
81
+ const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${f(width)}" height="${f(height)}">` +
82
+ `<filter id="e" x="-1" y="-1" width="3" height="3"><feGaussianBlur stdDeviation="${f(inline / 4)} ${f(block / 4)}"/></filter>` +
83
+ `<path filter="url(#e)" fill-rule="evenodd" d="M-20 -20H${f(width + 20)}V${f(height + 20)}H-20Z${hole}"/></svg>`;
84
+ return `url("data:image/svg+xml,${encodeURIComponent(svg)}")`;
85
+ };
59
86
  /** The filter and the shadow of the glass surfaces of the phone layer, by their fill (mobile-materials.css, touch.css). */
60
87
  const SURFACES = {
61
88
  "--menu-mobile-background": { filter: "--menu-mobile-backdrop-filter", shadow: "--menu-shadow" },
@@ -76,6 +103,8 @@ const intensityOf = (radius) => Math.max(0, Math.min(100, Math.round(radius * 5)
76
103
  */
77
104
  export function Glass({ radius = 0, elevation = "regular", tint, interactive, fillToken, filterToken, shadowToken, blur, style, children, ...rest }) {
78
105
  const theme = useTheme();
106
+ // The web lens's mask follows the glass's shape, so it needs the glass's size
107
+ const [size, setSize] = useState(null);
79
108
  const reduceTransparency = useReduceTransparency();
80
109
  const overrides = useThemeOverrides();
81
110
  const shape = { borderRadius: radius, borderCurve: "continuous" };
@@ -117,17 +146,24 @@ export function Glass({ radius = 0, elevation = "regular", tint, interactive, fi
117
146
  const sheen = liquid && tint == null ? own(WEB_LIQUID.sheen) : undefined;
118
147
  const lensToken = theme.token(WEB_LIQUID.lens.token);
119
148
  const lensFilter = typeof lensToken === "string" ? lensToken : WEB_LIQUID.lens.value;
120
- const mask = lensMask(Math.min(14, radius > 0 ? radius / 2 : 14), Math.min(9, radius > 0 ? radius / 3 : 9));
149
+ const mask = size != null && size.width > 0 && size.height > 0 ? lensMask(size.width, size.height, radius) : undefined;
121
150
  // An Animated.View, so a panel can move its own glass (a transform above the blur would stop it)
122
151
  return (_jsxs(Animated.View, { ...rest, style: [
123
152
  shape,
124
153
  { backgroundColor: fill, boxShadow: liquidShadow },
125
154
  { backdropFilter: filter, WebkitBackdropFilter: filter, backgroundImage: sheen },
126
155
  style,
127
- ], children: [liquid && lensFilter !== "none" ? (_jsx(View, { pointerEvents: "none", "aria-hidden": true, style: [
156
+ ], children: [liquid && lensFilter !== "none" ? (_jsx(View, { pointerEvents: "none", "aria-hidden": true, onLayout: (event) => {
157
+ const { width, height } = event.nativeEvent.layout;
158
+ if (size?.width !== width || size?.height !== height)
159
+ setSize({ width, height });
160
+ }, style: [
128
161
  StyleSheet.absoluteFill,
129
162
  shape,
130
- { backdropFilter: lensFilter, WebkitBackdropFilter: lensFilter, maskImage: mask, WebkitMaskImage: mask },
163
+ // Until the glass has a size, no lens: a lens unmasked would blur the whole glass
164
+ mask == null
165
+ ? null
166
+ : { backdropFilter: lensFilter, WebkitBackdropFilter: lensFilter, maskImage: mask, WebkitMaskImage: mask, maskSize: "100% 100%", WebkitMaskSize: "100% 100%" },
131
167
  ] })) : null, children] }));
132
168
  }
133
169
  const radiusPx = Number(/blur\(\s*([\d.]+)px\s*\)/.exec(filter)?.[1] ?? 12);
@@ -195,9 +195,10 @@ export function Overlay({ open, onDismiss, scrim = "transparent", dismissible =
195
195
  // action (Android's `setCancelable(false)`)
196
196
  _jsx(Modal, { visible: mounted, transparent: true, animationType: "none", onRequestClose: dismissible ? onDismiss : ignore, onDismiss: ios ? () => setPresented(false) : undefined, statusBarTranslucent: true, navigationBarTranslucent: true, supportedOrientations: ORIENTATIONS, children: mounted ? (
197
197
  // A closing overlay takes no more touches: an action cannot run twice while it fades
198
- _jsxs(View, { style: StyleSheet.absoluteFill, pointerEvents: show ? "box-none" : "none", onAccessibilityEscape: dismissible && show ? onDismiss : undefined, testID: testID, children: [_jsx(Animated.View, { pointerEvents: "none", style: [StyleSheet.absoluteFill, { backgroundColor: scrim, opacity: scrimOpacity ? scrimOpacity(progress, show) : progress }] }), _jsx(View, { importantForAccessibility: "no", "aria-hidden": true, style: StyleSheet.absoluteFill, onStartShouldSetResponder: dismissible && show ? yes : undefined, onResponderRelease: dismissible && show ? onDismiss : undefined, ...(Platform.OS === "web" ? { onTouchEnd: endTouch } : null), testID: testID ? `${testID}-scrim` : undefined }), children(progress, show, focus)] })) : null }));
198
+ _jsxs(View, { style: StyleSheet.absoluteFill, pointerEvents: show ? "box-none" : "none", onAccessibilityEscape: dismissible && show ? onDismiss : undefined, ...(Platform.OS === "web" ? { onClick: stopClick } : null), testID: testID, children: [_jsx(Animated.View, { pointerEvents: "none", style: [StyleSheet.absoluteFill, { backgroundColor: scrim, opacity: scrimOpacity ? scrimOpacity(progress, show) : progress }] }), _jsx(View, { importantForAccessibility: "no", "aria-hidden": true, style: StyleSheet.absoluteFill, onStartShouldSetResponder: dismissible && show ? yes : undefined, onResponderRelease: dismissible && show ? onDismiss : undefined, ...(Platform.OS === "web" ? { onTouchEnd: endTouch } : null), testID: testID ? `${testID}-scrim` : undefined }), children(progress, show, focus)] })) : null }));
199
199
  }
200
200
  const ignore = () => { };
201
+ const stopClick = (event) => event.stopPropagation?.();
201
202
  const endTouch = (event) => {
202
203
  if (event.cancelable !== false && event.nativeEvent?.cancelable !== false)
203
204
  event.preventDefault?.();
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../..").IconComponent;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../..").IconComponent;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../..").IconComponent;
2
+ export default _default;
@@ -8,6 +8,7 @@ export { default as AllGizmos } from "./AllGizmos";
8
8
  export { default as AllProductsExplore } from "./AllProductsExplore";
9
9
  export { default as Analytics } from "./Analytics";
10
10
  export { default as AnalyzeData } from "./AnalyzeData";
11
+ export { default as Android } from "./Android";
11
12
  export { default as ApiKey } from "./ApiKey";
12
13
  export { default as ApiKeyAdmin } from "./ApiKeyAdmin";
13
14
  export { default as ApiKeyPlus } from "./ApiKeyPlus";
@@ -16,6 +17,7 @@ export { default as ApiKeys } from "./ApiKeys";
16
17
  export { default as AppPermission } from "./AppPermission";
17
18
  export { default as AppStore } from "./AppStore";
18
19
  export { default as AppStoreSquare } from "./AppStoreSquare";
20
+ export { default as Apple } from "./Apple";
19
21
  export { default as Archive } from "./Archive";
20
22
  export { default as Array } from "./Array";
21
23
  export { default as ArrowBottomLeftSm } from "./ArrowBottomLeftSm";
@@ -179,6 +181,7 @@ export { default as Customize } from "./Customize";
179
181
  export { default as DarkMode } from "./DarkMode";
180
182
  export { default as DataControls } from "./DataControls";
181
183
  export { default as Desktop } from "./Desktop";
184
+ export { default as DeviceDesktop } from "./DeviceDesktop";
182
185
  export { default as DiceRandomize } from "./DiceRandomize";
183
186
  export { default as DiningEvents } from "./DiningEvents";
184
187
  export { default as DisabledCursor } from "./DisabledCursor";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plexui/react-native",
3
- "version": "0.2.20",
3
+ "version": "0.2.22",
4
4
  "description": "Plex UI components for React Native and Expo: iOS 26 and Material 3, on the shared @plexui/styles tokens",
5
5
  "license": "MIT",
6
6
  "homepage": "https://plexui.com",
@@ -0,0 +1,4 @@
1
+ // Generated by scripts/build-icons.mjs. Do not edit.
2
+ import { createIcon } from "../../components/Icon/createIcon"
3
+
4
+ export default createIcon("Android", "0 0 24 24", [["path",{"d":"M 7.9296875 2.0019531 A 1 1 0 0 0 7.5527344 2.1054688 A 1 1 0 0 0 7.1054688 3.4472656 L 7.7167969 4.6699219 C 6.6752684 5.6871056 6 7.1864755 6 9 L 6 17 C 6 18.092725 6.9072751 19 8 19 L 8 21 A 1 1 0 0 0 9 22 A 1 1 0 0 0 10 21 L 10 19 L 14 19 L 14 21 A 1 1 0 0 0 15 22 A 1 1 0 0 0 16 21 L 16 19 C 17.092725 19 18 18.092725 18 17 L 18 9 C 18 7.1864756 17.324732 5.6871056 16.283203 4.6699219 L 16.894531 3.4472656 A 1 1 0 0 0 16.447266 2.1054688 A 1 1 0 0 0 15.105469 2.5527344 L 14.609375 3.5429688 C 13.787069 3.1769755 12.891329 3 12 3 C 11.108671 3 10.212931 3.1769756 9.390625 3.5429688 L 8.8945312 2.5527344 A 1 1 0 0 0 8.3164062 2.0507812 A 1 1 0 0 0 7.9296875 2.0019531 z M 12 5 C 12.771225 5 13.535546 5.1958755 14.177734 5.5683594 A 1 1 0 0 0 14.552734 5.8945312 A 1 1 0 0 0 14.734375 5.9648438 C 14.747268 5.9759697 14.760715 5.9867378 14.773438 5.9980469 C 15.300388 6.4664477 15.6256 7.161876 15.810547 8 L 8.1894531 8 C 8.3743998 7.161876 8.6996114 6.4664477 9.2265625 5.9980469 C 9.2392854 5.9867377 9.2527322 5.9759699 9.265625 5.9648438 A 1 1 0 0 0 9.4472656 5.8945312 A 1 1 0 0 0 9.8222656 5.5683594 C 10.464454 5.1958754 11.228775 5 12 5 z M 4 9 A 1 1 0 0 0 3 10 L 3 16 A 1 1 0 0 0 4 17 A 1 1 0 0 0 5 16 L 5 10 A 1 1 0 0 0 4 9 z M 20 9 A 1 1 0 0 0 19 10 L 19 16 A 1 1 0 0 0 20 17 A 1 1 0 0 0 21 16 L 21 10 A 1 1 0 0 0 20 9 z M 8 10 L 16 10 L 16 17 L 15 17 L 8 17 L 8 10 z","fill":0}]])
@@ -0,0 +1,4 @@
1
+ // Generated by scripts/build-icons.mjs. Do not edit.
2
+ import { createIcon } from "../../components/Icon/createIcon"
3
+
4
+ export default createIcon("Apple", "0 0 24 24", [["path",{"d":"M 14 1 C 12.35499 1 11 2.3549904 11 4 A 1 1 0 0 0 12 5 C 13.64501 5 15 3.6450096 15 2 A 1.0001 1.0001 0 0 0 14 1 z M 14.939453 6 C 14.054078 6.0164983 13.286046 6.3178084 12.671875 6.5839844 C 12.121436 6.8225391 11.592494 6.9949369 11.484375 7.0585938 C 11.364264 7.0019627 10.940472 6.8581138 10.492188 6.6445312 C 9.9038525 6.3642232 9.1789101 6.0078125 8.2851562 6.0078125 C 6.3423717 6.0078125 4.875047 7.0850187 4.0742188 8.453125 C 3.2733906 9.8212313 3 11.450145 3 12.927734 C 3 14.763459 3.5705956 16.867828 4.4433594 18.621094 C 4.8797412 19.497726 5.3918886 20.283716 6.0039062 20.898438 C 6.615924 21.51316 7.3727535 22 8.2851562 22 A 1.0001 1.0001 0 0 0 8.328125 22 C 9.0421041 21.96936 9.5938728 21.801123 10.056641 21.677734 C 10.519408 21.554346 10.907459 21.462891 11.5 21.462891 C 12.075451 21.462891 12.292867 21.547671 12.730469 21.685547 C 13.16807 21.823427 13.799749 22 14.714844 22 C 15.451483 22 16.063409 21.684809 16.638672 21.279297 C 17.213935 20.873785 17.751743 20.345128 18.236328 19.746094 C 19.205498 18.548025 20 17.110103 20 15.619141 A 1.0001 1.0001 0 0 0 19.34375 14.679688 C 19.343281 14.679516 19.22472 14.645208 19.212891 14.642578 C 19.201061 14.639978 19.197809 14.637719 19.193359 14.636719 C 19.184459 14.634919 19.178905 14.634312 19.171875 14.632812 C 19.157815 14.629812 19.138611 14.625311 19.113281 14.619141 C 19.062611 14.606851 18.986898 14.587981 18.894531 14.556641 C 18.709798 14.493971 18.461868 14.385507 18.228516 14.224609 C 17.761812 13.902815 17.331969 13.465269 17.320312 12.378906 C 17.314312 11.586158 17.716646 11.105099 18.228516 10.710938 C 18.484687 10.513673 18.759281 10.360565 18.970703 10.259766 C 19.076414 10.209366 19.165311 10.171676 19.232422 10.144531 C 19.265972 10.130961 19.294142 10.121598 19.320312 10.111328 C 19.321948 10.110686 19.325087 10.109675 19.326172 10.109375 L 19.328125 10.109375 L 19.330078 10.109375 L 19.332031 10.111328 L 19.333984 10.111328 L 19.335938 10.111328 C 19.345609 10.10951 19.373652 10.096151 19.478516 10.039062 A 1.0001 1.0001 0 0 0 19.826172 8.5976562 C 19.140879 7.5934768 18.191582 6.9729745 17.349609 6.5878906 C 16.511594 6.2046169 15.827858 6.0467596 15.328125 6.0117188 L 15.326172 6.0117188 C 15.195014 6.0015389 15.065935 5.9976431 14.939453 6 z M 14.984375 8.0019531 C 15.048664 7.9999269 15.111282 8.0011224 15.171875 8.0058594 A 1.0001 1.0001 0 0 0 15.181641 8.0058594 C 15.269331 8.0118294 15.907504 8.1263338 16.519531 8.40625 C 16.786935 8.5285493 16.987132 8.7996549 17.242188 8.9824219 C 17.158207 9.0399689 17.095493 9.0589859 17.009766 9.125 C 16.200109 9.7484721 15.307113 10.857498 15.320312 12.398438 A 1.0001 1.0001 0 0 0 15.320312 12.400391 C 15.338653 14.110027 16.235954 15.279639 17.09375 15.871094 C 17.331641 16.035121 17.52177 16.092546 17.736328 16.191406 C 17.572161 16.881284 17.299652 17.724307 16.681641 18.488281 C 16.2956 18.965497 15.865346 19.377355 15.486328 19.644531 C 15.107276 19.91166 14.781705 20 14.714844 20 C 14.022939 20 13.748179 19.908464 13.332031 19.777344 C 12.915883 19.646224 12.330549 19.462891 11.5 19.462891 C 10.677541 19.462891 10.040248 19.612982 9.5410156 19.746094 C 9.0544997 19.875814 8.7099808 19.971185 8.2753906 19.994141 C 8.1146482 19.991469 7.8079929 19.876113 7.4199219 19.486328 C 7.0274083 19.092081 6.6016181 18.466258 6.234375 17.728516 C 5.4998887 16.253031 5 14.32101 5 12.927734 C 5 11.715324 5.2626094 10.384237 5.8007812 9.4648438 C 6.3389532 8.54545 7.0119407 8.0078125 8.2851562 8.0078125 C 8.5694024 8.0078125 9.0889439 8.1910267 9.6308594 8.4492188 C 10.172775 8.7074106 10.643045 9.0859375 11.5 9.0859375 C 12.41471 9.0859375 12.85745 8.6840068 13.466797 8.4199219 C 13.999975 8.1888475 14.534355 8.0161367 14.984375 8.0019531 z","fill":0}]])
@@ -0,0 +1,4 @@
1
+ // Generated by scripts/build-icons.mjs. Do not edit.
2
+ import { createIcon } from "../../components/Icon/createIcon"
3
+
4
+ export default createIcon("DeviceDesktop", "0 0 24 24", [["path",{"d":"M 4 3 C 2.9072751 3 2 3.9072751 2 5 L 2 15 C 2 16.092725 2.9072751 17 4 17 L 8 17 L 8 19 L 7 19 A 1 1 0 0 0 6 20 A 1 1 0 0 0 7 21 L 15 21 L 17 21 A 1 1 0 0 0 18 20 A 1 1 0 0 0 17 19 L 16 19 L 16 17 L 20 17 C 21.092725 17 22 16.092725 22 15 L 22 5 C 22 3.9072751 21.092725 3 20 3 L 4 3 z M 4 5 L 20 5 L 20 15 L 15 15 L 4 15 L 4 5 z M 10 17 L 14 17 L 14 19 L 10 19 L 10 17 z","fill":0}]])
@@ -10,6 +10,7 @@ export { default as AllGizmos } from "./AllGizmos"
10
10
  export { default as AllProductsExplore } from "./AllProductsExplore"
11
11
  export { default as Analytics } from "./Analytics"
12
12
  export { default as AnalyzeData } from "./AnalyzeData"
13
+ export { default as Android } from "./Android"
13
14
  export { default as ApiKey } from "./ApiKey"
14
15
  export { default as ApiKeyAdmin } from "./ApiKeyAdmin"
15
16
  export { default as ApiKeyPlus } from "./ApiKeyPlus"
@@ -18,6 +19,7 @@ export { default as ApiKeys } from "./ApiKeys"
18
19
  export { default as AppPermission } from "./AppPermission"
19
20
  export { default as AppStore } from "./AppStore"
20
21
  export { default as AppStoreSquare } from "./AppStoreSquare"
22
+ export { default as Apple } from "./Apple"
21
23
  export { default as Archive } from "./Archive"
22
24
  export { default as Array } from "./Array"
23
25
  export { default as ArrowBottomLeftSm } from "./ArrowBottomLeftSm"
@@ -181,6 +183,7 @@ export { default as Customize } from "./Customize"
181
183
  export { default as DarkMode } from "./DarkMode"
182
184
  export { default as DataControls } from "./DataControls"
183
185
  export { default as Desktop } from "./Desktop"
186
+ export { default as DeviceDesktop } from "./DeviceDesktop"
184
187
  export { default as DiceRandomize } from "./DiceRandomize"
185
188
  export { default as DiningEvents } from "./DiningEvents"
186
189
  export { default as DisabledCursor } from "./DisabledCursor"
@@ -1,3 +1,4 @@
1
+ import { useState } from "react"
1
2
  import { Animated, Platform, StyleSheet, View, type StyleProp, type ViewProps, type ViewStyle } from "react-native"
2
3
  import { useTheme, useThemeOverrides } from "../theme/ThemeProvider"
3
4
  import { blurModule, liquidGlassModule } from "./optional"
@@ -83,10 +84,37 @@ const WEB_LIQUID = {
83
84
  lens: { token: "--mobile-glass-web-lens-filter", value: "blur(3px) brightness(1.12) saturate(200%)" },
84
85
  }
85
86
 
86
- // The lens: the glass's edge only, 14 in from its sides and 9 from its top and bottom (a small glass keeps a third)
87
- const lensMask = (inline: number, block: number) =>
88
- `linear-gradient(to right, #000 0, transparent ${inline}px, transparent calc(100% - ${inline}px), #000 100%), ` +
89
- `linear-gradient(to bottom, #000 0, transparent ${block}px, transparent calc(100% - ${block}px), #000 100%)`
87
+ /**
88
+ * The lens: the glass's edge only, fading in over 14 from its sides and 9 from its top and bottom (a small glass keeps
89
+ * a half and a third of its radius), along the glass's own shape. A ring whose hole is the glass's outline drawn
90
+ * smaller, blurred so its inner edge fades; bands across the box would leave a square in a round glass. The outline is
91
+ * the corner radius as the browser draws it, so no larger than half the glass's shorter side (a capsule's 999 is its
92
+ * height's half). A round glass (a bar button, a progress ring) keeps a thin rim of it: a ring as deep as a bar's
93
+ * reads on a small circle as a halo around a darker middle.
94
+ */
95
+ const lensMask = (width: number, height: number, radius: number) => {
96
+ const r = Math.max(0, Math.min(radius, width / 2, height / 2))
97
+ const round = r > 0 && Math.abs(width - height) <= 1 && r >= Math.min(width, height) / 2 - 0.5
98
+ const inline = round ? r / 6 : Math.min(14, r > 0 ? r / 2 : 14)
99
+ const block = round ? r / 8 : Math.min(9, r > 0 ? r / 3 : 9)
100
+ const x = inline / 2
101
+ const y = block / 2
102
+ const w = Math.max(0, width - 2 * x)
103
+ const h = Math.max(0, height - 2 * y)
104
+ const rx = Math.max(0, Math.min(r - x, w / 2))
105
+ const ry = Math.max(0, Math.min(r - y, h / 2))
106
+ const f = (n: number) => +n.toFixed(2)
107
+ const hole =
108
+ `M${f(x + rx)} ${f(y)}H${f(x + w - rx)}A${f(rx)} ${f(ry)} 0 0 1 ${f(x + w)} ${f(y + ry)}V${f(y + h - ry)}` +
109
+ `A${f(rx)} ${f(ry)} 0 0 1 ${f(x + w - rx)} ${f(y + h)}H${f(x + rx)}A${f(rx)} ${f(ry)} 0 0 1 ${f(x)} ${f(y + h - ry)}` +
110
+ `V${f(y + ry)}A${f(rx)} ${f(ry)} 0 0 1 ${f(x + rx)} ${f(y)}Z`
111
+ // The outer edge stands 20 past the box, so the blur fades only the hole's edge; the glass's radius clips the rest
112
+ const svg =
113
+ `<svg xmlns="http://www.w3.org/2000/svg" width="${f(width)}" height="${f(height)}">` +
114
+ `<filter id="e" x="-1" y="-1" width="3" height="3"><feGaussianBlur stdDeviation="${f(inline / 4)} ${f(block / 4)}"/></filter>` +
115
+ `<path filter="url(#e)" fill-rule="evenodd" d="M-20 -20H${f(width + 20)}V${f(height + 20)}H-20Z${hole}"/></svg>`
116
+ return `url("data:image/svg+xml,${encodeURIComponent(svg)}")`
117
+ }
90
118
 
91
119
  /** The filter and the shadow of the glass surfaces of the phone layer, by their fill (mobile-materials.css, touch.css). */
92
120
  const SURFACES: Record<string, { filter: string; shadow: string }> = {
@@ -122,6 +150,8 @@ export function Glass({
122
150
  ...rest
123
151
  }: GlassProps) {
124
152
  const theme = useTheme()
153
+ // The web lens's mask follows the glass's shape, so it needs the glass's size
154
+ const [size, setSize] = useState<{ width: number; height: number } | null>(null)
125
155
  const reduceTransparency = useReduceTransparency()
126
156
  const overrides = useThemeOverrides()
127
157
  const shape: ViewStyle = { borderRadius: radius, borderCurve: "continuous" }
@@ -174,7 +204,7 @@ export function Glass({
174
204
  const sheen = liquid && tint == null ? own(WEB_LIQUID.sheen) : undefined
175
205
  const lensToken = theme.token(WEB_LIQUID.lens.token)
176
206
  const lensFilter = typeof lensToken === "string" ? lensToken : WEB_LIQUID.lens.value
177
- const mask = lensMask(Math.min(14, radius > 0 ? radius / 2 : 14), Math.min(9, radius > 0 ? radius / 3 : 9))
207
+ const mask = size != null && size.width > 0 && size.height > 0 ? lensMask(size.width, size.height, radius) : undefined
178
208
  // An Animated.View, so a panel can move its own glass (a transform above the blur would stop it)
179
209
  return (
180
210
  <Animated.View
@@ -190,10 +220,17 @@ export function Glass({
190
220
  <View
191
221
  pointerEvents="none"
192
222
  aria-hidden
223
+ onLayout={(event) => {
224
+ const { width, height } = event.nativeEvent.layout
225
+ if (size?.width !== width || size?.height !== height) setSize({ width, height })
226
+ }}
193
227
  style={[
194
228
  StyleSheet.absoluteFill,
195
229
  shape,
196
- { backdropFilter: lensFilter, WebkitBackdropFilter: lensFilter, maskImage: mask, WebkitMaskImage: mask } as ViewStyle,
230
+ // Until the glass has a size, no lens: a lens unmasked would blur the whole glass
231
+ mask == null
232
+ ? null
233
+ : ({ backdropFilter: lensFilter, WebkitBackdropFilter: lensFilter, maskImage: mask, WebkitMaskImage: mask, maskSize: "100% 100%", WebkitMaskSize: "100% 100%" } as ViewStyle),
197
234
  ]}
198
235
  />
199
236
  ) : null}
@@ -258,6 +258,10 @@ export function Overlay({ open, onDismiss, scrim = "transparent", dismissible =
258
258
  style={StyleSheet.absoluteFill}
259
259
  pointerEvents={show ? "box-none" : "none"}
260
260
  onAccessibilityEscape={dismissible && show ? onDismiss : undefined}
261
+ // A web click in the overlay goes no further: React carries it from the Modal's portal up to the trigger's
262
+ // own tree, where a List row whose Select opens from the whole row took a click on the scrim and opened its
263
+ // menu again. Only the click: the responders listen on the document, and a press there is the click
264
+ {...(Platform.OS === "web" ? { onClick: stopClick } : null)}
261
265
  testID={testID}
262
266
  >
263
267
  <Animated.View pointerEvents="none" style={[StyleSheet.absoluteFill, { backgroundColor: scrim, opacity: scrimOpacity ? scrimOpacity(progress, show) : progress }]} />
@@ -283,6 +287,7 @@ export function Overlay({ open, onDismiss, scrim = "transparent", dismissible =
283
287
  }
284
288
 
285
289
  const ignore = () => {}
290
+ const stopClick = (event: { stopPropagation?: () => void }) => event.stopPropagation?.()
286
291
  const endTouch = (event: { cancelable?: boolean; preventDefault?: () => void; nativeEvent?: { cancelable?: boolean } }) => {
287
292
  if (event.cancelable !== false && event.nativeEvent?.cancelable !== false) event.preventDefault?.()
288
293
  }