@poolse/react-ui 1.0.0-beta.0 → 1.0.1-beta.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/dist/index.cjs +305 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +76 -2
- package/dist/index.d.ts +76 -2
- package/dist/index.js +301 -56
- package/dist/index.js.map +1 -1
- package/dist/styles.css +228 -9
- package/package.json +5 -3
package/dist/styles.css
CHANGED
|
@@ -271,10 +271,53 @@
|
|
|
271
271
|
flex: 1 1 auto;
|
|
272
272
|
min-height: 0;
|
|
273
273
|
overflow-y: auto;
|
|
274
|
-
padding:
|
|
274
|
+
padding: 16px 14px;
|
|
275
275
|
display: flex;
|
|
276
276
|
flex-direction: column;
|
|
277
|
-
gap
|
|
277
|
+
/* Default tight gap — intra-cluster spacing. Rows that start a
|
|
278
|
+
NEW cluster (first / standalone) bump their own top margin via
|
|
279
|
+
the modifier below to create the inter-cluster gap. */
|
|
280
|
+
gap: 2px;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/* Inter-cluster gap: rows that start a new burst push themselves
|
|
284
|
+
down a bit so groups separate visually. The very first row in
|
|
285
|
+
the list doesn't need it (no preceding sibling), CSS handles
|
|
286
|
+
that via the :first-child override. */
|
|
287
|
+
.poolse-message-row--first,
|
|
288
|
+
.poolse-message-row--standalone {
|
|
289
|
+
margin-top: 10px;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.poolse-message-row--first:first-child,
|
|
293
|
+
.poolse-message-row--standalone:first-child {
|
|
294
|
+
margin-top: 0;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/* Day separator — centered pill between messages whose calendar
|
|
298
|
+
day differs. Padded above/below so it visually clusters with the
|
|
299
|
+
first message of the new day. */
|
|
300
|
+
.poolse-day-separator {
|
|
301
|
+
display: flex;
|
|
302
|
+
justify-content: center;
|
|
303
|
+
align-items: center;
|
|
304
|
+
margin: 14px 0 4px;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.poolse-day-separator:first-child {
|
|
308
|
+
margin-top: 0;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.poolse-day-separator span {
|
|
312
|
+
display: inline-block;
|
|
313
|
+
padding: 3px 12px;
|
|
314
|
+
font-size: 11.5px;
|
|
315
|
+
font-weight: 600;
|
|
316
|
+
letter-spacing: 0.02em;
|
|
317
|
+
color: var(--poolse-ink-3);
|
|
318
|
+
background: var(--poolse-surface);
|
|
319
|
+
border: 1px solid var(--poolse-border);
|
|
320
|
+
border-radius: var(--poolse-radius-pill);
|
|
278
321
|
}
|
|
279
322
|
|
|
280
323
|
.poolse-conversation__load-more {
|
|
@@ -311,8 +354,11 @@
|
|
|
311
354
|
display: flex;
|
|
312
355
|
flex-direction: column;
|
|
313
356
|
max-width: 78%;
|
|
314
|
-
padding
|
|
315
|
-
|
|
357
|
+
/* Tighter padding for a denser, more iMessage/WhatsApp-like read. */
|
|
358
|
+
padding: 7px 11px;
|
|
359
|
+
/* Default fully-rounded; the group-position modifiers below swap in
|
|
360
|
+
the asymmetric tail corner for `last` / `standalone`. */
|
|
361
|
+
border-radius: 16px;
|
|
316
362
|
font-size: 14.5px;
|
|
317
363
|
line-height: 1.4;
|
|
318
364
|
word-wrap: break-word;
|
|
@@ -323,7 +369,6 @@
|
|
|
323
369
|
align-self: flex-end;
|
|
324
370
|
background: var(--poolse-brand);
|
|
325
371
|
color: var(--poolse-on-brand);
|
|
326
|
-
border-bottom-right-radius: 5px;
|
|
327
372
|
}
|
|
328
373
|
|
|
329
374
|
.poolse-message--other {
|
|
@@ -331,6 +376,20 @@
|
|
|
331
376
|
background: var(--poolse-surface);
|
|
332
377
|
color: var(--poolse-ink);
|
|
333
378
|
border: 1px solid var(--poolse-border);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/* ── Group-position corners ─────────────────────────────────────
|
|
382
|
+
Only `last` + `standalone` get the asymmetric tail. `first` and
|
|
383
|
+
`middle` keep all corners rounded so the cluster reads as a
|
|
384
|
+
single contiguous block. Self gets the tail on the bottom-right
|
|
385
|
+
(its own side); other gets it on the bottom-left. */
|
|
386
|
+
.poolse-message--self.poolse-message--last,
|
|
387
|
+
.poolse-message--self.poolse-message--standalone {
|
|
388
|
+
border-bottom-right-radius: 5px;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.poolse-message--other.poolse-message--last,
|
|
392
|
+
.poolse-message--other.poolse-message--standalone {
|
|
334
393
|
border-bottom-left-radius: 5px;
|
|
335
394
|
}
|
|
336
395
|
|
|
@@ -340,9 +399,157 @@
|
|
|
340
399
|
gap: 4px;
|
|
341
400
|
justify-content: flex-end;
|
|
342
401
|
font-size: 10.5px;
|
|
343
|
-
margin-top:
|
|
402
|
+
margin-top: 3px;
|
|
403
|
+
opacity: 0.85;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.poolse-message__body {
|
|
407
|
+
white-space: pre-wrap;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/* Sender label — small, bold, per-user color. Only renders on the
|
|
411
|
+
first (or standalone) bubble of an other-side cluster when
|
|
412
|
+
`showSenderName` is true. Sits inside the bubble, above the body. */
|
|
413
|
+
.poolse-message__sender {
|
|
414
|
+
font-size: 12px;
|
|
415
|
+
font-weight: 700;
|
|
416
|
+
letter-spacing: 0.01em;
|
|
417
|
+
margin-bottom: 2px;
|
|
418
|
+
/* color is set inline via the userColor() palette so each user
|
|
419
|
+
keeps a stable identity tint. */
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/* Bubble + avatar shell — flex row, avatar slot to the left,
|
|
423
|
+
bubble to the right. Self bubbles + no-avatar configurations
|
|
424
|
+
bypass this wrapper entirely (Fragment passthrough). */
|
|
425
|
+
.poolse-bubble-shell {
|
|
426
|
+
display: flex;
|
|
427
|
+
align-items: flex-end;
|
|
428
|
+
gap: 6px;
|
|
429
|
+
/* Inherit max-width from .poolse-message-row so the bubble +
|
|
430
|
+
avatar combined never exceed the row's cap. */
|
|
431
|
+
max-width: 100%;
|
|
432
|
+
min-width: 0;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.poolse-bubble-shell__avatar {
|
|
436
|
+
/* Fixed width regardless of avatar presence so continuation
|
|
437
|
+
bubbles line up under the first one. */
|
|
438
|
+
flex-shrink: 0;
|
|
439
|
+
width: 28px;
|
|
440
|
+
height: 28px;
|
|
441
|
+
display: flex;
|
|
442
|
+
align-items: center;
|
|
443
|
+
justify-content: center;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/* Avatar is anchored to the bottom of the cluster — visually
|
|
447
|
+
pairs with the bubble's tail corner on the last bubble. */
|
|
448
|
+
.poolse-bubble-shell__avatar > * {
|
|
449
|
+
align-self: flex-end;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/* Markdown overrides — react-markdown emits real <p>, <ul>, <code>,
|
|
453
|
+
etc. Tame them so the bubble doesn't blow up vertically and the
|
|
454
|
+
spacing matches the rest of the chat. */
|
|
455
|
+
.poolse-message__body p {
|
|
456
|
+
margin: 0;
|
|
457
|
+
}
|
|
458
|
+
.poolse-message__body p + p {
|
|
459
|
+
margin-top: 6px;
|
|
460
|
+
}
|
|
461
|
+
.poolse-message__body ul,
|
|
462
|
+
.poolse-message__body ol {
|
|
463
|
+
margin: 4px 0;
|
|
464
|
+
padding-left: 22px;
|
|
465
|
+
}
|
|
466
|
+
.poolse-message__body li + li {
|
|
467
|
+
margin-top: 2px;
|
|
468
|
+
}
|
|
469
|
+
.poolse-message__body code {
|
|
470
|
+
font-family: var(--poolse-font-mono);
|
|
471
|
+
font-size: 0.92em;
|
|
472
|
+
background: rgba(0, 0, 0, 0.08);
|
|
473
|
+
padding: 1px 4px;
|
|
474
|
+
border-radius: 3px;
|
|
475
|
+
}
|
|
476
|
+
.poolse-message--self .poolse-message__body code {
|
|
477
|
+
background: rgba(255, 255, 255, 0.2);
|
|
478
|
+
}
|
|
479
|
+
.poolse-message__body pre {
|
|
480
|
+
margin: 6px 0;
|
|
481
|
+
padding: 8px 10px;
|
|
482
|
+
background: rgba(0, 0, 0, 0.08);
|
|
483
|
+
border-radius: 6px;
|
|
484
|
+
overflow-x: auto;
|
|
485
|
+
}
|
|
486
|
+
.poolse-message--self .poolse-message__body pre {
|
|
487
|
+
background: rgba(0, 0, 0, 0.18);
|
|
488
|
+
}
|
|
489
|
+
.poolse-message__body pre code {
|
|
490
|
+
background: transparent;
|
|
491
|
+
padding: 0;
|
|
492
|
+
font-size: 12.5px;
|
|
493
|
+
line-height: 1.45;
|
|
494
|
+
}
|
|
495
|
+
.poolse-message__body blockquote {
|
|
496
|
+
margin: 4px 0;
|
|
497
|
+
padding: 2px 10px;
|
|
498
|
+
border-left: 3px solid currentColor;
|
|
344
499
|
opacity: 0.85;
|
|
345
500
|
}
|
|
501
|
+
.poolse-message__body a {
|
|
502
|
+
color: inherit;
|
|
503
|
+
text-decoration: underline;
|
|
504
|
+
text-underline-offset: 2px;
|
|
505
|
+
font-weight: 600;
|
|
506
|
+
}
|
|
507
|
+
.poolse-message__body a:hover {
|
|
508
|
+
opacity: 0.85;
|
|
509
|
+
}
|
|
510
|
+
.poolse-message__body h1,
|
|
511
|
+
.poolse-message__body h2,
|
|
512
|
+
.poolse-message__body h3,
|
|
513
|
+
.poolse-message__body h4 {
|
|
514
|
+
/* Headings in chat are unusual — keep them tight + inline-ish. */
|
|
515
|
+
margin: 4px 0 2px;
|
|
516
|
+
font-size: 1em;
|
|
517
|
+
font-weight: 700;
|
|
518
|
+
}
|
|
519
|
+
.poolse-message__body table {
|
|
520
|
+
border-collapse: collapse;
|
|
521
|
+
margin: 4px 0;
|
|
522
|
+
font-size: 0.92em;
|
|
523
|
+
}
|
|
524
|
+
.poolse-message__body th,
|
|
525
|
+
.poolse-message__body td {
|
|
526
|
+
border: 1px solid currentColor;
|
|
527
|
+
padding: 2px 6px;
|
|
528
|
+
}
|
|
529
|
+
.poolse-message__body hr {
|
|
530
|
+
border: none;
|
|
531
|
+
border-top: 1px solid currentColor;
|
|
532
|
+
opacity: 0.3;
|
|
533
|
+
margin: 6px 0;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
.poolse-message__read-more {
|
|
537
|
+
display: inline-block;
|
|
538
|
+
margin-left: 6px;
|
|
539
|
+
padding: 0;
|
|
540
|
+
background: transparent;
|
|
541
|
+
border: none;
|
|
542
|
+
cursor: pointer;
|
|
543
|
+
font: inherit;
|
|
544
|
+
font-weight: 600;
|
|
545
|
+
text-decoration: underline;
|
|
546
|
+
color: inherit;
|
|
547
|
+
opacity: 0.85;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
.poolse-message__read-more:hover {
|
|
551
|
+
opacity: 1;
|
|
552
|
+
}
|
|
346
553
|
|
|
347
554
|
.poolse-message--self .poolse-message__meta {
|
|
348
555
|
color: var(--poolse-on-brand);
|
|
@@ -1135,18 +1342,30 @@
|
|
|
1135
1342
|
|
|
1136
1343
|
.poolse-message-row__actions {
|
|
1137
1344
|
position: absolute;
|
|
1138
|
-
top
|
|
1345
|
+
/* Vertically align with the bubble's top edge, slightly inset so
|
|
1346
|
+
the toolbar visually centers on the first line of a multi-line
|
|
1347
|
+
message. */
|
|
1348
|
+
top: 4px;
|
|
1349
|
+
z-index: 3;
|
|
1139
1350
|
opacity: 0;
|
|
1140
1351
|
pointer-events: none;
|
|
1141
1352
|
transition: opacity 0.12s;
|
|
1142
1353
|
}
|
|
1143
1354
|
|
|
1355
|
+
/* The toolbar sits BESIDE the bubble — never over it. That keeps
|
|
1356
|
+
the entire bubble body clickable (links, embedded UI, etc.) and
|
|
1357
|
+
sidesteps the messages-container overflow clipping that bit the
|
|
1358
|
+
"float above" approach when a bubble was near the top of the
|
|
1359
|
+
scrollable area.
|
|
1360
|
+
- Self (right-aligned) bubble → toolbar on the LEFT
|
|
1361
|
+
- Other (left-aligned) bubble → toolbar on the RIGHT
|
|
1362
|
+
Both directions point INTO the messages container's free space. */
|
|
1144
1363
|
.poolse-message-row__actions--right {
|
|
1145
|
-
right:
|
|
1364
|
+
right: calc(100% + 6px);
|
|
1146
1365
|
}
|
|
1147
1366
|
|
|
1148
1367
|
.poolse-message-row__actions--left {
|
|
1149
|
-
left:
|
|
1368
|
+
left: calc(100% + 6px);
|
|
1150
1369
|
}
|
|
1151
1370
|
|
|
1152
1371
|
.poolse-message-row:hover .poolse-message-row__actions,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poolse/react-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1-beta.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": [
|
|
@@ -44,8 +44,10 @@
|
|
|
44
44
|
"CHANGELOG.md"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"
|
|
48
|
-
"
|
|
47
|
+
"react-markdown": "^9.0.1",
|
|
48
|
+
"remark-gfm": "^4.0.0",
|
|
49
|
+
"@poolse/react": "1.0.1-beta.0",
|
|
50
|
+
"@poolse/sdk": "1.0.1-beta.0"
|
|
49
51
|
},
|
|
50
52
|
"peerDependencies": {
|
|
51
53
|
"react": ">=18"
|