@deriv-web-design/ui 0.1.4 → 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 +3237 -140
- package/components.manifest.json +2902 -0
- package/dist/award-leaf-left-HVAB5T5H.png +0 -0
- package/dist/award-leaf-right-WR5I37KI.png +0 -0
- package/dist/index.css +1941 -5
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +494 -13
- package/dist/index.d.ts +494 -13
- package/dist/index.js +1435 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1420 -20
- 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 +21 -5
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";
|
|
@@ -5581,6 +5784,1187 @@ var ArticleSection = ({
|
|
|
5581
5784
|
] })
|
|
5582
5785
|
] });
|
|
5583
5786
|
};
|
|
5787
|
+
|
|
5788
|
+
// templates/CoralBanner/CoralBanner.tsx
|
|
5789
|
+
import { useCallback as useCallback4, useEffect as useEffect13, useRef as useRef16, useState as useState16 } from "react";
|
|
5790
|
+
import { jsx as jsx46, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
5791
|
+
var DEFAULT_SLIDES = [
|
|
5792
|
+
{
|
|
5793
|
+
title: "Section title goes here",
|
|
5794
|
+
description: "Explain how this specific feature helps your user.",
|
|
5795
|
+
primaryButton: { label: "Get started", href: "#" }
|
|
5796
|
+
}
|
|
5797
|
+
];
|
|
5798
|
+
var CORAL_BANNER_DERIV_SLIDES = [
|
|
5799
|
+
{
|
|
5800
|
+
id: "ai-insights",
|
|
5801
|
+
title: "Analyse markets with AI-powered insights",
|
|
5802
|
+
primaryButton: { label: "Explore TradersView", href: "#" }
|
|
5803
|
+
},
|
|
5804
|
+
{
|
|
5805
|
+
id: "join-traders",
|
|
5806
|
+
title: "Join 3M+\nglobal traders",
|
|
5807
|
+
description: "Open an account in minutes and start trading the world's markets \u2014 forex, stocks, indices, and more.",
|
|
5808
|
+
primaryButton: { label: "Trade now", href: "#" }
|
|
5809
|
+
}
|
|
5810
|
+
];
|
|
5811
|
+
var LeftArrowIcon = () => /* @__PURE__ */ jsx46("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ jsx46(
|
|
5812
|
+
"path",
|
|
5813
|
+
{
|
|
5814
|
+
d: "M3.31066 8.75001L9.03033 14.4697L7.96967 15.5303L0.439339 8.00001L7.96967 0.469676L9.03033 1.53034L3.31066 7.25001L15.5 7.25L15.5 8.75L3.31066 8.75001Z",
|
|
5815
|
+
fill: "currentColor"
|
|
5816
|
+
}
|
|
5817
|
+
) });
|
|
5818
|
+
var RightArrowIcon = () => /* @__PURE__ */ jsx46("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ jsx46(
|
|
5819
|
+
"path",
|
|
5820
|
+
{
|
|
5821
|
+
d: "M12.6893 7.25L6.96967 1.53033L8.03033 0.469666L15.5607 8L8.03033 15.5303L6.96967 14.4697L12.6893 8.75H0.5V7.25H12.6893Z",
|
|
5822
|
+
fill: "currentColor"
|
|
5823
|
+
}
|
|
5824
|
+
) });
|
|
5825
|
+
var renderTitleLines = (title) => {
|
|
5826
|
+
const lines = title.split("\n");
|
|
5827
|
+
return lines.map((line, i) => /* @__PURE__ */ jsxs42("span", { children: [
|
|
5828
|
+
line,
|
|
5829
|
+
i < lines.length - 1 && /* @__PURE__ */ jsx46("br", {})
|
|
5830
|
+
] }, i));
|
|
5831
|
+
};
|
|
5832
|
+
var ButtonBlock3 = ({
|
|
5833
|
+
primaryButton,
|
|
5834
|
+
secondaryButton
|
|
5835
|
+
}) => {
|
|
5836
|
+
if (!primaryButton && !secondaryButton) return null;
|
|
5837
|
+
return /* @__PURE__ */ jsxs42("div", { className: "crb__buttons", children: [
|
|
5838
|
+
primaryButton && (primaryButton.href ? /* @__PURE__ */ jsx46("a", { href: primaryButton.href, children: /* @__PURE__ */ jsx46(
|
|
5839
|
+
Button,
|
|
5840
|
+
{
|
|
5841
|
+
colorScheme: "black",
|
|
5842
|
+
variant: "primary",
|
|
5843
|
+
label: primaryButton.label,
|
|
5844
|
+
onClick: primaryButton.onClick
|
|
5845
|
+
}
|
|
5846
|
+
) }) : /* @__PURE__ */ jsx46(
|
|
5847
|
+
Button,
|
|
5848
|
+
{
|
|
5849
|
+
colorScheme: "black",
|
|
5850
|
+
variant: "primary",
|
|
5851
|
+
label: primaryButton.label,
|
|
5852
|
+
onClick: primaryButton.onClick
|
|
5853
|
+
}
|
|
5854
|
+
)),
|
|
5855
|
+
secondaryButton && (secondaryButton.href ? /* @__PURE__ */ jsx46("a", { href: secondaryButton.href, children: /* @__PURE__ */ jsx46(
|
|
5856
|
+
Button,
|
|
5857
|
+
{
|
|
5858
|
+
colorScheme: "white",
|
|
5859
|
+
variant: "secondary",
|
|
5860
|
+
label: secondaryButton.label,
|
|
5861
|
+
onClick: secondaryButton.onClick
|
|
5862
|
+
}
|
|
5863
|
+
) }) : /* @__PURE__ */ jsx46(
|
|
5864
|
+
Button,
|
|
5865
|
+
{
|
|
5866
|
+
colorScheme: "white",
|
|
5867
|
+
variant: "secondary",
|
|
5868
|
+
label: secondaryButton.label,
|
|
5869
|
+
onClick: secondaryButton.onClick
|
|
5870
|
+
}
|
|
5871
|
+
))
|
|
5872
|
+
] });
|
|
5873
|
+
};
|
|
5874
|
+
var SlideContent = ({ slide }) => /* @__PURE__ */ jsxs42("div", { className: "crb__grid", children: [
|
|
5875
|
+
/* @__PURE__ */ jsxs42("div", { className: "crb__content", children: [
|
|
5876
|
+
/* @__PURE__ */ jsx46("h3", { className: "crb__title", children: renderTitleLines(slide.title) }),
|
|
5877
|
+
slide.description && /* @__PURE__ */ jsx46("p", { className: "crb__description", children: slide.description }),
|
|
5878
|
+
/* @__PURE__ */ jsx46(
|
|
5879
|
+
ButtonBlock3,
|
|
5880
|
+
{
|
|
5881
|
+
primaryButton: slide.primaryButton,
|
|
5882
|
+
secondaryButton: slide.secondaryButton
|
|
5883
|
+
}
|
|
5884
|
+
)
|
|
5885
|
+
] }),
|
|
5886
|
+
/* @__PURE__ */ jsx46("div", { className: "crb__spacer", "aria-hidden": "true" })
|
|
5887
|
+
] });
|
|
5888
|
+
var CoralBanner = ({
|
|
5889
|
+
variant = "static",
|
|
5890
|
+
slides,
|
|
5891
|
+
autoplay = true,
|
|
5892
|
+
autoplayDelay = 2e3,
|
|
5893
|
+
transitionDuration = 330,
|
|
5894
|
+
infinite = true,
|
|
5895
|
+
showArrows = true,
|
|
5896
|
+
showDots = true,
|
|
5897
|
+
className,
|
|
5898
|
+
...props
|
|
5899
|
+
}) => {
|
|
5900
|
+
const resolvedSlides = slides && slides.length > 0 ? slides : DEFAULT_SLIDES;
|
|
5901
|
+
const count = resolvedSlides.length;
|
|
5902
|
+
const isCarousel = variant === "carousel" && count > 1;
|
|
5903
|
+
const [activeIndex, setActiveIndex] = useState16(0);
|
|
5904
|
+
const autoplayTimer = useRef16(null);
|
|
5905
|
+
const dragState = useRef16(null);
|
|
5906
|
+
const goTo = useCallback4(
|
|
5907
|
+
(index) => {
|
|
5908
|
+
if (count <= 1) return;
|
|
5909
|
+
const next = infinite ? (index % count + count) % count : Math.max(0, Math.min(index, count - 1));
|
|
5910
|
+
setActiveIndex(next);
|
|
5911
|
+
},
|
|
5912
|
+
[count, infinite]
|
|
5913
|
+
);
|
|
5914
|
+
const goNext = useCallback4(() => goTo(activeIndex + 1), [activeIndex, goTo]);
|
|
5915
|
+
const goPrev = useCallback4(() => goTo(activeIndex - 1), [activeIndex, goTo]);
|
|
5916
|
+
const resetAutoplay = () => {
|
|
5917
|
+
if (autoplayTimer.current) clearTimeout(autoplayTimer.current);
|
|
5918
|
+
};
|
|
5919
|
+
useEffect13(() => {
|
|
5920
|
+
if (!isCarousel || !autoplay) return;
|
|
5921
|
+
autoplayTimer.current = setTimeout(() => {
|
|
5922
|
+
goTo(activeIndex + 1);
|
|
5923
|
+
}, autoplayDelay);
|
|
5924
|
+
return () => resetAutoplay();
|
|
5925
|
+
}, [isCarousel, autoplay, autoplayDelay, activeIndex]);
|
|
5926
|
+
const handlePointerDown = (e) => {
|
|
5927
|
+
if (!isCarousel) return;
|
|
5928
|
+
dragState.current = { startX: e.clientX };
|
|
5929
|
+
};
|
|
5930
|
+
const handlePointerUp = (e) => {
|
|
5931
|
+
if (!isCarousel || !dragState.current) return;
|
|
5932
|
+
const delta = e.clientX - dragState.current.startX;
|
|
5933
|
+
dragState.current = null;
|
|
5934
|
+
const SWIPE_THRESHOLD = 40;
|
|
5935
|
+
if (delta > SWIPE_THRESHOLD) {
|
|
5936
|
+
resetAutoplay();
|
|
5937
|
+
goPrev();
|
|
5938
|
+
} else if (delta < -SWIPE_THRESHOLD) {
|
|
5939
|
+
resetAutoplay();
|
|
5940
|
+
goNext();
|
|
5941
|
+
}
|
|
5942
|
+
};
|
|
5943
|
+
const rootClass = [
|
|
5944
|
+
"crb",
|
|
5945
|
+
isCarousel ? "crb--carousel" : "crb--static",
|
|
5946
|
+
className
|
|
5947
|
+
].filter(Boolean).join(" ");
|
|
5948
|
+
if (!isCarousel) {
|
|
5949
|
+
return /* @__PURE__ */ jsx46("section", { className: rootClass, ...props, children: /* @__PURE__ */ jsx46("div", { className: "crb__inner", children: /* @__PURE__ */ jsx46("div", { className: "crb__stage", children: /* @__PURE__ */ jsx46(SlideContent, { slide: resolvedSlides[0] }) }) }) });
|
|
5950
|
+
}
|
|
5951
|
+
return /* @__PURE__ */ jsx46("section", { className: rootClass, ...props, children: /* @__PURE__ */ jsx46("div", { className: "crb__inner", children: /* @__PURE__ */ jsxs42("div", { className: "crb__stage", children: [
|
|
5952
|
+
/* @__PURE__ */ jsx46(
|
|
5953
|
+
"div",
|
|
5954
|
+
{
|
|
5955
|
+
className: "crb__viewport",
|
|
5956
|
+
onPointerDown: handlePointerDown,
|
|
5957
|
+
onPointerUp: handlePointerUp,
|
|
5958
|
+
children: /* @__PURE__ */ jsx46(
|
|
5959
|
+
"div",
|
|
5960
|
+
{
|
|
5961
|
+
className: "crb__track",
|
|
5962
|
+
style: {
|
|
5963
|
+
transform: `translateX(-${activeIndex * 100}%)`,
|
|
5964
|
+
transitionDuration: `${transitionDuration}ms`
|
|
5965
|
+
},
|
|
5966
|
+
children: resolvedSlides.map((slide, i) => /* @__PURE__ */ jsx46(
|
|
5967
|
+
"div",
|
|
5968
|
+
{
|
|
5969
|
+
className: "crb__slide",
|
|
5970
|
+
role: "group",
|
|
5971
|
+
"aria-roledescription": "slide",
|
|
5972
|
+
"aria-label": `${i + 1} of ${count}`,
|
|
5973
|
+
"aria-hidden": i !== activeIndex,
|
|
5974
|
+
children: /* @__PURE__ */ jsx46(SlideContent, { slide })
|
|
5975
|
+
},
|
|
5976
|
+
slide.id ?? i
|
|
5977
|
+
))
|
|
5978
|
+
}
|
|
5979
|
+
)
|
|
5980
|
+
}
|
|
5981
|
+
),
|
|
5982
|
+
showDots && /* @__PURE__ */ jsx46("div", { className: "crb__dots", role: "tablist", "aria-label": "Banner slide navigation", children: resolvedSlides.map((_, i) => /* @__PURE__ */ jsx46(
|
|
5983
|
+
"button",
|
|
5984
|
+
{
|
|
5985
|
+
type: "button",
|
|
5986
|
+
role: "tab",
|
|
5987
|
+
"aria-selected": i === activeIndex,
|
|
5988
|
+
"aria-label": `Go to slide ${i + 1} of ${count}`,
|
|
5989
|
+
className: [
|
|
5990
|
+
"crb__dot",
|
|
5991
|
+
i === activeIndex ? "crb__dot--active" : ""
|
|
5992
|
+
].filter(Boolean).join(" "),
|
|
5993
|
+
onClick: () => {
|
|
5994
|
+
resetAutoplay();
|
|
5995
|
+
goTo(i);
|
|
5996
|
+
}
|
|
5997
|
+
},
|
|
5998
|
+
i
|
|
5999
|
+
)) }),
|
|
6000
|
+
showArrows && /* @__PURE__ */ jsxs42("div", { className: "crb__arrows", children: [
|
|
6001
|
+
/* @__PURE__ */ jsx46(
|
|
6002
|
+
"button",
|
|
6003
|
+
{
|
|
6004
|
+
type: "button",
|
|
6005
|
+
className: "crb__arrow crb__arrow--prev",
|
|
6006
|
+
"aria-label": "Previous slide",
|
|
6007
|
+
onClick: () => {
|
|
6008
|
+
resetAutoplay();
|
|
6009
|
+
goPrev();
|
|
6010
|
+
},
|
|
6011
|
+
children: /* @__PURE__ */ jsx46(LeftArrowIcon, {})
|
|
6012
|
+
}
|
|
6013
|
+
),
|
|
6014
|
+
/* @__PURE__ */ jsx46(
|
|
6015
|
+
"button",
|
|
6016
|
+
{
|
|
6017
|
+
type: "button",
|
|
6018
|
+
className: "crb__arrow crb__arrow--next",
|
|
6019
|
+
"aria-label": "Next slide",
|
|
6020
|
+
onClick: () => {
|
|
6021
|
+
resetAutoplay();
|
|
6022
|
+
goNext();
|
|
6023
|
+
},
|
|
6024
|
+
children: /* @__PURE__ */ jsx46(RightArrowIcon, {})
|
|
6025
|
+
}
|
|
6026
|
+
)
|
|
6027
|
+
] })
|
|
6028
|
+
] }) }) });
|
|
6029
|
+
};
|
|
6030
|
+
|
|
6031
|
+
// assets/award-leaf-left.png
|
|
6032
|
+
var award_leaf_left_default = "./award-leaf-left-HVAB5T5H.png";
|
|
6033
|
+
|
|
6034
|
+
// assets/award-leaf-right.png
|
|
6035
|
+
var award_leaf_right_default = "./award-leaf-right-WR5I37KI.png";
|
|
6036
|
+
|
|
6037
|
+
// templates/FeatureAwards/FeatureAwards.tsx
|
|
6038
|
+
import { jsx as jsx47, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
6039
|
+
var FEATURE_AWARDS_TEXT_CONTENT = {
|
|
6040
|
+
title: "Our awards"
|
|
6041
|
+
};
|
|
6042
|
+
var DEFAULT_AWARDS = [
|
|
6043
|
+
{ title: "Best Trade Execution Award (MEA)", subtitle: "Ultimate Fintech 2026" },
|
|
6044
|
+
{ title: "Best Trading Experience - Global", subtitle: "UF Awards 2025" },
|
|
6045
|
+
{ title: "Best CFD Broker - LATAM", subtitle: "UF Awards 2025" },
|
|
6046
|
+
{ title: "Most Innovative Broker - MEA", subtitle: "UF Awards 2025" },
|
|
6047
|
+
{ title: "Most Transparent Broker - Global", subtitle: "Global Forex Awards 2025" },
|
|
6048
|
+
{ title: "Best Broker - Africa", subtitle: "Global Forex Awards 2025" },
|
|
6049
|
+
{ title: "Best Trading Platform - MENA", subtitle: "Global Forex Awards 2025" },
|
|
6050
|
+
{ title: "Most Innovative Online Trading Platform", subtitle: "Forex Expo Dubai 2025" },
|
|
6051
|
+
{ title: "Chief Risk & Compliance Officer of the Year", subtitle: "Forex Expo Dubai 2025" },
|
|
6052
|
+
{ title: "Best Broker - APAC", subtitle: "UF Awards 2025" },
|
|
6053
|
+
{ title: "Best Trading Conditions - Global", subtitle: "Finance Magnates 2025" },
|
|
6054
|
+
{ title: "Most Trusted Broker - Middle East", subtitle: "Finance Magnates 2025" },
|
|
6055
|
+
{ title: "Affiliate Program of the Year", subtitle: "Forex Expo Dubai 2024" },
|
|
6056
|
+
{ title: "Best Customer Service - Global", subtitle: "Global Forex Awards 2024" },
|
|
6057
|
+
{ title: "Most Trusted Broker - Africa", subtitle: "Finance Magnates 2024" },
|
|
6058
|
+
{ title: "Best LATAM Region Broker", subtitle: "ADVFN Awards 2024" },
|
|
6059
|
+
{ title: "Broker of the Year - Global", subtitle: "Finance Magnates 2024" }
|
|
6060
|
+
];
|
|
6061
|
+
var LaurelIcon = ({ side }) => /* @__PURE__ */ jsx47(
|
|
6062
|
+
"img",
|
|
6063
|
+
{
|
|
6064
|
+
className: `fa__leaf fa__leaf--${side}`,
|
|
6065
|
+
src: side === "left" ? award_leaf_left_default : award_leaf_right_default,
|
|
6066
|
+
alt: "",
|
|
6067
|
+
"aria-hidden": "true",
|
|
6068
|
+
loading: "lazy",
|
|
6069
|
+
draggable: false
|
|
6070
|
+
}
|
|
6071
|
+
);
|
|
6072
|
+
var AwardBadge2 = ({ award }) => /* @__PURE__ */ jsxs43("div", { className: "fa__item", role: "listitem", children: [
|
|
6073
|
+
/* @__PURE__ */ jsx47(LaurelIcon, { side: "left" }),
|
|
6074
|
+
/* @__PURE__ */ jsxs43("div", { className: "fa__item-text", children: [
|
|
6075
|
+
/* @__PURE__ */ jsx47("p", { className: "fa__item-title", children: award.title }),
|
|
6076
|
+
/* @__PURE__ */ jsx47("p", { className: "fa__item-subtitle", children: award.subtitle })
|
|
6077
|
+
] }),
|
|
6078
|
+
/* @__PURE__ */ jsx47(LaurelIcon, { side: "right" })
|
|
6079
|
+
] });
|
|
6080
|
+
var FeatureAwards = ({
|
|
6081
|
+
title = FEATURE_AWARDS_TEXT_CONTENT.title,
|
|
6082
|
+
awards = DEFAULT_AWARDS,
|
|
6083
|
+
autoScrollDuration = 32,
|
|
6084
|
+
className,
|
|
6085
|
+
...props
|
|
6086
|
+
}) => {
|
|
6087
|
+
if (!awards || awards.length === 0) return null;
|
|
6088
|
+
const trackStyle = {
|
|
6089
|
+
"--fa-duration": `${autoScrollDuration}s`
|
|
6090
|
+
};
|
|
6091
|
+
return /* @__PURE__ */ jsx47(
|
|
6092
|
+
"section",
|
|
6093
|
+
{
|
|
6094
|
+
className: ["fa", className].filter(Boolean).join(" "),
|
|
6095
|
+
...props,
|
|
6096
|
+
children: /* @__PURE__ */ jsxs43("div", { className: "fa__inner", children: [
|
|
6097
|
+
title && /* @__PURE__ */ jsx47("h2", { className: "fa__title", children: title }),
|
|
6098
|
+
/* @__PURE__ */ jsx47("div", { className: "fa__grid", role: "list", children: awards.map((award, i) => /* @__PURE__ */ jsx47(AwardBadge2, { award }, `g-${i}`)) }),
|
|
6099
|
+
/* @__PURE__ */ jsx47("div", { className: "fa__scroller", children: /* @__PURE__ */ jsxs43("div", { className: "fa__track fa__track--auto", style: trackStyle, children: [
|
|
6100
|
+
/* @__PURE__ */ jsx47("div", { className: "fa__track-group", role: "list", children: awards.map((award, i) => /* @__PURE__ */ jsx47(AwardBadge2, { award }, `m-${i}`)) }),
|
|
6101
|
+
/* @__PURE__ */ jsx47(
|
|
6102
|
+
"div",
|
|
6103
|
+
{
|
|
6104
|
+
className: "fa__track-group",
|
|
6105
|
+
role: "presentation",
|
|
6106
|
+
"aria-hidden": "true",
|
|
6107
|
+
children: awards.map((award, i) => /* @__PURE__ */ jsx47(AwardBadge2, { award }, `m-dup-${i}`))
|
|
6108
|
+
}
|
|
6109
|
+
)
|
|
6110
|
+
] }) })
|
|
6111
|
+
] })
|
|
6112
|
+
}
|
|
6113
|
+
);
|
|
6114
|
+
};
|
|
6115
|
+
|
|
6116
|
+
// templates/FeatureBlog/FeatureBlog.tsx
|
|
6117
|
+
import { jsx as jsx48, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
6118
|
+
var externalLinkRel2 = (href) => href && /^https?:\/\//i.test(href) ? "noopener noreferrer" : void 0;
|
|
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(
|
|
6322
|
+
"img",
|
|
6323
|
+
{
|
|
6324
|
+
alt: category.iconAlt ?? "",
|
|
6325
|
+
className: "hcc-tile-iconImage",
|
|
6326
|
+
decoding: "async",
|
|
6327
|
+
height: 48,
|
|
6328
|
+
loading: "lazy",
|
|
6329
|
+
src: category.icon,
|
|
6330
|
+
width: 48
|
|
6331
|
+
}
|
|
6332
|
+
) : category.icon }),
|
|
6333
|
+
/* @__PURE__ */ jsx50("span", { className: "hcc-tile-title", children: category.title })
|
|
6334
|
+
] });
|
|
6335
|
+
var CategoryTile = ({ category }) => {
|
|
6336
|
+
if (category.href) {
|
|
6337
|
+
return /* @__PURE__ */ jsx50(
|
|
6338
|
+
"a",
|
|
6339
|
+
{
|
|
6340
|
+
className: "hcc-tile",
|
|
6341
|
+
href: category.href,
|
|
6342
|
+
onClick: category.onClick,
|
|
6343
|
+
rel: externalLinkRel3(category.href),
|
|
6344
|
+
children: /* @__PURE__ */ jsx50(CategoryTileContent, { category })
|
|
6345
|
+
}
|
|
6346
|
+
);
|
|
6347
|
+
}
|
|
6348
|
+
return /* @__PURE__ */ jsx50("button", { className: "hcc-tile", onClick: category.onClick, type: "button", children: /* @__PURE__ */ jsx50(CategoryTileContent, { category }) });
|
|
6349
|
+
};
|
|
6350
|
+
var getColumnCount = (categoryCount) => Math.max(1, Math.min(categoryCount, 3));
|
|
6351
|
+
var HelpCentreCategories = ({
|
|
6352
|
+
sectionTitle,
|
|
6353
|
+
sectionDescription,
|
|
6354
|
+
categories
|
|
6355
|
+
}) => {
|
|
6356
|
+
const columnCount = getColumnCount(categories.length);
|
|
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 })
|
|
6361
|
+
] }),
|
|
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}`)) })
|
|
6363
|
+
] }) });
|
|
6364
|
+
};
|
|
6365
|
+
|
|
6366
|
+
// templates/HelpCentreSubCategories/HelpCentreSubCategories.tsx
|
|
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;
|
|
6370
|
+
var QuestionCard = ({ item }) => {
|
|
6371
|
+
if (item.href) {
|
|
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 }) });
|
|
6373
|
+
}
|
|
6374
|
+
return /* @__PURE__ */ jsx51("button", { className: "hcsc-card", onClick: item.onClick, type: "button", children: /* @__PURE__ */ jsx51("span", { className: "hcsc-card-text", children: item.question }) });
|
|
6375
|
+
};
|
|
6376
|
+
var HelpCentreSubCategories = ({
|
|
6377
|
+
title,
|
|
6378
|
+
searchPlaceholder = "Search",
|
|
6379
|
+
searchAriaLabel,
|
|
6380
|
+
items,
|
|
6381
|
+
noResultsText = 'No results found for "{query}"',
|
|
6382
|
+
onSearchChange
|
|
6383
|
+
}) => {
|
|
6384
|
+
const [search, setSearch] = useState18("");
|
|
6385
|
+
const filtered = useMemo4(() => {
|
|
6386
|
+
const q = search.trim().toLowerCase();
|
|
6387
|
+
if (!q) return items;
|
|
6388
|
+
return items.filter((item) => item.question.toLowerCase().includes(q));
|
|
6389
|
+
}, [items, search]);
|
|
6390
|
+
const handleSearchChange = (e) => {
|
|
6391
|
+
setSearch(e.target.value);
|
|
6392
|
+
onSearchChange?.(e.target.value);
|
|
6393
|
+
};
|
|
6394
|
+
const handleClear = () => {
|
|
6395
|
+
setSearch("");
|
|
6396
|
+
onSearchChange?.("");
|
|
6397
|
+
};
|
|
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(
|
|
6401
|
+
SearchField,
|
|
6402
|
+
{
|
|
6403
|
+
"aria-label": searchAriaLabel ?? searchPlaceholder,
|
|
6404
|
+
onChange: handleSearchChange,
|
|
6405
|
+
onClear: handleClear,
|
|
6406
|
+
placeholder: searchPlaceholder,
|
|
6407
|
+
value: search,
|
|
6408
|
+
variant: "outline"
|
|
6409
|
+
}
|
|
6410
|
+
) }),
|
|
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) })
|
|
6412
|
+
] }) });
|
|
6413
|
+
};
|
|
6414
|
+
|
|
6415
|
+
// templates/HelpCenterPage/HelpCenterPage.tsx
|
|
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" }) });
|
|
6420
|
+
var renderBlock = (block, index) => {
|
|
6421
|
+
if (block.type === "heading") {
|
|
6422
|
+
const HeadingTag = block.level === 3 ? "h3" : "h2";
|
|
6423
|
+
return /* @__PURE__ */ jsx52(HeadingTag, { className: "hcp-blockHeading", children: block.text }, index);
|
|
6424
|
+
}
|
|
6425
|
+
if (block.type === "list") {
|
|
6426
|
+
const ListTag = block.ordered ? "ol" : "ul";
|
|
6427
|
+
return /* @__PURE__ */ jsx52(ListTag, { className: "hcp-blockList", children: (block.items ?? []).map((item, i) => /* @__PURE__ */ jsx52("li", { className: "hcp-blockListItem", children: item }, i)) }, index);
|
|
6428
|
+
}
|
|
6429
|
+
return /* @__PURE__ */ jsx52("p", { className: "hcp-blockParagraph", children: block.text }, index);
|
|
6430
|
+
};
|
|
6431
|
+
var QuestionRow = ({
|
|
6432
|
+
item,
|
|
6433
|
+
isActive,
|
|
6434
|
+
onSelect
|
|
6435
|
+
}) => {
|
|
6436
|
+
const rowClass = ["hcp-row", isActive ? "hcp-row--active" : ""].filter(Boolean).join(" ");
|
|
6437
|
+
if (item.href) {
|
|
6438
|
+
return /* @__PURE__ */ jsx52(
|
|
6439
|
+
"a",
|
|
6440
|
+
{
|
|
6441
|
+
"aria-current": isActive ? "page" : void 0,
|
|
6442
|
+
className: rowClass,
|
|
6443
|
+
href: item.href,
|
|
6444
|
+
onClick: () => {
|
|
6445
|
+
item.onClick?.();
|
|
6446
|
+
onSelect(item);
|
|
6447
|
+
},
|
|
6448
|
+
rel: externalLinkRel5(item.href),
|
|
6449
|
+
children: /* @__PURE__ */ jsx52("span", { className: "hcp-rowText", children: item.question })
|
|
6450
|
+
}
|
|
6451
|
+
);
|
|
6452
|
+
}
|
|
6453
|
+
return /* @__PURE__ */ jsx52(
|
|
6454
|
+
"button",
|
|
6455
|
+
{
|
|
6456
|
+
"aria-current": isActive ? "page" : void 0,
|
|
6457
|
+
className: rowClass,
|
|
6458
|
+
onClick: () => {
|
|
6459
|
+
item.onClick?.();
|
|
6460
|
+
onSelect(item);
|
|
6461
|
+
},
|
|
6462
|
+
type: "button",
|
|
6463
|
+
children: /* @__PURE__ */ jsx52("span", { className: "hcp-rowText", children: item.question })
|
|
6464
|
+
}
|
|
6465
|
+
);
|
|
6466
|
+
};
|
|
6467
|
+
var HelpCenterPage = ({
|
|
6468
|
+
categoryTitle,
|
|
6469
|
+
questions,
|
|
6470
|
+
activeQuestionId,
|
|
6471
|
+
defaultActiveQuestionId,
|
|
6472
|
+
onQuestionSelect,
|
|
6473
|
+
contentTitle,
|
|
6474
|
+
content,
|
|
6475
|
+
searchPlaceholder = "Search",
|
|
6476
|
+
searchAriaLabel,
|
|
6477
|
+
onSearchChange,
|
|
6478
|
+
searchNoResultsText = 'No results found for "{query}"',
|
|
6479
|
+
articlesSheetTitle = "Articles in this section",
|
|
6480
|
+
className
|
|
6481
|
+
}) => {
|
|
6482
|
+
const [search, setSearch] = useState19("");
|
|
6483
|
+
const [internalActiveId, setInternalActiveId] = useState19(defaultActiveQuestionId ?? questions[0]?.id);
|
|
6484
|
+
const [sheetOpen, setSheetOpen] = useState19(false);
|
|
6485
|
+
const isControlled = activeQuestionId !== void 0;
|
|
6486
|
+
const activeId = isControlled ? activeQuestionId : internalActiveId;
|
|
6487
|
+
const activeItem = questions.find((item) => item.id === activeId);
|
|
6488
|
+
const filtered = useMemo5(() => {
|
|
6489
|
+
const q = search.trim().toLowerCase();
|
|
6490
|
+
if (!q) return questions;
|
|
6491
|
+
return questions.filter((item) => item.question.toLowerCase().includes(q));
|
|
6492
|
+
}, [questions, search]);
|
|
6493
|
+
const handleSearchChange = (e) => {
|
|
6494
|
+
setSearch(e.target.value);
|
|
6495
|
+
onSearchChange?.(e.target.value);
|
|
6496
|
+
};
|
|
6497
|
+
const handleClear = () => {
|
|
6498
|
+
setSearch("");
|
|
6499
|
+
onSearchChange?.("");
|
|
6500
|
+
};
|
|
6501
|
+
const handleSelect = (item) => {
|
|
6502
|
+
if (!isControlled) setInternalActiveId(item.id);
|
|
6503
|
+
onQuestionSelect?.(item.id);
|
|
6504
|
+
setSheetOpen(false);
|
|
6505
|
+
};
|
|
6506
|
+
const resolvedTitle = activeItem?.content ? activeItem.contentTitle ?? contentTitle : contentTitle;
|
|
6507
|
+
const resolvedContent = activeItem?.content ?? content;
|
|
6508
|
+
const rootClass = ["hcp-section", className ?? ""].filter(Boolean).join(" ");
|
|
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(
|
|
6512
|
+
SearchField,
|
|
6513
|
+
{
|
|
6514
|
+
"aria-label": searchAriaLabel ?? searchPlaceholder,
|
|
6515
|
+
onChange: handleSearchChange,
|
|
6516
|
+
onClear: handleClear,
|
|
6517
|
+
placeholder: searchPlaceholder,
|
|
6518
|
+
value: search,
|
|
6519
|
+
variant: "outline"
|
|
6520
|
+
}
|
|
6521
|
+
) }),
|
|
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) })
|
|
6526
|
+
] }) }),
|
|
6527
|
+
/* @__PURE__ */ jsxs48(
|
|
6528
|
+
"button",
|
|
6529
|
+
{
|
|
6530
|
+
"aria-expanded": sheetOpen,
|
|
6531
|
+
className: "hcp-mobileToggle",
|
|
6532
|
+
onClick: () => setSheetOpen(true),
|
|
6533
|
+
type: "button",
|
|
6534
|
+
children: [
|
|
6535
|
+
/* @__PURE__ */ jsx52("span", { className: "hcp-mobileToggleLabel", children: categoryTitle }),
|
|
6536
|
+
/* @__PURE__ */ jsx52("span", { className: "hcp-mobileToggleChevron", children: /* @__PURE__ */ jsx52(ChevronDownIcon5, {}) })
|
|
6537
|
+
]
|
|
6538
|
+
}
|
|
6539
|
+
),
|
|
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) })
|
|
6543
|
+
] })
|
|
6544
|
+
] })
|
|
6545
|
+
] }),
|
|
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) }) })
|
|
6547
|
+
] });
|
|
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
|
+
};
|
|
5584
6968
|
export {
|
|
5585
6969
|
AVATAR_DATA,
|
|
5586
6970
|
Accordion,
|
|
@@ -5592,16 +6976,27 @@ export {
|
|
|
5592
6976
|
Button,
|
|
5593
6977
|
COL_ONE_LOGOS,
|
|
5594
6978
|
COL_TWO_LOGOS,
|
|
6979
|
+
CORAL_BANNER_DERIV_SLIDES,
|
|
5595
6980
|
CTABanner,
|
|
5596
6981
|
Card,
|
|
5597
6982
|
Chip,
|
|
5598
6983
|
ChipDropdown,
|
|
6984
|
+
CoralBanner,
|
|
6985
|
+
DEFAULT_AWARDS,
|
|
6986
|
+
DEFAULT_CULTURE_CARDS,
|
|
5599
6987
|
DayNightTransition,
|
|
5600
6988
|
DotLottieInView,
|
|
5601
6989
|
DownloadBadge,
|
|
5602
6990
|
DownloadBanner,
|
|
6991
|
+
FEATURE_AWARDS_TEXT_CONTENT,
|
|
6992
|
+
FEATURE_BLOG_CATEGORIES_TEXT_CONTENT,
|
|
6993
|
+
FEATURE_BLOG_TEXT_CONTENT,
|
|
5603
6994
|
FEATURE_SCROLL_DATA,
|
|
5604
6995
|
FaqAccordion,
|
|
6996
|
+
FeatureAwards,
|
|
6997
|
+
FeatureBlog,
|
|
6998
|
+
FeatureBlogCategories,
|
|
6999
|
+
FeatureBlogPage,
|
|
5605
7000
|
FeatureBullets,
|
|
5606
7001
|
FeatureCards,
|
|
5607
7002
|
FeatureCardsIcon,
|
|
@@ -5609,13 +7004,18 @@ export {
|
|
|
5609
7004
|
FeatureSplit,
|
|
5610
7005
|
Footer,
|
|
5611
7006
|
Header,
|
|
7007
|
+
HelpCenterPage,
|
|
7008
|
+
HelpCentreCategories,
|
|
7009
|
+
HelpCentreSubCategories,
|
|
5612
7010
|
Hero,
|
|
5613
7011
|
ImageBanner,
|
|
5614
7012
|
Leaders,
|
|
5615
7013
|
Link,
|
|
5616
7014
|
LogoMarquee,
|
|
5617
7015
|
Navbar,
|
|
7016
|
+
PARALLAX_BANNER_TEXT_CONTENT,
|
|
5618
7017
|
Pagination,
|
|
7018
|
+
ParallaxBanner,
|
|
5619
7019
|
PeopleGrid,
|
|
5620
7020
|
STEPS_DATA,
|
|
5621
7021
|
SearchField,
|