@windstream/react-shared-components 0.0.18 → 0.0.20

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.
Files changed (140) hide show
  1. package/dist/contentful/index.esm.js +1 -1
  2. package/dist/contentful/index.esm.js.map +1 -1
  3. package/dist/contentful/index.js +1 -1
  4. package/dist/contentful/index.js.map +1 -1
  5. package/dist/core.d.ts +38 -10
  6. package/dist/index.d.ts +35 -7
  7. package/dist/index.esm.js +5 -5
  8. package/dist/index.esm.js.map +1 -1
  9. package/dist/index.js +5 -5
  10. package/dist/index.js.map +1 -1
  11. package/dist/styles.css +1 -1
  12. package/dist/utils/index.esm.js.map +1 -1
  13. package/dist/utils/index.js.map +1 -1
  14. package/package.json +1 -1
  15. package/src/components/accordion/Accordion.stories.tsx +16 -11
  16. package/src/components/accordion/index.tsx +19 -8
  17. package/src/components/accordion/types.ts +8 -9
  18. package/src/components/alert-card/AlertCard.stories.tsx +4 -5
  19. package/src/components/alert-card/index.tsx +6 -9
  20. package/src/components/alert-card/types.ts +9 -9
  21. package/src/components/brand-button/BrandButton.stories.tsx +8 -10
  22. package/src/components/brand-button/helpers.ts +8 -8
  23. package/src/components/brand-button/index.tsx +30 -27
  24. package/src/components/brand-button/types.ts +6 -8
  25. package/src/components/button/Button.stories.tsx +6 -6
  26. package/src/components/button/index.tsx +3 -1
  27. package/src/components/button/types.ts +14 -14
  28. package/src/components/call-button/CallButton.stories.tsx +1 -1
  29. package/src/components/call-button/index.tsx +3 -4
  30. package/src/components/call-button/types.ts +1 -0
  31. package/src/components/checkbox/Checkbox.stories.tsx +6 -7
  32. package/src/components/checkbox/index.tsx +17 -7
  33. package/src/components/checkbox/types.ts +19 -16
  34. package/src/components/checklist/Checklist.stories.tsx +1 -2
  35. package/src/components/checklist/index.tsx +12 -6
  36. package/src/components/checklist/types.ts +5 -5
  37. package/src/components/collapse/Collapse.stories.tsx +18 -19
  38. package/src/components/collapse/index.tsx +1 -1
  39. package/src/components/collapse/types.ts +4 -4
  40. package/src/components/divider/Divider.stories.tsx +16 -17
  41. package/src/components/divider/index.tsx +2 -3
  42. package/src/components/divider/type.ts +2 -2
  43. package/src/components/image/Image.stories.tsx +113 -0
  44. package/src/components/image/index.tsx +22 -0
  45. package/src/components/image/types.ts +28 -0
  46. package/src/components/input/Input.stories.tsx +13 -46
  47. package/src/components/input/index.tsx +18 -15
  48. package/src/components/input/types.ts +1 -1
  49. package/src/components/link/Link.stories.tsx +1 -1
  50. package/src/components/link/index.tsx +1 -2
  51. package/src/components/link/types.ts +25 -25
  52. package/src/components/list/List.stories.tsx +1 -1
  53. package/src/components/list/index.tsx +86 -86
  54. package/src/components/list/list-item/index.tsx +36 -36
  55. package/src/components/list/list-item/types.ts +13 -13
  56. package/src/components/list/types.ts +29 -29
  57. package/src/components/material-icon/MaterialIcon.stories.tsx +1 -1
  58. package/src/components/material-icon/constants.ts +1 -1
  59. package/src/components/material-icon/index.tsx +44 -44
  60. package/src/components/material-icon/types.ts +31 -31
  61. package/src/components/modal/Modal.stories.tsx +9 -9
  62. package/src/components/modal/index.tsx +8 -14
  63. package/src/components/modal/types.ts +1 -1
  64. package/src/components/radio-button/RadioButton.stories.tsx +7 -7
  65. package/src/components/radio-button/index.tsx +11 -9
  66. package/src/components/radio-button/types.ts +18 -19
  67. package/src/components/see-more/SeeMore.stories.tsx +14 -15
  68. package/src/components/see-more/index.tsx +33 -29
  69. package/src/components/see-more/types.ts +3 -3
  70. package/src/components/select/Select.stories.tsx +3 -2
  71. package/src/components/select/index.tsx +15 -17
  72. package/src/components/select/types.ts +2 -1
  73. package/src/components/select-plan-button/SelectPlanButton.stories.tsx +20 -12
  74. package/src/components/select-plan-button/index.tsx +28 -20
  75. package/src/components/select-plan-button/types.ts +1 -1
  76. package/src/components/skeleton/Skeleton.stories.tsx +9 -10
  77. package/src/components/skeleton/index.tsx +61 -61
  78. package/src/components/skeleton/types.ts +3 -3
  79. package/src/components/spinner/Spinner.stories.tsx +1 -1
  80. package/src/components/spinner/index.tsx +1 -1
  81. package/src/components/spinner/types.ts +4 -4
  82. package/src/components/text/Text.stories.tsx +35 -16
  83. package/src/components/text/index.tsx +2 -5
  84. package/src/components/text/types.ts +45 -45
  85. package/src/components/tooltip/Tooltip.stories.tsx +15 -16
  86. package/src/components/tooltip/index.tsx +1 -5
  87. package/src/components/tooltip/types.ts +4 -4
  88. package/src/components/view-cart-button/ViewCartButton.stories.tsx +23 -12
  89. package/src/components/view-cart-button/index.tsx +11 -6
  90. package/src/components/view-cart-button/types.ts +1 -1
  91. package/src/contentful/blocks/accordion/Accordion.stories.tsx +23 -0
  92. package/src/contentful/blocks/accordion/index.tsx +11 -1
  93. package/src/contentful/blocks/accordion/types.ts +1 -1
  94. package/src/contentful/blocks/button/Button.stories.tsx +40 -0
  95. package/src/contentful/blocks/button/index.tsx +15 -14
  96. package/src/contentful/blocks/button/types.ts +17 -17
  97. package/src/contentful/blocks/callout/Callout.stories.tsx +23 -0
  98. package/src/contentful/blocks/callout/index.tsx +9 -1
  99. package/src/contentful/blocks/callout/types.ts +1 -1
  100. package/src/contentful/blocks/cards/Cards.stories.tsx +23 -0
  101. package/src/contentful/blocks/cards/index.tsx +7 -1
  102. package/src/contentful/blocks/cards/types.ts +1 -1
  103. package/src/contentful/blocks/carousel/Carousel.stories.tsx +23 -0
  104. package/src/contentful/blocks/carousel/index.tsx +7 -1
  105. package/src/contentful/blocks/carousel/types.ts +1 -1
  106. package/src/contentful/blocks/cta-callout/CtaCallout.stories.tsx +46 -0
  107. package/src/contentful/blocks/cta-callout/index.tsx +5 -5
  108. package/src/contentful/blocks/cta-callout/types.ts +16 -16
  109. package/src/contentful/blocks/floating-banner/FloatingBanner.stories.tsx +23 -0
  110. package/src/contentful/blocks/floating-banner/index.tsx +6 -2
  111. package/src/contentful/blocks/floating-banner/types.ts +1 -1
  112. package/src/contentful/blocks/footer/Footer.stories.tsx +30 -0
  113. package/src/contentful/blocks/footer/index.tsx +8 -7
  114. package/src/contentful/blocks/footer/types.ts +7 -6
  115. package/src/contentful/blocks/image-promo-bar/ImagePromoBar.stories.tsx +23 -0
  116. package/src/contentful/blocks/image-promo-bar/index.tsx +2 -1
  117. package/src/contentful/blocks/image-promo-bar/types.ts +28 -28
  118. package/src/contentful/blocks/modal/Modal.stories.tsx +23 -0
  119. package/src/contentful/blocks/modal/index.tsx +8 -2
  120. package/src/contentful/blocks/modal/types.ts +1 -1
  121. package/src/contentful/blocks/navigation/Navigation.stories.tsx +23 -0
  122. package/src/contentful/blocks/navigation/index.tsx +6 -2
  123. package/src/contentful/blocks/navigation/types.ts +1 -1
  124. package/src/contentful/blocks/primary-hero/PrimaryHero.stories.tsx +23 -0
  125. package/src/contentful/blocks/primary-hero/index.tsx +4 -3
  126. package/src/contentful/blocks/primary-hero/types.ts +29 -29
  127. package/src/contentful/blocks/shape-background-wrapper/ShapeBackgroundWrapper.stories.tsx +26 -0
  128. package/src/contentful/blocks/shape-background-wrapper/index.tsx +107 -106
  129. package/src/contentful/blocks/shape-background-wrapper/types.ts +24 -23
  130. package/src/contentful/blocks/text/Text.stories.tsx +23 -0
  131. package/src/contentful/blocks/text/index.tsx +7 -1
  132. package/src/contentful/blocks/text/types.ts +1 -1
  133. package/src/contentful/index.ts +1 -1
  134. package/src/hooks/use-body-scroll-lock.ts +2 -1
  135. package/src/index.ts +14 -2
  136. package/src/setupTests.ts +46 -46
  137. package/src/stories/DocsTemplate.tsx +0 -2
  138. package/src/styles/globals.css +162 -162
  139. package/src/types/global.d.ts +9 -9
  140. package/src/utils/index.ts +34 -34
