ssovee-os-web-ui 0.1.33 → 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 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,9 +1656,9 @@ 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 px-2 pl-9 text-sm leading-tight",
1659
- md: "h-10 px-3 pl-11 text-base leading-tight",
1660
- lg: "h-12 px-4 pl-12 text-lg leading-tight"
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",
@@ -1674,6 +1675,11 @@ var SearchInput = React22__namespace.default.forwardRef(
1674
1675
  md: "left-3",
1675
1676
  lg: "left-3.5"
1676
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
+ };
1677
1683
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full min-w-0", children: [
1678
1684
  /* @__PURE__ */ jsxRuntime.jsx(
1679
1685
  "div",
@@ -1682,12 +1688,24 @@ var SearchInput = React22__namespace.default.forwardRef(
1682
1688
  "pointer-events-none absolute top-1/2 z-10 -translate-y-1/2 text-neutral-400",
1683
1689
  iconPositionClasses[size]
1684
1690
  ),
1685
- children: /* @__PURE__ */ jsxRuntime.jsx(
1686
- react.MagnifyingGlassIcon,
1691
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
1692
+ "svg",
1687
1693
  {
1688
- size: iconPixelSizes[size],
1689
1694
  className: cn("block shrink-0", iconSizeClasses[size]),
1690
- weight: "regular"
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
+ ]
1691
1709
  }
1692
1710
  )
1693
1711
  }
@@ -1705,9 +1723,13 @@ var SearchInput = React22__namespace.default.forwardRef(
1705
1723
  variantClasses[variant],
1706
1724
  "w-full min-w-0",
1707
1725
  sizeClasses[size],
1708
- showClearButton && searchValue ? "pr-10" : "",
1709
1726
  className
1710
1727
  ),
1728
+ style: {
1729
+ paddingLeft: inputPaddings[size].left,
1730
+ paddingRight: showClearButton && searchValue ? "2.5rem" : inputPaddings[size].right,
1731
+ ...style
1732
+ },
1711
1733
  ...props
1712
1734
  }
1713
1735
  ),
@@ -3242,31 +3264,60 @@ var soundMap = {
3242
3264
  success: success_tone_default,
3243
3265
  swipe: swipe_tone_default
3244
3266
  };
3245
- var audioCache = /* @__PURE__ */ new Map();
3267
+ var pendingPlaybackQueue = [];
3268
+ var interactionListenersBound = false;
3246
3269
  var clampVolume = (value) => Math.min(1, Math.max(0, value));
3247
- var useSound = () => {
3248
- const playSound = React22.useCallback(async (type, options) => {
3249
- if (typeof window === "undefined" || typeof window.Audio === "undefined") {
3250
- return false;
3251
- }
3252
- const soundSrc = soundMap[type];
3253
- let audio = audioCache.get(type);
3254
- if (!audio) {
3255
- audio = new window.Audio(soundSrc);
3256
- audio.preload = "auto";
3257
- audioCache.set(type, audio);
3258
- }
3259
- audio.volume = clampVolume(options?.volume ?? 1);
3260
- if (options?.restart !== false) {
3261
- audio.currentTime = 0;
3262
- }
3263
- try {
3264
- await audio.play();
3265
- return true;
3266
- } catch (err) {
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)) {
3267
3292
  console.error("Sound playback failed:", err);
3268
- return false;
3269
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;
3270
3321
  }, []);
3271
3322
  return { playSound };
3272
3323
  };