@windstream/react-shared-components 0.2.59 → 0.2.60

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
@@ -66,8 +66,8 @@ type InputFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, "size"> & {
66
66
 
67
67
  declare const InputField: ForwardRefRenderFunction<HTMLInputElement, InputFieldProps>;
68
68
  declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size"> & {
69
- state?: "error" | "default" | "focus" | "active" | "hover" | "filled" | undefined;
70
- size?: "medium" | "slim" | "large" | undefined;
69
+ state?: "default" | "focus" | "active" | "hover" | "filled" | "error" | undefined;
70
+ size?: "slim" | "medium" | "large" | undefined;
71
71
  label?: string | undefined;
72
72
  errorText?: string | undefined;
73
73
  prefixIconName?: "search" | "location_on" | undefined;
package/dist/index.d.ts CHANGED
@@ -66,11 +66,11 @@ type InputFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, "size"> & {
66
66
 
67
67
  declare const InputField: ForwardRefRenderFunction<HTMLInputElement, InputFieldProps>;
68
68
  declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size"> & {
69
- state?: "default" | "focus" | "active" | "hover" | "filled" | "error" | undefined;
70
- size?: "slim" | "medium" | "large" | undefined;
69
+ state?: "error" | "default" | "focus" | "active" | "hover" | "filled" | undefined;
70
+ size?: "medium" | "slim" | "large" | undefined;
71
71
  label?: string | undefined;
72
72
  errorText?: string | undefined;
73
- prefixIconName?: "location_on" | "search" | undefined;
73
+ prefixIconName?: "search" | "location_on" | undefined;
74
74
  prefixIconSize?: 20 | 24 | 40 | 48 | undefined;
75
75
  prefixIconFill?: boolean | undefined;
76
76
  suffixIconFill?: boolean | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windstream/react-shared-components",
3
- "version": "0.2.59",
3
+ "version": "0.2.60",
4
4
  "type": "module",
5
5
  "description": "Shared React components for Kinetic applications",
6
6
  "main": "dist/index.js",
@@ -28,6 +28,26 @@ describe("AwardMarquee", () => {
28
28
  expect(icon.src).toContain("icon-0.png");
29
29
  });
30
30
 
31
+ it("renders intrinsic icon dimensions when provided", () => {
32
+ const [item] = buildItems(1);
33
+ render(
34
+ <AwardMarquee
35
+ items={[{ ...item, iconWidth: 320, iconHeight: 180 }]}
36
+ />
37
+ );
38
+ const icon = screen.getByAltText("Award 0");
39
+ expect(icon).toHaveAttribute("width", "320");
40
+ expect(icon).toHaveAttribute("height", "180");
41
+ expect(icon).toHaveClass("w-[200px]");
42
+ });
43
+
44
+ it("omits intrinsic icon dimensions when unavailable", () => {
45
+ render(<AwardMarquee items={buildItems(1)} />);
46
+ const icon = screen.getByAltText("Award 0");
47
+ expect(icon).not.toHaveAttribute("width");
48
+ expect(icon).not.toHaveAttribute("height");
49
+ });
50
+
31
51
  it("renders a static (non-animated) list when scroll is disabled", () => {
32
52
  const { container } = render(
33
53
  <AwardMarquee items={buildItems(5)} scroll={false} />
@@ -21,14 +21,27 @@ const BACKGROUND_CLASS: Record<AwardMarqueeBackground, string> = {
21
21
  };
22
22
 
23
23
  const renderAwardItem = (
24
- { iconUrl, iconAlt, title, description }: AwardMarqueeItem,
24
+ {
25
+ iconUrl,
26
+ iconAlt,
27
+ iconWidth,
28
+ iconHeight,
29
+ title,
30
+ description,
31
+ }: AwardMarqueeItem,
25
32
  key: React.Key
26
33
  ) => (
27
34
  <div
28
35
  key={key}
29
36
  className="ml-4 flex w-auto flex-shrink-0 items-center whitespace-nowrap"
30
37
  >
31
- <img src={iconUrl} alt={iconAlt ?? ""} width={200} />
38
+ <img
39
+ src={iconUrl}
40
+ alt={iconAlt ?? ""}
41
+ width={iconWidth}
42
+ height={iconHeight}
43
+ className="w-[200px]"
44
+ />
32
45
  <div className="w-[250px] text-center">
33
46
  <p className="flex justify-center text-center text-body3 font-bold">
34
47
  {title}
@@ -5,6 +5,8 @@ export type AwardMarqueeBackground = "cream" | "gray90" | "white";
5
5
  export type AwardMarqueeItem = {
6
6
  iconUrl: string;
7
7
  iconAlt?: string;
8
+ iconWidth?: number;
9
+ iconHeight?: number;
8
10
  title?: string;
9
11
  description?: string;
10
12
  };