ssovee-os-web-ui 0.1.32 → 0.1.34
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/dist/index.cjs +94 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +11 -8
- package/dist/index.js +95 -17
- package/dist/index.js.map +1 -1
- package/dist/sdk.cjs +53 -9
- package/dist/sdk.cjs.map +1 -1
- package/dist/sdk.d.cts +5 -1
- package/dist/sdk.d.ts +5 -1
- package/dist/sdk.js +53 -9
- package/dist/sdk.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1604,6 +1604,7 @@ var SearchInput = React22__namespace.default.forwardRef(
|
|
|
1604
1604
|
className,
|
|
1605
1605
|
value,
|
|
1606
1606
|
onChange,
|
|
1607
|
+
style,
|
|
1607
1608
|
enableKeyboardShortcuts = false,
|
|
1608
1609
|
isActive = true,
|
|
1609
1610
|
...props
|
|
@@ -1655,29 +1656,58 @@ var SearchInput = React22__namespace.default.forwardRef(
|
|
|
1655
1656
|
outline: "bg-transparent border border-surface-1 focus:border-brand-color focus:ring-1 focus:ring-brand-color/50"
|
|
1656
1657
|
};
|
|
1657
1658
|
const sizeClasses = {
|
|
1658
|
-
sm: "h-8
|
|
1659
|
-
md: "h-10
|
|
1660
|
-
lg: "h-12
|
|
1659
|
+
sm: "h-8 text-sm leading-tight",
|
|
1660
|
+
md: "h-10 text-base leading-tight",
|
|
1661
|
+
lg: "h-12 text-lg leading-tight"
|
|
1661
1662
|
};
|
|
1662
1663
|
const iconSizeClasses = {
|
|
1663
1664
|
sm: "w-4 h-4",
|
|
1664
1665
|
md: "w-5 h-5",
|
|
1665
1666
|
lg: "w-6 h-6"
|
|
1666
1667
|
};
|
|
1668
|
+
const iconPixelSizes = {
|
|
1669
|
+
sm: 16,
|
|
1670
|
+
md: 18,
|
|
1671
|
+
lg: 20
|
|
1672
|
+
};
|
|
1667
1673
|
const iconPositionClasses = {
|
|
1668
|
-
sm: "left-2",
|
|
1674
|
+
sm: "left-2.5",
|
|
1669
1675
|
md: "left-3",
|
|
1670
1676
|
lg: "left-3.5"
|
|
1671
1677
|
};
|
|
1678
|
+
const inputPaddings = {
|
|
1679
|
+
sm: { left: "2.25rem", right: "0.5rem" },
|
|
1680
|
+
md: { left: "2.75rem", right: "0.75rem" },
|
|
1681
|
+
lg: { left: "3rem", right: "1rem" }
|
|
1682
|
+
};
|
|
1672
1683
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full min-w-0", children: [
|
|
1673
1684
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1674
1685
|
"div",
|
|
1675
1686
|
{
|
|
1676
1687
|
className: cn(
|
|
1677
|
-
"pointer-events-none absolute top-1/2 -translate-y-1/2 text-neutral-400",
|
|
1688
|
+
"pointer-events-none absolute top-1/2 z-10 -translate-y-1/2 text-neutral-400",
|
|
1678
1689
|
iconPositionClasses[size]
|
|
1679
1690
|
),
|
|
1680
|
-
children: /* @__PURE__ */ jsxRuntime.
|
|
1691
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1692
|
+
"svg",
|
|
1693
|
+
{
|
|
1694
|
+
className: cn("block shrink-0", iconSizeClasses[size]),
|
|
1695
|
+
width: iconPixelSizes[size],
|
|
1696
|
+
height: iconPixelSizes[size],
|
|
1697
|
+
viewBox: "0 0 24 24",
|
|
1698
|
+
fill: "none",
|
|
1699
|
+
stroke: "currentColor",
|
|
1700
|
+
strokeWidth: "1.8",
|
|
1701
|
+
strokeLinecap: "round",
|
|
1702
|
+
strokeLinejoin: "round",
|
|
1703
|
+
"aria-hidden": "true",
|
|
1704
|
+
focusable: "false",
|
|
1705
|
+
children: [
|
|
1706
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "11", cy: "11", r: "7" }),
|
|
1707
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 20L16.65 16.65" })
|
|
1708
|
+
]
|
|
1709
|
+
}
|
|
1710
|
+
)
|
|
1681
1711
|
}
|
|
1682
1712
|
),
|
|
1683
1713
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1693,9 +1723,13 @@ var SearchInput = React22__namespace.default.forwardRef(
|
|
|
1693
1723
|
variantClasses[variant],
|
|
1694
1724
|
"w-full min-w-0",
|
|
1695
1725
|
sizeClasses[size],
|
|
1696
|
-
showClearButton && searchValue ? "pr-10" : "",
|
|
1697
1726
|
className
|
|
1698
1727
|
),
|
|
1728
|
+
style: {
|
|
1729
|
+
paddingLeft: inputPaddings[size].left,
|
|
1730
|
+
paddingRight: showClearButton && searchValue ? "2.5rem" : inputPaddings[size].right,
|
|
1731
|
+
...style
|
|
1732
|
+
},
|
|
1699
1733
|
...props
|
|
1700
1734
|
}
|
|
1701
1735
|
),
|
|
@@ -3230,16 +3264,60 @@ var soundMap = {
|
|
|
3230
3264
|
success: success_tone_default,
|
|
3231
3265
|
swipe: swipe_tone_default
|
|
3232
3266
|
};
|
|
3233
|
-
var
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3267
|
+
var pendingPlaybackQueue = [];
|
|
3268
|
+
var interactionListenersBound = false;
|
|
3269
|
+
var clampVolume = (value) => Math.min(1, Math.max(0, value));
|
|
3270
|
+
var isAutoplayRestrictionError = (error) => {
|
|
3271
|
+
if (!error || typeof error !== "object") return false;
|
|
3272
|
+
const maybeError = error;
|
|
3273
|
+
const message = maybeError.message?.toLowerCase() ?? "";
|
|
3274
|
+
return maybeError.name === "NotAllowedError" || message.includes("gesture") || message.includes("user");
|
|
3275
|
+
};
|
|
3276
|
+
var playNativeAudio = async (type, options) => {
|
|
3277
|
+
if (typeof window === "undefined" || typeof window.Audio === "undefined") {
|
|
3278
|
+
return false;
|
|
3279
|
+
}
|
|
3280
|
+
const soundSrc = soundMap[type];
|
|
3281
|
+
const audio = new window.Audio(soundSrc);
|
|
3282
|
+
audio.preload = "auto";
|
|
3283
|
+
audio.volume = clampVolume(options?.volume ?? 1);
|
|
3284
|
+
if (options?.restart !== false) {
|
|
3285
|
+
audio.currentTime = 0;
|
|
3286
|
+
}
|
|
3287
|
+
try {
|
|
3288
|
+
await audio.play();
|
|
3289
|
+
return true;
|
|
3290
|
+
} catch (err) {
|
|
3291
|
+
if (!isAutoplayRestrictionError(err)) {
|
|
3241
3292
|
console.error("Sound playback failed:", err);
|
|
3242
|
-
}
|
|
3293
|
+
}
|
|
3294
|
+
return false;
|
|
3295
|
+
}
|
|
3296
|
+
};
|
|
3297
|
+
var flushPendingQueue = () => {
|
|
3298
|
+
if (pendingPlaybackQueue.length === 0) return;
|
|
3299
|
+
const items = pendingPlaybackQueue;
|
|
3300
|
+
pendingPlaybackQueue = [];
|
|
3301
|
+
items.forEach(({ type, options }) => {
|
|
3302
|
+
void playNativeAudio(type, options);
|
|
3303
|
+
});
|
|
3304
|
+
};
|
|
3305
|
+
var bindInteractionListeners = () => {
|
|
3306
|
+
if (interactionListenersBound || typeof window === "undefined") return;
|
|
3307
|
+
interactionListenersBound = true;
|
|
3308
|
+
const unlockAndFlush = () => {
|
|
3309
|
+
flushPendingQueue();
|
|
3310
|
+
};
|
|
3311
|
+
window.addEventListener("pointerdown", unlockAndFlush, { passive: true });
|
|
3312
|
+
window.addEventListener("keydown", unlockAndFlush, { passive: true });
|
|
3313
|
+
};
|
|
3314
|
+
var useSound = () => {
|
|
3315
|
+
const playSound = React22.useCallback(async (type, options) => {
|
|
3316
|
+
bindInteractionListeners();
|
|
3317
|
+
const played = await playNativeAudio(type, options);
|
|
3318
|
+
if (played) return true;
|
|
3319
|
+
pendingPlaybackQueue.push({ type, options });
|
|
3320
|
+
return false;
|
|
3243
3321
|
}, []);
|
|
3244
3322
|
return { playSound };
|
|
3245
3323
|
};
|