@windstream/react-shared-components 0.0.1

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 (112) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +360 -0
  3. package/dist/core.d.ts +389 -0
  4. package/dist/index.d.ts +389 -0
  5. package/dist/index.esm.js +35 -0
  6. package/dist/index.esm.js.map +1 -0
  7. package/dist/index.js +35 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/styles.css +3 -0
  10. package/dist/utils/index.d.ts +11 -0
  11. package/dist/utils/index.esm.js +2 -0
  12. package/dist/utils/index.esm.js.map +1 -0
  13. package/dist/utils/index.js +2 -0
  14. package/dist/utils/index.js.map +1 -0
  15. package/package.json +151 -0
  16. package/src/components/accordion/Accordion.stories.tsx +225 -0
  17. package/src/components/accordion/index.tsx +36 -0
  18. package/src/components/accordion/types.ts +10 -0
  19. package/src/components/alert-card/AlertCard.stories.tsx +172 -0
  20. package/src/components/alert-card/index.tsx +35 -0
  21. package/src/components/alert-card/types.ts +9 -0
  22. package/src/components/brand-button/BrandButton.stories.tsx +221 -0
  23. package/src/components/brand-button/helpers.ts +35 -0
  24. package/src/components/brand-button/index.tsx +90 -0
  25. package/src/components/brand-button/types.ts +27 -0
  26. package/src/components/button/Button.stories.tsx +108 -0
  27. package/src/components/button/index.tsx +23 -0
  28. package/src/components/button/types.ts +14 -0
  29. package/src/components/call-button/CallButton.stories.tsx +324 -0
  30. package/src/components/call-button/index.tsx +80 -0
  31. package/src/components/call-button/types.ts +9 -0
  32. package/src/components/checkbox/Checkbox.stories.tsx +248 -0
  33. package/src/components/checkbox/index.tsx +185 -0
  34. package/src/components/checkbox/types.ts +24 -0
  35. package/src/components/checklist/Checklist.stories.tsx +151 -0
  36. package/src/components/checklist/index.tsx +33 -0
  37. package/src/components/checklist/types.ts +6 -0
  38. package/src/components/collapse/Collapse.stories.tsx +256 -0
  39. package/src/components/collapse/index.tsx +44 -0
  40. package/src/components/collapse/types.ts +6 -0
  41. package/src/components/divider/Divider.stories.tsx +206 -0
  42. package/src/components/divider/index.tsx +23 -0
  43. package/src/components/divider/type.ts +3 -0
  44. package/src/components/input/Input.stories.tsx +358 -0
  45. package/src/components/input/index.tsx +174 -0
  46. package/src/components/input/types.ts +37 -0
  47. package/src/components/link/Link.stories.tsx +163 -0
  48. package/src/components/link/index.tsx +96 -0
  49. package/src/components/link/types.ts +25 -0
  50. package/src/components/list/List.stories.tsx +272 -0
  51. package/src/components/list/index.tsx +86 -0
  52. package/src/components/list/list-item/index.tsx +36 -0
  53. package/src/components/list/list-item/types.ts +13 -0
  54. package/src/components/list/types.ts +29 -0
  55. package/src/components/material-icon/MaterialIcon.stories.tsx +330 -0
  56. package/src/components/material-icon/constants.ts +95 -0
  57. package/src/components/material-icon/index.tsx +44 -0
  58. package/src/components/material-icon/types.ts +31 -0
  59. package/src/components/modal/Modal.stories.tsx +171 -0
  60. package/src/components/modal/index.tsx +168 -0
  61. package/src/components/modal/types.ts +24 -0
  62. package/src/components/radio-button/RadioButton.stories.tsx +307 -0
  63. package/src/components/radio-button/index.tsx +73 -0
  64. package/src/components/radio-button/types.ts +22 -0
  65. package/src/components/see-more/SeeMore.stories.tsx +182 -0
  66. package/src/components/see-more/index.tsx +38 -0
  67. package/src/components/see-more/types.ts +4 -0
  68. package/src/components/select/Select.stories.tsx +410 -0
  69. package/src/components/select/index.tsx +150 -0
  70. package/src/components/select/types.ts +34 -0
  71. package/src/components/select-plan-button/SelectPlanButton.stories.tsx +160 -0
  72. package/src/components/select-plan-button/index.tsx +21 -0
  73. package/src/components/select-plan-button/types.ts +4 -0
  74. package/src/components/skeleton/Skeleton.stories.tsx +180 -0
  75. package/src/components/skeleton/index.tsx +61 -0
  76. package/src/components/skeleton/types.ts +4 -0
  77. package/src/components/spinner/Spinner.stories.tsx +335 -0
  78. package/src/components/spinner/index.tsx +44 -0
  79. package/src/components/spinner/types.ts +5 -0
  80. package/src/components/text/Text.stories.tsx +302 -0
  81. package/src/components/text/index.tsx +26 -0
  82. package/src/components/text/types.ts +45 -0
  83. package/src/components/tooltip/Tooltip.stories.tsx +220 -0
  84. package/src/components/tooltip/index.tsx +78 -0
  85. package/src/components/tooltip/types.ts +7 -0
  86. package/src/components/view-cart-button/ViewCartButton.stories.tsx +241 -0
  87. package/src/components/view-cart-button/index.tsx +39 -0
  88. package/src/components/view-cart-button/types.ts +5 -0
  89. package/src/hooks/use-body-scroll-lock.ts +31 -0
  90. package/src/index.ts +81 -0
  91. package/src/setupTests.ts +46 -0
  92. package/src/stories/DocsTemplate.tsx +26 -0
  93. package/src/stories/assets/accessibility.png +0 -0
  94. package/src/stories/assets/accessibility.svg +1 -0
  95. package/src/stories/assets/addon-library.png +0 -0
  96. package/src/stories/assets/assets.png +0 -0
  97. package/src/stories/assets/avif-test-image.avif +0 -0
  98. package/src/stories/assets/context.png +0 -0
  99. package/src/stories/assets/discord.svg +1 -0
  100. package/src/stories/assets/docs.png +0 -0
  101. package/src/stories/assets/figma-plugin.png +0 -0
  102. package/src/stories/assets/github.svg +1 -0
  103. package/src/stories/assets/share.png +0 -0
  104. package/src/stories/assets/styling.png +0 -0
  105. package/src/stories/assets/testing.png +0 -0
  106. package/src/stories/assets/theming.png +0 -0
  107. package/src/stories/assets/tutorials.svg +1 -0
  108. package/src/stories/assets/youtube.svg +1 -0
  109. package/src/styles/globals.css +50 -0
  110. package/src/types/global.d.ts +9 -0
  111. package/src/utils/index.ts +49 -0
  112. package/tailwind.config.cjs +524 -0
