@deriv-web-design/ui 0.1.11 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.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
- return /* @__PURE__ */ jsx36("section", { className: "steps", children: /* @__PURE__ */ jsxs32("div", { className: containerClass, children: [
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: [
@@ -6865,6 +6869,9 @@ var renderBlock2 = (block, index, headingIds) => {
6865
6869
  block.caption && /* @__PURE__ */ jsx54("figcaption", { className: "fbp-blockCaption", children: block.caption })
6866
6870
  ] }, index);
6867
6871
  }
6872
+ if (block.type === "steps") {
6873
+ return /* @__PURE__ */ jsx54("div", { className: "fbp-blockSteps", children: /* @__PURE__ */ jsx54(Steps, { embedded: true, steps: block.steps ?? [], title: block.text ?? "", titleId: headingIds.get(index) }) }, index);
6874
+ }
6868
6875
  return /* @__PURE__ */ jsx54("p", { className: "fbp-blockParagraph", children: block.text }, index);
6869
6876
  };
6870
6877
  var FeatureBlogPage = ({
@@ -6891,7 +6898,7 @@ var FeatureBlogPage = ({
6891
6898
  const seen = /* @__PURE__ */ new Map();
6892
6899
  const ids = /* @__PURE__ */ new Map();
6893
6900
  content.forEach((block, i) => {
6894
- if (block.type !== "heading") return;
6901
+ if (block.type !== "heading" && block.type !== "steps") return;
6895
6902
  const base = block.id ?? (slugify(block.text ?? "") || `section-${i}`);
6896
6903
  const count = seen.get(base) ?? 0;
6897
6904
  seen.set(base, count + 1);
@@ -6900,7 +6907,9 @@ var FeatureBlogPage = ({
6900
6907
  return ids;
6901
6908
  }, [content]);
6902
6909
  const headings = useMemo6(
6903
- () => 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 ?? "" })),
6910
+ () => content.map((block, i) => ({ block, i })).filter(
6911
+ ({ block }) => block.type === "steps" || block.type === "heading" && (block.level ?? 2) === 2
6912
+ ).map(({ block, i }) => ({ id: headingIds.get(i), text: block.text ?? "" })),
6904
6913
  [content, headingIds]
6905
6914
  );
6906
6915
  const [activeId, setActiveId] = useState20(null);