@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.d.mts CHANGED
@@ -1083,9 +1083,23 @@ interface StepsProps {
1083
1083
  * On mobile the image always stacks above the content.
1084
1084
  */
1085
1085
  imagePosition?: StepsImagePosition;
1086
+ /**
1087
+ * Render without the standalone page-section shell (no section
1088
+ * background, no section-level block padding, and a `<div>` instead of
1089
+ * a `<section>` landmark) for embedding inline inside another
1090
+ * template's content flow, e.g. `FeatureBlogPage`'s article body
1091
+ * (default: false).
1092
+ */
1093
+ embedded?: boolean;
1094
+ /**
1095
+ * Anchor id applied to the title `<h2>` instead of the section wrapper —
1096
+ * lets an embedding parent (e.g. a table of contents) scroll-target the
1097
+ * heading itself.
1098
+ */
1099
+ titleId?: string;
1086
1100
  }
1087
1101
 
1088
- declare const Steps: ({ title, steps, image, imageAlt, imagePosition, }: StepsProps) => react_jsx_runtime.JSX.Element;
1102
+ declare const Steps: ({ title, steps, image, imageAlt, imagePosition, embedded, titleId, }: StepsProps) => react_jsx_runtime.JSX.Element;
1089
1103
 
1090
1104
  type DownloadBannerStyle = "light" | "light-2" | "dark";
