@livelayer/react 0.18.1 → 0.18.3

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.
Files changed (2) hide show
  1. package/dist/styles.css +55 -25
  2. package/package.json +1 -1
package/dist/styles.css CHANGED
@@ -582,34 +582,64 @@
582
582
  flex-direction: column;
583
583
  }
584
584
 
585
- .ll-expanded--desktop {
586
- width: 400px;
587
- height: 560px;
588
- border-radius: 20px;
589
- }
590
-
591
- .ll-expanded--mobile {
592
- /* Mobile expanded is a thumbnail PiP 9:16 portrait, ~150px wide.
593
- The visitor's website is the primary surface; the widget is a
594
- persistent reachable affordance, not the focus. Sized so it fits
595
- comfortably alongside content without blocking it.
596
-
597
- Evolution:
598
- v0: 100vw × 80dvh edge-to-edge sheet blocked 60% of screen
599
- v0.16: 380 × 540 card marginally smaller, still ~90% of phone width
600
- v0.17: 150 × 267 (9:16) thumbnail → properly out-of-the-way
601
-
602
- The clamp lets the card scale slightly with viewport — tiny phones
603
- (320px wide) get 140px, normal phones (393-430px) stay at the
604
- 150px sweet spot, larger phones / foldables (500px+) can grow to
605
- 180px. aspect-ratio derives height from width so the 9:16 portrait
606
- framing stays exact regardless of where in the clamp range the
607
- viewport lands. */
608
- width: clamp(140px, 38vw, 180px);
609
- aspect-ratio: 9 / 16;
585
+ /* Sizing is media-query-driven, NOT JS-class-driven.
586
+ *
587
+ * Why: useIsMobile() is SSR-safe — it returns `false` on the server
588
+ * and on the very first client paint, then flips to `true` on the
589
+ * first useEffect tick. If sizing were keyed off the .ll-expanded--
590
+ * desktop / .ll-expanded--mobile class (which IS JS-driven), the
591
+ * first paint would render at desktop dimensions (400×560), then
592
+ * snap down to mobile dimensions (160×230) once the effect ran.
593
+ * Visitors on phones saw a visible flash of an oversized widget.
594
+ *
595
+ * The component still adds the .ll-expanded--desktop / --mobile
596
+ * class — other styles (the compact-status pill positioning,
597
+ * topbar padding, PIP sizing, etc.) key off it. But the bounding-
598
+ * box dimensions live in the .ll-expanded base + the media query
599
+ * below, so the right size is applied at first paint regardless
600
+ * of JS readiness.
601
+ *
602
+ * Breakpoint: 640px (matches Tailwind's `sm`). When a consumer
603
+ * passes a custom mobileBreakpoint prop, the JS still computes
604
+ * isMobile against that custom value (drives layout / waveform /
605
+ * compactControls behavior) but the CSS box dims stick to 640px.
606
+ * Acceptable tradeoff: the visual size flickers slightly when the
607
+ * custom breakpoint differs from 640, but the common case (every
608
+ * site using the default breakpoint) has zero flash.
609
+ *
610
+ * LL landing reference (components/landing/ExperienceFork.tsx:36):
611
+ * mobile (default): w-[160px] h-[230px]
612
+ * sm+ (≥640px): w-[180px] h-[260px]
613
+ * Desktop reference: 400 × 560, matches editor preview at app.livelayer.studio.
614
+ */
615
+ .ll-expanded {
616
+ /* Mobile-first: phones get the thumbnail card by default. The
617
+ desktop override below kicks in at ≥1024px where there's
618
+ actually room for the full 400 × 560 panel. */
619
+ width: 160px;
620
+ height: 230px;
610
621
  border-radius: 16px;
611
622
  }
612
623
 
624
+ @media (min-width: 640px) and (max-width: 1023px) {
625
+ .ll-expanded {
626
+ /* Sm-to-lg breakpoint — small tablets / large phones in
627
+ landscape. Slightly larger thumbnail. Matches the LL demo's
628
+ `sm:w-[180px] sm:h-[260px]` exactly. */
629
+ width: 180px;
630
+ height: 260px;
631
+ }
632
+ }
633
+
634
+ @media (min-width: 1024px) {
635
+ .ll-expanded {
636
+ /* Desktop card — full 400 × 560 with a softer 20px radius. */
637
+ width: 400px;
638
+ height: 560px;
639
+ border-radius: 20px;
640
+ }
641
+ }
642
+
613
643
  /* ── Background layers ───────────────────────────────────────── */
614
644
 
615
645
  .ll-expanded__bg,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livelayer/react",
3
- "version": "0.18.1",
3
+ "version": "0.18.3",
4
4
  "description": "LiveLayer agent widget for React — avatar video, team switching, responsive layouts, full-fidelity embed",
5
5
  "keywords": [
6
6
  "livelayer",