@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.
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 +34 -6
  6. package/dist/index.d.ts +33 -5
  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 +28 -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 +16 -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,10 +1,8 @@
1
1
  import React from "react";
2
-
3
- import { cx } from "@shared/utils";
4
-
5
2
  import { RadioButtonProps } from "./types";
6
- import { Button } from "@shared/components/button";
7
3
 
4
+ import { Button } from "@shared/components/button";
5
+ import { cx } from "@shared/utils";
8
6
 
9
7
  export const RadioButton: React.FC<RadioButtonProps> = props => {
10
8
  const {
@@ -48,12 +46,14 @@ export const RadioButton: React.FC<RadioButtonProps> = props => {
48
46
  onClick={handleChange}
49
47
  disabled={disabled}
50
48
  className={cx(
51
- "border-border-secondary-on-bg-fill bg-bg mr-3 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full border-[1px] border-solid outline-offset-4",
52
- checked && "border-border-brand border-[1px] border-solid",
49
+ "mr-3 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full border-[1px] border-solid border-border-secondary-on-bg-fill bg-bg outline-offset-4",
50
+ checked && "border-[1px] border-solid border-border-brand",
53
51
  disabled && "opacity-50"
54
52
  )}
55
53
  >
56
- {checked && <div className="bg-bg-fill-brand h-[0.875rem] w-[0.875rem] rounded-full" />}
54
+ {checked && (
55
+ <div className="h-[0.875rem] w-[0.875rem] rounded-full bg-bg-fill-brand" />
56
+ )}
57
57
  </Button>
58
58
  <Button
59
59
  type="button"
@@ -61,8 +61,10 @@ export const RadioButton: React.FC<RadioButtonProps> = props => {
61
61
  disabled={disabled}
62
62
  tabIndex={label ? 0 : -1}
63
63
  >
64
- <div className={cx("text-body2 font-normal", labelClassName)}>{label}</div>
65
- <div className="text-text-info text-body1">{subText}</div>
64
+ <div className={cx("text-body2 font-normal", labelClassName)}>
65
+ {label}
66
+ </div>
67
+ <div className="text-body1 text-text-info">{subText}</div>
66
68
  </Button>
67
69
  </label>
68
70
  );
@@ -1,22 +1,21 @@
1
1
  import { InputHTMLAttributes, LabelHTMLAttributes, ReactNode } from "react";
2
2
 
3
3
  type OwnProps = {
4
- name: string;
5
- value?: string | number;
6
- checked?: boolean;
7
- onChange?: (newVal?: string | number) => void;
8
- label?: string | ReactNode;
9
- subText?: string;
10
- className?: string;
11
- labelProps?: LabelHTMLAttributes<HTMLLabelElement>;
12
- variant?: "circle";
13
- hasError?: boolean;
14
- "data-cy"?: string;
15
- labelClassName?: string;
16
- };
17
- export type RadioButtonProps = OwnProps &
18
- Omit<
19
- InputHTMLAttributes<HTMLInputElement>,
20
- "onChange" | "value" | "name" | "checked"
21
- >;
22
-
4
+ name: string;
5
+ value?: string | number;
6
+ checked?: boolean;
7
+ onChange?: (newVal?: string | number) => void;
8
+ label?: string | ReactNode;
9
+ subText?: string;
10
+ className?: string;
11
+ labelProps?: LabelHTMLAttributes<HTMLLabelElement>;
12
+ variant?: "circle";
13
+ hasError?: boolean;
14
+ "data-cy"?: string;
15
+ labelClassName?: string;
16
+ };
17
+ export type RadioButtonProps = OwnProps &
18
+ Omit<
19
+ InputHTMLAttributes<HTMLInputElement>,
20
+ "onChange" | "value" | "name" | "checked"
21
+ >;
@@ -1,6 +1,6 @@
1
1
  import { SeeMore } 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 SeeMore> = {
@@ -52,8 +52,8 @@ export const Expanded: Story = {
52
52
  ],
53
53
  text: "See details",
54
54
  },
55
- render: (args) => (
56
- <div className="w-full max-w-md">
55
+ render: args => (
56
+ <div className="max-w-md w-full">
57
57
  <SeeMore {...args} />
58
58
  </div>
59
59
  ),
@@ -65,8 +65,8 @@ export const Collapsed: Story = {
65
65
  list: ["Item 1", "Item 2", "Item 3"],
66
66
  text: "Show more",
67
67
  },
68
- render: (args) => (
69
- <div className="w-full max-w-md">
68
+ render: args => (
69
+ <div className="max-w-md w-full">
70
70
  <SeeMore {...args} />
71
71
  </div>
72
72
  ),
@@ -84,8 +84,8 @@ export const WithChecklistItems: Story = {
84
84
  ],
85
85
  text: "View all features",
86
86
  },
87
- render: (args) => (
88
- <div className="w-full max-w-md">
87
+ render: args => (
88
+ <div className="max-w-md w-full">
89
89
  <SeeMore {...args} />
90
90
  </div>
91
91
  ),
@@ -97,8 +97,8 @@ export const CustomButtonText: Story = {
97
97
  list: ["Detail 1", "Detail 2", "Detail 3"],
98
98
  text: "Learn more",
99
99
  },
100
- render: (args) => (
101
- <div className="w-full max-w-md">
100
+ render: args => (
101
+ <div className="max-w-md w-full">
102
102
  <SeeMore {...args} />
103
103
  </div>
104
104
  ),
@@ -121,8 +121,8 @@ export const LongList: Story = {
121
121
  ],
122
122
  text: "See all features",
123
123
  },
124
- render: (args) => (
125
- <div className="w-full max-w-md">
124
+ render: args => (
125
+ <div className="max-w-md w-full">
126
126
  <SeeMore {...args} />
127
127
  </div>
128
128
  ),
@@ -134,8 +134,8 @@ export const SingleItem: Story = {
134
134
  list: ["Single checklist item"],
135
135
  text: "See details",
136
136
  },
137
- render: (args) => (
138
- <div className="w-full max-w-md">
137
+ render: args => (
138
+ <div className="max-w-md w-full">
139
139
  <SeeMore {...args} />
140
140
  </div>
141
141
  ),
@@ -144,7 +144,7 @@ export const SingleItem: Story = {
144
144
  // All variants showcase
145
145
  export const AllVariants: Story = {
146
146
  render: () => (
147
- <div className="w-full max-w-2xl space-y-8">
147
+ <div className="max-w-2xl w-full space-y-8">
148
148
  <div>
149
149
  <h3 className="mb-3 text-lg font-semibold">Default</h3>
150
150
  <SeeMore list={["Item 1", "Item 2", "Item 3"]} />
@@ -179,4 +179,3 @@ export const AllVariants: Story = {
179
179
  },
180
180
  },
181
181
  };
182
-
@@ -1,36 +1,40 @@
1
1
  import { useState } from "react";
2
- import { SeeMoreProps } from "@shared/components/see-more/types";
3
- import { MaterialIcon } from "@shared/components/material-icon";
4
- import { Collapse } from "@shared/components/collapse";
5
- import { Checklist } from "@shared/components/checklist";
2
+
6
3
  import { Button } from "@shared/components/button";
4
+ import { Checklist } from "@shared/components/checklist";
5
+ import { Collapse } from "@shared/components/collapse";
6
+ import { MaterialIcon } from "@shared/components/material-icon";
7
+ import { SeeMoreProps } from "@shared/components/see-more/types";
7
8
 
8
- export const SeeMore: React.FC<SeeMoreProps> = (props) => {
9
- const { list, text } = props
10
- const [showDetails, setShowDetails] = useState<boolean>(true);
11
- return (
12
- <div className="mt-3">
13
- <Button
14
- type="button"
15
- className="flex items-center gap-2 text-base font-semibold text-gray-900"
16
- aria-expanded={showDetails}
17
- onClick={(e) => { e.stopPropagation(); setShowDetails(v => !v); }}
18
- >
19
- <span>{text || 'See details'}</span>
20
- <MaterialIcon
21
- name={showDetails ? 'keyboard_arrow_down' : 'keyboard_arrow_up'}
22
- fill={1}
23
- size={24}
24
- />
25
- </Button>
9
+ export const SeeMore: React.FC<SeeMoreProps> = props => {
10
+ const { list, text } = props;
11
+ const [showDetails, setShowDetails] = useState<boolean>(true);
12
+ return (
13
+ <div className="mt-3">
14
+ <Button
15
+ type="button"
16
+ className="flex items-center gap-2 text-base font-semibold text-gray-900"
17
+ aria-expanded={showDetails}
18
+ onClick={e => {
19
+ e.stopPropagation();
20
+ setShowDetails(v => !v);
21
+ }}
22
+ >
23
+ <span>{text || "See details"}</span>
24
+ <MaterialIcon
25
+ name={showDetails ? "keyboard_arrow_down" : "keyboard_arrow_up"}
26
+ fill={1}
27
+ size={24}
28
+ />
29
+ </Button>
26
30
 
27
- <Collapse open={showDetails}>
28
- <div className="pt-1">
29
- <Checklist listItemClassName="body3" items={list} />
30
- </div>
31
- </Collapse>
32
- </div>
33
- );
31
+ <Collapse open={showDetails}>
32
+ <div className="pt-1">
33
+ <Checklist listItemClassName="body3" items={list} />
34
+ </div>
35
+ </Collapse>
36
+ </div>
37
+ );
34
38
  };
35
39
 
36
40
  SeeMore.displayName = "SeeMore";
@@ -1,4 +1,4 @@
1
1
  export type SeeMoreProps = {
2
- list: string[],
3
- text?: string
4
- }
2
+ list: string[];
3
+ text?: string;
4
+ };
@@ -1,6 +1,6 @@
1
1
  import { Select } 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 Select> = {
@@ -221,7 +221,8 @@ export const WithFiltering: Story = {
221
221
  parameters: {
222
222
  docs: {
223
223
  description: {
224
- story: "Select with custom filtering options that ignore case and accents for better search experience.",
224
+ story:
225
+ "Select with custom filtering options that ignore case and accents for better search experience.",
225
226
  },
226
227
  },
227
228
  },
@@ -1,9 +1,8 @@
1
1
  import React, { useMemo } from "react";
2
- import ReactSelect, { createFilter } from "react-select";
3
-
4
2
  import { cx } from "../../utils";
5
3
  import { Text } from "../text";
6
4
  import { FilterOptions, SelectOption, SelectProps } from "./types";
5
+ import ReactSelect, { createFilter } from "react-select";
7
6
 
8
7
  export const Select: React.FC<SelectProps> = React.memo(
9
8
  ({
@@ -57,7 +56,11 @@ export const Select: React.FC<SelectProps> = React.memo(
57
56
  ),
58
57
  indicatorSeparator: () => "hidden",
59
58
  dropdownIndicator: ({ selectProps }: any) =>
60
- isCustomStyle ? (selectProps.value ? "hidden" : "block") : `block text-icon-default ${hasError ? "text-icon-critical":""}`,
59
+ isCustomStyle
60
+ ? selectProps.value
61
+ ? "hidden"
62
+ : "block"
63
+ : `block text-icon-default ${hasError ? "text-icon-critical" : ""}`,
61
64
  singleValue: () =>
62
65
  cx(
63
66
  isCustomStyle
@@ -73,9 +76,7 @@ export const Select: React.FC<SelectProps> = React.memo(
73
76
  : "bg-white text-text-secondary",
74
77
  !isSelected && "hover:bg-bg-surface-hover",
75
78
  !isSelected && isFocused && "bg-bg-surface-hover",
76
- isCustomStyle
77
- ? "text-body1 text-text"
78
- : "",
79
+ isCustomStyle ? "text-body1 text-text" : "",
79
80
  !isCustomStyle || options[options.length - 1]?.label === label
80
81
  ? ""
81
82
  : "border-b border-border-brand"
@@ -107,7 +108,12 @@ export const Select: React.FC<SelectProps> = React.memo(
107
108
  return (
108
109
  <div className="w-full">
109
110
  {label && (
110
- <label className={cx("block text-sm font-medium text-text-secondary mb-1", labelClassName)}>
111
+ <label
112
+ className={cx(
113
+ "mb-1 block text-sm font-medium text-text-secondary",
114
+ labelClassName
115
+ )}
116
+ >
111
117
  {label}
112
118
  </label>
113
119
  )}
@@ -126,19 +132,11 @@ export const Select: React.FC<SelectProps> = React.memo(
126
132
  />
127
133
 
128
134
  {error && (
129
- <Text
130
- className="mt-1 footnote text-text-critical"
131
- >
132
- {error}
133
- </Text>
135
+ <Text className="footnote mt-1 text-text-critical">{error}</Text>
134
136
  )}
135
137
 
136
138
  {!error && helperText && (
137
- <Text
138
- className="mt-1 footnote text-text-info"
139
- >
140
- {helperText}
141
- </Text>
139
+ <Text className="footnote mt-1 text-text-info">{helperText}</Text>
142
140
  )}
143
141
  </div>
144
142
  );
@@ -31,4 +31,5 @@ export type OwnProps = {
31
31
  "data-testid"?: string;
32
32
  };
33
33
 
34
- export type SelectProps = OwnProps & Omit<ReactSelectProps<SelectOption>, "options" | "value" | "className">;
34
+ export type SelectProps = OwnProps &
35
+ Omit<ReactSelectProps<SelectOption>, "options" | "value" | "className">;
@@ -1,6 +1,6 @@
1
1
  import { SelectPlanButton } 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 SelectPlanButton> = {
@@ -51,7 +51,7 @@ export const WithSpeed: Story = {
51
51
  // Different speeds
52
52
  export const DifferentSpeeds: Story = {
53
53
  render: () => (
54
- <div className="w-full max-w-md space-y-3">
54
+ <div className="max-w-md w-full space-y-3">
55
55
  <SelectPlanButton speed="100 Mbps" onSelect={() => {}} />
56
56
  <SelectPlanButton speed="250 Mbps" onSelect={() => {}} />
57
57
  <SelectPlanButton speed="500 Mbps" onSelect={() => {}} />
@@ -74,10 +74,19 @@ export const Interactive: Story = {
74
74
  alert(`Selected plan: ${speed}`);
75
75
  };
76
76
  return (
77
- <div className="w-full max-w-md space-y-3">
78
- <SelectPlanButton speed="100 Mbps" onSelect={() => handleSelect("100 Mbps")} />
79
- <SelectPlanButton speed="500 Mbps" onSelect={() => handleSelect("500 Mbps")} />
80
- <SelectPlanButton speed="1 Gbps" onSelect={() => handleSelect("1 Gbps")} />
77
+ <div className="max-w-md w-full space-y-3">
78
+ <SelectPlanButton
79
+ speed="100 Mbps"
80
+ onSelect={() => handleSelect("100 Mbps")}
81
+ />
82
+ <SelectPlanButton
83
+ speed="500 Mbps"
84
+ onSelect={() => handleSelect("500 Mbps")}
85
+ />
86
+ <SelectPlanButton
87
+ speed="1 Gbps"
88
+ onSelect={() => handleSelect("1 Gbps")}
89
+ />
81
90
  </div>
82
91
  );
83
92
  },
@@ -93,10 +102,10 @@ export const Interactive: Story = {
93
102
  // In plan card
94
103
  export const InPlanCard: Story = {
95
104
  render: () => (
96
- <div className="w-full max-w-sm rounded-lg border border-border-default p-6 space-y-4">
105
+ <div className="max-w-sm border-border-default w-full space-y-4 rounded-lg border p-6">
97
106
  <div>
98
107
  <h3 className="heading3 text-text">Standard Plan</h3>
99
- <p className="body2 text-text-secondary mt-1">Perfect for families</p>
108
+ <p className="body2 mt-1 text-text-secondary">Perfect for families</p>
100
109
  </div>
101
110
  <div>
102
111
  <p className="heading2 text-text">$49.99</p>
@@ -122,7 +131,7 @@ export const InPlanCard: Story = {
122
131
  // All variants showcase
123
132
  export const AllVariants: Story = {
124
133
  render: () => (
125
- <div className="w-full max-w-2xl space-y-6">
134
+ <div className="max-w-2xl w-full space-y-6">
126
135
  <div>
127
136
  <h3 className="mb-3 text-lg font-semibold">Different Speeds</h3>
128
137
  <div className="space-y-3">
@@ -135,12 +144,12 @@ export const AllVariants: Story = {
135
144
  <div>
136
145
  <h3 className="mb-3 text-lg font-semibold">In Context</h3>
137
146
  <div className="grid grid-cols-2 gap-4">
138
- <div className="rounded-lg border border-border-default p-4 space-y-3">
147
+ <div className="border-border-default space-y-3 rounded-lg border p-4">
139
148
  <h4 className="subheading1 text-text">Basic Plan</h4>
140
149
  <p className="body2 text-text-secondary">100 Mbps</p>
141
150
  <SelectPlanButton speed="100 Mbps" onSelect={() => {}} />
142
151
  </div>
143
- <div className="rounded-lg border border-border-default p-4 space-y-3">
152
+ <div className="border-border-default space-y-3 rounded-lg border p-4">
144
153
  <h4 className="subheading1 text-text">Premium Plan</h4>
145
154
  <p className="body2 text-text-secondary">1 Gbps</p>
146
155
  <SelectPlanButton speed="1 Gbps" onSelect={() => {}} />
@@ -157,4 +166,3 @@ export const AllVariants: Story = {
157
166
  },
158
167
  },
159
168
  };
160
-
@@ -1,21 +1,29 @@
1
- import { cx } from "@shared/utils"
2
- import { Button } from "../button"
3
- import { MaterialIcon } from "../material-icon"
4
- import { SelectPlanButtonProps } from "./types"
5
- const className = "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 bg-bg-fill-brand text-text-brand-on-bg-fill enabled:hover:bg-bg-fill-brand-hover focus:ring-bg-fill-brand"
6
- export const SelectPlanButton:React.FC<SelectPlanButtonProps> = ({ onSelect, speed }) => {
7
- return <Button
8
- onClick={onSelect}
9
- className={cx(className,`w-full justify-between pl-5 pr-5`)}
10
- data-track-element-name="speed_plan_select_button"
11
- data-track-click-text={`Select plan speed ${speed}`}
12
- data-track-element-clicked="speed_plan_card"
13
- >
14
- <span>Select plan</span>
15
- <span className="inline-flex h-6 w-6 items-center justify-center rounded-full bg-bg text-icon-brand">
16
- <MaterialIcon name="chevron_right" fill={1} size={24} />
17
- </span>
18
- </Button>
19
- }
1
+ import { Button } from "../button";
2
+ import { MaterialIcon } from "../material-icon";
3
+ import { SelectPlanButtonProps } from "./types";
20
4
 
21
- export type { SelectPlanButtonProps } from "./types";
5
+ import { cx } from "@shared/utils";
6
+
7
+ const className =
8
+ "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 bg-bg-fill-brand text-text-brand-on-bg-fill enabled:hover:bg-bg-fill-brand-hover focus:ring-bg-fill-brand";
9
+ export const SelectPlanButton: React.FC<SelectPlanButtonProps> = ({
10
+ onSelect,
11
+ speed,
12
+ }) => {
13
+ return (
14
+ <Button
15
+ onClick={onSelect}
16
+ className={cx(className, `w-full justify-between pl-5 pr-5`)}
17
+ data-track-element-name="speed_plan_select_button"
18
+ data-track-click-text={`Select plan speed ${speed}`}
19
+ data-track-element-clicked="speed_plan_card"
20
+ >
21
+ <span>Select plan</span>
22
+ <span className="inline-flex h-6 w-6 items-center justify-center rounded-full bg-bg text-icon-brand">
23
+ <MaterialIcon name="chevron_right" fill={1} size={24} />
24
+ </span>
25
+ </Button>
26
+ );
27
+ };
28
+
29
+ export type { SelectPlanButtonProps } from "./types";
@@ -1,4 +1,4 @@
1
1
  export type SelectPlanButtonProps = {
2
2
  onSelect: () => void;
3
3
  speed: string;
4
- };
4
+ };
@@ -1,6 +1,6 @@
1
- import { Skeleton, PageSkeleton } from "./index";
2
- import { DocsPage } from "@shared/stories/DocsTemplate";
1
+ import { PageSkeleton, Skeleton } from "./index";
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 Skeleton> = {
@@ -58,7 +58,7 @@ export const CustomStyling: Story = {
58
58
  // Different counts
59
59
  export const DifferentCounts: Story = {
60
60
  render: () => (
61
- <div className="w-full max-w-md space-y-4">
61
+ <div className="max-w-md w-full space-y-4">
62
62
  <div>
63
63
  <h4 className="mb-2 text-sm font-medium">Single Line</h4>
64
64
  <Skeleton count={1} />
@@ -102,7 +102,7 @@ export const PageSkeletonExample: Story = {
102
102
  // In card
103
103
  export const InCard: Story = {
104
104
  render: () => (
105
- <div className="w-full max-w-sm rounded-lg border border-border-default p-6 space-y-4">
105
+ <div className="max-w-sm border-border-default w-full space-y-4 rounded-lg border p-6">
106
106
  <Skeleton count={1} className="h-6 w-3/4" />
107
107
  <Skeleton count={2} />
108
108
  <Skeleton count={1} className="h-10 w-full" />
@@ -120,8 +120,8 @@ export const InCard: Story = {
120
120
  // List skeleton
121
121
  export const ListSkeleton: Story = {
122
122
  render: () => (
123
- <div className="w-full max-w-md space-y-3">
124
- {[1, 2, 3, 4, 5].map((i) => (
123
+ <div className="max-w-md w-full space-y-3">
124
+ {[1, 2, 3, 4, 5].map(i => (
125
125
  <div key={i} className="flex items-center gap-3">
126
126
  <Skeleton count={1} className="h-12 w-12 rounded-full" />
127
127
  <div className="flex-1 space-y-2">
@@ -144,7 +144,7 @@ export const ListSkeleton: Story = {
144
144
  // All variants showcase
145
145
  export const AllVariants: Story = {
146
146
  render: () => (
147
- <div className="w-full max-w-2xl space-y-8">
147
+ <div className="max-w-2xl w-full space-y-8">
148
148
  <div>
149
149
  <h3 className="mb-3 text-lg font-semibold">Basic Skeleton</h3>
150
150
  <Skeleton count={3} />
@@ -155,7 +155,7 @@ export const AllVariants: Story = {
155
155
  </div>
156
156
  <div>
157
157
  <h3 className="mb-3 text-lg font-semibold">In Card</h3>
158
- <div className="rounded-lg border border-border-default p-6 space-y-4">
158
+ <div className="border-border-default space-y-4 rounded-lg border p-6">
159
159
  <Skeleton count={1} className="h-6 w-3/4" />
160
160
  <Skeleton count={2} />
161
161
  <Skeleton count={1} className="h-10 w-full" />
@@ -163,7 +163,7 @@ export const AllVariants: Story = {
163
163
  </div>
164
164
  <div>
165
165
  <h3 className="mb-3 text-lg font-semibold">Page Skeleton</h3>
166
- <div className="border border-border-default rounded p-4">
166
+ <div className="border-border-default rounded border p-4">
167
167
  <PageSkeleton />
168
168
  </div>
169
169
  </div>
@@ -177,4 +177,3 @@ export const AllVariants: Story = {
177
177
  },
178
178
  },
179
179
  };
180
-