@helpway/react 0.5.1 → 0.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helpway/react",
3
- "version": "0.5.1",
3
+ "version": "0.7.0",
4
4
  "description": "Official React SDK for Helpway — drop-in AI chat support widget with headless hooks for custom UIs.",
5
5
  "keywords": [
6
6
  "helpway",
@@ -241,6 +241,26 @@
241
241
  border-radius: 0; /* bubble itself handles rounding */
242
242
  }
243
243
 
244
+ /* Logo variant (admin-uploaded launcherIconUrl OR website.logoUrl) —
245
+ logos carry their own padding rules and shouldn't be cropped. Use
246
+ `contain` + inner padding so SVG/PNG marks render at intended
247
+ proportion inside the rounded bubble. `object-fit: cover` is correct
248
+ only for face avatars. Padding is applied directly on the img so it
249
+ works regardless of whether the parent has --logo / --avatar class. */
250
+ .hw-agent-img.hw-agent-img--logo {
251
+ object-fit: contain;
252
+ padding: 10px;
253
+ box-sizing: border-box;
254
+ }
255
+ /* Higher-specificity override: .hw-bubble--avatar's inner img rule sets
256
+ width/height + border-radius:0 with 3-class specificity. Match that
257
+ so logo padding actually applies inside the bubble. */
258
+ .hw-bubble--avatar .hw-bubble-icon--bot .hw-agent-img.hw-agent-img--logo {
259
+ padding: 10px;
260
+ box-sizing: border-box;
261
+ object-fit: contain;
262
+ }
263
+
244
264
  .hw-bubble-icon--close svg {
245
265
  width: 22px;
246
266
  height: 22px;
@@ -557,6 +577,11 @@
557
577
  justify-content: center;
558
578
  border-radius: 8px;
559
579
  overflow: hidden;
580
+ /* Public override hook — light SVG/PNG logos disappear on white
581
+ chat-header cards. Site stylesheet sets `--hw-agent-bg` to a
582
+ contrast color (e.g. brand color) and the avatar gets a tinted
583
+ circle behind it. Default `transparent` preserves legacy look. */
584
+ background: var(--hw-agent-bg, transparent);
560
585
  }
561
586
  .hw-header-bot-icon svg {
562
587
  width: 24px;
@@ -569,7 +594,14 @@
569
594
  .hw-header-agent-img {
570
595
  width: 100%;
571
596
  height: 100%;
572
- object-fit: cover;
597
+ /* Override hooks: `--hw-agent-fit` swaps cover→contain so logos
598
+ aren't cropped, `--hw-agent-pad` adds breathing room around the
599
+ logo inside the circle. Defaults match legacy face-photo
600
+ behavior. Padding requires border-box so it stays inside the
601
+ circle rather than expanding the img. */
602
+ object-fit: var(--hw-agent-fit, cover);
603
+ padding: var(--hw-agent-pad, 0);
604
+ box-sizing: border-box;
573
605
  }
574
606
  .hw-header-agent-initials {
575
607
  font-size: 11px;
@@ -842,7 +874,7 @@
842
874
  color: var(--hw-text);
843
875
  }
844
876
  .hw-recent-row--unread .hw-conv-card-time {
845
- color: var(--hw-accent);
877
+ color: var(--hw-primary);
846
878
  font-weight: 500;
847
879
  }
848
880
 
@@ -983,7 +1015,7 @@
983
1015
  color: var(--hw-text);
984
1016
  }
985
1017
  .hw-conv-card--unread .hw-conv-card-time {
986
- color: var(--hw-accent);
1018
+ color: var(--hw-primary);
987
1019
  font-weight: 500;
988
1020
  }
989
1021
 
@@ -1322,6 +1354,55 @@
1322
1354
  width: 100%;
1323
1355
  }
1324
1356
 