@@ -1,86 +1,86 @@
1
- import React, { forwardRef } from "react";
2
- import { cx } from "../../utils";
3
- import { ListItem, ListItemProps } from "./list-item";
4
- import { ListProps } from "./types";
5
-
6
- export const List = forwardRef<HTMLUListElement | HTMLOListElement, ListProps>(
7
- (
8
- {
9
- type = "ul",
10
- items,
11
- className = "",
12
- renderItem,
13
- children,
14
- variant = "unstyled",
15
- style,
16
- ...props
17
- },
18
- ref
19
- ) => {
20
- // Get Tailwind classes for different variants
21
- const getVariantClasses = () => {
22
- if (variant === "unstyled") {
23
- return "";
24
- }
25
-
26
- // TODO: Add styles based on the figma design for all variants
27
- const baseClasses = "m-0 p-0";
28
- const typeClasses =
29
- type === "ol" ? "pl-6 list-decimal" : "pl-5 list-disc";
30
-
31
- return `${baseClasses} ${typeClasses}`;
32
- };
33
-
34
- const tailwindClasses = getVariantClasses();
35
- const combinedClassName = cx(
36
- tailwindClasses,
37
- `list--${type}`,
38
- `list--${variant}`,
39
- className
40
- );
41
-
42
- // Render items if provided
43
- const renderItems = () => {
44
- if (!items || items.length === 0) return null;
45
-
46
- return items.map((item, index) => {
47
- if (renderItem) {
48
- return renderItem(item, index);
49
- }
50
-
51
- return (
52
- <ListItem
53
- key={item.id || index}
54
- className={item.className}
55
- variant={variant}
56
- >
57
- {item.content}
58
- </ListItem>
59
- );
60
- });
61
- };
62
-
63
- const content = children || renderItems();
64
-
65
- // Create props object to avoid duplication
66
- const listProps = {
67
- className: combinedClassName,
68
- style,
69
- ...props,
70
- children: content,
71
- };
72
-
73
- // Return appropriate list type with conditional rendering for proper TypeScript inference
74
- if (type === "ol") {
75
- return <ol {...listProps} ref={ref as React.Ref<HTMLOListElement>} />;
76
- }
77
-
78
- return <ul {...listProps} ref={ref as React.Ref<HTMLUListElement>} />;
79
- }
80
- );
81
-
82
- List.displayName = "List";
83
-
84
- export { ListItem };
85
-
86
- export type { ListProps, ListItemProps };
1
+ import React, { forwardRef } from "react";
2
+ import { cx } from "../../utils";
3
+ import { ListItem, ListItemProps } from "./list-item";
4
+ import { ListProps } from "./types";
5
+
6
+ export const List = forwardRef<HTMLUListElement | HTMLOListElement, ListProps>(
7
+ (
8
+ {
9
+ type = "ul",
10
+ items,
11
+ className = "",
12
+ renderItem,
13
+ children,
14
+ variant = "unstyled",
15
+ style,
16
+ ...props
17
+ },
18
+ ref
19
+ ) => {
20
+ // Get Tailwind classes for different variants
21
+ const getVariantClasses = () => {
22
+ if (variant === "unstyled") {
23
+ return "";
24
+ }
25
+
26
+ // TODO: Add styles based on the figma design for all variants
27
+ const baseClasses = "m-0 p-0";
28
+ const typeClasses =
29
+ type === "ol" ? "pl-6 list-decimal" : "pl-5 list-disc";
30
+
31
+ return `${baseClasses} ${typeClasses}`;
32
+ };
33
+
34
+ const tailwindClasses = getVariantClasses();
35
+ const combinedClassName = cx(
36
+ tailwindClasses,
37
+ `list--${type}`,
38
+ `list--${variant}`,
39
+ className
40
+ );
41
+
42
+ // Render items if provided
43
+ const renderItems = () => {
44
+ if (!items || items.length === 0) return null;
45
+
46
+ return items.map((item, index) => {
47
+ if (renderItem) {
48
+ return renderItem(item, index);
49
+ }
50
+
51
+ return (
52
+ <ListItem
53
+ key={item.id || index}
54
+ className={item.className}
55
+ variant={variant}
56
+ >
57
+ {item.content}
58
+ </ListItem>
59
+ );
60
+ });
61
+ };
62
+
63
+ const content = children || renderItems();
64
+
65
+ // Create props object to avoid duplication
66
+ const listProps = {
67
+ className: combinedClassName,
68
+ style,
69
+ ...props,
70
+ children: content,
71
+ };
72
+
73
+ // Return appropriate list type with conditional rendering for proper TypeScript inference
74
+ if (type === "ol") {
75
+ return <ol {...listProps} ref={ref as React.Ref<HTMLOListElement>} />;
76
+ }
77
+
78
+ return <ul {...listProps} ref={ref as React.Ref<HTMLUListElement>} />;
79
+ }
80
+ );
81
+
82
+ List.displayName = "List";
83
+
84
+ export { ListItem };
85
+
86
+ export type { ListProps, ListItemProps };
@@ -1,36 +1,36 @@
1
- import { forwardRef } from "react";
2
- import { cx } from "../../../utils";
3
- import { ListItemProps } from "./types";
4
-
5
- export const ListItem = forwardRef<HTMLLIElement, ListItemProps>(
6
- (
7
- { children, className = "", variant = "unstyled", style, ...props },
8
- ref
9
- ) => {
10
- // Get Tailwind classes for different variants
11
- const getVariantClasses = () => {
12
- if (variant === "unstyled") return "";
13
-
14
- // TODO: Add styles based on the figma design for all variants
15
- return "mb-1 leading-6";
16
- };
17
-
18
- const tailwindClasses = getVariantClasses();
19
- const combinedClassName = cx(
20
- tailwindClasses,
21
- "list-item",
22
- `list-item--${variant}`,
23
- className
24
- );
25
-
26
- return (
27
- <li ref={ref} className={combinedClassName} style={style} {...props}>
28
- {children}
29
- </li>
30
- );
31
- }
32
- );
33
-
34
- ListItem.displayName = "ListItem";
35
-
36
- export type { ListItemProps };
1
+ import { forwardRef } from "react";
2
+ import { cx } from "../../../utils";
3
+ import { ListItemProps } from "./types";
4
+
5
+ export const ListItem = forwardRef<HTMLLIElement, ListItemProps>(
6
+ (
7
+ { children, className = "", variant = "unstyled", style, ...props },
8
+ ref
9
+ ) => {
10
+ // Get Tailwind classes for different variants
11
+ const getVariantClasses = () => {
12
+ if (variant === "unstyled") return "";
13
+
14
+ // TODO: Add styles based on the figma design for all variants
15
+ return "mb-1 leading-6";
16
+ };
17
+
18
+ const tailwindClasses = getVariantClasses();
19
+ const combinedClassName = cx(
20
+ tailwindClasses,
21
+ "list-item",
22
+ `list-item--${variant}`,
23
+ className
24
+ );
25
+
26
+ return (
27
+ <li ref={ref} className={combinedClassName} style={style} {...props}>
28
+ {children}
29
+ </li>
30
+ );
31
+ }
32
+ );
33
+
34
+ ListItem.displayName = "ListItem";
35
+
36
+ export type { ListItemProps };
@@ -1,13 +1,13 @@
1
- import { CSSProperties, LiHTMLAttributes, ReactNode } from "react";
2
- import { ListVariant } from "../types";
3
-
4
- export interface ListItemProps extends LiHTMLAttributes<HTMLLIElement> {
5
- /** Content to render inside the list item */
6
- children: ReactNode;
7
- /** Custom className for the list item */
8
- className?: string;
9
- /** Additional styling options */
10
- variant?: ListVariant;
11
- /** Custom styles */
12
- style?: CSSProperties;
13
- }
1
+ import { CSSProperties, LiHTMLAttributes, ReactNode } from "react";
2
+ import { ListVariant } from "../types";
3
+
4
+ export interface ListItemProps extends LiHTMLAttributes<HTMLLIElement> {
5
+ /** Content to render inside the list item */
6
+ children: ReactNode;
7
+ /** Custom className for the list item */
8
+ className?: string;
9
+ /** Additional styling options */
10
+ variant?: ListVariant;
11
+ /** Custom styles */
12
+ style?: CSSProperties;
13
+ }
@@ -1,29 +1,29 @@
1
- import { CSSProperties, HTMLAttributes, ReactNode } from "react";
2
-
3
- export type ListType = "ul" | "ol";
4
- export type ListVariant = "default" | "unstyled";
5
-
6
- export type ListItem = {
7
- id: string | number;
8
- content: ReactNode;
9
- className?: string;
10
- [key: string]: any;
11
- };
12
-
13
- export interface ListProps
14
- extends Omit<HTMLAttributes<HTMLUListElement | HTMLOListElement>, "type"> {
15
- /** List type - unordered (ul) or ordered (ol) */
16
- type?: ListType;
17
- /** Array of items to render */
18
- items?: ListItem[];
19
- /** Custom className for the list */
20
- className?: string;
21
- /** Custom item renderer function */
22
- renderItem?: (item: ListItem, index: number) => ReactNode;
23
- /** Children to render instead of items */
24
- children?: ReactNode;
25
- /** Additional styling options */
26
- variant?: ListVariant;
27
- /** Custom styles */
28
- style?: CSSProperties;
29
- }
1
+ import { CSSProperties, HTMLAttributes, ReactNode } from "react";
2
+
3
+ export type ListType = "ul" | "ol";
4
+ export type ListVariant = "default" | "unstyled";
5
+
6
+ export type ListItem = {
7
+ id: string | number;
8
+ content: ReactNode;
9
+ className?: string;
10
+ [key: string]: any;
11
+ };
12
+
13
+ export interface ListProps
14
+ extends Omit<HTMLAttributes<HTMLUListElement | HTMLOListElement>, "type"> {
15
+ /** List type - unordered (ul) or ordered (ol) */
16
+ type?: ListType;
17
+ /** Array of items to render */
18
+ items?: ListItem[];
19
+ /** Custom className for the list */
20
+ className?: string;
21
+ /** Custom item renderer function */
22
+ renderItem?: (item: ListItem, index: number) => ReactNode;
23
+ /** Children to render instead of items */
24
+ children?: ReactNode;
25
+ /** Additional styling options */
26
+ variant?: ListVariant;
27
+ /** Custom styles */
28
+ style?: CSSProperties;
29
+ }
@@ -1,6 +1,6 @@
1
1
  import { MaterialIcon } from "./index";
