@stokr/components-library 4.2.2 → 4.2.4

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.
Files changed (59) hide show
  1. package/dist/components/Button/Button.styles.d.ts +5 -1
  2. package/dist/components/CardTabs/CardTabs.styles.d.ts +34 -9
  3. package/dist/components/Checkbox/Checkbox.d.ts +3 -1
  4. package/dist/components/Checkbox/Checkbox.styles.d.ts +18 -4
  5. package/dist/components/Collapsible/Collapsible.styles.d.ts +18 -6
  6. package/dist/components/CopyToClipboardTooltip/CopyToClipboardTooltip.styles.d.ts +3 -1
  7. package/dist/components/FAQ/FAQ.d.ts +29 -0
  8. package/dist/components/FAQ/FAQ.js +18 -18
  9. package/dist/components/FAQ/FAQ.styles.d.ts +38 -0
  10. package/dist/components/FAQ/FAQ.styles.js +58 -1
  11. package/dist/components/InfoIcon/InfoIcon.styles.d.ts +8 -2
  12. package/dist/components/Input/Input.d.ts +3 -0
  13. package/dist/components/Input/Input.js +5 -2
  14. package/dist/components/Input/Input.styles.d.ts +13 -3
  15. package/dist/components/Input/Input.styles.js +57 -0
  16. package/dist/components/Input/Select.d.ts +57 -0
  17. package/dist/components/Input/Select.js +71 -94
  18. package/dist/components/Input/Select.styles.d.ts +79 -0
  19. package/dist/components/Input/Select.styles.js +68 -1
  20. package/dist/components/Lottie/LottieAnimation.d.ts +43 -0
  21. package/dist/components/Lottie/LottieAnimation.js +0 -12
  22. package/dist/components/Lottie/LottieAnimation.styles.d.ts +5 -0
  23. package/dist/components/Lottie/LottieAnimation.styles.js +3 -2
  24. package/dist/components/MaterialIcon/MaterialIcon.styles.d.ts +25 -5
  25. package/dist/components/Modal/Modal.js +21 -5
  26. package/dist/components/Modal/Modal.styles.d.ts +49 -15
  27. package/dist/components/Modal/Modal.styles.js +4 -3
  28. package/dist/components/Modal/SideModal.js +7 -71
  29. package/dist/components/Modal/SideModal.styles.d.ts +12 -4
  30. package/dist/components/Modal/SideModalParts.d.ts +6 -2
  31. package/dist/components/Modal/SuccessModal/SuccessModal.d.ts +42 -0
  32. package/dist/components/Modal/SuccessModal/SuccessModal.js +50 -38
  33. package/dist/components/Modal/bodyScrollLock.d.ts +6 -0
  34. package/dist/components/Modal/bodyScrollLock.js +80 -0
  35. package/dist/components/Section/Section.styles.d.ts +35 -7
  36. package/dist/components/Skeleton/Skeleton.styles.d.ts +9 -3
  37. package/dist/components/StepSidebar/MobileStepProgress.d.ts +12 -0
  38. package/dist/components/StepSidebar/MobileStepProgress.js +14 -0
  39. package/dist/components/StepSidebar/MobileStepProgress.styles.d.ts +15 -0
  40. package/dist/components/StepSidebar/MobileStepProgress.styles.js +42 -0
  41. package/dist/components/StepSidebar/StepProgress.d.ts +14 -0
  42. package/dist/components/StepSidebar/StepProgress.js +14 -0
  43. package/dist/components/StepSidebar/StepProgress.styles.d.ts +30 -0
  44. package/dist/components/StepSidebar/StepProgress.styles.js +103 -0
  45. package/dist/components/StepSidebar/StepSidebar.d.ts +34 -0
  46. package/dist/components/StepSidebar/StepSidebar.js +56 -0
  47. package/dist/components/StepSidebar/StepSidebar.styles.d.ts +54 -0
  48. package/dist/components/StepSidebar/StepSidebar.styles.js +171 -0
  49. package/dist/components/StokrLoader/StokrLoader.d.ts +3 -1
  50. package/dist/components/Text/Text.styles.d.ts +6 -2
  51. package/dist/components/Tooltip/Tooltip.styles.d.ts +6 -2
  52. package/dist/index.d.ts +35 -10
  53. package/dist/index.js +6 -0
  54. package/dist/styles/borderedField.d.ts +11 -0
  55. package/dist/styles/borderedField.js +56 -0
  56. package/dist/styles/rwd.d.ts +3 -1
  57. package/dist/utils/customHooks.d.ts +11 -4
  58. package/dist/utils/customHooks.js +14 -22
  59. package/package.json +13 -3
