@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,301 +0,0 @@
1
- import * as React from "react"
2
- import useEmblaCarousel, {
3
- type UseEmblaCarouselType,
4
- } from "embla-carousel-react"
5
- import { cva } from "class-variance-authority"
6
- import { ArrowLeft, ArrowRight } from "lucide-react"
7
-
8
- import { cn } from "../lib/utils"
9
- import { Button } from "../Button/Button"
10
-
11
- type CarouselApi = UseEmblaCarouselType[1]
12
- type UseCarouselParameters = Parameters<typeof useEmblaCarousel>
13
- type CarouselOptions = UseCarouselParameters[0]
14
- type CarouselPlugin = UseCarouselParameters[1]
15
-
16
- type CarouselOrientation = "horizontal" | "vertical"
17
-
18
- type CarouselContextProps = {
19
- carouselRef: ReturnType<typeof useEmblaCarousel>[0]
20
- api: ReturnType<typeof useEmblaCarousel>[1]
21
- scrollPrev: () => void
22
- scrollNext: () => void
23
- canScrollPrev: boolean
24
- canScrollNext: boolean
25
- } & CarouselProps
26
-
27
- const CarouselContext = React.createContext<CarouselContextProps | null>(null)
28
-
29
- function useCarousel() {
30
- const context = React.useContext(CarouselContext)
31
-
32
- if (!context) {
33
- throw new Error("useCarousel must be used within a <Carousel />")
34
- }
35
-
36
- return context
37
- }
38
-
39
- const carouselVariants = cva("relative", {
40
- variants: {
41
- orientation: {
42
- horizontal: "",
43
- vertical: "",
44
- },
45
- },
46
- defaultVariants: {
47
- orientation: "horizontal",
48
- },
49
- })
50
-
51
- const carouselContentVariants = cva("flex", {
52
- variants: {
53
- orientation: {
54
- horizontal: "-ml-4",
55
- vertical: "-mt-4 flex-col",
56
- },
57
- },
58
- defaultVariants: {
59
- orientation: "horizontal",
60
- },
61
- })
62
-
63
- const carouselItemVariants = cva("min-w-0 shrink-0 grow-0 basis-full", {
64
- variants: {
65
- orientation: {
66
- horizontal: "pl-4",
67
- vertical: "pt-4",
68
- },
69
- },
70
- defaultVariants: {
71
- orientation: "horizontal",
72
- },
73
- })
74
-
75
- interface CarouselProps {
76
- opts?: CarouselOptions
77
- plugins?: CarouselPlugin
78
- orientation?: CarouselOrientation
79
- setApi?: (api: CarouselApi) => void
80
- }
81
-
82
- const Carousel = React.forwardRef<
83
- HTMLDivElement,
84
- React.HTMLAttributes<HTMLDivElement> & CarouselProps
85
- >(
86
- (
87
- {
88
- orientation = "horizontal",
89
- opts,
90
- setApi,
91
- plugins,
92
- className,
93
- children,
94
- ...props
95
- },
96
- ref
97
- ) => {
98
- const [carouselRef, api] = useEmblaCarousel(
99
- {
100
- ...opts,
101
- axis: orientation === "horizontal" ? "x" : "y",
102
- },
103
- plugins
104
- )
105
- const [canScrollPrev, setCanScrollPrev] = React.useState(false)
106
- const [canScrollNext, setCanScrollNext] = React.useState(false)
107
-
108
- const onSelect = React.useCallback((api: CarouselApi) => {
109
- if (!api) {
110
- return
111
- }
112
-
113
- setCanScrollPrev(api.canScrollPrev())
114
- setCanScrollNext(api.canScrollNext())
115
- }, [])
116
-
117
- const scrollPrev = React.useCallback(() => {
118
- api?.scrollPrev()
119
- }, [api])
120
-
121
- const scrollNext = React.useCallback(() => {
122
- api?.scrollNext()
123
- }, [api])
124
-
125
- const handleKeyDown = React.useCallback(
126
- (event: React.KeyboardEvent<HTMLDivElement>) => {
127
- if (event.key === "ArrowLeft") {
128
- event.preventDefault()
129
- scrollPrev()
130
- } else if (event.key === "ArrowRight") {
131
- event.preventDefault()
132
- scrollNext()
133
- }
134
- },
135
- [scrollPrev, scrollNext]
136
- )
137
-
138
- React.useEffect(() => {
139
- if (!api || !setApi) {
140
- return
141
- }
142
-
143
- setApi(api)
144
- }, [api, setApi])
145
-
146
- React.useEffect(() => {
147
- if (!api) {
148
- return
149
- }
150
-
151
- onSelect(api)
152
- api.on("reInit", onSelect)
153
- api.on("select", onSelect)
154
-
155
- return () => {
156
- api?.off("select", onSelect)
157
- }
158
- }, [api, onSelect])
159
-
160
- return (
161
- <CarouselContext.Provider
162
- value={{
163
- carouselRef,
164
- api: api,
165
- opts,
166
- orientation:
167
- orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
168
- scrollPrev,
169
- scrollNext,
170
- canScrollPrev,
171
- canScrollNext,
172
- }}
173
- >
174
- <div
175
- ref={ref}
176
- onKeyDownCapture={handleKeyDown}
177
- className={cn(carouselVariants({ orientation }), className)}
178
- role="region"
179
- aria-roledescription="carousel"
180
- {...props}
181
- >
182
- {children}
183
- </div>
184
- </CarouselContext.Provider>
185
- )
186
- }
187
- )
188
- Carousel.displayName = "Carousel"
189
-
190
- const CarouselContent = React.forwardRef<
191
- HTMLDivElement,
192
- React.HTMLAttributes<HTMLDivElement>
193
- >(({ className, ...props }, ref) => {
194
- const { carouselRef, orientation } = useCarousel()
195
-
196
- return (
197
- <div ref={carouselRef} className="overflow-hidden">
198
- <div
199
- ref={ref}
200
- className={cn(carouselContentVariants({ orientation }), className)}
201
- {...props}
202
- />
203
- </div>
204
- )
205
- })
206
- CarouselContent.displayName = "CarouselContent"
207
-
208
- const CarouselItem = React.forwardRef<
209
- HTMLDivElement,
210
- React.HTMLAttributes<HTMLDivElement>
211
- >(({ className, ...props }, ref) => {
212
- const { orientation } = useCarousel()
213
-
214
- return (
215
- <div
216
- ref={ref}
217
- role="group"
218
- aria-roledescription="slide"
219
- className={cn(carouselItemVariants({ orientation }), className)}
220
- {...props}
221
- />
222
- )
223
- })
224
- CarouselItem.displayName = "CarouselItem"
225
-
226
- const CarouselPrevious = React.forwardRef<
227
- HTMLButtonElement,
228
- React.ComponentProps<typeof Button>
229
- >(({ className, variant = "outline", size = "small", ...props }, ref) => {
230
- const { orientation, scrollPrev, canScrollPrev } = useCarousel()
231
-
232
- return (
233
- <Button
234
- ref={ref}
235
- variant={variant}
236
- size={size}
237
- roundness="round"
238
- className={cn(
239
- "absolute h-8 w-8 p-0",
240
- orientation === "horizontal"
241
- ? "-left-12 top-1/2 -translate-y-1/2"
242
- : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
243
- className
244
- )}
245
- disabled={!canScrollPrev}
246
- onClick={scrollPrev}
247
- {...props}
248
- >
249
- <ArrowLeft className="h-4 w-4" />
250
- <span className="sr-only">Previous slide</span>
251
- </Button>
252
- )
253
- })
254
- CarouselPrevious.displayName = "CarouselPrevious"
255
-
256
- const CarouselNext = React.forwardRef<
257
- HTMLButtonElement,
258
- React.ComponentProps<typeof Button>
259
- >(({ className, variant = "outline", size = "small", ...props }, ref) => {
260
- const { orientation, scrollNext, canScrollNext } = useCarousel()
261
-
262
- return (
263
- <Button
264
- ref={ref}
265
- variant={variant}
266
- size={size}
267
- roundness="round"
268
- className={cn(
269
- "absolute h-8 w-8 p-0",
270
- orientation === "horizontal"
271
- ? "-right-12 top-1/2 -translate-y-1/2"
272
- : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
273
- className
274
- )}
275
- disabled={!canScrollNext}
276
- onClick={scrollNext}
277
- {...props}
278
- >
279
- <ArrowRight className="h-4 w-4" />
280
- <span className="sr-only">Next slide</span>
281
- </Button>
282
- )
283
- })
284
- CarouselNext.displayName = "CarouselNext"
285
-
286
- export {
287
- Carousel,
288
- CarouselContent,
289
- CarouselItem,
290
- CarouselPrevious,
291
- CarouselNext,
292
- carouselVariants,
293
- carouselContentVariants,
294
- carouselItemVariants,
295
- useCarousel,
296
- type CarouselApi,
297
- type CarouselProps,
298
- type CarouselOptions,
299
- type CarouselPlugin,
300
- type CarouselOrientation,
301
- }
@@ -1,339 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react"
2
- import { Flex } from "../Flex/Flex"
3
- import { Typography } from "../Typography/Typography"
4
- import { ChatBubble } from "./ChatBubble"
5
-
6
- const meta: Meta<typeof ChatBubble> = {
7
- title: "Components/ChatBubble",
8
- component: ChatBubble,
9
- parameters: {
10
- layout: "centered",
11
- backgrounds: {
12
- default: "dark",
13
- values: [
14
- { name: "dark", value: "#1a1a1a" },
15
- { name: "light", value: "#ffffff" },
16
- ],
17
- },
18
- },
19
- tags: ["autodocs"],
20
- argTypes: {
21
- side: {
22
- control: "select",
23
- options: ["left", "right"],
24
- description: "The side of the chat bubble",
25
- },
26
- color: {
27
- control: "select",
28
- options: ["blue", "grey", "green", "lightGrey"],
29
- description: "The color variant of the bubble",
30
- },
31
- theme: {
32
- control: "select",
33
- options: ["dark", "light"],
34
- description: "The theme variant",
35
- },
36
- size: {
37
- control: "select",
38
- options: ["small", "medium", "large", "xlarge"],
39
- description: "The text size of the bubble",
40
- },
41
- label: {
42
- control: "text",
43
- description: "Label shown above the bubble",
44
- },
45
- showLabel: {
46
- control: "boolean",
47
- description: "Whether to show the label",
48
- },
49
- },
50
- }
51
-
52
- export default meta
53
- type Story = StoryObj<typeof ChatBubble>
54
-
55
- export const Default: Story = {
56
- args: {
57
- side: "left",
58
- color: "blue",
59
- theme: "dark",
60
- label: "Your name",
61
- children: "Your message goes here",
62
- },
63
- decorators: [
64
- (Story) => (
65
- <Flex className="w-[400px]">
66
- <Story />
67
- </Flex>
68
- ),
69
- ],
70
- }
71
-
72
- export const RightSide: Story = {
73
- args: {
74
- side: "right",
75
- color: "blue",
76
- theme: "dark",
77
- label: "Your name",
78
- children: "Your message goes here",
79
- },
80
- decorators: [
81
- (Story) => (
82
- <Flex className="w-[400px]">
83
- <Story />
84
- </Flex>
85
- ),
86
- ],
87
- }
88
-
89
- export const Grey: Story = {
90
- args: {
91
- side: "left",
92
- color: "grey",
93
- theme: "dark",
94
- label: "Your name",
95
- children: "Your message goes here",
96
- },
97
- decorators: [
98
- (Story) => (
99
- <Flex className="w-[400px]">
100
- <Story />
101
- </Flex>
102
- ),
103
- ],
104
- }
105
-
106
- export const Green: Story = {
107
- args: {
108
- side: "left",
109
- color: "green",
110
- theme: "dark",
111
- label: "Your name",
112
- children: "Your message goes here",
113
- },
114
- decorators: [
115
- (Story) => (
116
- <Flex className="w-[400px]">
117
- <Story />
118
- </Flex>
119
- ),
120
- ],
121
- }
122
-
123
- export const LightTheme: Story = {
124
- args: {
125
- side: "left",
126
- color: "blue",
127
- theme: "light",
128
- label: "Your name",
129
- children: "Your message goes here",
130
- },
131
- parameters: {
132
- backgrounds: { default: "light" },
133
- },
134
- decorators: [
135
- (Story) => (
136
- <Flex className="w-[400px]">
137
- <Story />
138
- </Flex>
139
- ),
140
- ],
141
- }
142
-
143
- export const LightGrey: Story = {
144
- args: {
145
- side: "left",
146
- color: "lightGrey",
147
- theme: "light",
148
- label: "Your name",
149
- children: "Your message goes here",
150
- },
151
- parameters: {
152
- backgrounds: { default: "light" },
153
- },
154
- decorators: [
155
- (Story) => (
156
- <Flex className="w-[400px]">
157
- <Story />
158
- </Flex>
159
- ),
160
- ],
161
- }
162
-
163
- export const GreyLight: Story = {
164
- args: {
165
- side: "left",
166
- color: "grey",
167
- theme: "light",
168
- label: "Your name",
169
- children: "Your message goes here",
170
- },
171
- parameters: {
172
- backgrounds: { default: "light" },
173
- },
174
- decorators: [
175
- (Story) => (
176
- <Flex className="w-[400px]">
177
- <Story />
178
- </Flex>
179
- ),
180
- ],
181
- }
182
-
183
- export const NoLabel: Story = {
184
- args: {
185
- side: "left",
186
- color: "blue",
187
- theme: "dark",
188
- showLabel: false,
189
- children: "Message without a label",
190
- },
191
- decorators: [
192
- (Story) => (
193
- <Flex className="w-[400px]">
194
- <Story />
195
- </Flex>
196
- ),
197
- ],
198
- }
199
-
200
- export const LongMessage: Story = {
201
- args: {
202
- side: "left",
203
- color: "blue",
204
- theme: "dark",
205
- label: "Your name",
206
- children:
207
- "This is a longer message that demonstrates how the chat bubble handles multiple lines of text. The bubble should expand to accommodate the content while maintaining proper padding and border radius.",
208
- },
209
- decorators: [
210
- (Story) => (
211
- <Flex className="w-[400px]">
212
- <Story />
213
- </Flex>
214
- ),
215
- ],
216
- }
217
-
218
- // Conversation example
219
- export const Conversation: Story = {
220
- render: () => (
221
- <Flex gap={4} className="w-[400px]">
222
- <ChatBubble side="left" color="grey" theme="dark" label="Alice">
223
- Hey! How are you doing?
224
- </ChatBubble>
225
- <ChatBubble side="right" color="blue" theme="dark" label="You">
226
- I'm doing great, thanks for asking!
227
- </ChatBubble>
228
- <ChatBubble side="left" color="grey" theme="dark" label="Alice">
229
- That's wonderful to hear. Want to grab lunch later?
230
- </ChatBubble>
231
- <ChatBubble side="right" color="green" theme="dark" label="You">
232
- Sounds perfect! See you at noon.
233
- </ChatBubble>
234
- </Flex>
235
- ),
236
- }
237
-
238
- // All Variants
239
- export const AllVariants: Story = {
240
- render: () => (
241
- <Flex gap={8}>
242
- {/* Dark Theme */}
243
- <Flex gap={4}>
244
- <Typography variant="h4" className="text-white">Dark Theme</Typography>
245
- <Flex direction="row" gap={4}>
246
- {/* Left side variants */}
247
- <Flex gap={4}>
248
- <ChatBubble side="left" color="blue" theme="dark" label="Blue Left">
249
- Your message goes here
250
- </ChatBubble>
251
- <ChatBubble side="left" color="grey" theme="dark" label="Grey Left">
252
- Your message goes here
253
- </ChatBubble>
254
- <ChatBubble side="left" color="green" theme="dark" label="Green Left">
255
- Your message goes here
256
- </ChatBubble>
257
- <ChatBubble side="left" color="lightGrey" theme="dark" label="Light Grey Left">
258
- Your message goes here
259
- </ChatBubble>
260
- </Flex>
261
- {/* Right side variants */}
262
- <Flex gap={4}>
263
- <ChatBubble side="right" color="blue" theme="dark" label="Blue Right">
264
- Your message goes here
265
- </ChatBubble>
266
- <ChatBubble side="right" color="grey" theme="dark" label="Grey Right">
267
- Your message goes here
268
- </ChatBubble>
269
- <ChatBubble side="right" color="green" theme="dark" label="Green Right">
270
- Your message goes here
271
- </ChatBubble>
272
- <ChatBubble side="right" color="lightGrey" theme="dark" label="Light Grey Right">
273
- Your message goes here
274
- </ChatBubble>
275
- </Flex>
276
- </Flex>
277
- </Flex>
278
-
279
- {/* Light Theme */}
280
- <Flex gap={4} className="bg-white p-6 rounded-lg">
281
- <Typography variant="h4">Light Theme</Typography>
282
- <Flex direction="row" gap={4}>
283
- {/* Left side variants */}
284
- <Flex gap={4}>
285
- <ChatBubble side="left" color="blue" theme="light" label="Blue Left">
286
- Your message goes here
287
- </ChatBubble>
288
- <ChatBubble side="left" color="grey" theme="light" label="Grey Left">
289
- Your message goes here
290
- </ChatBubble>
291
- <ChatBubble side="left" color="green" theme="light" label="Green Left">
292
- Your message goes here
293
- </ChatBubble>
294
- <ChatBubble side="left" color="lightGrey" theme="light" label="Light Grey Left">
295
- Your message goes here
296
- </ChatBubble>
297
- </Flex>
298
- {/* Right side variants */}
299
- <Flex gap={4}>
300
- <ChatBubble side="right" color="blue" theme="light" label="Blue Right">
301
- Your message goes here
302
- </ChatBubble>
303
- <ChatBubble side="right" color="grey" theme="light" label="Grey Right">
304
- Your message goes here
305
- </ChatBubble>
306
- <ChatBubble side="right" color="green" theme="light" label="Green Right">
307
- Your message goes here
308
- </ChatBubble>
309
- <ChatBubble side="right" color="lightGrey" theme="light" label="Light Grey Right">
310
- Your message goes here
311
- </ChatBubble>
312
- </Flex>
313
- </Flex>
314
- </Flex>
315
-
316
- {/* Sizes */}
317
- <Flex gap={4}>
318
- <Typography variant="h4" className="text-white">Sizes</Typography>
319
- <Flex gap={2} className="w-[400px]">
320
- <ChatBubble side="left" color="blue" theme="dark" size="small" label="Small">
321
- Small text size
322
- </ChatBubble>
323
- <ChatBubble side="left" color="blue" theme="dark" size="medium" label="Medium">
324
- Medium text size
325
- </ChatBubble>
326
- <ChatBubble side="left" color="blue" theme="dark" size="large" label="Large">
327
- Large text size
328
- </ChatBubble>
329
- <ChatBubble side="left" color="blue" theme="dark" size="xlarge" label="XLarge">
330
- Extra large text size
331
- </ChatBubble>
332
- </Flex>
333
- </Flex>
334
- </Flex>
335
- ),
336
- parameters: {
337
- layout: "padded",
338
- },
339
- }