@helpway/react 0.7.0 → 0.8.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.7.0",
3
+ "version": "0.8.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",
@@ -122,6 +122,11 @@
122
122
  BUBBLE (FAB)
123
123
  ════════════════════════════════════════════════ */
124
124
 
125
+ @keyframes hw-bubble-enter {
126
+ from { opacity: 0; transform: scale(0.6); }
127
+ to { opacity: 1; transform: scale(1); }
128
+ }
129
+
125
130
  .hw-bubble {
126
131
  width: 48px;
127
132
  height: 48px;
@@ -137,6 +142,7 @@
137
142
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
138
143
  position: relative;
139
144
  overflow: visible;
145
+ animation: hw-bubble-enter 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
140
146
  }
141
147
 
142
148
  /* bubbleStyle variants — override border-radius */
@@ -395,6 +401,7 @@
395
401
  .hw-window--closing,
396
402
  .hw-content,
397
403
  .hw-msg,
404
+ .hw-bubble,
398
405
  .hw-bubble-icon,
399
406
  .hw-bubble-badge,
400
407
  .hw-bubble-badge::after,
@@ -577,11 +584,14 @@
577
584
  justify-content: center;
578
585
  border-radius: 8px;
579
586
  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);
587
+ /* Two-tier fallback so site overrides still win cleanly:
588
+ 1. Site stylesheet → `--hw-agent-bg` (highest priority)
589
+ 2. Widget smart default → `--hw-agent-bg-default` (set when the
590
+ org uploaded a logo as the avatar; see [data-has-avatar])
591
+ 3. Built-in `transparent` (face-photo legacy default)
592
+ Setting --hw-agent-bg in user CSS short-circuits the entire
593
+ chain — exactly the cascade behavior we want. */
594
+ background: var(--hw-agent-bg, var(--hw-agent-bg-default, transparent));
585
595
  }
586
596
  .hw-header-bot-icon svg {
587
597
  width: 24px;
@@ -594,15 +604,23 @@
594
604
  .hw-header-agent-img {
595
605
  width: 100%;
596
606
  height: 100%;
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);
607
+ object-fit: cover;
608
+ }
609
+ .hw-header-bot-icon .hw-agent-img {
610
+ object-fit: var(--hw-agent-fit, var(--hw-agent-fit-default, cover));
611
+ padding: var(--hw-agent-pad, var(--hw-agent-pad-default, 0));
604
612
  box-sizing: border-box;
605
613
  }
614
+
615
+ /* Smart default: the org uploaded a logo (vs a face photo). Widget
616
+ sets data-has-avatar="true" on the root when agentConfig.avatarUrl
617
+ is non-empty. Logos look right with brand-tinted circle + contain +
618
+ inner padding; face photos with the legacy transparent + cover. */
619
+ .hw-widget[data-has-avatar="true"] {
620
+ --hw-agent-bg-default: var(--hw-primary);
621
+ --hw-agent-fit-default: contain;
622
+ --hw-agent-pad-default: 6px;
623
+ }
606
624
  .hw-header-agent-initials {
607
625
  font-size: 11px;
608
626
  font-weight: 600;
@@ -948,7 +966,11 @@
948
966
  width: 36px;
949
967
  height: 36px;
950
968
  border-radius: 10px;
951
- background: var(--hw-bg-subtle);
969
+ /* Same fallback chain as the chat-header avatar so the smart default
970
+ for uploaded logos (data-has-avatar="true" → --hw-agent-bg-default)
971
+ reaches conversation rows too. Falls through to --hw-bg-subtle for
972
+ face-photo agents (legacy gray container). */
973
+ background: var(--hw-agent-bg, var(--hw-agent-bg-default, var(--hw-bg-subtle)));
952
974
  color: var(--hw-text-3);
953
975
  display: flex;
954
976
  align-items: center;
@@ -963,8 +985,19 @@
963
985
  .hw-conv-card-avatar-img {
964
986
  width: 100%;
965
987
  height: 100%;
988
+ /* Team-member uploaded image — face photos by design, so cover-by-
989
+ default is correct. We deliberately don't apply --hw-agent-fit
990
+ here because that variable is for the BOT avatar (logo case). */
966
991
  object-fit: cover;
967
992
  }
993
+ /* Bot-side image rendered via WidgetLogo inside the conv-card-avatar.
994
+ Reaches the same fallback chain used in the chat header so uploaded
995
+ logos get contain + padding here as well. */
996
+ .hw-conv-card-avatar .hw-agent-img {
997
+ object-fit: var(--hw-agent-fit, var(--hw-agent-fit-default, cover));
998
+ padding: var(--hw-agent-pad, var(--hw-agent-pad-default, 0));
999
+ box-sizing: border-box;
1000
+ }
968
1001
  .hw-conv-card-avatar--team {
969
1002
  background: var(--hw-brand, #0a0a0a);
970
1003
  color: var(--hw-on-brand, #fff);
@@ -2319,7 +2352,10 @@
2319
2352
  width: 32px;
2320
2353
  height: 32px;
2321
2354
  border-radius: 50%;
2322
- background: var(--hw-bg-hover, #e0e0e0);
2355
+ /* Fallback chain mirroring chat-header / conv-list — uploaded-logo
2356
+ smart default reaches event rows (joined/left) when the bot
2357
+ avatar is the one being shown. Falls through to legacy gray. */
2358
+ background: var(--hw-agent-bg, var(--hw-agent-bg-default, var(--hw-bg-hover, #e0e0e0)));
2323
2359
  color: var(--hw-text-2, #555);
2324
2360
  display: flex;
2325
2361
  align-items: center;
@@ -2332,8 +2368,16 @@
2332
2368
  .hw-event-avatar-img {
2333
2369
  width: 100%;
2334
2370
  height: 100%;
2371
+ /* Same reasoning as conv-card-avatar-img: this is the human/team
2372
+ member's photo, cover is intentional. Bot-side avatars rendered
2373
+ via WidgetLogo (.hw-agent-img) get the variable-driven fit below. */
2335
2374
  object-fit: cover;
2336
2375
  }
2376
+ .hw-event-avatar .hw-agent-img {
2377
+ object-fit: var(--hw-agent-fit, var(--hw-agent-fit-default, cover));
2378
+ padding: var(--hw-agent-pad, var(--hw-agent-pad-default, 0));
2379
+ box-sizing: border-box;
2380
+ }
2337
2381
 
2338
2382
  .hw-event-body {
2339
2383
  font-size: 13px;