wealth-alpha-chat-widget 2.0.5 → 2.0.7

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 CHANGED
@@ -711,6 +711,7 @@ var chat_default = {
711
711
  bubbleMeta: "chat_bubbleMeta",
712
712
  chipRow: "chat_chipRow",
713
713
  chip: "chat_chip",
714
+ chipIcon: "chat_chipIcon",
714
715
  chipActive: "chat_chipActive",
715
716
  chipDisabled: "chat_chipDisabled",
716
717
  typing: "chat_typing",
@@ -774,12 +775,23 @@ function AuthGate({ brandName, loginUrl, onLoginClick }) {
774
775
  ] })
775
776
  ] });
776
777
  }
778
+ var HOME_ICON = '<path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/>';
779
+ var BACK_ICON = '<line x1="19" y1="12" x2="5" y2="12"/><polyline points="12 19 5 12 12 5"/>';
780
+ var EMOJI_RE = /[\u{1F000}-\u{1FAFF}\u{2190}-\u{21FF}\u{2300}-\u{27BF}\u{2B00}-\u{2BFF}\u{FE00}-\u{FE0F}\u{1F1E6}-\u{1F1FF}\u{20E3}]/gu;
781
+ var stripEmoji = (s) => s.replace(EMOJI_RE, "").replace(/\s{2,}/g, " ").trim();
782
+ function navIconFor(chip) {
783
+ if (chip.id === "__root__") return HOME_ICON;
784
+ if (chip.label.trim() === "Back") return BACK_ICON;
785
+ return null;
786
+ }
777
787
  function Chip({ chip, disabled, active, onClick }) {
778
788
  const classes = [
779
789
  chat_default.chip,
780
790
  active ? chat_default.chipActive : "",
781
791
  disabled ? chat_default.chipDisabled : ""
782
792
  ].filter(Boolean).join(" ");
793
+ const navIcon = navIconFor(chip);
794
+ const label = stripEmoji(chip.label);
783
795
  return /* @__PURE__ */ jsxRuntime.jsxs(
784
796
  "button",
785
797
  {
@@ -788,8 +800,19 @@ function Chip({ chip, disabled, active, onClick }) {
788
800
  disabled,
789
801
  onClick: () => !disabled && onClick(chip),
790
802
  children: [
791
- chip.icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: chip.icon }) : null,
792
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: chip.label })
803
+ navIcon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: chat_default.chipIcon, "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
804
+ "svg",
805
+ {
806
+ viewBox: "0 0 24 24",
807
+ fill: "none",
808
+ stroke: "currentColor",
809
+ strokeWidth: 2,
810
+ strokeLinecap: "round",
811
+ strokeLinejoin: "round",
812
+ dangerouslySetInnerHTML: { __html: navIcon }
813
+ }
814
+ ) }) : null,
815
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: label })
793
816
  ]
794
817
  }
795
818
  );