@windstream/react-shared-components 0.0.10 → 0.0.11

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 (103) hide show
  1. package/README.md +623 -623
  2. package/dist/contentful/index.d.ts +6 -2
  3. package/dist/contentful/index.esm.js +1 -1
  4. package/dist/contentful/index.esm.js.map +1 -1
  5. package/dist/contentful/index.js +1 -1
  6. package/dist/contentful/index.js.map +1 -1
  7. package/dist/core.d.ts +2 -2
  8. package/dist/index.d.ts +1 -1
  9. package/dist/index.js.map +1 -1
  10. package/dist/styles.css +1 -1
  11. package/package.json +159 -159
  12. package/src/components/accordion/Accordion.stories.tsx +225 -225
  13. package/src/components/accordion/index.tsx +36 -36
  14. package/src/components/accordion/types.ts +9 -9
  15. package/src/components/alert-card/types.ts +9 -9
  16. package/src/components/brand-button/BrandButton.stories.tsx +221 -221
  17. package/src/components/brand-button/helpers.ts +35 -35
  18. package/src/components/brand-button/index.tsx +90 -90
  19. package/src/components/brand-button/types.ts +26 -26
  20. package/src/components/button/Button.stories.tsx +108 -108
  21. package/src/components/button/index.tsx +23 -23
  22. package/src/components/button/types.ts +14 -14
  23. package/src/components/call-button/CallButton.stories.tsx +324 -324
  24. package/src/components/call-button/index.tsx +80 -80
  25. package/src/components/call-button/types.ts +9 -9
  26. package/src/components/checkbox/Checkbox.stories.tsx +248 -248
  27. package/src/components/checkbox/types.ts +23 -23
  28. package/src/components/checklist/Checklist.stories.tsx +151 -151
  29. package/src/components/checklist/index.tsx +33 -33
  30. package/src/components/checklist/types.ts +5 -5
  31. package/src/components/collapse/Collapse.stories.tsx +256 -256
  32. package/src/components/collapse/index.tsx +44 -44
  33. package/src/components/collapse/types.ts +5 -5
  34. package/src/components/divider/Divider.stories.tsx +206 -206
  35. package/src/components/divider/index.tsx +23 -23
  36. package/src/components/divider/type.ts +2 -2
  37. package/src/components/input/Input.stories.tsx +358 -358
  38. package/src/components/input/index.tsx +174 -174
  39. package/src/components/input/types.ts +36 -36
  40. package/src/components/link/Link.stories.tsx +163 -163
  41. package/src/components/link/index.tsx +96 -96
  42. package/src/components/link/types.ts +25 -25
  43. package/src/components/list/List.stories.tsx +272 -272
  44. package/src/components/list/index.tsx +86 -86
  45. package/src/components/list/list-item/index.tsx +36 -36
  46. package/src/components/list/list-item/types.ts +13 -13
  47. package/src/components/list/types.ts +29 -29
  48. package/src/components/material-icon/MaterialIcon.stories.tsx +330 -330
  49. package/src/components/material-icon/constants.ts +95 -95
  50. package/src/components/material-icon/index.tsx +44 -44
  51. package/src/components/material-icon/types.ts +31 -31
  52. package/src/components/modal/Modal.stories.tsx +171 -171
  53. package/src/components/modal/index.tsx +168 -168
  54. package/src/components/modal/types.ts +23 -23
  55. package/src/components/radio-button/index.tsx +73 -73
  56. package/src/components/radio-button/types.ts +21 -21
  57. package/src/components/see-more/SeeMore.stories.tsx +182 -182
  58. package/src/components/see-more/index.tsx +38 -38
  59. package/src/components/see-more/types.ts +3 -3
  60. package/src/components/select/Select.stories.tsx +410 -410
  61. package/src/components/select/index.tsx +150 -150
  62. package/src/components/select/types.ts +34 -34
  63. package/src/components/select-plan-button/SelectPlanButton.stories.tsx +160 -160
  64. package/src/components/select-plan-button/index.tsx +20 -20
  65. package/src/components/select-plan-button/types.ts +3 -3
  66. package/src/components/skeleton/Skeleton.stories.tsx +180 -180
  67. package/src/components/skeleton/index.tsx +61 -61
  68. package/src/components/skeleton/types.ts +3 -3
  69. package/src/components/spinner/Spinner.stories.tsx +335 -335
  70. package/src/components/spinner/index.tsx +44 -44
  71. package/src/components/spinner/types.ts +4 -4
  72. package/src/components/text/Text.stories.tsx +302 -302
  73. package/src/components/text/index.tsx +26 -26
  74. package/src/components/text/types.ts +45 -45
  75. package/src/components/tooltip/Tooltip.stories.tsx +220 -220
  76. package/src/components/tooltip/index.tsx +78 -78
  77. package/src/components/tooltip/types.ts +6 -6
  78. package/src/components/view-cart-button/ViewCartButton.stories.tsx +241 -241
  79. package/src/components/view-cart-button/index.tsx +38 -38
  80. package/src/components/view-cart-button/types.ts +4 -4
  81. package/src/contentful/blocks/accordion/index.tsx +7 -7
  82. package/src/contentful/blocks/button/index.tsx +5 -5
  83. package/src/contentful/blocks/callout/index.tsx +7 -7
  84. package/src/contentful/blocks/cards/index.tsx +7 -7
  85. package/src/contentful/blocks/carousel/index.tsx +7 -7
  86. package/src/contentful/blocks/cta-callout/index.tsx +6 -0
  87. package/src/contentful/blocks/cta-callout/types.ts +1 -0
  88. package/src/contentful/blocks/floating-banner/index.tsx +7 -7
  89. package/src/contentful/blocks/footer/index.tsx +7 -7
  90. package/src/contentful/blocks/image-promo-bar/index.tsx +7 -7
  91. package/src/contentful/blocks/modal/index.tsx +5 -5
  92. package/src/contentful/blocks/navigation/index.tsx +7 -7
  93. package/src/contentful/blocks/primary-hero/index.tsx +7 -7
  94. package/src/contentful/blocks/shape-background-wrapper/index.tsx +123 -123
  95. package/src/contentful/blocks/shape-background-wrapper/types.ts +35 -35
  96. package/src/contentful/blocks/text/index.tsx +6 -6
  97. package/src/contentful/index.ts +4 -1
  98. package/src/hooks/use-body-scroll-lock.ts +31 -31
  99. package/src/index.ts +81 -81
  100. package/src/setupTests.ts +46 -46
  101. package/src/styles/globals.css +275 -319
  102. package/src/types/global.d.ts +9 -9
  103. package/src/utils/index.ts +49 -49
