@a2v2ai/uikit 0.0.36 → 0.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Alert/Alert.stories.tsx +121 -0
- package/Alert/Alert.tsx +71 -0
- package/AlertDialog/AlertDialog.stories.tsx +665 -0
- package/AlertDialog/AlertDialog.tsx +241 -0
- package/Avatar/Avatar.stories.tsx +128 -0
- package/Avatar/Avatar.tsx +71 -0
- package/Badge/Badge.stories.tsx +76 -0
- package/Badge/Badge.tsx +39 -0
- package/Breadcrumb/Breadcrumb.stories.tsx +231 -0
- package/Breadcrumb/Breadcrumb.tsx +114 -0
- package/Button/Button.stories.tsx +684 -0
- package/Button/Button.tsx +107 -0
- package/Calendar/Calendar.stories.tsx +291 -0
- package/Calendar/Calendar.tsx +246 -0
- package/Card/Card.stories.tsx +136 -0
- package/Card/Card.tsx +96 -0
- package/Carousel/Carousel.stories.tsx +256 -0
- package/Carousel/Carousel.tsx +301 -0
- package/ChatBubble/ChatBubble.stories.tsx +339 -0
- package/ChatBubble/ChatBubble.tsx +179 -0
- package/Checkbox/Checkbox.stories.tsx +137 -0
- package/Checkbox/Checkbox.tsx +53 -0
- package/DataTable/DataTable.stories.tsx +400 -0
- package/DataTable/DataTable.tsx +207 -0
- package/Drawer/Drawer.stories.tsx +721 -0
- package/Drawer/Drawer.tsx +201 -0
- package/DropdownMenu/DropdownMenu.stories.tsx +251 -0
- package/DropdownMenu/DropdownMenu.tsx +199 -0
- package/ErrorMessage/ErrorMessage.stories.tsx +159 -0
- package/ErrorMessage/ErrorMessage.tsx +55 -0
- package/Flex/Flex.stories.tsx +390 -0
- package/Flex/Flex.tsx +102 -0
- package/IconButton/IconButton.stories.tsx +566 -0
- package/IconButton/IconButton.tsx +95 -0
- package/Input/Input.stories.tsx +566 -0
- package/Input/Input.tsx +168 -0
- package/InputOTP/InputOTP.stories.tsx +246 -0
- package/InputOTP/InputOTP.tsx +127 -0
- package/Label/Label.stories.tsx +110 -0
- package/Label/Label.tsx +44 -0
- package/Loader/Loader.stories.tsx +170 -0
- package/Loader/Loader.tsx +62 -0
- package/Menubar/Menubar.stories.tsx +382 -0
- package/Menubar/Menubar.tsx +274 -0
- package/Menubar/index.ts +18 -0
- package/Pagination/Pagination.stories.tsx +196 -0
- package/Pagination/Pagination.tsx +122 -0
- package/Popover/Popover.stories.tsx +133 -0
- package/Popover/Popover.tsx +31 -0
- package/Progress/Progress.stories.tsx +146 -0
- package/Progress/Progress.tsx +67 -0
- package/RadioGroup/RadioGroup.stories.tsx +159 -0
- package/RadioGroup/RadioGroup.tsx +68 -0
- package/ScrollArea/ScrollArea.stories.tsx +136 -0
- package/ScrollArea/ScrollArea.tsx +46 -0
- package/Select/Select.stories.tsx +378 -0
- package/Select/Select.tsx +230 -0
- package/Separator/Separator.stories.tsx +110 -0
- package/Separator/Separator.tsx +29 -0
- package/Sidebar/Sidebar.stories.tsx +340 -0
- package/Sidebar/Sidebar.tsx +414 -0
- package/Sidebar/index.ts +28 -0
- package/Skeleton/Skeleton.stories.tsx +117 -0
- package/Skeleton/Skeleton.tsx +16 -0
- package/Slider/Slider.stories.tsx +216 -0
- package/Slider/Slider.tsx +29 -0
- package/Spinner/Spinner.stories.tsx +210 -0
- package/Spinner/Spinner.tsx +78 -0
- package/Switch/Switch.stories.tsx +146 -0
- package/Switch/Switch.tsx +59 -0
- package/Table/Table.stories.tsx +510 -0
- package/Table/Table.tsx +114 -0
- package/Tabs/Tabs.stories.tsx +197 -0
- package/Tabs/Tabs.tsx +74 -0
- package/Textarea/Textarea.stories.tsx +187 -0
- package/Textarea/Textarea.tsx +73 -0
- package/Toast/Toast.stories.tsx +285 -0
- package/Toast/Toast.tsx +59 -0
- package/Tooltip/Tooltip.stories.tsx +463 -0
- package/Tooltip/Tooltip.tsx +96 -0
- package/Typography/Typography.stories.tsx +425 -0
- package/Typography/Typography.tsx +106 -0
- package/helpers.ts +5 -0
- package/{icons.js → icons.ts} +1 -1
- package/index.ts +217 -0
- package/lib/typography-types.ts +223 -0
- package/lib/utils.ts +15 -0
- package/package.json +36 -33
- package/tsconfig.json +22 -0
- package/Alert/Alert.d.ts +0 -13
- package/Alert/Alert.js +0 -25
- package/AlertDialog/AlertDialog.d.ts +0 -43
- package/AlertDialog/AlertDialog.js +0 -71
- package/Avatar/Avatar.d.ts +0 -14
- package/Avatar/Avatar.js +0 -25
- package/Badge/Badge.d.ts +0 -11
- package/Badge/Badge.js +0 -23
- package/Breadcrumb/Breadcrumb.d.ts +0 -19
- package/Breadcrumb/Breadcrumb.js +0 -23
- package/Button/Button.d.ts +0 -23
- package/Button/Button.js +0 -52
- package/Calendar/Calendar.d.ts +0 -20
- package/Calendar/Calendar.js +0 -78
- package/Card/Card.d.ts +0 -16
- package/Card/Card.js +0 -28
- package/Carousel/Carousel.d.ts +0 -37
- package/Carousel/Carousel.js +0 -132
- package/ChatBubble/ChatBubble.d.ts +0 -33
- package/ChatBubble/ChatBubble.js +0 -107
- package/Checkbox/Checkbox.d.ts +0 -12
- package/Checkbox/Checkbox.js +0 -20
- package/DataTable/DataTable.d.ts +0 -35
- package/DataTable/DataTable.js +0 -51
- package/Dialog/Dialog.d.ts +0 -35
- package/Dialog/Dialog.js +0 -130
- package/Drawer/Drawer.d.ts +0 -33
- package/Drawer/Drawer.js +0 -55
- package/DropdownMenu/DropdownMenu.d.ts +0 -27
- package/DropdownMenu/DropdownMenu.js +0 -35
- package/ErrorMessage/ErrorMessage.d.ts +0 -27
- package/ErrorMessage/ErrorMessage.js +0 -14
- package/Flex/Flex.d.ts +0 -31
- package/Flex/Flex.js +0 -64
- package/IconButton/IconButton.d.ts +0 -23
- package/IconButton/IconButton.js +0 -48
- package/Input/Input.d.ts +0 -27
- package/Input/Input.js +0 -42
- package/InputOTP/InputOTP.d.ts +0 -20
- package/InputOTP/InputOTP.js +0 -44
- package/Label/Label.d.ts +0 -13
- package/Label/Label.js +0 -19
- package/Loader/Loader.d.ts +0 -21
- package/Loader/Loader.js +0 -30
- package/Menubar/Menubar.d.ts +0 -26
- package/Menubar/Menubar.js +0 -54
- package/Menubar/index.d.ts +0 -1
- package/Menubar/index.js +0 -1
- package/Pagination/Pagination.d.ts +0 -35
- package/Pagination/Pagination.js +0 -37
- package/Popover/Popover.d.ts +0 -7
- package/Popover/Popover.js +0 -10
- package/Progress/Progress.d.ts +0 -17
- package/Progress/Progress.js +0 -33
- package/RadioGroup/RadioGroup.d.ts +0 -13
- package/RadioGroup/RadioGroup.js +0 -26
- package/ScrollArea/ScrollArea.d.ts +0 -5
- package/ScrollArea/ScrollArea.js +0 -11
- package/Select/Select.d.ts +0 -29
- package/Select/Select.js +0 -50
- package/Separator/Separator.d.ts +0 -4
- package/Separator/Separator.js +0 -7
- package/Sidebar/Sidebar.d.ts +0 -48
- package/Sidebar/Sidebar.js +0 -116
- package/Sidebar/index.d.ts +0 -2
- package/Sidebar/index.js +0 -1
- package/Skeleton/Skeleton.d.ts +0 -4
- package/Skeleton/Skeleton.js +0 -7
- package/Slider/Slider.d.ts +0 -6
- package/Slider/Slider.js +0 -7
- package/Spinner/Spinner.d.ts +0 -19
- package/Spinner/Spinner.js +0 -31
- package/Switch/Switch.d.ts +0 -12
- package/Switch/Switch.js +0 -30
- package/Table/Table.d.ts +0 -10
- package/Table/Table.js +0 -20
- package/Tabs/Tabs.d.ts +0 -15
- package/Tabs/Tabs.js +0 -24
- package/Textarea/Textarea.d.ts +0 -19
- package/Textarea/Textarea.js +0 -31
- package/Toast/Toast.d.ts +0 -12
- package/Toast/Toast.js +0 -25
- package/Tooltip/Tooltip.d.ts +0 -17
- package/Tooltip/Tooltip.js +0 -29
- package/Typography/Typography.d.ts +0 -20
- package/Typography/Typography.js +0 -43
- package/helpers.d.ts +0 -4
- package/helpers.js +0 -5
- package/icons.d.ts +0 -1
- package/index.d.ts +0 -42
- package/index.js +0 -45
- package/lib/typography-types.d.ts +0 -4
- package/lib/typography-types.js +0 -90
- package/lib/utils.d.ts +0 -3
- package/lib/utils.js +0 -14
- package/tmpclaude-2407-cwd +0 -1
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { Flex } from "../Flex/Flex"
|
|
3
|
+
import { Typography } from "./Typography"
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Typography> = {
|
|
6
|
+
title: "Components/Typography",
|
|
7
|
+
component: Typography,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: "padded",
|
|
10
|
+
},
|
|
11
|
+
tags: ["autodocs"],
|
|
12
|
+
argTypes: {
|
|
13
|
+
variant: {
|
|
14
|
+
control: "select",
|
|
15
|
+
options: [
|
|
16
|
+
"h1",
|
|
17
|
+
"h2",
|
|
18
|
+
"h3",
|
|
19
|
+
"h4",
|
|
20
|
+
"h5",
|
|
21
|
+
"h6",
|
|
22
|
+
"subtitle1",
|
|
23
|
+
"subtitle2",
|
|
24
|
+
"subtitle3",
|
|
25
|
+
"body1",
|
|
26
|
+
"body2",
|
|
27
|
+
"body3",
|
|
28
|
+
"caption",
|
|
29
|
+
"subtitle1Medium",
|
|
30
|
+
"subtitle1Bold",
|
|
31
|
+
"subtitle1SemiBold",
|
|
32
|
+
"subtitle2Medium",
|
|
33
|
+
"subtitle2Bold",
|
|
34
|
+
"subtitle2SemiBold",
|
|
35
|
+
"subtitle3Medium",
|
|
36
|
+
"subtitle3Bold",
|
|
37
|
+
"subtitle3SemiBold",
|
|
38
|
+
"body1Medium",
|
|
39
|
+
"body1Bold",
|
|
40
|
+
"body1SemiBold",
|
|
41
|
+
"body2Medium",
|
|
42
|
+
"body2Bold",
|
|
43
|
+
"body2SemiBold",
|
|
44
|
+
"body3Medium",
|
|
45
|
+
"body3Bold",
|
|
46
|
+
"body3SemiBold",
|
|
47
|
+
"captionMedium",
|
|
48
|
+
"captionBold",
|
|
49
|
+
"captionSemiBold",
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
color: {
|
|
53
|
+
control: "select",
|
|
54
|
+
options: [
|
|
55
|
+
"default",
|
|
56
|
+
"main-50", "main-100", "main-200", "main-300", "main-400", "main-500", "main-600", "main-700", "main-800", "main-900", "main-950",
|
|
57
|
+
"success-50", "success-100", "success-200", "success-300", "success-400", "success-500", "success-600", "success-700", "success-800", "success-900", "success-950",
|
|
58
|
+
"accent-50", "accent-100", "accent-200", "accent-300", "accent-400", "accent-500", "accent-600", "accent-700", "accent-800", "accent-900", "accent-950",
|
|
59
|
+
"error-50", "error-100", "error-200", "error-300", "error-400", "error-500", "error-600", "error-700", "error-800", "error-900", "error-950",
|
|
60
|
+
"warning-50", "warning-100", "warning-200", "warning-300", "warning-400", "warning-500", "warning-600", "warning-700", "warning-800", "warning-900", "warning-950",
|
|
61
|
+
"grey-50", "grey-100", "grey-200", "grey-300", "grey-400", "grey-500", "grey-600", "grey-700", "grey-800", "grey-900", "grey-950",
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export default meta
|
|
68
|
+
type Story = StoryObj<typeof Typography>
|
|
69
|
+
|
|
70
|
+
export const Default: Story = {
|
|
71
|
+
args: {
|
|
72
|
+
variant: "body1",
|
|
73
|
+
color: "default",
|
|
74
|
+
children: "The quick brown fox jumps over the lazy dog",
|
|
75
|
+
},
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export const AllVariants: Story = {
|
|
79
|
+
render: () => (
|
|
80
|
+
<Flex gap={6}>
|
|
81
|
+
<Typography variant="h1">Typography / h1</Typography>
|
|
82
|
+
<Typography variant="h2">Typography / h2</Typography>
|
|
83
|
+
<Typography variant="h3">Typography / h3</Typography>
|
|
84
|
+
<Typography variant="h4">Typography / h4</Typography>
|
|
85
|
+
<Typography variant="h5">Typography / h5</Typography>
|
|
86
|
+
<Typography variant="h6">Typography / h6</Typography>
|
|
87
|
+
<Typography variant="subtitle1">Typography / Subtitle 1</Typography>
|
|
88
|
+
<Typography variant="subtitle2">Typography / Subtitle 2</Typography>
|
|
89
|
+
<Typography variant="body1">Typography / Body 1</Typography>
|
|
90
|
+
<Typography variant="body2">Typography / Body 2</Typography>
|
|
91
|
+
<Typography variant="body3">Typography / Body 3</Typography>
|
|
92
|
+
<Typography variant="caption">Typography / Caption</Typography>
|
|
93
|
+
<Typography variant="subtitle1Medium">Typography / Subtitle 1 Medium</Typography>
|
|
94
|
+
<Typography variant="subtitle1Bold">Typography / Subtitle 1 Bold</Typography>
|
|
95
|
+
<Typography variant="subtitle1SemiBold">Typography / Subtitle 1 SemiBold</Typography>
|
|
96
|
+
<Typography variant="subtitle2Medium">Typography / Subtitle 2 Medium</Typography>
|
|
97
|
+
<Typography variant="subtitle2Bold">Typography / Subtitle 2 Bold</Typography>
|
|
98
|
+
<Typography variant="subtitle2SemiBold">Typography / Subtitle 2 SemiBold</Typography>
|
|
99
|
+
<Typography variant="subtitle3Medium">Typography / Subtitle 3 Medium</Typography>
|
|
100
|
+
<Typography variant="subtitle3Bold">Typography / Subtitle 3 Bold</Typography>
|
|
101
|
+
<Typography variant="subtitle3SemiBold">Typography / Subtitle 3 SemiBold</Typography>
|
|
102
|
+
<Typography variant="body1Medium">Typography / Body 1 Medium</Typography>
|
|
103
|
+
<Typography variant="body1Bold">Typography / Body 1 Bold</Typography>
|
|
104
|
+
<Typography variant="body1SemiBold">Typography / Body 1 SemiBold</Typography>
|
|
105
|
+
<Typography variant="body2Medium">Typography / Body 2 Medium</Typography>
|
|
106
|
+
<Typography variant="body2Bold">Typography / Body 2 Bold</Typography>
|
|
107
|
+
<Typography variant="body2SemiBold">Typography / Body 2 SemiBold</Typography>
|
|
108
|
+
<Typography variant="body3Medium">Typography / Body 3 Medium</Typography>
|
|
109
|
+
<Typography variant="body3Bold">Typography / Body 3 Bold</Typography>
|
|
110
|
+
<Typography variant="body3SemiBold">Typography / Body 3 SemiBold</Typography>
|
|
111
|
+
<Typography variant="captionMedium">Typography / Caption Medium</Typography>
|
|
112
|
+
<Typography variant="captionBold">Typography / Caption Bold</Typography>
|
|
113
|
+
<Typography variant="captionSemiBold">Typography / Caption SemiBold</Typography>
|
|
114
|
+
</Flex>
|
|
115
|
+
),
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export const Colors: Story = {
|
|
119
|
+
render: () => (
|
|
120
|
+
<Flex gap={8}>
|
|
121
|
+
{/* Default / Foreground */}
|
|
122
|
+
<Flex gap={2}>
|
|
123
|
+
<Typography variant="h5">Default (Foreground)</Typography>
|
|
124
|
+
<Typography variant="body1" color="default">
|
|
125
|
+
The quick brown fox jumps over the lazy dog
|
|
126
|
+
</Typography>
|
|
127
|
+
</Flex>
|
|
128
|
+
|
|
129
|
+
{/* Main Colors */}
|
|
130
|
+
<Flex gap={2}>
|
|
131
|
+
<Typography variant="h5">Main Colors</Typography>
|
|
132
|
+
<Flex gap={1}>
|
|
133
|
+
<Typography variant="body1" color="main-950">Main 950</Typography>
|
|
134
|
+
<Typography variant="body1" color="main-900">Main 900</Typography>
|
|
135
|
+
<Typography variant="body1" color="main-800">Main 800</Typography>
|
|
136
|
+
<Typography variant="body1" color="main-700">Main 700</Typography>
|
|
137
|
+
<Typography variant="body1" color="main-600">Main 600</Typography>
|
|
138
|
+
<Typography variant="body1" color="main-500">Main 500</Typography>
|
|
139
|
+
</Flex>
|
|
140
|
+
</Flex>
|
|
141
|
+
|
|
142
|
+
{/* Success Colors */}
|
|
143
|
+
<Flex gap={2}>
|
|
144
|
+
<Typography variant="h5">Success Colors</Typography>
|
|
145
|
+
<Flex gap={1}>
|
|
146
|
+
<Typography variant="body1" color="success-700">Success 700</Typography>
|
|
147
|
+
<Typography variant="body1" color="success-600">Success 600</Typography>
|
|
148
|
+
<Typography variant="body1" color="success-500">Success 500</Typography>
|
|
149
|
+
</Flex>
|
|
150
|
+
</Flex>
|
|
151
|
+
|
|
152
|
+
{/* Accent Colors */}
|
|
153
|
+
<Flex gap={2}>
|
|
154
|
+
<Typography variant="h5">Accent Colors</Typography>
|
|
155
|
+
<Flex gap={1}>
|
|
156
|
+
<Typography variant="body1" color="accent-700">Accent 700</Typography>
|
|
157
|
+
<Typography variant="body1" color="accent-600">Accent 600</Typography>
|
|
158
|
+
<Typography variant="body1" color="accent-500">Accent 500</Typography>
|
|
159
|
+
</Flex>
|
|
160
|
+
</Flex>
|
|
161
|
+
|
|
162
|
+
{/* Error Colors */}
|
|
163
|
+
<Flex gap={2}>
|
|
164
|
+
<Typography variant="h5">Error Colors</Typography>
|
|
165
|
+
<Flex gap={1}>
|
|
166
|
+
<Typography variant="body1" color="error-700">Error 700</Typography>
|
|
167
|
+
<Typography variant="body1" color="error-600">Error 600</Typography>
|
|
168
|
+
<Typography variant="body1" color="error-500">Error 500</Typography>
|
|
169
|
+
</Flex>
|
|
170
|
+
</Flex>
|
|
171
|
+
|
|
172
|
+
{/* Warning Colors */}
|
|
173
|
+
<Flex gap={2}>
|
|
174
|
+
<Typography variant="h5">Warning Colors</Typography>
|
|
175
|
+
<Flex gap={1}>
|
|
176
|
+
<Typography variant="body1" color="warning-700">Warning 700</Typography>
|
|
177
|
+
<Typography variant="body1" color="warning-600">Warning 600</Typography>
|
|
178
|
+
<Typography variant="body1" color="warning-500">Warning 500</Typography>
|
|
179
|
+
</Flex>
|
|
180
|
+
</Flex>
|
|
181
|
+
|
|
182
|
+
{/* Grey Colors */}
|
|
183
|
+
<Flex gap={2}>
|
|
184
|
+
<Typography variant="h5">Grey Colors</Typography>
|
|
185
|
+
<Flex gap={1}>
|
|
186
|
+
<Typography variant="body1" color="grey-900">Grey 900</Typography>
|
|
187
|
+
<Typography variant="body1" color="grey-700">Grey 700</Typography>
|
|
188
|
+
<Typography variant="body1" color="grey-500">Grey 500</Typography>
|
|
189
|
+
<Typography variant="body1" color="grey-400">Grey 400</Typography>
|
|
190
|
+
</Flex>
|
|
191
|
+
</Flex>
|
|
192
|
+
</Flex>
|
|
193
|
+
),
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export const H1: Story = {
|
|
197
|
+
args: {
|
|
198
|
+
variant: "h1",
|
|
199
|
+
children: "Heading 1",
|
|
200
|
+
},
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export const H2: Story = {
|
|
204
|
+
args: {
|
|
205
|
+
variant: "h2",
|
|
206
|
+
children: "Heading 2",
|
|
207
|
+
},
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export const H3: Story = {
|
|
211
|
+
args: {
|
|
212
|
+
variant: "h3",
|
|
213
|
+
children: "Heading 3",
|
|
214
|
+
},
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export const H4: Story = {
|
|
218
|
+
args: {
|
|
219
|
+
variant: "h4",
|
|
220
|
+
children: "Heading 4",
|
|
221
|
+
},
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export const H5: Story = {
|
|
225
|
+
args: {
|
|
226
|
+
variant: "h5",
|
|
227
|
+
children: "Heading 5",
|
|
228
|
+
},
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export const H6: Story = {
|
|
232
|
+
args: {
|
|
233
|
+
variant: "h6",
|
|
234
|
+
children: "Heading 6",
|
|
235
|
+
},
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export const Subtitle1: Story = {
|
|
239
|
+
args: {
|
|
240
|
+
variant: "subtitle1",
|
|
241
|
+
children: "Subtitle 1",
|
|
242
|
+
},
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export const Subtitle2: Story = {
|
|
246
|
+
args: {
|
|
247
|
+
variant: "subtitle2",
|
|
248
|
+
children: "Subtitle 2",
|
|
249
|
+
},
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export const Body1: Story = {
|
|
253
|
+
args: {
|
|
254
|
+
variant: "body1",
|
|
255
|
+
children: "Body 1 - The quick brown fox jumps over the lazy dog",
|
|
256
|
+
},
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export const Body2: Story = {
|
|
260
|
+
args: {
|
|
261
|
+
variant: "body2",
|
|
262
|
+
children: "Body 2 - The quick brown fox jumps over the lazy dog",
|
|
263
|
+
},
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export const Body3: Story = {
|
|
267
|
+
args: {
|
|
268
|
+
variant: "body3",
|
|
269
|
+
children: "Body 3 - The quick brown fox jumps over the lazy dog",
|
|
270
|
+
},
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export const Caption: Story = {
|
|
274
|
+
args: {
|
|
275
|
+
variant: "caption",
|
|
276
|
+
children: "Caption - The quick brown fox jumps over the lazy dog",
|
|
277
|
+
},
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export const Subtitle1Medium: Story = {
|
|
281
|
+
args: {
|
|
282
|
+
variant: "subtitle1Medium",
|
|
283
|
+
children: "Subtitle 1 Medium",
|
|
284
|
+
},
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export const Subtitle1Bold: Story = {
|
|
288
|
+
args: {
|
|
289
|
+
variant: "subtitle1Bold",
|
|
290
|
+
children: "Subtitle 1 Bold",
|
|
291
|
+
},
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export const Subtitle1SemiBold: Story = {
|
|
295
|
+
args: {
|
|
296
|
+
variant: "subtitle1SemiBold",
|
|
297
|
+
children: "Subtitle 1 SemiBold",
|
|
298
|
+
},
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
export const Subtitle2Medium: Story = {
|
|
302
|
+
args: {
|
|
303
|
+
variant: "subtitle2Medium",
|
|
304
|
+
children: "Subtitle 2 Medium",
|
|
305
|
+
},
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export const Subtitle2Bold: Story = {
|
|
309
|
+
args: {
|
|
310
|
+
variant: "subtitle2Bold",
|
|
311
|
+
children: "Subtitle 2 Bold",
|
|
312
|
+
},
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
export const Subtitle2SemiBold: Story = {
|
|
316
|
+
args: {
|
|
317
|
+
variant: "subtitle2SemiBold",
|
|
318
|
+
children: "Subtitle 2 SemiBold",
|
|
319
|
+
},
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
export const Subtitle3Medium: Story = {
|
|
323
|
+
args: {
|
|
324
|
+
variant: "subtitle3Medium",
|
|
325
|
+
children: "Subtitle 3 Medium",
|
|
326
|
+
},
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export const Subtitle3Bold: Story = {
|
|
330
|
+
args: {
|
|
331
|
+
variant: "subtitle3Bold",
|
|
332
|
+
children: "Subtitle 3 Bold",
|
|
333
|
+
},
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export const Subtitle3SemiBold: Story = {
|
|
337
|
+
args: {
|
|
338
|
+
variant: "subtitle3SemiBold",
|
|
339
|
+
children: "Subtitle 3 SemiBold",
|
|
340
|
+
},
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export const Body1Medium: Story = {
|
|
344
|
+
args: {
|
|
345
|
+
variant: "body1Medium",
|
|
346
|
+
children: "Body 1 Medium - The quick brown fox jumps over the lazy dog",
|
|
347
|
+
},
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export const Body1Bold: Story = {
|
|
351
|
+
args: {
|
|
352
|
+
variant: "body1Bold",
|
|
353
|
+
children: "Body 1 Bold - The quick brown fox jumps over the lazy dog",
|
|
354
|
+
},
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export const Body1SemiBold: Story = {
|
|
358
|
+
args: {
|
|
359
|
+
variant: "body1SemiBold",
|
|
360
|
+
children: "Body 1 SemiBold - The quick brown fox jumps over the lazy dog",
|
|
361
|
+
},
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
export const Body2Medium: Story = {
|
|
365
|
+
args: {
|
|
366
|
+
variant: "body2Medium",
|
|
367
|
+
children: "Body 2 Medium - The quick brown fox jumps over the lazy dog",
|
|
368
|
+
},
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
export const Body2Bold: Story = {
|
|
372
|
+
args: {
|
|
373
|
+
variant: "body2Bold",
|
|
374
|
+
children: "Body 2 Bold - The quick brown fox jumps over the lazy dog",
|
|
375
|
+
},
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
export const Body2SemiBold: Story = {
|
|
379
|
+
args: {
|
|
380
|
+
variant: "body2SemiBold",
|
|
381
|
+
children: "Body 2 SemiBold - The quick brown fox jumps over the lazy dog",
|
|
382
|
+
},
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
export const Body3Medium: Story = {
|
|
386
|
+
args: {
|
|
387
|
+
variant: "body3Medium",
|
|
388
|
+
children: "Body 3 Medium - The quick brown fox jumps over the lazy dog",
|
|
389
|
+
},
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
export const Body3Bold: Story = {
|
|
393
|
+
args: {
|
|
394
|
+
variant: "body3Bold",
|
|
395
|
+
children: "Body 3 Bold - The quick brown fox jumps over the lazy dog",
|
|
396
|
+
},
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
export const Body3SemiBold: Story = {
|
|
400
|
+
args: {
|
|
401
|
+
variant: "body3SemiBold",
|
|
402
|
+
children: "Body 3 SemiBold - The quick brown fox jumps over the lazy dog",
|
|
403
|
+
},
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
export const CaptionMedium: Story = {
|
|
407
|
+
args: {
|
|
408
|
+
variant: "captionMedium",
|
|
409
|
+
children: "Caption Medium - The quick brown fox jumps over the lazy dog",
|
|
410
|
+
},
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
export const CaptionBold: Story = {
|
|
414
|
+
args: {
|
|
415
|
+
variant: "captionBold",
|
|
416
|
+
children: "Caption Bold - The quick brown fox jumps over the lazy dog",
|
|
417
|
+
},
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
export const CaptionSemiBold: Story = {
|
|
421
|
+
args: {
|
|
422
|
+
variant: "captionSemiBold",
|
|
423
|
+
children: "Caption SemiBold - The quick brown fox jumps over the lazy dog",
|
|
424
|
+
},
|
|
425
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
import {
|
|
6
|
+
type TextVariant,
|
|
7
|
+
type TextColor,
|
|
8
|
+
textVariantClasses,
|
|
9
|
+
textColorClasses,
|
|
10
|
+
} from "../lib/typography-types";
|
|
11
|
+
|
|
12
|
+
const typographyVariants = cva("", {
|
|
13
|
+
variants: {
|
|
14
|
+
align: {
|
|
15
|
+
left: "text-left",
|
|
16
|
+
center: "text-center",
|
|
17
|
+
right: "text-right",
|
|
18
|
+
justify: "text-justify",
|
|
19
|
+
},
|
|
20
|
+
variant: textVariantClasses,
|
|
21
|
+
color: textColorClasses,
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
variant: "body1",
|
|
25
|
+
color: "default",
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
type TypographyVariant = TextVariant;
|
|
30
|
+
type TypographyColor = TextColor;
|
|
31
|
+
type TypographyAlign = "left" | "center" | "right" | "justify";
|
|
32
|
+
|
|
33
|
+
const variantElementMap: Record<
|
|
34
|
+
TypographyVariant,
|
|
35
|
+
keyof React.JSX.IntrinsicElements
|
|
36
|
+
> = {
|
|
37
|
+
h1: "h1",
|
|
38
|
+
h2: "h2",
|
|
39
|
+
h3: "h3",
|
|
40
|
+
h4: "h4",
|
|
41
|
+
h5: "h5",
|
|
42
|
+
h6: "h6",
|
|
43
|
+
subtitle1: "p",
|
|
44
|
+
subtitle2: "p",
|
|
45
|
+
subtitle3: "p",
|
|
46
|
+
body1: "p",
|
|
47
|
+
body2: "p",
|
|
48
|
+
body3: "p",
|
|
49
|
+
caption: "span",
|
|
50
|
+
subtitle1Medium: "p",
|
|
51
|
+
subtitle1Bold: "p",
|
|
52
|
+
subtitle1SemiBold: "p",
|
|
53
|
+
subtitle2Medium: "p",
|
|
54
|
+
subtitle2Bold: "p",
|
|
55
|
+
subtitle2SemiBold: "p",
|
|
56
|
+
subtitle3Medium: "p",
|
|
57
|
+
subtitle3Bold: "p",
|
|
58
|
+
subtitle3SemiBold: "p",
|
|
59
|
+
body1Medium: "p",
|
|
60
|
+
body1Bold: "p",
|
|
61
|
+
body1SemiBold: "p",
|
|
62
|
+
body2Medium: "p",
|
|
63
|
+
body2Bold: "p",
|
|
64
|
+
body2SemiBold: "p",
|
|
65
|
+
body3Medium: "p",
|
|
66
|
+
body3Bold: "p",
|
|
67
|
+
body3SemiBold: "p",
|
|
68
|
+
captionMedium: "span",
|
|
69
|
+
captionBold: "span",
|
|
70
|
+
captionSemiBold: "span",
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
type TypographyProps<T extends React.ElementType = "p"> = {
|
|
74
|
+
as?: T;
|
|
75
|
+
asChild?: boolean;
|
|
76
|
+
variant?: TypographyVariant;
|
|
77
|
+
color?: TypographyColor;
|
|
78
|
+
align?: TypographyAlign;
|
|
79
|
+
} & Omit<
|
|
80
|
+
React.ComponentPropsWithoutRef<T>,
|
|
81
|
+
"as" | "asChild" | "color" | "variant" | "align"
|
|
82
|
+
>;
|
|
83
|
+
|
|
84
|
+
function Typography<T extends React.ElementType = "p">({
|
|
85
|
+
className,
|
|
86
|
+
variant = "body1",
|
|
87
|
+
color = "default",
|
|
88
|
+
align,
|
|
89
|
+
as,
|
|
90
|
+
asChild = false,
|
|
91
|
+
...props
|
|
92
|
+
}: TypographyProps<T>) {
|
|
93
|
+
const defaultElement = variant ? variantElementMap[variant] : "p";
|
|
94
|
+
const Component = asChild ? Slot : as ?? defaultElement;
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<Component
|
|
98
|
+
data-slot="typography"
|
|
99
|
+
className={cn(typographyVariants({ variant, color, align, className }))}
|
|
100
|
+
{...props}
|
|
101
|
+
/>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export { Typography, typographyVariants };
|
|
106
|
+
export type { TypographyVariant, TypographyColor, TypographyAlign };
|
package/helpers.ts
ADDED
package/{icons.js → icons.ts}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Re-export all icons from lucide-react
|
|
2
|
-
export * from "lucide-react"
|
|
2
|
+
export * from "lucide-react"
|