@windstream/react-shared-components 0.2.91 → 0.2.92
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 +8 -4
- package/dist/contentful/index.esm.js +1 -1
- package/dist/contentful/index.esm.js.map +1 -1
- package/dist/contentful/index.js +1 -1
- package/dist/contentful/index.js.map +1 -1
- package/dist/core.d.ts +2 -2
- package/dist/index.d.ts +3 -3
- package/package.json +1 -1
- package/src/contentful/blocks/callout/{callout.stories.tsx → Callout.stories.tsx} +1 -1
- package/src/contentful/blocks/cards/product-card/index.test.tsx +18 -0
- package/src/contentful/blocks/cards/product-card/index.tsx +1 -0
- package/src/contentful/blocks/cards/product-card/types.ts +8 -1
- package/src/contentful/blocks/navigation/{navigation.stories.tsx → Navigation.stories.tsx} +1 -1
- package/src/contentful/blocks/primary-hero/index.test.tsx +2 -2
- /package/src/contentful/blocks/carousel/{carousel.stories.tsx → Carousel.stories.tsx} +0 -0
package/dist/core.d.ts
CHANGED
|
@@ -67,8 +67,8 @@ type InputFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, "size"> & {
|
|
|
67
67
|
|
|
68
68
|
declare const InputField: ForwardRefRenderFunction<HTMLInputElement, InputFieldProps>;
|
|
69
69
|
declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size"> & {
|
|
70
|
-
state?: "
|
|
71
|
-
size?: "
|
|
70
|
+
state?: "default" | "focus" | "active" | "hover" | "filled" | "error" | undefined;
|
|
71
|
+
size?: "slim" | "medium" | "large" | undefined;
|
|
72
72
|
label?: string | undefined;
|
|
73
73
|
errorText?: string | undefined;
|
|
74
74
|
prefixIconName?: "search" | "location_on" | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -67,11 +67,11 @@ type InputFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, "size"> & {
|
|
|
67
67
|
|
|
68
68
|
declare const InputField: ForwardRefRenderFunction<HTMLInputElement, InputFieldProps>;
|
|
69
69
|
declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size"> & {
|
|
70
|
-
state?: "default" | "
|
|
71
|
-
size?: "
|
|
70
|
+
state?: "default" | "error" | "focus" | "active" | "hover" | "filled" | undefined;
|
|
71
|
+
size?: "medium" | "slim" | "large" | undefined;
|
|
72
72
|
label?: string | undefined;
|
|
73
73
|
errorText?: string | undefined;
|
|
74
|
-
prefixIconName?: "
|
|
74
|
+
prefixIconName?: "search" | "location_on" | undefined;
|
|
75
75
|
prefixIconSize?: 20 | 24 | 40 | 48 | undefined;
|
|
76
76
|
prefixIconFill?: boolean | undefined;
|
|
77
77
|
suffixIconFill?: boolean | undefined;
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
fourColumnItems,
|
|
9
9
|
fullImageItems,
|
|
10
10
|
withFloatingImageArgs,
|
|
11
|
-
} from "./
|
|
11
|
+
} from "./Callout.stories.mocks";
|
|
12
12
|
|
|
13
13
|
import { DocsPage } from "@shared/stories/DocsTemplate";
|
|
14
14
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
@@ -299,6 +299,24 @@ describe("ProductCard", () => {
|
|
|
299
299
|
expect(screen.getByAltText("Free router")).toBeInTheDocument();
|
|
300
300
|
});
|
|
301
301
|
|
|
302
|
+
it("spreads each gift's fieldProps onto its own row", () => {
|
|
303
|
+
const giftBadge = [
|
|
304
|
+
{
|
|
305
|
+
title: "Free router",
|
|
306
|
+
icon: "/router.png",
|
|
307
|
+
fieldProps: { "data-contentful-entry-id": "gift-1" },
|
|
308
|
+
},
|
|
309
|
+
{ title: "Free install", icon: "/install.png" },
|
|
310
|
+
] as any;
|
|
311
|
+
render(<ProductCard {...defaultProps} giftBadge={giftBadge} />);
|
|
312
|
+
expect(
|
|
313
|
+
screen.getByText("Free router").parentElement
|
|
314
|
+
).toHaveAttribute("data-contentful-entry-id", "gift-1");
|
|
315
|
+
expect(
|
|
316
|
+
screen.getByText("Free install").parentElement
|
|
317
|
+
).not.toHaveAttribute("data-contentful-entry-id");
|
|
318
|
+
});
|
|
319
|
+
|
|
302
320
|
it("does not render gift badges when not provided", () => {
|
|
303
321
|
render(<ProductCard {...defaultProps} />);
|
|
304
322
|
expect(screen.queryByText("Free router")).not.toBeInTheDocument();
|
|
@@ -18,7 +18,14 @@ export interface ProductCardProps {
|
|
|
18
18
|
description: string;
|
|
19
19
|
bestValue?: boolean;
|
|
20
20
|
bestValueText?: string;
|
|
21
|
-
giftBadge?: [
|
|
21
|
+
giftBadge?: [
|
|
22
|
+
{
|
|
23
|
+
title: ReactNode;
|
|
24
|
+
icon: string;
|
|
25
|
+
/** Extra DOM attribute props, spread onto this gift row. */
|
|
26
|
+
fieldProps?: Record<string, unknown>;
|
|
27
|
+
},
|
|
28
|
+
];
|
|
22
29
|
innerBadge?: { badgeText: string; badgeIcon: string };
|
|
23
30
|
theme?: "light" | "dark";
|
|
24
31
|
featuresTitle?: string;
|
|
@@ -147,7 +147,7 @@ describe("PrimaryHero", () => {
|
|
|
147
147
|
expect(dollarSign).toHaveClass("subheading1", "mt-0.5");
|
|
148
148
|
expect(amount).toHaveTextContent(/^19$/);
|
|
149
149
|
expect(suffix?.tagName).toBe("P");
|
|
150
|
-
expect(suffix).toHaveClass("
|
|
150
|
+
expect(suffix).toHaveClass("label1", "mt-0.5");
|
|
151
151
|
expect(suffix).toHaveTextContent(/^99\/mo\*$/);
|
|
152
152
|
expect(suffix?.querySelector("span")).toBeNull();
|
|
153
153
|
});
|
|
@@ -208,7 +208,7 @@ describe("PrimaryHero", () => {
|
|
|
208
208
|
const { amount, suffix } = getPriceLockup(container);
|
|
209
209
|
|
|
210
210
|
expect(amount).toHaveTextContent(/^39$/);
|
|
211
|
-
expect(suffix).toHaveClass("
|
|
211
|
+
expect(suffix).toHaveClass("label1", "mt-0.5");
|
|
212
212
|
expect(suffix).toHaveTextContent(/^99$/);
|
|
213
213
|
});
|
|
214
214
|
|
|
File without changes
|