@poolse/react-ui 1.0.5 → 1.1.0
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/CHANGELOG.md +78 -0
- package/README.md +266 -50
- package/dist/index.cjs +101 -73
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -4
- package/dist/index.d.ts +13 -4
- package/dist/index.js +101 -73
- package/dist/index.js.map +1 -1
- package/dist/styles.css +233 -12
- package/package.json +3 -3
package/dist/styles.css
CHANGED
|
@@ -366,8 +366,14 @@
|
|
|
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
|
|
369
|
+
/* Anchor for the chevron action-trigger overlay AND the in-bubble
|
|
370
|
+
image mosaic's overlaid meta pill (WhatsApp-style). */
|
|
370
371
|
position: relative;
|
|
372
|
+
/* Clip the in-bubble image mosaic to the bubble's rounded corners
|
|
373
|
+
so the media reads as part of the bubble rather than an island
|
|
374
|
+
pasted on top. The chevron + actions overlay sit well within the
|
|
375
|
+
interior so they aren't affected by the clip. */
|
|
376
|
+
overflow: hidden;
|
|
371
377
|
}
|
|
372
378
|
|
|
373
379
|
.poolse-message--self {
|
|
@@ -1321,6 +1327,215 @@
|
|
|
1321
1327
|
font-family: var(--poolse-font-mono);
|
|
1322
1328
|
}
|
|
1323
1329
|
|
|
1330
|
+
/* ─────────────────────────────────────────────────────────────
|
|
1331
|
+
In-bubble attachment mosaic — WhatsApp-style
|
|
1332
|
+
─────────────────────────────────────────────────────────────
|
|
1333
|
+
Images render in a CSS grid INSIDE the bubble. The grid bleeds
|
|
1334
|
+
into the bubble's padding (negative side margins + overflow:hidden
|
|
1335
|
+
on the bubble) so each image hugs the bubble's rounded corners.
|
|
1336
|
+
File-type attachments stack below the mosaic as cards sitting in
|
|
1337
|
+
the bubble's normal padded area.
|
|
1338
|
+
|
|
1339
|
+
Layouts by image count (see ImageMosaic in MessageBubble.tsx):
|
|
1340
|
+
n1 → single tile, natural aspect, capped height
|
|
1341
|
+
n2 → two square tiles side-by-side
|
|
1342
|
+
n3 → one wide tile on top, two squares beneath
|
|
1343
|
+
n4 → 2×2 grid; "+N more" overlay surfaces extras past 4
|
|
1344
|
+
*/
|
|
1345
|
+
|
|
1346
|
+
.poolse-message__media {
|
|
1347
|
+
display: grid;
|
|
1348
|
+
/* 2px hairline gutters between tiles mirror the WA chat look — the
|
|
1349
|
+
bubble's background bleeds through and reads as a tasteful seam. */
|
|
1350
|
+
gap: 2px;
|
|
1351
|
+
/* Full-bleed: cancel the bubble's 7px/11px padding so each image
|
|
1352
|
+
touches the bubble border. The bubble's `overflow: hidden` +
|
|
1353
|
+
border-radius clip the mosaic to the bubble shape. */
|
|
1354
|
+
margin: -7px -11px 0 -11px;
|
|
1355
|
+
/* Minimum width so a tiny solo image doesn't collapse the bubble
|
|
1356
|
+
into a thumbnail-narrow strip. Capped naturally by the row's
|
|
1357
|
+
78% max-width. */
|
|
1358
|
+
min-width: 220px;
|
|
1359
|
+
/* Subtle backing color in case an image is transparent / still
|
|
1360
|
+
loading — keeps the seam color consistent with the bubble seams. */
|
|
1361
|
+
background: var(--poolse-surface-2);
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
/* When the bubble has only the media + meta overlay (no body, no file
|
|
1365
|
+
cards), extend the mosaic into the bubble's bottom padding too so
|
|
1366
|
+
the image fully fills the bubble. The bubble's rounded corners +
|
|
1367
|
+
overflow:hidden handle the bottom shape. */
|
|
1368
|
+
.poolse-message--media-only .poolse-message__media {
|
|
1369
|
+
margin-bottom: -7px;
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
/* When body text or file cards follow the mosaic, add a small gap so
|
|
1373
|
+
they don't kiss the image. The mosaic still bleeds into the side
|
|
1374
|
+
padding; only the bottom rejoins the padded text area. */
|
|
1375
|
+
.poolse-message__media + .poolse-message__files,
|
|
1376
|
+
.poolse-message__media + .poolse-message__body,
|
|
1377
|
+
.poolse-message__media + .poolse-message__body--deleted {
|
|
1378
|
+
margin-top: 6px;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
.poolse-message__files + .poolse-message__body,
|
|
1382
|
+
.poolse-message__files + .poolse-message__body--deleted {
|
|
1383
|
+
margin-top: 6px;
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
/* Layout templates by image count */
|
|
1387
|
+
.poolse-message__media--n1 {
|
|
1388
|
+
grid-template-columns: 1fr;
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
.poolse-message__media--n2 {
|
|
1392
|
+
grid-template-columns: 1fr 1fr;
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
.poolse-message__media--n3 {
|
|
1396
|
+
grid-template-columns: 1fr 1fr;
|
|
1397
|
+
grid-template-rows: auto auto;
|
|
1398
|
+
}
|
|
1399
|
+
.poolse-message__media--n3 > .poolse-message__media-tile:nth-child(1) {
|
|
1400
|
+
/* First tile spans the full top row (wide hero). */
|
|
1401
|
+
grid-column: 1 / span 2;
|
|
1402
|
+
aspect-ratio: 16 / 9;
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
.poolse-message__media--n4 {
|
|
1406
|
+
grid-template-columns: 1fr 1fr;
|
|
1407
|
+
grid-template-rows: 1fr 1fr;
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
/* Tile — wraps a single AttachmentPreview and the optional +N overlay.
|
|
1411
|
+
Grid-layout tiles are forced to a square aspect so the mosaic stays
|
|
1412
|
+
tidy; the solo tile keeps the image's natural shape. */
|
|
1413
|
+
.poolse-message__media-tile {
|
|
1414
|
+
position: relative;
|
|
1415
|
+
overflow: hidden;
|
|
1416
|
+
background: var(--poolse-surface-2);
|
|
1417
|
+
/* Force the AttachmentPreview's inner button + img to fill the tile
|
|
1418
|
+
by stretching their flex/grid sizing constraints. */
|
|
1419
|
+
display: block;
|
|
1420
|
+
min-width: 0;
|
|
1421
|
+
min-height: 0;
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
.poolse-message__media--n2 .poolse-message__media-tile,
|
|
1425
|
+
.poolse-message__media--n3 .poolse-message__media-tile:not(:nth-child(1)),
|
|
1426
|
+
.poolse-message__media--n4 .poolse-message__media-tile {
|
|
1427
|
+
aspect-ratio: 1 / 1;
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
/* Override AttachmentPreview's defaults so the image stretches edge-
|
|
1431
|
+
to-edge inside the tile. Outside the mosaic (e.g. ThreadView's
|
|
1432
|
+
composer preview) the original `.poolse-attachment` rules still
|
|
1433
|
+
apply unchanged. */
|
|
1434
|
+
.poolse-message__media-tile .poolse-attachment {
|
|
1435
|
+
display: block;
|
|
1436
|
+
max-width: none;
|
|
1437
|
+
width: 100%;
|
|
1438
|
+
height: 100%;
|
|
1439
|
+
gap: 0;
|
|
1440
|
+
}
|
|
1441
|
+
.poolse-message__media-tile .poolse-attachment__image-button {
|
|
1442
|
+
width: 100%;
|
|
1443
|
+
height: 100%;
|
|
1444
|
+
border-radius: 0;
|
|
1445
|
+
/* The mosaic provides the rounded corners via the bubble's clip;
|
|
1446
|
+
individual tiles stay rectangular for the grid seams. */
|
|
1447
|
+
}
|
|
1448
|
+
.poolse-message__media-tile .poolse-attachment__image {
|
|
1449
|
+
width: 100%;
|
|
1450
|
+
height: 100%;
|
|
1451
|
+
max-width: none;
|
|
1452
|
+
max-height: none;
|
|
1453
|
+
border-radius: 0;
|
|
1454
|
+
object-fit: cover;
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
/* Solo image keeps its natural aspect so portraits don't get squashed
|
|
1458
|
+
into a square — capped to a comfortable max-height. */
|
|
1459
|
+
.poolse-message__media--n1 .poolse-attachment__image {
|
|
1460
|
+
height: auto;
|
|
1461
|
+
max-height: 360px;
|
|
1462
|
+
object-fit: contain;
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
/* "+N more" overlay on the last visible tile of an over-capacity
|
|
1466
|
+
mosaic. Sits above the image with a darkened scrim so the count
|
|
1467
|
+
reads regardless of the underlying photo. */
|
|
1468
|
+
.poolse-message__media-overflow {
|
|
1469
|
+
position: absolute;
|
|
1470
|
+
inset: 0;
|
|
1471
|
+
display: flex;
|
|
1472
|
+
align-items: center;
|
|
1473
|
+
justify-content: center;
|
|
1474
|
+
background: rgba(0, 0, 0, 0.5);
|
|
1475
|
+
color: #fff;
|
|
1476
|
+
font-size: 26px;
|
|
1477
|
+
font-weight: 700;
|
|
1478
|
+
letter-spacing: -0.01em;
|
|
1479
|
+
pointer-events: none;
|
|
1480
|
+
font-family: var(--poolse-font-body);
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
/* File-type attachment cards inside the bubble — stacked, full-width,
|
|
1484
|
+
sit in the bubble's padded interior. Self bubbles tint the card
|
|
1485
|
+
slightly so it reads against the brand background. */
|
|
1486
|
+
.poolse-message__files {
|
|
1487
|
+
display: flex;
|
|
1488
|
+
flex-direction: column;
|
|
1489
|
+
gap: 4px;
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
.poolse-message__files .poolse-attachment {
|
|
1493
|
+
max-width: none;
|
|
1494
|
+
width: 100%;
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
.poolse-message__files .poolse-attachment__file {
|
|
1498
|
+
width: 100%;
|
|
1499
|
+
min-width: 0;
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
.poolse-message--self .poolse-message__files .poolse-attachment__file {
|
|
1503
|
+
background: rgba(255, 255, 255, 0.18);
|
|
1504
|
+
border-color: rgba(255, 255, 255, 0.25);
|
|
1505
|
+
color: var(--poolse-on-brand);
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
.poolse-message--self .poolse-message__files .poolse-attachment__file-icon {
|
|
1509
|
+
color: var(--poolse-on-brand);
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
.poolse-message--self .poolse-message__files .poolse-attachment__file-meta {
|
|
1513
|
+
color: rgba(255, 255, 255, 0.78);
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
/* Image-only message: float meta (time + read tick) as a pill on the
|
|
1517
|
+
bottom-right of the mosaic, WhatsApp-style. Dark scrim keeps it
|
|
1518
|
+
readable against any image. */
|
|
1519
|
+
.poolse-message__meta--overlay {
|
|
1520
|
+
position: absolute;
|
|
1521
|
+
right: 8px;
|
|
1522
|
+
bottom: 6px;
|
|
1523
|
+
padding: 2px 8px;
|
|
1524
|
+
border-radius: var(--poolse-radius-pill);
|
|
1525
|
+
background: rgba(0, 0, 0, 0.42);
|
|
1526
|
+
color: #fff !important;
|
|
1527
|
+
font-size: 10.5px;
|
|
1528
|
+
line-height: 1.2;
|
|
1529
|
+
opacity: 1;
|
|
1530
|
+
z-index: 1;
|
|
1531
|
+
pointer-events: none;
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
.poolse-message--self .poolse-message__meta--overlay,
|
|
1535
|
+
.poolse-message--other .poolse-message__meta--overlay {
|
|
1536
|
+
color: #fff;
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1324
1539
|
/* ─────────────────────────────────────────────────────────────
|
|
1325
1540
|
Reactions
|
|
1326
1541
|
───────────────────────────────────────────────────────────── */
|
|
@@ -1859,17 +2074,6 @@
|
|
|
1859
2074
|
max-width: 100%;
|
|
1860
2075
|
}
|
|
1861
2076
|
|
|
1862
|
-
.poolse-message-row__attachments {
|
|
1863
|
-
display: flex;
|
|
1864
|
-
flex-direction: column;
|
|
1865
|
-
gap: 4px;
|
|
1866
|
-
align-items: flex-start;
|
|
1867
|
-
}
|
|
1868
|
-
|
|
1869
|
-
.poolse-message-row__attachments.is-self {
|
|
1870
|
-
align-items: flex-end;
|
|
1871
|
-
}
|
|
1872
|
-
|
|
1873
2077
|
.poolse-message-row__reactions {
|
|
1874
2078
|
display: flex;
|
|
1875
2079
|
align-items: flex-start;
|
|
@@ -2133,6 +2337,23 @@
|
|
|
2133
2337
|
text-overflow: ellipsis;
|
|
2134
2338
|
}
|
|
2135
2339
|
|
|
2340
|
+
/* Ready state — no progress bar (upload's done), just a caption that
|
|
2341
|
+
reinforces the "staged, waiting on send" affordance. */
|
|
2342
|
+
.poolse-upload-chip__ready-label {
|
|
2343
|
+
color: var(--poolse-success);
|
|
2344
|
+
font-size: 12px;
|
|
2345
|
+
font-weight: 600;
|
|
2346
|
+
}
|
|
2347
|
+
|
|
2348
|
+
.poolse-upload-chip--ready {
|
|
2349
|
+
border-color: color-mix(in oklab, var(--poolse-success) 40%, var(--poolse-border));
|
|
2350
|
+
background: color-mix(in oklab, var(--poolse-success) 6%, var(--poolse-surface));
|
|
2351
|
+
}
|
|
2352
|
+
|
|
2353
|
+
.poolse-upload-chip--ready .poolse-upload-chip__icon {
|
|
2354
|
+
color: var(--poolse-success);
|
|
2355
|
+
}
|
|
2356
|
+
|
|
2136
2357
|
.poolse-upload-chip__action {
|
|
2137
2358
|
flex-shrink: 0;
|
|
2138
2359
|
width: 22px;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poolse/react-ui",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
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/
|
|
50
|
-
"@poolse/
|
|
49
|
+
"@poolse/react": "1.1.0",
|
|
50
|
+
"@poolse/sdk": "1.1.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"react": ">=18"
|