wealth-alpha-chat-widget 2.0.5 → 2.0.6

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,26 @@ 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 PREV_ICON = '<polyline points="15 18 9 12 15 6"/>';
780
+ var NEXT_ICON = '<polyline points="9 18 15 12 9 6"/>';
781
+ 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
+ var stripEmoji = (s) => s.replace(EMOJI_RE, "").replace(/\s{2,}/g, " ").trim();
783
+ function navIconFor(chip) {
784
+ if (chip.id === "__root__") return HOME_ICON;
785
+ if (chip.id.includes("_page:")) {
786
+ return /prev/i.test(chip.label) ? PREV_ICON : NEXT_ICON;
787
+ }
788
+ return null;
789
+ }
777
790
  function Chip({ chip, disabled, active, onClick }) {
778
791
  const classes = [
779
792
  chat_default.chip,
780
793
  active ? chat_default.chipActive : "",
781
794
  disabled ? chat_default.chipDisabled : ""
782
795
  ].filter(Boolean).join(" ");
796
+ const navIcon = navIconFor(chip);
797
+ const label = stripEmoji(chip.label);
783
798
  return /* @__PURE__ */ jsxRuntime.jsxs(
784
799
  "button",
785
800
  {
@@ -788,8 +803,19 @@ function Chip({ chip, disabled, active, onClick }) {
788
803
  disabled,
789
804
  onClick: () => !disabled && onClick(chip),
790
805
  children: [
791
- chip.icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: chip.icon }) : null,
792
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: chip.label })
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 })
793
819
  ]
794
820
  }
795
821
  );