@a2v2ai/uikit 0.0.38 → 0.0.39

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 (183) hide show
  1. package/Alert/Alert.d.ts +13 -0
  2. package/Alert/Alert.js +25 -0
  3. package/AlertDialog/AlertDialog.d.ts +43 -0
  4. package/AlertDialog/AlertDialog.js +71 -0
  5. package/Avatar/Avatar.d.ts +14 -0
  6. package/Avatar/Avatar.js +25 -0
  7. package/Badge/Badge.d.ts +11 -0
  8. package/Badge/Badge.js +23 -0
  9. package/Breadcrumb/Breadcrumb.d.ts +19 -0
  10. package/Breadcrumb/Breadcrumb.js +23 -0
  11. package/Button/Button.d.ts +23 -0
  12. package/Button/Button.js +52 -0
  13. package/Calendar/Calendar.d.ts +20 -0
  14. package/Calendar/Calendar.js +78 -0
  15. package/Card/Card.d.ts +16 -0
  16. package/Card/Card.js +28 -0
  17. package/Carousel/Carousel.d.ts +37 -0
  18. package/Carousel/Carousel.js +132 -0
  19. package/ChatBubble/ChatBubble.d.ts +33 -0
  20. package/ChatBubble/ChatBubble.js +107 -0
  21. package/Checkbox/Checkbox.d.ts +12 -0
  22. package/Checkbox/Checkbox.js +20 -0
  23. package/DataTable/DataTable.d.ts +35 -0
  24. package/DataTable/DataTable.js +51 -0
  25. package/Drawer/Drawer.d.ts +33 -0
  26. package/Drawer/Drawer.js +55 -0
  27. package/DropdownMenu/DropdownMenu.d.ts +27 -0
  28. package/DropdownMenu/DropdownMenu.js +35 -0
  29. package/ErrorMessage/ErrorMessage.d.ts +27 -0
  30. package/ErrorMessage/ErrorMessage.js +14 -0
  31. package/Flex/Flex.d.ts +31 -0
  32. package/Flex/Flex.js +64 -0
  33. package/IconButton/IconButton.d.ts +23 -0
  34. package/IconButton/IconButton.js +48 -0
  35. package/Input/Input.d.ts +27 -0
  36. package/Input/Input.js +42 -0
  37. package/InputOTP/InputOTP.d.ts +20 -0
  38. package/InputOTP/InputOTP.js +44 -0
  39. package/Label/Label.d.ts +13 -0
  40. package/Label/Label.js +19 -0
  41. package/Loader/Loader.d.ts +21 -0
  42. package/Loader/Loader.js +30 -0
  43. package/Menubar/Menubar.d.ts +26 -0
  44. package/Menubar/Menubar.js +54 -0
  45. package/Menubar/index.d.ts +1 -0
  46. package/Menubar/index.js +1 -0
  47. package/Pagination/Pagination.d.ts +35 -0
  48. package/Pagination/Pagination.js +37 -0
  49. package/Popover/Popover.d.ts +7 -0
  50. package/Popover/Popover.js +10 -0
  51. package/Progress/Progress.d.ts +17 -0
  52. package/Progress/Progress.js +33 -0
  53. package/RadioGroup/RadioGroup.d.ts +13 -0
  54. package/RadioGroup/RadioGroup.js +26 -0
  55. package/ScrollArea/ScrollArea.d.ts +5 -0
  56. package/ScrollArea/ScrollArea.js +11 -0
  57. package/Select/Select.d.ts +29 -0
  58. package/Select/Select.js +50 -0
  59. package/Separator/Separator.d.ts +4 -0
  60. package/Separator/Separator.js +7 -0
  61. package/Sidebar/Sidebar.d.ts +48 -0
  62. package/Sidebar/Sidebar.js +116 -0
  63. package/Sidebar/index.d.ts +2 -0
  64. package/Sidebar/index.js +1 -0
  65. package/Skeleton/Skeleton.d.ts +4 -0
  66. package/Skeleton/Skeleton.js +7 -0
  67. package/Slider/Slider.d.ts +6 -0
  68. package/Slider/Slider.js +7 -0
  69. package/Spinner/Spinner.d.ts +19 -0
  70. package/Spinner/Spinner.js +31 -0
  71. package/Switch/Switch.d.ts +12 -0
  72. package/Switch/Switch.js +30 -0
  73. package/Table/Table.d.ts +10 -0
  74. package/Table/Table.js +20 -0
  75. package/Tabs/Tabs.d.ts +15 -0
  76. package/Tabs/Tabs.js +24 -0
  77. package/Textarea/Textarea.d.ts +19 -0
  78. package/Textarea/Textarea.js +31 -0
  79. package/Toast/Toast.d.ts +12 -0
  80. package/Toast/Toast.js +25 -0
  81. package/Tooltip/Tooltip.d.ts +17 -0
  82. package/Tooltip/Tooltip.js +29 -0
  83. package/Typography/Typography.d.ts +20 -0
  84. package/Typography/Typography.js +71 -0
  85. package/helpers.d.ts +4 -0
  86. package/helpers.js +5 -0
  87. package/icons.d.ts +1 -0
  88. package/{icons.ts → icons.js} +1 -1
  89. package/index.css +68 -0
  90. package/index.d.ts +42 -0
  91. package/index.js +45 -0
  92. package/lib/typography-types.d.ts +4 -0
  93. package/lib/typography-types.js +118 -0
  94. package/lib/utils.d.ts +3 -0
  95. package/lib/utils.js +14 -0
  96. package/package.json +1 -1
  97. package/Alert/Alert.stories.tsx +0 -121
  98. package/Alert/Alert.tsx +0 -71
  99. package/AlertDialog/AlertDialog.stories.tsx +0 -665
  100. package/AlertDialog/AlertDialog.tsx +0 -241
  101. package/Avatar/Avatar.stories.tsx +0 -128
  102. package/Avatar/Avatar.tsx +0 -71
  103. package/Badge/Badge.stories.tsx +0 -76
  104. package/Badge/Badge.tsx +0 -39
  105. package/Breadcrumb/Breadcrumb.stories.tsx +0 -231
  106. package/Breadcrumb/Breadcrumb.tsx +0 -114
  107. package/Button/Button.stories.tsx +0 -684
  108. package/Button/Button.tsx +0 -107
  109. package/Calendar/Calendar.stories.tsx +0 -291
  110. package/Calendar/Calendar.tsx +0 -246
  111. package/Card/Card.stories.tsx +0 -136
  112. package/Card/Card.tsx +0 -96
  113. package/Carousel/Carousel.stories.tsx +0 -256
  114. package/Carousel/Carousel.tsx +0 -301
  115. package/ChatBubble/ChatBubble.stories.tsx +0 -339
  116. package/ChatBubble/ChatBubble.tsx +0 -179
  117. package/Checkbox/Checkbox.stories.tsx +0 -137
  118. package/Checkbox/Checkbox.tsx +0 -53
  119. package/DataTable/DataTable.stories.tsx +0 -400
  120. package/DataTable/DataTable.tsx +0 -207
  121. package/Drawer/Drawer.stories.tsx +0 -721
  122. package/Drawer/Drawer.tsx +0 -201
  123. package/DropdownMenu/DropdownMenu.stories.tsx +0 -251
  124. package/DropdownMenu/DropdownMenu.tsx +0 -199
  125. package/ErrorMessage/ErrorMessage.stories.tsx +0 -159
  126. package/ErrorMessage/ErrorMessage.tsx +0 -55
  127. package/Flex/Flex.stories.tsx +0 -390
  128. package/Flex/Flex.tsx +0 -102
  129. package/IconButton/IconButton.stories.tsx +0 -566
  130. package/IconButton/IconButton.tsx +0 -95
  131. package/Input/Input.stories.tsx +0 -566
  132. package/Input/Input.tsx +0 -168
  133. package/InputOTP/InputOTP.stories.tsx +0 -246
  134. package/InputOTP/InputOTP.tsx +0 -127
  135. package/Label/Label.stories.tsx +0 -110
  136. package/Label/Label.tsx +0 -44
  137. package/Loader/Loader.stories.tsx +0 -170
  138. package/Loader/Loader.tsx +0 -62
  139. package/Menubar/Menubar.stories.tsx +0 -382
  140. package/Menubar/Menubar.tsx +0 -274
  141. package/Menubar/index.ts +0 -18
  142. package/Pagination/Pagination.stories.tsx +0 -196
  143. package/Pagination/Pagination.tsx +0 -122
  144. package/Popover/Popover.stories.tsx +0 -133
  145. package/Popover/Popover.tsx +0 -31
  146. package/Progress/Progress.stories.tsx +0 -146
  147. package/Progress/Progress.tsx +0 -67
  148. package/RadioGroup/RadioGroup.stories.tsx +0 -159
  149. package/RadioGroup/RadioGroup.tsx +0 -68
  150. package/ScrollArea/ScrollArea.stories.tsx +0 -136
  151. package/ScrollArea/ScrollArea.tsx +0 -46
  152. package/Select/Select.stories.tsx +0 -378
  153. package/Select/Select.tsx +0 -230
  154. package/Separator/Separator.stories.tsx +0 -110
  155. package/Separator/Separator.tsx +0 -29
  156. package/Sidebar/Sidebar.stories.tsx +0 -340
  157. package/Sidebar/Sidebar.tsx +0 -414
  158. package/Sidebar/index.ts +0 -28
  159. package/Skeleton/Skeleton.stories.tsx +0 -117
  160. package/Skeleton/Skeleton.tsx +0 -16
  161. package/Slider/Slider.stories.tsx +0 -216
  162. package/Slider/Slider.tsx +0 -29
  163. package/Spinner/Spinner.stories.tsx +0 -210
  164. package/Spinner/Spinner.tsx +0 -78
  165. package/Switch/Switch.stories.tsx +0 -146
  166. package/Switch/Switch.tsx +0 -59
  167. package/Table/Table.stories.tsx +0 -510
  168. package/Table/Table.tsx +0 -114
  169. package/Tabs/Tabs.stories.tsx +0 -197
  170. package/Tabs/Tabs.tsx +0 -74
  171. package/Textarea/Textarea.stories.tsx +0 -187
  172. package/Textarea/Textarea.tsx +0 -73
  173. package/Toast/Toast.stories.tsx +0 -285
  174. package/Toast/Toast.tsx +0 -59
  175. package/Tooltip/Tooltip.stories.tsx +0 -463
  176. package/Tooltip/Tooltip.tsx +0 -96
  177. package/Typography/Typography.stories.tsx +0 -425
  178. package/Typography/Typography.tsx +0 -106
  179. package/helpers.ts +0 -5
  180. package/index.ts +0 -217
  181. package/lib/typography-types.ts +0 -223
  182. package/lib/utils.ts +0 -15
  183. package/tsconfig.json +0 -22
