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