wealth-alpha-chat-widget 2.0.6 → 2.0.8

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
@@ -776,14 +776,17 @@ function AuthGate({ brandName, loginUrl, onLoginClick }) {
776
776
  ] });
777
777
  }
778
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"/>';
779
780
  var PREV_ICON = '<polyline points="15 18 9 12 15 6"/>';
780
781
  var NEXT_ICON = '<polyline points="9 18 15 12 9 6"/>';
781
782
  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;
782
783
  var stripEmoji = (s) => s.replace(EMOJI_RE, "").replace(/\s{2,}/g, " ").trim();
783
784
  function navIconFor(chip) {
784
- if (chip.id === "__root__") return HOME_ICON;
785
+ if (chip.id === "__root__") return { svg: HOME_ICON, trailing: false };
786
+ if (chip.label.trim() === "Back") return { svg: BACK_ICON, trailing: false };
785
787
  if (chip.id.includes("_page:")) {
786
- return /prev/i.test(chip.label) ? PREV_ICON : NEXT_ICON;
788
+ const isPrev = /prev/i.test(chip.label);
789
+ return { svg: isPrev ? PREV_ICON : NEXT_ICON, trailing: !isPrev };
787
790
  }
788
791
  return null;
789
792
  }
@@ -795,6 +798,18 @@ function Chip({ chip, disabled, active, onClick }) {
795
798
  ].filter(Boolean).join(" ");
796
799
  const navIcon = navIconFor(chip);
797
800
  const label = stripEmoji(chip.label);
801
+ const iconEl = navIcon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: chat_default.chipIcon, "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
802
+ "svg",
803
+ {
804
+ viewBox: "0 0 24 24",
805
+ fill: "none",
806
+ stroke: "currentColor",
807
+ strokeWidth: 2,
808
+ strokeLinecap: "round",
809
+ strokeLinejoin: "round",
810
+ dangerouslySetInnerHTML: { __html: navIcon.svg }
811
+ }
812
+ ) }) : null;
798
813
  return /* @__PURE__ */ jsxRuntime.jsxs(
799
814
  "button",
800
815
  {
@@ -803,19 +818,9 @@ function Chip({ chip, disabled, active, onClick }) {
803
818
  disabled,
804
819
  onClick: () => !disabled && onClick(chip),
805
820
  children: [
806
- navIcon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: chat_default.chipIcon, "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
807
- "svg",
808
- {
809
- viewBox: "0 0 24 24",
810
- fill: "none",
811
- stroke: "currentColor",
812
- strokeWidth: 2,
813
- strokeLinecap: "round",
814
- strokeLinejoin: "round",
815
- dangerouslySetInnerHTML: { __html: navIcon }
816
- }
817
- ) }) : null,
818
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: label })
821
+ navIcon && !navIcon.trailing ? iconEl : null,
822
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: label }),
823
+ navIcon && navIcon.trailing ? iconEl : null
819
824
  ]
820
825
  }
821
826
  );