@eshal-bot/chat-widget 0.2.14 → 0.2.15

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.
@@ -89051,10 +89051,18 @@
89051
89051
  })]
89052
89052
  });
89053
89053
  }
89054
+
89055
+ // EV-4471: a button-group tap sends the label the customer read, not the
89056
+ // button's value. A slot button carried "2026-10-11T11:00" as its value, and
89057
+ // that string became the customer's own chat bubble. Every messaging channel
89058
+ // already round-trips the label (backend channels/ir/from-a2ui.ts). A
89059
+ // confirmation renders through here with sendValue: its choice values
89060
+ // ("confirm-EK001") are the answer the backend reads.
89054
89061
  function ButtonGroup({
89055
89062
  spec,
89056
89063
  isDark,
89057
- onButtonClick
89064
+ onButtonClick,
89065
+ sendValue = false
89058
89066
  }) {
89059
89067
  const buttons = Array.isArray(spec.buttons) ? spec.buttons : [];
89060
89068
  if (buttons.length === 0) return null;
@@ -89079,7 +89087,7 @@
89079
89087
  },
89080
89088
  children: buttons.map((b, i) => /*#__PURE__*/jsxRuntimeExports.jsx("button", {
89081
89089
  type: "button",
89082
- onClick: onButtonClick ? () => onButtonClick(String(b.value ?? b.label ?? ''), String(b.label ?? b.value ?? '')) : undefined,
89090
+ onClick: onButtonClick ? () => onButtonClick(String((sendValue ? b.value : b.label) || b.label || b.value || ''), String(b.label || b.value || '')) : undefined,
89083
89091
  disabled: !onButtonClick,
89084
89092
  style: {
89085
89093
  border: '1px solid ' + (isDark ? '#374151' : '#d1d5db'),
@@ -89091,7 +89099,7 @@
89091
89099
  cursor: onButtonClick ? 'pointer' : 'default',
89092
89100
  opacity: onButtonClick ? 1 : 0.6
89093
89101
  },
89094
- children: String(b.label ?? b.value ?? '')
89102
+ children: String(b.label || b.value || '')
89095
89103
  }, i))
89096
89104
  })]
89097
89105
  });
@@ -89539,7 +89547,8 @@
89539
89547
  buttons: lockedButtons
89540
89548
  },
89541
89549
  isDark: isDark,
89542
- onButtonClick: locked ? undefined : handleChoose
89550
+ onButtonClick: locked ? undefined : handleChoose,
89551
+ sendValue: true
89543
89552
  })]
89544
89553
  });
89545
89554
  }