@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/contentful/index.d.ts +2 -0
- 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/award-marquee/index.test.tsx +20 -0
- package/src/contentful/blocks/award-marquee/index.tsx +15 -2
- package/src/contentful/blocks/award-marquee/types.ts +2 -0
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?: "
|
|
70
|
-
size?: "
|
|
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" |
|
|
70
|
-
size?: "
|
|
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?: "
|
|
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
|
@@ -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
|
-
{
|
|
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
|
|
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}
|