2
- import { DocsPage } from "@shared/stories/DocsTemplate";
3
2
 
3
+ import { DocsPage } from "@shared/stories/DocsTemplate";
4
4
  import type { Meta, StoryObj } from "@storybook/react";
5
5
 
6
6
  const meta: Meta<typeof MaterialIcon> = {
@@ -78,7 +78,7 @@ export const iconNameList = [
78
78
  "replay",
79
79
  "fiber_manual_record",
80
80
  "menu",
81
- "dangerous"
81
+ "dangerous",
82
82
  ] as const;
83
83
 
84
84
  export const OpticalSizes = ["20dp", "24dp", "40dp", "48dp"] as const;
@@ -1,44 +1,44 @@
1
- import React from "react";
2
- import { cx } from "../../utils";
3
- import type { IconProps } from "./types";
4
-
5
- const MaterialIcon: React.FC<IconProps> = ({
6
- name,
7
- fill = 0,
8
- opticalSize = "48dp",
9
- weight = "200",
10
- emphasis = 145,
11
- size = 24,
12
- color = "currentColor",
13
- style = {},
14
- className,
15
- onClick,
16
- dataTestId,
17
- }) => {
18
- const fontVariationSettings = `'FILL' ${fill}, 'wght' ${weight}, 'GRAD' ${emphasis}, 'opsz' ${opticalSize.substring(0, 2)}`;
19
-
20
- const combinedStyle: React.CSSProperties = {
21
- fontVariationSettings,
22
- fontSize: `${size}px`,
23
- fontFamily: "'Material Symbols Rounded'",
24
- color: color || "currentColor",
25
- ...style,
26
- };
27
-
28
- return (
29
- <span
30
- style={combinedStyle}
31
- className={cx("material-symbols-rounded", className)}
32
- onClick={onClick}
33
- data-testid={dataTestId}
34
- >
35
- {name}
36
- </span>
37
- );
38
- };
39
-
40
- export { MaterialIcon };
41
-
42
- MaterialIcon.displayName = "MaterialIcon";
43
-
44
- export type { IconProps, IconName } from "./types";
1
+ import React from "react";
2
+ import { cx } from "../../utils";
3
+ import type { IconProps } from "./types";
4
+
5
+ const MaterialIcon: React.FC<IconProps> = ({
6
+ name,
7
+ fill = 0,
8
+ opticalSize = "48dp",
9
+ weight = "200",
10
+ emphasis = 145,
11
+ size = 24,
12
+ color = "currentColor",
13
+ style = {},
14
+ className,
15
+ onClick,
16
+ dataTestId,
17
+ }) => {
18
+ const fontVariationSettings = `'FILL' ${fill}, 'wght' ${weight}, 'GRAD' ${emphasis}, 'opsz' ${opticalSize.substring(0, 2)}`;
19
+
20
+ const combinedStyle: React.CSSProperties = {
21
+ fontVariationSettings,
22
+ fontSize: `${size}px`,
23
+ fontFamily: "'Material Symbols Rounded'",
24
+ color: color || "currentColor",
25
+ ...style,
26
+ };
27
+
28
+ return (
29
+ <span
30
+ style={combinedStyle}
31
+ className={cx("material-symbols-rounded", className)}
32
+ onClick={onClick}
33
+ data-testid={dataTestId}
34
+ >
35
+ {name}
36
+ </span>
37
+ );
38
+ };
39
+
40
+ export { MaterialIcon };
41
+
42
+ MaterialIcon.displayName = "MaterialIcon";
43
+
44
+ export type { IconProps, IconName } from "./types";
@@ -1,31 +1,31 @@
1
- import type { CSSProperties } from "react";
2
- import {
3
- emphasis,
4
- iconNameList,
5
- OpticalSizes,
6
- sizes,
7
- weights,
8
- } from "./constants";
9
-
10
- export type Fill = 1 | 0;
11
-
12
- export type IconName = (typeof iconNameList)[number];
13
-
14
- export type OpticalSize = (typeof OpticalSizes)[number];
15
- export type Weight = (typeof weights)[number];
16
- export type Emphasis = (typeof emphasis)[number];
17
- export type Size = (typeof sizes)[number];
18
-
19
- export type IconProps = {
20
- name: IconName;
21
- fill?: Fill;
22
- opticalSize?: OpticalSize;
23
- weight?: Weight;
24
- emphasis?: Emphasis;
25
- size?: Size;
26
- color?: string;
27
- style?: CSSProperties;
28
- className?: string;
29
- onClick?: () => void;
30
- dataTestId?: string;
31
- };
1
+ import type { CSSProperties } from "react";
2
+ import {
3
+ emphasis,
4
+ iconNameList,
5
+ OpticalSizes,
6
+ sizes,
7
+ weights,
8
+ } from "./constants";
9
+
10
+ export type Fill = 1 | 0;
11
+
12
+ export type IconName = (typeof iconNameList)[number];
13
+
14
+ export type OpticalSize = (typeof OpticalSizes)[number];
15
+ export type Weight = (typeof weights)[number];
16
+ export type Emphasis = (typeof emphasis)[number];
17
+ export type Size = (typeof sizes)[number];
18
+
19
+ export type IconProps = {
20
+ name: IconName;
21
+ fill?: Fill;
22
+ opticalSize?: OpticalSize;
23
+ weight?: Weight;
24
+ emphasis?: Emphasis;
25
+ size?: Size;
26
+ color?: string;
27
+ style?: CSSProperties;
28
+ className?: string;
29
+ onClick?: () => void;
30
+ dataTestId?: string;
31
+ };
@@ -1,6 +1,6 @@
1
1
  import { Modal } from "./index";
2
- import { DocsPage } from "@shared/stories/DocsTemplate";
3
2
 
3
+ import { DocsPage } from "@shared/stories/DocsTemplate";
4
4
  import type { Meta, StoryObj } from "@storybook/react";
5
5
 
6
6
  const meta: Meta<typeof Modal> = {
@@ -69,14 +69,14 @@ export const Default: Story = {
69
69
  children: (
70
70
  <div className="space-y-4">
71
71
  <p className="text-gray-600">
72
- This is a default modal with some content. You can close it by clicking
73
- the X button, pressing Escape, or clicking outside the modal.
72
+ This is a default modal with some content. You can close it by
73
+ clicking the X button, pressing Escape, or clicking outside the modal.
74
74
  </p>
75
75
  <div className="flex justify-end space-x-2">
76
76
  <button className="px-4 py-2 text-gray-600 hover:text-gray-800">
77
77
  Cancel
78
78
  </button>
79
- <button className="px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700">
79
+ <button className="rounded bg-blue-600 px-4 py-2 text-white hover:bg-blue-700">
80
80
  Confirm
81
81
  </button>
82
82
  </div>
@@ -107,8 +107,8 @@ export const Large: Story = {
107
107
  for forms, detailed information, or complex layouts.
108
108
  </p>
109
109
  <div className="grid grid-cols-2 gap-4">
110
- <div className="p-4 bg-gray-100 rounded">Content 1</div>
111
- <div className="p-4 bg-gray-100 rounded">Content 2</div>
110
+ <div className="rounded bg-gray-100 p-4">Content 1</div>
111
+ <div className="rounded bg-gray-100 p-4">Content 2</div>
112
112
  </div>
113
113
  </div>
114
114
  ),
@@ -127,13 +127,13 @@ export const BottomSheet: Story = {
127
127
  This modal slides up from the bottom, perfect for mobile interfaces.
128
128
  </p>
129
129
  <div className="space-y-2">
130
- <button className="w-full p-3 text-left hover:bg-gray-100 rounded">
130
+ <button className="w-full rounded p-3 text-left hover:bg-gray-100">
131
131
  Option 1
132
132
  </button>
133
- <button className="w-full p-3 text-left hover:bg-gray-100 rounded">
133
+ <button className="w-full rounded p-3 text-left hover:bg-gray-100">
134
134
  Option 2
135
135
  </button>
136
- <button className="w-full p-3 text-left hover:bg-gray-100 rounded">
136
+ <button className="w-full rounded p-3 text-left hover:bg-gray-100">
137
137
  Option 3
138
138
  </button>
139
139
  </div>
@@ -1,13 +1,11 @@
1
1
  import React, { useEffect, useMemo, useState } from "react";
2
- import ReactModal from "react-modal";
3
- import { Transition } from "react-transition-group";
4
-
5
- import { MaterialIcon } from "../material-icon";
6
- import { cx } from "../../utils";
7
2
  import useBodyScrollLock from "../../hooks/use-body-scroll-lock";
8
-
9
- import { ModalProps, Size, Shape, Animation } from "./types";
3
+ import { cx } from "../../utils";
10
4
  import { Button } from "../button";
5
+ import { MaterialIcon } from "../material-icon";
6
+ import { Animation, ModalProps, Shape, Size } from "./types";
7
+ import ReactModal from "react-modal";
8
+ import { Transition } from "react-transition-group";
11
9
 
12
10
  const Modal: React.FC<ModalProps> = ({
13
11
  size = "md",
@@ -102,7 +100,7 @@ const Modal: React.FC<ModalProps> = ({
102
100
  closeTimeoutMS={0}
103
101
  parentSelector={() => parent}
104
102
  className={cx(
105
- "absolute bg-white overflow-auto outline-none min-w-[150px] rounded-lg max-w-[calc(100vw-30px)]",
103
+ "absolute min-w-[150px] max-w-[calc(100vw-30px)] overflow-auto rounded-lg bg-white outline-none",
106
104
  getSizeClasses(size),
107
105
  shape === "rounded" && "rounded-3xl",
108
106
  centered && "top-0 translate-y-[calc(50vh-50%)]",
@@ -129,10 +127,7 @@ const Modal: React.FC<ModalProps> = ({
129
127
  data-track-click-text="Close Modal"
130
128
  data-track-element-clicked="modal"
131
129
  >
132
- <MaterialIcon
133
- name="close"
134
- size={24}
135
- />
130
+ <MaterialIcon name="close" size={24} />
136
131
  </Button>
137
132
  </div>
138
133
  )}
@@ -140,7 +135,7 @@ const Modal: React.FC<ModalProps> = ({
140
135
  {title ? (
141
136
  <div
142
137
  className={cx(
143
- "px-[7px] py-[7px] border-b border-border-secondary-on-bg-fill text-text",
138
+ "border-b border-border-secondary-on-bg-fill px-[7px] py-[7px] text-text"
144
139
  )}
145
140
  >
146
141
  {title}
@@ -165,4 +160,3 @@ export { Modal };
165
160
  Modal.displayName = "Modal";
166
161
 
167
162
  export type { ModalProps, Size, Shape, Animation };
168
-
@@ -21,4 +21,4 @@ type OwnProps = {
21
21
  ["data-cy"]?: string;
22
22
  };
23
23
 
24
- export type ModalProps = OwnProps & RModalProps;
24
+ export type ModalProps = OwnProps & RModalProps;
@@ -1,8 +1,8 @@
1
+ import { useState } from "react";
1
2
  import { RadioButton } from "./index";
2
- import { DocsPage } from "@shared/stories/DocsTemplate";
3
3
 
4
+ import { DocsPage } from "@shared/stories/DocsTemplate";
4
5
  import type { Meta, StoryObj } from "@storybook/react";
5
- import { useState } from "react";
6
6
 
7
7
  const meta: Meta<typeof RadioButton> = {
8
8
  title: "Components/RadioButton",
@@ -177,7 +177,7 @@ export const GroupWithError: Story = {
177
177
  name="payment"
178
178
  value="credit"
179
179
  checked={selected === "credit"}
180
- onChange={(val) =>
180
+ onChange={val =>
181
181
  setSelected(
182
182
  typeof val === "string" || typeof val === "number"
183
183
  ? String(val)
@@ -191,7 +191,7 @@ export const GroupWithError: Story = {
191
191
  name="payment"
192
192
  value="debit"
193
193
  checked={selected === "debit"}
194
- onChange={(val) =>
194
+ onChange={val =>
195
195
  setSelected(
196
196
  typeof val === "string" || typeof val === "number"
197
197
  ? String(val)
@@ -205,7 +205,7 @@ export const GroupWithError: Story = {
205
205
  name="payment"
206
206
  value="paypal"
207
207
  checked={selected === "paypal"}
208
- onChange={(val) =>
208
+ onChange={val =>
209
209
  setSelected(
210
210
  typeof val === "string" || typeof val === "number"
211
211
  ? String(val)
@@ -224,7 +224,8 @@ export const GroupWithError: Story = {
224
224
  parameters: {
225
225
  docs: {
226
226
  description: {
227
- story: "Radio button group with error state when no option is selected.",
227
+ story:
228
+ "Radio button group with error state when no option is selected.",
228
229
  },
229
230
  },
230
231
  },
@@ -304,4 +305,3 @@ export const AllVariants: Story = {
304
305
  },
305
306
  },
306
307
  };
307
-