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