@adatechnology/conversations-ui 0.4.2 → 0.6.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.
Files changed (110) hide show
  1. package/README.md +231 -0
  2. package/dist/{ConversationSimulatorPanel-DnXElfY8.d.ts → ConversationSimulatorPanel-CrfFjiWh.d.ts} +2 -268
  3. package/dist/{chunk-PJNR6UMN.js → chunk-CBYEHPX6.js} +1 -63
  4. package/dist/{chunk-4P5KMWOI.js → chunk-FAQLC3TX.js} +327 -522
  5. package/dist/{chunk-HMCOTZAX.js → chunk-HOKNKXIT.js} +1 -1
  6. package/dist/chunk-MRVFFJEH.js +64 -0
  7. package/dist/chunk-O6457XHK.js +255 -0
  8. package/dist/chunk-OVFCLRQQ.js +84 -0
  9. package/dist/flows/index.js +5 -3
  10. package/dist/index.d.ts +21 -5
  11. package/dist/index.js +783 -807
  12. package/dist/participant/index.d.ts +186 -0
  13. package/dist/participant/index.js +1708 -0
  14. package/dist/preview/index.d.ts +4 -2
  15. package/dist/preview/index.js +4 -2
  16. package/dist/quickReply.types-B4gmZsSr.d.ts +274 -0
  17. package/dist/styles.css +689 -0
  18. package/package.json +8 -4
  19. package/src/ChannelIcon.tsx +2 -0
  20. package/src/MessageText.test.tsx +76 -0
  21. package/src/MessageText.tsx +28 -12
  22. package/src/MessageTextCopiedBadge.tsx +15 -0
  23. package/src/StatusTicks.test.tsx +51 -0
  24. package/src/StatusTicks.tsx +36 -6
  25. package/src/buildOutput.test.ts +41 -0
  26. package/src/channelCapability.test.ts +17 -0
  27. package/src/conversationChannel.test.ts +30 -1
  28. package/src/conversationChannel.ts +19 -1
  29. package/src/legacyChannels.golden.test.ts +89 -0
  30. package/src/legacyDefaults.golden.test.tsx +127 -0
  31. package/src/legacyStyles.fixture.css +1121 -0
  32. package/src/legacyStyles.golden.test.ts +121 -0
  33. package/src/messageTextCopyInteraction.test.ts +75 -0
  34. package/src/messageTextCopyInteraction.ts +37 -0
  35. package/src/participant/ParticipantAttachmentItem.tsx +77 -0
  36. package/src/participant/ParticipantChannelBadges.test.tsx +59 -0
  37. package/src/participant/ParticipantChannelBadges.tsx +75 -0
  38. package/src/participant/ParticipantComposer.test.tsx +97 -0
  39. package/src/participant/ParticipantComposer.tsx +167 -0
  40. package/src/participant/ParticipantConversations.test.tsx +90 -0
  41. package/src/participant/ParticipantConversations.tsx +49 -0
  42. package/src/participant/ParticipantConversationsScreen.tsx +78 -0
  43. package/src/participant/ParticipantInbox.test.tsx +244 -0
  44. package/src/participant/ParticipantInbox.tsx +149 -0
  45. package/src/participant/ParticipantInboxRow.tsx +75 -0
  46. package/src/participant/ParticipantInboxSearchField.tsx +34 -0
  47. package/src/participant/ParticipantLoadState.tsx +27 -0
  48. package/src/participant/ParticipantMessageBubble.test.tsx +167 -0
  49. package/src/participant/ParticipantMessageBubble.tsx +185 -0
  50. package/src/participant/ParticipantProtocolBadge.tsx +74 -0
  51. package/src/participant/ParticipantProtocolView.test.tsx +208 -0
  52. package/src/participant/ParticipantThread.test.tsx +149 -0
  53. package/src/participant/ParticipantThread.tsx +184 -0
  54. package/src/participant/ParticipantThreadScreen.tsx +135 -0
  55. package/src/participant/bindAttachmentUrlResolver.test.ts +25 -0
  56. package/src/participant/bindAttachmentUrlResolver.ts +7 -0
  57. package/src/participant/index.ts +26 -0
  58. package/src/participant/participant.types.ts +52 -0
  59. package/src/participant/participantApi.types.ts +59 -0
  60. package/src/participant/participantAttachmentUrl.test.ts +32 -0
  61. package/src/participant/participantAttachmentUrl.ts +10 -0
  62. package/src/participant/participantBubbleActions.test.ts +44 -0
  63. package/src/participant/participantBubbleActions.ts +40 -0
  64. package/src/participant/participantChannels.test.ts +42 -0
  65. package/src/participant/participantChannels.ts +33 -0
  66. package/src/participant/participantDrafts.test.ts +65 -0
  67. package/src/participant/participantDrafts.ts +50 -0
  68. package/src/participant/participantFileValidation.test.ts +86 -0
  69. package/src/participant/participantFileValidation.ts +72 -0
  70. package/src/participant/participantFixtures.test-helper.ts +41 -0
  71. package/src/participant/participantGrouping.test.ts +236 -0
  72. package/src/participant/participantGrouping.ts +90 -0
  73. package/src/participant/participantInboxState.test.ts +69 -0
  74. package/src/participant/participantInboxState.ts +74 -0
  75. package/src/participant/participantLabels.ts +115 -0
  76. package/src/participant/participantLoadView.test.ts +23 -0
  77. package/src/participant/participantLoadView.ts +21 -0
  78. package/src/participant/participantMessages.test.ts +128 -0
  79. package/src/participant/participantMessages.ts +73 -0
  80. package/src/participant/participantNewMessages.test.ts +54 -0
  81. package/src/participant/participantNewMessages.ts +29 -0
  82. package/src/participant/participantProtocol.test.ts +104 -0
  83. package/src/participant/participantProtocol.ts +52 -0
  84. package/src/participant/participantProtocolCopy.test.ts +45 -0
  85. package/src/participant/participantProtocolCopy.ts +32 -0
  86. package/src/participant/participantQuickReply.test.ts +23 -0
  87. package/src/participant/participantQuickReply.ts +6 -0
  88. package/src/participant/participantScroll.test.ts +69 -0
  89. package/src/participant/participantScroll.ts +43 -0
  90. package/src/participant/participantSendController.test.ts +201 -0
  91. package/src/participant/participantSendController.ts +134 -0
  92. package/src/participant/participantSendStates.ts +31 -0
  93. package/src/participant/participantTheme.ts +20 -0
  94. package/src/participant/participantThreadState.test.ts +75 -0
  95. package/src/participant/participantThreadState.ts +59 -0
  96. package/src/participant/shouldMarkRead.test.ts +24 -0
  97. package/src/participant/shouldMarkRead.ts +16 -0
  98. package/src/participant/useDocumentVisibility.ts +18 -0
  99. package/src/participant/useParticipantConversationView.ts +60 -0
  100. package/src/participant/useParticipantDraft.ts +45 -0
  101. package/src/participant/useParticipantInbox.ts +57 -0
  102. package/src/participant/useParticipantMarkRead.ts +26 -0
  103. package/src/participant/useParticipantRevalidation.ts +36 -0
  104. package/src/participant/useParticipantSend.ts +84 -0
  105. package/src/participant/useParticipantThread.ts +116 -0
  106. package/src/participant/useParticipantThreadScroll.ts +26 -0
  107. package/src/participant/useStickToBottom.ts +77 -0
  108. package/src/preview/ConversationSimulatorPanel.tsx +8 -0
  109. package/src/styles.css +178 -0
  110. package/src/types.ts +3 -1
