ui-arreya-components 0.0.16 → 0.1.2
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/dist/index.d.mts +342 -0
- package/dist/index.d.ts +342 -0
- package/dist/index.js +1682 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1495 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +61 -106
- package/.github/workflows/npm-publish.yml +0 -35
- package/.storybook/main.ts +0 -18
- package/.storybook/preview.ts +0 -16
- package/.storybook/vitest.setup.ts +0 -9
- package/README.md +0 -62
- package/components.json +0 -21
- package/dist/styles.css +0 -3
- package/dist/ui.cjs.js +0 -242
- package/dist/ui.es.js +0 -25142
- package/dist/ui.umd.js +0 -242
- package/eslint.config.js +0 -28
- package/postcss.config.js +0 -6
- package/scripts/build-index-ts.sh +0 -16
- package/scripts/template.sh +0 -57
- package/src/components/feature/graph-card.stories.tsx +0 -138
- package/src/components/feature/graph-card.tsx +0 -113
- package/src/components/feature/header.stories.tsx +0 -129
- package/src/components/feature/header.tsx +0 -78
- package/src/components/feature/login-form.stories.tsx +0 -35
- package/src/components/feature/login-form.tsx +0 -97
- package/src/components/feature/search-bar.stories.tsx +0 -35
- package/src/components/feature/search-bar.tsx +0 -141
- package/src/components/feature/wizard.stories.tsx +0 -199
- package/src/components/feature/wizard.tsx +0 -278
- package/src/components/ui/accordion.stories.tsx.disabled +0 -36
- package/src/components/ui/accordion.tsx +0 -55
- package/src/components/ui/alert-dialog.stories.tsx +0 -46
- package/src/components/ui/alert-dialog.tsx +0 -139
- package/src/components/ui/alert.stories.tsx +0 -45
- package/src/components/ui/alert.tsx +0 -59
- package/src/components/ui/aspect-ratio.stories.tsx +0 -24
- package/src/components/ui/aspect-ratio.tsx +0 -5
- package/src/components/ui/avatar.stories.tsx +0 -29
- package/src/components/ui/avatar.tsx +0 -48
- package/src/components/ui/badge.stories.tsx +0 -43
- package/src/components/ui/badge.tsx +0 -36
- package/src/components/ui/breadcrumb.stories.tsx +0 -146
- package/src/components/ui/breadcrumb.tsx +0 -115
- package/src/components/ui/button.stories.tsx +0 -87
- package/src/components/ui/button.tsx +0 -57
- package/src/components/ui/card.stories.tsx +0 -99
- package/src/components/ui/card.tsx +0 -76
- package/src/components/ui/carousel.stories.tsx +0 -47
- package/src/components/ui/carousel.tsx +0 -260
- package/src/components/ui/chart.stories.tsx.disabled +0 -44
- package/src/components/ui/chart.tsx +0 -363
- package/src/components/ui/checkbox.stories.tsx +0 -56
- package/src/components/ui/checkbox.tsx +0 -28
- package/src/components/ui/collapsible.stories.tsx +0 -58
- package/src/components/ui/collapsible.tsx +0 -9
- package/src/components/ui/context-menu.stories.tsx +0 -34
- package/src/components/ui/context-menu.tsx +0 -198
- package/src/components/ui/dialog.stories.tsx +0 -40
- package/src/components/ui/dialog.tsx +0 -120
- package/src/components/ui/drawer.stories.tsx +0 -48
- package/src/components/ui/drawer.tsx +0 -116
- package/src/components/ui/dropdown-menu.stories.tsx +0 -92
- package/src/components/ui/dropdown-menu.tsx +0 -199
- package/src/components/ui/form.tsx +0 -176
- package/src/components/ui/hover-card.stories.tsx +0 -31
- package/src/components/ui/hover-card.tsx +0 -27
- package/src/components/ui/input-otp.tsx +0 -69
- package/src/components/ui/input.stories.tsx +0 -63
- package/src/components/ui/input.tsx +0 -22
- package/src/components/ui/label.tsx +0 -24
- package/src/components/ui/menubar.tsx +0 -254
- package/src/components/ui/navigation-menu.tsx +0 -128
- package/src/components/ui/pagination.tsx +0 -117
- package/src/components/ui/popover.tsx +0 -31
- package/src/components/ui/progress.tsx +0 -26
- package/src/components/ui/radio-group.tsx +0 -42
- package/src/components/ui/resizable.tsx +0 -43
- package/src/components/ui/scroll-area.tsx +0 -46
- package/src/components/ui/select.tsx +0 -157
- package/src/components/ui/separator.tsx +0 -29
- package/src/components/ui/sheet.tsx +0 -138
- package/src/components/ui/sidebar.tsx +0 -771
- package/src/components/ui/skeleton.tsx +0 -15
- package/src/components/ui/slider.tsx +0 -26
- package/src/components/ui/sonner.tsx +0 -29
- package/src/components/ui/switch.tsx +0 -27
- package/src/components/ui/table.tsx +0 -120
- package/src/components/ui/tabs.tsx +0 -53
- package/src/components/ui/textarea.tsx +0 -22
- package/src/components/ui/toast.tsx +0 -127
- package/src/components/ui/toaster.tsx +0 -33
- package/src/components/ui/toggle-group.tsx +0 -59
- package/src/components/ui/toggle.tsx +0 -43
- package/src/components/ui/tooltip.tsx +0 -30
- package/src/hooks/use-mobile.tsx +0 -19
- package/src/hooks/use-toast.ts +0 -194
- package/src/index.css +0 -3633
- package/src/index.ts +0 -51
- package/src/lib/types.ts +0 -5
- package/src/lib/utils.ts +0 -6
- package/src/styles/tailwind.css +0 -100
- package/tailwind.config.js +0 -94
- package/tsconfig.app.json +0 -30
- package/tsconfig.json +0 -13
- package/tsconfig.node.json +0 -24
- package/vite.config.ts +0 -33
- package/vitest.workspace.ts +0 -32
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
|
|
3
|
-
import { cn } from "@/lib/utils"
|
|
4
|
-
|
|
5
|
-
const Card = React.forwardRef<
|
|
6
|
-
HTMLDivElement,
|
|
7
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
8
|
-
>(({ className, ...props }, ref) => (
|
|
9
|
-
<div
|
|
10
|
-
ref={ref}
|
|
11
|
-
className={cn(
|
|
12
|
-
"rounded-xl border bg-card text-card-foreground shadow",
|
|
13
|
-
className
|
|
14
|
-
)}
|
|
15
|
-
{...props}
|
|
16
|
-
/>
|
|
17
|
-
))
|
|
18
|
-
Card.displayName = "Card"
|
|
19
|
-
|
|
20
|
-
const CardHeader = React.forwardRef<
|
|
21
|
-
HTMLDivElement,
|
|
22
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
23
|
-
>(({ className, ...props }, ref) => (
|
|
24
|
-
<div
|
|
25
|
-
ref={ref}
|
|
26
|
-
className={cn("flex flex-col space-y-1.5 p-6", className)}
|
|
27
|
-
{...props}
|
|
28
|
-
/>
|
|
29
|
-
))
|
|
30
|
-
CardHeader.displayName = "CardHeader"
|
|
31
|
-
|
|
32
|
-
const CardTitle = React.forwardRef<
|
|
33
|
-
HTMLDivElement,
|
|
34
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
35
|
-
>(({ className, ...props }, ref) => (
|
|
36
|
-
<div
|
|
37
|
-
ref={ref}
|
|
38
|
-
className={cn("font-semibold leading-none tracking-tight", className)}
|
|
39
|
-
{...props}
|
|
40
|
-
/>
|
|
41
|
-
))
|
|
42
|
-
CardTitle.displayName = "CardTitle"
|
|
43
|
-
|
|
44
|
-
const CardDescription = React.forwardRef<
|
|
45
|
-
HTMLDivElement,
|
|
46
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
47
|
-
>(({ className, ...props }, ref) => (
|
|
48
|
-
<div
|
|
49
|
-
ref={ref}
|
|
50
|
-
className={cn("text-sm text-muted-foreground", className)}
|
|
51
|
-
{...props}
|
|
52
|
-
/>
|
|
53
|
-
))
|
|
54
|
-
CardDescription.displayName = "CardDescription"
|
|
55
|
-
|
|
56
|
-
const CardContent = React.forwardRef<
|
|
57
|
-
HTMLDivElement,
|
|
58
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
59
|
-
>(({ className, ...props }, ref) => (
|
|
60
|
-
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
|
|
61
|
-
))
|
|
62
|
-
CardContent.displayName = "CardContent"
|
|
63
|
-
|
|
64
|
-
const CardFooter = React.forwardRef<
|
|
65
|
-
HTMLDivElement,
|
|
66
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
67
|
-
>(({ className, ...props }, ref) => (
|
|
68
|
-
<div
|
|
69
|
-
ref={ref}
|
|
70
|
-
className={cn("flex items-center p-6 pt-0", className)}
|
|
71
|
-
{...props}
|
|
72
|
-
/>
|
|
73
|
-
))
|
|
74
|
-
CardFooter.displayName = "CardFooter"
|
|
75
|
-
|
|
76
|
-
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react"
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
Carousel,
|
|
5
|
-
CarouselContent,
|
|
6
|
-
CarouselItem,
|
|
7
|
-
CarouselNext,
|
|
8
|
-
CarouselPrevious
|
|
9
|
-
} from "./carousel"
|
|
10
|
-
import {
|
|
11
|
-
Card,
|
|
12
|
-
CardContent
|
|
13
|
-
} from './card'
|
|
14
|
-
|
|
15
|
-
const meta = {
|
|
16
|
-
title: "Components/Carousel",
|
|
17
|
-
component: Carousel,
|
|
18
|
-
parameters: {
|
|
19
|
-
layout: "centered",
|
|
20
|
-
},
|
|
21
|
-
tags: ["autodocs"],
|
|
22
|
-
} satisfies Meta<typeof Carousel>
|
|
23
|
-
|
|
24
|
-
export default meta
|
|
25
|
-
type Story = StoryObj<typeof meta>
|
|
26
|
-
|
|
27
|
-
export const Default: Story = {
|
|
28
|
-
render: () => (
|
|
29
|
-
<Carousel className="w-full max-w-xs">
|
|
30
|
-
<CarouselContent>
|
|
31
|
-
{[0,1,2,3,4].map((_, index) => (
|
|
32
|
-
<CarouselItem key={index}>
|
|
33
|
-
<div className="p-1">
|
|
34
|
-
<Card>
|
|
35
|
-
<CardContent className="flex aspect-square items-center justify-center p-6">
|
|
36
|
-
<span className="text-4xl font-semibold">{index + 1}</span>
|
|
37
|
-
</CardContent>
|
|
38
|
-
</Card>
|
|
39
|
-
</div>
|
|
40
|
-
</CarouselItem>
|
|
41
|
-
))}
|
|
42
|
-
</CarouselContent>
|
|
43
|
-
<CarouselPrevious />
|
|
44
|
-
<CarouselNext />
|
|
45
|
-
</Carousel>
|
|
46
|
-
)
|
|
47
|
-
}
|
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import useEmblaCarousel, {
|
|
3
|
-
type UseEmblaCarouselType,
|
|
4
|
-
} from "embla-carousel-react"
|
|
5
|
-
import { ArrowLeft, ArrowRight } from "lucide-react"
|
|
6
|
-
|
|
7
|
-
import { cn } from "@/lib/utils"
|
|
8
|
-
import { Button } from "@/components/ui/button"
|
|
9
|
-
|
|
10
|
-
type CarouselApi = UseEmblaCarouselType[1]
|
|
11
|
-
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>
|
|
12
|
-
type CarouselOptions = UseCarouselParameters[0]
|
|
13
|
-
type CarouselPlugin = UseCarouselParameters[1]
|
|
14
|
-
|
|
15
|
-
type CarouselProps = {
|
|
16
|
-
opts?: CarouselOptions
|
|
17
|
-
plugins?: CarouselPlugin
|
|
18
|
-
orientation?: "horizontal" | "vertical"
|
|
19
|
-
setApi?: (api: CarouselApi) => void
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
type CarouselContextProps = {
|
|
23
|
-
carouselRef: ReturnType<typeof useEmblaCarousel>[0]
|
|
24
|
-
api: ReturnType<typeof useEmblaCarousel>[1]
|
|
25
|
-
scrollPrev: () => void
|
|
26
|
-
scrollNext: () => void
|
|
27
|
-
canScrollPrev: boolean
|
|
28
|
-
canScrollNext: boolean
|
|
29
|
-
} & CarouselProps
|
|
30
|
-
|
|
31
|
-
const CarouselContext = React.createContext<CarouselContextProps | null>(null)
|
|
32
|
-
|
|
33
|
-
function useCarousel() {
|
|
34
|
-
const context = React.useContext(CarouselContext)
|
|
35
|
-
|
|
36
|
-
if (!context) {
|
|
37
|
-
throw new Error("useCarousel must be used within a <Carousel />")
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return context
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const Carousel = React.forwardRef<
|
|
44
|
-
HTMLDivElement,
|
|
45
|
-
React.HTMLAttributes<HTMLDivElement> & CarouselProps
|
|
46
|
-
>(
|
|
47
|
-
(
|
|
48
|
-
{
|
|
49
|
-
orientation = "horizontal",
|
|
50
|
-
opts,
|
|
51
|
-
setApi,
|
|
52
|
-
plugins,
|
|
53
|
-
className,
|
|
54
|
-
children,
|
|
55
|
-
...props
|
|
56
|
-
},
|
|
57
|
-
ref
|
|
58
|
-
) => {
|
|
59
|
-
const [carouselRef, api] = useEmblaCarousel(
|
|
60
|
-
{
|
|
61
|
-
...opts,
|
|
62
|
-
axis: orientation === "horizontal" ? "x" : "y",
|
|
63
|
-
},
|
|
64
|
-
plugins
|
|
65
|
-
)
|
|
66
|
-
const [canScrollPrev, setCanScrollPrev] = React.useState(false)
|
|
67
|
-
const [canScrollNext, setCanScrollNext] = React.useState(false)
|
|
68
|
-
|
|
69
|
-
const onSelect = React.useCallback((api: CarouselApi) => {
|
|
70
|
-
if (!api) {
|
|
71
|
-
return
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
setCanScrollPrev(api.canScrollPrev())
|
|
75
|
-
setCanScrollNext(api.canScrollNext())
|
|
76
|
-
}, [])
|
|
77
|
-
|
|
78
|
-
const scrollPrev = React.useCallback(() => {
|
|
79
|
-
api?.scrollPrev()
|
|
80
|
-
}, [api])
|
|
81
|
-
|
|
82
|
-
const scrollNext = React.useCallback(() => {
|
|
83
|
-
api?.scrollNext()
|
|
84
|
-
}, [api])
|
|
85
|
-
|
|
86
|
-
const handleKeyDown = React.useCallback(
|
|
87
|
-
(event: React.KeyboardEvent<HTMLDivElement>) => {
|
|
88
|
-
if (event.key === "ArrowLeft") {
|
|
89
|
-
event.preventDefault()
|
|
90
|
-
scrollPrev()
|
|
91
|
-
} else if (event.key === "ArrowRight") {
|
|
92
|
-
event.preventDefault()
|
|
93
|
-
scrollNext()
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
[scrollPrev, scrollNext]
|
|
97
|
-
)
|
|
98
|
-
|
|
99
|
-
React.useEffect(() => {
|
|
100
|
-
if (!api || !setApi) {
|
|
101
|
-
return
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
setApi(api)
|
|
105
|
-
}, [api, setApi])
|
|
106
|
-
|
|
107
|
-
React.useEffect(() => {
|
|
108
|
-
if (!api) {
|
|
109
|
-
return
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
onSelect(api)
|
|
113
|
-
api.on("reInit", onSelect)
|
|
114
|
-
api.on("select", onSelect)
|
|
115
|
-
|
|
116
|
-
return () => {
|
|
117
|
-
api?.off("select", onSelect)
|
|
118
|
-
}
|
|
119
|
-
}, [api, onSelect])
|
|
120
|
-
|
|
121
|
-
return (
|
|
122
|
-
<CarouselContext.Provider
|
|
123
|
-
value={{
|
|
124
|
-
carouselRef,
|
|
125
|
-
api: api,
|
|
126
|
-
opts,
|
|
127
|
-
orientation:
|
|
128
|
-
orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
|
|
129
|
-
scrollPrev,
|
|
130
|
-
scrollNext,
|
|
131
|
-
canScrollPrev,
|
|
132
|
-
canScrollNext,
|
|
133
|
-
}}
|
|
134
|
-
>
|
|
135
|
-
<div
|
|
136
|
-
ref={ref}
|
|
137
|
-
onKeyDownCapture={handleKeyDown}
|
|
138
|
-
className={cn("relative", className)}
|
|
139
|
-
role="region"
|
|
140
|
-
aria-roledescription="carousel"
|
|
141
|
-
{...props}
|
|
142
|
-
>
|
|
143
|
-
{children}
|
|
144
|
-
</div>
|
|
145
|
-
</CarouselContext.Provider>
|
|
146
|
-
)
|
|
147
|
-
}
|
|
148
|
-
)
|
|
149
|
-
Carousel.displayName = "Carousel"
|
|
150
|
-
|
|
151
|
-
const CarouselContent = React.forwardRef<
|
|
152
|
-
HTMLDivElement,
|
|
153
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
154
|
-
>(({ className, ...props }, ref) => {
|
|
155
|
-
const { carouselRef, orientation } = useCarousel()
|
|
156
|
-
|
|
157
|
-
return (
|
|
158
|
-
<div ref={carouselRef} className="overflow-hidden">
|
|
159
|
-
<div
|
|
160
|
-
ref={ref}
|
|
161
|
-
className={cn(
|
|
162
|
-
"flex",
|
|
163
|
-
orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
|
|
164
|
-
className
|
|
165
|
-
)}
|
|
166
|
-
{...props}
|
|
167
|
-
/>
|
|
168
|
-
</div>
|
|
169
|
-
)
|
|
170
|
-
})
|
|
171
|
-
CarouselContent.displayName = "CarouselContent"
|
|
172
|
-
|
|
173
|
-
const CarouselItem = React.forwardRef<
|
|
174
|
-
HTMLDivElement,
|
|
175
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
176
|
-
>(({ className, ...props }, ref) => {
|
|
177
|
-
const { orientation } = useCarousel()
|
|
178
|
-
|
|
179
|
-
return (
|
|
180
|
-
<div
|
|
181
|
-
ref={ref}
|
|
182
|
-
role="group"
|
|
183
|
-
aria-roledescription="slide"
|
|
184
|
-
className={cn(
|
|
185
|
-
"min-w-0 shrink-0 grow-0 basis-full",
|
|
186
|
-
orientation === "horizontal" ? "pl-4" : "pt-4",
|
|
187
|
-
className
|
|
188
|
-
)}
|
|
189
|
-
{...props}
|
|
190
|
-
/>
|
|
191
|
-
)
|
|
192
|
-
})
|
|
193
|
-
CarouselItem.displayName = "CarouselItem"
|
|
194
|
-
|
|
195
|
-
const CarouselPrevious = React.forwardRef<
|
|
196
|
-
HTMLButtonElement,
|
|
197
|
-
React.ComponentProps<typeof Button>
|
|
198
|
-
>(({ className, variant = "outline", size = "icon", ...props }, ref) => {
|
|
199
|
-
const { orientation, scrollPrev, canScrollPrev } = useCarousel()
|
|
200
|
-
|
|
201
|
-
return (
|
|
202
|
-
<Button
|
|
203
|
-
ref={ref}
|
|
204
|
-
variant={variant}
|
|
205
|
-
size={size}
|
|
206
|
-
className={cn(
|
|
207
|
-
"absolute h-8 w-8 rounded-full",
|
|
208
|
-
orientation === "horizontal"
|
|
209
|
-
? "-left-12 top-1/2 -translate-y-1/2"
|
|
210
|
-
: "-top-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
211
|
-
className
|
|
212
|
-
)}
|
|
213
|
-
disabled={!canScrollPrev}
|
|
214
|
-
onClick={scrollPrev}
|
|
215
|
-
{...props}
|
|
216
|
-
>
|
|
217
|
-
<ArrowLeft className="h-4 w-4" />
|
|
218
|
-
<span className="sr-only">Previous slide</span>
|
|
219
|
-
</Button>
|
|
220
|
-
)
|
|
221
|
-
})
|
|
222
|
-
CarouselPrevious.displayName = "CarouselPrevious"
|
|
223
|
-
|
|
224
|
-
const CarouselNext = React.forwardRef<
|
|
225
|
-
HTMLButtonElement,
|
|
226
|
-
React.ComponentProps<typeof Button>
|
|
227
|
-
>(({ className, variant = "outline", size = "icon", ...props }, ref) => {
|
|
228
|
-
const { orientation, scrollNext, canScrollNext } = useCarousel()
|
|
229
|
-
|
|
230
|
-
return (
|
|
231
|
-
<Button
|
|
232
|
-
ref={ref}
|
|
233
|
-
variant={variant}
|
|
234
|
-
size={size}
|
|
235
|
-
className={cn(
|
|
236
|
-
"absolute h-8 w-8 rounded-full",
|
|
237
|
-
orientation === "horizontal"
|
|
238
|
-
? "-right-12 top-1/2 -translate-y-1/2"
|
|
239
|
-
: "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
240
|
-
className
|
|
241
|
-
)}
|
|
242
|
-
disabled={!canScrollNext}
|
|
243
|
-
onClick={scrollNext}
|
|
244
|
-
{...props}
|
|
245
|
-
>
|
|
246
|
-
<ArrowRight className="h-4 w-4" />
|
|
247
|
-
<span className="sr-only">Next slide</span>
|
|
248
|
-
</Button>
|
|
249
|
-
)
|
|
250
|
-
})
|
|
251
|
-
CarouselNext.displayName = "CarouselNext"
|
|
252
|
-
|
|
253
|
-
export {
|
|
254
|
-
type CarouselApi,
|
|
255
|
-
Carousel,
|
|
256
|
-
CarouselContent,
|
|
257
|
-
CarouselItem,
|
|
258
|
-
CarouselPrevious,
|
|
259
|
-
CarouselNext,
|
|
260
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react"
|
|
2
|
-
import { Bar, BarChart, CartesianGrid, XAxis } from "recharts"
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
ChartContainer,
|
|
6
|
-
ChartTooltip,
|
|
7
|
-
ChartTooltipContent,
|
|
8
|
-
ChartLegend,
|
|
9
|
-
ChartLegendContent,
|
|
10
|
-
ChartStyle
|
|
11
|
-
} from "./chart"
|
|
12
|
-
|
|
13
|
-
const meta = {
|
|
14
|
-
title: "Components/ChartContainer",
|
|
15
|
-
component: ChartContainer,
|
|
16
|
-
parameters: {
|
|
17
|
-
layout: "centered",
|
|
18
|
-
},
|
|
19
|
-
tags: ["autodocs"],
|
|
20
|
-
} satisfies Meta<typeof ChartContainer>
|
|
21
|
-
|
|
22
|
-
export default meta
|
|
23
|
-
type Story = StoryObj<typeof meta>
|
|
24
|
-
|
|
25
|
-
export const Default: Story = {
|
|
26
|
-
args: {
|
|
27
|
-
data: [
|
|
28
|
-
{ month: "January", desktop: 186, mobile: 80 },
|
|
29
|
-
{ month: "February", desktop: 305, mobile: 200 },
|
|
30
|
-
{ month: "March", desktop: 237, mobile: 120 },
|
|
31
|
-
{ month: "April", desktop: 73, mobile: 190 },
|
|
32
|
-
{ month: "May", desktop: 209, mobile: 130 },
|
|
33
|
-
{ month: "June", desktop: 214, mobile: 140 },
|
|
34
|
-
]
|
|
35
|
-
},
|
|
36
|
-
render: (args) => (
|
|
37
|
-
<ChartContainer className="h-[200px] w-full">
|
|
38
|
-
<BarChart accessibilityLayer data={args.data}>
|
|
39
|
-
<CartesianGrid vertical={false} />
|
|
40
|
-
<Bar dataKey="mobile" fill="var(--color-mobile)" radius={4} />
|
|
41
|
-
</BarChart>
|
|
42
|
-
</ChartContainer>
|
|
43
|
-
)
|
|
44
|
-
}
|