@deriv-web-design/ui 0.1.5 → 0.1.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/block-registry.json +810 -14
- package/components.manifest.json +477 -7
- package/dist/index.css +1150 -86
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +297 -13
- package/dist/index.d.ts +297 -13
- package/dist/index.js +912 -73
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +910 -79
- package/dist/index.mjs.map +1 -1
- package/dist/share-facebook-3B3NOC5Q.png +0 -0
- package/dist/share-link-QGD6KIDA.png +0 -0
- package/dist/share-linkedin-UCIII3JU.png +0 -0
- package/dist/share-telegram-QRXGSHQT.png +0 -0
- package/dist/share-x-UTEBBL73.png +0 -0
- package/dist/trustpilot-rating-badge-D7JOW3KJ.png +0 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -267,6 +267,7 @@ var SearchField = forwardRef2(
|
|
|
267
267
|
({
|
|
268
268
|
variant = "outline",
|
|
269
269
|
status = "neutral",
|
|
270
|
+
showSearchIcon = true,
|
|
270
271
|
value,
|
|
271
272
|
defaultValue,
|
|
272
273
|
onChange,
|
|
@@ -321,7 +322,7 @@ var SearchField = forwardRef2(
|
|
|
321
322
|
className: wrapperClass,
|
|
322
323
|
"data-disabled": disabled || void 0,
|
|
323
324
|
children: [
|
|
324
|
-
/* @__PURE__ */ jsx7("span", { className: "iconSlot", children: /* @__PURE__ */ jsx7(SearchIcon, {}) }),
|
|
325
|
+
showSearchIcon && /* @__PURE__ */ jsx7("span", { className: "iconSlot", children: /* @__PURE__ */ jsx7(SearchIcon, {}) }),
|
|
325
326
|
/* @__PURE__ */ jsx7(
|
|
326
327
|
"input",
|
|
327
328
|
{
|
|
@@ -865,6 +866,21 @@ var CardThumbnailVariant = ({
|
|
|
865
866
|
const isVideo = type === "video";
|
|
866
867
|
const isHorizontal = layout === "horizontal" || layout === "horizontal-reverse";
|
|
867
868
|
const isReversed = layout === "horizontal-reverse";
|
|
869
|
+
const hasTags = !hideTags && tags.length > 0;
|
|
870
|
+
const tagsNode = hasTags && (isHorizontal ? /* @__PURE__ */ jsx13("div", { className: "ct-tagsList", children: tags.map((tag, i) => /* @__PURE__ */ jsxs13("span", { className: "ct-tagItem", children: [
|
|
871
|
+
i > 0 && /* @__PURE__ */ jsx13("span", { "aria-hidden": "true", className: "ct-tagDot", children: "\xB7" }),
|
|
872
|
+
/* @__PURE__ */ jsx13(Tag, { icon: tag.icon, label: tag.label, size: "md", variant: "custom" })
|
|
873
|
+
] }, i)) }) : /* @__PURE__ */ jsx13("div", { className: "ct-tagsRow", children: tags.map((tag, i) => /* @__PURE__ */ jsx13(Tag, { icon: tag.icon, label: tag.label, size: "md", variant: "fill" }, i)) }));
|
|
874
|
+
const copyLinkNode = showCopyLink && /* @__PURE__ */ jsx13(
|
|
875
|
+
"button",
|
|
876
|
+
{
|
|
877
|
+
"aria-label": "Copy link",
|
|
878
|
+
className: "ct-copyLink",
|
|
879
|
+
onClick: onCopyLink,
|
|
880
|
+
type: "button",
|
|
881
|
+
children: /* @__PURE__ */ jsx13(LinkIcon, {})
|
|
882
|
+
}
|
|
883
|
+
);
|
|
868
884
|
return /* @__PURE__ */ jsxs13(
|
|
869
885
|
"div",
|
|
870
886
|
{
|
|
@@ -877,24 +893,13 @@ var CardThumbnailVariant = ({
|
|
|
877
893
|
!isVideo && !hideAvatar && avatar && /* @__PURE__ */ jsx13("img", { alt: avatarAlt, className: "ct-avatar", src: avatar })
|
|
878
894
|
] }),
|
|
879
895
|
/* @__PURE__ */ jsxs13("div", { className: "ct-content", children: [
|
|
896
|
+
!isHorizontal && tagsNode,
|
|
880
897
|
/* @__PURE__ */ jsx13("p", { className: "ct-title", children: title }),
|
|
881
898
|
/* @__PURE__ */ jsx13("p", { className: "ct-summary", children: summary }),
|
|
882
|
-
/* @__PURE__ */ jsxs13("div", { className: "ct-metaRow", children: [
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
] }, i)) }),
|
|
887
|
-
showCopyLink && /* @__PURE__ */ jsx13(
|
|
888
|
-
"button",
|
|
889
|
-
{
|
|
890
|
-
"aria-label": "Copy link",
|
|
891
|
-
className: "ct-copyLink",
|
|
892
|
-
onClick: onCopyLink,
|
|
893
|
-
type: "button",
|
|
894
|
-
children: /* @__PURE__ */ jsx13(LinkIcon, {})
|
|
895
|
-
}
|
|
896
|
-
)
|
|
897
|
-
] })
|
|
899
|
+
isHorizontal ? (tagsNode || copyLinkNode) && /* @__PURE__ */ jsxs13("div", { className: "ct-metaRow", children: [
|
|
900
|
+
tagsNode,
|
|
901
|
+
copyLinkNode
|
|
902
|
+
] }) : copyLinkNode && /* @__PURE__ */ jsx13("div", { className: "ct-metaRow ct-metaRow--end", children: copyLinkNode })
|
|
898
903
|
] })
|
|
899
904
|
]
|
|
900
905
|
}
|
|
@@ -1897,6 +1902,24 @@ var ButtonBlock2 = ({
|
|
|
1897
1902
|
))
|
|
1898
1903
|
] });
|
|
1899
1904
|
};
|
|
1905
|
+
var SearchBlock = ({ search }) => {
|
|
1906
|
+
const handleKeyDown = (event) => {
|
|
1907
|
+
if (event.key === "Enter") {
|
|
1908
|
+
search?.onSubmit?.(event.currentTarget.value);
|
|
1909
|
+
}
|
|
1910
|
+
};
|
|
1911
|
+
return /* @__PURE__ */ jsx24("div", { className: "header__search", children: /* @__PURE__ */ jsx24(
|
|
1912
|
+
SearchField,
|
|
1913
|
+
{
|
|
1914
|
+
placeholder: search?.placeholder ?? "Search",
|
|
1915
|
+
value: search?.value,
|
|
1916
|
+
onChange: search?.onChange,
|
|
1917
|
+
onClear: search?.onClear,
|
|
1918
|
+
onKeyDown: handleKeyDown,
|
|
1919
|
+
showSearchIcon: false
|
|
1920
|
+
}
|
|
1921
|
+
) });
|
|
1922
|
+
};
|
|
1900
1923
|
var Header = ({
|
|
1901
1924
|
variant,
|
|
1902
1925
|
subtitle,
|
|
@@ -1906,6 +1929,7 @@ var Header = ({
|
|
|
1906
1929
|
secondaryButton,
|
|
1907
1930
|
leftVisual,
|
|
1908
1931
|
rightVisual,
|
|
1932
|
+
search,
|
|
1909
1933
|
className,
|
|
1910
1934
|
...props
|
|
1911
1935
|
}) => {
|
|
@@ -1961,6 +1985,7 @@ var Header = ({
|
|
|
1961
1985
|
/* @__PURE__ */ jsx24("div", { className: "header__overlay", "aria-hidden": "true" }),
|
|
1962
1986
|
/* @__PURE__ */ jsx24("div", { className: "header__inner", children: /* @__PURE__ */ jsx24("div", { className: "header__content", children: /* @__PURE__ */ jsxs22("div", { className: "header__body", children: [
|
|
1963
1987
|
textBlock,
|
|
1988
|
+
variant === "dark-search" && /* @__PURE__ */ jsx24(SearchBlock, { search }),
|
|
1964
1989
|
/* @__PURE__ */ jsx24(
|
|
1965
1990
|
ButtonBlock2,
|
|
1966
1991
|
{
|
|
@@ -5180,7 +5205,7 @@ var ImageBanner = ({
|
|
|
5180
5205
|
};
|
|
5181
5206
|
|
|
5182
5207
|
// templates/Testimonial/Testimonial.tsx
|
|
5183
|
-
import {
|
|
5208
|
+
import { useCallback as useCallback3, useEffect as useEffect12, useId as useId2, useRef as useRef15, useState as useState15 } from "react";
|
|
5184
5209
|
|
|
5185
5210
|
// assets/quote-left.webp
|
|
5186
5211
|
var quote_left_default = "./quote-left-63QMW5NQ.webp";
|
|
@@ -5188,9 +5213,181 @@ var quote_left_default = "./quote-left-63QMW5NQ.webp";
|
|
|
5188
5213
|
// assets/quote-right.webp
|
|
5189
5214
|
var quote_right_default = "./quote-right-W6AS4YHN.webp";
|
|
5190
5215
|
|
|
5216
|
+
// assets/trustpilot-rating-badge.png
|
|
5217
|
+
var trustpilot_rating_badge_default = "./trustpilot-rating-badge-D7JOW3KJ.png";
|
|
5218
|
+
|
|
5191
5219
|
// templates/Testimonial/Testimonial.tsx
|
|
5192
5220
|
import { jsx as jsx43, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
5193
|
-
var
|
|
5221
|
+
var StarCell = ({ fill }) => {
|
|
5222
|
+
const clipId = useId2();
|
|
5223
|
+
const clamped = Math.max(0, Math.min(1, fill));
|
|
5224
|
+
return /* @__PURE__ */ jsxs39(
|
|
5225
|
+
"svg",
|
|
5226
|
+
{
|
|
5227
|
+
className: "testimonial__tp-star",
|
|
5228
|
+
viewBox: "0 0 96 96",
|
|
5229
|
+
width: "20",
|
|
5230
|
+
height: "20",
|
|
5231
|
+
"aria-hidden": "true",
|
|
5232
|
+
children: [
|
|
5233
|
+
/* @__PURE__ */ jsx43("rect", { width: "96", height: "96", className: "testimonial__tp-star-bg" }),
|
|
5234
|
+
/* @__PURE__ */ jsx43("clipPath", { id: clipId, children: /* @__PURE__ */ jsx43("rect", { width: 96 * clamped, height: "96" }) }),
|
|
5235
|
+
/* @__PURE__ */ jsx43(
|
|
5236
|
+
"rect",
|
|
5237
|
+
{
|
|
5238
|
+
width: "96",
|
|
5239
|
+
height: "96",
|
|
5240
|
+
className: "testimonial__tp-star-fill",
|
|
5241
|
+
clipPath: `url(#${clipId})`
|
|
5242
|
+
}
|
|
5243
|
+
),
|
|
5244
|
+
/* @__PURE__ */ jsx43(
|
|
5245
|
+
"path",
|
|
5246
|
+
{
|
|
5247
|
+
d: "M48,64.7L62.6,61l6.1,18.8L48,64.7z M81.6,40.4H55.9L48,16.2l-7.9,24.2H14.4l20.8,15l-7.9,24.2 l20.8-15l12.8-9.2L81.6,40.4L81.6,40.4L81.6,40.4L81.6,40.4z",
|
|
5248
|
+
className: "testimonial__tp-star-glyph"
|
|
5249
|
+
}
|
|
5250
|
+
)
|
|
5251
|
+
]
|
|
5252
|
+
}
|
|
5253
|
+
);
|
|
5254
|
+
};
|
|
5255
|
+
var StarRow = ({ rating, size = "sm" }) => {
|
|
5256
|
+
const stars = [0, 1, 2, 3, 4].map((i) => Math.max(0, Math.min(1, rating - i)));
|
|
5257
|
+
return /* @__PURE__ */ jsx43(
|
|
5258
|
+
"span",
|
|
5259
|
+
{
|
|
5260
|
+
className: ["testimonial__tp-stars", `testimonial__tp-stars--${size}`].join(" "),
|
|
5261
|
+
role: "img",
|
|
5262
|
+
"aria-label": `Rated ${rating} out of 5 stars`,
|
|
5263
|
+
children: stars.map((fill, i) => /* @__PURE__ */ jsx43(StarCell, { fill }, i))
|
|
5264
|
+
}
|
|
5265
|
+
);
|
|
5266
|
+
};
|
|
5267
|
+
var ArrowIcon = ({ direction }) => /* @__PURE__ */ jsx43("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: direction === "prev" ? /* @__PURE__ */ jsx43("path", { d: "M10 3.5 5.5 8l4.5 4.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) : /* @__PURE__ */ jsx43("path", { d: "M6 3.5 10.5 8 6 12.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
5268
|
+
var SCROLL_EPS = 4;
|
|
5269
|
+
function readScrollState(el) {
|
|
5270
|
+
if (!el) return { canPrev: false, canNext: false };
|
|
5271
|
+
const { scrollLeft, scrollWidth, clientWidth } = el;
|
|
5272
|
+
const maxScroll = scrollWidth - clientWidth;
|
|
5273
|
+
return {
|
|
5274
|
+
canPrev: scrollLeft > SCROLL_EPS,
|
|
5275
|
+
canNext: scrollLeft < maxScroll - SCROLL_EPS
|
|
5276
|
+
};
|
|
5277
|
+
}
|
|
5278
|
+
var TrustpilotTestimonial = ({
|
|
5279
|
+
title,
|
|
5280
|
+
items,
|
|
5281
|
+
className,
|
|
5282
|
+
trustpilotUrl = "https://www.trustpilot.com/review/deriv.com?utm_medium=trustbox&utm_source=Mini",
|
|
5283
|
+
trustpilotScore = 4.5,
|
|
5284
|
+
...props
|
|
5285
|
+
}) => {
|
|
5286
|
+
const trackRef = useRef15(null);
|
|
5287
|
+
const [canPrev, setCanPrev] = useState15(false);
|
|
5288
|
+
const [canNext, setCanNext] = useState15(true);
|
|
5289
|
+
const syncScrollState = useCallback3(() => {
|
|
5290
|
+
const next = readScrollState(trackRef.current);
|
|
5291
|
+
setCanPrev(next.canPrev);
|
|
5292
|
+
setCanNext(next.canNext);
|
|
5293
|
+
}, []);
|
|
5294
|
+
useEffect12(() => {
|
|
5295
|
+
const el = trackRef.current;
|
|
5296
|
+
if (!el) return;
|
|
5297
|
+
syncScrollState();
|
|
5298
|
+
const ro = new ResizeObserver(() => syncScrollState());
|
|
5299
|
+
ro.observe(el);
|
|
5300
|
+
return () => ro.disconnect();
|
|
5301
|
+
}, [syncScrollState]);
|
|
5302
|
+
const scrollByCard = (direction) => {
|
|
5303
|
+
const el = trackRef.current;
|
|
5304
|
+
if (!el) return;
|
|
5305
|
+
const card = el.querySelector(".testimonial__tp-card-wrap");
|
|
5306
|
+
const gap = Number.parseFloat(getComputedStyle(el).columnGap || "0") || 0;
|
|
5307
|
+
const delta = card?.offsetWidth ?? el.clientWidth * 0.85;
|
|
5308
|
+
el.scrollBy({ left: direction * (delta + gap), behavior: "smooth" });
|
|
5309
|
+
window.requestAnimationFrame(() => window.setTimeout(syncScrollState, 320));
|
|
5310
|
+
};
|
|
5311
|
+
return /* @__PURE__ */ jsxs39(
|
|
5312
|
+
"section",
|
|
5313
|
+
{
|
|
5314
|
+
className: ["testimonial", "testimonial--trustpilot", className].filter(Boolean).join(" "),
|
|
5315
|
+
...props,
|
|
5316
|
+
children: [
|
|
5317
|
+
/* @__PURE__ */ jsx43("div", { className: "testimonial__tp-head", children: title && /* @__PURE__ */ jsx43("h2", { className: "testimonial__title testimonial__title--trustpilot", children: title }) }),
|
|
5318
|
+
/* @__PURE__ */ jsx43("div", { className: "testimonial__tp-bleed", children: /* @__PURE__ */ jsx43(
|
|
5319
|
+
"div",
|
|
5320
|
+
{
|
|
5321
|
+
ref: trackRef,
|
|
5322
|
+
className: "testimonial__tp-carousel",
|
|
5323
|
+
tabIndex: 0,
|
|
5324
|
+
role: "region",
|
|
5325
|
+
"aria-roledescription": "carousel",
|
|
5326
|
+
"aria-label": "Customer reviews on Trustpilot",
|
|
5327
|
+
onScroll: syncScrollState,
|
|
5328
|
+
children: /* @__PURE__ */ jsx43("div", { className: "testimonial__tp-track", children: items.map((item, i) => /* @__PURE__ */ jsx43("div", { className: "testimonial__tp-card-wrap", children: /* @__PURE__ */ jsxs39(
|
|
5329
|
+
"a",
|
|
5330
|
+
{
|
|
5331
|
+
href: item.reviewUrl ?? trustpilotUrl,
|
|
5332
|
+
className: "testimonial__tp-card",
|
|
5333
|
+
target: "_blank",
|
|
5334
|
+
rel: "noopener noreferrer",
|
|
5335
|
+
children: [
|
|
5336
|
+
/* @__PURE__ */ jsx43(StarRow, { rating: item.rating ?? 5, size: "sm" }),
|
|
5337
|
+
/* @__PURE__ */ jsx43("p", { className: "testimonial__tp-quote", children: item.quote }),
|
|
5338
|
+
/* @__PURE__ */ jsx43("p", { className: "testimonial__tp-author", children: item.authorName })
|
|
5339
|
+
]
|
|
5340
|
+
}
|
|
5341
|
+
) }, i)) })
|
|
5342
|
+
}
|
|
5343
|
+
) }),
|
|
5344
|
+
/* @__PURE__ */ jsx43("div", { className: "testimonial__tp-foot", children: /* @__PURE__ */ jsxs39("div", { className: "testimonial__tp-footer", children: [
|
|
5345
|
+
/* @__PURE__ */ jsx43("div", { className: "testimonial__tp-trust", children: /* @__PURE__ */ jsx43(
|
|
5346
|
+
"a",
|
|
5347
|
+
{
|
|
5348
|
+
href: trustpilotUrl,
|
|
5349
|
+
className: "testimonial__tp-badge",
|
|
5350
|
+
target: "_blank",
|
|
5351
|
+
rel: "noopener noreferrer",
|
|
5352
|
+
"aria-label": `Deriv on Trustpilot \u2014 rated ${trustpilotScore} out of 5`,
|
|
5353
|
+
children: /* @__PURE__ */ jsx43(
|
|
5354
|
+
"img",
|
|
5355
|
+
{
|
|
5356
|
+
src: trustpilot_rating_badge_default,
|
|
5357
|
+
alt: "",
|
|
5358
|
+
className: "testimonial__tp-badge-img"
|
|
5359
|
+
}
|
|
5360
|
+
)
|
|
5361
|
+
}
|
|
5362
|
+
) }),
|
|
5363
|
+
items.length > 1 && (canPrev || canNext) && /* @__PURE__ */ jsxs39("div", { className: "testimonial__tp-nav", children: [
|
|
5364
|
+
canPrev && /* @__PURE__ */ jsx43(
|
|
5365
|
+
"button",
|
|
5366
|
+
{
|
|
5367
|
+
type: "button",
|
|
5368
|
+
className: "testimonial__tp-nav-btn",
|
|
5369
|
+
"aria-label": "Show previous testimonials",
|
|
5370
|
+
onClick: () => scrollByCard(-1),
|
|
5371
|
+
children: /* @__PURE__ */ jsx43(ArrowIcon, { direction: "prev" })
|
|
5372
|
+
}
|
|
5373
|
+
),
|
|
5374
|
+
canNext && /* @__PURE__ */ jsx43(
|
|
5375
|
+
"button",
|
|
5376
|
+
{
|
|
5377
|
+
type: "button",
|
|
5378
|
+
className: "testimonial__tp-nav-btn",
|
|
5379
|
+
"aria-label": "Show next testimonials",
|
|
5380
|
+
onClick: () => scrollByCard(1),
|
|
5381
|
+
children: /* @__PURE__ */ jsx43(ArrowIcon, { direction: "next" })
|
|
5382
|
+
}
|
|
5383
|
+
)
|
|
5384
|
+
] })
|
|
5385
|
+
] }) })
|
|
5386
|
+
]
|
|
5387
|
+
}
|
|
5388
|
+
);
|
|
5389
|
+
};
|
|
5390
|
+
var DefaultTestimonial = ({
|
|
5194
5391
|
title,
|
|
5195
5392
|
items,
|
|
5196
5393
|
className,
|
|
@@ -5225,7 +5422,6 @@ var Testimonial = ({
|
|
|
5225
5422
|
if (autoRef.current) clearTimeout(autoRef.current);
|
|
5226
5423
|
};
|
|
5227
5424
|
}, [activeIndex, items.length]);
|
|
5228
|
-
if (!items || items.length === 0) return null;
|
|
5229
5425
|
return /* @__PURE__ */ jsx43(
|
|
5230
5426
|
"section",
|
|
5231
5427
|
{
|
|
@@ -5301,6 +5497,13 @@ var Testimonial = ({
|
|
|
5301
5497
|
}
|
|
5302
5498
|
);
|
|
5303
5499
|
};
|
|
5500
|
+
var Testimonial = (props) => {
|
|
5501
|
+
if (!props.items || props.items.length === 0) return null;
|
|
5502
|
+
if (props.variant === "trustpilot") {
|
|
5503
|
+
return /* @__PURE__ */ jsx43(TrustpilotTestimonial, { ...props });
|
|
5504
|
+
}
|
|
5505
|
+
return /* @__PURE__ */ jsx43(DefaultTestimonial, { ...props });
|
|
5506
|
+
};
|
|
5304
5507
|
|
|
5305
5508
|
// templates/ArticleHero/ArticleHero.tsx
|
|
5306
5509
|
import { jsx as jsx44, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
@@ -5583,7 +5786,7 @@ var ArticleSection = ({
|
|
|
5583
5786
|
};
|
|
5584
5787
|
|
|
5585
5788
|
// templates/CoralBanner/CoralBanner.tsx
|
|
5586
|
-
import { useCallback as
|
|
5789
|
+
import { useCallback as useCallback4, useEffect as useEffect13, useRef as useRef16, useState as useState16 } from "react";
|
|
5587
5790
|
import { jsx as jsx46, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
5588
5791
|
var DEFAULT_SLIDES = [
|
|
5589
5792
|
{
|
|
@@ -5700,7 +5903,7 @@ var CoralBanner = ({
|
|
|
5700
5903
|
const [activeIndex, setActiveIndex] = useState16(0);
|
|
5701
5904
|
const autoplayTimer = useRef16(null);
|
|
5702
5905
|
const dragState = useRef16(null);
|
|
5703
|
-
const goTo =
|
|
5906
|
+
const goTo = useCallback4(
|
|
5704
5907
|
(index) => {
|
|
5705
5908
|
if (count <= 1) return;
|
|
5706
5909
|
const next = infinite ? (index % count + count) % count : Math.max(0, Math.min(index, count - 1));
|
|
@@ -5708,8 +5911,8 @@ var CoralBanner = ({
|
|
|
5708
5911
|
},
|
|
5709
5912
|
[count, infinite]
|
|
5710
5913
|
);
|
|
5711
|
-
const goNext =
|
|
5712
|
-
const goPrev =
|
|
5914
|
+
const goNext = useCallback4(() => goTo(activeIndex + 1), [activeIndex, goTo]);
|
|
5915
|
+
const goPrev = useCallback4(() => goTo(activeIndex - 1), [activeIndex, goTo]);
|
|
5713
5916
|
const resetAutoplay = () => {
|
|
5714
5917
|
if (autoplayTimer.current) clearTimeout(autoplayTimer.current);
|
|
5715
5918
|
};
|
|
@@ -5910,11 +6113,212 @@ var FeatureAwards = ({
|
|
|
5910
6113
|
);
|
|
5911
6114
|
};
|
|
5912
6115
|
|
|
5913
|
-
// templates/
|
|
5914
|
-
import {
|
|
6116
|
+
// templates/FeatureBlog/FeatureBlog.tsx
|
|
6117
|
+
import { jsx as jsx48, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
5915
6118
|
var externalLinkRel2 = (href) => href && /^https?:\/\//i.test(href) ? "noopener noreferrer" : void 0;
|
|
5916
|
-
var
|
|
5917
|
-
|
|
6119
|
+
var FEATURE_BLOG_TEXT_CONTENT = {
|
|
6120
|
+
title: "Deriv press releases",
|
|
6121
|
+
linkText: "See all press releases"
|
|
6122
|
+
};
|
|
6123
|
+
var PostCard = ({ post, index }) => {
|
|
6124
|
+
const tags = [post.date, post.category].filter((value) => Boolean(value)).map((label) => ({ label }));
|
|
6125
|
+
const card = /* @__PURE__ */ jsx48(
|
|
6126
|
+
Card,
|
|
6127
|
+
{
|
|
6128
|
+
hideAvatar: true,
|
|
6129
|
+
layout: "vertical",
|
|
6130
|
+
showCopyLink: false,
|
|
6131
|
+
summary: post.summary,
|
|
6132
|
+
tags,
|
|
6133
|
+
thumbnail: post.thumbnail,
|
|
6134
|
+
thumbnailAlt: post.thumbnailAlt,
|
|
6135
|
+
title: post.title,
|
|
6136
|
+
type: "article",
|
|
6137
|
+
variant: "thumbnail"
|
|
6138
|
+
}
|
|
6139
|
+
);
|
|
6140
|
+
if (post.href) {
|
|
6141
|
+
return /* @__PURE__ */ jsx48(
|
|
6142
|
+
"a",
|
|
6143
|
+
{
|
|
6144
|
+
className: "fb-cardLink",
|
|
6145
|
+
href: post.href,
|
|
6146
|
+
rel: externalLinkRel2(post.href),
|
|
6147
|
+
children: card
|
|
6148
|
+
},
|
|
6149
|
+
`${post.title}-${index}`
|
|
6150
|
+
);
|
|
6151
|
+
}
|
|
6152
|
+
if (post.onClick) {
|
|
6153
|
+
return /* @__PURE__ */ jsx48(
|
|
6154
|
+
"button",
|
|
6155
|
+
{
|
|
6156
|
+
className: "fb-cardLink fb-cardButton",
|
|
6157
|
+
onClick: post.onClick,
|
|
6158
|
+
type: "button",
|
|
6159
|
+
children: card
|
|
6160
|
+
},
|
|
6161
|
+
`${post.title}-${index}`
|
|
6162
|
+
);
|
|
6163
|
+
}
|
|
6164
|
+
return /* @__PURE__ */ jsx48("div", { children: card }, `${post.title}-${index}`);
|
|
6165
|
+
};
|
|
6166
|
+
var FeatureBlog = ({
|
|
6167
|
+
title = FEATURE_BLOG_TEXT_CONTENT.title,
|
|
6168
|
+
posts,
|
|
6169
|
+
showLink = true,
|
|
6170
|
+
linkText = FEATURE_BLOG_TEXT_CONTENT.linkText,
|
|
6171
|
+
linkHref,
|
|
6172
|
+
onLinkClick,
|
|
6173
|
+
className,
|
|
6174
|
+
...props
|
|
6175
|
+
}) => {
|
|
6176
|
+
if (!posts || posts.length === 0) return null;
|
|
6177
|
+
return /* @__PURE__ */ jsx48("section", { className: ["fb-section", className ?? ""].filter(Boolean).join(" "), ...props, children: /* @__PURE__ */ jsxs44("div", { className: "fb-container", children: [
|
|
6178
|
+
title && /* @__PURE__ */ jsx48("h2", { className: "fb-title", children: title }),
|
|
6179
|
+
/* @__PURE__ */ jsx48("div", { className: "fb-grid", children: posts.map((post, index) => /* @__PURE__ */ jsx48(PostCard, { index, post }, `${post.title}-${index}`)) }),
|
|
6180
|
+
showLink && /* @__PURE__ */ jsx48("div", { className: "fb-linkWrap", children: /* @__PURE__ */ jsx48(
|
|
6181
|
+
Link,
|
|
6182
|
+
{
|
|
6183
|
+
colorScheme: "coral",
|
|
6184
|
+
href: linkHref,
|
|
6185
|
+
label: linkText,
|
|
6186
|
+
rel: externalLinkRel2(linkHref),
|
|
6187
|
+
onClick: onLinkClick
|
|
6188
|
+
}
|
|
6189
|
+
) })
|
|
6190
|
+
] }) });
|
|
6191
|
+
};
|
|
6192
|
+
|
|
6193
|
+
// templates/FeatureBlogCategories/FeatureBlogCategories.tsx
|
|
6194
|
+
import { useMemo as useMemo3, useState as useState17 } from "react";
|
|
6195
|
+
import { jsx as jsx49, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
6196
|
+
var isExternalUrl = (href) => Boolean(href && /^https?:\/\//i.test(href));
|
|
6197
|
+
var FEATURE_BLOG_CATEGORIES_TEXT_CONTENT = {
|
|
6198
|
+
title: "Deriv press releases",
|
|
6199
|
+
allCategoryId: "all",
|
|
6200
|
+
allCategoryLabel: "View all",
|
|
6201
|
+
searchPlaceholder: "Search",
|
|
6202
|
+
emptyStateText: "Sorry, we couldn't find any results matching."
|
|
6203
|
+
};
|
|
6204
|
+
var PostCard2 = ({
|
|
6205
|
+
post,
|
|
6206
|
+
categoryLabel
|
|
6207
|
+
}) => {
|
|
6208
|
+
const tags = [post.date, categoryLabel].filter((value) => Boolean(value)).map((label) => ({ label }));
|
|
6209
|
+
const card = /* @__PURE__ */ jsx49(
|
|
6210
|
+
Card,
|
|
6211
|
+
{
|
|
6212
|
+
hideAvatar: true,
|
|
6213
|
+
layout: "vertical",
|
|
6214
|
+
showCopyLink: false,
|
|
6215
|
+
summary: post.summary,
|
|
6216
|
+
tags,
|
|
6217
|
+
thumbnail: post.thumbnail,
|
|
6218
|
+
thumbnailAlt: post.thumbnailAlt,
|
|
6219
|
+
title: post.title,
|
|
6220
|
+
type: "article",
|
|
6221
|
+
variant: "thumbnail"
|
|
6222
|
+
}
|
|
6223
|
+
);
|
|
6224
|
+
if (post.href) {
|
|
6225
|
+
const external = isExternalUrl(post.href);
|
|
6226
|
+
return /* @__PURE__ */ jsx49(
|
|
6227
|
+
"a",
|
|
6228
|
+
{
|
|
6229
|
+
className: "fbc-cardLink",
|
|
6230
|
+
href: post.href,
|
|
6231
|
+
rel: external ? "noopener noreferrer" : void 0,
|
|
6232
|
+
target: external ? "_blank" : void 0,
|
|
6233
|
+
children: card
|
|
6234
|
+
}
|
|
6235
|
+
);
|
|
6236
|
+
}
|
|
6237
|
+
if (post.onClick) {
|
|
6238
|
+
return /* @__PURE__ */ jsx49("button", { className: "fbc-cardLink fbc-cardButton", onClick: post.onClick, type: "button", children: card });
|
|
6239
|
+
}
|
|
6240
|
+
return /* @__PURE__ */ jsx49("div", { children: card });
|
|
6241
|
+
};
|
|
6242
|
+
var FeatureBlogCategories = ({
|
|
6243
|
+
title = FEATURE_BLOG_CATEGORIES_TEXT_CONTENT.title,
|
|
6244
|
+
categories,
|
|
6245
|
+
allCategoryId = FEATURE_BLOG_CATEGORIES_TEXT_CONTENT.allCategoryId,
|
|
6246
|
+
allCategoryLabel = FEATURE_BLOG_CATEGORIES_TEXT_CONTENT.allCategoryLabel,
|
|
6247
|
+
activeCategoryId,
|
|
6248
|
+
defaultActiveCategoryId,
|
|
6249
|
+
onCategoryChange,
|
|
6250
|
+
posts,
|
|
6251
|
+
searchPlaceholder = FEATURE_BLOG_CATEGORIES_TEXT_CONTENT.searchPlaceholder,
|
|
6252
|
+
searchAriaLabel,
|
|
6253
|
+
onSearchChange,
|
|
6254
|
+
emptyStateText = FEATURE_BLOG_CATEGORIES_TEXT_CONTENT.emptyStateText,
|
|
6255
|
+
className,
|
|
6256
|
+
...props
|
|
6257
|
+
}) => {
|
|
6258
|
+
const [search, setSearch] = useState17("");
|
|
6259
|
+
const [internalActiveId, setInternalActiveId] = useState17(defaultActiveCategoryId ?? allCategoryId);
|
|
6260
|
+
const isControlled = activeCategoryId !== void 0;
|
|
6261
|
+
const activeId = isControlled ? activeCategoryId : internalActiveId;
|
|
6262
|
+
const tabs = useMemo3(
|
|
6263
|
+
() => [{ id: allCategoryId, label: allCategoryLabel }, ...categories],
|
|
6264
|
+
[allCategoryId, allCategoryLabel, categories]
|
|
6265
|
+
);
|
|
6266
|
+
const categoryLabelById = useMemo3(() => {
|
|
6267
|
+
const map = /* @__PURE__ */ new Map();
|
|
6268
|
+
categories.forEach((category) => map.set(category.id, category.label));
|
|
6269
|
+
return map;
|
|
6270
|
+
}, [categories]);
|
|
6271
|
+
const filteredPosts = useMemo3(() => {
|
|
6272
|
+
const query = search.trim().toLowerCase();
|
|
6273
|
+
return posts.filter((post) => {
|
|
6274
|
+
const matchesCategory = activeId === allCategoryId || post.category === activeId;
|
|
6275
|
+
if (!matchesCategory) return false;
|
|
6276
|
+
if (!query) return true;
|
|
6277
|
+
return post.title.toLowerCase().includes(query) || post.summary.toLowerCase().includes(query);
|
|
6278
|
+
});
|
|
6279
|
+
}, [posts, activeId, allCategoryId, search]);
|
|
6280
|
+
const handleTabChange = (id) => {
|
|
6281
|
+
if (!isControlled) setInternalActiveId(id);
|
|
6282
|
+
onCategoryChange?.(id);
|
|
6283
|
+
};
|
|
6284
|
+
const handleSearchChange = (e) => {
|
|
6285
|
+
setSearch(e.target.value);
|
|
6286
|
+
onSearchChange?.(e.target.value);
|
|
6287
|
+
};
|
|
6288
|
+
const handleSearchClear = () => {
|
|
6289
|
+
setSearch("");
|
|
6290
|
+
onSearchChange?.("");
|
|
6291
|
+
};
|
|
6292
|
+
return /* @__PURE__ */ jsx49("section", { className: ["fbc-section", className ?? ""].filter(Boolean).join(" "), ...props, children: /* @__PURE__ */ jsxs45("div", { className: "fbc-container", children: [
|
|
6293
|
+
title && /* @__PURE__ */ jsx49("h2", { className: "fbc-title", children: title }),
|
|
6294
|
+
/* @__PURE__ */ jsx49("div", { className: "fbc-searchWrap", children: /* @__PURE__ */ jsx49(
|
|
6295
|
+
SearchField,
|
|
6296
|
+
{
|
|
6297
|
+
"aria-label": searchAriaLabel ?? searchPlaceholder,
|
|
6298
|
+
onChange: handleSearchChange,
|
|
6299
|
+
onClear: handleSearchClear,
|
|
6300
|
+
placeholder: searchPlaceholder,
|
|
6301
|
+
value: search,
|
|
6302
|
+
variant: "outline"
|
|
6303
|
+
}
|
|
6304
|
+
) }),
|
|
6305
|
+
/* @__PURE__ */ jsx49("div", { className: "fbc-tabsWrap", children: /* @__PURE__ */ jsx49(Tabs, { activeId: activeId ?? allCategoryId, items: tabs, onChange: handleTabChange }) }),
|
|
6306
|
+
filteredPosts.length > 0 ? /* @__PURE__ */ jsx49("div", { className: "fbc-grid", children: filteredPosts.map((post, index) => /* @__PURE__ */ jsx49(
|
|
6307
|
+
PostCard2,
|
|
6308
|
+
{
|
|
6309
|
+
categoryLabel: post.categoryLabel ?? categoryLabelById.get(post.category),
|
|
6310
|
+
post
|
|
6311
|
+
},
|
|
6312
|
+
`${post.title}-${index}`
|
|
6313
|
+
)) }) : /* @__PURE__ */ jsx49("p", { className: "fbc-emptyState", children: emptyStateText })
|
|
6314
|
+
] }) });
|
|
6315
|
+
};
|
|
6316
|
+
|
|
6317
|
+
// templates/HelpCentreCategories/HelpCentreCategories.tsx
|
|
6318
|
+
import { Fragment as Fragment7, jsx as jsx50, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
6319
|
+
var externalLinkRel3 = (href) => href && /^https?:\/\//i.test(href) ? "noopener noreferrer" : void 0;
|
|
6320
|
+
var CategoryTileContent = ({ category }) => /* @__PURE__ */ jsxs46(Fragment7, { children: [
|
|
6321
|
+
category.icon && /* @__PURE__ */ jsx50("span", { className: "hcc-tile-icon", children: typeof category.icon === "string" ? /* @__PURE__ */ jsx50(
|
|
5918
6322
|
"img",
|
|
5919
6323
|
{
|
|
5920
6324
|
alt: category.iconAlt ?? "",
|
|
@@ -5926,22 +6330,22 @@ var CategoryTileContent = ({ category }) => /* @__PURE__ */ jsxs44(Fragment7, {
|
|
|
5926
6330
|
width: 48
|
|
5927
6331
|
}
|
|
5928
6332
|
) : category.icon }),
|
|
5929
|
-
/* @__PURE__ */
|
|
6333
|
+
/* @__PURE__ */ jsx50("span", { className: "hcc-tile-title", children: category.title })
|
|
5930
6334
|
] });
|
|
5931
6335
|
var CategoryTile = ({ category }) => {
|
|
5932
6336
|
if (category.href) {
|
|
5933
|
-
return /* @__PURE__ */
|
|
6337
|
+
return /* @__PURE__ */ jsx50(
|
|
5934
6338
|
"a",
|
|
5935
6339
|
{
|
|
5936
6340
|
className: "hcc-tile",
|
|
5937
6341
|
href: category.href,
|
|
5938
6342
|
onClick: category.onClick,
|
|
5939
|
-
rel:
|
|
5940
|
-
children: /* @__PURE__ */
|
|
6343
|
+
rel: externalLinkRel3(category.href),
|
|
6344
|
+
children: /* @__PURE__ */ jsx50(CategoryTileContent, { category })
|
|
5941
6345
|
}
|
|
5942
6346
|
);
|
|
5943
6347
|
}
|
|
5944
|
-
return /* @__PURE__ */
|
|
6348
|
+
return /* @__PURE__ */ jsx50("button", { className: "hcc-tile", onClick: category.onClick, type: "button", children: /* @__PURE__ */ jsx50(CategoryTileContent, { category }) });
|
|
5945
6349
|
};
|
|
5946
6350
|
var getColumnCount = (categoryCount) => Math.max(1, Math.min(categoryCount, 3));
|
|
5947
6351
|
var HelpCentreCategories = ({
|
|
@@ -5950,24 +6354,24 @@ var HelpCentreCategories = ({
|
|
|
5950
6354
|
categories
|
|
5951
6355
|
}) => {
|
|
5952
6356
|
const columnCount = getColumnCount(categories.length);
|
|
5953
|
-
return /* @__PURE__ */
|
|
5954
|
-
(sectionTitle || sectionDescription) && /* @__PURE__ */
|
|
5955
|
-
sectionTitle && /* @__PURE__ */
|
|
5956
|
-
sectionDescription && /* @__PURE__ */
|
|
6357
|
+
return /* @__PURE__ */ jsx50("section", { className: "hcc-section", children: /* @__PURE__ */ jsxs46("div", { className: "hcc-container", children: [
|
|
6358
|
+
(sectionTitle || sectionDescription) && /* @__PURE__ */ jsxs46("div", { className: "hcc-header", children: [
|
|
6359
|
+
sectionTitle && /* @__PURE__ */ jsx50("h2", { className: "hcc-sectionTitle", children: sectionTitle }),
|
|
6360
|
+
sectionDescription && /* @__PURE__ */ jsx50("p", { className: "hcc-sectionDescription", children: sectionDescription })
|
|
5957
6361
|
] }),
|
|
5958
|
-
/* @__PURE__ */
|
|
6362
|
+
/* @__PURE__ */ jsx50("div", { className: `hcc-grid hcc-grid--${columnCount}`, role: "list", children: categories.map((category, index) => /* @__PURE__ */ jsx50("div", { className: "hcc-gridItem", role: "listitem", children: /* @__PURE__ */ jsx50(CategoryTile, { category }) }, category.id ?? `${category.title}-${index}`)) })
|
|
5959
6363
|
] }) });
|
|
5960
6364
|
};
|
|
5961
6365
|
|
|
5962
6366
|
// templates/HelpCentreSubCategories/HelpCentreSubCategories.tsx
|
|
5963
|
-
import { useMemo as
|
|
5964
|
-
import { jsx as
|
|
5965
|
-
var
|
|
6367
|
+
import { useMemo as useMemo4, useState as useState18 } from "react";
|
|
6368
|
+
import { jsx as jsx51, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
6369
|
+
var externalLinkRel4 = (href) => href && /^https?:\/\//i.test(href) ? "noopener noreferrer" : void 0;
|
|
5966
6370
|
var QuestionCard = ({ item }) => {
|
|
5967
6371
|
if (item.href) {
|
|
5968
|
-
return /* @__PURE__ */
|
|
6372
|
+
return /* @__PURE__ */ jsx51("a", { className: "hcsc-card", href: item.href, onClick: item.onClick, rel: externalLinkRel4(item.href), children: /* @__PURE__ */ jsx51("span", { className: "hcsc-card-text", children: item.question }) });
|
|
5969
6373
|
}
|
|
5970
|
-
return /* @__PURE__ */
|
|
6374
|
+
return /* @__PURE__ */ jsx51("button", { className: "hcsc-card", onClick: item.onClick, type: "button", children: /* @__PURE__ */ jsx51("span", { className: "hcsc-card-text", children: item.question }) });
|
|
5971
6375
|
};
|
|
5972
6376
|
var HelpCentreSubCategories = ({
|
|
5973
6377
|
title,
|
|
@@ -5977,8 +6381,8 @@ var HelpCentreSubCategories = ({
|
|
|
5977
6381
|
noResultsText = 'No results found for "{query}"',
|
|
5978
6382
|
onSearchChange
|
|
5979
6383
|
}) => {
|
|
5980
|
-
const [search, setSearch] =
|
|
5981
|
-
const filtered =
|
|
6384
|
+
const [search, setSearch] = useState18("");
|
|
6385
|
+
const filtered = useMemo4(() => {
|
|
5982
6386
|
const q = search.trim().toLowerCase();
|
|
5983
6387
|
if (!q) return items;
|
|
5984
6388
|
return items.filter((item) => item.question.toLowerCase().includes(q));
|
|
@@ -5991,9 +6395,9 @@ var HelpCentreSubCategories = ({
|
|
|
5991
6395
|
setSearch("");
|
|
5992
6396
|
onSearchChange?.("");
|
|
5993
6397
|
};
|
|
5994
|
-
return /* @__PURE__ */
|
|
5995
|
-
/* @__PURE__ */
|
|
5996
|
-
/* @__PURE__ */
|
|
6398
|
+
return /* @__PURE__ */ jsx51("section", { className: "hcsc-section", children: /* @__PURE__ */ jsxs47("div", { className: "hcsc-container", children: [
|
|
6399
|
+
/* @__PURE__ */ jsx51("h1", { className: "hcsc-title", children: title }),
|
|
6400
|
+
/* @__PURE__ */ jsx51("div", { className: "hcsc-searchWrap", children: /* @__PURE__ */ jsx51(
|
|
5997
6401
|
SearchField,
|
|
5998
6402
|
{
|
|
5999
6403
|
"aria-label": searchAriaLabel ?? searchPlaceholder,
|
|
@@ -6004,25 +6408,25 @@ var HelpCentreSubCategories = ({
|
|
|
6004
6408
|
variant: "outline"
|
|
6005
6409
|
}
|
|
6006
6410
|
) }),
|
|
6007
|
-
filtered.length > 0 ? /* @__PURE__ */
|
|
6411
|
+
filtered.length > 0 ? /* @__PURE__ */ jsx51("div", { className: "hcsc-grid", role: "list", children: filtered.map((item, index) => /* @__PURE__ */ jsx51("div", { className: "hcsc-gridItem", role: "listitem", children: /* @__PURE__ */ jsx51(QuestionCard, { item }) }, item.id ?? `${item.question}-${index}`)) }) : /* @__PURE__ */ jsx51("p", { className: "hcsc-noResults", children: noResultsText.replace("{query}", search) })
|
|
6008
6412
|
] }) });
|
|
6009
6413
|
};
|
|
6010
6414
|
|
|
6011
6415
|
// templates/HelpCenterPage/HelpCenterPage.tsx
|
|
6012
|
-
import { useMemo as
|
|
6013
|
-
import { jsx as
|
|
6014
|
-
var
|
|
6015
|
-
var ChevronDownIcon5 = () => /* @__PURE__ */
|
|
6416
|
+
import { useMemo as useMemo5, useState as useState19 } from "react";
|
|
6417
|
+
import { jsx as jsx52, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
6418
|
+
var externalLinkRel5 = (href) => href && /^https?:\/\//i.test(href) ? "noopener noreferrer" : void 0;
|
|
6419
|
+
var ChevronDownIcon5 = () => /* @__PURE__ */ jsx52("svg", { "aria-hidden": "true", fill: "none", height: "16", viewBox: "0 0 16 16", width: "16", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx52("path", { d: "M4 6l4 4 4-4", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5" }) });
|
|
6016
6420
|
var renderBlock = (block, index) => {
|
|
6017
6421
|
if (block.type === "heading") {
|
|
6018
6422
|
const HeadingTag = block.level === 3 ? "h3" : "h2";
|
|
6019
|
-
return /* @__PURE__ */
|
|
6423
|
+
return /* @__PURE__ */ jsx52(HeadingTag, { className: "hcp-blockHeading", children: block.text }, index);
|
|
6020
6424
|
}
|
|
6021
6425
|
if (block.type === "list") {
|
|
6022
6426
|
const ListTag = block.ordered ? "ol" : "ul";
|
|
6023
|
-
return /* @__PURE__ */
|
|
6427
|
+
return /* @__PURE__ */ jsx52(ListTag, { className: "hcp-blockList", children: (block.items ?? []).map((item, i) => /* @__PURE__ */ jsx52("li", { className: "hcp-blockListItem", children: item }, i)) }, index);
|
|
6024
6428
|
}
|
|
6025
|
-
return /* @__PURE__ */
|
|
6429
|
+
return /* @__PURE__ */ jsx52("p", { className: "hcp-blockParagraph", children: block.text }, index);
|
|
6026
6430
|
};
|
|
6027
6431
|
var QuestionRow = ({
|
|
6028
6432
|
item,
|
|
@@ -6031,7 +6435,7 @@ var QuestionRow = ({
|
|
|
6031
6435
|
}) => {
|
|
6032
6436
|
const rowClass = ["hcp-row", isActive ? "hcp-row--active" : ""].filter(Boolean).join(" ");
|
|
6033
6437
|
if (item.href) {
|
|
6034
|
-
return /* @__PURE__ */
|
|
6438
|
+
return /* @__PURE__ */ jsx52(
|
|
6035
6439
|
"a",
|
|
6036
6440
|
{
|
|
6037
6441
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -6041,12 +6445,12 @@ var QuestionRow = ({
|
|
|
6041
6445
|
item.onClick?.();
|
|
6042
6446
|
onSelect(item);
|
|
6043
6447
|
},
|
|
6044
|
-
rel:
|
|
6045
|
-
children: /* @__PURE__ */
|
|
6448
|
+
rel: externalLinkRel5(item.href),
|
|
6449
|
+
children: /* @__PURE__ */ jsx52("span", { className: "hcp-rowText", children: item.question })
|
|
6046
6450
|
}
|
|
6047
6451
|
);
|
|
6048
6452
|
}
|
|
6049
|
-
return /* @__PURE__ */
|
|
6453
|
+
return /* @__PURE__ */ jsx52(
|
|
6050
6454
|
"button",
|
|
6051
6455
|
{
|
|
6052
6456
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -6056,7 +6460,7 @@ var QuestionRow = ({
|
|
|
6056
6460
|
onSelect(item);
|
|
6057
6461
|
},
|
|
6058
6462
|
type: "button",
|
|
6059
|
-
children: /* @__PURE__ */
|
|
6463
|
+
children: /* @__PURE__ */ jsx52("span", { className: "hcp-rowText", children: item.question })
|
|
6060
6464
|
}
|
|
6061
6465
|
);
|
|
6062
6466
|
};
|
|
@@ -6075,13 +6479,13 @@ var HelpCenterPage = ({
|
|
|
6075
6479
|
articlesSheetTitle = "Articles in this section",
|
|
6076
6480
|
className
|
|
6077
6481
|
}) => {
|
|
6078
|
-
const [search, setSearch] =
|
|
6079
|
-
const [internalActiveId, setInternalActiveId] =
|
|
6080
|
-
const [sheetOpen, setSheetOpen] =
|
|
6482
|
+
const [search, setSearch] = useState19("");
|
|
6483
|
+
const [internalActiveId, setInternalActiveId] = useState19(defaultActiveQuestionId ?? questions[0]?.id);
|
|
6484
|
+
const [sheetOpen, setSheetOpen] = useState19(false);
|
|
6081
6485
|
const isControlled = activeQuestionId !== void 0;
|
|
6082
6486
|
const activeId = isControlled ? activeQuestionId : internalActiveId;
|
|
6083
6487
|
const activeItem = questions.find((item) => item.id === activeId);
|
|
6084
|
-
const filtered =
|
|
6488
|
+
const filtered = useMemo5(() => {
|
|
6085
6489
|
const q = search.trim().toLowerCase();
|
|
6086
6490
|
if (!q) return questions;
|
|
6087
6491
|
return questions.filter((item) => item.question.toLowerCase().includes(q));
|
|
@@ -6102,9 +6506,9 @@ var HelpCenterPage = ({
|
|
|
6102
6506
|
const resolvedTitle = activeItem?.content ? activeItem.contentTitle ?? contentTitle : contentTitle;
|
|
6103
6507
|
const resolvedContent = activeItem?.content ?? content;
|
|
6104
6508
|
const rootClass = ["hcp-section", className ?? ""].filter(Boolean).join(" ");
|
|
6105
|
-
return /* @__PURE__ */
|
|
6106
|
-
/* @__PURE__ */
|
|
6107
|
-
/* @__PURE__ */
|
|
6509
|
+
return /* @__PURE__ */ jsxs48("section", { className: rootClass, children: [
|
|
6510
|
+
/* @__PURE__ */ jsxs48("div", { className: "hcp-container", children: [
|
|
6511
|
+
/* @__PURE__ */ jsx52("div", { className: "hcp-searchWrap", children: /* @__PURE__ */ jsx52(
|
|
6108
6512
|
SearchField,
|
|
6109
6513
|
{
|
|
6110
6514
|
"aria-label": searchAriaLabel ?? searchPlaceholder,
|
|
@@ -6115,12 +6519,12 @@ var HelpCenterPage = ({
|
|
|
6115
6519
|
variant: "outline"
|
|
6116
6520
|
}
|
|
6117
6521
|
) }),
|
|
6118
|
-
/* @__PURE__ */
|
|
6119
|
-
/* @__PURE__ */
|
|
6120
|
-
/* @__PURE__ */
|
|
6121
|
-
filtered.length > 0 ? /* @__PURE__ */
|
|
6522
|
+
/* @__PURE__ */ jsxs48("div", { className: "hcp-body", children: [
|
|
6523
|
+
/* @__PURE__ */ jsx52("aside", { className: "hcp-sidebar", children: /* @__PURE__ */ jsxs48("div", { className: "hcp-sidebarCard", children: [
|
|
6524
|
+
/* @__PURE__ */ jsx52("h2", { className: "hcp-sidebarTitle", children: categoryTitle }),
|
|
6525
|
+
filtered.length > 0 ? /* @__PURE__ */ jsx52("div", { className: "hcp-list", role: "list", children: filtered.map((item) => /* @__PURE__ */ jsx52("div", { className: "hcp-listItem", role: "listitem", children: /* @__PURE__ */ jsx52(QuestionRow, { isActive: item.id === activeId, item, onSelect: handleSelect }) }, item.id)) }) : /* @__PURE__ */ jsx52("p", { className: "hcp-noResults", children: searchNoResultsText.replace("{query}", search) })
|
|
6122
6526
|
] }) }),
|
|
6123
|
-
/* @__PURE__ */
|
|
6527
|
+
/* @__PURE__ */ jsxs48(
|
|
6124
6528
|
"button",
|
|
6125
6529
|
{
|
|
6126
6530
|
"aria-expanded": sheetOpen,
|
|
@@ -6128,20 +6532,439 @@ var HelpCenterPage = ({
|
|
|
6128
6532
|
onClick: () => setSheetOpen(true),
|
|
6129
6533
|
type: "button",
|
|
6130
6534
|
children: [
|
|
6131
|
-
/* @__PURE__ */
|
|
6132
|
-
/* @__PURE__ */
|
|
6535
|
+
/* @__PURE__ */ jsx52("span", { className: "hcp-mobileToggleLabel", children: categoryTitle }),
|
|
6536
|
+
/* @__PURE__ */ jsx52("span", { className: "hcp-mobileToggleChevron", children: /* @__PURE__ */ jsx52(ChevronDownIcon5, {}) })
|
|
6133
6537
|
]
|
|
6134
6538
|
}
|
|
6135
6539
|
),
|
|
6136
|
-
/* @__PURE__ */
|
|
6137
|
-
/* @__PURE__ */
|
|
6138
|
-
/* @__PURE__ */
|
|
6540
|
+
/* @__PURE__ */ jsxs48("div", { className: "hcp-content", children: [
|
|
6541
|
+
/* @__PURE__ */ jsx52("h1", { className: "hcp-contentTitle", children: resolvedTitle }),
|
|
6542
|
+
/* @__PURE__ */ jsx52("div", { className: "hcp-contentBody", children: resolvedContent.map(renderBlock) })
|
|
6139
6543
|
] })
|
|
6140
6544
|
] })
|
|
6141
6545
|
] }),
|
|
6142
|
-
/* @__PURE__ */
|
|
6546
|
+
/* @__PURE__ */ jsx52(BottomSheet, { onClose: () => setSheetOpen(false), open: sheetOpen, title: articlesSheetTitle, children: filtered.length > 0 ? /* @__PURE__ */ jsx52("div", { className: "hcp-sheetList", role: "list", children: filtered.map((item) => /* @__PURE__ */ jsx52("div", { className: "hcp-sheetItem", role: "listitem", children: /* @__PURE__ */ jsx52(QuestionRow, { isActive: item.id === activeId, item, onSelect: handleSelect }) }, item.id)) }) : /* @__PURE__ */ jsx52("p", { className: "hcp-noResults", children: searchNoResultsText.replace("{query}", search) }) })
|
|
6143
6547
|
] });
|
|
6144
6548
|
};
|
|
6549
|
+
|
|
6550
|
+
// templates/FeatureBlogPage/FeatureBlogPage.tsx
|
|
6551
|
+
import { useEffect as useEffect14, useMemo as useMemo6, useState as useState20 } from "react";
|
|
6552
|
+
|
|
6553
|
+
// assets/share-link.png
|
|
6554
|
+
var share_link_default = "./share-link-QGD6KIDA.png";
|
|
6555
|
+
|
|
6556
|
+
// assets/share-facebook.png
|
|
6557
|
+
var share_facebook_default = "./share-facebook-3B3NOC5Q.png";
|
|
6558
|
+
|
|
6559
|
+
// assets/share-x.png
|
|
6560
|
+
var share_x_default = "./share-x-UTEBBL73.png";
|
|
6561
|
+
|
|
6562
|
+
// assets/share-telegram.png
|
|
6563
|
+
var share_telegram_default = "./share-telegram-QRXGSHQT.png";
|
|
6564
|
+
|
|
6565
|
+
// assets/share-linkedin.png
|
|
6566
|
+
var share_linkedin_default = "./share-linkedin-UCIII3JU.png";
|
|
6567
|
+
|
|
6568
|
+
// templates/FeatureBlogPage/FeatureBlogPage.tsx
|
|
6569
|
+
import { jsx as jsx53, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
6570
|
+
var ChevronDownIcon6 = () => /* @__PURE__ */ jsx53("svg", { "aria-hidden": "true", fill: "none", height: "16", viewBox: "0 0 16 16", width: "16", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx53("path", { d: "M4 6l4 4 4-4", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5" }) });
|
|
6571
|
+
var CheckIcon3 = () => /* @__PURE__ */ jsx53("svg", { "aria-hidden": "true", fill: "none", height: "18", viewBox: "0 0 16 16", width: "18", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx53("path", { d: "M3.5 8.5l3 3 6-7", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.6" }) });
|
|
6572
|
+
var SHARE_ICONS = {
|
|
6573
|
+
facebook: { src: share_facebook_default, alt: "Facebook" },
|
|
6574
|
+
twitter: { src: share_x_default, alt: "X" },
|
|
6575
|
+
linkedin: { src: share_linkedin_default, alt: "LinkedIn" },
|
|
6576
|
+
telegram: { src: share_telegram_default, alt: "Telegram" }
|
|
6577
|
+
};
|
|
6578
|
+
var LABELS = {
|
|
6579
|
+
facebook: "Share on Facebook",
|
|
6580
|
+
twitter: "Share on X",
|
|
6581
|
+
linkedin: "Share on LinkedIn",
|
|
6582
|
+
telegram: "Share on Telegram"
|
|
6583
|
+
};
|
|
6584
|
+
var slugify = (text) => text.toLowerCase().trim().replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
6585
|
+
function shareHref(platform, url, text) {
|
|
6586
|
+
const encodedUrl = encodeURIComponent(url);
|
|
6587
|
+
const encodedText = encodeURIComponent(text);
|
|
6588
|
+
switch (platform) {
|
|
6589
|
+
case "facebook":
|
|
6590
|
+
return `https://www.facebook.com/sharer/sharer.php?u=${encodedUrl}`;
|
|
6591
|
+
case "twitter":
|
|
6592
|
+
return `https://twitter.com/intent/tweet?url=${encodedUrl}&text=${encodedText}`;
|
|
6593
|
+
case "linkedin":
|
|
6594
|
+
return `https://www.linkedin.com/sharing/share-offsite/?url=${encodedUrl}`;
|
|
6595
|
+
case "telegram":
|
|
6596
|
+
return `https://t.me/share/url?url=${encodedUrl}&text=${encodedText}`;
|
|
6597
|
+
}
|
|
6598
|
+
}
|
|
6599
|
+
var TocCard = ({
|
|
6600
|
+
tocTitle,
|
|
6601
|
+
headings,
|
|
6602
|
+
activeId,
|
|
6603
|
+
defaultOpen,
|
|
6604
|
+
onNavigate,
|
|
6605
|
+
idSuffix,
|
|
6606
|
+
collapsible
|
|
6607
|
+
}) => {
|
|
6608
|
+
const [open, setOpen] = useState20(defaultOpen);
|
|
6609
|
+
const panelId = `fbp-toc-panel-${idSuffix}`;
|
|
6610
|
+
const isOpen = collapsible ? open : true;
|
|
6611
|
+
const list = /* @__PURE__ */ jsx53("ol", { className: "fbp-tocList", id: panelId, children: headings.map((heading) => /* @__PURE__ */ jsx53("li", { className: "fbp-tocItem", children: /* @__PURE__ */ jsx53(
|
|
6612
|
+
"a",
|
|
6613
|
+
{
|
|
6614
|
+
"aria-current": activeId === heading.id ? "location" : void 0,
|
|
6615
|
+
className: ["fbp-tocLink", activeId === heading.id ? "fbp-tocLink--active" : ""].filter(Boolean).join(" "),
|
|
6616
|
+
href: `#${heading.id}`,
|
|
6617
|
+
onClick: (e) => {
|
|
6618
|
+
e.preventDefault();
|
|
6619
|
+
onNavigate(heading.id);
|
|
6620
|
+
},
|
|
6621
|
+
children: heading.text
|
|
6622
|
+
}
|
|
6623
|
+
) }, heading.id)) });
|
|
6624
|
+
return /* @__PURE__ */ jsxs49("div", { className: "fbp-tocCard", children: [
|
|
6625
|
+
collapsible ? /* @__PURE__ */ jsxs49(
|
|
6626
|
+
"button",
|
|
6627
|
+
{
|
|
6628
|
+
"aria-controls": panelId,
|
|
6629
|
+
"aria-expanded": isOpen,
|
|
6630
|
+
className: "fbp-tocHeader fbp-tocHeader--button",
|
|
6631
|
+
onClick: () => setOpen((prev) => !prev),
|
|
6632
|
+
type: "button",
|
|
6633
|
+
children: [
|
|
6634
|
+
/* @__PURE__ */ jsx53("span", { className: "fbp-tocTitle", children: tocTitle }),
|
|
6635
|
+
/* @__PURE__ */ jsx53("span", { className: ["fbp-tocChevron", isOpen ? "fbp-tocChevron--open" : ""].filter(Boolean).join(" "), children: /* @__PURE__ */ jsx53(ChevronDownIcon6, {}) })
|
|
6636
|
+
]
|
|
6637
|
+
}
|
|
6638
|
+
) : /* @__PURE__ */ jsx53("div", { className: "fbp-tocHeader", children: /* @__PURE__ */ jsx53("span", { className: "fbp-tocTitle", children: tocTitle }) }),
|
|
6639
|
+
isOpen && list
|
|
6640
|
+
] });
|
|
6641
|
+
};
|
|
6642
|
+
var ShareRow = ({
|
|
6643
|
+
shareTitle,
|
|
6644
|
+
shareUrl,
|
|
6645
|
+
shareText,
|
|
6646
|
+
platforms,
|
|
6647
|
+
onShare,
|
|
6648
|
+
copiedLabel
|
|
6649
|
+
}) => {
|
|
6650
|
+
const [copied, setCopied] = useState20(false);
|
|
6651
|
+
const handleCopy = async () => {
|
|
6652
|
+
onShare?.("copy");
|
|
6653
|
+
try {
|
|
6654
|
+
if (typeof navigator !== "undefined" && navigator.clipboard?.writeText) {
|
|
6655
|
+
await navigator.clipboard.writeText(shareUrl);
|
|
6656
|
+
setCopied(true);
|
|
6657
|
+
window.setTimeout(() => setCopied(false), 2e3);
|
|
6658
|
+
}
|
|
6659
|
+
} catch {
|
|
6660
|
+
}
|
|
6661
|
+
};
|
|
6662
|
+
return /* @__PURE__ */ jsxs49("div", { className: "fbp-shareCard", children: [
|
|
6663
|
+
/* @__PURE__ */ jsx53("span", { className: "fbp-shareTitle", children: shareTitle }),
|
|
6664
|
+
/* @__PURE__ */ jsxs49("div", { className: "fbp-shareIcons", children: [
|
|
6665
|
+
/* @__PURE__ */ jsx53(
|
|
6666
|
+
"button",
|
|
6667
|
+
{
|
|
6668
|
+
"aria-label": copied ? copiedLabel : "Copy link",
|
|
6669
|
+
className: "fbp-shareIcon",
|
|
6670
|
+
onClick: handleCopy,
|
|
6671
|
+
type: "button",
|
|
6672
|
+
children: copied ? /* @__PURE__ */ jsx53(CheckIcon3, {}) : /* @__PURE__ */ jsx53("img", { alt: "", className: "fbp-shareIconImg", src: share_link_default })
|
|
6673
|
+
}
|
|
6674
|
+
),
|
|
6675
|
+
platforms.map((platform) => {
|
|
6676
|
+
const icon = SHARE_ICONS[platform];
|
|
6677
|
+
return /* @__PURE__ */ jsx53(
|
|
6678
|
+
"a",
|
|
6679
|
+
{
|
|
6680
|
+
"aria-label": LABELS[platform],
|
|
6681
|
+
className: "fbp-shareIcon",
|
|
6682
|
+
href: shareHref(platform, shareUrl, shareText),
|
|
6683
|
+
onClick: () => onShare?.(platform),
|
|
6684
|
+
rel: "noopener noreferrer",
|
|
6685
|
+
target: "_blank",
|
|
6686
|
+
children: /* @__PURE__ */ jsx53("img", { alt: "", className: "fbp-shareIconImg", src: icon.src })
|
|
6687
|
+
},
|
|
6688
|
+
platform
|
|
6689
|
+
);
|
|
6690
|
+
})
|
|
6691
|
+
] })
|
|
6692
|
+
] });
|
|
6693
|
+
};
|
|
6694
|
+
var renderBlock2 = (block, index, headingIds) => {
|
|
6695
|
+
if (block.type === "heading") {
|
|
6696
|
+
const level = block.level ?? 2;
|
|
6697
|
+
const HeadingTag = level === 3 ? "h3" : "h2";
|
|
6698
|
+
const headingClass = level === 3 ? "fbp-blockHeading fbp-blockHeading--h3" : "fbp-blockHeading";
|
|
6699
|
+
return /* @__PURE__ */ jsx53(HeadingTag, { className: headingClass, id: headingIds.get(index), children: block.text }, index);
|
|
6700
|
+
}
|
|
6701
|
+
if (block.type === "list") {
|
|
6702
|
+
const ListTag = block.ordered ? "ol" : "ul";
|
|
6703
|
+
return /* @__PURE__ */ jsx53(ListTag, { className: "fbp-blockList", children: (block.items ?? []).map((item, i) => /* @__PURE__ */ jsx53("li", { className: "fbp-blockListItem", children: item }, i)) }, index);
|
|
6704
|
+
}
|
|
6705
|
+
if (block.type === "quote") {
|
|
6706
|
+
return /* @__PURE__ */ jsxs49("blockquote", { className: "fbp-blockQuote", children: [
|
|
6707
|
+
/* @__PURE__ */ jsx53("p", { className: "fbp-blockQuoteText", children: block.text }),
|
|
6708
|
+
block.cite && /* @__PURE__ */ jsx53("cite", { className: "fbp-blockQuoteCite", children: block.cite })
|
|
6709
|
+
] }, index);
|
|
6710
|
+
}
|
|
6711
|
+
if (block.type === "image") {
|
|
6712
|
+
return /* @__PURE__ */ jsxs49("figure", { className: "fbp-blockImageWrap", children: [
|
|
6713
|
+
/* @__PURE__ */ jsx53("img", { alt: block.imageAlt ?? "", className: "fbp-blockImage", src: block.image }),
|
|
6714
|
+
block.caption && /* @__PURE__ */ jsx53("figcaption", { className: "fbp-blockCaption", children: block.caption })
|
|
6715
|
+
] }, index);
|
|
6716
|
+
}
|
|
6717
|
+
return /* @__PURE__ */ jsx53("p", { className: "fbp-blockParagraph", children: block.text }, index);
|
|
6718
|
+
};
|
|
6719
|
+
var FeatureBlogPage = ({
|
|
6720
|
+
category,
|
|
6721
|
+
title,
|
|
6722
|
+
publishDate,
|
|
6723
|
+
author,
|
|
6724
|
+
heroImage,
|
|
6725
|
+
heroImageAlt,
|
|
6726
|
+
content,
|
|
6727
|
+
tocTitle = "Contents",
|
|
6728
|
+
tocDefaultOpen = true,
|
|
6729
|
+
hideToc = false,
|
|
6730
|
+
shareTitle = "Share article",
|
|
6731
|
+
shareUrl,
|
|
6732
|
+
shareText,
|
|
6733
|
+
sharePlatforms = ["facebook", "twitter", "telegram", "linkedin"],
|
|
6734
|
+
hideShare = false,
|
|
6735
|
+
onShare,
|
|
6736
|
+
copiedLabel = "Copied!",
|
|
6737
|
+
className
|
|
6738
|
+
}) => {
|
|
6739
|
+
const headingIds = useMemo6(() => {
|
|
6740
|
+
const seen = /* @__PURE__ */ new Map();
|
|
6741
|
+
const ids = /* @__PURE__ */ new Map();
|
|
6742
|
+
content.forEach((block, i) => {
|
|
6743
|
+
if (block.type !== "heading") return;
|
|
6744
|
+
const base = block.id ?? (slugify(block.text ?? "") || `section-${i}`);
|
|
6745
|
+
const count = seen.get(base) ?? 0;
|
|
6746
|
+
seen.set(base, count + 1);
|
|
6747
|
+
ids.set(i, count === 0 ? base : `${base}-${count}`);
|
|
6748
|
+
});
|
|
6749
|
+
return ids;
|
|
6750
|
+
}, [content]);
|
|
6751
|
+
const headings = useMemo6(
|
|
6752
|
+
() => content.map((block, i) => ({ block, i })).filter(({ block }) => block.type === "heading" && (block.level ?? 2) === 2).map(({ block, i }) => ({ id: headingIds.get(i), text: block.text ?? "" })),
|
|
6753
|
+
[content, headingIds]
|
|
6754
|
+
);
|
|
6755
|
+
const [activeId, setActiveId] = useState20(null);
|
|
6756
|
+
useEffect14(() => {
|
|
6757
|
+
if (typeof IntersectionObserver === "undefined" || headings.length === 0) return;
|
|
6758
|
+
const elements = headings.map((heading) => document.getElementById(heading.id)).filter((el) => el !== null);
|
|
6759
|
+
if (elements.length === 0) return;
|
|
6760
|
+
const observer = new IntersectionObserver(
|
|
6761
|
+
(entries) => {
|
|
6762
|
+
const visible = entries.filter((entry) => entry.isIntersecting);
|
|
6763
|
+
if (visible.length === 0) return;
|
|
6764
|
+
const topMost = visible.reduce(
|
|
6765
|
+
(a, b) => a.boundingClientRect.top < b.boundingClientRect.top ? a : b
|
|
6766
|
+
);
|
|
6767
|
+
setActiveId(topMost.target.id);
|
|
6768
|
+
},
|
|
6769
|
+
{ rootMargin: "-112px 0px -70% 0px", threshold: 0 }
|
|
6770
|
+
);
|
|
6771
|
+
elements.forEach((el) => observer.observe(el));
|
|
6772
|
+
return () => observer.disconnect();
|
|
6773
|
+
}, [headings]);
|
|
6774
|
+
const handleNavigate = (id) => {
|
|
6775
|
+
setActiveId(id);
|
|
6776
|
+
const el = document.getElementById(id);
|
|
6777
|
+
if (!el) return;
|
|
6778
|
+
const prefersReducedMotion = typeof window !== "undefined" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
6779
|
+
el.scrollIntoView({ behavior: prefersReducedMotion ? "auto" : "smooth", block: "start" });
|
|
6780
|
+
};
|
|
6781
|
+
const showToc = !hideToc && headings.length > 0;
|
|
6782
|
+
const showShare = !hideShare && Boolean(shareUrl);
|
|
6783
|
+
const resolvedShareText = shareText ?? title;
|
|
6784
|
+
return /* @__PURE__ */ jsx53("section", { className: ["fbp-section", className ?? ""].filter(Boolean).join(" "), children: /* @__PURE__ */ jsxs49("div", { className: "fbp-container", children: [
|
|
6785
|
+
showToc && /* @__PURE__ */ jsx53("div", { className: "fbp-tocMobileWrap", children: /* @__PURE__ */ jsx53(
|
|
6786
|
+
TocCard,
|
|
6787
|
+
{
|
|
6788
|
+
activeId,
|
|
6789
|
+
collapsible: true,
|
|
6790
|
+
defaultOpen: tocDefaultOpen,
|
|
6791
|
+
headings,
|
|
6792
|
+
idSuffix: "mobile",
|
|
6793
|
+
onNavigate: handleNavigate,
|
|
6794
|
+
tocTitle
|
|
6795
|
+
}
|
|
6796
|
+
) }),
|
|
6797
|
+
/* @__PURE__ */ jsxs49("div", { className: "fbp-body", children: [
|
|
6798
|
+
/* @__PURE__ */ jsxs49("div", { className: "fbp-main", children: [
|
|
6799
|
+
/* @__PURE__ */ jsxs49("header", { className: "fbp-header", children: [
|
|
6800
|
+
category && /* @__PURE__ */ jsx53(Tag, { label: category, size: "md", variant: "fill" }),
|
|
6801
|
+
/* @__PURE__ */ jsx53("h1", { className: "fbp-title", children: title }),
|
|
6802
|
+
(publishDate || author) && /* @__PURE__ */ jsxs49("div", { className: "fbp-meta", children: [
|
|
6803
|
+
author && /* @__PURE__ */ jsxs49("span", { className: "fbp-metaAuthor", children: [
|
|
6804
|
+
author.avatar && /* @__PURE__ */ jsx53(
|
|
6805
|
+
"img",
|
|
6806
|
+
{
|
|
6807
|
+
alt: author.avatarAlt ?? "",
|
|
6808
|
+
className: "fbp-avatar",
|
|
6809
|
+
src: author.avatar
|
|
6810
|
+
}
|
|
6811
|
+
),
|
|
6812
|
+
/* @__PURE__ */ jsx53("span", { className: "fbp-authorName", children: author.name })
|
|
6813
|
+
] }),
|
|
6814
|
+
publishDate && /* @__PURE__ */ jsx53("span", { className: "fbp-dateChip", children: publishDate })
|
|
6815
|
+
] })
|
|
6816
|
+
] }),
|
|
6817
|
+
heroImage && /* @__PURE__ */ jsx53("div", { className: "fbp-heroImageWrap", children: /* @__PURE__ */ jsx53("img", { alt: heroImageAlt ?? "", className: "fbp-heroImage", src: heroImage }) }),
|
|
6818
|
+
/* @__PURE__ */ jsx53("div", { className: "fbp-content", children: content.map((block, index) => renderBlock2(block, index, headingIds)) }),
|
|
6819
|
+
showShare && /* @__PURE__ */ jsx53("div", { className: "fbp-shareMobileWrap", children: /* @__PURE__ */ jsx53(
|
|
6820
|
+
ShareRow,
|
|
6821
|
+
{
|
|
6822
|
+
copiedLabel,
|
|
6823
|
+
onShare,
|
|
6824
|
+
platforms: sharePlatforms,
|
|
6825
|
+
shareText: resolvedShareText,
|
|
6826
|
+
shareTitle,
|
|
6827
|
+
shareUrl
|
|
6828
|
+
}
|
|
6829
|
+
) })
|
|
6830
|
+
] }),
|
|
6831
|
+
(showToc || showShare) && /* @__PURE__ */ jsx53("aside", { className: "fbp-sidebar", children: /* @__PURE__ */ jsxs49("div", { className: "fbp-sidebarSticky", children: [
|
|
6832
|
+
showToc && /* @__PURE__ */ jsx53(
|
|
6833
|
+
TocCard,
|
|
6834
|
+
{
|
|
6835
|
+
activeId,
|
|
6836
|
+
collapsible: false,
|
|
6837
|
+
defaultOpen: tocDefaultOpen,
|
|
6838
|
+
headings,
|
|
6839
|
+
idSuffix: "desktop",
|
|
6840
|
+
onNavigate: handleNavigate,
|
|
6841
|
+
tocTitle
|
|
6842
|
+
}
|
|
6843
|
+
),
|
|
6844
|
+
showShare && /* @__PURE__ */ jsx53(
|
|
6845
|
+
ShareRow,
|
|
6846
|
+
{
|
|
6847
|
+
copiedLabel,
|
|
6848
|
+
onShare,
|
|
6849
|
+
platforms: sharePlatforms,
|
|
6850
|
+
shareText: resolvedShareText,
|
|
6851
|
+
shareTitle,
|
|
6852
|
+
shareUrl
|
|
6853
|
+
}
|
|
6854
|
+
)
|
|
6855
|
+
] }) })
|
|
6856
|
+
] })
|
|
6857
|
+
] }) });
|
|
6858
|
+
};
|
|
6859
|
+
|
|
6860
|
+
// templates/ParallaxBanner/ParallaxBanner.tsx
|
|
6861
|
+
import { useRef as useRef17 } from "react";
|
|
6862
|
+
import { motion as motion5, useScroll as useScroll4, useSpring as useSpring3, useTransform as useTransform3, useReducedMotion } from "framer-motion";
|
|
6863
|
+
import { jsx as jsx54, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
6864
|
+
var PARALLAX_BANNER_TEXT_CONTENT = {
|
|
6865
|
+
title: "Our culture",
|
|
6866
|
+
description: "We combine human values with AI precision. Collaboration, integrity, and continuous learning guide every project.",
|
|
6867
|
+
ctaLabel: "Culture at Deriv"
|
|
6868
|
+
};
|
|
6869
|
+
var DEFAULT_CULTURE_CARDS = [
|
|
6870
|
+
{
|
|
6871
|
+
title: "Customer focus",
|
|
6872
|
+
description: "We obsess over customers, prioritising measurable user value and using AI to surface insights and tailor experiences, always keeping human judgment central."
|
|
6873
|
+
},
|
|
6874
|
+
{
|
|
6875
|
+
title: "Integrity",
|
|
6876
|
+
description: "We act with candour and accountability. We make clear trade-offs, give honest feedback, and design our AI and data use with ethics and transparency to build trust."
|
|
6877
|
+
},
|
|
6878
|
+
{
|
|
6879
|
+
title: "Teamwork",
|
|
6880
|
+
description: "We move together in cross-functional teams. We share credit, solve problems collaboratively, and welcome diverse perspectives to deliver better outcomes."
|
|
6881
|
+
},
|
|
6882
|
+
{
|
|
6883
|
+
title: "Competence",
|
|
6884
|
+
description: "We hold high standards and keep learning. We pair deep expertise with pragmatic delivery from prototype to production, and we use AI thoughtfully to amplify judgment and scale impact."
|
|
6885
|
+
}
|
|
6886
|
+
];
|
|
6887
|
+
var PLACEHOLDER_IMAGE4 = "https://cdn.prod.website-files.com/68da5c86c91c54f39c86c28a/69b9309379ac08e59ca8210a_1f3f555da9a5cbb13a6fe1bf0d5fe1b6_placeholder-image.webp";
|
|
6888
|
+
var PARALLAX_PX = 36;
|
|
6889
|
+
var PARALLAX_SPRING = { stiffness: 90, damping: 26, restDelta: 1e-3 };
|
|
6890
|
+
var ParallaxBanner = ({
|
|
6891
|
+
variant = "default",
|
|
6892
|
+
title = PARALLAX_BANNER_TEXT_CONTENT.title,
|
|
6893
|
+
description = PARALLAX_BANNER_TEXT_CONTENT.description,
|
|
6894
|
+
ctaLabel = PARALLAX_BANNER_TEXT_CONTENT.ctaLabel,
|
|
6895
|
+
ctaHref,
|
|
6896
|
+
onCtaClick,
|
|
6897
|
+
imageUrl = PLACEHOLDER_IMAGE4,
|
|
6898
|
+
imageAlt = "",
|
|
6899
|
+
cards = DEFAULT_CULTURE_CARDS,
|
|
6900
|
+
enableParallax = true,
|
|
6901
|
+
className,
|
|
6902
|
+
...props
|
|
6903
|
+
}) => {
|
|
6904
|
+
const sectionRef = useRef17(null);
|
|
6905
|
+
const prefersReducedMotion = useReducedMotion();
|
|
6906
|
+
const parallaxActive = enableParallax && !prefersReducedMotion;
|
|
6907
|
+
const showCards = variant !== "banner-only" && cards.length > 0;
|
|
6908
|
+
const { scrollYProgress } = useScroll4({
|
|
6909
|
+
target: sectionRef,
|
|
6910
|
+
offset: ["start end", "end start"]
|
|
6911
|
+
});
|
|
6912
|
+
const smoothProgress = useSpring3(scrollYProgress, PARALLAX_SPRING);
|
|
6913
|
+
const parallaxY = useTransform3(smoothProgress, [0, 1], [-PARALLAX_PX, PARALLAX_PX]);
|
|
6914
|
+
return /* @__PURE__ */ jsx54(
|
|
6915
|
+
"section",
|
|
6916
|
+
{
|
|
6917
|
+
ref: sectionRef,
|
|
6918
|
+
className: [
|
|
6919
|
+
"parallax-banner",
|
|
6920
|
+
variant === "banner-only" ? "parallax-banner--banner-only" : "",
|
|
6921
|
+
className
|
|
6922
|
+
].filter(Boolean).join(" "),
|
|
6923
|
+
...props,
|
|
6924
|
+
children: /* @__PURE__ */ jsxs50("div", { className: "parallax-banner__inner", children: [
|
|
6925
|
+
/* @__PURE__ */ jsxs50("div", { className: "parallax-banner__card", children: [
|
|
6926
|
+
/* @__PURE__ */ jsxs50("div", { className: "parallax-banner__content", children: [
|
|
6927
|
+
/* @__PURE__ */ jsx54("h2", { className: "parallax-banner__title", children: title }),
|
|
6928
|
+
description && /* @__PURE__ */ jsx54("p", { className: "parallax-banner__description", children: description }),
|
|
6929
|
+
ctaLabel && /* @__PURE__ */ jsx54("div", { className: "parallax-banner__actions", children: /* @__PURE__ */ jsx54(
|
|
6930
|
+
Link,
|
|
6931
|
+
{
|
|
6932
|
+
colorScheme: "white",
|
|
6933
|
+
label: ctaLabel,
|
|
6934
|
+
href: ctaHref,
|
|
6935
|
+
onClick: onCtaClick,
|
|
6936
|
+
showChevron: true,
|
|
6937
|
+
className: "parallax-banner__cta-link"
|
|
6938
|
+
}
|
|
6939
|
+
) })
|
|
6940
|
+
] }),
|
|
6941
|
+
imageUrl && /* @__PURE__ */ jsx54("div", { className: "parallax-banner__image-wrapper", children: /* @__PURE__ */ jsx54(
|
|
6942
|
+
motion5.img,
|
|
6943
|
+
{
|
|
6944
|
+
src: imageUrl,
|
|
6945
|
+
alt: imageAlt,
|
|
6946
|
+
className: "parallax-banner__image",
|
|
6947
|
+
loading: "lazy",
|
|
6948
|
+
style: parallaxActive ? { y: parallaxY } : void 0
|
|
6949
|
+
}
|
|
6950
|
+
) })
|
|
6951
|
+
] }),
|
|
6952
|
+
showCards && /* @__PURE__ */ jsx54("div", { className: "parallax-banner__cards", role: "list", children: cards.map((card, index) => /* @__PURE__ */ jsxs50(
|
|
6953
|
+
"div",
|
|
6954
|
+
{
|
|
6955
|
+
className: "parallax-banner__card-item",
|
|
6956
|
+
role: "listitem",
|
|
6957
|
+
children: [
|
|
6958
|
+
/* @__PURE__ */ jsx54("h3", { className: "parallax-banner__card-title", children: card.title }),
|
|
6959
|
+
/* @__PURE__ */ jsx54("p", { className: "parallax-banner__card-description", children: card.description })
|
|
6960
|
+
]
|
|
6961
|
+
},
|
|
6962
|
+
`${card.title}-${index}`
|
|
6963
|
+
)) })
|
|
6964
|
+
] })
|
|
6965
|
+
}
|
|
6966
|
+
);
|
|
6967
|
+
};
|
|
6145
6968
|
export {
|
|
6146
6969
|
AVATAR_DATA,
|
|
6147
6970
|
Accordion,
|
|
@@ -6160,14 +6983,20 @@ export {
|
|
|
6160
6983
|
ChipDropdown,
|
|
6161
6984
|
CoralBanner,
|
|
6162
6985
|
DEFAULT_AWARDS,
|
|
6986
|
+
DEFAULT_CULTURE_CARDS,
|
|
6163
6987
|
DayNightTransition,
|
|
6164
6988
|
DotLottieInView,
|
|
6165
6989
|
DownloadBadge,
|
|
6166
6990
|
DownloadBanner,
|
|
6167
6991
|
FEATURE_AWARDS_TEXT_CONTENT,
|
|
6992
|
+
FEATURE_BLOG_CATEGORIES_TEXT_CONTENT,
|
|
6993
|
+
FEATURE_BLOG_TEXT_CONTENT,
|
|
6168
6994
|
FEATURE_SCROLL_DATA,
|
|
6169
6995
|
FaqAccordion,
|
|
6170
6996
|
FeatureAwards,
|
|
6997
|
+
FeatureBlog,
|
|
6998
|
+
FeatureBlogCategories,
|
|
6999
|
+
FeatureBlogPage,
|
|
6171
7000
|
FeatureBullets,
|
|
6172
7001
|
FeatureCards,
|
|
6173
7002
|
FeatureCardsIcon,
|
|
@@ -6184,7 +7013,9 @@ export {
|
|
|
6184
7013
|
Link,
|
|
6185
7014
|
LogoMarquee,
|
|
6186
7015
|
Navbar,
|
|
7016
|
+
PARALLAX_BANNER_TEXT_CONTENT,
|
|
6187
7017
|
Pagination,
|
|
7018
|
+
ParallaxBanner,
|
|
6188
7019
|
PeopleGrid,
|
|
6189
7020
|
STEPS_DATA,
|
|
6190
7021
|
SearchField,
|