@windstream/react-shared-components 0.0.18 → 0.0.21
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.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 +34 -6
- package/dist/index.d.ts +33 -5
- package/dist/index.esm.js +5 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/utils/index.esm.js.map +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/accordion/Accordion.stories.tsx +16 -11
- package/src/components/accordion/index.tsx +19 -8
- package/src/components/accordion/types.ts +8 -9
- package/src/components/alert-card/AlertCard.stories.tsx +4 -5
- package/src/components/alert-card/index.tsx +6 -9
- package/src/components/alert-card/types.ts +9 -9
- package/src/components/brand-button/BrandButton.stories.tsx +8 -10
- package/src/components/brand-button/helpers.ts +8 -8
- package/src/components/brand-button/index.tsx +28 -27
- package/src/components/brand-button/types.ts +6 -8
- package/src/components/button/Button.stories.tsx +6 -6
- package/src/components/button/index.tsx +3 -1
- package/src/components/button/types.ts +14 -14
- package/src/components/call-button/CallButton.stories.tsx +1 -1
- package/src/components/call-button/index.tsx +3 -4
- package/src/components/call-button/types.ts +1 -0
- package/src/components/checkbox/Checkbox.stories.tsx +6 -7
- package/src/components/checkbox/index.tsx +17 -7
- package/src/components/checkbox/types.ts +19 -16
- package/src/components/checklist/Checklist.stories.tsx +1 -2
- package/src/components/checklist/index.tsx +12 -6
- package/src/components/checklist/types.ts +5 -5
- package/src/components/collapse/Collapse.stories.tsx +18 -19
- package/src/components/collapse/index.tsx +1 -1
- package/src/components/collapse/types.ts +4 -4
- package/src/components/divider/Divider.stories.tsx +16 -17
- package/src/components/divider/index.tsx +2 -3
- package/src/components/divider/type.ts +2 -2
- package/src/components/image/Image.stories.tsx +113 -0
- package/src/components/image/index.tsx +22 -0
- package/src/components/image/types.ts +28 -0
- package/src/components/input/Input.stories.tsx +13 -46
- package/src/components/input/index.tsx +16 -15
- package/src/components/input/types.ts +1 -1
- package/src/components/link/Link.stories.tsx +1 -1
- package/src/components/link/index.tsx +1 -2
- package/src/components/link/types.ts +25 -25
- package/src/components/list/List.stories.tsx +1 -1
- package/src/components/list/index.tsx +86 -86
- package/src/components/list/list-item/index.tsx +36 -36
- package/src/components/list/list-item/types.ts +13 -13
- package/src/components/list/types.ts +29 -29
- package/src/components/material-icon/MaterialIcon.stories.tsx +1 -1
- package/src/components/material-icon/constants.ts +1 -1
- package/src/components/material-icon/index.tsx +44 -44
- package/src/components/material-icon/types.ts +31 -31
- package/src/components/modal/Modal.stories.tsx +9 -9
- package/src/components/modal/index.tsx +8 -14
- package/src/components/modal/types.ts +1 -1
- package/src/components/radio-button/RadioButton.stories.tsx +7 -7
- package/src/components/radio-button/index.tsx +11 -9
- package/src/components/radio-button/types.ts +18 -19
- package/src/components/see-more/SeeMore.stories.tsx +14 -15
- package/src/components/see-more/index.tsx +33 -29
- package/src/components/see-more/types.ts +3 -3
- package/src/components/select/Select.stories.tsx +3 -2
- package/src/components/select/index.tsx +15 -17
- package/src/components/select/types.ts +2 -1
- package/src/components/select-plan-button/SelectPlanButton.stories.tsx +20 -12
- package/src/components/select-plan-button/index.tsx +28 -20
- package/src/components/select-plan-button/types.ts +1 -1
- package/src/components/skeleton/Skeleton.stories.tsx +9 -10
- package/src/components/skeleton/index.tsx +61 -61
- package/src/components/skeleton/types.ts +3 -3
- package/src/components/spinner/Spinner.stories.tsx +1 -1
- package/src/components/spinner/index.tsx +1 -1
- package/src/components/spinner/types.ts +4 -4
- package/src/components/text/Text.stories.tsx +35 -16
- package/src/components/text/index.tsx +2 -5
- package/src/components/text/types.ts +45 -45
- package/src/components/tooltip/Tooltip.stories.tsx +15 -16
- package/src/components/tooltip/index.tsx +1 -5
- package/src/components/tooltip/types.ts +4 -4
- package/src/components/view-cart-button/ViewCartButton.stories.tsx +23 -12
- package/src/components/view-cart-button/index.tsx +11 -6
- package/src/components/view-cart-button/types.ts +1 -1
- package/src/contentful/blocks/accordion/Accordion.stories.tsx +23 -0
- package/src/contentful/blocks/accordion/index.tsx +11 -1
- package/src/contentful/blocks/accordion/types.ts +1 -1
- package/src/contentful/blocks/button/Button.stories.tsx +40 -0
- package/src/contentful/blocks/button/index.tsx +15 -14
- package/src/contentful/blocks/button/types.ts +17 -17
- package/src/contentful/blocks/callout/Callout.stories.tsx +23 -0
- package/src/contentful/blocks/callout/index.tsx +9 -1
- package/src/contentful/blocks/callout/types.ts +1 -1
- package/src/contentful/blocks/cards/Cards.stories.tsx +23 -0
- package/src/contentful/blocks/cards/index.tsx +7 -1
- package/src/contentful/blocks/cards/types.ts +1 -1
- package/src/contentful/blocks/carousel/Carousel.stories.tsx +23 -0
- package/src/contentful/blocks/carousel/index.tsx +7 -1
- package/src/contentful/blocks/carousel/types.ts +1 -1
- package/src/contentful/blocks/cta-callout/CtaCallout.stories.tsx +46 -0
- package/src/contentful/blocks/cta-callout/index.tsx +5 -5
- package/src/contentful/blocks/cta-callout/types.ts +16 -16
- package/src/contentful/blocks/floating-banner/FloatingBanner.stories.tsx +23 -0
- package/src/contentful/blocks/floating-banner/index.tsx +6 -2
- package/src/contentful/blocks/floating-banner/types.ts +1 -1
- package/src/contentful/blocks/footer/Footer.stories.tsx +30 -0
- package/src/contentful/blocks/footer/index.tsx +8 -7
- package/src/contentful/blocks/footer/types.ts +7 -6
- package/src/contentful/blocks/image-promo-bar/ImagePromoBar.stories.tsx +23 -0
- package/src/contentful/blocks/image-promo-bar/index.tsx +2 -1
- package/src/contentful/blocks/image-promo-bar/types.ts +28 -28
- package/src/contentful/blocks/modal/Modal.stories.tsx +23 -0
- package/src/contentful/blocks/modal/index.tsx +8 -2
- package/src/contentful/blocks/modal/types.ts +1 -1
- package/src/contentful/blocks/navigation/Navigation.stories.tsx +23 -0
- package/src/contentful/blocks/navigation/index.tsx +6 -2
- package/src/contentful/blocks/navigation/types.ts +1 -1
- package/src/contentful/blocks/primary-hero/PrimaryHero.stories.tsx +23 -0
- package/src/contentful/blocks/primary-hero/index.tsx +4 -3
- package/src/contentful/blocks/primary-hero/types.ts +29 -29
- package/src/contentful/blocks/shape-background-wrapper/ShapeBackgroundWrapper.stories.tsx +26 -0
- package/src/contentful/blocks/shape-background-wrapper/index.tsx +107 -106
- package/src/contentful/blocks/shape-background-wrapper/types.ts +24 -23
- package/src/contentful/blocks/text/Text.stories.tsx +23 -0
- package/src/contentful/blocks/text/index.tsx +7 -1
- package/src/contentful/blocks/text/types.ts +1 -1
- package/src/contentful/index.ts +1 -1
- package/src/hooks/use-body-scroll-lock.ts +2 -1
- package/src/index.ts +14 -2
- package/src/setupTests.ts +46 -46
- package/src/stories/DocsTemplate.tsx +0 -2
- package/src/styles/globals.css +162 -162
- package/src/types/global.d.ts +9 -9
- package/src/utils/index.ts +34 -34
package/dist/core.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
|
-
import React__default, { InputHTMLAttributes, ReactNode, ForwardRefRenderFunction, AnchorHTMLAttributes, MouseEvent, CSSProperties, HTMLAttributes, LiHTMLAttributes, ButtonHTMLAttributes, LabelHTMLAttributes, FC } from 'react';
|
|
2
|
+
import React__default, { InputHTMLAttributes, ReactNode, ForwardRefRenderFunction, ImgHTMLAttributes, ComponentType, AnchorHTMLAttributes, MouseEvent, CSSProperties, HTMLAttributes, LiHTMLAttributes, ButtonHTMLAttributes, LabelHTMLAttributes, FC } from 'react';
|
|
3
3
|
export { ButtonHTMLAttributes, CSSProperties, ReactNode } from 'react';
|
|
4
4
|
import { ButtonProps as ButtonProps$1 } from '@shared/components/button/types';
|
|
5
5
|
export { ButtonProps } from '@shared/components/button/types';
|
|
6
|
+
import { ImageProps as ImageProps$1 } from '@shared/components/image/types';
|
|
6
7
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
8
|
import { CallButtonProps } from '@shared/components/call-button/types';
|
|
8
9
|
export { CallButtonProps } from '@shared/components/call-button/types';
|
|
@@ -59,7 +60,7 @@ declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAtt
|
|
|
59
60
|
size?: "slim" | "medium" | "large" | undefined;
|
|
60
61
|
label?: string | undefined;
|
|
61
62
|
errorText?: string | undefined;
|
|
62
|
-
prefixIconName?: "
|
|
63
|
+
prefixIconName?: "search" | "location_on" | undefined;
|
|
63
64
|
prefixIconSize?: 20 | 24 | 40 | 48 | undefined;
|
|
64
65
|
prefixIconFill?: boolean | undefined;
|
|
65
66
|
suffixIconFill?: boolean | undefined;
|
|
@@ -71,6 +72,33 @@ declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAtt
|
|
|
71
72
|
hasError?: boolean | undefined;
|
|
72
73
|
} & React$1.RefAttributes<HTMLInputElement>>;
|
|
73
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Props passed to the custom image component when using the `as` prop.
|
|
77
|
+
* Covers native img attributes plus optional Next.js Image props (fill, sizes, priority, etc.).
|
|
78
|
+
*/
|
|
79
|
+
interface ImageComponentProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, "alt"> {
|
|
80
|
+
/** Image source URL */
|
|
81
|
+
src: string;
|
|
82
|
+
/** Alt text (required for accessibility; use "" for decorative images) */
|
|
83
|
+
alt: string;
|
|
84
|
+
/** Optional; used by Next.js Image when using fill layout */
|
|
85
|
+
fill?: boolean;
|
|
86
|
+
/** Optional; used by Next.js Image for responsive sizes */
|
|
87
|
+
sizes?: string;
|
|
88
|
+
/** Optional; used by Next.js Image for priority loading */
|
|
89
|
+
priority?: boolean;
|
|
90
|
+
/** Optional; used by Next.js Image for blur placeholder */
|
|
91
|
+
placeholder?: "blur" | "empty";
|
|
92
|
+
/** Optional; used by Next.js Image for quality (1–100) */
|
|
93
|
+
quality?: number;
|
|
94
|
+
}
|
|
95
|
+
interface ImageProps extends ImageComponentProps {
|
|
96
|
+
/** Custom component to render instead of native img (e.g. next/image) */
|
|
97
|
+
as?: ComponentType<ImageComponentProps>;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
declare const Image: React$1.ForwardRefExoticComponent<ImageProps$1 & React$1.RefAttributes<HTMLImageElement>>;
|
|
101
|
+
|
|
74
102
|
interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
75
103
|
/** Content to render inside the link */
|
|
76
104
|
children: ReactNode;
|
|
@@ -232,7 +260,7 @@ type CheckboxProps = {
|
|
|
232
260
|
error?: boolean;
|
|
233
261
|
"data-cy"?: string;
|
|
234
262
|
renderInfoIcon?: InfoIconProps;
|
|
235
|
-
} & Omit<InputHTMLAttributes<HTMLInputElement>,
|
|
263
|
+
} & Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "checked" | "onChange">;
|
|
236
264
|
|
|
237
265
|
declare const Checkbox: React__default.FC<CheckboxProps>;
|
|
238
266
|
|
|
@@ -357,7 +385,7 @@ type ToolTipProps = {
|
|
|
357
385
|
className?: string;
|
|
358
386
|
};
|
|
359
387
|
|
|
360
|
-
declare function Tooltip({ tooltipMsg, className, children
|
|
388
|
+
declare function Tooltip({ tooltipMsg, className, children }: ToolTipProps): react_jsx_runtime.JSX.Element;
|
|
361
389
|
declare namespace Tooltip {
|
|
362
390
|
var displayName: string;
|
|
363
391
|
}
|
|
@@ -385,5 +413,5 @@ declare function useBodyScrollLock(isOpen: boolean, hideScrollOnIsOpenFalse: boo
|
|
|
385
413
|
*/
|
|
386
414
|
declare const cx: (...val: ClassValue[]) => string;
|
|
387
415
|
|
|
388
|
-
export { Accordion, AlertCard, BrandButton, Button, CallButton, Checkbox, Checklist, Collapse, Divider, Input, InputField, Link, List, ListItem, MaterialIcon, Modal, PageSkeleton, RadioButton, SeeMore, Select, SelectPlanButton, Skeleton, Spinner, Text, Input as TextInput, Tooltip, ViewCartButton, cx, useBodyScrollLock };
|
|
389
|
-
export type { AlertCardProps, Animation, ButtonProps as BrandButtonProps, ButtonSizeT, ButtonVariantsT, CheckboxProps, CollapsibleProps, DividerProps, FilterOptions, IconName, IconProps, InputFieldProps, InputProps, LinkProps, ListItemProps, ListProps, ModalProps, RadioButtonProps, ResponsiveSize, SelectOption, SelectPlanButtonProps, SelectProps, Shape, Size, SkeletonProps, SpinnerProps, TextProps, TextVariant, ToolTipProps, ViewCartButtonProps };
|
|
416
|
+
export { Accordion, AlertCard, BrandButton, Button, CallButton, Checkbox, Checklist, Collapse, Divider, Image, Input, InputField, Link, List, ListItem, MaterialIcon, Modal, PageSkeleton, RadioButton, SeeMore, Select, SelectPlanButton, Skeleton, Spinner, Text, Input as TextInput, Tooltip, ViewCartButton, cx, useBodyScrollLock };
|
|
417
|
+
export type { AlertCardProps, Animation, ButtonProps as BrandButtonProps, ButtonSizeT, ButtonVariantsT, CheckboxProps, CollapsibleProps, DividerProps, FilterOptions, IconName, IconProps, ImageComponentProps, ImageProps, InputFieldProps, InputProps, LinkProps, ListItemProps, ListProps, ModalProps, RadioButtonProps, ResponsiveSize, SelectOption, SelectPlanButtonProps, SelectProps, Shape, Size, SkeletonProps, SpinnerProps, TextProps, TextVariant, ToolTipProps, ViewCartButtonProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
|
-
import React__default, { InputHTMLAttributes, ReactNode, ForwardRefRenderFunction, AnchorHTMLAttributes, MouseEvent, CSSProperties, HTMLAttributes, LiHTMLAttributes, ButtonHTMLAttributes, LabelHTMLAttributes, FC } from 'react';
|
|
2
|
+
import React__default, { InputHTMLAttributes, ReactNode, ForwardRefRenderFunction, ImgHTMLAttributes, ComponentType, AnchorHTMLAttributes, MouseEvent, CSSProperties, HTMLAttributes, LiHTMLAttributes, ButtonHTMLAttributes, LabelHTMLAttributes, FC } from 'react';
|
|
3
3
|
export { ButtonHTMLAttributes, CSSProperties, ReactNode } from 'react';
|
|
4
4
|
import { ButtonProps as ButtonProps$1 } from '@shared/components/button/types';
|
|
5
5
|
export { ButtonProps } from '@shared/components/button/types';
|
|
6
|
+
import { ImageProps as ImageProps$1 } from '@shared/components/image/types';
|
|
6
7
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
8
|
import { CallButtonProps } from '@shared/components/call-button/types';
|
|
8
9
|
export { CallButtonProps } from '@shared/components/call-button/types';
|
|
@@ -71,6 +72,33 @@ declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAtt
|
|
|
71
72
|
hasError?: boolean | undefined;
|
|
72
73
|
} & React$1.RefAttributes<HTMLInputElement>>;
|
|
73
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Props passed to the custom image component when using the `as` prop.
|
|
77
|
+
* Covers native img attributes plus optional Next.js Image props (fill, sizes, priority, etc.).
|
|
78
|
+
*/
|
|
79
|
+
interface ImageComponentProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, "alt"> {
|
|
80
|
+
/** Image source URL */
|
|
81
|
+
src: string;
|
|
82
|
+
/** Alt text (required for accessibility; use "" for decorative images) */
|
|
83
|
+
alt: string;
|
|
84
|
+
/** Optional; used by Next.js Image when using fill layout */
|
|
85
|
+
fill?: boolean;
|
|
86
|
+
/** Optional; used by Next.js Image for responsive sizes */
|
|
87
|
+
sizes?: string;
|
|
88
|
+
/** Optional; used by Next.js Image for priority loading */
|
|
89
|
+
priority?: boolean;
|
|
90
|
+
/** Optional; used by Next.js Image for blur placeholder */
|
|
91
|
+
placeholder?: "blur" | "empty";
|
|
92
|
+
/** Optional; used by Next.js Image for quality (1–100) */
|
|
93
|
+
quality?: number;
|
|
94
|
+
}
|
|
95
|
+
interface ImageProps extends ImageComponentProps {
|
|
96
|
+
/** Custom component to render instead of native img (e.g. next/image) */
|
|
97
|
+
as?: ComponentType<ImageComponentProps>;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
declare const Image: React$1.ForwardRefExoticComponent<ImageProps$1 & React$1.RefAttributes<HTMLImageElement>>;
|
|
101
|
+
|
|
74
102
|
interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
75
103
|
/** Content to render inside the link */
|
|
76
104
|
children: ReactNode;
|
|
@@ -232,7 +260,7 @@ type CheckboxProps = {
|
|
|
232
260
|
error?: boolean;
|
|
233
261
|
"data-cy"?: string;
|
|
234
262
|
renderInfoIcon?: InfoIconProps;
|
|
235
|
-
} & Omit<InputHTMLAttributes<HTMLInputElement>,
|
|
263
|
+
} & Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "checked" | "onChange">;
|
|
236
264
|
|
|
237
265
|
declare const Checkbox: React__default.FC<CheckboxProps>;
|
|
238
266
|
|
|
@@ -357,7 +385,7 @@ type ToolTipProps = {
|
|
|
357
385
|
className?: string;
|
|
358
386
|
};
|
|
359
387
|
|
|
360
|
-
declare function Tooltip({ tooltipMsg, className, children
|
|
388
|
+
declare function Tooltip({ tooltipMsg, className, children }: ToolTipProps): react_jsx_runtime.JSX.Element;
|
|
361
389
|
declare namespace Tooltip {
|
|
362
390
|
var displayName: string;
|
|
363
391
|
}
|
|
@@ -385,5 +413,5 @@ declare function useBodyScrollLock(isOpen: boolean, hideScrollOnIsOpenFalse: boo
|
|
|
385
413
|
*/
|
|
386
414
|
declare const cx: (...val: ClassValue[]) => string;
|
|
387
415
|
|
|
388
|
-
export { Accordion, AlertCard, BrandButton, Button, CallButton, Checkbox, Checklist, Collapse, Divider, Input, InputField, Link, List, ListItem, MaterialIcon, Modal, PageSkeleton, RadioButton, SeeMore, Select, SelectPlanButton, Skeleton, Spinner, Text, Input as TextInput, Tooltip, ViewCartButton, cx, useBodyScrollLock };
|
|
389
|
-
export type { AlertCardProps, Animation, ButtonProps as BrandButtonProps, ButtonSizeT, ButtonVariantsT, CheckboxProps, CollapsibleProps, DividerProps, FilterOptions, IconName, IconProps, InputFieldProps, InputProps, LinkProps, ListItemProps, ListProps, ModalProps, RadioButtonProps, ResponsiveSize, SelectOption, SelectPlanButtonProps, SelectProps, Shape, Size, SkeletonProps, SpinnerProps, TextProps, TextVariant, ToolTipProps, ViewCartButtonProps };
|
|
416
|
+
export { Accordion, AlertCard, BrandButton, Button, CallButton, Checkbox, Checklist, Collapse, Divider, Image, Input, InputField, Link, List, ListItem, MaterialIcon, Modal, PageSkeleton, RadioButton, SeeMore, Select, SelectPlanButton, Skeleton, Spinner, Text, Input as TextInput, Tooltip, ViewCartButton, cx, useBodyScrollLock };
|
|
417
|
+
export type { AlertCardProps, Animation, ButtonProps as BrandButtonProps, ButtonSizeT, ButtonVariantsT, CheckboxProps, CollapsibleProps, DividerProps, FilterOptions, IconName, IconProps, ImageComponentProps, ImageProps, InputFieldProps, InputProps, LinkProps, ListItemProps, ListProps, ModalProps, RadioButtonProps, ResponsiveSize, SelectOption, SelectPlanButtonProps, SelectProps, Shape, Size, SkeletonProps, SpinnerProps, TextProps, TextVariant, ToolTipProps, ViewCartButtonProps };
|