@@ -1,10 +1,12 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { SideModal } from "../SideModal.js";
3
+ import { Modal } from "../Modal.js";
2
4
  import { useEffect } from "react";
3
5
  import { createRoot } from "react-dom/client";
4
- import PropTypes from "prop-types";
5
- import { Modal } from "../Modal.js";
6
+ import { SideModalHeader, SideModalBody } from "../SideModalParts.js";
7
+ import { useMobileView } from "../../../utils/customHooks.js";
6
8
  import { LottieAnimation } from "../../Lottie/LottieAnimation.js";
7
- import { SuccessModalContent, AnimationContainer, Title, Subtitle, ContentWrapper } from "./SuccessModal.styles.js";
9
+ import { SuccessModalContent, Title, Subtitle, ContentWrapper, AnimationContainer } from "./SuccessModal.styles.js";
8
10
  const SuccessModalComponent = ({
9
11
  isOpen,
10
12
  onClose,
@@ -19,10 +21,13 @@ const SuccessModalComponent = ({
19
21
  speed = 1,
20
22
  modalProps = {},
21
23
  maxWidth = "800px",
22
- hideAnimation = false
24
+ hideAnimation = false,
25
+ sideModalBreakpoint = "Medium",
26
+ disableSideModal = false
23
27
  }) => {
28
+ const isSideModal = useMobileView(sideModalBreakpoint) && !disableSideModal;
24
29
  useEffect(() => {
25
- if (!isOpen) return;
30
+ if (!isOpen || isSideModal) return;
26
31
  const handleKeyDown = (e) => {
27
32
  if (e.key === "Escape") {
28
33
  onClose?.();
@@ -30,7 +35,38 @@ const SuccessModalComponent = ({
30
35
  };
31
36
  document.addEventListener("keydown", handleKeyDown);
32
37
  return () => document.removeEventListener("keydown", handleKeyDown);
33
- }, [isOpen, onClose]);
38
+ }, [isOpen, isSideModal, onClose]);
39
+ const animation = !hideAnimation && /* @__PURE__ */ jsx(AnimationContainer, { children: /* @__PURE__ */ jsx(
40
+ LottieAnimation,
41
+ {
42
+ variant,
43
+ src: animationSrc,
44
+ loop,
45
+ autoplay,
46
+ segment,
47
+ speed,
48
+ size: "100%"
49
+ }
50
+ ) });
51
+ if (isSideModal) {
52
+ return /* @__PURE__ */ jsxs(
53
+ SideModal,
54
+ {
55
+ isOpen,
56
+ onClose,
57
+ fullWidthOnMobile: true,
58
+ showCloseButton: !modalProps.hideCloseButton,
59
+ closeButtonVariant: modalProps.closeButtonVariant,
60
+ children: [
61
+ (title || subtitle) && /* @__PURE__ */ jsx(SideModalHeader, { title, subtitle, size: "lg" }),
62
+ /* @__PURE__ */ jsxs(SideModalBody, { children: [
63
+ animation,
64
+ content
65
+ ] })
66
+ ]
67
+ }
68
+ );
69
+ }
34
70
  return /* @__PURE__ */ jsx(
35
71
  Modal,
36
72
  {
@@ -41,18 +77,7 @@ const SuccessModalComponent = ({
41
77
  maxWidth,
42
78
  ...modalProps,
43
79
  children: /* @__PURE__ */ jsxs(SuccessModalContent, { children: [
44
- !hideAnimation && /* @__PURE__ */ jsx(AnimationContainer, { children: /* @__PURE__ */ jsx(
45
- LottieAnimation,
46
- {
47
- variant,
48
- src: animationSrc,
49
- loop,
50
- autoplay,
51
- segment,
52
- speed,
53
- size: "100%"
54
- }
55
- ) }),
80
+ animation,
56
81
  title && /* @__PURE__ */ jsx(Title, { children: title }),
57
82
  subtitle && /* @__PURE__ */ jsx(Subtitle, { children: subtitle }),
58
83
  content && /* @__PURE__ */ jsx(ContentWrapper, { children: content })
@@ -60,23 +85,6 @@ const SuccessModalComponent = ({
60
85
  }
61
86
  );
62
87
  };
63
- SuccessModalComponent.propTypes = {
64
- isOpen: PropTypes.bool.isRequired,
65
- onClose: PropTypes.func.isRequired,
66
- variant: PropTypes.oneOf(["success", "progress", "upload"]),
67
- title: PropTypes.node,
68
- subtitle: PropTypes.node,
69
- content: PropTypes.node,
70
- animationSrc: PropTypes.string,
71
- loop: PropTypes.bool,
72
- autoplay: PropTypes.bool,
73
- segment: PropTypes.arrayOf(PropTypes.number),
74
- speed: PropTypes.number,
75
- modalProps: PropTypes.object,
76
- maxWidth: PropTypes.string,
77
- /** Skips the animation container entirely (e.g. a plain form step with no success/progress state). */
78
- hideAnimation: PropTypes.bool
79
- };
80
88
  let successContainer = null;
81
89
  let successRoot = null;
82
90
  const showSuccess = (options = {}) => {
@@ -92,7 +100,9 @@ const showSuccess = (options = {}) => {
92
100
  speed = 1,
93
101
  autoClose = 0,
94
102
  modalProps = {},
95
- maxWidth = "800px"
103
+ maxWidth = "800px",
104
+ sideModalBreakpoint,
105
+ disableSideModal
96
106
  } = options;
97
107
  return new Promise((resolve) => {
98
108
  if (!successContainer) {
@@ -132,7 +142,9 @@ const showSuccess = (options = {}) => {
132
142
  segment,
133
143
  speed,
134
144
  modalProps,
135
- maxWidth
145
+ maxWidth,
146
+ sideModalBreakpoint,
147
+ disableSideModal
136
148
  }
137
149
  )
138
150
  );
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Hides the page scrollbar behind an overlay. The body takes its width as padding so the layout stays put, and
3
+ * `--scrollbar-compensation` holds it for fixed elements (a header) to do the same. Nested overlays share one lock,
4
+ * released with the last one, which also restores the page scroll position. Returns the unlock function.
5
+ */
6
+ export declare function lockBodyScroll(): () => void;
@@ -0,0 +1,80 @@
1
+ function findScrolledElement() {
2
+ let best = null;
3
+ function walk(el) {
4
+ const s = getComputedStyle(el);
5
+ const scrollable = (s.overflowY === "auto" || s.overflowY === "scroll" || s.overflow === "auto" || s.overflow === "scroll") && el.scrollHeight > el.clientHeight && el.scrollTop > 0;
6
+ if (scrollable && (!best || el.scrollTop > best.scrollTop)) best = { el, scrollTop: el.scrollTop };
7
+ for (let i = 0; i < el.children.length; i++) walk(el.children[i]);
8
+ }
9
+ walk(document.body);
10
+ return best ? { type: "element", ...best } : null;
11
+ }
12
+ function restoreScroll(saved) {
13
+ if (!saved) return;
14
+ if (saved.type === "window") {
15
+ window.scrollTo(0, saved.y);
16
+ } else if (document.contains(saved.el)) {
17
+ saved.el.scrollTop = saved.scrollTop;
18
+ }
19
+ }
20
+ function clearBodyLock() {
21
+ const { style } = document.body;
22
+ const docEl = document.documentElement;
23
+ style.position = "";
24
+ style.top = "";
25
+ style.left = "";
26
+ style.right = "";
27
+ style.width = "";
28
+ style.height = "";
29
+ style.overflow = "";
30
+ style.paddingRight = "";
31
+ docEl.style.overflow = "";
32
+ docEl.style.setProperty("--scrollbar-compensation", "0px");
33
+ }
34
+ function applyBodyLock(saved) {
35
+ const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
36
+ if (saved?.type === "window") {
37
+ const docHeight = document.documentElement.scrollHeight;
38
+ document.documentElement.style.overflow = "hidden";
39
+ document.documentElement.style.setProperty("--scrollbar-compensation", `${scrollbarWidth}px`);
40
+ document.body.style.position = "fixed";
41
+ document.body.style.top = `-${saved.y}px`;
42
+ document.body.style.left = "0";
43
+ document.body.style.right = "0";
44
+ document.body.style.width = "100%";
45
+ document.body.style.height = `${docHeight}px`;
46
+ document.body.style.paddingRight = `${scrollbarWidth}px`;
47
+ } else {
48
+ document.documentElement.style.overflow = "hidden";
49
+ document.body.style.overflow = "hidden";
50
+ document.body.style.paddingRight = `${scrollbarWidth}px`;
51
+ document.documentElement.style.setProperty("--scrollbar-compensation", `${scrollbarWidth}px`);
52
+ if (saved) {
53
+ requestAnimationFrame(() => {
54
+ restoreScroll(saved);
55
+ requestAnimationFrame(() => restoreScroll(saved));
56
+ });
57
+ }
58
+ }
59
+ }
60
+ let lockCount = 0;
61
+ let savedScroll = null;
62
+ function lockBodyScroll() {
63
+ if (lockCount++ === 0) {
64
+ savedScroll = findScrolledElement() ?? (window.scrollY > 0 ? { type: "window", y: window.scrollY } : null);
65
+ applyBodyLock(savedScroll);
66
+ }
67
+ let released = false;
68
+ return () => {
69
+ if (released) return;
70
+ released = true;
71
+ if (--lockCount > 0) return;
72
+ clearBodyLock();
73
+ const saved = savedScroll;
74
+ savedScroll = null;
75
+ if (saved) requestAnimationFrame(() => restoreScroll(saved));
76
+ };
77
+ }
78
+ export {
79
+ lockBodyScroll
80
+ };
@@ -1,4 +1,6 @@
1
- export declare const SectionRoot: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, {
1
+ export declare const SectionRoot: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, "style"> & {
2
+ style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
3
+ }, {
2
4
  $variant: "card" | "plain";
3
5
  $elevated: boolean;
4
6
  $collapsible: boolean;
@@ -6,7 +8,9 @@ export declare const SectionRoot: import('styled-components/dist/types').IStyled
6
8
  $always?: boolean;
7
9
  }>> & string;
8
10
  /** Figma header block: title, with a rule beneath it at padding-bottom space/5. */
9
- export declare const SectionHeader: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
11
+ export declare const SectionHeader: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
12
+ style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
13
+ }, {
10
14
  $collapsed?: boolean;
11
15
  $always?: boolean;
12
16
  }>> & string;
@@ -14,7 +18,9 @@ export declare const SectionHeader: import('styled-components/dist/types').IStyl
14
18
  * The title row, the section's toggle. It reaches over the card's padding so the whole header
15
19
  * opens it, and while collapsed the whole card; the text stays where the padding put it.
16
20
  */
17
- export declare const SectionToggle: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
21
+ export declare const SectionToggle: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style"> & {
22
+ style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
23
+ }, {
18
24
  $collapsed?: boolean;
19
25
  $always?: boolean;
20
26
  }>> & string;
@@ -22,13 +28,35 @@ export declare const SectionToggle: import('styled-components/dist/types').IStyl
22
28
  * Collapsible's animated body, always open from desktop up unless `$always`. The overrides use `&&`:
23
29
  * the production bundle can emit the base Collapsible rules after these.
24
30
  */
25
- export declare const SectionBody: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$open"> & {
31
+ export declare const SectionBody: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('styled-components').FastOmit<import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
32
+ style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
33
+ }, {
26
34
  $open: boolean;
35
+ }>, "as" | "forwardedAs"> & {
36
+ as?: import('styled-components').WebTarget;
37
+ forwardedAs?: import('styled-components').WebTarget;
38
+ }, "style"> & {
39
+ style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | (import('react').CSSProperties & {
40
+ [key: `--${string}`]: string | number;
41
+ });
27
42
  }, {
28
43
  $always?: boolean;
29
44
  }>> & string;
30
- export declare const SectionBodyClip: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>, {
45
+ export declare const SectionBodyClip: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('styled-components').FastOmit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
46
+ style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
47
+ }, "as" | "forwardedAs"> & {
48
+ as?: import('styled-components').WebTarget;
49
+ forwardedAs?: import('styled-components').WebTarget;
50
+ }, "style"> & {
51
+ style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | (import('react').CSSProperties & {
52
+ [key: `--${string}`]: string | number;
53
+ });
54
+ }, {
31
55
  $always?: boolean;
32
56
  }>> & string;
33
- export declare const SectionBodyInner: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
34
- export declare const SectionHeading: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>> & string;
57
+ export declare const SectionBodyInner: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
58
+ style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
59
+ }> & string;
60
+ export declare const SectionHeading: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "style"> & {
61
+ style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
62
+ }> & string;
@@ -6,9 +6,15 @@ interface BlockProps {
6
6
  $baseColor: string;
7
7
  $highlightColor: string;
8
8
  }
9
- export declare const SkeletonBlock: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, BlockProps>> & string;
10
- export declare const SkeletonLinesRoot: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
9
+ export declare const SkeletonBlock: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
10
+ style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
11
+ }, BlockProps>> & string;
12
+ export declare const SkeletonLinesRoot: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
13
+ style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
14
+ }, {
11
15
  $gap: number;
12
16
  }>> & string;
13
- export declare const VisuallyHidden: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
17
+ export declare const VisuallyHidden: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
18
+ style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
19
+ }> & string;
14
20
  export {};
@@ -0,0 +1,12 @@
1
+ import { StepProgressProps } from './StepProgress';
2
+ export interface StepCaptionInfo {
3
+ number: number;
4
+ total: number;
5
+ title: string;
6
+ }
7
+ export interface MobileStepProgressProps extends StepProgressProps {
8
+ /** Builds the "Step 2 of 5 — Title" caption (copy lives in the app). */
9
+ formatCaption: (info: StepCaptionInfo) => string;
10
+ }
11
+ /** Horizontal segment strip with a caption for the current step, for narrow screens. */
12
+ export declare const MobileStepProgress: ({ steps, formatCaption, className }: MobileStepProgressProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { Strip, Segments, Segment, Caption } from "./MobileStepProgress.styles.js";
3
+ const MobileStepProgress = ({ steps, formatCaption, className }) => {
4
+ const active = steps.find((step) => step.status === "active");
5
+ const last = steps[steps.length - 1];
6
+ const current = active ?? (last?.status === "done" ? last : void 0);
7
+ return /* @__PURE__ */ jsxs(Strip, { className, children: [
8
+ /* @__PURE__ */ jsx(Segments, { children: steps.map((step) => /* @__PURE__ */ jsx(Segment, { $status: step.status }, step.id)) }),
9
+ current && /* @__PURE__ */ jsx(Caption, { children: formatCaption({ number: current.number, total: steps.length, title: current.title }) })
10
+ ] });
11
+ };
12
+ export {
13
+ MobileStepProgress
14
+ };
@@ -0,0 +1,15 @@
1
+ import { StepStatus } from './StepProgress';
2
+ export declare const Strip: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
3
+ style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
4
+ }> & string;
5
+ export declare const Segments: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
6
+ style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
7
+ }> & string;
8
+ export declare const Segment: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
9
+ style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
10
+ }, {
11
+ $status: StepStatus;
12
+ }>> & string;
13
+ export declare const Caption: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "style"> & {
14
+ style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
15
+ }> & string;
@@ -0,0 +1,42 @@
1
+ import styled from "styled-components";
2
+ import { colors } from "../../styles/colors.js";
3
+ const SEGMENT_COLOR = {
4
+ done: colors.lighterGreen,
5
+ active: colors.white,
6
+ upcoming: "#4a4a4a"
7
+ };
8
+ const Strip = styled.div`
9
+ display: flex;
10
+ flex-direction: column;
11
+ gap: 8px;
12
+ padding: 0 22px 12px;
13
+ `;
14
+ const Segments = styled.div`
15
+ display: flex;
16
+ gap: 6px;
17
+ width: 100%;
18
+ `;
19
+ const Segment = styled.span`
20
+ flex: 1 0 0;
21
+ min-width: 1px;
22
+ height: 4px;
23
+ border-radius: 2px;
24
+ background: ${({ $status }) => SEGMENT_COLOR[$status]};
25
+ `;
26
+ const Caption = styled.p`
27
+ margin: 0;
28
+ font-size: 10px;
29
+ font-weight: 600;
30
+ letter-spacing: 1.2px;
31
+ text-transform: uppercase;
32
+ color: #9e9e9e;
33
+ white-space: nowrap;
34
+ overflow: hidden;
35
+ text-overflow: ellipsis;
36
+ `;
37
+ export {
38
+ Caption,
39
+ Segment,
40
+ Segments,
41
+ Strip
42
+ };
@@ -0,0 +1,14 @@
1
+ export type StepStatus = 'done' | 'active' | 'upcoming';
2
+ export interface StepProgressItem {
3
+ id: string;
4
+ number: number;
5
+ title: string;
6
+ subtitle?: string;
7
+ status: StepStatus;
8
+ }
9
+ export interface StepProgressProps {
10
+ steps: readonly StepProgressItem[];
11
+ className?: string;
12
+ }
13
+ /** Vertical step timeline for dark sidebars. */
14
+ export declare const StepProgress: ({ steps, className }: StepProgressProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { MaterialIcon } from "../MaterialIcon/MaterialIcon.js";
3
+ import { List, Item, Marker, Line, ItemText, ItemTitle, ItemSubtitle } from "./StepProgress.styles.js";
4
+ const StepProgress = ({ steps, className }) => /* @__PURE__ */ jsx(List, { className, children: steps.map((step, index) => /* @__PURE__ */ jsxs(Item, { "data-status": step.status, "aria-current": step.status === "active" ? "step" : void 0, children: [
5
+ /* @__PURE__ */ jsx(Marker, { $status: step.status, children: step.status === "done" ? /* @__PURE__ */ jsx(MaterialIcon, { name: "check", weight: 600, size: "md" }) : step.number }),
6
+ index < steps.length - 1 && /* @__PURE__ */ jsx(Line, { $status: step.status }),
7
+ /* @__PURE__ */ jsxs(ItemText, { children: [
8
+ /* @__PURE__ */ jsx(ItemTitle, { $status: step.status, children: step.title }),
9
+ step.subtitle && /* @__PURE__ */ jsx(ItemSubtitle, { $status: step.status, children: step.subtitle })
10
+ ] })
11
+ ] }, step.id)) });
12
+ export {
13
+ StepProgress
14
+ };
@@ -0,0 +1,30 @@
1
+ import { StepStatus } from './StepProgress';
2
+ export declare const List: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "style"> & {
3
+ style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
4
+ }> & string;
5
+ export declare const Item: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "style"> & {
6
+ style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
7
+ }> & string;
8
+ export declare const Line: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
9
+ style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
10
+ }, {
11
+ $status: StepStatus;
12
+ }>> & string;
13
+ export declare const Marker: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
14
+ style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
15
+ }, {
16
+ $status: StepStatus;
17
+ }>> & string;
18
+ export declare const ItemText: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
19
+ style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
20
+ }> & string;
21
+ export declare const ItemTitle: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "style"> & {
22
+ style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
23
+ }, {
24
+ $status: StepStatus;
25
+ }>> & string;
26
+ export declare const ItemSubtitle: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "style"> & {
27
+ style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
28
+ }, {
29
+ $status: StepStatus;
30
+ }>> & string;
@@ -0,0 +1,103 @@
1
+ import styled from "styled-components";
2
+ import { colors } from "../../styles/colors.js";
3
+ import { media } from "../../styles/rwd.js";
4
+ import { typography } from "../../styles/typography.js";
5
+ const MARKER_SIZE = 28;
6
+ const LINE_GAP = 4;
7
+ const DARK = "#0a0a0a";
8
+ const MARKER_BG = {
9
+ upcoming: "transparent",
10
+ active: colors.white,
11
+ done: colors.lighterGreen
12
+ };
13
+ const MARKER_BORDER = {
14
+ upcoming: colors.grey2,
15
+ active: colors.white,
16
+ done: colors.lighterGreen
17
+ };
18
+ const MARKER_TEXT = { upcoming: colors.grey2, active: DARK, done: DARK };
19
+ const TITLE_COLOR = {
20
+ upcoming: colors.grey2,
21
+ active: colors.white,
22
+ done: colors.lighterGreen
23
+ };
24
+ const SUBTITLE_COLOR = {
25
+ upcoming: colors.grey2,
26
+ active: colors.grey,
27
+ done: "rgba(255, 255, 255, 0.45)"
28
+ };
29
+ const LINE_COLOR = {
30
+ upcoming: colors.grey2,
31
+ active: colors.grey,
32
+ done: colors.lightPastelGreen
33
+ };
34
+ const List = styled.ol`
35
+ display: flex;
36
+ flex-direction: column;
37
+ margin: 0;
38
+ padding: 0;
39
+ list-style: none;
40
+ `;
41
+ const Item = styled.li`
42
+ position: relative;
43
+ display: flex;
44
+ align-items: flex-start;
45
+ gap: 16px;
46
+ padding-bottom: 32px;
47
+
48
+ &:last-child {
49
+ padding-bottom: 0;
50
+ }
51
+ `;
52
+ const Line = styled.span`
53
+ position: absolute;
54
+ left: ${MARKER_SIZE / 2 - 1}px;
55
+ top: ${MARKER_SIZE + LINE_GAP}px;
56
+ bottom: ${LINE_GAP}px;
57
+ width: 2px;
58
+ background-color: ${({ $status }) => LINE_COLOR[$status]};
59
+ `;
60
+ const Marker = styled.span`
61
+ ${typography.formInputMain}
62
+ z-index: 1;
63
+ flex: 0 0 ${MARKER_SIZE}px;
64
+ width: ${MARKER_SIZE}px;
65
+ height: ${MARKER_SIZE}px;
66
+ border-radius: 50%;
67
+ display: flex;
68
+ align-items: center;
69
+ justify-content: center;
70
+ background-color: ${({ $status }) => MARKER_BG[$status]};
71
+ color: ${({ $status }) => MARKER_TEXT[$status]};
72
+ border: 1px solid ${({ $status }) => MARKER_BORDER[$status]};
73
+ `;
74
+ const ItemText = styled.div`
75
+ padding-top: 4px;
76
+ `;
77
+ const ItemTitle = styled.p`
78
+ ${typography.bodyMdCallout}
79
+ margin: 0;
80
+ color: ${({ $status }) => TITLE_COLOR[$status]};
81
+
82
+ ${media.desktopXlUp} {
83
+ font-size: 16px;
84
+ }
85
+ `;
86
+ const ItemSubtitle = styled.p`
87
+ ${typography.formInput}
88
+ margin: 4px 0 0;
89
+ color: ${({ $status }) => SUBTITLE_COLOR[$status]};
90
+
91
+ ${media.desktopXlUp} {
92
+ font-size: 13px;
93
+ }
94
+ `;
95
+ export {
96
+ Item,
97
+ ItemSubtitle,
98
+ ItemText,
99
+ ItemTitle,
100
+ Line,
101
+ List,
102
+ Marker
103
+ };
@@ -0,0 +1,34 @@
1
+ import { ReactNode } from 'react';
2
+ export interface StepSidebarIntro {
3
+ eyebrow: ReactNode;
4
+ title: ReactNode;
5
+ description?: ReactNode;
6
+ }
7
+ export interface StepSidebarSupport {
8
+ heading: ReactNode;
9
+ body: ReactNode;
10
+ linkLabel: ReactNode;
11
+ href: string;
12
+ /** Opens the link in a new tab. */
13
+ external?: boolean;
14
+ }
15
+ export interface StepSidebarProps {
16
+ /** Desktop content between the intro and the support block, e.g. `<StepProgress />`. */
17
+ children?: ReactNode;
18
+ /** Mobile content below the header, e.g. `<MobileStepProgress />`. */
19
+ mobileContent?: ReactNode;
20
+ /** Eyebrow, title and text below the logo (desktop only). */
21
+ intro?: StepSidebarIntro;
22
+ /** Contact block pinned to the bottom (desktop only). */
23
+ support?: StepSidebarSupport;
24
+ logoAlt: string;
25
+ /** Makes the logo a button. */
26
+ onLogoClick?: () => void;
27
+ /** Shows the close (×) button in the mobile header. */
28
+ onClose?: () => void;
29
+ closeLabel?: string;
30
+ dataCyPrefix?: string;
31
+ className?: string;
32
+ }
33
+ /** Dark flow sidebar shell: logo, intro, your content and a support contact; a compact header on mobile. */
34
+ export declare const StepSidebar: ({ children, mobileContent, intro, support, logoAlt, onLogoClick, onClose, closeLabel, dataCyPrefix, className, }: StepSidebarProps) => import("react/jsx-runtime").JSX.Element;