@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.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
|
-
|
|
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: [
|
|
@@ -5584,13 +5588,8 @@ var TrustpilotTestimonial = ({
|
|
|
5584
5588
|
"button",
|
|
5585
5589
|
{
|
|
5586
5590
|
type: "button",
|
|
5587
|
-
className:
|
|
5588
|
-
"testimonial__tp-nav-btn",
|
|
5589
|
-
!canPrev ? "testimonial__tp-nav-btn--hidden" : ""
|
|
5590
|
-
].filter(Boolean).join(" "),
|
|
5591
|
+
className: "testimonial__tp-nav-btn",
|
|
5591
5592
|
"aria-label": "Show previous testimonials",
|
|
5592
|
-
"aria-hidden": !canPrev,
|
|
5593
|
-
tabIndex: canPrev ? 0 : -1,
|
|
5594
5593
|
disabled: !canPrev,
|
|
5595
5594
|
onClick: () => scrollByCard(-1),
|
|
5596
5595
|
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ArrowIcon, { direction: "prev" })
|
|
@@ -5600,13 +5599,8 @@ var TrustpilotTestimonial = ({
|
|
|
5600
5599
|
"button",
|
|
5601
5600
|
{
|
|
5602
5601
|
type: "button",
|
|
5603
|
-
className:
|
|
5604
|
-
"testimonial__tp-nav-btn",
|
|
5605
|
-
!canNext ? "testimonial__tp-nav-btn--hidden" : ""
|
|
5606
|
-
].filter(Boolean).join(" "),
|
|
5602
|
+
className: "testimonial__tp-nav-btn",
|
|
5607
5603
|
"aria-label": "Show next testimonials",
|
|
5608
|
-
"aria-hidden": !canNext,
|
|
5609
|
-
tabIndex: canNext ? 0 : -1,
|
|
5610
5604
|
disabled: !canNext,
|
|
5611
5605
|
onClick: () => scrollByCard(1),
|
|
5612
5606
|
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ArrowIcon, { direction: "next" })
|
|
@@ -6945,6 +6939,9 @@ var renderBlock2 = (block, index, headingIds) => {
|
|
|
6945
6939
|
block.caption && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("figcaption", { className: "fbp-blockCaption", children: block.caption })
|
|
6946
6940
|
] }, index);
|
|
6947
6941
|
}
|
|
6942
|
+
if (block.type === "steps") {
|
|
6943
|
+
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);
|
|
6944
|
+
}
|
|
6948
6945
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "fbp-blockParagraph", children: block.text }, index);
|
|
6949
6946
|
};
|
|
6950
6947
|
var FeatureBlogPage = ({
|
|
@@ -6971,7 +6968,7 @@ var FeatureBlogPage = ({
|
|
|
6971
6968
|
const seen = /* @__PURE__ */ new Map();
|
|
6972
6969
|
const ids = /* @__PURE__ */ new Map();
|
|
6973
6970
|
content.forEach((block, i) => {
|
|
6974
|
-
if (block.type !== "heading") return;
|
|
6971
|
+
if (block.type !== "heading" && block.type !== "steps") return;
|
|
6975
6972
|
const base = block.id ?? (slugify(block.text ?? "") || `section-${i}`);
|
|
6976
6973
|
const count = seen.get(base) ?? 0;
|
|
6977
6974
|
seen.set(base, count + 1);
|
|
@@ -6980,7 +6977,9 @@ var FeatureBlogPage = ({
|
|
|
6980
6977
|
return ids;
|
|
6981
6978
|
}, [content]);
|
|
6982
6979
|
const headings = (0, import_react28.useMemo)(
|
|
6983
|
-
() => content.map((block, i) => ({ block, i })).filter(
|
|
6980
|
+
() => content.map((block, i) => ({ block, i })).filter(
|
|
6981
|
+
({ block }) => block.type === "steps" || block.type === "heading" && (block.level ?? 2) === 2
|
|
6982
|
+
).map(({ block, i }) => ({ id: headingIds.get(i), text: block.text ?? "" })),
|
|
6984
6983
|
[content, headingIds]
|
|
6985
6984
|
);
|
|
6986
6985
|
const [activeId, setActiveId] = (0, import_react28.useState)(null);
|