@windstream/react-shared-components 0.1.70 → 0.1.72
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/contentful/index.d.ts +104 -28
- package/dist/contentful/index.esm.js +3 -3
- package/dist/contentful/index.esm.js.map +1 -1
- package/dist/contentful/index.js +3 -3
- package/dist/contentful/index.js.map +1 -1
- package/dist/core.d.ts +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/next/index.esm.js.map +1 -1
- package/dist/next/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/utils/index.d.ts +12 -1
- package/dist/utils/index.esm.js +1 -1
- package/dist/utils/index.esm.js.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/next-image/index.tsx +3 -1
- package/src/contentful/blocks/accordion/Accordion.stories.mocks.tsx +8 -8
- package/src/contentful/blocks/accordion/Accordion.stories.tsx +5 -13
- package/src/contentful/blocks/address-input-banner/index.tsx +5 -5
- package/src/contentful/blocks/anchored-bottom-banner/index.tsx +114 -3
- package/src/contentful/blocks/anchored-bottom-banner/types.ts +4 -1
- package/src/contentful/blocks/blogs-grid-base/types.ts +1 -0
- package/src/contentful/blocks/callout/index.tsx +201 -37
- package/src/contentful/blocks/callout/types.ts +56 -3
- package/src/contentful/blocks/cards/floating-image-card/index.tsx +119 -0
- package/src/contentful/blocks/cards/floating-image-card/types.ts +30 -0
- package/src/contentful/blocks/cards/full-image-card/index.tsx +130 -0
- package/src/contentful/blocks/cards/full-image-card/types.ts +29 -0
- package/src/contentful/blocks/cards/simple-card/index.tsx +294 -58
- package/src/contentful/blocks/cards/simple-card/types.ts +47 -4
- package/src/contentful/blocks/cart-retention-banner/types.ts +2 -2
- package/src/contentful/blocks/comparison-table/index.tsx +5 -3
- package/src/contentful/blocks/email-input-block/index.tsx +1 -2
- package/src/contentful/blocks/footer/Footer.stories.tsx +145 -32
- package/src/contentful/index.ts +1 -2
- package/src/hooks/contentful/use-contentful-rich-text.tsx +9 -10
- package/src/utils/index.ts +3 -0
- package/src/utils/speed-card-bg.ts +24 -0
|
@@ -1,21 +1,64 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
import { ButtonProps } from "../../button/types";
|
|
1
|
+
import type { CSSProperties, ReactNode } from "react";
|
|
2
|
+
import type { ButtonProps } from "../../button/types";
|
|
3
|
+
|
|
4
|
+
export type PinwheelColor =
|
|
5
|
+
| "Blue-#307998"
|
|
6
|
+
| "Green-#209A61"
|
|
7
|
+
| "Orange-#DE7E0A"
|
|
8
|
+
| "Purple-#7E1458"
|
|
9
|
+
| (string & {});
|
|
10
|
+
|
|
11
|
+
export type SimpleCardCtaBottom = {
|
|
12
|
+
title?: string;
|
|
13
|
+
href?: string;
|
|
14
|
+
};
|
|
3
15
|
|
|
4
16
|
export type Item = {
|
|
5
17
|
title?: string;
|
|
6
18
|
image?: string;
|
|
19
|
+
imageAlt?: string;
|
|
20
|
+
imageWidth?: number;
|
|
21
|
+
imageHeight?: number;
|
|
7
22
|
imageAlignment?: "left" | "right" | "center";
|
|
8
|
-
|
|
23
|
+
iconAlignment?: "left" | "right" | "center";
|
|
24
|
+
/**
|
|
25
|
+
* Layout variant for the image. `standard` / `icon` render an inline
|
|
26
|
+
* icon above the content. `full` renders a full-bleed top image.
|
|
27
|
+
* `margin` is `full` with horizontal padding.
|
|
28
|
+
*/
|
|
29
|
+
imageView?: "standard" | "icon" | "full" | "margin" | "inset";
|
|
30
|
+
body?: ReactNode;
|
|
31
|
+
/** Optional secondary rich-text region (port of local `richText`). */
|
|
32
|
+
richText?: ReactNode;
|
|
9
33
|
cta?: ButtonProps;
|
|
10
34
|
ctaAlignment?: "left" | "right" | "center";
|
|
11
|
-
|
|
35
|
+
/** Top "location" CTA, rendered above the title with a `location_on` icon. */
|
|
36
|
+
ctaBottom?: SimpleCardCtaBottom;
|
|
37
|
+
ctaAlignmentBottom?: "left" | "right" | "center";
|
|
38
|
+
/** Legacy token-based card background (mapped via `backgroundColorMap`). */
|
|
12
39
|
backgroundColor?: string;
|
|
40
|
+
/** Raw color value used when `applyCardBackgroundColor` is true. */
|
|
41
|
+
applyCardBackgroundColor?: boolean;
|
|
42
|
+
textColor?: string;
|
|
43
|
+
showBackgroundImage?: boolean;
|
|
44
|
+
pinwheelColor?: PinwheelColor;
|
|
45
|
+
/** On `lg:` and up, lays out icon + content side-by-side. */
|
|
46
|
+
imageToRichTextAlignment?: boolean;
|
|
47
|
+
/** Bold label between title and the phone/hours table. */
|
|
48
|
+
titleLocation?: string;
|
|
49
|
+
phoneNumber?: string[];
|
|
50
|
+
/** Each entry uses a `label|value` separator. */
|
|
51
|
+
workingHours?: string[];
|
|
52
|
+
shadow?: boolean;
|
|
13
53
|
};
|
|
14
54
|
|
|
15
55
|
export type SimpleCardProps = {
|
|
16
56
|
card: Item;
|
|
17
57
|
lgWidth?: string;
|
|
18
58
|
mdWidth?: string;
|
|
59
|
+
className?: string;
|
|
60
|
+
contentClassName?: string;
|
|
61
|
+
style?: CSSProperties;
|
|
19
62
|
};
|
|
20
63
|
|
|
21
64
|
export const backgroundColorMap: Record<string, string> = {
|
|
@@ -4,8 +4,8 @@ export interface TypeCartRetentionBannerFields {
|
|
|
4
4
|
mainHeading?: string;
|
|
5
5
|
description?: {
|
|
6
6
|
json: any;
|
|
7
|
-
};
|
|
8
|
-
|
|
7
|
+
};
|
|
8
|
+
cta?: { buttonLabel?: string; [key: string]: any };
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export type TypeCartRetentionBanner = TypeCartRetentionBannerFields;
|
|
@@ -12,12 +12,14 @@ export const ComparisonTable: React.FC<ComparisonTableProps> = ({
|
|
|
12
12
|
return (
|
|
13
13
|
<div className="component-container">
|
|
14
14
|
<div
|
|
15
|
-
className={`mx-5 mb-5 mt-8
|
|
15
|
+
className={`mx-5 mb-5 mt-8 md:mt-18 ${maxWidth ? "max-w-120 xl:mx-auto" : ""}`}
|
|
16
16
|
>
|
|
17
|
-
<Text as="h2" className="heading2
|
|
17
|
+
<Text as="h2" className="heading2 md:heading1 md:text-center">
|
|
18
18
|
{title}
|
|
19
19
|
</Text>
|
|
20
|
-
<div className="comparison-table-container mt-
|
|
20
|
+
<div className="comparison-table-container mt-5 p-5 pt-0 md:mt-10 md:px-10 md:py-9">
|
|
21
|
+
{table}
|
|
22
|
+
</div>
|
|
21
23
|
<Text as="div" className="micro mt-8 text-center">
|
|
22
24
|
{disclaimer}
|
|
23
25
|
</Text>
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import React, { useState } from "react";
|
|
4
|
+
import { Button } from "../button";
|
|
4
5
|
import { EmailInputBlockProps } from "./types";
|
|
5
6
|
|
|
6
|
-
import { Button } from "@shared/contentful";
|
|
7
|
-
|
|
8
7
|
export const EmailInputBlock: React.FC<EmailInputBlockProps> = props => {
|
|
9
8
|
const {
|
|
10
9
|
anchorId = "email-input",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Footer } from "./index";
|
|
2
|
+
|
|
2
3
|
import { DocsPage } from "@shared/stories/DocsTemplate";
|
|
3
4
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
5
|
|
|
@@ -27,11 +28,13 @@ const meta: Meta<typeof Footer> = {
|
|
|
27
28
|
argTypes: {
|
|
28
29
|
body: {
|
|
29
30
|
control: "text",
|
|
30
|
-
description:
|
|
31
|
+
description:
|
|
32
|
+
"HTML string for disclaimer or promotional body content at top of footer",
|
|
31
33
|
},
|
|
32
34
|
copyrights: {
|
|
33
35
|
control: "text",
|
|
34
|
-
description:
|
|
36
|
+
description:
|
|
37
|
+
"HTML string for copyright description text rendered below the year",
|
|
35
38
|
},
|
|
36
39
|
terms: {
|
|
37
40
|
control: "text",
|
|
@@ -64,14 +67,46 @@ const meta: Meta<typeof Footer> = {
|
|
|
64
67
|
title: "Explore",
|
|
65
68
|
items: {
|
|
66
69
|
items: [
|
|
67
|
-
{
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
{
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
{
|
|
71
|
+
buttonLabel: "Fiber Internet",
|
|
72
|
+
href: "/fiber-internet",
|
|
73
|
+
showButtonAs: "text",
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
buttonLabel: "High-Speed Internet",
|
|
77
|
+
href: "/high-speed-internet",
|
|
78
|
+
showButtonAs: "text",
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
buttonLabel: "Whole Home Wi-Fi",
|
|
82
|
+
href: "/whole-home-wifi",
|
|
83
|
+
showButtonAs: "text",
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
buttonLabel: "Internet Security",
|
|
87
|
+
href: "/kinetic-secure-packs",
|
|
88
|
+
showButtonAs: "text",
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
buttonLabel: "AT&T Wireless",
|
|
92
|
+
href: "/att-wireless",
|
|
93
|
+
showButtonAs: "text",
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
buttonLabel: "TV & Entertainment",
|
|
97
|
+
href: "/products",
|
|
98
|
+
showButtonAs: "text",
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
buttonLabel: "Home Phone",
|
|
102
|
+
href: "/home-phone",
|
|
103
|
+
showButtonAs: "text",
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
buttonLabel: "Kinetic Wi-Fi Manager",
|
|
107
|
+
href: "/wifi-manager",
|
|
108
|
+
showButtonAs: "text",
|
|
109
|
+
},
|
|
75
110
|
],
|
|
76
111
|
},
|
|
77
112
|
},
|
|
@@ -80,14 +115,46 @@ const meta: Meta<typeof Footer> = {
|
|
|
80
115
|
items: {
|
|
81
116
|
items: [
|
|
82
117
|
{ buttonLabel: "Support", href: "/support", showButtonAs: "text" },
|
|
83
|
-
{
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
{
|
|
89
|
-
|
|
90
|
-
|
|
118
|
+
{
|
|
119
|
+
buttonLabel: "Find Local",
|
|
120
|
+
href: "/find-local",
|
|
121
|
+
showButtonAs: "text",
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
buttonLabel: "Go Kinetic Customer Portal",
|
|
125
|
+
href: "https://www.my.gokinetic.com/",
|
|
126
|
+
showButtonAs: "text",
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
buttonLabel: "Move My Service",
|
|
130
|
+
href: "/moving-my-internet-service",
|
|
131
|
+
showButtonAs: "text",
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
buttonLabel: "Kinetic Blog",
|
|
135
|
+
href: "/blog",
|
|
136
|
+
showButtonAs: "text",
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
buttonLabel: "Referral Program",
|
|
140
|
+
href: "/refer-a-friend-program",
|
|
141
|
+
showButtonAs: "text",
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
buttonLabel: "Lifeline Assistance Program",
|
|
145
|
+
href: "/lifeline",
|
|
146
|
+
showButtonAs: "text",
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
buttonLabel: "Digital Literacy Program",
|
|
150
|
+
href: "/residential/digital-literacy-program",
|
|
151
|
+
showButtonAs: "text",
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
buttonLabel: "Become an Authorized Dealer",
|
|
155
|
+
href: "/authorized-dealer",
|
|
156
|
+
showButtonAs: "text",
|
|
157
|
+
},
|
|
91
158
|
],
|
|
92
159
|
},
|
|
93
160
|
},
|
|
@@ -98,12 +165,36 @@ const meta: Meta<typeof Footer> = {
|
|
|
98
165
|
{ buttonLabel: "About Us", href: "/about", showButtonAs: "text" },
|
|
99
166
|
{ buttonLabel: "Careers", href: "/careers", showButtonAs: "text" },
|
|
100
167
|
{ buttonLabel: "News", href: "/news", showButtonAs: "text" },
|
|
101
|
-
{
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
{
|
|
168
|
+
{
|
|
169
|
+
buttonLabel: "Investor Relations",
|
|
170
|
+
href: "https://investor.windstream.com",
|
|
171
|
+
showButtonAs: "text",
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
buttonLabel: "Suppliers",
|
|
175
|
+
href: "/about/supplier-information",
|
|
176
|
+
showButtonAs: "text",
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
buttonLabel: "Offer Conditions",
|
|
180
|
+
href: "/offer-conditions",
|
|
181
|
+
showButtonAs: "text",
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
buttonLabel: "Broadband Network Statement",
|
|
185
|
+
href: "/about/legal/broadband-network-statement",
|
|
186
|
+
showButtonAs: "text",
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
buttonLabel: "Law Enforcement Support Center",
|
|
190
|
+
href: "/law-enforcement-support-center-2",
|
|
191
|
+
showButtonAs: "text",
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
buttonLabel: "Call Authentication Statement",
|
|
195
|
+
href: "/about/legal/call-authentication-statement",
|
|
196
|
+
showButtonAs: "text",
|
|
197
|
+
},
|
|
107
198
|
],
|
|
108
199
|
},
|
|
109
200
|
},
|
|
@@ -112,16 +203,36 @@ const meta: Meta<typeof Footer> = {
|
|
|
112
203
|
items: {
|
|
113
204
|
items: [
|
|
114
205
|
{ buttonLabel: "Residential", href: "/", showButtonAs: "text" },
|
|
115
|
-
{
|
|
116
|
-
|
|
206
|
+
{
|
|
207
|
+
buttonLabel: "Business",
|
|
208
|
+
href: "/business",
|
|
209
|
+
showButtonAs: "text",
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
buttonLabel: "Uniti Solutions",
|
|
213
|
+
href: "/enterprise",
|
|
214
|
+
showButtonAs: "text",
|
|
215
|
+
},
|
|
117
216
|
],
|
|
118
217
|
},
|
|
119
218
|
},
|
|
120
219
|
],
|
|
121
220
|
bottomLinks: [
|
|
122
|
-
{
|
|
123
|
-
|
|
124
|
-
|
|
221
|
+
{
|
|
222
|
+
buttonLabel: "Privacy Policy",
|
|
223
|
+
href: "/about/legal/privacy-policy",
|
|
224
|
+
showButtonAs: "text",
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
buttonLabel: "Terms & Conditions",
|
|
228
|
+
href: "/about/legal/terms-and-conditions",
|
|
229
|
+
showButtonAs: "text",
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
buttonLabel: "Legal Notice",
|
|
233
|
+
href: "/about/legal/legal-notices",
|
|
234
|
+
showButtonAs: "text",
|
|
235
|
+
},
|
|
125
236
|
],
|
|
126
237
|
},
|
|
127
238
|
render: ({ body, copyrights, ...rest }) => (
|
|
@@ -177,7 +288,8 @@ export const FullWidth: Story = {
|
|
|
177
288
|
parameters: {
|
|
178
289
|
docs: {
|
|
179
290
|
description: {
|
|
180
|
-
story:
|
|
291
|
+
story:
|
|
292
|
+
"Footer without max-width constraint — spans full container width.",
|
|
181
293
|
},
|
|
182
294
|
},
|
|
183
295
|
},
|
|
@@ -191,7 +303,8 @@ export const Minimal: Story = {
|
|
|
191
303
|
parameters: {
|
|
192
304
|
docs: {
|
|
193
305
|
description: {
|
|
194
|
-
story:
|
|
306
|
+
story:
|
|
307
|
+
"Minimal footer with only terms and copyright text — no body, no links.",
|
|
195
308
|
},
|
|
196
309
|
},
|
|
197
310
|
},
|
|
@@ -201,4 +314,4 @@ export const Minimal: Story = {
|
|
|
201
314
|
bottomLinks: [],
|
|
202
315
|
copyrights: undefined,
|
|
203
316
|
},
|
|
204
|
-
};
|
|
317
|
+
};
|
package/src/contentful/index.ts
CHANGED
|
@@ -87,8 +87,7 @@ export { EmailInputBlock } from "./blocks/email-input-block";
|
|
|
87
87
|
export type { EmailInputBlockProps } from "./blocks/email-input-block/types";
|
|
88
88
|
|
|
89
89
|
export { default as CartRetentionBanner } from "./blocks/cart-retention-banner";
|
|
90
|
-
export type {TypeCartRetentionBannerFields as CartRetentionBannerProps } from "./blocks/cart-retention-banner/types";
|
|
91
|
-
|
|
90
|
+
export type { TypeCartRetentionBannerFields as CartRetentionBannerProps } from "./blocks/cart-retention-banner/types";
|
|
92
91
|
|
|
93
92
|
// Contentful Rich Text Hooks & Utils
|
|
94
93
|
export { toDocument } from "../utils/contentful/to-document";
|
|
@@ -206,15 +206,15 @@ export function renderContentfulRichTextTable(
|
|
|
206
206
|
...defaultOptions, // Spread defaultOptions so <p> and <strong> still work!
|
|
207
207
|
renderMark: {
|
|
208
208
|
...defaultOptions.renderMark,
|
|
209
|
-
[MARKS.BOLD]: text =>
|
|
209
|
+
[MARKS.BOLD]: text => (
|
|
210
|
+
<strong className="label4 md:label2">{text}</strong>
|
|
211
|
+
),
|
|
210
212
|
},
|
|
211
213
|
renderNode: {
|
|
212
214
|
...defaultOptions.renderNode,
|
|
213
|
-
[BLOCKS.PARAGRAPH]: (_node, children) =>
|
|
214
|
-
<div className="body2">{children}</div>
|
|
215
|
-
),
|
|
215
|
+
[BLOCKS.PARAGRAPH]: (_node, children) => <>{children}</>,
|
|
216
216
|
[BLOCKS.TABLE]: (node: any, children) => (
|
|
217
|
-
<div className="comparison-table-wrapper
|
|
217
|
+
<div className="comparison-table-wrapper w-full overflow-x-auto border-none md:overflow-hidden">
|
|
218
218
|
<table
|
|
219
219
|
className={`responsive-table w-full table-fixed border-collapse ${
|
|
220
220
|
node.content[0]?.content?.length > 2
|
|
@@ -230,11 +230,10 @@ export function renderContentfulRichTextTable(
|
|
|
230
230
|
<tr className="border-b border-gray-200 last:border-0">{children}</tr>
|
|
231
231
|
),
|
|
232
232
|
[BLOCKS.TABLE_HEADER_CELL]: (node: any, children) => {
|
|
233
|
-
// Find the parent row to check total column count
|
|
234
233
|
const isScrollable = node.parent?.content.length > 2;
|
|
235
234
|
return (
|
|
236
235
|
<th
|
|
237
|
-
className={`label4 break-words py-4 text-center ${isScrollable ? "sticky left-0 z-20 w-[50vw] min-w-[50vw] first:z-30 first:w-[50vw] first:min-w-[50vw] first:border-r" : "w-1/4 first:w-1/2"} `}
|
|
236
|
+
className={`label4 break-words py-4 text-center md:label2 ${isScrollable ? "sticky left-0 z-20 w-[50vw] min-w-[50vw] first:z-30 first:w-[50vw] first:min-w-[50vw] first:border-r" : "w-1/4 first:w-1/2"} `}
|
|
238
237
|
>
|
|
239
238
|
{children}
|
|
240
239
|
</th>
|
|
@@ -263,7 +262,7 @@ export function renderContentfulRichTextTable(
|
|
|
263
262
|
|
|
264
263
|
return (
|
|
265
264
|
<td
|
|
266
|
-
className={`rt-table-cell
|
|
265
|
+
className={`rt-table-cell footnote break-words bg-white py-2 text-center align-top leading-5 text-text md:body2 first:text-left md:leading-7 ${
|
|
267
266
|
isScrollable
|
|
268
267
|
? "w-[50vw] min-w-[50vw] first:sticky first:left-0 first:z-10 first:w-[50vw] first:min-w-[50vw] first:border-r"
|
|
269
268
|
: "w-1/4 first:w-1/2"
|
|
@@ -289,14 +288,14 @@ export function renderContentfulRichTextTable(
|
|
|
289
288
|
renderContentfulRichText(
|
|
290
289
|
toDocument(item?.checkListTitle ?? ""),
|
|
291
290
|
true,
|
|
292
|
-
"
|
|
291
|
+
""
|
|
293
292
|
)
|
|
294
293
|
) || [];
|
|
295
294
|
return (
|
|
296
295
|
<Checklist
|
|
297
296
|
items={items}
|
|
298
297
|
listIconName="disc"
|
|
299
|
-
listItemClassName="items-baseline body2"
|
|
298
|
+
listItemClassName="items-baseline footnote md:body2 leading-5 md:leading-7 text-text"
|
|
300
299
|
/>
|
|
301
300
|
);
|
|
302
301
|
}
|
package/src/utils/index.ts
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns an inline SVG string for the SpeedCard pinwheel decorative
|
|
3
|
+
* background. The two paths are filled with the provided color so callers
|
|
4
|
+
* can theme the background dynamically (used by SimpleCard when
|
|
5
|
+
* `showBackgroundImage` is enabled and a `pinwheelColor` is provided).
|
|
6
|
+
*
|
|
7
|
+
* Output is intended to be embedded as a `data:image/svg+xml;utf8,...`
|
|
8
|
+
* `background-image`. Encode the result with `encodeURIComponent`.
|
|
9
|
+
*/
|
|
10
|
+
export const SpeedCardBg = (color: string = "#24A76A"): string => {
|
|
11
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="684" height="107" viewBox="0 0 684 107" fill="none">
|
|
12
|
+
<g clip-path="url(#clip0_12352_9042)">
|
|
13
|
+
<path d="M154.09 -70.5605C173.769 -7.58032 204.79 24.8889 328.202 55.2823C444.619 83.9133 629.479 141.332 667.653 80.7015C691.679 45.2165 678.322 -5.62201 670.537 -46.3554C664.452 -73.1846 658.327 -97.1939 652.913 -123.475C651.135 -132.091 638.766 -131.974 637.067 -123.318C628.136 -77.6888 612.526 -44.9062 577.593 -22.4637C517.962 20.1889 377.954 -6.48361 303.148 -38.287C223.245 -70.7171 200.918 -132.366 195.425 -199.341C193.37 -235.257 198.467 -269.841 208.07 -299.569C210.915 -308.303 199.218 -314.178 193.844 -306.697C151.324 -247.751 137.69 -140.395 154.129 -70.5213" fill="${color}" />
|
|
14
|
+
<path d="M167.605 -417.382C104.062 -397.877 71.302 -367.131 40.6368 -244.813C11.7499 -129.428 -46.182 53.7941 14.9903 91.6292C50.7927 115.443 102.086 102.204 143.183 94.4883C170.253 88.4567 194.476 82.3858 220.992 77.02C229.686 75.2574 229.568 62.9983 220.834 61.3141C174.797 52.4624 141.721 36.9915 119.078 2.36813C76.0441 -56.7345 102.955 -195.502 135.043 -269.645C167.763 -348.84 229.963 -370.969 297.537 -376.414C333.774 -378.45 368.667 -373.398 398.661 -363.88C407.473 -361.06 413.401 -372.654 405.853 -377.98C346.38 -420.124 238.064 -433.636 167.565 -417.343" fill="${color}" />
|
|
15
|
+
</g>
|
|
16
|
+
<defs>
|
|
17
|
+
<clipPath id="clip0_12352_9042">
|
|
18
|
+
<rect width="684" height="107" fill="white" />
|
|
19
|
+
</clipPath>
|
|
20
|
+
</defs>
|
|
21
|
+
</svg>`;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default SpeedCardBg;
|