@deriv-web-design/ui 0.1.12 → 0.1.14
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 +19 -1
- package/components.manifest.json +18 -2
- package/dist/index.css +87 -46
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +26 -4
- package/dist/index.d.ts +26 -4
- package/dist/index.js +16 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.mjs
CHANGED
|
@@ -4619,13 +4619,17 @@ var Steps = ({
|
|
|
4619
4619
|
steps,
|
|
4620
4620
|
image,
|
|
4621
4621
|
imageAlt = "",
|
|
4622
|
-
imagePosition = "left"
|
|
4622
|
+
imagePosition = "left",
|
|
4623
|
+
embedded = false,
|
|
4624
|
+
titleId
|
|
4623
4625
|
}) => {
|
|
4624
4626
|
const containerClass = [
|
|
4625
4627
|
"steps__container",
|
|
4626
4628
|
imagePosition === "right" ? "steps__container--image-right" : ""
|
|
4627
4629
|
].filter(Boolean).join(" ");
|
|
4628
|
-
|
|
4630
|
+
const wrapperClass = ["steps", embedded ? "steps--embedded" : ""].filter(Boolean).join(" ");
|
|
4631
|
+
const Wrapper = embedded ? "div" : "section";
|
|
4632
|
+
return /* @__PURE__ */ jsx36(Wrapper, { className: wrapperClass, children: /* @__PURE__ */ jsxs32("div", { className: containerClass, children: [
|
|
4629
4633
|
image && /* @__PURE__ */ jsx36("div", { className: "steps__image-wrapper", children: /* @__PURE__ */ jsx36(
|
|
4630
4634
|
"img",
|
|
4631
4635
|
{
|
|
@@ -4635,7 +4639,7 @@ var Steps = ({
|
|
|
4635
4639
|
}
|
|
4636
4640
|
) }),
|
|
4637
4641
|
/* @__PURE__ */ jsxs32("div", { className: "steps__content", children: [
|
|
4638
|
-
/* @__PURE__ */ jsx36("h2", { className: "steps__title", children: title }),
|
|
4642
|
+
/* @__PURE__ */ jsx36("h2", { className: "steps__title", id: titleId, children: title }),
|
|
4639
4643
|
/* @__PURE__ */ jsx36("ol", { className: "steps__list", children: steps.map((step, index) => /* @__PURE__ */ jsx36("li", { className: "steps__item", children: /* @__PURE__ */ jsxs32("div", { className: "steps__item-inner", children: [
|
|
4640
4644
|
/* @__PURE__ */ jsx36("span", { className: "steps__number", "aria-hidden": "true", children: index + 1 }),
|
|
4641
4645
|
/* @__PURE__ */ jsxs32("div", { className: "steps__item-body", children: [
|
|
@@ -5504,13 +5508,8 @@ var TrustpilotTestimonial = ({
|
|
|
5504
5508
|
"button",
|
|
5505
5509
|
{
|
|
5506
5510
|
type: "button",
|
|
5507
|
-
className:
|
|
5508
|
-
"testimonial__tp-nav-btn",
|
|
5509
|
-
!canPrev ? "testimonial__tp-nav-btn--hidden" : ""
|
|
5510
|
-
].filter(Boolean).join(" "),
|
|
5511
|
+
className: "testimonial__tp-nav-btn",
|
|
5511
5512
|
"aria-label": "Show previous testimonials",
|
|
5512
|
-
"aria-hidden": !canPrev,
|
|
5513
|
-
tabIndex: canPrev ? 0 : -1,
|
|
5514
5513
|
disabled: !canPrev,
|
|
5515
5514
|
onClick: () => scrollByCard(-1),
|
|
5516
5515
|
children: /* @__PURE__ */ jsx44(ArrowIcon, { direction: "prev" })
|
|
@@ -5520,13 +5519,8 @@ var TrustpilotTestimonial = ({
|
|
|
5520
5519
|
"button",
|
|
5521
5520
|
{
|
|
5522
5521
|
type: "button",
|
|
5523
|
-
className:
|
|
5524
|
-
"testimonial__tp-nav-btn",
|
|
5525
|
-
!canNext ? "testimonial__tp-nav-btn--hidden" : ""
|
|
5526
|
-
].filter(Boolean).join(" "),
|
|
5522
|
+
className: "testimonial__tp-nav-btn",
|
|
5527
5523
|
"aria-label": "Show next testimonials",
|
|
5528
|
-
"aria-hidden": !canNext,
|
|
5529
|
-
tabIndex: canNext ? 0 : -1,
|
|
5530
5524
|
disabled: !canNext,
|
|
5531
5525
|
onClick: () => scrollByCard(1),
|
|
5532
5526
|
children: /* @__PURE__ */ jsx44(ArrowIcon, { direction: "next" })
|
|
@@ -6865,6 +6859,9 @@ var renderBlock2 = (block, index, headingIds) => {
|
|
|
6865
6859
|
block.caption && /* @__PURE__ */ jsx54("figcaption", { className: "fbp-blockCaption", children: block.caption })
|
|
6866
6860
|
] }, index);
|
|
6867
6861
|
}
|
|
6862
|
+
if (block.type === "steps") {
|
|
6863
|
+
return /* @__PURE__ */ jsx54("div", { className: "fbp-blockSteps", children: /* @__PURE__ */ jsx54(Steps, { embedded: true, steps: block.steps ?? [], title: block.text ?? "", titleId: headingIds.get(index) }) }, index);
|
|
6864
|
+
}
|
|
6868
6865
|
return /* @__PURE__ */ jsx54("p", { className: "fbp-blockParagraph", children: block.text }, index);
|
|
6869
6866
|
};
|
|
6870
6867
|
var FeatureBlogPage = ({
|
|
@@ -6891,7 +6888,7 @@ var FeatureBlogPage = ({
|
|
|
6891
6888
|
const seen = /* @__PURE__ */ new Map();
|
|
6892
6889
|
const ids = /* @__PURE__ */ new Map();
|
|
6893
6890
|
content.forEach((block, i) => {
|
|
6894
|
-
if (block.type !== "heading") return;
|
|
6891
|
+
if (block.type !== "heading" && block.type !== "steps") return;
|
|
6895
6892
|
const base = block.id ?? (slugify(block.text ?? "") || `section-${i}`);
|
|
6896
6893
|
const count = seen.get(base) ?? 0;
|
|
6897
6894
|
seen.set(base, count + 1);
|
|
@@ -6900,7 +6897,9 @@ var FeatureBlogPage = ({
|
|
|
6900
6897
|
return ids;
|
|
6901
6898
|
}, [content]);
|
|
6902
6899
|
const headings = useMemo6(
|
|
6903
|
-
() => content.map((block, i) => ({ block, i })).filter(
|
|
6900
|
+
() => content.map((block, i) => ({ block, i })).filter(
|
|
6901
|
+
({ block }) => block.type === "steps" || block.type === "heading" && (block.level ?? 2) === 2
|
|
6902
|
+
).map(({ block, i }) => ({ id: headingIds.get(i), text: block.text ?? "" })),
|
|
6904
6903
|
[content, headingIds]
|
|
6905
6904
|
);
|
|
6906
6905
|
const [activeId, setActiveId] = useState20(null);
|