1357
+ /* Quick reply buttons — interactive workflow choices */
1358
+ .hw-quick-replies {
1359
+ display: flex;
1360
+ flex-wrap: wrap;
1361
+ gap: 6px;
1362
+ margin-top: 8px;
1363
+ }
1364
+
1365
+ .hw-quick-reply-btn {
1366
+ font: inherit;
1367
+ font-size: 13px;
1368
+ font-weight: 500;
1369
+ padding: 6px 14px;
1370
+ border-radius: 18px;
1371
+ border: 1px solid rgba(0, 0, 0, 0.12);
1372
+ background: var(--hw-bg, #fff);
1373
+ color: var(--hw-text-1, #1a1a1a);
1374
+ cursor: pointer;
1375
+ transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 80ms ease;
1376
+ line-height: 1.3;
1377
+ }
1378
+
1379
+ .hw-quick-reply-btn:hover:not(:disabled) {
1380
+ border-color: var(--hw-primary);
1381
+ background: color-mix(in srgb, var(--hw-primary) 8%, transparent);
1382
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
1383
+ }
1384
+
1385
+ .hw-quick-reply-btn:active:not(:disabled) {
1386
+ transform: scale(0.97);
1387
+ }
1388
+
1389
+ .hw-quick-reply-btn:disabled {
1390
+ cursor: default;
1391
+ opacity: 0.4;
1392
+ }
1393
+
1394
+ .hw-quick-reply-btn[data-tapped="true"] {
1395
+ background: var(--hw-primary);
1396
+ color: white;
1397
+ border-color: var(--hw-primary);
1398
+ opacity: 1;
1399
+ }
1400
+
1401
+ .hw-quick-replies[data-cancelled="true"] .hw-quick-reply-btn {
1402
+ border-color: rgba(0, 0, 0, 0.08);
1403
+ color: var(--hw-text-muted, #9ca3af);
1404
+ }
1405
+
1325
1406
  .hw-msg--ai .hw-code {
1326
1407
  width: 100%;
1327
1408
  box-sizing: border-box;
@@ -2473,10 +2554,6 @@
2473
2554
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
2474
2555
  }
2475
2556
 
2476
- .hw-preview--closing {
2477
- animation: hw-preview-out 0.2s ease forwards;
2478
- }
2479
-
2480
2557
  @keyframes hw-preview-in {
2481
2558
  from {
2482
2559
  opacity: 0;
@@ -2558,14 +2635,52 @@
2558
2635
  }
2559
2636
 
2560
2637
  .hw-preview-body {
2561
- padding: 8px 14px 14px;
2638
+ padding: 4px 14px;
2562
2639
  font-size: 14px;
2563
2640
  line-height: 1.45;
2564
2641
  color: var(--hw-text-2);
2565
- display: -webkit-box;
2566
- -webkit-line-clamp: 3;
2567
- -webkit-box-orient: vertical;
2568
- overflow: hidden;
2642
+ }
2643
+
2644
+ .hw-preview-body:first-of-type {
2645
+ padding-top: 8px;
2646
+ }
2647
+
2648
+ .hw-preview-body:last-child {
2649
+ padding-bottom: 14px;
2650
+ }
2651
+
2652
+ .hw-preview-prompt {
2653
+ padding: 2px 14px 6px;
2654
+ font-size: 14px;
2655
+ font-weight: 500;
2656
+ color: var(--hw-text-1);
2657
+ }
2658
+
2659
+ .hw-preview-quick-replies {
2660
+ display: flex;
2661
+ flex-wrap: wrap;
2662
+ gap: 6px;
2663
+ padding: 0 14px 14px;
2664
+ }
2665
+
2666
+ .hw-preview-qr-btn {
2667
+ display: inline-flex;
2668
+ align-items: center;
2669
+ padding: 6px 14px;
2670
+ font-size: 13px;
2671
+ font-weight: 500;
2672
+ line-height: 1.3;
2673
+ color: var(--hw-brand, #000);
2674
+ background: transparent;
2675
+ border: 1px solid var(--hw-border, rgba(0, 0, 0, 0.1));
2676
+ border-radius: 18px;
2677
+ cursor: pointer;
2678
+ transition: background 0.15s, border-color 0.15s;
2679
+ }
2680
+
2681
+ .hw-preview-qr-btn:hover {
2682
+ background: var(--hw-hover, rgba(0, 0, 0, 0.04));
2683
+ border-color: var(--hw-brand, #000);
2569
2684
  }
2570
2685
 
2571
2686
  /* ═══════════════════════════════════════════════════════════