@poolse/react-ui 1.0.2 → 1.0.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/dist/styles.css CHANGED
@@ -366,6 +366,8 @@
366
366
  line-height: 1.4;
367
367
  word-wrap: break-word;
368
368
  overflow-wrap: anywhere;
369
+ /* Anchor for the chevron action-trigger overlay. */
370
+ position: relative;
369
371
  }
370
372
 
371
373
  .poolse-message--self {
@@ -1359,12 +1361,18 @@
1359
1361
 
1360
1362
  .poolse-reaction-picker {
1361
1363
  display: inline-flex;
1364
+ flex-wrap: wrap;
1362
1365
  gap: 4px;
1363
1366
  padding: 6px;
1364
1367
  background: var(--poolse-surface);
1365
1368
  border: 1px solid var(--poolse-border);
1366
1369
  border-radius: var(--poolse-radius-lg);
1367
1370
  box-shadow: var(--poolse-shadow-md);
1371
+ /* Cap width so the picker can't overflow narrow viewports. Anchors
1372
+ to the same edge as the actions toolbar via
1373
+ .poolse-msg-actions__picker; if it would exceed the bubble's
1374
+ side it wraps to a second row instead of clipping off-screen. */
1375
+ max-width: min(280px, calc(100vw - 16px));
1368
1376
  }
1369
1377
 
1370
1378
  .poolse-reaction-picker__btn {
@@ -1474,6 +1482,10 @@
1474
1482
  color: var(--poolse-error);
1475
1483
  }
1476
1484
 
1485
+ /* Reactions picker — mirrors the actions popover's edge alignment so
1486
+ it stays anchored to the same side as the toolbar (right for self,
1487
+ left for other). On narrow viewports the picker wraps to two rows
1488
+ so it never overflows the bubble's max-width. */
1477
1489
  .poolse-msg-actions__picker {
1478
1490
  position: absolute;
1479
1491
  /* Picker appears BELOW the actions toolbar so the stack is
@@ -1483,6 +1495,14 @@
1483
1495
  z-index: 10;
1484
1496
  }
1485
1497
 
1498
+ /* When the row's actions are right-aligned (self bubbles), the picker
1499
+ anchors to the right edge of the toolbar so it extends LEFT — same
1500
+ "into available space" behavior the toolbar itself uses. */
1501
+ .poolse-message-row__actions--right .poolse-msg-actions__picker {
1502
+ left: auto;
1503
+ right: 0;
1504
+ }
1505
+
1486
1506
  /* Default container that customers can wrap each message in for
1487
1507
  hover-show behavior. Adds positioning context + reveals the
1488
1508
  actions only on row hover. */
@@ -1518,13 +1538,90 @@
1518
1538
  left: 0;
1519
1539
  }
1520
1540
 
1521
- .poolse-message-row:hover .poolse-message-row__actions,
1522
- .poolse-message-row:focus-within .poolse-message-row__actions,
1523
- .poolse-message-row[data-actions-open] .poolse-message-row__actions {
1541
+ /* Reveal the actions popover only on explicit open — click on chevron
1542
+ (desktop) / tap-on-bubble (touch) sets data-actions-open; the
1543
+ popover then stays open while any of its OWN buttons have focus
1544
+ (so keyboard tabbing inside doesn't dismiss it).
1545
+ We deliberately do NOT use `.poolse-message-row:focus-within` here:
1546
+ that would also open on any other focusable descendant (e.g. the
1547
+ thread-pill "N replies" button), which is the wrong UX. */
1548
+ .poolse-message-row[data-actions-open] .poolse-message-row__actions,
1549
+ .poolse-message-row__actions:focus-within {
1524
1550
  opacity: 1;
1525
1551
  pointer-events: auto;
1526
1552
  }
1527
1553
 
1554
+ /* For other-side rows with avatar, the row spans avatar + gap + bubble.
1555
+ Shift the popover right by the avatar slot (28px + 6px gap) so it
1556
+ left-aligns with the bubble, not the avatar. */
1557
+ .poolse-message-row[data-avatar] .poolse-message-row__actions--left {
1558
+ left: 34px;
1559
+ }
1560
+
1561
+ /* Chevron action trigger — overlay at the bubble's top-trailing
1562
+ corner. Hidden on touch (tap-on-bubble works there) and on screens
1563
+ without hover. On desktop: hidden by default, visible on row hover
1564
+ OR while the popover is open. WhatsApp-style affordance — discoverable
1565
+ without being visually noisy. */
1566
+ .poolse-message__chevron {
1567
+ position: absolute;
1568
+ top: 4px;
1569
+ right: 4px;
1570
+ width: 22px;
1571
+ height: 22px;
1572
+ display: inline-flex;
1573
+ align-items: center;
1574
+ justify-content: center;
1575
+ padding: 0;
1576
+ border: none;
1577
+ border-radius: 50%;
1578
+ background: color-mix(in oklab, var(--poolse-ink) 18%, transparent);
1579
+ color: var(--poolse-on-brand);
1580
+ cursor: pointer;
1581
+ opacity: 0;
1582
+ pointer-events: none;
1583
+ transition:
1584
+ opacity 0.12s,
1585
+ background-color 0.12s;
1586
+ z-index: 2;
1587
+ }
1588
+
1589
+ .poolse-message--other .poolse-message__chevron {
1590
+ background: color-mix(in oklab, var(--poolse-ink-2) 18%, transparent);
1591
+ color: var(--poolse-ink-2);
1592
+ }
1593
+
1594
+ .poolse-message__chevron:hover {
1595
+ background: color-mix(in oklab, var(--poolse-ink) 34%, transparent);
1596
+ }
1597
+
1598
+ .poolse-message--other .poolse-message__chevron:hover {
1599
+ background: color-mix(in oklab, var(--poolse-ink-2) 32%, transparent);
1600
+ color: var(--poolse-ink);
1601
+ }
1602
+
1603
+ /* Chevron reveal — show on row hover (desktop discoverability), on
1604
+ its own focus (keyboard users tabbing through), or whenever the
1605
+ popover is open. We can't use row :focus-within (that would also
1606
+ reveal it while a thread-pill or reaction button has focus, which
1607
+ isn't what we want) — focusing the chevron itself or a popover
1608
+ button keeps both visible. */
1609
+ .poolse-message-row:hover .poolse-message__chevron,
1610
+ .poolse-message__chevron:focus,
1611
+ .poolse-message-row[data-actions-open] .poolse-message__chevron {
1612
+ opacity: 1;
1613
+ pointer-events: auto;
1614
+ }
1615
+
1616
+ /* Touch devices don't need the chevron — tap-on-bubble opens the
1617
+ popover there. The chevron would also miss `:hover` on touch
1618
+ anyway, but hiding it explicitly keeps the bubble visually clean. */
1619
+ @media (hover: none) {
1620
+ .poolse-message__chevron {
1621
+ display: none;
1622
+ }
1623
+ }
1624
+
1528
1625
  /* ─────────────────────────────────────────────────────────────
1529
1626
  EditableMessageBubble — in-place edit
1530
1627
  ───────────────────────────────────────────────────────────── */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poolse/react-ui",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Plug-and-play React components for poolse — realtime chat infrastructure. Brand-aligned defaults, CSS-variable theming, render-prop escape hatches.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -46,8 +46,8 @@
46
46
  "dependencies": {
47
47
  "react-markdown": "^9.0.1",
48
48
  "remark-gfm": "^4.0.0",
49
- "@poolse/react": "1.0.2",
50
- "@poolse/sdk": "1.0.2"
49
+ "@poolse/react": "1.0.4",
50
+ "@poolse/sdk": "1.0.4"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "react": ">=18"