@bearmenu/ui 0.5.1 → 0.5.2

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.
@@ -26,13 +26,12 @@ var SlidingPanels = ({
26
26
  return () => ro.disconnect();
27
27
  }, [currentIndex]);
28
28
  const handleBack = () => {
29
- if (currentIndex > 0) {
30
- const previousPanel = panels[currentIndex - 1];
31
- if (currentPanelData == null ? void 0 : currentPanelData.onBack) {
32
- currentPanelData.onBack();
33
- } else {
34
- onPanelChange(previousPanel.id);
35
- }
29
+ const previousPanel = panels[currentIndex - 1];
30
+ if (!previousPanel) return;
31
+ if (currentPanelData == null ? void 0 : currentPanelData.onBack) {
32
+ currentPanelData.onBack();
33
+ } else {
34
+ onPanelChange(previousPanel.id);
36
35
  }
37
36
  };
38
37
  return /* @__PURE__ */ jsx(
@@ -22,6 +22,7 @@ var StickyContainer = ({
22
22
  {
23
23
  ref,
24
24
  id,
25
+ "data-stuck": isSticky ? "true" : void 0,
25
26
  className: cn(
26
27
  "sticky px-4 transition-all duration-200",
27
28
  hideUntilSticky ? isSticky ? "py-4 opacity-100 translate-y-0" : "py-0 opacity-0 -translate-y-2 pointer-events-none" : "py-4",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bearmenu/ui",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "BearMenu design system — shared UI tokens, primitives, and components",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -46,13 +46,12 @@ export const SlidingPanels = ({
46
46
  }, [currentIndex]);
47
47
 
48
48
  const handleBack = () => {
49
- if (currentIndex > 0) {
50
- const previousPanel = panels[currentIndex - 1];
51
- if (currentPanelData?.onBack) {
52
- currentPanelData.onBack();
53
- } else {
54
- onPanelChange(previousPanel.id);
55
- }
49
+ const previousPanel = panels[currentIndex - 1];
50
+ if (!previousPanel) return;
51
+ if (currentPanelData?.onBack) {
52
+ currentPanelData.onBack();
53
+ } else {
54
+ onPanelChange(previousPanel.id);
56
55
  }
57
56
  };
58
57
 
@@ -65,6 +65,7 @@ export const StickyContainer = ({
65
65
  <div
66
66
  ref={ref}
67
67
  id={id}
68
+ data-stuck={isSticky ? "true" : undefined}
68
69
  className={cn(
69
70
  "sticky px-4 transition-all duration-200",
70
71
  hideUntilSticky
package/src/globals.css CHANGED
@@ -422,6 +422,22 @@ h6 {
422
422
  top: env(safe-area-inset-top, 0);
423
423
  }
424
424
 
425
+ /* In PWA standalone mode the sticky bar pins below the safe-area inset, leaving
426
+ the strip under the notch transparent. When the bar is actually stuck
427
+ (data-stuck="true"), extend its current background up into that strip so the
428
+ status bar sits over the bar's color instead of empty space.
429
+ Browser mode never matches `display-mode: standalone`, so this is a no-op. */
430
+ @media (display-mode: standalone) {
431
+ .sticky-header-safe[data-stuck="true"]::before {
432
+ content: "";
433
+ position: absolute;
434
+ inset: calc(-1 * env(safe-area-inset-top, 0)) 0 auto 0;
435
+ height: env(safe-area-inset-top, 0);
436
+ background: inherit;
437
+ pointer-events: none;
438
+ }
439
+ }
440
+
425
441
  /* For mobile bottom nav */
426
442
  .mobile-nav-safe {
427
443
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));