1091
1105
  interface DownloadBannerProps {
@@ -1756,11 +1770,17 @@ interface HelpCenterPageProps {
1756
1770
 
1757
1771
  declare const HelpCenterPage: ({ categoryTitle, questions, activeQuestionId, defaultActiveQuestionId, onQuestionSelect, contentTitle, content, searchPlaceholder, searchAriaLabel, onSearchChange, searchNoResultsText, articlesSheetTitle, className, }: HelpCenterPageProps) => react_jsx_runtime.JSX.Element;
1758
1772
 
1759
- type FeatureBlogContentBlockType = "heading" | "paragraph" | "list" | "quote" | "image";
1773
+ type FeatureBlogContentBlockType = "heading" | "paragraph" | "list" | "quote" | "image" | "steps";
1774
+ interface FeatureBlogStepItem {
1775
+ /** Step title */
1776
+ title: string;
1777
+ /** Step body copy */
1778
+ description: string;
1779
+ }
1760
1780
  interface FeatureBlogContentBlock {
1761
- /** Block kind — "heading"/"paragraph"/"quote" use `text`, "list" uses `items`, "image" uses `image` */
1781
+ /** Block kind — "heading"/"paragraph"/"quote" use `text`, "list" uses `items`, "image" uses `image`, "steps" uses `text` (section title) + `steps` */
1762
1782
  type: FeatureBlogContentBlockType;
1763
- /** Text content for "heading" / "paragraph" / "quote" blocks */
1783
+ /** Text content for "heading" / "paragraph" / "quote" blocks; section title for "steps" blocks */
1764
1784
  text?: string;
1765
1785
  /**
1766
1786
  * Heading level for "heading" blocks (default: 2). Only level-2 headings
@@ -1781,6 +1801,8 @@ interface FeatureBlogContentBlock {
1781
1801
  imageAlt?: string;
1782
1802
  /** Optional caption rendered below an "image" block */
1783
1803
  caption?: string;
1804
+ /** Numbered entries for "steps" blocks — rendered via the Steps template */
1805
+ steps?: FeatureBlogStepItem[];
1784
1806
  }
1785
1807
  type FeatureBlogSharePlatform = "facebook" | "twitter" | "linkedin" | "telegram";
1786
1808
  interface FeatureBlogAuthor {
package/dist/index.d.ts CHANGED
@@ -1083,9 +1083,23 @@ interface StepsProps {
1083
1083
  * On mobile the image always stacks above the content.
1084
1084
  */
1085
1085
  imagePosition?: StepsImagePosition;
1086
+ /**
1087
+ * Render without the standalone page-section shell (no section
1088
+ * background, no section-level block padding, and a `<div>` instead of
1089
+ * a `<section>` landmark) for embedding inline inside another
1090
+ * template's content flow, e.g. `FeatureBlogPage`'s article body
1091
+ * (default: false).
1092
+ */
1093
+ embedded?: boolean;
1094
+ /**
1095
+ * Anchor id applied to the title `<h2>` instead of the section wrapper —
1096
+ * lets an embedding parent (e.g. a table of contents) scroll-target the
1097
+ * heading itself.
1098
+ */
1099
+ titleId?: string;
1086
1100
  }
1087
1101
 
1088
- declare const Steps: ({ title, steps, image, imageAlt, imagePosition, }: StepsProps) => react_jsx_runtime.JSX.Element;
1102
+ declare const Steps: ({ title, steps, image, imageAlt, imagePosition, embedded, titleId, }: StepsProps) => react_jsx_runtime.JSX.Element;
1089
1103
 
1090
1104
  type DownloadBannerStyle = "light" | "light-2" | "dark";
1091
1105
  interface DownloadBannerProps {
@@ -1756,11 +1770,17 @@ interface HelpCenterPageProps {
1756
1770
 
1757
1771
  declare const HelpCenterPage: ({ categoryTitle, questions, activeQuestionId, defaultActiveQuestionId, onQuestionSelect, contentTitle, content, searchPlaceholder, searchAriaLabel, onSearchChange, searchNoResultsText, articlesSheetTitle, className, }: HelpCenterPageProps) => react_jsx_runtime.JSX.Element;
1758
1772
 
1759
- type FeatureBlogContentBlockType = "heading" | "paragraph" | "list" | "quote" | "image";
1773
+ type FeatureBlogContentBlockType = "heading" | "paragraph" | "list" | "quote" | "image" | "steps";
1774
+ interface FeatureBlogStepItem {
1775
+ /** Step title */
1776
+ title: string;
1777
+ /** Step body copy */
1778
+ description: string;
1779
+ }
1760
1780
  interface FeatureBlogContentBlock {
1761
- /** Block kind — "heading"/"paragraph"/"quote" use `text`, "list" uses `items`, "image" uses `image` */
1781
+ /** Block kind — "heading"/"paragraph"/"quote" use `text`, "list" uses `items`, "image" uses `image`, "steps" uses `text` (section title) + `steps` */
1762
1782
  type: FeatureBlogContentBlockType;
1763
- /** Text content for "heading" / "paragraph" / "quote" blocks */
1783
+ /** Text content for "heading" / "paragraph" / "quote" blocks; section title for "steps" blocks */
1764
1784
  text?: string;
1765
1785
  /**
1766
1786
  * Heading level for "heading" blocks (default: 2). Only level-2 headings
@@ -1781,6 +1801,8 @@ interface FeatureBlogContentBlock {
1781
1801
  imageAlt?: string;
1782
1802
  /** Optional caption rendered below an "image" block */
1783
1803
  caption?: string;
1804
+ /** Numbered entries for "steps" blocks — rendered via the Steps template */
1805
+ steps?: FeatureBlogStepItem[];
1784
1806
  }
1785
1807
  type FeatureBlogSharePlatform = "facebook" | "twitter" | "linkedin" | "telegram";
1786
1808
  interface FeatureBlogAuthor {
package/dist/index.js CHANGED
@@ -4699,13 +4699,17 @@ var Steps = ({
4699
4699
  steps,
4700
4700
  image,
4701
4701
  imageAlt = "",
4702
- imagePosition = "left"
4702
+ imagePosition = "left",
4703
+ embedded = false,
4704
+ titleId
4703
4705
  }) => {
4704
4706
  const containerClass = [
4705
4707
  "steps__container",
4706
4708
  imagePosition === "right" ? "steps__container--image-right" : ""
4707
4709
  ].filter(Boolean).join(" ");
4708
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("section", { className: "steps", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: containerClass, children: [
4710
+ const wrapperClass = ["steps", embedded ? "steps--embedded" : ""].filter(Boolean).join(" ");
4711
+ const Wrapper = embedded ? "div" : "section";
4712
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Wrapper, { className: wrapperClass, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: containerClass, children: [
4709
4713
  image && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "steps__image-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
4710
4714
  "img",
4711
4715
  {
@@ -4715,7 +4719,7 @@ var Steps = ({
4715
4719
  }
4716
4720
  ) }),
4717
4721
  /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "steps__content", children: [
4718
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("h2", { className: "steps__title", children: title }),
4722
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("h2", { className: "steps__title", id: titleId, children: title }),
4719
4723
  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("ol", { className: "steps__list", children: steps.map((step, index) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("li", { className: "steps__item", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "steps__item-inner", children: [
4720
4724
  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "steps__number", "aria-hidden": "true", children: index + 1 }),
4721
4725
  /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "steps__item-body", children: [
@@ -6945,6 +6949,9 @@ var renderBlock2 = (block, index, headingIds) => {
6945
6949
  block.caption && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("figcaption", { className: "fbp-blockCaption", children: block.caption })
6946
6950
  ] }, index);
6947
6951
  }
6952
+ if (block.type === "steps") {
6953
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "fbp-blockSteps", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Steps, { embedded: true, steps: block.steps ?? [], title: block.text ?? "", titleId: headingIds.get(index) }) }, index);
6954
+ }
6948
6955
  return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "fbp-blockParagraph", children: block.text }, index);
6949
6956
  };
6950
6957
  var FeatureBlogPage = ({
@@ -6971,7 +6978,7 @@ var FeatureBlogPage = ({
6971
6978
  const seen = /* @__PURE__ */ new Map();
6972
6979
  const ids = /* @__PURE__ */ new Map();
6973
6980
  content.forEach((block, i) => {
6974
- if (block.type !== "heading") return;
6981
+ if (block.type !== "heading" && block.type !== "steps") return;
6975
6982
  const base = block.id ?? (slugify(block.text ?? "") || `section-${i}`);
6976
6983
  const count = seen.get(base) ?? 0;
6977
6984
  seen.set(base, count + 1);
@@ -6980,7 +6987,9 @@ var FeatureBlogPage = ({
6980
6987
  return ids;
6981
6988
  }, [content]);
6982
6989
  const headings = (0, import_react28.useMemo)(
6983
- () => 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 ?? "" })),
6990
+ () => content.map((block, i) => ({ block, i })).filter(
6991
+ ({ block }) => block.type === "steps" || block.type === "heading" && (block.level ?? 2) === 2
6992
+ ).map(({ block, i }) => ({ id: headingIds.get(i), text: block.text ?? "" })),
6984
6993
  [content, headingIds]
6985
6994
  );
6986
6995
  const [activeId, setActiveId] = (0, import_react28.useState)(null);