@@ -1,39 +1,39 @@
1
- import { cx } from "@shared/utils";
2
- import { Button } from "../button";
3
- import { MaterialIcon } from "../material-icon";
4
- import { Text } from "../text";
5
- import { ViewCartButtonProps } from "./types";
6
- const baseClasses =
7
- "btn-medium rounded-2xl pl-15 pr-15 inline-flex gap-2 items-center justify-center outline-none focus:ring-2 focus:ring-offset-2 cursor-pointer transition-colors duration-200 align-top border-2 border-border-secondary-on-bg-fill bg-bg text-text focus:ring-bg-surface-inverse";
8
- export const ViewCartButton: React.FC<ViewCartButtonProps> = (props) => {
9
- const { cartTotalText, onClick, isOpen, ...rest } = props;
10
- return (
11
- <Button
12
- className={cx(baseClasses, "btn-small w-full border-border pl-6 pr-4 md:btn-medium")}
13
- onClick={onClick}
14
- {...rest}
15
- >
16
- <div className="flex w-full items-center justify-center gap-2">
17
- <div className="flex flex-col items-center justify-center">
18
- <Text className="footnote -mb-1 text-text-secondary sm:body3">
19
- View cart
20
- </Text>
21
- <Text className="body3 font-bold md:body1" data-testid="cart-total">
22
- {cartTotalText}
23
- </Text>
24
- </div>
25
- <MaterialIcon
26
- name="keyboard_arrow_up"
27
- size={24}
28
- fill={0}
29
- className={cx(
30
- "h-6 w-6 transition-transform",
31
- isOpen ? "rotate-180" : "rotate-0"
32
- )}
33
- />
34
- </div>
35
- </Button>
36
- )
37
- }
38
-
1
+ import { cx } from "@shared/utils";
2
+ import { Button } from "../button";
3
+ import { MaterialIcon } from "../material-icon";
4
+ import { Text } from "../text";
5
+ import { ViewCartButtonProps } from "./types";
6
+ const baseClasses =
7
+ "btn-medium rounded-2xl pl-15 pr-15 inline-flex gap-2 items-center justify-center outline-none focus:ring-2 focus:ring-offset-2 cursor-pointer transition-colors duration-200 align-top border-2 border-border-secondary-on-bg-fill bg-bg text-text focus:ring-bg-surface-inverse";
8
+ export const ViewCartButton: React.FC<ViewCartButtonProps> = (props) => {
9
+ const { cartTotalText, onClick, isOpen, ...rest } = props;
10
+ return (
11
+ <Button
12
+ className={cx(baseClasses, "btn-small w-full border-border pl-6 pr-4 md:btn-medium")}
13
+ onClick={onClick}
14
+ {...rest}
15
+ >
16
+ <div className="flex w-full items-center justify-center gap-2">
17
+ <div className="flex flex-col items-center justify-center">
18
+ <Text className="footnote -mb-1 text-text-secondary sm:body3">
19
+ View cart
20
+ </Text>
21
+ <Text className="body3 font-bold md:body1" data-testid="cart-total">
22
+ {cartTotalText}
23
+ </Text>
24
+ </div>
25
+ <MaterialIcon
26
+ name="keyboard_arrow_up"
27
+ size={24}
28
+ fill={0}
29
+ className={cx(
30
+ "h-6 w-6 transition-transform",
31
+ isOpen ? "rotate-180" : "rotate-0"
32
+ )}
33
+ />
34
+ </div>
35
+ </Button>
36
+ )
37
+ }
38
+
39
39
  export type { ViewCartButtonProps } from "./types";
