@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/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?: "error" | "default" | "focus" | "active" | "hover" | "filled" | undefined;
71
- size?: "medium" | "slim" | "large" | undefined;
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" | "focus" | "active" | "hover" | "filled" | "error" | undefined;
71
- size?: "slim" | "medium" | "large" | undefined;
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?: "location_on" | "search" | undefined;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windstream/react-shared-components",
3
- "version": "0.2.91",
3
+ "version": "0.2.92",
4
4
  "type": "module",
5
5
  "description": "Shared React components for Kinetic applications",
6
6
  "main": "dist/index.js",
@@ -8,7 +8,7 @@ import {
8
8
  fourColumnItems,
9
9
  fullImageItems,
10
10
  withFloatingImageArgs,
11
- } from "./callout.stories.mocks";
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();
@@ -214,6 +214,7 @@ export const ProductCard: React.FC<ProductCardProps> = ({
214
214
  <div
215
215
  key={badge.title}
216
216
  className="flex w-full items-center gap-2"
217
+ {...badge.fieldProps}
217
218
  >
218
219
  <Image
219
220
  src={badge.icon}
@@ -18,7 +18,14 @@ export interface ProductCardProps {
18
18
  description: string;
19
19
  bestValue?: boolean;
20
20
  bestValueText?: string;
21
- giftBadge?: [{ title: ReactNode; icon: string }];
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;
@@ -7,7 +7,7 @@ import {
7
7
  UTILITY_LINKS,
8
8
  ACCOUNT_LINKS,
9
9
  SUPPORT_LINKS,
10
- } from "./navigation.stories.mocks";
10
+ } from "./Navigation.stories.mocks";
11
11
 
12
12
  const searchFormStyle = `
13
13
  form[name="searchForm"] {
@@ -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("subheading1", "mt-0.5");
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("subheading1", "mt-0.5");
211
+ expect(suffix).toHaveClass("label1", "mt-0.5");
212
212
  expect(suffix).toHaveTextContent(/^99$/);
213
213
  });
214
214