@zakisheriff/liquid-glass 0.2.3 → 0.2.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/THIRD_PARTY_NOTICES.md +11 -0
- package/dist/index.css +47 -36
- package/dist/index.css.map +1 -1
- package/dist/index.js +143 -81
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +130 -68
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -922,15 +922,30 @@ GlassCard.displayName = "GlassCard";
|
|
|
922
922
|
|
|
923
923
|
// src/components/GlassInput/GlassInput.tsx
|
|
924
924
|
var import_react5 = __toESM(require("react"));
|
|
925
|
+
|
|
926
|
+
// src/components/internal/Symbol.tsx
|
|
925
927
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
]
|
|
928
|
+
function Symbol2({ source, size = 24, className, style, ...props }) {
|
|
929
|
+
const mask = `url("${source}")`;
|
|
930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
931
|
+
"span",
|
|
932
|
+
{
|
|
933
|
+
"aria-hidden": "true",
|
|
934
|
+
...props,
|
|
935
|
+
className: ["lg-symbol", className].filter(Boolean).join(" "),
|
|
936
|
+
style: { "--lg-symbol-size": `${size}px`, WebkitMaskImage: mask, maskImage: mask, ...style }
|
|
937
|
+
}
|
|
938
|
+
);
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
// src/components/internal/inputSymbols.ts
|
|
942
|
+
var searchSymbol = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAkKADAAQ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MtmUNql9yR/7sbnj4Iof0FJvWaeDOgJWD1GXfqhTW+Kfy/QodisQAaW49P7wTyYNAqk+l2Tn5qiORXYZTkk1GC6m608I91LuQ6kEkvTjtItLgVvAHomvtMmsrtuRxHgiUCHOmEFCGnbqUxvArsC/AzMgntAL6wPAhruSJ2DrAHHgMPASrAMKD1Uv+mqSG/VULamZsElkDvBrUBzU7rsngMa3a4G1wIdqsyMAWPAGDAGjAFjwBgwBowBY8AYMAaMAWPAGDAGjAFjwBgwBowBY8AYMAaMAWPAGDAGjAFjwBgwBowBY8AYMAaMAWPAGDAGpmLgv14OpyS3UH6uAAAAAElFTkSuQmCC";
|
|
944
|
+
|
|
945
|
+
// src/components/GlassInput/GlassInput.tsx
|
|
946
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
947
|
+
var Magnifier = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Symbol2, { source: searchSymbol, size: 20 });
|
|
948
|
+
var ClearGlyph = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Symbol2, { source: clearSymbol, size: 20 });
|
|
934
949
|
var GlassInput = import_react5.default.forwardRef(
|
|
935
950
|
({ intensity = 5, tint, label: label2, icon, trailing, onClear, className, style, value, onChange, type = "text", disabled, onFocus, onBlur, ...rest }, forwardedRef) => {
|
|
936
951
|
const fieldRef = (0, import_react5.useRef)(null);
|
|
@@ -952,17 +967,17 @@ var GlassInput = import_react5.default.forwardRef(
|
|
|
952
967
|
}
|
|
953
968
|
inputRef.current?.focus();
|
|
954
969
|
};
|
|
955
|
-
return /* @__PURE__ */ (0,
|
|
970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
956
971
|
"label",
|
|
957
972
|
{
|
|
958
973
|
className: ["lg-input", className].filter(Boolean).join(" "),
|
|
959
974
|
"data-liquid-glass": "",
|
|
960
975
|
style: tint ? { "--lg-input-tint": tint, ...style } : style,
|
|
961
976
|
children: [
|
|
962
|
-
label2 && /* @__PURE__ */ (0,
|
|
963
|
-
/* @__PURE__ */ (0,
|
|
964
|
-
leading && /* @__PURE__ */ (0,
|
|
965
|
-
/* @__PURE__ */ (0,
|
|
977
|
+
label2 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "lg-input__label", children: label2 }),
|
|
978
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { ref: fieldRef, className: "lg-glass lg-input__field", "data-focused": focused ? "" : void 0, children: [
|
|
979
|
+
leading && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "lg-input__icon", children: leading }),
|
|
980
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
966
981
|
"input",
|
|
967
982
|
{
|
|
968
983
|
ref: inputRef,
|
|
@@ -984,7 +999,7 @@ var GlassInput = import_react5.default.forwardRef(
|
|
|
984
999
|
...rest
|
|
985
1000
|
}
|
|
986
1001
|
),
|
|
987
|
-
current && !disabled ? /* @__PURE__ */ (0,
|
|
1002
|
+
current && !disabled ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
988
1003
|
"button",
|
|
989
1004
|
{
|
|
990
1005
|
type: "button",
|
|
@@ -994,7 +1009,7 @@ var GlassInput = import_react5.default.forwardRef(
|
|
|
994
1009
|
onClick: clear,
|
|
995
1010
|
children: ClearGlyph
|
|
996
1011
|
}
|
|
997
|
-
) : trailing && /* @__PURE__ */ (0,
|
|
1012
|
+
) : trailing && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "lg-input__icon lg-input__trailing", children: trailing })
|
|
998
1013
|
] })
|
|
999
1014
|
]
|
|
1000
1015
|
}
|
|
@@ -1006,7 +1021,7 @@ GlassInput.displayName = "GlassInput";
|
|
|
1006
1021
|
// src/components/GlassSheet/GlassSheet.tsx
|
|
1007
1022
|
var import_react6 = require("react");
|
|
1008
1023
|
var import_react_dom = require("react-dom");
|
|
1009
|
-
var
|
|
1024
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1010
1025
|
var OPEN = springFrom(0.42, 0.86);
|
|
1011
1026
|
var CLOSE = springFrom(0.34, 1);
|
|
1012
1027
|
var GlassSheet = ({ open, onClose, intensity = 5, tint, children, "aria-label": ariaLabel }) => {
|
|
@@ -1107,9 +1122,9 @@ var GlassSheet = ({ open, onClose, intensity = 5, tint, children, "aria-label":
|
|
|
1107
1122
|
}, [mounted]);
|
|
1108
1123
|
if (!mounted || typeof document === "undefined") return null;
|
|
1109
1124
|
return (0, import_react_dom.createPortal)(
|
|
1110
|
-
/* @__PURE__ */ (0,
|
|
1111
|
-
/* @__PURE__ */ (0,
|
|
1112
|
-
/* @__PURE__ */ (0,
|
|
1125
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "lg-sheet-layer", "data-liquid-glass": "", children: [
|
|
1126
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { ref: scrimRef, className: "lg-sheet__scrim", onClick: () => onClose?.(), "aria-hidden": "true" }),
|
|
1127
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1113
1128
|
"div",
|
|
1114
1129
|
{
|
|
1115
1130
|
ref: sheetRef,
|
|
@@ -1120,8 +1135,8 @@ var GlassSheet = ({ open, onClose, intensity = 5, tint, children, "aria-label":
|
|
|
1120
1135
|
className: "lg-glass lg-glass--host lg-sheet",
|
|
1121
1136
|
style: tint ? { "--lg-host-tint": tint } : void 0,
|
|
1122
1137
|
children: [
|
|
1123
|
-
/* @__PURE__ */ (0,
|
|
1124
|
-
/* @__PURE__ */ (0,
|
|
1138
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "lg-sheet__grabber-zone", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "lg-sheet__grabber" }) }),
|
|
1139
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "lg-sheet__content", children })
|
|
1125
1140
|
]
|
|
1126
1141
|
}
|
|
1127
1142
|
)
|
|
@@ -1146,11 +1161,9 @@ function useLensTrack(refs, options) {
|
|
|
1146
1161
|
(0, import_react7.useEffect)(() => {
|
|
1147
1162
|
const bar = refs.bar.current;
|
|
1148
1163
|
const lens = refs.lens.current;
|
|
1149
|
-
const tint = refs.tint.current;
|
|
1150
|
-
const row = refs.row.current;
|
|
1151
1164
|
const glass = refs.glass.current;
|
|
1152
1165
|
const select = refs.select.current;
|
|
1153
|
-
if (!bar || !lens || !
|
|
1166
|
+
if (!bar || !lens || !glass || !select) return;
|
|
1154
1167
|
let slot = 0;
|
|
1155
1168
|
let height = 0;
|
|
1156
1169
|
let pad = 0;
|
|
@@ -1160,6 +1173,13 @@ function useLensTrack(refs, options) {
|
|
|
1160
1173
|
let current = latest.current.index;
|
|
1161
1174
|
let gesture = null;
|
|
1162
1175
|
let suppressClick = false;
|
|
1176
|
+
const buttons = Array.from(bar.querySelectorAll("[data-lg-item]"));
|
|
1177
|
+
let glyphs = [];
|
|
1178
|
+
const preview = (index) => {
|
|
1179
|
+
if (index === void 0) delete bar.dataset.previewing;
|
|
1180
|
+
else bar.dataset.previewing = "";
|
|
1181
|
+
buttons.forEach((button, i) => button.toggleAttribute("data-lg-preview", i === index));
|
|
1182
|
+
};
|
|
1163
1183
|
const measure = () => {
|
|
1164
1184
|
const style = getComputedStyle(bar);
|
|
1165
1185
|
pad = parseFloat(style.paddingLeft) || 0;
|
|
@@ -1168,15 +1188,20 @@ function useLensTrack(refs, options) {
|
|
|
1168
1188
|
const { overhang, spread } = latest.current;
|
|
1169
1189
|
W = Math.round(slot * (1 + spread));
|
|
1170
1190
|
H = Math.round(bar.offsetHeight + overhang);
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
el2.style.top = `${pad + (height - H) / 2}px`;
|
|
1176
|
-
}
|
|
1191
|
+
lens.style.width = `${W}px`;
|
|
1192
|
+
lens.style.height = `${H}px`;
|
|
1193
|
+
lens.style.left = `${pad + (slot - W) / 2}px`;
|
|
1194
|
+
lens.style.top = `${pad + (height - H) / 2}px`;
|
|
1177
1195
|
select.style.width = `${slot}px`;
|
|
1178
|
-
|
|
1179
|
-
|
|
1196
|
+
glyphs = buttons.flatMap(
|
|
1197
|
+
(button) => Array.from(button.querySelectorAll(".lg-nav__label, .lg-nav__icon > .lg-symbol")).map((node) => ({
|
|
1198
|
+
node,
|
|
1199
|
+
x: button.offsetLeft + node.offsetLeft - pad,
|
|
1200
|
+
y: node.offsetTop + node.offsetHeight / 2,
|
|
1201
|
+
width: node.offsetWidth,
|
|
1202
|
+
label: node.classList.contains("lg-nav__label")
|
|
1203
|
+
}))
|
|
1204
|
+
);
|
|
1180
1205
|
};
|
|
1181
1206
|
const paint = () => {
|
|
1182
1207
|
const { x: x2, swell: swell2, squash } = state;
|
|
@@ -1186,14 +1211,29 @@ function useLensTrack(refs, options) {
|
|
|
1186
1211
|
const ky = (height + (H - height) * lift2) / H * (1 - squash * 0.6);
|
|
1187
1212
|
const transform = `translateX(${x2}px) scale(${kx}, ${ky})`;
|
|
1188
1213
|
lens.style.transform = transform;
|
|
1189
|
-
tint.style.transform = transform;
|
|
1190
|
-
row.style.transform = `translate(${W / 2 + (-slot / 2 - x2) / kx}px, ${H / 2 - height / (2 * ky)}px) scale(${1 / kx}, ${1 / ky})`;
|
|
1191
1214
|
select.style.transform = `translateX(${x2}px)`;
|
|
1192
1215
|
lens.style.opacity = String(clamp(lift2 * 4, 0, 1));
|
|
1193
1216
|
const grow = 1 + latest.current.swell / Math.max(bar.offsetWidth, 1) * swell2;
|
|
1194
1217
|
bar.style.scale = `${grow}`;
|
|
1195
1218
|
lens.style.setProperty("--lg-lift", String(clamp(lift2, 0, 1)));
|
|
1196
1219
|
bar.style.setProperty("--lg-lift", String(clamp(lift2, 0, 1)));
|
|
1220
|
+
for (const glyph of glyphs) {
|
|
1221
|
+
if (lift2 <= 0.02 && !gesture) {
|
|
1222
|
+
glyph.node.style.removeProperty("--lg-content-tint");
|
|
1223
|
+
glyph.node.style.removeProperty("transform");
|
|
1224
|
+
continue;
|
|
1225
|
+
}
|
|
1226
|
+
const ry = H * ky / 2;
|
|
1227
|
+
const dy = clamp(Math.abs(glyph.y - height / 2) / ry, 0, 1);
|
|
1228
|
+
const half = Math.max(0, (W - H) * kx / 2) + H * kx / 2 * Math.sqrt(1 - dy * dy);
|
|
1229
|
+
const from = x2 + slot / 2 - half - glyph.x;
|
|
1230
|
+
const to = x2 + slot / 2 + half - glyph.x;
|
|
1231
|
+
const normal = "var(--lg-fg)";
|
|
1232
|
+
const active2 = "var(--lg-track-active, var(--lg-accent))";
|
|
1233
|
+
glyph.node.style.setProperty("--lg-content-tint", `linear-gradient(90deg, ${normal} ${from}px, ${active2} ${from}px, ${active2} ${to}px, ${normal} ${to}px)`);
|
|
1234
|
+
const coverage = clamp((Math.min(glyph.width, to) - Math.max(0, from)) / Math.max(1, glyph.width), 0, 1);
|
|
1235
|
+
glyph.node.style.transform = `scale(${1 + clamp(lift2, 0, 1) * coverage * (glyph.label ? 0.035 : 0.08)})`;
|
|
1236
|
+
}
|
|
1197
1237
|
if (!gesture && lift2 < 0.02) delete bar.dataset.lifted;
|
|
1198
1238
|
};
|
|
1199
1239
|
const x = createSpring(current * slot, SPRINGS.snap, (value, velocity) => {
|
|
@@ -1218,7 +1258,7 @@ function useLensTrack(refs, options) {
|
|
|
1218
1258
|
};
|
|
1219
1259
|
const position = (clientX) => {
|
|
1220
1260
|
if (!gesture) return 0;
|
|
1221
|
-
const raw = gesture.anchor + clientX - gesture.startX;
|
|
1261
|
+
const raw = gesture.anchor + (clientX - gesture.startX) * bar.offsetWidth / Math.max(1, gesture.box.width);
|
|
1222
1262
|
const max = slot * (latest.current.count - 1);
|
|
1223
1263
|
const give = Math.min(14, slot * 0.12);
|
|
1224
1264
|
if (raw < 0) return rubberband(raw, give, 0.55);
|
|
@@ -1242,6 +1282,7 @@ function useLensTrack(refs, options) {
|
|
|
1242
1282
|
gesture = { id: event.pointerId, startX: event.clientX, anchor: index * slot, moved: false, box, hovered: index };
|
|
1243
1283
|
suppressClick = false;
|
|
1244
1284
|
bar.dataset.lifted = "";
|
|
1285
|
+
preview(index);
|
|
1245
1286
|
lens.dataset.pressed = "";
|
|
1246
1287
|
light(event.clientX, box);
|
|
1247
1288
|
haptic();
|
|
@@ -1251,6 +1292,7 @@ function useLensTrack(refs, options) {
|
|
|
1251
1292
|
swell.set(1);
|
|
1252
1293
|
x.tune(SPRINGS.snap);
|
|
1253
1294
|
x.set(index * slot);
|
|
1295
|
+
paint();
|
|
1254
1296
|
};
|
|
1255
1297
|
const onMove = (event) => {
|
|
1256
1298
|
if (event.pointerId !== gesture?.id) return;
|
|
@@ -1269,6 +1311,7 @@ function useLensTrack(refs, options) {
|
|
|
1269
1311
|
const hovered = clamp(Math.round(at / slot), 0, latest.current.count - 1);
|
|
1270
1312
|
if (hovered !== gesture.hovered) {
|
|
1271
1313
|
gesture.hovered = hovered;
|
|
1314
|
+
preview(hovered);
|
|
1272
1315
|
haptic();
|
|
1273
1316
|
}
|
|
1274
1317
|
};
|
|
@@ -1278,6 +1321,7 @@ function useLensTrack(refs, options) {
|
|
|
1278
1321
|
const at = moved ? position(event.clientX) : gesture.anchor;
|
|
1279
1322
|
const index = clamp(Math.round(at / slot), 0, latest.current.count - 1);
|
|
1280
1323
|
gesture = null;
|
|
1324
|
+
preview();
|
|
1281
1325
|
delete lens.dataset.pressed;
|
|
1282
1326
|
if (bar.hasPointerCapture?.(event.pointerId)) bar.releasePointerCapture(event.pointerId);
|
|
1283
1327
|
const inside = event.clientY >= box.top - 30 && event.clientY <= box.bottom + 30;
|
|
@@ -1297,6 +1341,20 @@ function useLensTrack(refs, options) {
|
|
|
1297
1341
|
};
|
|
1298
1342
|
const onUp = (event) => finish(event, true);
|
|
1299
1343
|
const onCancel = (event) => finish(event, false);
|
|
1344
|
+
const onBlur = () => {
|
|
1345
|
+
if (!gesture) return;
|
|
1346
|
+
const id = gesture.id;
|
|
1347
|
+
gesture = null;
|
|
1348
|
+
preview();
|
|
1349
|
+
delete lens.dataset.pressed;
|
|
1350
|
+
if (bar.hasPointerCapture(id)) bar.releasePointerCapture(id);
|
|
1351
|
+
lift.tune(SPRINGS.settle);
|
|
1352
|
+
lift.set(0);
|
|
1353
|
+
swell.tune(SPRINGS.release);
|
|
1354
|
+
swell.set(0);
|
|
1355
|
+
x.tune(SPRINGS.snap);
|
|
1356
|
+
x.set(current * slot);
|
|
1357
|
+
};
|
|
1300
1358
|
const onClick = (event) => {
|
|
1301
1359
|
if (suppressClick && event.detail !== 0) {
|
|
1302
1360
|
suppressClick = false;
|
|
@@ -1333,6 +1391,7 @@ function useLensTrack(refs, options) {
|
|
|
1333
1391
|
window.addEventListener("pointermove", onMove);
|
|
1334
1392
|
window.addEventListener("pointerup", onUp);
|
|
1335
1393
|
window.addEventListener("pointercancel", onCancel);
|
|
1394
|
+
window.addEventListener("blur", onBlur);
|
|
1336
1395
|
bar.addEventListener("click", onClick, true);
|
|
1337
1396
|
bar.addEventListener("keydown", onKey);
|
|
1338
1397
|
bar.addEventListener("touchmove", onTouchMove, { passive: false });
|
|
@@ -1345,11 +1404,17 @@ function useLensTrack(refs, options) {
|
|
|
1345
1404
|
window.removeEventListener("pointermove", onMove);
|
|
1346
1405
|
window.removeEventListener("pointerup", onUp);
|
|
1347
1406
|
window.removeEventListener("pointercancel", onCancel);
|
|
1407
|
+
window.removeEventListener("blur", onBlur);
|
|
1348
1408
|
bar.removeEventListener("click", onClick, true);
|
|
1349
1409
|
bar.removeEventListener("keydown", onKey);
|
|
1350
1410
|
bar.removeEventListener("touchmove", onTouchMove);
|
|
1351
1411
|
delete bar.dataset.ready;
|
|
1352
1412
|
delete bar.dataset.lifted;
|
|
1413
|
+
preview();
|
|
1414
|
+
glyphs.forEach(({ node }) => {
|
|
1415
|
+
node.style.removeProperty("--lg-content-tint");
|
|
1416
|
+
node.style.removeProperty("transform");
|
|
1417
|
+
});
|
|
1353
1418
|
};
|
|
1354
1419
|
}, [options.count]);
|
|
1355
1420
|
(0, import_react7.useEffect)(() => {
|
|
@@ -1358,7 +1423,7 @@ function useLensTrack(refs, options) {
|
|
|
1358
1423
|
}
|
|
1359
1424
|
|
|
1360
1425
|
// src/components/internal/LensTrack.tsx
|
|
1361
|
-
var
|
|
1426
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1362
1427
|
function LensTrack({
|
|
1363
1428
|
items,
|
|
1364
1429
|
labels,
|
|
@@ -1373,15 +1438,13 @@ function LensTrack({
|
|
|
1373
1438
|
const bar = (0, import_react8.useRef)(null);
|
|
1374
1439
|
const glass = (0, import_react8.useRef)(null);
|
|
1375
1440
|
const lens = (0, import_react8.useRef)(null);
|
|
1376
|
-
const tint = (0, import_react8.useRef)(null);
|
|
1377
|
-
const row = (0, import_react8.useRef)(null);
|
|
1378
1441
|
const select = (0, import_react8.useRef)(null);
|
|
1379
1442
|
const strength = Math.max(1, Math.min(10, intensity)) / 5;
|
|
1380
1443
|
useRefraction(glass, { kind: "surface", strength });
|
|
1381
1444
|
useRefraction(lens, { kind: "lens", strength, zoom: variant === "tabbar" ? 1.14 : 1.1 });
|
|
1382
1445
|
const tabbar = variant === "tabbar";
|
|
1383
1446
|
useLensTrack(
|
|
1384
|
-
{ bar, glass, lens,
|
|
1447
|
+
{ bar, glass, lens, select },
|
|
1385
1448
|
{
|
|
1386
1449
|
count: items.length,
|
|
1387
1450
|
index,
|
|
@@ -1391,7 +1454,7 @@ function LensTrack({
|
|
|
1391
1454
|
swell: tabbar ? 8 : 14
|
|
1392
1455
|
}
|
|
1393
1456
|
);
|
|
1394
|
-
return /* @__PURE__ */ (0,
|
|
1457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1395
1458
|
"div",
|
|
1396
1459
|
{
|
|
1397
1460
|
ref: bar,
|
|
@@ -1401,9 +1464,9 @@ function LensTrack({
|
|
|
1401
1464
|
"data-liquid-glass": "",
|
|
1402
1465
|
style: { ...style, "--lg-count": items.length, "--lg-index": index },
|
|
1403
1466
|
children: [
|
|
1404
|
-
/* @__PURE__ */ (0,
|
|
1405
|
-
/* @__PURE__ */ (0,
|
|
1406
|
-
items.map((item, i) => /* @__PURE__ */ (0,
|
|
1467
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { ref: glass, className: "lg-glass lg-track__glass", "aria-hidden": "true" }),
|
|
1468
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { ref: select, className: "lg-track__select", "aria-hidden": "true" }),
|
|
1469
|
+
items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1407
1470
|
"button",
|
|
1408
1471
|
{
|
|
1409
1472
|
type: "button",
|
|
@@ -1417,15 +1480,14 @@ function LensTrack({
|
|
|
1417
1480
|
},
|
|
1418
1481
|
i
|
|
1419
1482
|
)),
|
|
1420
|
-
/* @__PURE__ */ (0,
|
|
1421
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { ref: lens, className: "lg-glass lg-track__lens", "aria-hidden": "true" })
|
|
1483
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { ref: lens, className: "lg-glass lg-track__lens", "aria-hidden": "true" })
|
|
1422
1484
|
]
|
|
1423
1485
|
}
|
|
1424
1486
|
);
|
|
1425
1487
|
}
|
|
1426
1488
|
|
|
1427
1489
|
// src/components/GlassNav/GlassNav.tsx
|
|
1428
|
-
var
|
|
1490
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1429
1491
|
var GlassNav = ({
|
|
1430
1492
|
items,
|
|
1431
1493
|
activeIndex = 0,
|
|
@@ -1436,7 +1498,7 @@ var GlassNav = ({
|
|
|
1436
1498
|
"aria-label": ariaLabel = "Tabs"
|
|
1437
1499
|
}) => {
|
|
1438
1500
|
const hasIcons = items.some((item) => item.icon != null);
|
|
1439
|
-
return /* @__PURE__ */ (0,
|
|
1501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1440
1502
|
LensTrack,
|
|
1441
1503
|
{
|
|
1442
1504
|
variant: "tabbar",
|
|
@@ -1447,9 +1509,9 @@ var GlassNav = ({
|
|
|
1447
1509
|
index: activeIndex,
|
|
1448
1510
|
onChange,
|
|
1449
1511
|
labels: items.map((item) => item.label),
|
|
1450
|
-
items: items.map((item, i) => /* @__PURE__ */ (0,
|
|
1451
|
-
item.icon != null && /* @__PURE__ */ (0,
|
|
1452
|
-
/* @__PURE__ */ (0,
|
|
1512
|
+
items: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_react9.default.Fragment, { children: [
|
|
1513
|
+
item.icon != null && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "lg-nav__icon", children: item.icon }),
|
|
1514
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "lg-nav__label", children: item.label })
|
|
1453
1515
|
] }, i))
|
|
1454
1516
|
}
|
|
1455
1517
|
);
|
|
@@ -1458,7 +1520,7 @@ GlassNav.displayName = "GlassNav";
|
|
|
1458
1520
|
|
|
1459
1521
|
// src/components/GlassSegmented/GlassSegmented.tsx
|
|
1460
1522
|
var import_react10 = __toESM(require("react"));
|
|
1461
|
-
var
|
|
1523
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1462
1524
|
var GlassSegmented = ({
|
|
1463
1525
|
options,
|
|
1464
1526
|
value,
|
|
@@ -1470,7 +1532,7 @@ var GlassSegmented = ({
|
|
|
1470
1532
|
"aria-label": ariaLabel
|
|
1471
1533
|
}) => {
|
|
1472
1534
|
const normalized = options.map((option) => typeof option === "string" ? { label: option } : option);
|
|
1473
|
-
return /* @__PURE__ */ (0,
|
|
1535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1474
1536
|
LensTrack,
|
|
1475
1537
|
{
|
|
1476
1538
|
variant: "segmented",
|
|
@@ -1481,9 +1543,9 @@ var GlassSegmented = ({
|
|
|
1481
1543
|
index: value,
|
|
1482
1544
|
onChange,
|
|
1483
1545
|
labels: normalized.map((option) => option.label),
|
|
1484
|
-
items: normalized.map((option, i) => /* @__PURE__ */ (0,
|
|
1546
|
+
items: normalized.map((option, i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react10.default.Fragment, { children: [
|
|
1485
1547
|
option.icon,
|
|
1486
|
-
/* @__PURE__ */ (0,
|
|
1548
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: option.label })
|
|
1487
1549
|
] }, i))
|
|
1488
1550
|
}
|
|
1489
1551
|
);
|
|
@@ -1492,7 +1554,7 @@ GlassSegmented.displayName = "GlassSegmented";
|
|
|
1492
1554
|
|
|
1493
1555
|
// src/components/GlassSlider/GlassSlider.tsx
|
|
1494
1556
|
var import_react11 = __toESM(require("react"));
|
|
1495
|
-
var
|
|
1557
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1496
1558
|
var GlassSlider = import_react11.default.forwardRef(
|
|
1497
1559
|
({
|
|
1498
1560
|
value = 0,
|
|
@@ -1649,7 +1711,7 @@ var GlassSlider = import_react11.default.forwardRef(
|
|
|
1649
1711
|
window.removeEventListener("pointercancel", up);
|
|
1650
1712
|
};
|
|
1651
1713
|
}, [showThumb]);
|
|
1652
|
-
const input = /* @__PURE__ */ (0,
|
|
1714
|
+
const input = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1653
1715
|
"input",
|
|
1654
1716
|
{
|
|
1655
1717
|
ref: inputRef,
|
|
@@ -1669,7 +1731,7 @@ var GlassSlider = import_react11.default.forwardRef(
|
|
|
1669
1731
|
);
|
|
1670
1732
|
const vars = { "--lg-progress": progress, ...tint ? { "--lg-slider-fill": tint } : {}, ...style };
|
|
1671
1733
|
if (!showThumb) {
|
|
1672
|
-
return /* @__PURE__ */ (0,
|
|
1734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1673
1735
|
"div",
|
|
1674
1736
|
{
|
|
1675
1737
|
ref: rootRef,
|
|
@@ -1677,16 +1739,16 @@ var GlassSlider = import_react11.default.forwardRef(
|
|
|
1677
1739
|
"data-liquid-glass": "",
|
|
1678
1740
|
style: vars,
|
|
1679
1741
|
children: [
|
|
1680
|
-
/* @__PURE__ */ (0,
|
|
1681
|
-
/* @__PURE__ */ (0,
|
|
1682
|
-
icon && /* @__PURE__ */ (0,
|
|
1683
|
-
label2 && /* @__PURE__ */ (0,
|
|
1684
|
-
/* @__PURE__ */ (0,
|
|
1742
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { ref: blockRef, className: "lg-glass lg-slider__block", children: [
|
|
1743
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "lg-slider__block-content", "aria-hidden": "true", children: [
|
|
1744
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "lg-slider__icon", children: icon }),
|
|
1745
|
+
label2 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "lg-slider__label", children: label2 }),
|
|
1746
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "lg-slider__value", children: Number(value) })
|
|
1685
1747
|
] }),
|
|
1686
|
-
/* @__PURE__ */ (0,
|
|
1687
|
-
icon && /* @__PURE__ */ (0,
|
|
1688
|
-
label2 && /* @__PURE__ */ (0,
|
|
1689
|
-
/* @__PURE__ */ (0,
|
|
1748
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "lg-slider__block-fill", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "lg-slider__block-content lg-slider__block-content--lit", children: [
|
|
1749
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "lg-slider__icon", children: icon }),
|
|
1750
|
+
label2 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "lg-slider__label", children: label2 }),
|
|
1751
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "lg-slider__value", children: Number(value) })
|
|
1690
1752
|
] }) })
|
|
1691
1753
|
] }),
|
|
1692
1754
|
input
|
|
@@ -1694,7 +1756,7 @@ var GlassSlider = import_react11.default.forwardRef(
|
|
|
1694
1756
|
}
|
|
1695
1757
|
);
|
|
1696
1758
|
}
|
|
1697
|
-
return /* @__PURE__ */ (0,
|
|
1759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1698
1760
|
"div",
|
|
1699
1761
|
{
|
|
1700
1762
|
ref: rootRef,
|
|
@@ -1703,8 +1765,8 @@ var GlassSlider = import_react11.default.forwardRef(
|
|
|
1703
1765
|
"data-mirror": mirrored ? "" : void 0,
|
|
1704
1766
|
style: vars,
|
|
1705
1767
|
children: [
|
|
1706
|
-
/* @__PURE__ */ (0,
|
|
1707
|
-
/* @__PURE__ */ (0,
|
|
1768
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "lg-slider__rail", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "lg-slider__fill" }) }),
|
|
1769
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "lg-slider__thumb-slot", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { ref: thumbRef, className: "lg-glass lg-slider__thumb", "data-lg-mirror-bare": "", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { ref: faceRef, className: "lg-slider__face" }) }) }),
|
|
1708
1770
|
input
|
|
1709
1771
|
]
|
|
1710
1772
|
}
|
|
@@ -1715,7 +1777,7 @@ GlassSlider.displayName = "GlassSlider";
|
|
|
1715
1777
|
|
|
1716
1778
|
// src/components/GlassSwitch/GlassSwitch.tsx
|
|
1717
1779
|
var import_react12 = __toESM(require("react"));
|
|
1718
|
-
var
|
|
1780
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1719
1781
|
var SETTLE = springFrom(0.36, 0.68);
|
|
1720
1782
|
var REST = 0.655;
|
|
1721
1783
|
var TRAVEL = 22;
|
|
@@ -1866,7 +1928,7 @@ var GlassSwitch = import_react12.default.forwardRef(
|
|
|
1866
1928
|
(0, import_react12.useEffect)(() => {
|
|
1867
1929
|
sync.current?.(checked);
|
|
1868
1930
|
}, [checked]);
|
|
1869
|
-
return /* @__PURE__ */ (0,
|
|
1931
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1870
1932
|
"button",
|
|
1871
1933
|
{
|
|
1872
1934
|
ref,
|
|
@@ -1883,8 +1945,8 @@ var GlassSwitch = import_react12.default.forwardRef(
|
|
|
1883
1945
|
rest.onKeyDown?.(event);
|
|
1884
1946
|
},
|
|
1885
1947
|
children: [
|
|
1886
|
-
/* @__PURE__ */ (0,
|
|
1887
|
-
/* @__PURE__ */ (0,
|
|
1948
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { ref: fillRef, className: "lg-switch__fill", "aria-hidden": "true" }),
|
|
1949
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { ref: thumbRef, className: "lg-glass lg-switch__thumb", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { ref: faceRef, className: "lg-switch__face" }) })
|
|
1888
1950
|
]
|
|
1889
1951
|
}
|
|
1890
1952
|
);
|
|
@@ -1894,28 +1956,28 @@ GlassSwitch.displayName = "GlassSwitch";
|
|
|
1894
1956
|
|
|
1895
1957
|
// src/filters/LiquidGlassFilter.tsx
|
|
1896
1958
|
var import_react13 = require("react");
|
|
1897
|
-
var
|
|
1959
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1898
1960
|
var GlassFilterContext = (0, import_react13.createContext)(false);
|
|
1899
1961
|
function LiquidGlassFilter({ children }) {
|
|
1900
|
-
return /* @__PURE__ */ (0,
|
|
1901
|
-
/* @__PURE__ */ (0,
|
|
1962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(GlassFilterContext.Provider, { value: true, children: [
|
|
1963
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GlassFilterSVG, {}),
|
|
1902
1964
|
children
|
|
1903
1965
|
] });
|
|
1904
1966
|
}
|
|
1905
1967
|
function GlassFilterSVG() {
|
|
1906
|
-
return /* @__PURE__ */ (0,
|
|
1968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1907
1969
|
"svg",
|
|
1908
1970
|
{
|
|
1909
1971
|
width: "0",
|
|
1910
1972
|
height: "0",
|
|
1911
1973
|
style: { position: "absolute", pointerEvents: "none" },
|
|
1912
1974
|
"aria-hidden": "true",
|
|
1913
|
-
children: /* @__PURE__ */ (0,
|
|
1975
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("defs", { children: Array.from({ length: 10 }, (_, i) => {
|
|
1914
1976
|
const level = i + 1;
|
|
1915
1977
|
const scale = level * 2;
|
|
1916
1978
|
const freq1 = 0.012 + level * 1e-3;
|
|
1917
1979
|
const freq2 = 0.01 + level * 8e-4;
|
|
1918
|
-
return /* @__PURE__ */ (0,
|
|
1980
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1919
1981
|
"filter",
|
|
1920
1982
|
{
|
|
1921
1983
|
id: `liquid-glass-refract-${level}`,
|
|
@@ -1925,7 +1987,7 @@ function GlassFilterSVG() {
|
|
|
1925
1987
|
height: "120%",
|
|
1926
1988
|
colorInterpolationFilters: "sRGB",
|
|
1927
1989
|
children: [
|
|
1928
|
-
/* @__PURE__ */ (0,
|
|
1990
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1929
1991
|
"feTurbulence",
|
|
1930
1992
|
{
|
|
1931
1993
|
type: "fractalNoise",
|
|
@@ -1935,7 +1997,7 @@ function GlassFilterSVG() {
|
|
|
1935
1997
|
result: "noise"
|
|
1936
1998
|
}
|
|
1937
1999
|
),
|
|
1938
|
-
/* @__PURE__ */ (0,
|
|
2000
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1939
2001
|
"feDisplacementMap",
|
|
1940
2002
|
{
|
|
1941
2003
|
in: "SourceGraphic",
|