@windstream/react-shared-components 0.0.17 → 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 (141) hide show
  1. package/dist/contentful/index.d.ts +35 -5
  2. package/dist/contentful/index.esm.js +1 -1
  3. package/dist/contentful/index.esm.js.map +1 -1
  4. package/dist/contentful/index.js +1 -1
  5. package/dist/contentful/index.js.map +1 -1
  6. package/dist/core.d.ts +38 -10
  7. package/dist/index.d.ts +39 -11
  8. package/dist/index.esm.js +5 -5
  9. package/dist/index.esm.js.map +1 -1
  10. package/dist/index.js +5 -5
  11. package/dist/index.js.map +1 -1
  12. package/dist/styles.css +1 -1
  13. package/dist/utils/index.esm.js.map +1 -1
  14. package/dist/utils/index.js.map +1 -1
  15. package/package.json +1 -1
  16. package/src/components/accordion/Accordion.stories.tsx +16 -11
  17. package/src/components/accordion/index.tsx +19 -8
  18. package/src/components/accordion/types.ts +8 -9
  19. package/src/components/alert-card/AlertCard.stories.tsx +4 -5
  20. package/src/components/alert-card/index.tsx +6 -9
  21. package/src/components/alert-card/types.ts +9 -9
  22. package/src/components/brand-button/BrandButton.stories.tsx +8 -10
  23. package/src/components/brand-button/helpers.ts +8 -8
  24. package/src/components/brand-button/index.tsx +30 -27
  25. package/src/components/brand-button/types.ts +6 -8
  26. package/src/components/button/Button.stories.tsx +6 -6
  27. package/src/components/button/index.tsx +3 -1
  28. package/src/components/button/types.ts +14 -14
  29. package/src/components/call-button/CallButton.stories.tsx +1 -1
  30. package/src/components/call-button/index.tsx +3 -4
  31. package/src/components/call-button/types.ts +1 -0
  32. package/src/components/checkbox/Checkbox.stories.tsx +6 -7
  33. package/src/components/checkbox/index.tsx +17 -7
  34. package/src/components/checkbox/types.ts +19 -16
  35. package/src/components/checklist/Checklist.stories.tsx +1 -2
  36. package/src/components/checklist/index.tsx +12 -6
  37. package/src/components/checklist/types.ts +5 -5
  38. package/src/components/collapse/Collapse.stories.tsx +18 -19
  39. package/src/components/collapse/index.tsx +1 -1
  40. package/src/components/collapse/types.ts +4 -4
  41. package/src/components/divider/Divider.stories.tsx +16 -17
  42. package/src/components/divider/index.tsx +2 -3
  43. package/src/components/divider/type.ts +2 -2
  44. package/src/components/image/Image.stories.tsx +113 -0
  45. package/src/components/image/index.tsx +22 -0
  46. package/src/components/image/types.ts +28 -0
  47. package/src/components/input/Input.stories.tsx +13 -46
  48. package/src/components/input/index.tsx +18 -15
  49. package/src/components/input/types.ts +1 -1
  50. package/src/components/link/Link.stories.tsx +1 -1
  51. package/src/components/link/index.tsx +1 -2
  52. package/src/components/link/types.ts +25 -25
  53. package/src/components/list/List.stories.tsx +1 -1
  54. package/src/components/list/index.tsx +86 -86
  55. package/src/components/list/list-item/index.tsx +36 -36
  56. package/src/components/list/list-item/types.ts +13 -13
  57. package/src/components/list/types.ts +29 -29
  58. package/src/components/material-icon/MaterialIcon.stories.tsx +1 -1
  59. package/src/components/material-icon/constants.ts +1 -1
  60. package/src/components/material-icon/index.tsx +44 -44
  61. package/src/components/material-icon/types.ts +31 -31
  62. package/src/components/modal/Modal.stories.tsx +9 -9
  63. package/src/components/modal/index.tsx +8 -14
  64. package/src/components/modal/types.ts +1 -1
  65. package/src/components/radio-button/RadioButton.stories.tsx +7 -7
  66. package/src/components/radio-button/index.tsx +11 -9
  67. package/src/components/radio-button/types.ts +18 -19
  68. package/src/components/see-more/SeeMore.stories.tsx +14 -15
  69. package/src/components/see-more/index.tsx +33 -29
  70. package/src/components/see-more/types.ts +3 -3
  71. package/src/components/select/Select.stories.tsx +3 -2
  72. package/src/components/select/index.tsx +15 -17
  73. package/src/components/select/types.ts +2 -1
  74. package/src/components/select-plan-button/SelectPlanButton.stories.tsx +20 -12
  75. package/src/components/select-plan-button/index.tsx +28 -20
  76. package/src/components/select-plan-button/types.ts +1 -1
  77. package/src/components/skeleton/Skeleton.stories.tsx +9 -10
  78. package/src/components/skeleton/index.tsx +61 -61
  79. package/src/components/skeleton/types.ts +3 -3
  80. package/src/components/spinner/Spinner.stories.tsx +1 -1
  81. package/src/components/spinner/index.tsx +1 -1
  82. package/src/components/spinner/types.ts +4 -4
  83. package/src/components/text/Text.stories.tsx +35 -16
  84. package/src/components/text/index.tsx +2 -5
  85. package/src/components/text/types.ts +45 -45
  86. package/src/components/tooltip/Tooltip.stories.tsx +15 -16
  87. package/src/components/tooltip/index.tsx +1 -5
  88. package/src/components/tooltip/types.ts +4 -4
  89. package/src/components/view-cart-button/ViewCartButton.stories.tsx +23 -12
  90. package/src/components/view-cart-button/index.tsx +11 -6
  91. package/src/components/view-cart-button/types.ts +1 -1
  92. package/src/contentful/blocks/accordion/Accordion.stories.tsx +23 -0
  93. package/src/contentful/blocks/accordion/index.tsx +11 -1
  94. package/src/contentful/blocks/accordion/types.ts +1 -1
  95. package/src/contentful/blocks/button/Button.stories.tsx +40 -0
  96. package/src/contentful/blocks/button/index.tsx +15 -14
  97. package/src/contentful/blocks/button/types.ts +17 -17
  98. package/src/contentful/blocks/callout/Callout.stories.tsx +23 -0
  99. package/src/contentful/blocks/callout/index.tsx +9 -1
  100. package/src/contentful/blocks/callout/types.ts +1 -1
  101. package/src/contentful/blocks/cards/Cards.stories.tsx +23 -0
  102. package/src/contentful/blocks/cards/index.tsx +7 -1
  103. package/src/contentful/blocks/cards/types.ts +1 -1
  104. package/src/contentful/blocks/carousel/Carousel.stories.tsx +23 -0
  105. package/src/contentful/blocks/carousel/index.tsx +7 -1
  106. package/src/contentful/blocks/carousel/types.ts +1 -1
  107. package/src/contentful/blocks/cta-callout/CtaCallout.stories.tsx +46 -0
  108. package/src/contentful/blocks/cta-callout/index.tsx +5 -5
  109. package/src/contentful/blocks/cta-callout/types.ts +16 -16
  110. package/src/contentful/blocks/floating-banner/FloatingBanner.stories.tsx +23 -0
  111. package/src/contentful/blocks/floating-banner/index.tsx +6 -2
  112. package/src/contentful/blocks/floating-banner/types.ts +1 -1
  113. package/src/contentful/blocks/footer/Footer.stories.tsx +30 -0
  114. package/src/contentful/blocks/footer/index.tsx +8 -7
  115. package/src/contentful/blocks/footer/types.ts +7 -6
  116. package/src/contentful/blocks/image-promo-bar/ImagePromoBar.stories.tsx +23 -0
  117. package/src/contentful/blocks/image-promo-bar/index.tsx +84 -2
  118. package/src/contentful/blocks/image-promo-bar/types.ts +28 -1
  119. package/src/contentful/blocks/modal/Modal.stories.tsx +23 -0
  120. package/src/contentful/blocks/modal/index.tsx +8 -2
  121. package/src/contentful/blocks/modal/types.ts +1 -1
  122. package/src/contentful/blocks/navigation/Navigation.stories.tsx +23 -0
  123. package/src/contentful/blocks/navigation/index.tsx +6 -2
  124. package/src/contentful/blocks/navigation/types.ts +1 -1
  125. package/src/contentful/blocks/primary-hero/PrimaryHero.stories.tsx +23 -0
  126. package/src/contentful/blocks/primary-hero/index.tsx +4 -3
  127. package/src/contentful/blocks/primary-hero/types.ts +29 -25
  128. package/src/contentful/blocks/shape-background-wrapper/ShapeBackgroundWrapper.stories.tsx +26 -0
  129. package/src/contentful/blocks/shape-background-wrapper/index.tsx +107 -106
  130. package/src/contentful/blocks/shape-background-wrapper/types.ts +24 -23
  131. package/src/contentful/blocks/text/Text.stories.tsx +23 -0
  132. package/src/contentful/blocks/text/index.tsx +7 -1
  133. package/src/contentful/blocks/text/types.ts +1 -1
  134. package/src/contentful/index.ts +1 -1
  135. package/src/hooks/use-body-scroll-lock.ts +2 -1
  136. package/src/index.ts +14 -2
  137. package/src/setupTests.ts +46 -46
  138. package/src/stories/DocsTemplate.tsx +0 -2
  139. package/src/styles/globals.css +162 -162
  140. package/src/types/global.d.ts +9 -9
  141. package/src/utils/index.ts +34 -34