@@ -0,0 +1,335 @@
1
+ import { Spinner } from "./index";
2
+ import { DocsPage } from "@shared/stories/DocsTemplate";
3
+
4
+ import type { Meta, StoryObj } from "@storybook/react";
5
+
6
+ const meta: Meta<typeof Spinner> = {
7
+ title: "Components/Spinner",
8
+ component: Spinner,
9
+ tags: ["autodocs"],
10
+ parameters: {
11
+ layout: "centered",
12
+ docs: {
13
+ page: DocsPage,
14
+ description: {
15
+ component:
16
+ "A loading spinner component with customizable size, color, and animation.",
17
+ },
18
+ },
19
+ },
20
+ argTypes: {
21
+ size: {
22
+ control: { type: "select" },
23
+ options: ["small", "medium", "large", "xlarge"],
24
+ description: "Spinner size",
25
+ },
26
+ color: {
27
+ control: { type: "color" },
28
+ description: "Spinner color",
29
+ },
30
+ className: {
31
+ control: { type: "text" },
32
+ description: "Additional CSS classes",
33
+ },
34
+ },
35
+ args: {
36
+ size: "medium",
37
+ },
38
+ };
39
+
40
+ export default meta;
41
+ type Story = StoryObj<typeof meta>;
42
+
43
+ // Default spinner
44
+ export const Default: Story = {
45
+ args: {},
46
+ };
47
+
48
+ // Different sizes
49
+ export const Sizes: Story = {
50
+ render: () => (
51
+ <div className="flex items-center gap-8">
52
+ <div className="text-center">
53
+ <Spinner size="small" />
54
+ <p className="mt-2 text-xs">Small</p>
55
+ </div>
56
+ <div className="text-center">
57
+ <Spinner size="medium" />
58
+ <p className="mt-2 text-xs">Medium</p>
59
+ </div>
60
+ <div className="text-center">
61
+ <Spinner size="large" />
62
+ <p className="mt-2 text-xs">Large</p>
63
+ </div>
64
+ <div className="text-center">
65
+ <Spinner size="xlarge" />
66
+ <p className="mt-2 text-xs">XLarge</p>
67
+ </div>
68
+ </div>
69
+ ),
70
+ parameters: {
71
+ docs: {
72
+ description: {
73
+ story: "All available spinner sizes.",
74
+ },
75
+ },
76
+ },
77
+ };
78
+
79
+ // Colored spinners
80
+ export const ColoredSpinners: Story = {
81
+ render: () => (
82
+ <div className="grid grid-cols-4 gap-6">
83
+ <div className="text-center">
84
+ <Spinner size="large" color="#3b82f6" />
85
+ <p className="mt-2 text-sm text-blue-600">Blue</p>
86
+ </div>
87
+ <div className="text-center">
88
+ <Spinner size="large" color="#10b981" />
89
+ <p className="mt-2 text-sm text-green-600">Green</p>
90
+ </div>
91
+ <div className="text-center">
92
+ <Spinner size="large" color="#ef4444" />
93
+ <p className="mt-2 text-sm text-red-600">Red</p>
94
+ </div>
95
+ <div className="text-center">
96
+ <Spinner size="large" color="#f59e0b" />
97
+ <p className="mt-2 text-sm text-yellow-600">Yellow</p>
98
+ </div>
99
+ </div>
100
+ ),
101
+ parameters: {
102
+ docs: {
103
+ description: {
104
+ story: "Spinners with different colors.",
105
+ },
106
+ },
107
+ },
108
+ };
109
+
110
+ // Spinner with text
111
+ export const SpinnerWithText: Story = {
112
+ render: () => (
113
+ <div className="space-y-6">
114
+ <div className="flex items-center gap-3">
115
+ <Spinner size="small" />
116
+ <span className="text-sm text-gray-600">Loading...</span>
117
+ </div>
118
+ <div className="flex items-center gap-3">
119
+ <Spinner size="medium" />
120
+ <span className="text-sm text-gray-600">Processing request...</span>
121
+ </div>
122
+ <div className="flex items-center gap-3">
123
+ <Spinner size="large" />
124
+ <span className="text-sm text-gray-600">Saving changes...</span>
125
+ </div>
126
+ </div>
127
+ ),
128
+ parameters: {
129
+ docs: {
130
+ description: {
131
+ story: "Spinners used alongside loading text.",
132
+ },
133
+ },
134
+ },
135
+ };
136
+
137
+ // Button with spinner
138
+ export const ButtonWithSpinner: Story = {
139
+ render: () => (
140
+ <div className="space-y-4">
141
+ <button className="flex items-center gap-2 rounded bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 disabled:opacity-50">
142
+ <Spinner size="small" color="white" />
143
+ <span>Loading...</span>
144
+ </button>
145
+
146
+ <button className="flex items-center gap-2 rounded bg-gray-600 px-4 py-2 text-white hover:bg-gray-700 disabled:opacity-50">
147
+ <Spinner size="small" color="white" />
148
+ <span>Processing...</span>
149
+ </button>
150
+
151
+ <button className="flex items-center gap-2 rounded bg-green-600 px-4 py-2 text-white hover:bg-green-700 disabled:opacity-50">
152
+ <Spinner size="small" color="white" />
153
+ <span>Saving...</span>
154
+ </button>
155
+ </div>
156
+ ),
157
+ parameters: {
158
+ docs: {
159
+ description: {
160
+ story: "Spinners integrated into buttons for loading states.",
161
+ },
162
+ },
163
+ },
164
+ };
165
+
166
+ // Card with spinner
167
+ export const CardWithSpinner: Story = {
168
+ render: () => (
169
+ <div className="grid grid-cols-2 gap-6">
170
+ <div className="rounded-lg border p-6">
171
+ <div className="flex h-32 items-center justify-center">
172
+ <div className="text-center">
173
+ <Spinner size="large" />
174
+ <p className="mt-3 text-sm text-gray-600">Loading content...</p>
175
+ </div>
176
+ </div>
177
+ </div>
178
+
179
+ <div className="rounded-lg border p-6">
180
+ <div className="flex h-32 items-center justify-center">
181
+ <div className="text-center">
182
+ <Spinner size="large" color="#10b981" />
183
+ <p className="mt-3 text-sm text-gray-600">Processing data...</p>
184
+ </div>
185
+ </div>
186
+ </div>
187
+ </div>
188
+ ),
189
+ parameters: {
190
+ docs: {
191
+ description: {
192
+ story: "Spinners in card layouts for content loading states.",
193
+ },
194
+ },
195
+ },
196
+ };
197
+
198
+ // Inline spinner
199
+ export const InlineSpinner: Story = {
200
+ render: () => (
201
+ <div className="space-y-4">
202
+ <p className="text-gray-700">
203
+ This is some text with an inline{" "}
204
+ <Spinner size="small" className="mx-1 inline" /> spinner.
205
+ </p>
206
+
207
+ <p className="text-gray-700">
208
+ Another example with a{" "}
209
+ <Spinner size="small" color="#ef4444" className="mx-1 inline" /> colored
210
+ spinner.
211
+ </p>
212
+
213
+ <div className="flex items-center gap-2">
214
+ <span>Status:</span>
215
+ <Spinner size="small" />
216
+ <span className="text-sm text-gray-500">Checking...</span>
217
+ </div>
218
+ </div>
219
+ ),
220
+ parameters: {
221
+ docs: {
222
+ description: {
223
+ story: "Inline spinners within text content.",
224
+ },
225
+ },
226
+ },
227
+ };
228
+
229
+ // Loading states
230
+ export const LoadingStates: Story = {
231
+ render: () => (
232
+ <div className="space-y-6">
233
+ <div className="rounded-lg border p-4">
234
+ <h3 className="mb-2 font-medium">Initial Loading</h3>
235
+ <div className="flex items-center gap-3">
236
+ <Spinner size="medium" />
237
+ <span className="text-sm text-gray-600">Loading application...</span>
238
+ </div>
239
+ </div>
240
+
241
+ <div className="rounded-lg border p-4">
242
+ <h3 className="mb-2 font-medium">Data Fetching</h3>
243
+ <div className="flex items-center gap-3">
244
+ <Spinner size="medium" color="#3b82f6" />
245
+ <span className="text-sm text-gray-600">Fetching user data...</span>
246
+ </div>
247
+ </div>
248
+
249
+ <div className="rounded-lg border p-4">
250
+ <h3 className="mb-2 font-medium">Form Submission</h3>
251
+ <div className="flex items-center gap-3">
252
+ <Spinner size="medium" color="#10b981" />
253
+ <span className="text-sm text-gray-600">Submitting form...</span>
254
+ </div>
255
+ </div>
256
+
257
+ <div className="rounded-lg border p-4">
258
+ <h3 className="mb-2 font-medium">File Upload</h3>
259
+ <div className="flex items-center gap-3">
260
+ <Spinner size="medium" color="#f59e0b" />
261
+ <span className="text-sm text-gray-600">Uploading file...</span>
262
+ </div>
263
+ </div>
264
+ </div>
265
+ ),
266
+ parameters: {
267
+ docs: {
268
+ description: {
269
+ story: "Different loading states with appropriate messaging.",
270
+ },
271
+ },
272
+ },
273
+ };
274
+
275
+ // All variants showcase
276
+ export const AllVariants: Story = {
277
+ render: () => (
278
+ <div className="space-y-8">
279
+ <div>
280
+ <h3 className="mb-4 text-lg font-semibold">Spinner Sizes</h3>
281
+ <div className="flex items-center gap-8">
282
+ <div className="text-center">
283
+ <Spinner size="small" />
284
+ <p className="mt-2 text-xs">Small</p>
285
+ </div>
286
+ <div className="text-center">
287
+ <Spinner size="medium" />
288
+ <p className="mt-2 text-xs">Medium</p>
289
+ </div>
290
+ <div className="text-center">
291
+ <Spinner size="large" />
292
+ <p className="mt-2 text-xs">Large</p>
293
+ </div>
294
+ <div className="text-center">
295
+ <Spinner size="xlarge" />
296
+ <p className="mt-2 text-xs">XLarge</p>
297
+ </div>
298
+ </div>
299
+ </div>
300
+
301
+ <div>
302
+ <h3 className="mb-4 text-lg font-semibold">Color Variants</h3>
303
+ <div className="grid grid-cols-5 gap-4">
304
+ <div className="text-center">
305
+ <Spinner size="large" color="#3b82f6" />
306
+ <p className="mt-2 text-xs text-blue-600">Blue</p>
307
+ </div>
308
+ <div className="text-center">
309
+ <Spinner size="large" color="#10b981" />
310
+ <p className="mt-2 text-xs text-green-600">Green</p>
311
+ </div>
312
+ <div className="text-center">
313
+ <Spinner size="large" color="#ef4444" />
314
+ <p className="mt-2 text-xs text-red-600">Red</p>
315
+ </div>
316
+ <div className="text-center">
317
+ <Spinner size="large" color="#f59e0b" />
318
+ <p className="mt-2 text-xs text-yellow-600">Yellow</p>
319
+ </div>
320
+ <div className="text-center">
321
+ <Spinner size="large" color="#8b5cf6" />
322
+ <p className="mt-2 text-xs text-purple-600">Purple</p>
323
+ </div>
324
+ </div>
325
+ </div>
326
+ </div>
327
+ ),
328
+ parameters: {
329
+ docs: {
330
+ description: {
331
+ story: "Complete showcase of all spinner sizes and colors.",
332
+ },
333
+ },
334
+ },
335
+ };
@@ -0,0 +1,44 @@
1
+ import React from "react";
2
+ import { cx } from "../../utils";
3
+ import { SpinnerProps } from "./types";
4
+
5
+ export const Spinner: React.FunctionComponent<SpinnerProps> = props => {
6
+ const { color = "#fff", size = "medium" } = props;
7
+
8
+ const sizeClasses = {
9
+ small: "w-4 h-4",
10
+ medium: "w-6 h-6",
11
+ large: "w-8 h-8",
12
+ xlarge: "w-12 h-12",
13
+ };
14
+
15
+ return (
16
+ <div role="status" className={"relative flex flex-row items-center"}>
17
+ <svg
18
+ aria-hidden="true"
19
+ className={cx(
20
+ "mr-2 h-5 w-5 text-transparent animate-spin",
21
+ sizeClasses[size],
22
+ props.className
23
+ )}
24
+ style={{ animation: "spin 0.75s linear infinite" }}
25
+ viewBox="0 0 100 100"
26
+ fill={color}
27
+ >
28
+ <path
29
+ d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
30
+ fill="currentColor"
31
+ />
32
+ <path
33
+ d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
34
+ fill="currentFill"
35
+ />
36
+ </svg>
37
+ <span className="sr-only">Loading...</span>
38
+ </div>
39
+ );
40
+ };
41
+
42
+ Spinner.displayName = "Spinner";
43
+
44
+ export type { SpinnerProps };
@@ -0,0 +1,5 @@
1
+ export type SpinnerProps = {
2
+ size?: "small" | "medium" | "large" | "xlarge";
3
+ color?: string;
4
+ className?: string;
5
+ } & React.HTMLAttributes<HTMLDivElement>;
@@ -0,0 +1,302 @@
1
+ import { Text } from "./index";
2
+ import { DocsPage } from "@shared/stories/DocsTemplate";
3
+
4
+ import type { Meta, StoryObj } from "@storybook/react";
5
+
6
+ const meta: Meta<typeof Text> = {
7
+ title: "Components/Text",
8
+ component: Text,
9
+ tags: ["autodocs"],
10
+ parameters: {
11
+ layout: "centered",
12
+ docs: {
13
+ page: DocsPage,
14
+ description: {
15
+ component:
16
+ "A flexible text component with multiple typography variants and semantic elements.",
17
+ },
18
+ },
19
+ },
20
+ argTypes: {
21
+ as: {
22
+ control: { type: "select" },
23
+ options: [
24
+ "h1",
25
+ "h2",
26
+ "h3",
27
+ "h4",
28
+ "h5",
29
+ "h6",
30
+ "p",
31
+ "span",
32
+ "div",
33
+ "label",
34
+ ],
35
+ description: "HTML element to render",
36
+ },
37
+ className: {
38
+ control: { type: "text" },
39
+ description: "Additional CSS classes (use typography classes like body1, heading1, etc.)",
40
+ },
41
+ children: {
42
+ control: { type: "text" },
43
+ description: "Text content",
44
+ },
45
+ },
46
+ args: {
47
+ children: "Sample text content",
48
+ className: "body1",
49
+ as: "p",
50
+ },
51
+ };
52
+
53
+ export default meta;
54
+ type Story = StoryObj<typeof meta>;
55
+
56
+ // Default text
57
+ export const Default: Story = {
58
+ args: {},
59
+ };
60
+
61
+ // Headings
62
+ export const Headings: Story = {
63
+ render: () => (
64
+ <div className="space-y-4">
65
+ <Text as="h1" className="heading1">
66
+ Heading 1
67
+ </Text>
68
+ <Text as="h2" className="heading2">
69
+ Heading 2
70
+ </Text>
71
+ <Text as="h3" className="heading3">
72
+ Heading 3
73
+ </Text>
74
+ <Text as="h4" className="heading4">
75
+ Heading 4
76
+ </Text>
77
+ <Text as="h5" className="heading5">
78
+ Heading 5
79
+ </Text>
80
+ <Text as="h6" className="heading6">
81
+ Heading 6
82
+ </Text>
83
+ </div>
84
+ ),
85
+ parameters: {
86
+ docs: {
87
+ description: {
88
+ story: "All heading variants with appropriate semantic HTML elements.",
89
+ },
90
+ },
91
+ },
92
+ };
93
+
94
+ // Subheadings
95
+ export const Subheadings: Story = {
96
+ render: () => (
97
+ <div className="space-y-4">
98
+ <Text className="subheading1">Subheading 1</Text>
99
+ <Text className="subheading2">Subheading 2</Text>
100
+ <Text className="subheading3">Subheading 3</Text>
101
+ </div>
102
+ ),
103
+ parameters: {
104
+ docs: {
105
+ description: {
106
+ story: "All subheading variants.",
107
+ },
108
+ },
109
+ },
110
+ };
111
+
112
+ // Body text
113
+ export const BodyText: Story = {
114
+ render: () => (
115
+ <div className="space-y-4">
116
+ <Text className="body1">
117
+ Body 1 text is used for the main content of your application. It
118
+ provides good readability and is suitable for paragraphs and longer text
119
+ content.
120
+ </Text>
121
+ <Text className="body2">
122
+ Body 2 text is slightly smaller and can be used for secondary content,
123
+ descriptions, or supporting text that doesn't need as much emphasis.
124
+ </Text>
125
+ <Text className="body3">
126
+ Body 3 text is the smallest body variant, perfect for fine print,
127
+ captions, or less important information.
128
+ </Text>
129
+ </div>
130
+ ),
131
+ parameters: {
132
+ docs: {
133
+ description: {
134
+ story: "Body text variants for different content hierarchy levels.",
135
+ },
136
+ },
137
+ },
138
+ };
139
+
140
+ // Labels
141
+ export const Labels: Story = {
142
+ render: () => (
143
+ <div className="space-y-4">
144
+ <div>
145
+ <Text as="label" className="mb-2 block body1">
146
+ Label 1
147
+ </Text>
148
+ <input
149
+ type="text"
150
+ className="rounded border px-3 py-2"
151
+ placeholder="Input with label"
152
+ />
153
+ </div>
154
+ <div>
155
+ <Text as="label" className="mb-2 block body2">
156
+ Label 2
157
+ </Text>
158
+ <input
159
+ type="text"
160
+ className="rounded border px-3 py-2"
161
+ placeholder="Input with label"
162
+ />
163
+ </div>
164
+ <div>
165
+ <Text as="label" className="mb-2 block body3">
166
+ Label 3
167
+ </Text>
168
+ <input
169
+ type="text"
170
+ className="rounded border px-3 py-2"
171
+ placeholder="Input with label"
172
+ />
173
+ </div>
174
+ <div>
175
+ <Text as="label" className="mb-2 block footnote">
176
+ Label 4
177
+ </Text>
178
+ <input
179
+ type="text"
180
+ className="rounded border px-3 py-2"
181
+ placeholder="Input with label"
182
+ />
183
+ </div>
184
+ </div>
185
+ ),
186
+ parameters: {
187
+ docs: {
188
+ description: {
189
+ story: "Label variants commonly used with form inputs.",
190
+ },
191
+ },
192
+ },
193
+ };
194
+
195
+ // Utility text
196
+ export const UtilityText: Story = {
197
+ render: () => (
198
+ <div className="space-y-4">
199
+ <Text className="footnote">
200
+ Footnote text is used for additional information, citations, or less
201
+ important details.
202
+ </Text>
203
+ <Text className="micro">
204
+ Micro text is the smallest text variant, perfect for timestamps, version
205
+ numbers, or other very small information.
206
+ </Text>
207
+ <Text className="unstyled">
208
+ Unstyled text inherits all styling from its parent element.
209
+ </Text>
210
+ </div>
211
+ ),
212
+ parameters: {
213
+ docs: {
214
+ description: {
215
+ story: "Utility text variants for specific use cases.",
216
+ },
217
+ },
218
+ },
219
+ };
220
+
221
+ // Semantic elements
222
+ export const SemanticElements: Story = {
223
+ render: () => (
224
+ <div className="space-y-4">
225
+ <Text as="h1" className="heading1">
226
+ Main Page Title
227
+ </Text>
228
+ <Text as="h2" className="heading2">
229
+ Page Description
230
+ </Text>
231
+ <Text as="p" className="body1">
232
+ This is a paragraph element that provides the main content of the page.
233
+ It demonstrates how the Text component can be used with semantic HTML
234
+ elements.
235
+ </Text>
236
+ <Text as="label" className="block body1">
237
+ Form Label
238
+ </Text>
239
+ <Text as="span" className="footnote">
240
+ Additional information
241
+ </Text>
242
+ </div>
243
+ ),
244
+ parameters: {
245
+ docs: {
246
+ description: {
247
+ story:
248
+ "Examples of using different semantic HTML elements with the Text component.",
249
+ },
250
+ },
251
+ },
252
+ };
253
+
254
+ // All variants showcase
255
+ export const AllVariants: Story = {
256
+ render: () => (
257
+ <div className="max-w-4xl space-y-6">
258
+ <div>
259
+ <h3 className="mb-3 text-lg font-semibold">Headings</h3>
260
+ <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>
264
+ </div>
265
+ </div>
266
+
267
+ <div>
268
+ <h3 className="mb-3 text-lg font-semibold">Body Text</h3>
269
+ <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>
273
+ </div>
274
+ </div>
275
+
276
+ <div>
277
+ <h3 className="mb-3 text-lg font-semibold">Labels</h3>
278
+ <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>
282
+ <Text className="footnote">Label 4</Text>
283
+ </div>
284
+ </div>
285
+
286
+ <div>
287
+ <h3 className="mb-3 text-lg font-semibold">Utility</h3>
288
+ <div className="space-y-2">
289
+ <Text className="footnote">Footnote text</Text>
290
+ <Text className="micro">Micro text</Text>
291
+ </div>
292
+ </div>
293
+ </div>
294
+ ),
295
+ parameters: {
296
+ docs: {
297
+ description: {
298
+ story: "Complete showcase of all text variants in organized sections.",
299
+ },
300
+ },
301
+ },
302
+ };