@@ -1,566 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react"
2
- import { Plus, Pencil, Filter, MoreVertical, MoreHorizontal, Trash2 } from "../icons"
3
-
4
- import { Flex } from "../Flex/Flex"
5
- import { Typography } from "../Typography/Typography"
6
- import { IconButton } from "./IconButton"
7
-
8
- const meta: Meta<typeof IconButton> = {
9
- title: "Components/IconButton",
10
- component: IconButton,
11
- parameters: {
12
- layout: "centered",
13
- },
14
- argTypes: {
15
- variant: {
16
- control: "select",
17
- options: ["primary", "secondary", "outline", "ghost"],
18
- description: "The visual variant of the button",
19
- },
20
- size: {
21
- control: "select",
22
- options: ["mini", "small", "regular", "large"],
23
- description: "The size of the button",
24
- },
25
- roundness: {
26
- control: "select",
27
- options: ["default", "round"],
28
- description: "The roundness of the button corners",
29
- },
30
- disabled: {
31
- control: "boolean",
32
- description: "Whether the button is disabled",
33
- },
34
- },
35
- tags: ["autodocs"],
36
- }
37
-
38
- export default meta
39
- type Story = StoryObj<typeof meta>
40
-
41
- // Default story
42
- export const Default: Story = {
43
- args: {
44
- icon: <Plus />,
45
- "aria-label": "Add item",
46
- },
47
- parameters: {
48
- docs: {
49
- source: {
50
- code: `<IconButton icon={<Plus />} aria-label="Add item" />`,
51
- },
52
- },
53
- },
54
- }
55
-
56
- // Variants
57
- export const Primary: Story = {
58
- args: {
59
- variant: "primary",
60
- icon: <Plus />,
61
- "aria-label": "Add item",
62
- },
63
- parameters: {
64
- docs: {
65
- source: {
66
- code: `<IconButton variant="primary" icon={<Plus />} aria-label="Add item" />`,
67
- },
68
- },
69
- },
70
- }
71
-
72
- export const Secondary: Story = {
73
- args: {
74
- variant: "secondary",
75
- icon: <Pencil />,
76
- "aria-label": "Edit",
77
- },
78
- parameters: {
79
- docs: {
80
- source: {
81
- code: `<IconButton variant="secondary" icon={<Pencil />} aria-label="Edit" />`,
82
- },
83
- },
84
- },
85
- }
86
-
87
- export const Outline: Story = {
88
- args: {
89
- variant: "outline",
90
- icon: <Filter />,
91
- "aria-label": "Filter",
92
- },
93
- parameters: {
94
- docs: {
95
- source: {
96
- code: `<IconButton variant="outline" icon={<Filter />} aria-label="Filter" />`,
97
- },
98
- },
99
- },
100
- }
101
-
102
- export const Ghost: Story = {
103
- args: {
104
- variant: "ghost",
105
- icon: <MoreVertical />,
106
- "aria-label": "More options",
107
- },
108
- parameters: {
109
- docs: {
110
- source: {
111
- code: `<IconButton variant="ghost" icon={<MoreVertical />} aria-label="More options" />`,
112
- },
113
- },
114
- },
115
- }
116
-
117
- // Sizes
118
- export const SizeLarge: Story = {
119
- args: {
120
- size: "large",
121
- icon: <Plus />,
122
- "aria-label": "Add item",
123
- },
124
- parameters: {
125
- docs: {
126
- source: {
127
- code: `<IconButton size="large" icon={<Plus />} aria-label="Add item" />`,
128
- },
129
- },
130
- },
131
- }
132
-
133
- export const SizeRegular: Story = {
134
- args: {
135
- size: "regular",
136
- icon: <Plus />,
137
- "aria-label": "Add item",
138
- },
139
- parameters: {
140
- docs: {
141
- source: {
142
- code: `<IconButton size="regular" icon={<Plus />} aria-label="Add item" />`,
143
- },
144
- },
145
- },
146
- }
147
-
148
- export const SizeSmall: Story = {
149
- args: {
150
- size: "small",
151
- icon: <Plus />,
152
- "aria-label": "Add item",
153
- },
154
- parameters: {
155
- docs: {
156
- source: {
157
- code: `<IconButton size="small" icon={<Plus />} aria-label="Add item" />`,
158
- },
159
- },
160
- },
161
- }
162
-
163
- export const SizeMini: Story = {
164
- args: {
165
- size: "mini",
166
- icon: <Plus />,
167
- "aria-label": "Add item",
168
- },
169
- parameters: {
170
- docs: {
171
- source: {
172
- code: `<IconButton size="mini" icon={<Plus />} aria-label="Add item" />`,
173
- },
174
- },
175
- },
176
- }
177
-
178
- // Roundness
179
- export const RoundDefault: Story = {
180
- args: {
181
- roundness: "default",
182
- icon: <Plus />,
183
- "aria-label": "Add item",
184
- },
185
- parameters: {
186
- docs: {
187
- source: {
188
- code: `<IconButton roundness="default" icon={<Plus />} aria-label="Add item" />`,
189
- },
190
- },
191
- },
192
- }
193
-
194
- export const RoundFull: Story = {
195
- args: {
196
- roundness: "round",
197
- icon: <Plus />,
198
- "aria-label": "Add item",
199
- },
200
- parameters: {
201
- docs: {
202
- source: {
203
- code: `<IconButton roundness="round" icon={<Plus />} aria-label="Add item" />`,
204
- },
205
- },
206
- },
207
- }
208
-
209
- // Disabled
210
- export const Disabled: Story = {
211
- args: {
212
- disabled: true,
213
- icon: <Plus />,
214
- "aria-label": "Add item",
215
- },
216
- parameters: {
217
- docs: {
218
- source: {
219
- code: `<IconButton disabled icon={<Plus />} aria-label="Add item" />`,
220
- },
221
- },
222
- },
223
- }
224
-
225
- // All Variants showcase - matching Figma grid layout
226
- export const AllVariants: Story = {
227
- render: () => (
228
- <Flex gap={8}>
229
- {/* Icon Button Grid - matching Figma layout */}
230
- <Flex gap={4}>
231
- <Typography variant="h4" className="text-white">Icon Button</Typography>
232
-
233
- {/* Header row with variant labels */}
234
- <Flex direction="row" gap={0}>
235
- {/* Spacer for row labels */}
236
- <div className="w-20" />
237
-
238
- {/* Primary */}
239
- <Flex align="center" className="w-40">
240
- <Typography variant="body2" className="text-neutral-400 mb-2">Primary</Typography>
241
- <Flex direction="row" gap={2}>
242
- <Typography variant="caption" className="text-neutral-500 w-10 text-center">Default</Typography>
243
- <Typography variant="caption" className="text-neutral-500 w-10 text-center">Disabled</Typography>
244
- </Flex>
245
- </Flex>
246
-
247
- {/* Secondary */}
248
- <Flex align="center" className="w-40">
249
- <Typography variant="body2" className="text-neutral-400 mb-2">Secondary</Typography>
250
- <Flex direction="row" gap={2}>
251
- <Typography variant="caption" className="text-neutral-500 w-10 text-center">Default</Typography>
252
- <Typography variant="caption" className="text-neutral-500 w-10 text-center">Disabled</Typography>
253
- </Flex>
254
- </Flex>
255
-
256
- {/* Outline */}
257
- <Flex align="center" className="w-40">
258
- <Typography variant="body2" className="text-neutral-400 mb-2">Outline</Typography>
259
- <Flex direction="row" gap={2}>
260
- <Typography variant="caption" className="text-neutral-500 w-10 text-center">Default</Typography>
261
- <Typography variant="caption" className="text-neutral-500 w-10 text-center">Disabled</Typography>
262
- </Flex>
263
- </Flex>
264
-
265
- {/* Ghost */}
266
- <Flex align="center" className="w-40">
267
- <Typography variant="body2" className="text-neutral-400 mb-2">Ghost</Typography>
268
- <Flex direction="row" gap={2}>
269
- <Typography variant="caption" className="text-neutral-500 w-10 text-center">Default</Typography>
270
- <Typography variant="caption" className="text-neutral-500 w-10 text-center">Disabled</Typography>
271
- </Flex>
272
- </Flex>
273
- </Flex>
274
-
275
- {/* Default Roundness Section */}
276
- <Flex gap={2}>
277
- <Typography variant="body2" className="text-neutral-500 mb-1">Default</Typography>
278
-
279
- {/* Regular Row */}
280
- <Flex direction="row" gap={0} align="center">
281
- <Typography variant="caption" className="text-neutral-500 w-20">Regular</Typography>
282
- <Flex direction="row" gap={2} className="w-40" justify="center">
283
- <IconButton variant="primary" size="regular" icon={<Plus />} aria-label="Primary Regular" />
284
- <IconButton variant="primary" size="regular" icon={<Plus />} aria-label="Primary Regular Disabled" disabled />
285
- </Flex>
286
- <Flex direction="row" gap={2} className="w-40" justify="center">
287
- <IconButton variant="secondary" size="regular" icon={<Plus />} aria-label="Secondary Regular" />
288
- <IconButton variant="secondary" size="regular" icon={<Plus />} aria-label="Secondary Regular Disabled" disabled />
289
- </Flex>
290
- <Flex direction="row" gap={2} className="w-40" justify="center">
291
- <IconButton variant="outline" size="regular" icon={<Plus />} aria-label="Outline Regular" />
292
- <IconButton variant="outline" size="regular" icon={<Plus />} aria-label="Outline Regular Disabled" disabled />
293
- </Flex>
294
- <Flex direction="row" gap={2} className="w-40" justify="center">
295
- <IconButton variant="ghost" size="regular" icon={<Plus />} aria-label="Ghost Regular" />
296
- <IconButton variant="ghost" size="regular" icon={<Plus />} aria-label="Ghost Regular Disabled" disabled />
297
- </Flex>
298
- </Flex>
299
-
300
- {/* Large Row */}
301
- <Flex direction="row" gap={0} align="center">
302
- <Typography variant="caption" className="text-neutral-500 w-20">Large</Typography>
303
- <Flex direction="row" gap={2} className="w-40" justify="center">
304
- <IconButton variant="primary" size="large" icon={<Plus />} aria-label="Primary Large" />
305
- <IconButton variant="primary" size="large" icon={<Plus />} aria-label="Primary Large Disabled" disabled />
306
- </Flex>
307
- <Flex direction="row" gap={2} className="w-40" justify="center">
308
- <IconButton variant="secondary" size="large" icon={<Plus />} aria-label="Secondary Large" />
309
- <IconButton variant="secondary" size="large" icon={<Plus />} aria-label="Secondary Large Disabled" disabled />
310
- </Flex>
311
- <Flex direction="row" gap={2} className="w-40" justify="center">
312
- <IconButton variant="outline" size="large" icon={<Plus />} aria-label="Outline Large" />
313
- <IconButton variant="outline" size="large" icon={<Plus />} aria-label="Outline Large Disabled" disabled />
314
- </Flex>
315
- <Flex direction="row" gap={2} className="w-40" justify="center">
316
- <IconButton variant="ghost" size="large" icon={<Plus />} aria-label="Ghost Large" />
317
- <IconButton variant="ghost" size="large" icon={<Plus />} aria-label="Ghost Large Disabled" disabled />
318
- </Flex>
319
- </Flex>
320
-
321
- {/* Small Row */}
322
- <Flex direction="row" gap={0} align="center">
323
- <Typography variant="caption" className="text-neutral-500 w-20">Small</Typography>
324
- <Flex direction="row" gap={2} className="w-40" justify="center">
325
- <IconButton variant="primary" size="small" icon={<Plus />} aria-label="Primary Small" />
326
- <IconButton variant="primary" size="small" icon={<Plus />} aria-label="Primary Small Disabled" disabled />
327
- </Flex>
328
- <Flex direction="row" gap={2} className="w-40" justify="center">
329
- <IconButton variant="secondary" size="small" icon={<Plus />} aria-label="Secondary Small" />
330
- <IconButton variant="secondary" size="small" icon={<Plus />} aria-label="Secondary Small Disabled" disabled />
331
- </Flex>
332
- <Flex direction="row" gap={2} className="w-40" justify="center">
333
- <IconButton variant="outline" size="small" icon={<Plus />} aria-label="Outline Small" />
334
- <IconButton variant="outline" size="small" icon={<Plus />} aria-label="Outline Small Disabled" disabled />
335
- </Flex>
336
- <Flex direction="row" gap={2} className="w-40" justify="center">
337
- <IconButton variant="ghost" size="small" icon={<Plus />} aria-label="Ghost Small" />
338
- <IconButton variant="ghost" size="small" icon={<Plus />} aria-label="Ghost Small Disabled" disabled />
339
- </Flex>
340
- </Flex>
341
-
342
- {/* Mini Row */}
343
- <Flex direction="row" gap={0} align="center">
344
- <Typography variant="caption" className="text-neutral-500 w-20">Mini</Typography>
345
- <Flex direction="row" gap={2} className="w-40" justify="center">
346
- <IconButton variant="primary" size="mini" icon={<Plus />} aria-label="Primary Mini" />
347
- <IconButton variant="primary" size="mini" icon={<Plus />} aria-label="Primary Mini Disabled" disabled />
348
- </Flex>
349
- <Flex direction="row" gap={2} className="w-40" justify="center">
350
- <IconButton variant="secondary" size="mini" icon={<Plus />} aria-label="Secondary Mini" />
351
- <IconButton variant="secondary" size="mini" icon={<Plus />} aria-label="Secondary Mini Disabled" disabled />
352
- </Flex>
353
- <Flex direction="row" gap={2} className="w-40" justify="center">
354
- <IconButton variant="outline" size="mini" icon={<Plus />} aria-label="Outline Mini" />
355
- <IconButton variant="outline" size="mini" icon={<Plus />} aria-label="Outline Mini Disabled" disabled />
356
- </Flex>
357
- <Flex direction="row" gap={2} className="w-40" justify="center">
358
- <IconButton variant="ghost" size="mini" icon={<Plus />} aria-label="Ghost Mini" />
359
- <IconButton variant="ghost" size="mini" icon={<Plus />} aria-label="Ghost Mini Disabled" disabled />
360
- </Flex>
361
- </Flex>
362
- </Flex>
363
-
364
- {/* Round Section */}
365
- <Flex gap={2} className="mt-4">
366
- <Typography variant="body2" className="text-neutral-500 mb-1">Round</Typography>
367
-
368
- {/* Regular Row */}
369
- <Flex direction="row" gap={0} align="center">
370
- <Typography variant="caption" className="text-neutral-500 w-20">Regular</Typography>
371
- <Flex direction="row" gap={2} className="w-40" justify="center">
372
- <IconButton variant="primary" roundness="round" size="regular" icon={<Plus />} aria-label="Primary Regular Round" />
373
- <IconButton variant="primary" roundness="round" size="regular" icon={<Plus />} aria-label="Primary Regular Round Disabled" disabled />
374
- </Flex>
375
- <Flex direction="row" gap={2} className="w-40" justify="center">
376
- <IconButton variant="secondary" roundness="round" size="regular" icon={<Plus />} aria-label="Secondary Regular Round" />
377
- <IconButton variant="secondary" roundness="round" size="regular" icon={<Plus />} aria-label="Secondary Regular Round Disabled" disabled />
378
- </Flex>
379
- <Flex direction="row" gap={2} className="w-40" justify="center">
380
- <IconButton variant="outline" roundness="round" size="regular" icon={<Plus />} aria-label="Outline Regular Round" />
381
- <IconButton variant="outline" roundness="round" size="regular" icon={<Plus />} aria-label="Outline Regular Round Disabled" disabled />
382
- </Flex>
383
- <Flex direction="row" gap={2} className="w-40" justify="center">
384
- <IconButton variant="ghost" roundness="round" size="regular" icon={<Plus />} aria-label="Ghost Regular Round" />
385
- <IconButton variant="ghost" roundness="round" size="regular" icon={<Plus />} aria-label="Ghost Regular Round Disabled" disabled />
386
- </Flex>
387
- </Flex>
388
-
389
- {/* Large Row */}
390
- <Flex direction="row" gap={0} align="center">
391
- <Typography variant="caption" className="text-neutral-500 w-20">Large</Typography>
392
- <Flex direction="row" gap={2} className="w-40" justify="center">
393
- <IconButton variant="primary" roundness="round" size="large" icon={<Plus />} aria-label="Primary Large Round" />
394
- <IconButton variant="primary" roundness="round" size="large" icon={<Plus />} aria-label="Primary Large Round Disabled" disabled />
395
- </Flex>
396
- <Flex direction="row" gap={2} className="w-40" justify="center">
397
- <IconButton variant="secondary" roundness="round" size="large" icon={<Plus />} aria-label="Secondary Large Round" />
398
- <IconButton variant="secondary" roundness="round" size="large" icon={<Plus />} aria-label="Secondary Large Round Disabled" disabled />
399
- </Flex>
400
- <Flex direction="row" gap={2} className="w-40" justify="center">
401
- <IconButton variant="outline" roundness="round" size="large" icon={<Plus />} aria-label="Outline Large Round" />
402
- <IconButton variant="outline" roundness="round" size="large" icon={<Plus />} aria-label="Outline Large Round Disabled" disabled />
403
- </Flex>
404
- <Flex direction="row" gap={2} className="w-40" justify="center">
405
- <IconButton variant="ghost" roundness="round" size="large" icon={<Plus />} aria-label="Ghost Large Round" />
406
- <IconButton variant="ghost" roundness="round" size="large" icon={<Plus />} aria-label="Ghost Large Round Disabled" disabled />
407
- </Flex>
408
- </Flex>
409
-
410
- {/* Small Row */}
411
- <Flex direction="row" gap={0} align="center">
412
- <Typography variant="caption" className="text-neutral-500 w-20">Small</Typography>
413
- <Flex direction="row" gap={2} className="w-40" justify="center">
414
- <IconButton variant="primary" roundness="round" size="small" icon={<Plus />} aria-label="Primary Small Round" />
415
- <IconButton variant="primary" roundness="round" size="small" icon={<Plus />} aria-label="Primary Small Round Disabled" disabled />
416
- </Flex>
417
- <Flex direction="row" gap={2} className="w-40" justify="center">
418
- <IconButton variant="secondary" roundness="round" size="small" icon={<Plus />} aria-label="Secondary Small Round" />
419
- <IconButton variant="secondary" roundness="round" size="small" icon={<Plus />} aria-label="Secondary Small Round Disabled" disabled />
420
- </Flex>
421
- <Flex direction="row" gap={2} className="w-40" justify="center">
422
- <IconButton variant="outline" roundness="round" size="small" icon={<Plus />} aria-label="Outline Small Round" />
423
- <IconButton variant="outline" roundness="round" size="small" icon={<Plus />} aria-label="Outline Small Round Disabled" disabled />
424
- </Flex>
425
- <Flex direction="row" gap={2} className="w-40" justify="center">
426
- <IconButton variant="ghost" roundness="round" size="small" icon={<Plus />} aria-label="Ghost Small Round" />
427
- <IconButton variant="ghost" roundness="round" size="small" icon={<Plus />} aria-label="Ghost Small Round Disabled" disabled />
428
- </Flex>
429
- </Flex>
430
-
431
- {/* Mini Row */}
432
- <Flex direction="row" gap={0} align="center">
433
- <Typography variant="caption" className="text-neutral-500 w-20">Mini</Typography>
434
- <Flex direction="row" gap={2} className="w-40" justify="center">
435
- <IconButton variant="primary" roundness="round" size="mini" icon={<Plus />} aria-label="Primary Mini Round" />
436
- <IconButton variant="primary" roundness="round" size="mini" icon={<Plus />} aria-label="Primary Mini Round Disabled" disabled />
437
- </Flex>
438
- <Flex direction="row" gap={2} className="w-40" justify="center">
439
- <IconButton variant="secondary" roundness="round" size="mini" icon={<Plus />} aria-label="Secondary Mini Round" />
440
- <IconButton variant="secondary" roundness="round" size="mini" icon={<Plus />} aria-label="Secondary Mini Round Disabled" disabled />
441
- </Flex>
442
- <Flex direction="row" gap={2} className="w-40" justify="center">
443
- <IconButton variant="outline" roundness="round" size="mini" icon={<Plus />} aria-label="Outline Mini Round" />
444
- <IconButton variant="outline" roundness="round" size="mini" icon={<Plus />} aria-label="Outline Mini Round Disabled" disabled />
445
- </Flex>
446
- <Flex direction="row" gap={2} className="w-40" justify="center">
447
- <IconButton variant="ghost" roundness="round" size="mini" icon={<Plus />} aria-label="Ghost Mini Round" />
448
- <IconButton variant="ghost" roundness="round" size="mini" icon={<Plus />} aria-label="Ghost Mini Round Disabled" disabled />
449
- </Flex>
450
- </Flex>
451
- </Flex>
452
- </Flex>
453
-
454
- {/* Examples Section - matching Figma "Sizes" and "Round" */}
455
- <Flex gap={4}>
456
- <Typography variant="h4" className="text-white">Examples</Typography>
457
-
458
- <Flex direction="row" gap={16}>
459
- {/* Sizes Column */}
460
- <Flex gap={4}>
461
- <Typography variant="body2" className="text-neutral-400">Sizes</Typography>
462
- {/* Regular row */}
463
- <Flex direction="row" gap={3} align="center">
464
- <IconButton variant="primary" size="regular" icon={<Plus />} aria-label="Add" />
465
- <IconButton variant="secondary" size="regular" icon={<Pencil />} aria-label="Edit" />
466
- <IconButton variant="outline" size="regular" icon={<Filter />} aria-label="Filter" />
467
- <IconButton variant="ghost" size="regular" icon={<MoreVertical />} aria-label="More" />
468
- <IconButton variant="ghost" size="regular" icon={<MoreHorizontal />} aria-label="More" />
469
- <IconButton variant="outline" size="regular" icon={<Trash2 />} aria-label="Delete" className="text-red-500 border-red-500 hover:bg-red-50" />
470
- </Flex>
471
- {/* Large row */}
472
- <Flex direction="row" gap={3} align="center">
473
- <IconButton variant="primary" size="large" icon={<Plus />} aria-label="Add" />
474
- <IconButton variant="secondary" size="large" icon={<Pencil />} aria-label="Edit" />
475
- <IconButton variant="outline" size="large" icon={<Filter />} aria-label="Filter" />
476
- <IconButton variant="ghost" size="large" icon={<MoreVertical />} aria-label="More" />
477
- <IconButton variant="ghost" size="large" icon={<MoreHorizontal />} aria-label="More" />
478
- <IconButton variant="outline" size="large" icon={<Trash2 />} aria-label="Delete" className="text-red-500 border-red-500 hover:bg-red-50" />
479
- </Flex>
480
- {/* Small row */}
481
- <Flex direction="row" gap={3} align="center">
482
- <IconButton variant="primary" size="small" icon={<Plus />} aria-label="Add" />
483
- <IconButton variant="secondary" size="small" icon={<Pencil />} aria-label="Edit" />
484
- <IconButton variant="outline" size="small" icon={<Filter />} aria-label="Filter" />
485
- <IconButton variant="ghost" size="small" icon={<MoreVertical />} aria-label="More" />
486
- <IconButton variant="ghost" size="small" icon={<MoreHorizontal />} aria-label="More" />
487
- <IconButton variant="outline" size="small" icon={<Trash2 />} aria-label="Delete" className="text-red-500 border-red-500 hover:bg-red-50" />
488
- </Flex>
489
- {/* Mini row */}
490
- <Flex direction="row" gap={3} align="center">
491
- <IconButton variant="primary" size="mini" icon={<Plus />} aria-label="Add" />
492
- <IconButton variant="secondary" size="mini" icon={<Pencil />} aria-label="Edit" />
493
- <IconButton variant="outline" size="mini" icon={<Filter />} aria-label="Filter" />
494
- <IconButton variant="ghost" size="mini" icon={<MoreVertical />} aria-label="More" />
495
- <IconButton variant="ghost" size="mini" icon={<MoreHorizontal />} aria-label="More" />
496
- <IconButton variant="outline" size="mini" icon={<Trash2 />} aria-label="Delete" className="text-red-500 border-red-500 hover:bg-red-50" />
497
- </Flex>
498
- </Flex>
499
-
500
- {/* Round Column */}
501
- <Flex gap={4}>
502
- <Typography variant="body2" className="text-neutral-400">Round</Typography>
503
- {/* Regular row */}
504
- <Flex direction="row" gap={3} align="center">
505
- <IconButton variant="primary" roundness="round" size="regular" icon={<Plus />} aria-label="Add" />
506
- <IconButton variant="secondary" roundness="round" size="regular" icon={<Pencil />} aria-label="Edit" />
507
- <IconButton variant="outline" roundness="round" size="regular" icon={<Filter />} aria-label="Filter" />
508
- <IconButton variant="ghost" roundness="round" size="regular" icon={<MoreVertical />} aria-label="More" />
509
- <IconButton variant="ghost" roundness="round" size="regular" icon={<MoreHorizontal />} aria-label="More" />
510
- <IconButton variant="outline" roundness="round" size="regular" icon={<Trash2 />} aria-label="Delete" className="text-red-500 border-red-500 hover:bg-red-50" />
511
- </Flex>
512
- {/* Large row */}
513
- <Flex direction="row" gap={3} align="center">
514
- <IconButton variant="primary" roundness="round" size="large" icon={<Plus />} aria-label="Add" />
515
- <IconButton variant="secondary" roundness="round" size="large" icon={<Pencil />} aria-label="Edit" />
516
- <IconButton variant="outline" roundness="round" size="large" icon={<Filter />} aria-label="Filter" />
517
- <IconButton variant="ghost" roundness="round" size="large" icon={<MoreVertical />} aria-label="More" />
518
- <IconButton variant="ghost" roundness="round" size="large" icon={<MoreHorizontal />} aria-label="More" />
519
- <IconButton variant="outline" roundness="round" size="large" icon={<Trash2 />} aria-label="Delete" className="text-red-500 border-red-500 hover:bg-red-50" />
520
- </Flex>
521
- {/* Small row */}
522
- <Flex direction="row" gap={3} align="center">
523
- <IconButton variant="primary" roundness="round" size="small" icon={<Plus />} aria-label="Add" />
524
- <IconButton variant="secondary" roundness="round" size="small" icon={<Pencil />} aria-label="Edit" />
525
- <IconButton variant="outline" roundness="round" size="small" icon={<Filter />} aria-label="Filter" />
526
- <IconButton variant="ghost" roundness="round" size="small" icon={<MoreVertical />} aria-label="More" />
527
- <IconButton variant="ghost" roundness="round" size="small" icon={<MoreHorizontal />} aria-label="More" />
528
- <IconButton variant="outline" roundness="round" size="small" icon={<Trash2 />} aria-label="Delete" className="text-red-500 border-red-500 hover:bg-red-50" />
529
- </Flex>
530
- {/* Mini row */}
531
- <Flex direction="row" gap={3} align="center">
532
- <IconButton variant="primary" roundness="round" size="mini" icon={<Plus />} aria-label="Add" />
533
- <IconButton variant="secondary" roundness="round" size="mini" icon={<Pencil />} aria-label="Edit" />
534
- <IconButton variant="outline" roundness="round" size="mini" icon={<Filter />} aria-label="Filter" />
535
- <IconButton variant="ghost" roundness="round" size="mini" icon={<MoreVertical />} aria-label="More" />
536
- <IconButton variant="ghost" roundness="round" size="mini" icon={<MoreHorizontal />} aria-label="More" />
537
- <IconButton variant="outline" roundness="round" size="mini" icon={<Trash2 />} aria-label="Delete" className="text-red-500 border-red-500 hover:bg-red-50" />
538
- </Flex>
539
- </Flex>
540
- </Flex>
541
- </Flex>
542
- </Flex>
543
- ),
544
- parameters: {
545
- docs: {
546
- source: {
547
- code: `// Primary variants
548
- <IconButton variant="primary" icon={<Plus />} aria-label="Add" />
549
- <IconButton variant="primary" size="large" icon={<Plus />} aria-label="Add" />
550
- <IconButton variant="primary" roundness="round" icon={<Plus />} aria-label="Add" />
551
-
552
- // Secondary variants
553
- <IconButton variant="secondary" icon={<Pencil />} aria-label="Edit" />
554
-
555
- // Outline variants
556
- <IconButton variant="outline" icon={<Filter />} aria-label="Filter" />
557
-
558
- // Ghost variants
559
- <IconButton variant="ghost" icon={<MoreVertical />} aria-label="More" />
560
-
561
- // Disabled
562
- <IconButton disabled icon={<Plus />} aria-label="Add" />`,
563
- },
564
- },
565
- },
566
- }
@@ -1,95 +0,0 @@
1
- import * as React from "react"
2
- import { Slot } from "@radix-ui/react-slot"
3
- import { cva } from "class-variance-authority"
4
-
5
- import { cn } from "../lib/utils"
6
-
7
- type IconButtonVariant = "primary" | "secondary" | "outline" | "ghost"
8
- type IconButtonSize = "mini" | "small" | "regular" | "large"
9
- type IconButtonRoundness = "default" | "round"
10
-
11
- const iconButtonVariants = cva(
12
- "inline-flex items-center justify-center shrink-0 cursor-pointer transition-colors focus-visible:outline-none focus-visible:shadow-[0_0_0_3px_#d4d4d4] disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed [&_svg]:pointer-events-none [&_svg]:shrink-0",
13
- {
14
- variants: {
15
- variant: {
16
- primary: "bg-accent-600 text-white hover:bg-accent-700",
17
- secondary: "bg-main-100 text-main-950 hover:bg-main-200",
18
- outline:
19
- "border border-main-300 bg-transparent text-main-950 hover:bg-main-100",
20
- ghost: "bg-transparent text-main-600 hover:bg-main-100 hover:text-main-950",
21
- },
22
- size: {
23
- mini: "size-6 [&_svg]:size-3",
24
- small: "size-8 [&_svg]:size-4",
25
- regular: "size-9 [&_svg]:size-4",
26
- large: "size-10 [&_svg]:size-5",
27
- },
28
- roundness: {
29
- default: "rounded-lg",
30
- round: "rounded-full",
31
- },
32
- },
33
- compoundVariants: [
34
- {
35
- size: "mini",
36
- roundness: "default",
37
- className: "rounded-md",
38
- },
39
- {
40
- size: "small",
41
- roundness: "default",
42
- className: "rounded-md",
43
- },
44
- ],
45
- defaultVariants: {
46
- variant: "primary",
47
- size: "regular",
48
- roundness: "default",
49
- },
50
- }
51
- )
52
-
53
- export interface IconButtonProps
54
- extends React.ButtonHTMLAttributes<HTMLButtonElement> {
55
- variant?: IconButtonVariant
56
- size?: IconButtonSize
57
- roundness?: IconButtonRoundness
58
- /** Use the Slot component to render a different element */
59
- asChild?: boolean
60
- /** The icon to render inside the button */
61
- icon?: React.ReactNode
62
- /** Accessible label for screen readers */
63
- "aria-label": string
64
- }
65
-
66
- const IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(
67
- (
68
- {
69
- className,
70
- variant,
71
- size,
72
- roundness,
73
- asChild = false,
74
- icon,
75
- children,
76
- ...props
77
- },
78
- ref
79
- ) => {
80
- const Comp = asChild ? Slot : "button"
81
- return (
82
- <Comp
83
- className={cn(iconButtonVariants({ variant, size, roundness, className }))}
84
- ref={ref}
85
- {...props}
86
- >
87
- {icon || children}
88
- </Comp>
89
- )
90
- }
91
- )
92
- IconButton.displayName = "IconButton"
93
-
94
- export { IconButton, iconButtonVariants }
95
- export type { IconButtonVariant, IconButtonSize, IconButtonRoundness }