@@ -1,61 +1,61 @@
1
- import { FC } from "react";
2
- import { SkeletonProps } from "./types";
3
-
4
- export const Skeleton: FC<SkeletonProps> = ({ className = "", count = 1 }) => {
5
- return (
6
- <div className="animate-pulse space-y-4">
7
- {Array.from({ length: count }).map((_, index) => (
8
- <div
9
- key={index}
10
- className={`h-8 rounded bg-skeleton-bg-start ${className}`}
11
- style={{ opacity: 1 - index * 0.1 }}
12
- />
13
- ))}
14
- </div>
15
- );
16
- };
17
-
18
- Skeleton.displayName = "Skeleton";
19
-
20
- export type { SkeletonProps };
21
-
22
- export const PageSkeleton: FC = () => {
23
- return (
24
- <div
25
- className="item-center mx-auto mt-4 flex animate-pulse flex-col justify-center gap-10 px-1 md:max-w-[48.375rem] md:gap-16 md:px-0"
26
- data-testid="generic-skeleton"
27
- >
28
- {/* Title */}
29
- <div
30
- className="h-12 w-full rounded-lg bg-skeleton-bg-start"
31
- data-testid="title"
32
- />
33
-
34
- {/* Subtitle */}
35
- <div className="item-center flex flex-col gap-6" data-testid="subtitle">
36
- <div className="h-5 w-full rounded-lg bg-skeleton-bg-start" />
37
- <div className="h-5 w-full rounded-lg bg-skeleton-bg-start" />
38
- </div>
39
-
40
- {/* Content */}
41
- <div className="item-center flex flex-col gap-3" data-testid="content">
42
- <div className="h-12 w-full rounded-lg bg-skeleton-bg-start" />
43
- <div className="h-12 w-full rounded-lg bg-skeleton-bg-start" />
44
- </div>
45
-
46
- {/* Additional Information */}
47
- <div
48
- className="item-center flex flex-col gap-6"
49
- data-testid="additional-info"
50
- >
51
- <div className="h-5 w-full rounded-lg bg-skeleton-bg-end" />
52
- <div className="h-5 w-full rounded-lg bg-skeleton-bg-end" />
53
- </div>
54
-
55
- {/* CTA button */}
56
- <div className="item-center flex justify-center" data-testid="cta-button">
57
- <div className="h-12 w-full rounded-lg bg-skeleton-bg-end md:w-[22.125rem]" />
58
- </div>
59
- </div>
60
- );
61
- };
1
+ import { FC } from "react";
2
+ import { SkeletonProps } from "./types";
3
+
4
+ export const Skeleton: FC<SkeletonProps> = ({ className = "", count = 1 }) => {
5
+ return (
6
+ <div className="animate-pulse space-y-4">
7
+ {Array.from({ length: count }).map((_, index) => (
8
+ <div
9
+ key={index}
10
+ className={`h-8 rounded bg-skeleton-bg-start ${className}`}
11
+ style={{ opacity: 1 - index * 0.1 }}
12
+ />
13
+ ))}
14
+ </div>
15
+ );
16
+ };
17
+
18
+ Skeleton.displayName = "Skeleton";
19
+
20
+ export type { SkeletonProps };
21
+
22
+ export const PageSkeleton: FC = () => {
23
+ return (
24
+ <div
25
+ className="item-center mx-auto mt-4 flex animate-pulse flex-col justify-center gap-10 px-1 md:max-w-[48.375rem] md:gap-16 md:px-0"
26
+ data-testid="generic-skeleton"
27
+ >
28
+ {/* Title */}
29
+ <div
30
+ className="h-12 w-full rounded-lg bg-skeleton-bg-start"
31
+ data-testid="title"
32
+ />
33
+
34
+ {/* Subtitle */}
35
+ <div className="item-center flex flex-col gap-6" data-testid="subtitle">
36
+ <div className="h-5 w-full rounded-lg bg-skeleton-bg-start" />
37
+ <div className="h-5 w-full rounded-lg bg-skeleton-bg-start" />
38
+ </div>
39
+
40
+ {/* Content */}
41
+ <div className="item-center flex flex-col gap-3" data-testid="content">
42
+ <div className="h-12 w-full rounded-lg bg-skeleton-bg-start" />
43
+ <div className="h-12 w-full rounded-lg bg-skeleton-bg-start" />
44
+ </div>
45
+
46
+ {/* Additional Information */}
47
+ <div
48
+ className="item-center flex flex-col gap-6"
49
+ data-testid="additional-info"
50
+ >
51
+ <div className="h-5 w-full rounded-lg bg-skeleton-bg-end" />
52
+ <div className="h-5 w-full rounded-lg bg-skeleton-bg-end" />
53
+ </div>
54
+
55
+ {/* CTA button */}
56
+ <div className="item-center flex justify-center" data-testid="cta-button">
57
+ <div className="h-12 w-full rounded-lg bg-skeleton-bg-end md:w-[22.125rem]" />
58
+ </div>
59
+ </div>
60
+ );
61
+ };
@@ -1,4 +1,4 @@
1
1
  export type SkeletonProps = {
2
- className?: string;
3
- count?: number;
4
- }
2
+ className?: string;
3
+ count?: number;
4
+ };
@@ -1,6 +1,6 @@
1
1
  import { Spinner } 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 Spinner> = {
@@ -17,7 +17,7 @@ export const Spinner: React.FunctionComponent<SpinnerProps> = props => {
17
17
  <svg
18
18
  aria-hidden="true"
19
19
  className={cx(
20
- "mr-2 h-5 w-5 text-transparent animate-spin",
20
+ "mr-2 h-5 w-5 animate-spin text-transparent",
21
21
  sizeClasses[size],
22
22
  props.className
23
23
  )}
@@ -1,5 +1,5 @@
1
1
  export type SpinnerProps = {
2
- size?: "small" | "medium" | "large" | "xlarge";
3
- color?: string;
4
- className?: string;
5
- } & React.HTMLAttributes<HTMLDivElement>;
2
+ size?: "small" | "medium" | "large" | "xlarge";
3
+ color?: string;
4
+ className?: string;
5
+ } & React.HTMLAttributes<HTMLDivElement>;
@@ -1,6 +1,6 @@
1
1
  import { Text } 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 Text> = {
@@ -36,7 +36,8 @@ const meta: Meta<typeof Text> = {
36
36
  },
37
37
  className: {
38
38
  control: { type: "text" },
39
- description: "Additional CSS classes (use typography classes like body1, heading1, etc.)",
39
+ description:
40
+ "Additional CSS classes (use typography classes like body1, heading1, etc.)",
40
41
  },
41
42
  children: {
42
43
  control: { type: "text" },
@@ -142,7 +143,7 @@ export const Labels: Story = {
142
143
  render: () => (
143
144
  <div className="space-y-4">
144
145
  <div>
145
- <Text as="label" className="mb-2 block body1">
146
+ <Text as="label" className="body1 mb-2 block">
146
147
  Label 1
147
148
  </Text>
148
149
  <input
@@ -152,7 +153,7 @@ export const Labels: Story = {
152
153
  />
153
154
  </div>
154
155
  <div>
155
- <Text as="label" className="mb-2 block body2">
156
+ <Text as="label" className="body2 mb-2 block">
156
157
  Label 2
157
158
  </Text>
158
159
  <input
@@ -162,7 +163,7 @@ export const Labels: Story = {
162
163
  />
163
164
  </div>
164
165
  <div>
165
- <Text as="label" className="mb-2 block body3">
166
+ <Text as="label" className="body3 mb-2 block">
166
167
  Label 3
167
168
  </Text>
168
169
  <input
@@ -172,7 +173,7 @@ export const Labels: Story = {
172
173
  />
173
174
  </div>
174
175
  <div>
175
- <Text as="label" className="mb-2 block footnote">
176
+ <Text as="label" className="footnote mb-2 block">
176
177
  Label 4
177
178
  </Text>
178
179
  <input
@@ -233,7 +234,7 @@ export const SemanticElements: Story = {
233
234
  It demonstrates how the Text component can be used with semantic HTML
234
235
  elements.
235
236
  </Text>
236
- <Text as="label" className="block body1">
237
+ <Text as="label" className="body1 block">
237
238
  Form Label
238
239
  </Text>
239
240
  <Text as="span" className="footnote">
@@ -258,27 +259,45 @@ export const AllVariants: Story = {
258
259
  <div>
259
260
  <h3 className="mb-3 text-lg font-semibold">Headings</h3>
260
261
  <div className="space-y-2">
261
- <Text as="h1" className="heading1">Heading 1</Text>
262
- <Text as="h2" className="heading2">Heading 2</Text>
263
- <Text as="h3" className="heading3">Heading 3</Text>
262
+ <Text as="h1" className="heading1">
263
+ Heading 1
264
+ </Text>
265
+ <Text as="h2" className="heading2">
266
+ Heading 2
267
+ </Text>
268
+ <Text as="h3" className="heading3">
269
+ Heading 3
270
+ </Text>
264
271
  </div>
265
272
  </div>
266
273
 
267
274
  <div>
268
275
  <h3 className="mb-3 text-lg font-semibold">Body Text</h3>
269
276
  <div className="space-y-2">
270
- <Text as="p" className="body1">Body 1 - Main content text</Text>
271
- <Text as="p" className="body2">Body 2 - Secondary content text</Text>
272
- <Text as="p" className="body3">Body 3 - Smaller content text</Text>
277
+ <Text as="p" className="body1">
278
+ Body 1 - Main content text
279
+ </Text>
280
+ <Text as="p" className="body2">
281
+ Body 2 - Secondary content text
282
+ </Text>
283
+ <Text as="p" className="body3">
284
+ Body 3 - Smaller content text
285
+ </Text>
273
286
  </div>
274
287
  </div>
275
288
 
276
289
  <div>
277
290
  <h3 className="mb-3 text-lg font-semibold">Labels</h3>
278
291
  <div className="space-y-2">
279
- <Text as="label" className="body1">Label 1</Text>
280
- <Text as="label" className="body2">Label 2</Text>
281
- <Text as="label" className="body3">Label 3</Text>
292
+ <Text as="label" className="body1">
293
+ Label 1
294
+ </Text>
295
+ <Text as="label" className="body2">
296
+ Label 2
297
+ </Text>
298
+ <Text as="label" className="body3">
299
+ Label 3
300
+ </Text>
282
301
  <Text className="footnote">Label 4</Text>
283
302
  </div>
284
303
  </div>
@@ -2,11 +2,8 @@ import React, { forwardRef } from "react";
2
2
  import { TextProps, TextVariant } from "./types";
3
3
 
4
4
  export const Text = forwardRef<HTMLElement, TextProps>(
5
- (
6
- { children, as, className = "", style, ...props },
7
- ref
8
- ) => {
9
- const elementType = as || 'p';
5
+ ({ children, as, className = "", style, ...props }, ref) => {
6
+ const elementType = as || "p";
10
7
 
11
8
  return React.createElement(
12
9
  elementType,
@@ -1,45 +1,45 @@
1
- import { type CSSProperties, type HTMLAttributes, type ReactNode } from "react";
2
-
3
- export type TextVariant =
4
- | "heading1"
5
- | "heading2"
6
- | "heading3"
7
- | "heading4"
8
- | "heading5"
9
- | "heading6"
10
- | "subheading1"
11
- | "subheading2"
12
- | "subheading3"
13
- | "subheading4"
14
- | "subheading5"
15
- | "subheading6"
16
- | "body1"
17
- | "body2"
18
- | "body3"
19
- | "footnote"
20
- | "micro"
21
- | "label1"
22
- | "label2"
23
- | "label3"
24
- | "label4"
25
- | "error"
26
- | "unstyled";
27
- export type TextWeight =
28
- | "thin"
29
- | "normal"
30
- | "medium"
31
- | "semibold"
32
- | "bold"
33
- | "extrabold"
34
- | "black"
35
- | undefined;
36
- export interface TextProps extends HTMLAttributes<HTMLElement> {
37
- /** Content to render inside the text element */
38
- children?: ReactNode;
39
- /** Custom HTML element to render as */
40
- as?: keyof import("react").JSX.IntrinsicElements;
41
- /** Custom className for the text */
42
- className?: string;
43
- /** Custom styles */
44
- style?: CSSProperties;
45
- }
1
+ import { type CSSProperties, type HTMLAttributes, type ReactNode } from "react";
2
+
3
+ export type TextVariant =
4
+ | "heading1"
5
+ | "heading2"
6
+ | "heading3"
7
+ | "heading4"
8
+ | "heading5"
9
+ | "heading6"
10
+ | "subheading1"
11
+ | "subheading2"
12
+ | "subheading3"
13
+ | "subheading4"
14
+ | "subheading5"
15
+ | "subheading6"
16
+ | "body1"
17
+ | "body2"
18
+ | "body3"
19
+ | "footnote"
20
+ | "micro"
21
+ | "label1"
22
+ | "label2"
23
+ | "label3"
24
+ | "label4"
25
+ | "error"
26
+ | "unstyled";
27
+ export type TextWeight =
28
+ | "thin"
29
+ | "normal"
30
+ | "medium"
31
+ | "semibold"
32
+ | "bold"
33
+ | "extrabold"
34
+ | "black"
35
+ | undefined;
36
+ export interface TextProps extends HTMLAttributes<HTMLElement> {
37
+ /** Content to render inside the text element */
38
+ children?: ReactNode;
39
+ /** Custom HTML element to render as */
40
+ as?: keyof import("react").JSX.IntrinsicElements;
41
+ /** Custom className for the text */
42
+ className?: string;
43
+ /** Custom styles */
44
+ style?: CSSProperties;
45
+ }
@@ -1,6 +1,6 @@
1
1
  import { Tooltip } 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 Tooltip> = {
@@ -58,7 +58,7 @@ export const WithButton: Story = {
58
58
  args: {
59
59
  tooltipMsg: "Click to submit the form",
60
60
  children: (
61
- <button className="px-4 py-2 bg-fill-brand text-inverse rounded">
61
+ <button className="bg-fill-brand text-inverse rounded px-4 py-2">
62
62
  Submit
63
63
  </button>
64
64
  ),
@@ -70,7 +70,7 @@ export const WithIcon: Story = {
70
70
  args: {
71
71
  tooltipMsg: "More information",
72
72
  children: (
73
- <span className="inline-flex items-center justify-center w-8 h-8 rounded-full bg-surface-secondary text-icon-info cursor-help">
73
+ <span className="bg-surface-secondary inline-flex h-8 w-8 cursor-help items-center justify-center rounded-full text-icon-info">
74
74
  i
75
75
  </span>
76
76
  ),
@@ -104,17 +104,17 @@ export const LongMessage: Story = {
104
104
  // Different children
105
105
  export const DifferentChildren: Story = {
106
106
  render: () => (
107
- <div className="flex flex-wrap gap-4 items-center">
107
+ <div className="flex flex-wrap items-center gap-4">
108
108
  <Tooltip tooltipMsg="Text tooltip">
109
- <span className="underline cursor-help">Text</span>
109
+ <span className="cursor-help underline">Text</span>
110
110
  </Tooltip>
111
111
  <Tooltip tooltipMsg="Button tooltip">
112
- <button className="px-4 py-2 bg-fill-brand text-inverse rounded">
112
+ <button className="bg-fill-brand text-inverse rounded px-4 py-2">
113
113
  Button
114
114
  </button>
115
115
  </Tooltip>
116
116
  <Tooltip tooltipMsg="Icon tooltip">
117
- <span className="inline-flex items-center justify-center w-8 h-8 rounded-full bg-surface-secondary text-icon-info cursor-help">
117
+ <span className="bg-surface-secondary inline-flex h-8 w-8 cursor-help items-center justify-center rounded-full text-icon-info">
118
118
  ?
119
119
  </span>
120
120
  </Tooltip>
@@ -149,17 +149,17 @@ export const Multiple: Story = {
149
149
  <div className="space-y-4">
150
150
  <div className="flex gap-4">
151
151
  <Tooltip tooltipMsg="First tooltip">
152
- <button className="px-4 py-2 bg-surface-secondary text-text rounded">
152
+ <button className="bg-surface-secondary rounded px-4 py-2 text-text">
153
153
  Button 1
154
154
  </button>
155
155
  </Tooltip>
156
156
  <Tooltip tooltipMsg="Second tooltip">
157
- <button className="px-4 py-2 bg-surface-secondary text-text rounded">
157
+ <button className="bg-surface-secondary rounded px-4 py-2 text-text">
158
158
  Button 2
159
159
  </button>
160
160
  </Tooltip>
161
161
  <Tooltip tooltipMsg="Third tooltip">
162
- <button className="px-4 py-2 bg-surface-secondary text-text rounded">
162
+ <button className="bg-surface-secondary rounded px-4 py-2 text-text">
163
163
  Button 3
164
164
  </button>
165
165
  </Tooltip>
@@ -178,17 +178,17 @@ export const Multiple: Story = {
178
178
  // All variants showcase
179
179
  export const AllVariants: Story = {
180
180
  render: () => (
181
- <div className="w-full max-w-2xl space-y-8">
181
+ <div className="max-w-2xl w-full space-y-8">
182
182
  <div>
183
183
  <h3 className="mb-3 text-lg font-semibold">With Text</h3>
184
184
  <Tooltip tooltipMsg="This is a tooltip message">
185
- <span className="underline cursor-help">Hover me</span>
185
+ <span className="cursor-help underline">Hover me</span>
186
186
  </Tooltip>
187
187
  </div>
188
188
  <div>
189
189
  <h3 className="mb-3 text-lg font-semibold">With Button</h3>
190
190
  <Tooltip tooltipMsg="Click to submit">
191
- <button className="px-4 py-2 bg-fill-brand text-inverse rounded">
191
+ <button className="bg-fill-brand text-inverse rounded px-4 py-2">
192
192
  Submit
193
193
  </button>
194
194
  </Tooltip>
@@ -196,7 +196,7 @@ export const AllVariants: Story = {
196
196
  <div>
197
197
  <h3 className="mb-3 text-lg font-semibold">With Icon</h3>
198
198
  <Tooltip tooltipMsg="More information">
199
- <span className="inline-flex items-center justify-center w-8 h-8 rounded-full bg-surface-secondary text-icon-info cursor-help">
199
+ <span className="bg-surface-secondary inline-flex h-8 w-8 cursor-help items-center justify-center rounded-full text-icon-info">
200
200
  i
201
201
  </span>
202
202
  </Tooltip>
@@ -204,7 +204,7 @@ export const AllVariants: Story = {
204
204
  <div>
205
205
  <h3 className="mb-3 text-lg font-semibold">Long Message</h3>
206
206
  <Tooltip tooltipMsg="This is a longer tooltip message that demonstrates how the tooltip handles extended text content.">
207
- <span className="underline cursor-help">Hover for long message</span>
207
+ <span className="cursor-help underline">Hover for long message</span>
208
208
  </Tooltip>
209
209
  </div>
210
210
  </div>
@@ -217,4 +217,3 @@ export const AllVariants: Story = {
217
217
  },
218
218
  },
219
219
  };
220
-
@@ -1,10 +1,6 @@
1
1
  import { ToolTipProps } from "./types";
2
2
 
3
- export function Tooltip({
4
- tooltipMsg,
5
- className,
6
- children,
7
- }: ToolTipProps) {
3
+ export function Tooltip({ tooltipMsg, className, children }: ToolTipProps) {
8
4
  return (
9
5
  <>
10
6
  <style>{`
@@ -1,7 +1,7 @@
1
1
  import { ReactNode } from "react";
2
2
 
3
3
  export type ToolTipProps = {
4
- tooltipMsg: string;
5
- children: ReactNode;
6
- className?: string;
7
- };
4
+ tooltipMsg: string;
5
+ children: ReactNode;
6
+ className?: string;
7
+ };
@@ -1,8 +1,8 @@
1
+ import { useState } from "react";
1
2
  import { ViewCartButton } 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 ViewCartButton> = {
8
8
  title: "Components/ViewCartButton",
@@ -75,14 +75,14 @@ export const Interactive: Story = {
75
75
  render: () => {
76
76
  const [isOpen, setIsOpen] = useState(false);
77
77
  return (
78
- <div className="w-full max-w-md">
78
+ <div className="max-w-md w-full">
79
79
  <ViewCartButton
80
80
  cartTotalText="$149.99"
81
81
  isOpen={isOpen}
82
82
  onClick={() => setIsOpen(!isOpen)}
83
83
  />
84
84
  {isOpen && (
85
- <div className="mt-4 p-4 bg-surface-secondary rounded">
85
+ <div className="bg-surface-secondary mt-4 rounded p-4">
86
86
  <p className="body2 text-text">Cart is open</p>
87
87
  </div>
88
88
  )}
@@ -102,11 +102,23 @@ export const Interactive: Story = {
102
102
  // Different totals
103
103
  export const DifferentTotals: Story = {
104
104
  render: () => (
105
- <div className="w-full max-w-md space-y-3">
105
+ <div className="max-w-md w-full space-y-3">
106
106
  <ViewCartButton cartTotalText="$0.00" isOpen={false} onClick={() => {}} />
107
- <ViewCartButton cartTotalText="$29.99" isOpen={false} onClick={() => {}} />
108
- <ViewCartButton cartTotalText="$99.99" isOpen={false} onClick={() => {}} />
109
- <ViewCartButton cartTotalText="$249.99" isOpen={false} onClick={() => {}} />
107
+ <ViewCartButton
108
+ cartTotalText="$29.99"
109
+ isOpen={false}
110
+ onClick={() => {}}
111
+ />
112
+ <ViewCartButton
113
+ cartTotalText="$99.99"
114
+ isOpen={false}
115
+ onClick={() => {}}
116
+ />
117
+ <ViewCartButton
118
+ cartTotalText="$249.99"
119
+ isOpen={false}
120
+ onClick={() => {}}
121
+ />
110
122
  </div>
111
123
  ),
112
124
  parameters: {
@@ -138,7 +150,7 @@ export const Responsive: Story = {
138
150
  <h3 className="mb-2 text-sm font-medium text-gray-600">
139
151
  Desktop View (btn-medium)
140
152
  </h3>
141
- <div className="w-full max-w-md border border-gray-200 p-2">
153
+ <div className="max-w-md w-full border border-gray-200 p-2">
142
154
  <ViewCartButton
143
155
  cartTotalText="$99.99"
144
156
  isOpen={false}
@@ -161,7 +173,7 @@ export const Responsive: Story = {
161
173
  // Open and closed states
162
174
  export const OpenAndClosed: Story = {
163
175
  render: () => (
164
- <div className="w-full max-w-md space-y-4">
176
+ <div className="max-w-md w-full space-y-4">
165
177
  <div>
166
178
  <h4 className="mb-2 text-sm font-medium">Closed State</h4>
167
179
  <ViewCartButton
@@ -192,7 +204,7 @@ export const OpenAndClosed: Story = {
192
204
  // All variants showcase
193
205
  export const AllVariants: Story = {
194
206
  render: () => (
195
- <div className="w-full max-w-2xl space-y-6">
207
+ <div className="max-w-2xl w-full space-y-6">
196
208
  <div>
197
209
  <h3 className="mb-3 text-lg font-semibold">States</h3>
198
210
  <div className="space-y-3">
@@ -238,4 +250,3 @@ export const AllVariants: Story = {
238
250
  },
239
251
  },
240
252
  };
241
-
@@ -1,15 +1,20 @@
1
- import { cx } from "@shared/utils";
2
1
  import { Button } from "../button";
3
2
  import { MaterialIcon } from "../material-icon";
4
3
  import { Text } from "../text";
5
4
  import { ViewCartButtonProps } from "./types";
5
+
6
+ import { cx } from "@shared/utils";
7
+
6
8
  const baseClasses =
7
9
  "btn-medium rounded-2xl pl-15 pr-15 inline-flex gap-2 items-center justify-center outline-none focus:ring-2 focus:ring-offset-2 cursor-pointer transition-colors duration-200 align-top border-2 border-border-secondary-on-bg-fill bg-bg text-text focus:ring-bg-surface-inverse";
8
- export const ViewCartButton: React.FC<ViewCartButtonProps> = (props) => {
10
+ export const ViewCartButton: React.FC<ViewCartButtonProps> = props => {
9
11
  const { cartTotalText, onClick, isOpen, ...rest } = props;
10
12
  return (
11
13
  <Button
12
- className={cx(baseClasses, "btn-small w-full border-border pl-6 pr-4 md:btn-medium")}
14
+ className={cx(
15
+ baseClasses,
16
+ "btn-small w-full border-border pl-6 pr-4 md:btn-medium"
17
+ )}
13
18
  onClick={onClick}
14
19
  {...rest}
15
20
  >
@@ -33,7 +38,7 @@ export const ViewCartButton: React.FC<ViewCartButtonProps> = (props) => {
33
38
  />
34
39
  </div>
35
40
  </Button>
36
- )
37
- }
41
+ );
42
+ };
38
43
 
39
- export type { ViewCartButtonProps } from "./types";
44
+ export type { ViewCartButtonProps } from "./types";
@@ -2,4 +2,4 @@ export type ViewCartButtonProps = {
2
2
  cartTotalText: string;
3
3
  onClick: () => void;
4
4
  isOpen: boolean;
5
- } & React.ButtonHTMLAttributes<HTMLButtonElement>
5
+ } & React.ButtonHTMLAttributes<HTMLButtonElement>;