@windstream/react-shared-components 0.0.70 → 0.0.71

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
@@ -57,15 +57,15 @@ type InputFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, "size"> & {
57
57
 
58
58
  declare const InputField: ForwardRefRenderFunction<HTMLInputElement, InputFieldProps>;
59
59
  declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size"> & {
60
- state?: "default" | "focus" | "active" | "hover" | "filled" | "error" | undefined;
61
- size?: "slim" | "medium" | "large" | undefined;
60
+ state?: "error" | "default" | "filled" | "active" | "focus" | "hover" | undefined;
61
+ size?: "medium" | "large" | "slim" | undefined;
62
62
  label?: string | undefined;
63
63
  errorText?: string | undefined;
64
64
  prefixIconName?: "search" | "location_on" | undefined;
65
65
  prefixIconSize?: 20 | 24 | 40 | 48 | undefined;
66
66
  prefixIconFill?: boolean | undefined;
67
67
  suffixIconFill?: boolean | undefined;
68
- suffixIconName?: "visibility" | "visibility_off" | "lock" | undefined;
68
+ suffixIconName?: "visibility" | "lock" | "visibility_off" | undefined;
69
69
  suffixIconSize?: 20 | 24 | 40 | 48 | undefined;
70
70
  containerClassName?: string | undefined;
71
71
  prefixIconClassName?: string | undefined;
package/dist/index.d.ts CHANGED
@@ -61,7 +61,7 @@ declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAtt
61
61
  size?: "slim" | "medium" | "large" | undefined;
62
62
  label?: string | undefined;
63
63
  errorText?: string | undefined;
64
- prefixIconName?: "location_on" | "search" | undefined;
64
+ prefixIconName?: "search" | "location_on" | undefined;
65
65
  prefixIconSize?: 20 | 24 | 40 | 48 | undefined;
66
66
  prefixIconFill?: boolean | undefined;
67
67
  suffixIconFill?: boolean | undefined;
@@ -331,7 +331,7 @@ type ButtonCustomProps = {
331
331
  };
332
332
  type ButtonProps = ButtonCustomProps & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "className">;
333
333
 
334
- declare const BrandButton: React$1.ForwardRefExoticComponent<_shared_components_brand_button_types.ButtonCustomProps & Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, "className" | "children"> & React$1.RefAttributes<HTMLButtonElement>>;
334
+ declare const BrandButton: React$1.ForwardRefExoticComponent<_shared_components_brand_button_types.ButtonCustomProps & Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, "children" | "className"> & React$1.RefAttributes<HTMLButtonElement>>;
335
335
 
336
336
  declare const Checklist: React__default.FC<ChecklistProps>;
337
337
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windstream/react-shared-components",
3
- "version": "0.0.70",
3
+ "version": "0.0.71",
4
4
  "type": "module",
5
5
  "description": "Shared React components for Kinetic applications",
6
6
  "main": "dist/index.js",
@@ -2,6 +2,7 @@ import React from "react";
2
2
  import { ButtonProps } from "./types";
3
3
 
4
4
  import { BrandButton } from "@shared/components/brand-button";
5
+ import { Button as CoreButton } from "@shared/components/button";
5
6
  import { Link } from "@shared/components/link";
6
7
 
7
8
  export const Button: React.FC<ButtonProps> = ({
@@ -17,7 +18,9 @@ export const Button: React.FC<ButtonProps> = ({
17
18
  fullWidth,
18
19
  preDefinedFunctionExecution,
19
20
  checkPlansJSX,
21
+ buttonClassName,
20
22
  onClick,
23
+ ...rest
21
24
  }) => {
22
25
  if (preDefinedFunctionExecution === "check availability") {
23
26
  return checkPlansJSX;
@@ -30,35 +33,52 @@ export const Button: React.FC<ButtonProps> = ({
30
33
  onClick?.(event);
31
34
  }
32
35
 
33
- return showButtonAs === "solid" ? (
34
- <BrandButton
35
- id={anchorId}
36
- variant={buttonVariant}
37
- text={buttonLabel}
38
- label={buttonPrefix}
39
- fullWidth={fullWidth}
40
- onClick={buttonClick}
41
- // badge={badge}
42
- // badgeIcon={badgeIcon}
43
- // icon={buttonIcon}
44
- // iconPosition={buttonIconPosition}
45
- // href={href}
46
- // target={target}
47
- // preserveQueryParameters={preserveQueryParameters}
48
- // clickToOpen={clickToOpen}
49
- // tabmodalNameToOpen={tabmodalNameToOpen}
50
- // preDefinedFunctionExecution={preDefinedFunctionExecution}
51
- />
52
- ) : showButtonAs === "text" ? (
53
- <Link
54
- href={href}
55
- target={target}
56
- variant={linkVariant || "default"}
57
- className={`text-text-brand ${linkClassName || ""}`}
58
- onClick={linkClick}
59
- >
60
- {buttonLabel}
61
- </Link>
62
- ) : null;
36
+ let CTA = (
37
+ <CoreButton onClick={buttonClick} className={buttonClassName} {...rest} />
38
+ );
39
+
40
+ switch (showButtonAs) {
41
+ case "solid":
42
+ CTA = (
43
+ <BrandButton
44
+ id={anchorId}
45
+ variant={buttonVariant}
46
+ text={buttonLabel}
47
+ label={buttonPrefix}
48
+ fullWidth={fullWidth}
49
+ onClick={buttonClick}
50
+ // badge={badge}
51
+ // badgeIcon={badgeIcon}
52
+ // icon={buttonIcon}
53
+ // iconPosition={buttonIconPosition}
54
+ // href={href}
55
+ // target={target}
56
+ // preserveQueryParameters={preserveQueryParameters}
57
+ // clickToOpen={clickToOpen}
58
+ // tabmodalNameToOpen={tabmodalNameToOpen}
59
+ // preDefinedFunctionExecution={preDefinedFunctionExecution}
60
+ />
61
+ );
62
+ break;
63
+ case "text":
64
+ CTA = (
65
+ <Link
66
+ href={href}
67
+ target={target}
68
+ variant={linkVariant || "default"}
69
+ className={`text-text-brand ${linkClassName || ""}`}
70
+ onClick={linkClick}
71
+ >
72
+ {buttonLabel}
73
+ </Link>
74
+ );
75
+ break;
76
+ case "unstyled": // For unstyled, we can use the CoreButton without any additional styling
77
+ break;
78
+ default: // For default, we can use the CoreButton without any additional styling
79
+ break;
80
+ }
81
+
82
+ return CTA;
63
83
  };
64
84
  export default Button;
@@ -1,5 +1,5 @@
1
1
  export type ButtonProps = {
2
- showButtonAs?: "solid" | "text";
2
+ showButtonAs?: "solid" | "text" | "unstyled";
3
3
  buttonVariant?: "primary_brand" | "secondary" | "primary_inverse";
4
4
  buttonLabel?: string;
5
5
  buttonPrefix?: string;
@@ -16,9 +16,11 @@ export type ButtonProps = {
16
16
  preDefinedFunctionExecution?: string;
17
17
  checkPlansJSX?: React.ReactNode;
18
18
  linkClassName?: string;
19
+ buttonClassName?: string;
19
20
  linkVariant?: "unstyled" | "default";
20
21
  fullWidth?: boolean;
21
22
  onClick?: (
22
23
  event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>
23
24
  ) => void;
25
+ children?: React.ReactNode;
24
26
  };
@@ -16,7 +16,7 @@ const meta: Meta<typeof Carousel> = {
16
16
  },
17
17
  },
18
18
  },
19
- args: { },
19
+ args: {},
20
20
  };
21
21
  export default meta;
22
22
  type Story = StoryObj<typeof meta>;
@@ -1,6 +1,5 @@
1
1
  import React, { CSSProperties } from "react";
2
2
 
3
- import { Button as CoreButton } from "@shared/components/button";
4
3
  import { MaterialIcon } from "@shared/components/material-icon";
5
4
  import { Text } from "@shared/components/text";
6
5
  import { Button } from "@shared/contentful/blocks/button";
@@ -60,11 +59,12 @@ export const DesktopLinkGroups: React.FC<LinkGroupsProps> = ({
60
59
  style={{ anchorName: fullAnchorName } as CSSProperties}
61
60
  ref={ref}
62
61
  >
63
- <CoreButton
62
+ <Button
64
63
  onClick={() => setIsOpen(prev => !prev)}
65
64
  aria-expanded={isOpen}
66
- className="group body3 flex h-full items-center"
65
+ buttonClassName="group body3 flex h-full items-center"
67
66
  key={anchorId}
67
+ showButtonAs="unstyled"
68
68
  >
69
69
  <Text as="span" className="group-hover:underline">
70
70
  {title ?? null}
@@ -74,7 +74,7 @@ export const DesktopLinkGroups: React.FC<LinkGroupsProps> = ({
74
74
  className="text-icon-info group-hover:opacity-50"
75
75
  name={isOpen ? "keyboard_arrow_up" : "keyboard_arrow_down"}
76
76
  />
77
- </CoreButton>
77
+ </Button>
78
78
 
79
79
  <div
80
80
  className={cx(
@@ -3,7 +3,6 @@ import { DesktopLinkGroups } from "./desktop-link-groups.tsx";
3
3
  import { MobileLinkGroups } from "./mobile-link-groups.tsx";
4
4
  import { NavigationProps } from "./types";
5
5
 
6
- import { Button } from "@shared/components/button";
7
6
  import { CallButton } from "@shared/components/call-button";
8
7
  import { Input } from "@shared/components/input";
9
8
  import { MaterialIcon } from "@shared/components/material-icon";
@@ -198,9 +197,13 @@ const MobileMenu = (props: NavigationProps) => {
198
197
 
199
198
  return (
200
199
  <div>
201
- <Button className="flex" onClick={() => setIsOpen(true)}>
200
+ <ContentfulButton
201
+ showButtonAs="unstyled"
202
+ buttonClassName="flex"
203
+ onClick={() => setIsOpen(true)}
204
+ >
202
205
  <MaterialIcon name="menu" />
203
- </Button>
206
+ </ContentfulButton>
204
207
  {isOpen ? (
205
208
  <div className="fixed bottom-0 left-0 right-0 top-0 z-[90] h-full w-full bg-scrim-bg-modal"></div>
206
209
  ) : null}
@@ -226,9 +229,13 @@ const MobileMenu = (props: NavigationProps) => {
226
229
  </CallButton>
227
230
  </div>
228
231
  <div>
229
- <Button onClick={closeMenu} className="focus-item flex">
232
+ <ContentfulButton
233
+ showButtonAs="unstyled"
234
+ buttonClassName="focus-item flex"
235
+ onClick={closeMenu}
236
+ >
230
237
  <MaterialIcon name="close" />
231
- </Button>
238
+ </ContentfulButton>
232
239
  </div>
233
240
  </div>
234
241
  <MobileSearchInput
@@ -1,6 +1,5 @@
1
1
  import React from "react";
2
2
 
3
- import { Button as CoreButton } from "@shared/components/button";
4
3
  import { MaterialIcon } from "@shared/components/material-icon";
5
4
  import { Button } from "@shared/contentful/blocks/button";
6
5
  import { ButtonProps as ContentfulButtonProps } from "@shared/contentful/blocks/button/types";
@@ -44,18 +43,19 @@ export const MobileLinkGroups: React.FC<LinkGroupsProps> = ({ link }) => {
44
43
 
45
44
  return (
46
45
  <>
47
- <CoreButton
46
+ <Button
48
47
  onClick={() => setIsOpen(prev => !prev)}
49
48
  aria-expanded={isOpen}
50
- className="label3 flex h-11 w-full items-center px-4"
49
+ buttonClassName="label3 flex h-11 w-full items-center px-4"
51
50
  key={anchorId}
51
+ showButtonAs="unstyled"
52
52
  >
53
53
  {title ?? null}
54
54
  <MaterialIcon
55
55
  weight="700"
56
56
  name={isOpen ? "keyboard_arrow_up" : "keyboard_arrow_down"}
57
57
  />
58
- </CoreButton>
58
+ </Button>
59
59
  {isOpen && subMenu.length > 0 && <RenderSubMenu items={subMenu} />}
60
60
  </>
61
61
  );
@@ -37,7 +37,7 @@ export const PrimaryHero: React.FC<PrimaryHeroProps> = props => {
37
37
  {title && (
38
38
  <Text
39
39
  as={showAsHeading ? "h1" : "h2"}
40
- className="heading2 font-bold lg:heading1"
40
+ className="heading2 lg:heading1"
41
41
  >
42
42
  {title}
43
43
  </Text>