@@ -1,5 +1,5 @@
1
- export type ViewCartButtonProps = {
2
- cartTotalText: string;
3
- onClick: () => void;
4
- isOpen: boolean;
1
+ export type ViewCartButtonProps = {
2
+ cartTotalText: string;
3
+ onClick: () => void;
4
+ isOpen: boolean;
5
5
  } & React.ButtonHTMLAttributes<HTMLButtonElement>
@@ -1,7 +1,7 @@
1
- import { AccordionProps } from "./types";
2
-
3
- export const Accordion: React.FC<{ fields: AccordionProps }> = ({ fields }) => {
4
- return <div>Accordion</div>;
5
- };
6
-
7
- export default Accordion;
1
+ import { AccordionProps } from "./types";
2
+
3
+ export const Accordion: React.FC<{ fields: AccordionProps }> = ({ fields }) => {
4
+ return <div>Accordion</div>;
5
+ };
6
+
7
+ export default Accordion;
@@ -1,6 +1,6 @@
1
- import { ButtonProps } from "./types";
2
-
3
- export const Button: React.FC<{ fields: ButtonProps }> = ({ fields }) => {
4
- return <div>Button Block</div>;
5
- };
1
+ import { ButtonProps } from "./types";
2
+
3
+ export const Button: React.FC<{ fields: ButtonProps }> = ({ fields }) => {
4
+ return <div>Button Block</div>;
5
+ };
6
6
  export default Button;
@@ -1,7 +1,7 @@
1
- import { CalloutProps } from "./types";
2
-
3
- export const Callout: React.FC<{ fields: CalloutProps }> = ({ fields }) => {
4
- return <div>Callout</div>;
5
- };
6
-
7
- export default Callout;
1
+ import { CalloutProps } from "./types";
2
+
3
+ export const Callout: React.FC<{ fields: CalloutProps }> = ({ fields }) => {
4
+ return <div>Callout</div>;
5
+ };
6
+
7
+ export default Callout;
@@ -1,7 +1,7 @@
1
- import { CardsProps } from "./types";
2
-
3
- export const Cards: React.FC<{ fields: CardsProps }> = ({ fields }) => {
4
- return <div>Cards</div>;
5
- };
6
-
7
- export default Cards;
1
+ import { CardsProps } from "./types";
2
+
3
+ export const Cards: React.FC<{ fields: CardsProps }> = ({ fields }) => {
4
+ return <div>Cards</div>;
5
+ };
6
+
7
+ export default Cards;
@@ -1,7 +1,7 @@
1
- import { CarouselProps } from "./types";
2
-
3
- export const Carousel: React.FC<{ fields: CarouselProps }> = ({ fields }) => {
4
- return <div>Carousel</div>;
5
- };
6
-
7
- export default Carousel;
1
+ import { CarouselProps } from "./types";
2
+
3
+ export const Carousel: React.FC<{ fields: CarouselProps }> = ({ fields }) => {
4
+ return <div>Carousel</div>;
5
+ };
6
+
7
+ export default Carousel;
@@ -0,0 +1,6 @@
1
+ import { CtaCalloutProps } from "./types";
2
+
3
+ export const CtaCallout: React.FC<CtaCalloutProps> = ({fields}) => {
4
+ return <div>CTA Callout Block</div>;
5
+ };
6
+ export default CtaCallout;
@@ -0,0 +1 @@
1
+ export type CtaCalloutProps = {};
@@ -1,7 +1,7 @@
1
- import { FloatingBannerProps } from "./types";
2
-
3
- export const FloatingBanner: React.FC<{fields: FloatingBannerProps}> = ({ fields }) => {
4
- return <div>FloatingBanner</div>;
5
- };
6
-
7
- export default FloatingBanner;
1
+ import { FloatingBannerProps } from "./types";
2
+
3
+ export const FloatingBanner: React.FC<{fields: FloatingBannerProps}> = ({ fields }) => {
4
+ return <div>FloatingBanner</div>;
5
+ };
6
+
7
+ export default FloatingBanner;
@@ -1,7 +1,7 @@
1
- import { FooterProps } from "./types";
2
-
3
- export const Footer: React.FC<{ fields: FooterProps }> = ({ fields }) => {
4
- return <div>Footer component</div>;
5
- };
6
-
7
- export default Footer;
1
+ import { FooterProps } from "./types";
2
+
3
+ export const Footer: React.FC<{ fields: FooterProps }> = ({ fields }) => {
4
+ return <div>Footer component</div>;
5
+ };
6
+
7
+ export default Footer;
@@ -1,7 +1,7 @@
1
- import { ImagePromoBarProps } from "./types";
2
-
3
- export const ImagePromoBar: React.FC<{ fields: ImagePromoBarProps }> = ({ fields }) => {
4
- return <div>Image Promo Bar</div>;
5
- };
6
-
7
- export default ImagePromoBar;
1
+ import { ImagePromoBarProps } from "./types";
2
+
3
+ export const ImagePromoBar: React.FC<{ fields: ImagePromoBarProps }> = ({ fields }) => {
4
+ return <div>Image Promo Bar</div>;
5
+ };
6
+
7
+ export default ImagePromoBar;
@@ -1,6 +1,6 @@
1
- import { ModalProps } from "./types";
2
-
3
- export const Modal: React.FC<{ fields: ModalProps }> = ({ fields }) => {
4
- return <div>Modal Block</div>;
5
- };
1
+ import { ModalProps } from "./types";
2
+
3
+ export const Modal: React.FC<{ fields: ModalProps }> = ({ fields }) => {
4
+ return <div>Modal Block</div>;
5
+ };
6
6
  export default Modal;
@@ -1,7 +1,7 @@
1
- import { NavigationProps } from "./types";
2
-
3
- export const Navigation: React.FC<{ fields: NavigationProps }> = ({ fields }) => {
4
- return <div>Navigation</div>;
5
- };
6
-
7
- export default Navigation;
1
+ import { NavigationProps } from "./types";
2
+
3
+ export const Navigation: React.FC<{ fields: NavigationProps }> = ({ fields }) => {
4
+ return <div>Navigation</div>;
5
+ };
6
+
7
+ export default Navigation;
@@ -1,7 +1,7 @@
1
- import { PrimaryHeroProps } from "./types";
2
-
3
- export const PrimaryHero: React.FC<{ fields: PrimaryHeroProps }> = ({ fields }) => {
4
- return <div>Primary Hero</div>;
5
- };
6
-
7
- export default PrimaryHero;
1
+ import { PrimaryHeroProps } from "./types";
2
+
3
+ export const PrimaryHero: React.FC<{ fields: PrimaryHeroProps }> = ({ fields }) => {
4
+ return <div>Primary Hero</div>;
5
+ };
6
+
7
+ export default PrimaryHero;
@@ -1,123 +1,123 @@
1
- // ShapeBackgroundWrapper.tsx
2
- import React from "react";
3
-
4
- import { ShapeBackgroundWrapperProps, ThemeKey } from "./types";
5
- export const ShapeBackgroundWrapper: React.FC<ShapeBackgroundWrapperProps> = ({
6
- children,
7
- background,
8
- className,
9
- fill = "yellow",
10
- maxFit,
11
- show = true,
12
- path = "path2",
13
- }) => {
14
- const variantClass = `${path}`;
15
-
16
- const textColorClasses: Record<ThemeKey, string> = {
17
- blue: "text-[#07B2E2]",
18
- green: "text-[#26B170]",
19
- yellow: "text-[#F5FF1E]",
20
- purple: "text-[#931D69]",
21
- white: "text-white",
22
- navy: "text-[#00002D]",
23
- };
24
-
25
- const bgColorClasses: Record<ThemeKey, string> = {
26
- blue: "bg-[#07B2E2]",
27
- green: "bg-[#26B170]",
28
- yellow: "bg-[#F5FF1E]",
29
- purple: "bg-[#931D69]",
30
- white: "bg-white",
31
- navy: "bg-[#00002D]",
32
- };
33
-
34
- const isThemeKey =
35
- typeof background === "string" && background in bgColorClasses;
36
-
37
- const bgClass = isThemeKey
38
- ? bgColorClasses[background as ThemeKey]
39
- : undefined;
40
- const bgStyle = background && !isThemeKey ? { background } : undefined;
41
-
42
- const fillClass =
43
- fill in textColorClasses
44
- ? textColorClasses[fill as ThemeKey]
45
- : "text-[#F5FF1E]";
46
-
47
- if (!show) {
48
- return (
49
- <div className={className} style={bgStyle}>
50
- {children}
51
- </div>
52
- );
53
- }
54
-
55
- return (
56
- <div
57
- className={`shape-bg ${className ?? ""} ${maxFit ? "max-content" : ""} ${bgClass ?? (!bgStyle ? "bg-white" : "")
58
- }`}
59
- style={bgStyle}
60
- >
61
- {path === "path1" && (
62
- <svg
63
- className={`shape-bg-svg ${variantClass} fill-current ${fillClass}`}
64
- width="2262"
65
- height="4359"
66
- viewBox="0 0 2262 4359"
67
- fill="none"
68
- xmlns="http://www.w3.org/2000/svg"
69
- aria-hidden="true"
70
- focusable="false"
71
- >
72
- <path d="M1838.72 444.021C2216.45 758.242 2351.22 1060.81 2202.83 1982.25C2062.95 2851.55 1923.57 4265.14 1394.48 4348.94C1079.75 4409.66 766.955 4172.68 508.523 4003.04C340.876 3884.89 192.855 3774.9 26.6866 3661.93C-27.6562 3624.7 8.69435 3542.15 74.1261 3555.69C415.628 3626.61 686.916 3615.36 942.942 3443.48C1410.95 3163.54 1632.32 2141.02 1629.56 1543.75C1637.51 910.76 1276.06 582.318 829.643 352.709C587.562 235.528 333.508 169.963 100.699 149.757C31.9431 143.965 25.0259 47.9703 92.459 33.1281C623.196 -84.6769 1404.59 131.886 1839.84 443.573" />
73
- </svg>
74
- )}
75
- {path === "path2" && (
76
- <svg
77
- className={`shape-bg-svg ${variantClass} fill-current ${fillClass}`}
78
- width="3739"
79
- height="3666"
80
- viewBox="0 0 3739 3666"
81
- fill="none"
82
- xmlns="http://www.w3.org/2000/svg"
83
- aria-hidden="true"
84
- focusable="false"
85
- >
86
- <path d="M1662.93 3664.31C2153.52 3637.23 2442.1 3474.65 2872.31 2646.41C3278.25 1865.09 4009.1 647.09 3634.26 264.38C3417.79 27.9944 3025.37 31.7818 2716.76 13.9013C2511.72 8.81634 2327.31 8.87399 2126.55 0.511773C2060.73 -2.00127 2040.7 85.9475 2101.3 114.087C2417.76 260.743 2628.86 431.51 2731.94 722.142C2940.79 1225.9 2508.91 2178.82 2150.63 2656.7C1779.64 3169.63 1293.64 3217.84 798.345 3136.04C534.128 3085.8 291.072 2986.97 92.1133 2864.4C33.4593 2828.06 -29.3236 2901.01 15.967 2953.13C371.841 3364.12 1128.29 3656.09 1663.56 3665.34" />
87
- </svg>
88
- )}
89
- {path === "path3" && (
90
- <svg
91
- className={`shape-bg-svg ${variantClass} fill-current ${fillClass}`}
92
- width="3044"
93
- height="3248"
94
- viewBox="0 0 3044 3248"
95
- fill="none"
96
- xmlns="http://www.w3.org/2000/svg"
97
- aria-hidden="true"
98
- focusable="false"
99
- >
100
- <path d="M1.21857 1353.6C-0.931975 1765.46 120.504 2015.15 791.765 2417.01C1424.98 2796.19 2407.16 3469.31 2746.34 3175.04C2955.08 3005.86 2971.76 2677.32 3002.33 2420C3016.95 2248.7 3026.23 2094.39 3043.38 1926.83C3048.81 1871.88 2976.24 1850.67 2949.63 1899.96C2810.91 2157.33 2657.35 2325.33 2408.95 2396.88C1976.88 2546.15 1201.39 2136.59 819.655 1812.63C409.231 1476.27 393.475 1067.19 486.97 656.895C542.372 438.358 637.352 239.983 749.974 79.7081C783.347 32.4684 725.487 -23.7534 679.587 11.5067C317.699 288.49 35.1358 906.671 0.328344 1354.07" />
101
- </svg>
102
- )}
103
- {path === "path4" && (
104
- <svg
105
- className={`shape-bg-svg ${variantClass} fill-current ${fillClass}`}
106
- width="3739"
107
- height="3666"
108
- viewBox="0 0 3739 3666"
109
- fill="none"
110
- xmlns="http://www.w3.org/2000/svg"
111
- aria-hidden="true"
112
- focusable="false"
113
- >
114
- <path d="M1662.93 3664.31C2153.52 3637.23 2442.1 3474.65 2872.31 2646.41C3278.25 1865.1 4009.1 647.091 3634.26 264.381C3417.79 27.9951 3025.37 31.7826 2716.76 13.902C2511.72 8.81709 2327.31 8.87474 2126.55 0.512528C2060.73 -2.00052 2040.7 85.9483 2101.3 114.088C2417.76 260.743 2628.86 431.51 2731.94 722.143C2940.79 1225.9 2508.91 2178.82 2150.63 2656.7C1779.64 3169.63 1293.64 3217.84 798.345 3136.04C534.128 3085.8 291.072 2986.98 92.1133 2864.4C33.4593 2828.06 -29.3236 2901.01 15.967 2953.13C371.841 3364.12 1128.29 3656.09 1663.56 3665.34" />
115
- </svg>
116
- )}
117
-
118
- <div className="shape-bg-content">{children}</div>
119
- </div>
120
- );
121
- };
122
-
123
- export default ShapeBackgroundWrapper;
1
+ // ShapeBackgroundWrapper.tsx
2
+ import React from "react";
3
+
4
+ import { ShapeBackgroundWrapperProps, ThemeKey } from "./types";
5
+ export const ShapeBackgroundWrapper: React.FC<ShapeBackgroundWrapperProps> = ({
6
+ children,
7
+ background,
8
+ className,
9
+ fill = "yellow",
10
+ maxFit,
11
+ show = true,
12
+ path = "path2",
13
+ }) => {
14
+ const variantClass = `${path}`;
15
+
16
+ const textColorClasses: Record<ThemeKey, string> = {
17
+ blue: "text-[#07B2E2]",
18
+ green: "text-[#26B170]",
19
+ yellow: "text-[#F5FF1E]",
20
+ purple: "text-[#931D69]",
21
+ white: "text-white",
22
+ navy: "text-[#00002D]",
23
+ };
24
+
25
+ const bgColorClasses: Record<ThemeKey, string> = {
26
+ blue: "bg-[#07B2E2]",
27
+ green: "bg-[#26B170]",
28
+ yellow: "bg-[#F5FF1E]",
29
+ purple: "bg-[#931D69]",
30
+ white: "bg-white",
31
+ navy: "bg-[#00002D]",
32
+ };
33
+
34
+ const isThemeKey =
35
+ typeof background === "string" && background in bgColorClasses;
36
+
37
+ const bgClass = isThemeKey
38
+ ? bgColorClasses[background as ThemeKey]
39
+ : undefined;
40
+ const bgStyle = background && !isThemeKey ? { background } : undefined;
41
+
42
+ const fillClass =
43
+ fill in textColorClasses
44
+ ? textColorClasses[fill as ThemeKey]
45
+ : "text-[#F5FF1E]";
46
+
47
+ if (!show) {
48
+ return (
49
+ <div className={className} style={bgStyle}>
50
+ {children}
51
+ </div>
52
+ );
53
+ }
54
+
55
+ return (
56
+ <div
57
+ className={`shape-bg relative overflow-hidden ${className ?? ""} ${maxFit ? "max-content" : ""} ${bgClass ?? (!bgStyle ? "bg-white" : "")
58
+ }`}
59
+ style={bgStyle}
60
+ >
61
+ {path === "path1" && (
62
+ <svg
63
+ className={`shape-bg-svg absolute pointer-events-none z-0 left-1/2 top-[-2371px] -translate-x-[-55%] ${variantClass} fill-current ${fillClass}`}
64
+ width="2262"
65
+ height="4359"
66
+ viewBox="0 0 2262 4359"
67
+ fill="none"
68
+ xmlns="http://www.w3.org/2000/svg"
69
+ aria-hidden="true"
70
+ focusable="false"
71
+ >
72
+ <path d="M1838.72 444.021C2216.45 758.242 2351.22 1060.81 2202.83 1982.25C2062.95 2851.55 1923.57 4265.14 1394.48 4348.94C1079.75 4409.66 766.955 4172.68 508.523 4003.04C340.876 3884.89 192.855 3774.9 26.6866 3661.93C-27.6562 3624.7 8.69435 3542.15 74.1261 3555.69C415.628 3626.61 686.916 3615.36 942.942 3443.48C1410.95 3163.54 1632.32 2141.02 1629.56 1543.75C1637.51 910.76 1276.06 582.318 829.643 352.709C587.562 235.528 333.508 169.963 100.699 149.757C31.9431 143.965 25.0259 47.9703 92.459 33.1281C623.196 -84.6769 1404.59 131.886 1839.84 443.573" />
73
+ </svg>
74
+ )}
75
+ {path === "path2" && (
76
+ <svg
77
+ className={`shape-bg-svg absolute pointer-events-none z-0 left-1/2 top-[45.8px] -translate-x-[-101%] ${variantClass} fill-current ${fillClass}`}
78
+ width="3739"
79
+ height="3666"
80
+ viewBox="0 0 3739 3666"
81
+ fill="none"
82
+ xmlns="http://www.w3.org/2000/svg"
83
+ aria-hidden="true"
84
+ focusable="false"
85
+ >
86
+ <path d="M1662.93 3664.31C2153.52 3637.23 2442.1 3474.65 2872.31 2646.41C3278.25 1865.09 4009.1 647.09 3634.26 264.38C3417.79 27.9944 3025.37 31.7818 2716.76 13.9013C2511.72 8.81634 2327.31 8.87399 2126.55 0.511773C2060.73 -2.00127 2040.7 85.9475 2101.3 114.087C2417.76 260.743 2628.86 431.51 2731.94 722.142C2940.79 1225.9 2508.91 2178.82 2150.63 2656.7C1779.64 3169.63 1293.64 3217.84 798.345 3136.04C534.128 3085.8 291.072 2986.97 92.1133 2864.4C33.4593 2828.06 -29.3236 2901.01 15.967 2953.13C371.841 3364.12 1128.29 3656.09 1663.56 3665.34" />
87
+ </svg>
88
+ )}
89
+ {path === "path3" && (
90
+ <svg
91
+ className={`shape-bg-svg absolute pointer-events-none z-0 top-[-2600px] left-1/2 -translate-x-[-55%] ${variantClass} fill-current ${fillClass}`}
92
+ width="3044"
93
+ height="3248"
94
+ viewBox="0 0 3044 3248"
95
+ fill="none"
96
+ xmlns="http://www.w3.org/2000/svg"
97
+ aria-hidden="true"
98
+ focusable="false"
99
+ >
100
+ <path d="M1.21857 1353.6C-0.931975 1765.46 120.504 2015.15 791.765 2417.01C1424.98 2796.19 2407.16 3469.31 2746.34 3175.04C2955.08 3005.86 2971.76 2677.32 3002.33 2420C3016.95 2248.7 3026.23 2094.39 3043.38 1926.83C3048.81 1871.88 2976.24 1850.67 2949.63 1899.96C2810.91 2157.33 2657.35 2325.33 2408.95 2396.88C1976.88 2546.15 1201.39 2136.59 819.655 1812.63C409.231 1476.27 393.475 1067.19 486.97 656.895C542.372 438.358 637.352 239.983 749.974 79.7081C783.347 32.4684 725.487 -23.7534 679.587 11.5067C317.699 288.49 35.1358 906.671 0.328344 1354.07" />
101
+ </svg>
102
+ )}
103
+ {path === "path4" && (
104
+ <svg
105
+ className={`shape-bg-svg absolute pointer-events-none z-0 left-1/2 top-[-1966.1px] -translate-x-[-48%] ${variantClass} fill-current ${fillClass}`}
106
+ width="3739"
107
+ height="3666"
108
+ viewBox="0 0 3739 3666"
109
+ fill="none"
110
+ xmlns="http://www.w3.org/2000/svg"
111
+ aria-hidden="true"
112
+ focusable="false"
113
+ >
114
+ <path d="M1662.93 3664.31C2153.52 3637.23 2442.1 3474.65 2872.31 2646.41C3278.25 1865.1 4009.1 647.091 3634.26 264.381C3417.79 27.9951 3025.37 31.7826 2716.76 13.902C2511.72 8.81709 2327.31 8.87474 2126.55 0.512528C2060.73 -2.00052 2040.7 85.9483 2101.3 114.088C2417.76 260.743 2628.86 431.51 2731.94 722.143C2940.79 1225.9 2508.91 2178.82 2150.63 2656.7C1779.64 3169.63 1293.64 3217.84 798.345 3136.04C534.128 3085.8 291.072 2986.98 92.1133 2864.4C33.4593 2828.06 -29.3236 2901.01 15.967 2953.13C371.841 3364.12 1128.29 3656.09 1663.56 3665.34" />
115
+ </svg>
116
+ )}
117
+
118
+ <div className="shape-bg-content relative z-[1]">{children}</div>
119
+ </div>
120
+ );
121
+ };
122
+
123
+ export default ShapeBackgroundWrapper;
@@ -1,35 +1,35 @@
1
- import React from "react";
2
- export const svgPaths: Record<string, string> = {
3
- path1:
4
- "M6183.96 7035.43C6943.82 6952.66 7380.2 6676.58 7990.48 5362.95C8565.72 4123.69 9615.39 2181.9 9006.03 1622.93C8652.98 1276.95 8045.02 1315.49 7564.14 1313.75C7245.36 1323.32 6958.63 1339.47 6647.54 1342.72C6545.53 1343.83 6520.42 1482.38 6615.44 1520.24C7116.37 1719.55 7456.61 1965.53 7637.69 2405.03C7996.29 3164.74 7392.93 4672.05 6870.51 5439.14C6330.05 6261.86 5579.71 6377.14 4804.66 6292.58C4390.94 6237.27 4007.68 6104.9 3689.42 5932.73C3595.96 5881.89 3503.99 5999.87 3577.76 6076.26C4158.63 6680.16 5353 7066.59 6184.5 7035.07",
5
- path2:
6
- "M7084.87 3152.11C6998.44 2399.11 6718.09 1965.81 5389.62 1356.34C4136.36 781.869 2172.07 -265.216 1610.51 336.377C1262.56 684.784 1303.76 1287.15 1303.81 1763.48C1314.67 2079.29 1332.06 2363.37 1336.52 2671.54C1338.02 2772.59 1477.99 2797.98 1515.86 2704.01C1715.18 2208.55 1962.22 1872.45 2405.24 1694.74C3170.84 1342.39 4694.82 1945.74 5471.2 2466.11C6303.81 3004.57 6423.02 3748.26 6340.57 4515.68C6286.3 4925.29 6154.1 5304.42 5981.5 5619.04C5930.51 5711.42 6049.97 5802.96 6126.81 5730.18C6734.29 5157.06 7119.9 3975.43 7084.95 3151.67",
7
- path3:
8
- "M3161.08 2245.08C2401.23 2327.85 1964.85 2603.93 1354.57 3917.56C779.331 5156.82 -270.345 7098.61 339.023 7657.58C692.066 8003.56 1300.03 7965.02 1780.91 7966.76C2099.69 7957.19 2386.42 7941.04 2697.51 7937.79C2799.52 7936.68 2824.63 7798.13 2729.61 7760.27C2228.68 7560.96 1888.43 7314.98 1707.36 6875.48C1348.76 6115.77 1952.12 4608.46 2474.54 3841.37C3015 3018.65 3765.34 2903.37 4540.39 2987.93C4954.11 3043.24 5337.36 3175.61 5655.63 3347.77C5749.09 3398.62 5841.06 3280.64 5767.29 3204.25C5186.41 2600.35 3992.04 2213.93 3160.55 2245.44",
9
- path4:
10
- "M2260.18 6128.4C2346.6 6881.39 2626.96 7314.69 3955.43 7924.16C5208.69 8498.64 7172.98 9545.72 7734.98 8944.21C8082.94 8595.81 8041.74 7993.44 8041.68 7517.11C8030.82 7201.3 8013.43 6917.22 8008.98 6609.05C8007.48 6508 7867.51 6482.61 7829.64 6576.58C7630.32 7072.04 7383.27 7408.14 6940.26 7585.85C6174.65 7938.2 4650.68 7334.85 3874.29 6814.48C3041.68 6276.02 2922.48 5532.33 3004.93 4764.91C3059.2 4355.3 3191.4 3976.17 3364 3661.56C3414.98 3569.17 3295.53 3477.63 3218.68 3550.41C2611.21 4123.53 2225.6 5305.17 2260.54 6128.92",
11
-
12
- path5:
13
- "M1282.49 -1892.66C1660.21 -1578.44 1794.98 -1275.87 1646.6 -354.424C1506.72 514.868 1367.34 1928.46 838.242 2012.26C523.517 2072.99 210.72 1836 -47.7117 1666.37C-215.358 1548.21 -363.379 1438.22 -529.548 1325.25C-583.891 1288.03 -547.54 1205.47 -482.108 1219.01C-140.607 1289.93 130.682 1278.68 386.707 1106.8C854.714 826.863 1076.08 -195.662 1073.33 -792.933C1081.27 -1425.92 719.826 -1754.36 273.408 -1983.97C31.3272 -2101.15 -222.727 -2166.72 -455.536 -2186.92C-524.291 -2192.71 -531.208 -2288.71 -463.775 -2303.55C66.962 -2421.36 848.353 -2204.79 1283.6 -1893.11",
14
- };
15
-
16
- export type ThemeKey =
17
- | "blue"
18
- | "green"
19
- | "yellow"
20
- | "purple"
21
- | "white"
22
- | "navy";
23
-
24
- // Infers the union of keys from the svgPaths constant
25
- export type SvgPathKey = keyof typeof svgPaths;
26
-
27
- export type ShapeBackgroundWrapperProps = {
28
- path?: SvgPathKey;
29
- fill?: ThemeKey | string;
30
- className?: string;
31
- children?: React.ReactNode;
32
- maxFit?: boolean;
33
- background?: ThemeKey | string;
34
- show?: boolean;
35
- };
1
+ import React from "react";
2
+ export const svgPaths: Record<string, string> = {
3
+ path1:
4
+ "M6183.96 7035.43C6943.82 6952.66 7380.2 6676.58 7990.48 5362.95C8565.72 4123.69 9615.39 2181.9 9006.03 1622.93C8652.98 1276.95 8045.02 1315.49 7564.14 1313.75C7245.36 1323.32 6958.63 1339.47 6647.54 1342.72C6545.53 1343.83 6520.42 1482.38 6615.44 1520.24C7116.37 1719.55 7456.61 1965.53 7637.69 2405.03C7996.29 3164.74 7392.93 4672.05 6870.51 5439.14C6330.05 6261.86 5579.71 6377.14 4804.66 6292.58C4390.94 6237.27 4007.68 6104.9 3689.42 5932.73C3595.96 5881.89 3503.99 5999.87 3577.76 6076.26C4158.63 6680.16 5353 7066.59 6184.5 7035.07",
5
+ path2:
6
+ "M7084.87 3152.11C6998.44 2399.11 6718.09 1965.81 5389.62 1356.34C4136.36 781.869 2172.07 -265.216 1610.51 336.377C1262.56 684.784 1303.76 1287.15 1303.81 1763.48C1314.67 2079.29 1332.06 2363.37 1336.52 2671.54C1338.02 2772.59 1477.99 2797.98 1515.86 2704.01C1715.18 2208.55 1962.22 1872.45 2405.24 1694.74C3170.84 1342.39 4694.82 1945.74 5471.2 2466.11C6303.81 3004.57 6423.02 3748.26 6340.57 4515.68C6286.3 4925.29 6154.1 5304.42 5981.5 5619.04C5930.51 5711.42 6049.97 5802.96 6126.81 5730.18C6734.29 5157.06 7119.9 3975.43 7084.95 3151.67",
7
+ path3:
8
+ "M3161.08 2245.08C2401.23 2327.85 1964.85 2603.93 1354.57 3917.56C779.331 5156.82 -270.345 7098.61 339.023 7657.58C692.066 8003.56 1300.03 7965.02 1780.91 7966.76C2099.69 7957.19 2386.42 7941.04 2697.51 7937.79C2799.52 7936.68 2824.63 7798.13 2729.61 7760.27C2228.68 7560.96 1888.43 7314.98 1707.36 6875.48C1348.76 6115.77 1952.12 4608.46 2474.54 3841.37C3015 3018.65 3765.34 2903.37 4540.39 2987.93C4954.11 3043.24 5337.36 3175.61 5655.63 3347.77C5749.09 3398.62 5841.06 3280.64 5767.29 3204.25C5186.41 2600.35 3992.04 2213.93 3160.55 2245.44",
9
+ path4:
10
+ "M2260.18 6128.4C2346.6 6881.39 2626.96 7314.69 3955.43 7924.16C5208.69 8498.64 7172.98 9545.72 7734.98 8944.21C8082.94 8595.81 8041.74 7993.44 8041.68 7517.11C8030.82 7201.3 8013.43 6917.22 8008.98 6609.05C8007.48 6508 7867.51 6482.61 7829.64 6576.58C7630.32 7072.04 7383.27 7408.14 6940.26 7585.85C6174.65 7938.2 4650.68 7334.85 3874.29 6814.48C3041.68 6276.02 2922.48 5532.33 3004.93 4764.91C3059.2 4355.3 3191.4 3976.17 3364 3661.56C3414.98 3569.17 3295.53 3477.63 3218.68 3550.41C2611.21 4123.53 2225.6 5305.17 2260.54 6128.92",
11
+
12
+ path5:
13
+ "M1282.49 -1892.66C1660.21 -1578.44 1794.98 -1275.87 1646.6 -354.424C1506.72 514.868 1367.34 1928.46 838.242 2012.26C523.517 2072.99 210.72 1836 -47.7117 1666.37C-215.358 1548.21 -363.379 1438.22 -529.548 1325.25C-583.891 1288.03 -547.54 1205.47 -482.108 1219.01C-140.607 1289.93 130.682 1278.68 386.707 1106.8C854.714 826.863 1076.08 -195.662 1073.33 -792.933C1081.27 -1425.92 719.826 -1754.36 273.408 -1983.97C31.3272 -2101.15 -222.727 -2166.72 -455.536 -2186.92C-524.291 -2192.71 -531.208 -2288.71 -463.775 -2303.55C66.962 -2421.36 848.353 -2204.79 1283.6 -1893.11",
14
+ };
15
+
16
+ export type ThemeKey =
17
+ | "blue"
18
+ | "green"
19
+ | "yellow"
20
+ | "purple"
21
+ | "white"
22
+ | "navy";
23
+
24
+ // Infers the union of keys from the svgPaths constant
25
+ export type SvgPathKey = keyof typeof svgPaths;
26
+
27
+ export type ShapeBackgroundWrapperProps = {
28
+ path?: SvgPathKey;
29
+ fill?: ThemeKey | string;
30
+ className?: string;
31
+ children?: React.ReactNode;
32
+ maxFit?: boolean;
33
+ background?: ThemeKey | string;
34
+ show?: boolean;
35
+ };
@@ -1,6 +1,6 @@
1
- import { TextProps } from "./types";
2
-
3
- export const Text: React.FC<{ fields: TextProps }> = ({ fields }) => {
4
- return <div>Text Block</div>;
5
- };
6
- export default Text;
1
+ import { TextProps } from "./types";
2
+
3
+ export const Text: React.FC<{ fields: TextProps }> = ({ fields }) => {
4
+ return <div>Text Block</div>;
5
+ };
6
+ export default Text;
@@ -36,4 +36,7 @@ export { Modal } from "./blocks/modal";
36
36
  export type { ModalProps } from "./blocks/modal/types";
37
37
 
38
38
  export { ShapeBackgroundWrapper } from "./blocks/shape-background-wrapper";
39
- export type { ShapeBackgroundWrapperProps } from "./blocks/shape-background-wrapper/types";
39
+ export type { ShapeBackgroundWrapperProps } from "./blocks/shape-background-wrapper/types";
40
+
41
+ export { CtaCallout } from "./blocks/cta-callout";
42
+ export type { CtaCalloutProps } from "./blocks/cta-callout/types";