package/dist/styles.css CHANGED
@@ -1251,3 +1251,692 @@
1251
1251
  border-top-color: rgb(51 65 85);
1252
1252
  background: rgb(17 24 39);
1253
1253
  }
1254
+ .cv-status-ticks {
1255
+ display: flex;
1256
+ align-items: center;
1257
+ line-height: 1;
1258
+ cursor: help;
1259
+ }
1260
+ .cv-status-ticks--queued,
1261
+ .cv-status-ticks--sent,
1262
+ .cv-status-ticks--delivered {
1263
+ color: rgb(0 0 0 / 40%);
1264
+ }
1265
+ .dark .cv-status-ticks--queued,
1266
+ .dark .cv-status-ticks--sent,
1267
+ .dark .cv-status-ticks--delivered {
1268
+ color: rgb(255 255 255 / 40%);
1269
+ }
1270
+ .cv-status-ticks--read {
1271
+ color: rgb(14 165 233);
1272
+ }
1273
+ .cv-status-ticks--failed {
1274
+ color: rgb(239 68 68);
1275
+ }
1276
+ .cv-message-text {
1277
+ position: relative;
1278
+ font-size: 14.2px;
1279
+ line-height: 19px;
1280
+ white-space: pre-wrap;
1281
+ overflow-wrap: break-word;
1282
+ word-break: break-word;
1283
+ }
1284
+ .cv-message-text--copyable {
1285
+ user-select: all;
1286
+ cursor: pointer;
1287
+ }
1288
+ .cv-message-text strong {
1289
+ font-weight: 700;
1290
+ }
1291
+ .cv-message-text em {
1292
+ font-style: italic;
1293
+ }
1294
+ .cv-message-text del {
1295
+ text-decoration-line: line-through;
1296
+ }
1297
+ .cv-message-text__copied {
1298
+ position: absolute;
1299
+ top: 0;
1300
+ right: 0;
1301
+ transform: translateY(-100%);
1302
+ background: #3b4a54;
1303
+ color: #fff;
1304
+ font-size: 11px;
1305
+ padding: 0.125rem 0.375rem;
1306
+ border-radius: 0.25rem;
1307
+ box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
1308
+ }
1309
+ .cv-p {
1310
+ --cv-p-i-surface: var(--cv-p-surface, #ffffff);
1311
+ --cv-p-i-surface-raised: var(--cv-p-surface-raised, #f3f4f6);
1312
+ --cv-p-i-text: var(--cv-p-text, #111827);
1313
+ --cv-p-i-text-muted: var(--cv-p-text-muted, #5b6573);
1314
+ --cv-p-i-border: var(--cv-p-border, #d5d9df);
1315
+ --cv-p-i-accent: var(--cv-p-accent, #a85a1c);
1316
+ --cv-p-i-accent-contrast: var(--cv-p-accent-contrast, #ffffff);
1317
+ --cv-p-i-highlight: var(--cv-p-highlight, #fbefe2);
1318
+ --cv-p-i-danger: var(--cv-p-danger, #c62828);
1319
+ --cv-p-i-radius: var(--cv-p-radius, 0);
1320
+ --cv-p-i-touch: 2.75rem;
1321
+ display: flex;
1322
+ flex-direction: column;
1323
+ min-height: 0;
1324
+ height: 100%;
1325
+ background: var(--cv-p-i-surface);
1326
+ color: var(--cv-p-i-text);
1327
+ font-family:
1328
+ "Avenir Next",
1329
+ Avenir,
1330
+ "Segoe UI",
1331
+ sans-serif;
1332
+ line-height: 1.4;
1333
+ box-sizing: border-box;
1334
+ }
1335
+ .dark .cv-p {
1336
+ --cv-p-i-surface: var(--cv-p-surface, #10222c);
1337
+ --cv-p-i-surface-raised: var(--cv-p-surface-raised, #1c2b33);
1338
+ --cv-p-i-text: var(--cv-p-text, #f0f2ee);
1339
+ --cv-p-i-text-muted: var(--cv-p-text-muted, #8fa3ad);
1340
+ --cv-p-i-border: var(--cv-p-border, rgb(143 163 173 / 26%));
1341
+ --cv-p-i-accent: var(--cv-p-accent, #d58a47);
1342
+ --cv-p-i-accent-contrast: var(--cv-p-accent-contrast, #10222c);
1343
+ --cv-p-i-highlight: var(--cv-p-highlight, rgb(213 138 71 / 10%));
1344
+ --cv-p-i-danger: var(--cv-p-danger, #ff6b63);
1345
+ }
1346
+ .cv-p *,
1347
+ .cv-p *::before,
1348
+ .cv-p *::after {
1349
+ box-sizing: border-box;
1350
+ }
1351
+ .cv-p :focus-visible {
1352
+ outline: 2px solid var(--cv-p-i-accent);
1353
+ outline-offset: 2px;
1354
+ }
1355
+ .cv-p-sr-only {
1356
+ position: absolute;
1357
+ width: 1px;
1358
+ height: 1px;
1359
+ margin: -1px;
1360
+ padding: 0;
1361
+ overflow: hidden;
1362
+ clip: rect(0 0 0 0);
1363
+ white-space: nowrap;
1364
+ border: 0;
1365
+ }
1366
+ .cv-p-button,
1367
+ .cv-p-chip,
1368
+ .cv-p-row,
1369
+ .cv-p-thread__older,
1370
+ .cv-p-bubble__retry,
1371
+ .cv-p-bubble__action {
1372
+ font: inherit;
1373
+ color: inherit;
1374
+ cursor: pointer;
1375
+ }
1376
+ .cv-p-button {
1377
+ min-height: var(--cv-p-i-touch);
1378
+ min-width: var(--cv-p-i-touch);
1379
+ padding: 0 0.75rem;
1380
+ background: transparent;
1381
+ border: 1px solid var(--cv-p-i-border);
1382
+ border-radius: var(--cv-p-i-radius);
1383
+ display: inline-flex;
1384
+ align-items: center;
1385
+ justify-content: center;
1386
+ }
1387
+ .cv-p-button:disabled {
1388
+ opacity: 0.45;
1389
+ cursor: not-allowed;
1390
+ }
1391
+ .cv-p-button--primary {
1392
+ background: var(--cv-p-i-accent);
1393
+ border-color: var(--cv-p-i-accent);
1394
+ color: var(--cv-p-i-accent-contrast);
1395
+ font-weight: 600;
1396
+ }
1397
+ .cv-p-chip {
1398
+ flex: none;
1399
+ min-height: 2.75rem;
1400
+ padding: 0 0.875rem;
1401
+ display: inline-flex;
1402
+ align-items: center;
1403
+ gap: 0.4rem;
1404
+ background: transparent;
1405
+ border: 1px solid var(--cv-p-i-border);
1406
+ border-radius: var(--cv-p-i-radius);
1407
+ color: var(--cv-p-i-text-muted);
1408
+ font-size: 0.85rem;
1409
+ }
1410
+ .cv-p-chip[aria-pressed=true] {
1411
+ background: var(--cv-p-i-text);
1412
+ border-color: var(--cv-p-i-text);
1413
+ color: var(--cv-p-i-surface);
1414
+ }
1415
+ .cv-p-chip__count {
1416
+ font:
1417
+ 0.7rem "SFMono-Regular",
1418
+ Consolas,
1419
+ monospace;
1420
+ background: var(--cv-p-i-accent);
1421
+ color: var(--cv-p-i-accent-contrast);
1422
+ padding: 0 0.35rem;
1423
+ }
1424
+ .cv-p-inbox {
1425
+ overflow-y: auto;
1426
+ }
1427
+ .cv-p-inbox__title {
1428
+ margin: 0;
1429
+ padding: 0.75rem 1rem;
1430
+ font-size: 1rem;
1431
+ border-bottom: 1px solid var(--cv-p-i-border);
1432
+ }
1433
+ .cv-p-filters {
1434
+ display: flex;
1435
+ gap: 0.5rem;
1436
+ padding: 0.625rem 1rem;
1437
+ overflow-x: auto;
1438
+ border-bottom: 1px solid var(--cv-p-i-border);
1439
+ }
1440
+ .cv-p-error {
1441
+ display: flex;
1442
+ flex-direction: column;
1443
+ align-items: center;
1444
+ gap: 0.5rem;
1445
+ padding: 1.5rem 1rem;
1446
+ text-align: center;
1447
+ color: var(--cv-p-i-danger, #b91c1c);
1448
+ }
1449
+ .cv-p-error__message {
1450
+ margin: 0;
1451
+ }
1452
+ .cv-p-loading {
1453
+ display: flex;
1454
+ flex-direction: column;
1455
+ gap: 0.5rem;
1456
+ padding: 1rem;
1457
+ }
1458
+ .cv-p-skeleton {
1459
+ display: block;
1460
+ height: 3rem;
1461
+ border-radius: var(--cv-p-i-radius);
1462
+ background: var(--cv-p-i-surface-raised);
1463
+ }
1464
+ .cv-p-inbox__more {
1465
+ display: block;
1466
+ margin: 0.75rem auto;
1467
+ padding: 0 1rem;
1468
+ }
1469
+ .cv-p-empty {
1470
+ padding: 2rem 1rem;
1471
+ text-align: center;
1472
+ color: var(--cv-p-i-text-muted);
1473
+ }
1474
+ .cv-p-section__heading {
1475
+ display: flex;
1476
+ justify-content: space-between;
1477
+ margin: 0;
1478
+ padding: 0.875rem 1rem 0.375rem;
1479
+ font:
1480
+ 0.68rem "SFMono-Regular",
1481
+ Consolas,
1482
+ monospace;
1483
+ letter-spacing: 0.1em;
1484
+ text-transform: uppercase;
1485
+ color: var(--cv-p-i-text-muted);
1486
+ list-style: none;
1487
+ }
1488
+ .cv-p-section--awaiting .cv-p-section__heading {
1489
+ color: var(--cv-p-i-accent);
1490
+ }
1491
+ .cv-p-section--closed > summary {
1492
+ cursor: pointer;
1493
+ min-height: var(--cv-p-i-touch);
1494
+ align-items: center;
1495
+ }
1496
+ .cv-p-section--closed > summary::-webkit-details-marker {
1497
+ display: none;
1498
+ }
1499
+ .cv-p-row {
1500
+ width: 100%;
1501
+ min-height: var(--cv-p-i-touch);
1502
+ display: grid;
1503
+ grid-template-columns: 2.25rem 1fr auto;
1504
+ gap: 0.625rem;
1505
+ padding: 0.75rem 1rem;
1506
+ text-align: left;
1507
+ background: transparent;
1508
+ border: 0;
1509
+ border-bottom: 1px solid var(--cv-p-i-border);
1510
+ border-left: 3px solid transparent;
1511
+ }
1512
+ .cv-p-row--awaiting {
1513
+ border-left-color: var(--cv-p-i-accent);
1514
+ background: var(--cv-p-i-highlight);
1515
+ }
1516
+ .cv-p-row__icon {
1517
+ width: 2.25rem;
1518
+ height: 2.25rem;
1519
+ display: grid;
1520
+ place-items: center;
1521
+ border: 1px solid var(--cv-p-i-border);
1522
+ border-radius: var(--cv-p-i-radius);
1523
+ font:
1524
+ 0.7rem "SFMono-Regular",
1525
+ Consolas,
1526
+ monospace;
1527
+ text-transform: uppercase;
1528
+ color: var(--cv-p-i-accent);
1529
+ }
1530
+ .cv-p-inbox__icon {
1531
+ color: var(--cv-p-i-accent);
1532
+ font-size: 1rem;
1533
+ }
1534
+ .cv-p-inbox__icon svg {
1535
+ width: 1.25rem;
1536
+ height: 1.25rem;
1537
+ }
1538
+ .cv-p-row__tags {
1539
+ display: flex;
1540
+ flex-wrap: wrap;
1541
+ align-items: center;
1542
+ gap: 0.25rem 0.5rem;
1543
+ }
1544
+ .cv-p-channels {
1545
+ display: inline-flex;
1546
+ flex-wrap: wrap;
1547
+ gap: 0.25rem;
1548
+ margin: 0;
1549
+ padding: 0;
1550
+ list-style: none;
1551
+ }
1552
+ .cv-p-channel {
1553
+ display: inline-grid;
1554
+ place-items: center;
1555
+ width: 1.375rem;
1556
+ height: 1.375rem;
1557
+ border: 1px solid var(--cv-p-i-border);
1558
+ border-radius: var(--cv-p-i-radius);
1559
+ color: var(--cv-p-i-text-muted);
1560
+ }
1561
+ .cv-p-channel svg {
1562
+ display: block;
1563
+ }
1564
+ .cv-p-channel--whatsapp {
1565
+ color: var(--cv-p-channel-whatsapp, #20914f);
1566
+ }
1567
+ .cv-p-channel--app {
1568
+ color: var(--cv-p-channel-app, var(--cv-p-i-accent));
1569
+ }
1570
+ .cv-p-row__body {
1571
+ display: flex;
1572
+ flex-direction: column;
1573
+ min-width: 0;
1574
+ }
1575
+ .cv-p-row__kind {
1576
+ font:
1577
+ 0.64rem "SFMono-Regular",
1578
+ Consolas,
1579
+ monospace;
1580
+ letter-spacing: 0.08em;
1581
+ text-transform: uppercase;
1582
+ color: var(--cv-p-i-text-muted);
1583
+ }
1584
+ .cv-p-row__title {
1585
+ font-weight: 600;
1586
+ font-size: 0.92rem;
1587
+ }
1588
+ .cv-p-row__preview {
1589
+ color: var(--cv-p-i-text-muted);
1590
+ font-size: 0.82rem;
1591
+ white-space: nowrap;
1592
+ overflow: hidden;
1593
+ text-overflow: ellipsis;
1594
+ }
1595
+ .cv-p-row__meta {
1596
+ display: flex;
1597
+ flex-direction: column;
1598
+ align-items: flex-end;
1599
+ gap: 0.25rem;
1600
+ font:
1601
+ 0.7rem "SFMono-Regular",
1602
+ Consolas,
1603
+ monospace;
1604
+ color: var(--cv-p-i-text-muted);
1605
+ }
1606
+ .cv-p-row__unread {
1607
+ min-width: 1.25rem;
1608
+ padding: 0 0.3rem;
1609
+ text-align: center;
1610
+ font-weight: 700;
1611
+ background: var(--cv-p-i-accent);
1612
+ color: var(--cv-p-i-accent-contrast);
1613
+ }
1614
+ .cv-p-thread__header {
1615
+ display: flex;
1616
+ align-items: center;
1617
+ gap: 0.5rem;
1618
+ padding: 0.5rem 1rem;
1619
+ border-bottom: 1px solid var(--cv-p-i-border);
1620
+ }
1621
+ .cv-p-thread__heading {
1622
+ flex: 1;
1623
+ min-width: 0;
1624
+ display: flex;
1625
+ flex-direction: column;
1626
+ }
1627
+ .cv-p-thread__title {
1628
+ flex: 1;
1629
+ margin: 0;
1630
+ font-size: 1rem;
1631
+ min-width: 0;
1632
+ }
1633
+ .cv-p-thread__title-button {
1634
+ min-height: var(--cv-p-i-touch);
1635
+ padding: 0;
1636
+ background: none;
1637
+ border: 0;
1638
+ color: inherit;
1639
+ font: inherit;
1640
+ font-weight: 600;
1641
+ text-align: left;
1642
+ text-decoration: underline;
1643
+ cursor: pointer;
1644
+ }
1645
+ .cv-p-thread__subject-card {
1646
+ margin: 0.75rem 1rem 0;
1647
+ padding: 0.625rem 0.75rem;
1648
+ border: 1px solid var(--cv-p-i-border);
1649
+ background: var(--cv-p-i-surface-raised);
1650
+ border-radius: var(--cv-p-i-radius);
1651
+ font-size: 0.82rem;
1652
+ }
1653
+ .cv-p-thread__scroll {
1654
+ flex: 1;
1655
+ min-height: 0;
1656
+ overflow-y: auto;
1657
+ overflow-anchor: none;
1658
+ padding: 0.5rem 1rem 1rem;
1659
+ }
1660
+ .cv-p-thread__older {
1661
+ display: block;
1662
+ margin: 0 auto 0.5rem;
1663
+ min-height: var(--cv-p-i-touch);
1664
+ padding: 0 1rem;
1665
+ background: transparent;
1666
+ border: 1px solid var(--cv-p-i-border);
1667
+ border-radius: var(--cv-p-i-radius);
1668
+ }
1669
+ .cv-p-thread__messages {
1670
+ display: flex;
1671
+ flex-direction: column;
1672
+ gap: 0.5rem;
1673
+ }
1674
+ .cv-p-thread__live {
1675
+ padding: 0 1rem;
1676
+ font-size: 0.75rem;
1677
+ color: var(--cv-p-i-accent);
1678
+ }
1679
+ .cv-p-thread__live:empty {
1680
+ position: absolute;
1681
+ width: 1px;
1682
+ height: 1px;
1683
+ margin: -1px;
1684
+ padding: 0;
1685
+ overflow: hidden;
1686
+ clip: rect(0 0 0 0);
1687
+ white-space: nowrap;
1688
+ border: 0;
1689
+ }
1690
+ .cv-p-thread__closed {
1691
+ margin: 0;
1692
+ padding: 1rem;
1693
+ text-align: center;
1694
+ color: var(--cv-p-i-text-muted);
1695
+ border-top: 1px solid var(--cv-p-i-border);
1696
+ }
1697
+ .cv-p-day {
1698
+ align-self: center;
1699
+ margin: 0.5rem 0;
1700
+ font:
1701
+ 0.65rem "SFMono-Regular",
1702
+ Consolas,
1703
+ monospace;
1704
+ text-transform: uppercase;
1705
+ color: var(--cv-p-i-text-muted);
1706
+ }
1707
+ .cv-p-bubble {
1708
+ max-width: 82%;
1709
+ align-self: flex-start;
1710
+ padding: 0.5rem 0.7rem;
1711
+ font-size: 0.88rem;
1712
+ background: var(--cv-p-i-surface-raised);
1713
+ border: 1px solid var(--cv-p-i-border);
1714
+ border-radius: var(--cv-p-i-radius);
1715
+ }
1716
+ .cv-p-bubble--mine {
1717
+ align-self: flex-end;
1718
+ background: var(--cv-p-i-highlight);
1719
+ border-color: var(--cv-p-i-accent);
1720
+ }
1721
+ .cv-p-bubble__author {
1722
+ display: block;
1723
+ margin-bottom: 0.15rem;
1724
+ font:
1725
+ 0.65rem "SFMono-Regular",
1726
+ Consolas,
1727
+ monospace;
1728
+ text-transform: uppercase;
1729
+ color: var(--cv-p-i-accent);
1730
+ }
1731
+ .cv-p-bubble__meta {
1732
+ display: flex;
1733
+ justify-content: flex-end;
1734
+ align-items: center;
1735
+ gap: 0.35rem;
1736
+ margin-top: 0.25rem;
1737
+ font:
1738
+ 0.65rem "SFMono-Regular",
1739
+ Consolas,
1740
+ monospace;
1741
+ color: var(--cv-p-i-text-muted);
1742
+ }
1743
+ .cv-p-bubble__status {
1744
+ display: inline-flex;
1745
+ align-items: center;
1746
+ gap: 0.25rem;
1747
+ }
1748
+ .cv-p-bubble__retry {
1749
+ min-height: var(--cv-p-i-touch);
1750
+ display: inline-flex;
1751
+ align-items: center;
1752
+ gap: 0.25rem;
1753
+ padding: 0 0.5rem;
1754
+ background: transparent;
1755
+ border: 1px solid var(--cv-p-i-danger);
1756
+ color: var(--cv-p-i-danger);
1757
+ border-radius: var(--cv-p-i-radius);
1758
+ font-size: 0.7rem;
1759
+ }
1760
+ .cv-p-bubble__actions {
1761
+ display: inline-flex;
1762
+ gap: 0.5rem;
1763
+ margin-top: 0.25rem;
1764
+ }
1765
+ .cv-p-bubble__action {
1766
+ min-height: var(--cv-p-i-touch);
1767
+ display: inline-flex;
1768
+ align-items: center;
1769
+ padding: 0 0.75rem;
1770
+ background: transparent;
1771
+ border: 1px solid var(--cv-p-i-border);
1772
+ color: inherit;
1773
+ border-radius: var(--cv-p-i-radius);
1774
+ font-size: 0.7rem;
1775
+ }
1776
+ .cv-p-attachment {
1777
+ display: flex;
1778
+ flex-direction: column;
1779
+ gap: 0.25rem;
1780
+ margin-top: 0.35rem;
1781
+ color: inherit;
1782
+ }
1783
+ .cv-p-attachment--document {
1784
+ flex-direction: row;
1785
+ justify-content: space-between;
1786
+ min-height: var(--cv-p-i-touch);
1787
+ align-items: center;
1788
+ text-decoration: underline;
1789
+ }
1790
+ .cv-p-attachment__image {
1791
+ display: block;
1792
+ max-width: 100%;
1793
+ max-height: 16rem;
1794
+ object-fit: contain;
1795
+ }
1796
+ .cv-p-attachment__audio {
1797
+ width: 100%;
1798
+ min-height: var(--cv-p-i-touch);
1799
+ }
1800
+ .cv-p-attachment__name,
1801
+ .cv-p-attachment__size {
1802
+ font-size: 0.75rem;
1803
+ overflow-wrap: anywhere;
1804
+ }
1805
+ .cv-p-composer {
1806
+ display: flex;
1807
+ flex-direction: column;
1808
+ gap: 0.5rem;
1809
+ padding: 0.5rem 1rem 1rem;
1810
+ border-top: 1px solid var(--cv-p-i-border);
1811
+ }
1812
+ .cv-p-composer__row {
1813
+ display: flex;
1814
+ align-items: flex-end;
1815
+ gap: 0.5rem;
1816
+ }
1817
+ .cv-p-composer__input {
1818
+ flex: 1;
1819
+ min-height: var(--cv-p-i-touch);
1820
+ max-height: 8rem;
1821
+ resize: none;
1822
+ padding: 0.7rem;
1823
+ font: inherit;
1824
+ font-size: 0.9rem;
1825
+ color: inherit;
1826
+ background: var(--cv-p-i-surface);
1827
+ border: 1px solid var(--cv-p-i-border);
1828
+ border-radius: var(--cv-p-i-radius);
1829
+ }
1830
+ .cv-p-composer__error {
1831
+ margin: 0;
1832
+ font-size: 0.8rem;
1833
+ color: var(--cv-p-i-danger);
1834
+ }
1835
+ .cv-p-quick {
1836
+ display: flex;
1837
+ gap: 0.5rem;
1838
+ overflow-x: auto;
1839
+ }
1840
+ .cv-p-files {
1841
+ display: flex;
1842
+ flex-direction: column;
1843
+ gap: 0.25rem;
1844
+ margin: 0;
1845
+ padding: 0;
1846
+ list-style: none;
1847
+ }
1848
+ .cv-p-files__item {
1849
+ display: flex;
1850
+ align-items: center;
1851
+ gap: 0.5rem;
1852
+ font-size: 0.8rem;
1853
+ }
1854
+ .cv-p-files__name {
1855
+ flex: 1;
1856
+ overflow: hidden;
1857
+ text-overflow: ellipsis;
1858
+ white-space: nowrap;
1859
+ }
1860
+ .cv-p-files__size {
1861
+ color: var(--cv-p-i-text-muted);
1862
+ }
1863
+ .cv-p-files__remove {
1864
+ min-width: var(--cv-p-i-touch);
1865
+ min-height: var(--cv-p-i-touch);
1866
+ background: transparent;
1867
+ border: 0;
1868
+ color: inherit;
1869
+ font: inherit;
1870
+ cursor: pointer;
1871
+ }
1872
+ .cv-p-protocol {
1873
+ min-width: 0;
1874
+ overflow-wrap: anywhere;
1875
+ font:
1876
+ 0.7rem "SFMono-Regular",
1877
+ Consolas,
1878
+ monospace;
1879
+ letter-spacing: 0.04em;
1880
+ color: var(--cv-p-i-text-muted);
1881
+ }
1882
+ .cv-p-protocol--header {
1883
+ display: flex;
1884
+ align-items: center;
1885
+ gap: 0.5rem;
1886
+ }
1887
+ .cv-p-protocol__copy {
1888
+ min-height: var(--cv-p-i-touch);
1889
+ min-width: var(--cv-p-i-touch);
1890
+ padding: 0 0.75rem;
1891
+ background: transparent;
1892
+ border: 1px solid var(--cv-p-i-border);
1893
+ border-radius: var(--cv-p-i-radius);
1894
+ color: var(--cv-p-i-text);
1895
+ font: inherit;
1896
+ font-size: 0.75rem;
1897
+ cursor: pointer;
1898
+ }
1899
+ .cv-p-search {
1900
+ padding: 0.625rem 1rem;
1901
+ border-bottom: 1px solid var(--cv-p-i-border);
1902
+ }
1903
+ .cv-p-search__input {
1904
+ width: 100%;
1905
+ box-sizing: border-box;
1906
+ min-height: var(--cv-p-i-touch);
1907
+ padding: 0 0.75rem;
1908
+ font: inherit;
1909
+ font-size: 0.9rem;
1910
+ color: var(--cv-p-i-text);
1911
+ background: var(--cv-p-i-surface);
1912
+ border: 1px solid var(--cv-p-i-border);
1913
+ border-radius: var(--cv-p-i-radius);
1914
+ }
1915
+ .cv-p-search__input:focus-visible,
1916
+ .cv-p-protocol__copy:focus-visible {
1917
+ outline: 2px solid var(--cv-p-i-accent);
1918
+ outline-offset: 2px;
1919
+ }
1920
+ @media (prefers-reduced-motion: no-preference) {
1921
+ .cv-p-protocol__copy,
1922
+ .cv-p-search__input {
1923
+ transition: border-color 0.12s, background-color 0.12s;
1924
+ }
1925
+ .cv-p-row,
1926
+ .cv-p-button,
1927
+ .cv-p-chip {
1928
+ transition: background-color 0.12s, border-color 0.12s;
1929
+ }
1930
+ }
1931
+ .cv-p-root {
1932
+ display: flex;
1933
+ flex-direction: column;
1934
+ min-height: 0;
1935
+ height: 100%;
1936
+ }
1937
+ .cv-p-root__screen {
1938
+ display: flex;
1939
+ flex-direction: column;
1940
+ flex: 1;
1941
+ min-height: 0;
1942
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adatechnology/conversations-ui",
3
- "version": "0.4.2",
3
+ "version": "0.6.0",
4
4
  "description": "WhatsApp conversation UI components — parametrizável por endpoint, tema e feature flags",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -23,6 +23,10 @@
23
23
  "import": "./dist/preview/index.js",
24
24
  "types": "./dist/preview/index.d.ts"
25
25
  },
26
+ "./participant": {
27
+ "import": "./dist/participant/index.js",
28
+ "types": "./dist/participant/index.d.ts"
29
+ },
26
30
  "./styles.css": "./dist/styles.css"
27
31
  },
28
32
  "main": "dist/index.js",
@@ -31,7 +35,7 @@
31
35
  "clsx": "^2.1.1",
32
36
  "lucide-react": "^1.21.0",
33
37
  "tailwind-merge": "^3.6.0",
34
- "@adatechnology/conversation-contracts": "0.3.0",
38
+ "@adatechnology/conversation-contracts": "0.5.0",
35
39
  "@adatechnology/meta-whatsapp-contracts": "0.6.0"
36
40
  },
37
41
  "peerDependencies": {
@@ -53,8 +57,8 @@
53
57
  "typescript": "^5.9.3"
54
58
  },
55
59
  "scripts": {
56
- "build": "tsup src/index.ts src/flows/index.ts src/channel/index.ts src/preview/index.ts src/styles.css --dts --clean --format esm --external react --external react-dom --external @xyflow/react",
57
- "build:watch": "tsup src/index.ts src/flows/index.ts src/channel/index.ts src/styles.css --watch --dts --format esm --external react --external react-dom --external @xyflow/react",
60
+ "build": "tsup src/index.ts src/flows/index.ts src/channel/index.ts src/preview/index.ts src/participant/index.ts src/styles.css --dts --clean --format esm --external react --external react-dom --external @xyflow/react",
61
+ "build:watch": "tsup src/index.ts src/flows/index.ts src/channel/index.ts src/preview/index.ts src/participant/index.ts src/styles.css --watch --dts --format esm --external react --external react-dom --external @xyflow/react",
58
62
  "check": "tsc -p tsconfig.json --noEmit",
59
63
  "test": "bun test"
60
64
  }