@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,159 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react"
2
- import * as React from "react"
3
- import { ErrorMessage } from "./ErrorMessage"
4
- import { Input } from "../Input/Input"
5
- import { Label } from "../Label/Label"
6
- import { Flex } from "../Flex/Flex"
7
- import { Typography } from "../Typography/Typography"
8
-
9
- const meta: Meta<typeof ErrorMessage> = {
10
- title: "Components/ErrorMessage",
11
- component: ErrorMessage,
12
- parameters: {
13
- layout: "centered",
14
- },
15
- tags: ["autodocs"],
16
- argTypes: {
17
- name: {
18
- control: "text",
19
- description: "The field name to check for errors",
20
- },
21
- },
22
- }
23
-
24
- export default meta
25
- type Story = StoryObj<typeof ErrorMessage>
26
-
27
- export const Default: Story = {
28
- render: () => (
29
- <div className="w-72">
30
- <Label htmlFor="email">Email</Label>
31
- <Input id="email" placeholder="Enter email" className="border-error-500" />
32
- <ErrorMessage
33
- name="email"
34
- errors={{ email: "Please enter a valid email address" }}
35
- />
36
- </div>
37
- ),
38
- }
39
-
40
- export const WithTouched: Story = {
41
- render: () => (
42
- <Flex gap={4} className="w-72">
43
- <div>
44
- <Label htmlFor="username">Username (touched)</Label>
45
- <Input id="username" placeholder="Enter username" className="border-error-500" />
46
- <ErrorMessage
47
- name="username"
48
- errors={{ username: "Username is required" }}
49
- touched={{ username: true }}
50
- />
51
- </div>
52
- <div>
53
- <Label htmlFor="password">Password (not touched - no error shown)</Label>
54
- <Input id="password" type="password" placeholder="Enter password" />
55
- <ErrorMessage
56
- name="password"
57
- errors={{ password: "Password is required" }}
58
- touched={{ password: false }}
59
- />
60
- </div>
61
- </Flex>
62
- ),
63
- }
64
-
65
- export const NoError: Story = {
66
- render: () => (
67
- <div className="w-72">
68
- <Label htmlFor="name">Name</Label>
69
- <Input id="name" placeholder="Enter name" />
70
- <ErrorMessage
71
- name="name"
72
- errors={{}}
73
- />
74
- <Typography variant="caption" color="grey-500" className="mt-2">
75
- No error message shown when field has no errors
76
- </Typography>
77
- </div>
78
- ),
79
- }
80
-
81
- export const FormExample: Story = {
82
- render: () => {
83
- const [errors] = React.useState({
84
- email: "Please enter a valid email address",
85
- password: "Password must be at least 8 characters",
86
- })
87
- const [touched] = React.useState({
88
- email: true,
89
- password: true,
90
- })
91
-
92
- return (
93
- <Flex gap={4} className="w-80">
94
- <Typography variant="h4">Sign Up Form</Typography>
95
- <div>
96
- <Label htmlFor="form-email">Email</Label>
97
- <Input
98
- id="form-email"
99
- type="email"
100
- placeholder="you@example.com"
101
- className={touched.email && errors.email ? "border-error-500 focus-visible:ring-error-500" : ""}
102
- />
103
- <ErrorMessage name="email" errors={errors} touched={touched} />
104
- </div>
105
- <div>
106
- <Label htmlFor="form-password">Password</Label>
107
- <Input
108
- id="form-password"
109
- type="password"
110
- placeholder="••••••••"
111
- className={touched.password && errors.password ? "border-error-500 focus-visible:ring-error-500" : ""}
112
- />
113
- <ErrorMessage name="password" errors={errors} touched={touched} />
114
- </div>
115
- </Flex>
116
- )
117
- },
118
- }
119
-
120
- export const AllVariants: Story = {
121
- render: () => (
122
- <Flex gap={6} className="w-80">
123
- <div>
124
- <Typography variant="h4" className="mb-4">Error Message Examples</Typography>
125
- </div>
126
-
127
- <div>
128
- <Typography variant="body2" color="grey-600" className="mb-2">Basic Error</Typography>
129
- <Label htmlFor="v1">Field with error</Label>
130
- <Input id="v1" className="border-error-500" />
131
- <ErrorMessage name="field" errors={{ field: "This field is required" }} />
132
- </div>
133
-
134
- <div>
135
- <Typography variant="body2" color="grey-600" className="mb-2">Long Error Message</Typography>
136
- <Label htmlFor="v2">Email</Label>
137
- <Input id="v2" className="border-error-500" />
138
- <ErrorMessage
139
- name="email"
140
- errors={{ email: "The email address you entered is not valid. Please check the format and try again." }}
141
- />
142
- </div>
143
-
144
- <div>
145
- <Typography variant="body2" color="grey-600" className="mb-2">With Custom Class</Typography>
146
- <Label htmlFor="v3">Username</Label>
147
- <Input id="v3" className="border-error-500" />
148
- <ErrorMessage
149
- name="username"
150
- errors={{ username: "Username already taken" }}
151
- className="font-medium"
152
- />
153
- </div>
154
- </Flex>
155
- ),
156
- parameters: {
157
- layout: "padded",
158
- },
159
- }
@@ -1,55 +0,0 @@
1
- import * as React from "react"
2
- import { Typography, type TypographyColor } from "../Typography/Typography"
3
- import { cn } from "../lib/utils"
4
-
5
- export interface ErrorMessageProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "color"> {
6
- /**
7
- * The field name to check for errors
8
- */
9
- name: string
10
- /**
11
- * Object containing error messages keyed by field name
12
- */
13
- errors: Record<string, string | undefined>
14
- /**
15
- * Optional object containing touched state keyed by field name
16
- * If provided, error is only shown when field is touched
17
- */
18
- touched?: Record<string, boolean | undefined>
19
- /**
20
- * Color variant for the error message
21
- * @default "error-600"
22
- */
23
- color?: TypographyColor
24
- }
25
-
26
- function ErrorMessage({
27
- name,
28
- errors,
29
- touched,
30
- className,
31
- color = "error-600",
32
- ...props
33
- }: ErrorMessageProps) {
34
- const hasError = errors && typeof errors[name] === "string"
35
- const shouldShow = touched ? hasError && touched[name] : hasError
36
-
37
- if (!shouldShow) {
38
- return null
39
- }
40
-
41
- return (
42
- <Typography
43
- variant="caption"
44
- color={color}
45
- className={cn("mt-1", className)}
46
- {...props}
47
- >
48
- {errors[name]}
49
- </Typography>
50
- )
51
- }
52
-
53
- ErrorMessage.displayName = "ErrorMessage"
54
-
55
- export { ErrorMessage }
@@ -1,390 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react"
2
- import { Typography } from "../Typography/Typography"
3
- import { Flex } from "./Flex"
4
-
5
- const meta: Meta<typeof Flex> = {
6
- title: "Layout/Flex",
7
- component: Flex,
8
- parameters: {
9
- layout: "centered",
10
- },
11
- tags: ["autodocs"],
12
- argTypes: {
13
- direction: {
14
- control: "select",
15
- options: ["row", "column", "row-reverse", "column-reverse"],
16
- description: "The flex direction",
17
- },
18
- align: {
19
- control: "select",
20
- options: ["start", "center", "end", "stretch", "baseline"],
21
- description: "Align items (cross axis)",
22
- },
23
- justify: {
24
- control: "select",
25
- options: ["start", "center", "end", "between", "around", "evenly"],
26
- description: "Justify content (main axis)",
27
- },
28
- wrap: {
29
- control: "select",
30
- options: ["nowrap", "wrap", "wrap-reverse"],
31
- description: "Flex wrap behavior",
32
- },
33
- gap: {
34
- control: "select",
35
- options: [0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24, 32, 40, 48],
36
- description: "Gap between items",
37
- },
38
- },
39
- }
40
-
41
- export default meta
42
- type Story = StoryObj<typeof Flex>
43
-
44
- const Box = ({ children, className = "" }: { children?: React.ReactNode; className?: string }) => (
45
- <div className={`bg-accent-100 border border-accent-300 rounded-md p-4 text-accent-700 font-medium ${className}`}>
46
- {children}
47
- </div>
48
- )
49
-
50
- export const Default: Story = {
51
- args: {
52
- direction: "column",
53
- align: "stretch",
54
- justify: "start",
55
- gap: 4,
56
- },
57
- render: (args) => (
58
- <Flex {...args} className="w-64">
59
- <Box>Item 1</Box>
60
- <Box>Item 2</Box>
61
- <Box>Item 3</Box>
62
- </Flex>
63
- ),
64
- }
65
-
66
- export const Row: Story = {
67
- render: () => (
68
- <Flex direction="row" gap={4}>
69
- <Box>Item 1</Box>
70
- <Box>Item 2</Box>
71
- <Box>Item 3</Box>
72
- </Flex>
73
- ),
74
- }
75
-
76
- export const Column: Story = {
77
- render: () => (
78
- <Flex direction="column" gap={4}>
79
- <Box>Item 1</Box>
80
- <Box>Item 2</Box>
81
- <Box>Item 3</Box>
82
- </Flex>
83
- ),
84
- }
85
-
86
- export const RowReverse: Story = {
87
- render: () => (
88
- <Flex direction="row-reverse" gap={4}>
89
- <Box>Item 1</Box>
90
- <Box>Item 2</Box>
91
- <Box>Item 3</Box>
92
- </Flex>
93
- ),
94
- }
95
-
96
- export const ColumnReverse: Story = {
97
- render: () => (
98
- <Flex direction="column-reverse" gap={4}>
99
- <Box>Item 1</Box>
100
- <Box>Item 2</Box>
101
- <Box>Item 3</Box>
102
- </Flex>
103
- ),
104
- }
105
-
106
- export const AlignStart: Story = {
107
- render: () => (
108
- <Flex direction="row" align="start" gap={4} className="h-32 bg-main-50 p-4 rounded-lg">
109
- <Box>Short</Box>
110
- <Box className="h-full">Tall</Box>
111
- <Box>Short</Box>
112
- </Flex>
113
- ),
114
- }
115
-
116
- export const AlignCenter: Story = {
117
- render: () => (
118
- <Flex direction="row" align="center" gap={4} className="h-32 bg-main-50 p-4 rounded-lg">
119
- <Box>Short</Box>
120
- <Box className="h-full">Tall</Box>
121
- <Box>Short</Box>
122
- </Flex>
123
- ),
124
- }
125
-
126
- export const AlignEnd: Story = {
127
- render: () => (
128
- <Flex direction="row" align="end" gap={4} className="h-32 bg-main-50 p-4 rounded-lg">
129
- <Box>Short</Box>
130
- <Box className="h-full">Tall</Box>
131
- <Box>Short</Box>
132
- </Flex>
133
- ),
134
- }
135
-
136
- export const AlignStretch: Story = {
137
- render: () => (
138
- <Flex direction="row" align="stretch" gap={4} className="h-32 bg-main-50 p-4 rounded-lg">
139
- <Box>Item 1</Box>
140
- <Box>Item 2</Box>
141
- <Box>Item 3</Box>
142
- </Flex>
143
- ),
144
- }
145
-
146
- export const JustifyStart: Story = {
147
- render: () => (
148
- <Flex direction="row" justify="start" gap={4} className="w-96 bg-main-50 p-4 rounded-lg">
149
- <Box>1</Box>
150
- <Box>2</Box>
151
- <Box>3</Box>
152
- </Flex>
153
- ),
154
- }
155
-
156
- export const JustifyCenter: Story = {
157
- render: () => (
158
- <Flex direction="row" justify="center" gap={4} className="w-96 bg-main-50 p-4 rounded-lg">
159
- <Box>1</Box>
160
- <Box>2</Box>
161
- <Box>3</Box>
162
- </Flex>
163
- ),
164
- }
165
-
166
- export const JustifyEnd: Story = {
167
- render: () => (
168
- <Flex direction="row" justify="end" gap={4} className="w-96 bg-main-50 p-4 rounded-lg">
169
- <Box>1</Box>
170
- <Box>2</Box>
171
- <Box>3</Box>
172
- </Flex>
173
- ),
174
- }
175
-
176
- export const JustifyBetween: Story = {
177
- render: () => (
178
- <Flex direction="row" justify="between" className="w-96 bg-main-50 p-4 rounded-lg">
179
- <Box>1</Box>
180
- <Box>2</Box>
181
- <Box>3</Box>
182
- </Flex>
183
- ),
184
- }
185
-
186
- export const JustifyAround: Story = {
187
- render: () => (
188
- <Flex direction="row" justify="around" className="w-96 bg-main-50 p-4 rounded-lg">
189
- <Box>1</Box>
190
- <Box>2</Box>
191
- <Box>3</Box>
192
- </Flex>
193
- ),
194
- }
195
-
196
- export const JustifyEvenly: Story = {
197
- render: () => (
198
- <Flex direction="row" justify="evenly" className="w-96 bg-main-50 p-4 rounded-lg">
199
- <Box>1</Box>
200
- <Box>2</Box>
201
- <Box>3</Box>
202
- </Flex>
203
- ),
204
- }
205
-
206
- export const WrapEnabled: Story = {
207
- render: () => (
208
- <Flex direction="row" wrap="wrap" gap={4} className="w-64 bg-main-50 p-4 rounded-lg">
209
- <Box>Item 1</Box>
210
- <Box>Item 2</Box>
211
- <Box>Item 3</Box>
212
- <Box>Item 4</Box>
213
- <Box>Item 5</Box>
214
- <Box>Item 6</Box>
215
- </Flex>
216
- ),
217
- }
218
-
219
- export const GapSizes: Story = {
220
- render: () => (
221
- <Flex gap={8}>
222
- <Typography variant="subtitle1" color="main-700">Gap Sizes</Typography>
223
-
224
- <Flex gap={4}>
225
- <Typography variant="body2" color="main-500">gap={0}</Typography>
226
- <Flex direction="row" gap={0} className="bg-main-50 p-2 rounded-lg">
227
- <Box>1</Box>
228
- <Box>2</Box>
229
- <Box>3</Box>
230
- </Flex>
231
- </Flex>
232
-
233
- <Flex gap={4}>
234
- <Typography variant="body2" color="main-500">gap={2}</Typography>
235
- <Flex direction="row" gap={2} className="bg-main-50 p-2 rounded-lg">
236
- <Box>1</Box>
237
- <Box>2</Box>
238
- <Box>3</Box>
239
- </Flex>
240
- </Flex>
241
-
242
- <Flex gap={4}>
243
- <Typography variant="body2" color="main-500">gap={4}</Typography>
244
- <Flex direction="row" gap={4} className="bg-main-50 p-2 rounded-lg">
245
- <Box>1</Box>
246
- <Box>2</Box>
247
- <Box>3</Box>
248
- </Flex>
249
- </Flex>
250
-
251
- <Flex gap={4}>
252
- <Typography variant="body2" color="main-500">gap={8}</Typography>
253
- <Flex direction="row" gap={8} className="bg-main-50 p-2 rounded-lg">
254
- <Box>1</Box>
255
- <Box>2</Box>
256
- <Box>3</Box>
257
- </Flex>
258
- </Flex>
259
- </Flex>
260
- ),
261
- }
262
-
263
- export const CenteredContent: Story = {
264
- render: () => (
265
- <Flex
266
- direction="row"
267
- align="center"
268
- justify="center"
269
- className="w-96 h-48 bg-main-50 rounded-lg border-2 border-dashed border-main-300"
270
- >
271
- <Box>Centered Content</Box>
272
- </Flex>
273
- ),
274
- }
275
-
276
- export const Navbar: Story = {
277
- render: () => (
278
- <Flex
279
- direction="row"
280
- align="center"
281
- justify="between"
282
- className="w-full max-w-2xl bg-main-900 text-white px-6 py-3 rounded-lg"
283
- >
284
- <Typography variant="h6" className="text-white">Logo</Typography>
285
- <Flex direction="row" gap={6}>
286
- <Typography variant="body2" className="text-main-300 hover:text-white cursor-pointer">Home</Typography>
287
- <Typography variant="body2" className="text-main-300 hover:text-white cursor-pointer">About</Typography>
288
- <Typography variant="body2" className="text-main-300 hover:text-white cursor-pointer">Contact</Typography>
289
- </Flex>
290
- <Box className="bg-accent-500 border-accent-600 text-white text-sm py-2">Sign In</Box>
291
- </Flex>
292
- ),
293
- }
294
-
295
- export const CardLayout: Story = {
296
- render: () => (
297
- <Flex direction="row" wrap="wrap" gap={4} className="max-w-xl">
298
- {[1, 2, 3, 4, 5, 6].map((i) => (
299
- <Flex
300
- key={i}
301
- gap={2}
302
- className="w-40 bg-white border border-main-200 rounded-lg p-4 shadow-sm"
303
- >
304
- <div className="w-full h-20 bg-main-100 rounded-md" />
305
- <Typography variant="subtitle2">Card {i}</Typography>
306
- <Typography variant="body3" color="main-500">Description text</Typography>
307
- </Flex>
308
- ))}
309
- </Flex>
310
- ),
311
- }
312
-
313
- export const AllVariants: Story = {
314
- render: () => (
315
- <Flex gap={12}>
316
- {/* Direction */}
317
- <Flex gap={4}>
318
- <Typography variant="subtitle1" color="main-700">Direction</Typography>
319
- <Flex direction="row" gap={8} wrap="wrap">
320
- <Flex gap={2}>
321
- <Typography variant="body3" color="main-500">row</Typography>
322
- <Flex direction="row" gap={2} className="bg-main-50 p-3 rounded-lg">
323
- <Box className="text-xs py-2 px-3">1</Box>
324
- <Box className="text-xs py-2 px-3">2</Box>
325
- <Box className="text-xs py-2 px-3">3</Box>
326
- </Flex>
327
- </Flex>
328
- <Flex gap={2}>
329
- <Typography variant="body3" color="main-500">column</Typography>
330
- <Flex direction="column" gap={2} className="bg-main-50 p-3 rounded-lg">
331
- <Box className="text-xs py-2 px-3">1</Box>
332
- <Box className="text-xs py-2 px-3">2</Box>
333
- <Box className="text-xs py-2 px-3">3</Box>
334
- </Flex>
335
- </Flex>
336
- <Flex gap={2}>
337
- <Typography variant="body3" color="main-500">row-reverse</Typography>
338
- <Flex direction="row-reverse" gap={2} className="bg-main-50 p-3 rounded-lg">
339
- <Box className="text-xs py-2 px-3">1</Box>
340
- <Box className="text-xs py-2 px-3">2</Box>
341
- <Box className="text-xs py-2 px-3">3</Box>
342
- </Flex>
343
- </Flex>
344
- <Flex gap={2}>
345
- <Typography variant="body3" color="main-500">column-reverse</Typography>
346
- <Flex direction="column-reverse" gap={2} className="bg-main-50 p-3 rounded-lg">
347
- <Box className="text-xs py-2 px-3">1</Box>
348
- <Box className="text-xs py-2 px-3">2</Box>
349
- <Box className="text-xs py-2 px-3">3</Box>
350
- </Flex>
351
- </Flex>
352
- </Flex>
353
- </Flex>
354
-
355
- {/* Alignment */}
356
- <Flex gap={4}>
357
- <Typography variant="subtitle1" color="main-700">Align Items</Typography>
358
- <Flex direction="row" gap={8} wrap="wrap">
359
- {(["start", "center", "end", "stretch"] as const).map((alignment) => (
360
- <Flex key={alignment} gap={2}>
361
- <Typography variant="body3" color="main-500">{alignment}</Typography>
362
- <Flex direction="row" align={alignment} gap={2} className="h-24 bg-main-50 p-3 rounded-lg">
363
- <Box className="text-xs py-2 px-3">A</Box>
364
- <Box className="text-xs py-4 px-3">B</Box>
365
- <Box className="text-xs py-2 px-3">C</Box>
366
- </Flex>
367
- </Flex>
368
- ))}
369
- </Flex>
370
- </Flex>
371
-
372
- {/* Justify */}
373
- <Flex gap={4}>
374
- <Typography variant="subtitle1" color="main-700">Justify Content</Typography>
375
- <Flex gap={4}>
376
- {(["start", "center", "end", "between", "around", "evenly"] as const).map((justification) => (
377
- <Flex key={justification} gap={2}>
378
- <Typography variant="body3" color="main-500">{justification}</Typography>
379
- <Flex direction="row" justify={justification} className="w-80 bg-main-50 p-3 rounded-lg">
380
- <Box className="text-xs py-2 px-3">1</Box>
381
- <Box className="text-xs py-2 px-3">2</Box>
382
- <Box className="text-xs py-2 px-3">3</Box>
383
- </Flex>
384
- </Flex>
385
- ))}
386
- </Flex>
387
- </Flex>
388
- </Flex>
389
- ),
390
- }