buildgrid-ui 1.1.0-alpha.4 → 1.1.0-dev.5
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/.storybook/main.ts +24 -25
- package/CHANGELOG.md +17 -0
- package/dist/buildgrid-ui.es.js +5259 -891
- package/dist/buildgrid-ui.umd.js +91 -11
- package/dist/components/adaptative-input/adaptative-input.d.ts +9 -0
- package/dist/components/adaptative-input/index.d.ts +1 -0
- package/dist/components/autocomplete/autocomplete.d.ts +14 -0
- package/dist/components/autocomplete/index.d.ts +1 -0
- package/dist/components/avatar/avatar.d.ts +6 -0
- package/dist/components/avatar/index.d.ts +1 -0
- package/dist/components/badge/index.d.ts +1 -1
- package/dist/components/button/{Button.d.ts → button.d.ts} +4 -3
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/card/index.d.ts +1 -1
- package/dist/components/checkbox/checkbox.d.ts +4 -0
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +27 -0
- package/dist/components/dropdown-menu/index.d.ts +1 -0
- package/dist/components/index.d.ts +7 -0
- package/dist/components/input/index.d.ts +1 -0
- package/dist/components/input/input.d.ts +9 -0
- package/dist/components/popover/index.d.ts +1 -0
- package/dist/components/popover/popover.d.ts +7 -0
- package/dist/components/skeleton/index.d.ts +1 -1
- package/dist/index.d.ts +7 -0
- package/package.json +7 -2
- package/src/components/adaptative-input/adaptative-input.stories.tsx +30 -0
- package/src/components/adaptative-input/adaptative-input.tsx +66 -0
- package/src/components/adaptative-input/index.ts +1 -0
- package/src/components/autocomplete/autocomplete.stories.tsx +85 -0
- package/src/components/autocomplete/autocomplete.tsx +136 -0
- package/src/components/autocomplete/index.ts +1 -0
- package/src/components/avatar/avatar.stories.tsx +29 -0
- package/src/components/avatar/avatar.tsx +48 -0
- package/src/components/avatar/index.ts +1 -0
- package/src/components/badge/{Badge.stories.tsx → badge.stories.tsx} +1 -1
- package/src/components/badge/index.ts +1 -1
- package/src/components/button/button.stories.tsx +62 -0
- package/src/components/button/button.tsx +82 -0
- package/src/components/button/index.ts +1 -1
- package/src/components/card/{Card.stories.tsx → card.stories.tsx} +1 -1
- package/src/components/card/index.ts +1 -1
- package/src/components/checkbox/checkbox.stories.tsx +36 -0
- package/src/components/checkbox/checkbox.tsx +28 -0
- package/src/components/checkbox/index.ts +1 -0
- package/src/components/dropdown-menu/dropdown-menu.stories.tsx +90 -0
- package/src/components/dropdown-menu/dropdown-menu.tsx +192 -0
- package/src/components/dropdown-menu/index.ts +1 -0
- package/src/components/index.ts +7 -0
- package/src/components/input/index.ts +1 -0
- package/src/components/input/input.stories.tsx +22 -0
- package/src/components/input/input.tsx +41 -0
- package/src/components/popover/index.ts +1 -0
- package/src/components/popover/popover.stories.tsx +32 -0
- package/src/components/popover/popover.tsx +30 -0
- package/src/components/skeleton/index.ts +1 -1
- package/src/index.ts +7 -0
- package/src/components/button/Button.stories.tsx +0 -40
- package/src/components/button/Button.tsx +0 -57
- /package/dist/components/badge/{Badge.d.ts → badge.d.ts} +0 -0
- /package/dist/components/card/{Card.d.ts → card.d.ts} +0 -0
- /package/dist/components/skeleton/{Skeleton.d.ts → skeleton.d.ts} +0 -0
- /package/src/components/badge/{Badge.tsx → badge.tsx} +0 -0
- /package/src/components/card/{Card.tsx → card.tsx} +0 -0
- /package/src/components/skeleton/{Skeleton.stories.tsx → skeleton.stories.tsx} +0 -0
- /package/src/components/skeleton/{Skeleton.tsx → skeleton.tsx} +0 -0
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
// organize-imports-ignore
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
4
|
-
import { Button, ButtonProps } from './Button'
|
|
5
|
-
|
|
6
|
-
const meta: Meta<typeof Button> = {
|
|
7
|
-
component: Button,
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export default meta
|
|
11
|
-
type Story = StoryObj<typeof Button>
|
|
12
|
-
|
|
13
|
-
const Template = (args: ButtonProps) => {
|
|
14
|
-
const variants: Array<ButtonProps['variant']> = [
|
|
15
|
-
'default',
|
|
16
|
-
'secondary',
|
|
17
|
-
'destructive',
|
|
18
|
-
'outline',
|
|
19
|
-
'ghost',
|
|
20
|
-
'link',
|
|
21
|
-
]
|
|
22
|
-
return (
|
|
23
|
-
<div className="flex gap-2">
|
|
24
|
-
{Object.values(variants).map((variant) => (
|
|
25
|
-
<Button
|
|
26
|
-
{...args}
|
|
27
|
-
variant={variant as ButtonProps['variant']}
|
|
28
|
-
className="capitalize"
|
|
29
|
-
>
|
|
30
|
-
{variant}
|
|
31
|
-
</Button>
|
|
32
|
-
))}
|
|
33
|
-
</div>
|
|
34
|
-
)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export const Default: Story = {
|
|
38
|
-
render: Template.bind({}),
|
|
39
|
-
args: {},
|
|
40
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
2
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import { cn } from "../../lib/utils/cn";
|
|
5
|
-
|
|
6
|
-
const buttonVariants = cva(
|
|
7
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
8
|
-
{
|
|
9
|
-
variants: {
|
|
10
|
-
variant: {
|
|
11
|
-
default:
|
|
12
|
-
"bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
13
|
-
destructive:
|
|
14
|
-
"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
15
|
-
outline:
|
|
16
|
-
"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
17
|
-
secondary:
|
|
18
|
-
"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
19
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
20
|
-
link: "text-primary underline-offset-4 hover:underline",
|
|
21
|
-
},
|
|
22
|
-
size: {
|
|
23
|
-
default: "h-9 px-4 py-2",
|
|
24
|
-
sm: "h-8 rounded-md px-3 text-xs",
|
|
25
|
-
lg: "h-10 rounded-md px-8",
|
|
26
|
-
xl: "h-12 rounded-md px-10 text-xl",
|
|
27
|
-
icon: "h-9 w-9",
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
defaultVariants: {
|
|
31
|
-
variant: "default",
|
|
32
|
-
size: "default",
|
|
33
|
-
},
|
|
34
|
-
}
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
export interface ButtonProps
|
|
38
|
-
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
39
|
-
VariantProps<typeof buttonVariants> {
|
|
40
|
-
asChild?: boolean;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
44
|
-
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
45
|
-
const Comp = asChild ? Slot : "button";
|
|
46
|
-
return (
|
|
47
|
-
<Comp
|
|
48
|
-
className={cn(buttonVariants({ variant, size, className }))}
|
|
49
|
-
ref={ref}
|
|
50
|
-
{...props}
|
|
51
|
-
/>
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
);
|
|
55
|
-
Button.displayName = "Button";
|
|
56
|
-
|
|
57
|
-
export { Button, buttonVariants };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|