linkedunion-design-kit 1.6.2 → 1.6.4
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/app/page.js +2 -3
- package/dist/index.d.ts +10 -5
- package/dist/index.js +10 -5
- package/dist/src/components/Button/Button.d.ts +45 -3
- package/dist/src/components/Button/Button.js +77 -6
- package/dist/src/components/Button/Button.stories.d.ts +124 -5
- package/dist/src/components/Button/Button.stories.js +236 -51
- package/dist/src/components/Button/Button.test.js +2 -54
- package/dist/src/components/Button/IconButton.d.ts +33 -3
- package/dist/src/components/Button/IconButton.js +54 -5
- package/dist/src/components/Button/IconButton.stories.js +24 -12
- package/dist/src/components/Button/IconButton.test.js +7 -9
- package/dist/src/components/Button/index.d.ts +0 -7
- package/dist/src/components/Button/index.js +8 -15
- package/dist/src/components/Button/type.d.ts +0 -22
- package/dist/src/components/Button/type.js +25 -1
- package/dist/src/components/Checkbox/checkbox.stories.js +2 -2
- package/dist/src/components/ColorPicker/ColorPicker.js +6 -1
- package/dist/src/components/EditorTooltip/EditorTooltip.js +2 -3
- package/dist/src/components/Icons/LUIcon.d.ts +1 -1
- package/dist/src/components/Icons/LUIcon.js +10 -4
- package/dist/src/components/Icons/LUIcon.stories.d.ts +3 -1
- package/dist/src/components/Icons/LUIcon.stories.js +51 -20
- package/dist/src/components/Icons/index.d.ts +64 -1
- package/dist/src/components/Icons/index.js +84 -14
- package/dist/src/components/Icons/type.d.ts +7 -3
- package/dist/src/components/ImageUploader/ImageUploader.stories.d.ts +1 -1
- package/dist/src/components/ImageUploader/ImageUploader.stories.js +1 -1
- package/dist/src/components/ImageUploader/imageUploader.d.ts +3 -0
- package/dist/src/components/ImageUploader/imageUploader.js +68 -0
- package/dist/src/components/Label/Label.d.ts +14 -3
- package/dist/src/components/Label/Label.js +19 -5
- package/dist/src/components/Label/Label.stories.d.ts +1 -2
- package/dist/src/components/Label/Label.stories.js +10 -4
- package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme1.js +2 -3
- package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme2.js +2 -3
- package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme1.js +2 -3
- package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme2.js +2 -3
- package/dist/src/components/ToolTip/Tooltip.d.ts +3 -0
- package/dist/src/components/ToolTip/Tooltip.js +8 -0
- package/dist/src/components/ToolTip/Tooltip.stories.d.ts +5 -0
- package/dist/src/components/ToolTip/Tooltip.stories.js +37 -0
- package/dist/src/components/ToolTip/type.d.ts +5 -0
- package/dist/src/components/ToolTip/type.js +1 -0
- package/dist/src/components/Typography/Body/Body.stories.d.ts +4 -0
- package/dist/src/components/Typography/Body/Body.stories.js +46 -0
- package/dist/src/components/Typography/Body/body.d.ts +35 -0
- package/dist/src/components/Typography/Body/body.js +61 -0
- package/dist/src/components/Typography/Caption/Caption.stories.d.ts +4 -0
- package/dist/src/components/Typography/Caption/Caption.stories.js +36 -0
- package/dist/src/components/Typography/Display/Display.stories.d.ts +4 -0
- package/dist/src/components/Typography/Display/Display.stories.js +36 -0
- package/dist/src/components/Typography/Display/display.d.ts +15 -0
- package/dist/src/components/Typography/Display/display.js +48 -0
- package/dist/src/components/Typography/Heading/Heading.stories.d.ts +4 -0
- package/dist/src/components/Typography/Heading/Heading.stories.js +36 -0
- package/dist/src/components/Typography/Heading/heading.d.ts +36 -0
- package/dist/src/components/Typography/Heading/heading.js +69 -0
- package/dist/src/components/Typography/Heading.d.ts +3 -0
- package/dist/src/components/Typography/Heading.js +29 -0
- package/dist/src/components/Typography/Heading.stories.d.ts +5 -0
- package/dist/src/components/Typography/Heading.stories.js +37 -0
- package/dist/src/components/Typography/type.d.ts +3 -3
- package/dist/src/components/ui/body.d.ts +0 -0
- package/dist/src/components/ui/body.js +1 -0
- package/dist/src/components/ui/caption.d.ts +8 -0
- package/dist/src/components/ui/caption.js +34 -0
- package/dist/src/components/ui/display.d.ts +15 -0
- package/dist/src/components/ui/display.js +48 -0
- package/dist/src/components/ui/heading.d.ts +36 -0
- package/dist/src/components/ui/heading.js +69 -0
- package/dist/src/components/ui/imageUploader.js +3 -3
- package/dist/src/components/ui/switch.js +2 -2
- package/dist/src/components/ui/typography.d.ts +1 -1
- package/dist/styles/global.css +145 -964
- package/package.json +2 -1
package/dist/app/page.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import Image from "next/image";
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
export default function Home() {
|
|
4
|
-
return (
|
|
3
|
+
return (_jsx("div", { className: "text-center flex flex-col items-center justify-center min-h-screen p-24 gap-5", children: _jsx("h1", { children: " Welcome to Linkedunion Design kit" }) }));
|
|
5
4
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
export { default as LUIcon } from "./src/components/Icons/LUIcon";
|
|
2
2
|
export { default as Card } from "./src/components/MediaCard/Card";
|
|
3
|
-
export { default as Button } from "./src/components/Button/Button";
|
|
4
3
|
export { default as LuImage } from "./src/components/Images/LuImage";
|
|
5
4
|
export { default as Avatar } from "./src/components/Avatar/Avatar";
|
|
6
5
|
export { default as Title } from "./src/components/Title/Title";
|
|
7
|
-
export {
|
|
6
|
+
export { IconButton } from "./src/components/Button/IconButton";
|
|
8
7
|
export { default as ColorPicker } from "./src/components/ColorPicker/ColorPicker";
|
|
9
|
-
export { default as Label } from "./src/components/Label/Label";
|
|
10
8
|
export { Input } from "./src/components/ui/input";
|
|
11
9
|
export { default as EditorTooltip } from "./src/components/EditorTooltip/EditorTooltip";
|
|
12
10
|
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent, } from "./src/components/ui/accordion";
|
|
13
|
-
export { default as ImageUploader } from "./src/components/
|
|
14
|
-
export { Typography } from "./src/components/ui/typography";
|
|
11
|
+
export { default as ImageUploader } from "./src/components/ImageUploader/imageUploader";
|
|
15
12
|
export { Checkbox } from "./src/components/ui/checkbox";
|
|
16
13
|
export { Switch } from "./src/components/ui/switch";
|
|
14
|
+
export { Typography } from "./src/components/ui/typography";
|
|
15
|
+
export { Heading } from "./src/components/Typography/Heading/heading";
|
|
16
|
+
export { Body } from "./src/components/Typography/Body/body";
|
|
17
|
+
export { Display } from "./src/components/Typography/Display/display";
|
|
18
|
+
export { Caption } from "./src/components/ui/caption";
|
|
19
|
+
export { default as Tooltip } from "./src/components/ToolTip/Tooltip";
|
|
20
|
+
export { Button } from "./src/components/Button/Button";
|
|
21
|
+
export { Label } from "./src/components/Label/Label";
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
export { default as LUIcon } from "./src/components/Icons/LUIcon";
|
|
2
2
|
export { default as Card } from "./src/components/MediaCard/Card";
|
|
3
|
-
export { default as Button } from "./src/components/Button/Button";
|
|
4
3
|
export { default as LuImage } from "./src/components/Images/LuImage";
|
|
5
4
|
export { default as Avatar } from "./src/components/Avatar/Avatar";
|
|
6
5
|
export { default as Title } from "./src/components/Title/Title";
|
|
7
|
-
export {
|
|
6
|
+
export { IconButton } from "./src/components/Button/IconButton";
|
|
8
7
|
export { default as ColorPicker } from "./src/components/ColorPicker/ColorPicker";
|
|
9
|
-
export { default as Label } from "./src/components/Label/Label";
|
|
10
8
|
export { Input } from "./src/components/ui/input";
|
|
11
9
|
export { default as EditorTooltip } from "./src/components/EditorTooltip/EditorTooltip";
|
|
12
10
|
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent, } from "./src/components/ui/accordion";
|
|
13
|
-
export { default as ImageUploader } from "./src/components/
|
|
14
|
-
export { Typography } from "./src/components/ui/typography";
|
|
11
|
+
export { default as ImageUploader } from "./src/components/ImageUploader/imageUploader";
|
|
15
12
|
export { Checkbox } from "./src/components/ui/checkbox";
|
|
16
13
|
export { Switch } from "./src/components/ui/switch";
|
|
14
|
+
export { Typography } from "./src/components/ui/typography";
|
|
15
|
+
export { Heading } from "./src/components/Typography/Heading/heading";
|
|
16
|
+
export { Body } from "./src/components/Typography/Body/body";
|
|
17
|
+
export { Display } from "./src/components/Typography/Display/display";
|
|
18
|
+
export { Caption } from "./src/components/ui/caption";
|
|
19
|
+
export { default as Tooltip } from "./src/components/ToolTip/Tooltip";
|
|
20
|
+
export { Button } from "./src/components/Button/Button";
|
|
21
|
+
export { Label } from "./src/components/Label/Label";
|
|
@@ -1,3 +1,45 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
export declare const color: {
|
|
4
|
+
blue: string;
|
|
5
|
+
red: string;
|
|
6
|
+
green: string;
|
|
7
|
+
yellow: string;
|
|
8
|
+
indigo: string;
|
|
9
|
+
gray: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const size: {
|
|
12
|
+
xl: string;
|
|
13
|
+
lg: string;
|
|
14
|
+
md: string;
|
|
15
|
+
sm: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const shape: {
|
|
18
|
+
"rounded-sm": string;
|
|
19
|
+
"rounded-full": string;
|
|
20
|
+
};
|
|
21
|
+
export declare const variant: {
|
|
22
|
+
default: string;
|
|
23
|
+
link: string;
|
|
24
|
+
};
|
|
25
|
+
export declare const linkColor: {
|
|
26
|
+
blue: string;
|
|
27
|
+
red: string;
|
|
28
|
+
green: string;
|
|
29
|
+
yellow: string;
|
|
30
|
+
indigo: string;
|
|
31
|
+
gray: string;
|
|
32
|
+
};
|
|
33
|
+
declare const buttonVariants: (props?: ({
|
|
34
|
+
color?: "blue" | "green" | "yellow" | "red" | "indigo" | "gray" | null | undefined;
|
|
35
|
+
size?: "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
36
|
+
shape?: "rounded-full" | "rounded-sm" | null | undefined;
|
|
37
|
+
variant?: "link" | "default" | null | undefined;
|
|
38
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
39
|
+
declare function Button({ className, color, size, shape, variant, asChild, startIcon, endIcon, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
40
|
+
asChild?: boolean;
|
|
41
|
+
startIcon?: string;
|
|
42
|
+
endIcon?: string;
|
|
43
|
+
variant?: "default" | "link";
|
|
44
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export { Button, buttonVariants };
|
|
@@ -20,10 +20,81 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
-
import {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
25
|
+
import { cva } from "class-variance-authority";
|
|
26
|
+
import { cn } from "../../lib/utils";
|
|
27
|
+
import LUIcon from "../Icons/LUIcon";
|
|
28
|
+
export var color = {
|
|
29
|
+
blue: "bg-blue-600 text-white hover:bg-blue-700 focus-visible:ring-blue-300 active:bg-blue-800 disabled:bg-gray-100 disabled:text-gray-400",
|
|
30
|
+
red: "bg-red-600 text-white hover:bg-red-700 focus-visible:ring-red-300 active:bg-red-800 disabled:bg-gray-100 disabled:text-gray-400",
|
|
31
|
+
green: "bg-green-600 text-white hover:bg-green-700 focus-visible:ring-green-300 active:bg-green-800 disabled:bg-gray-100 disabled:text-gray-400",
|
|
32
|
+
yellow: "bg-yellow-500 text-white hover:bg-yellow-600 focus-visible:ring-yellow-200 active:bg-yellow-700 disabled:bg-gray-100 disabled:text-gray-400",
|
|
33
|
+
indigo: "bg-indigo-600 text-white hover:bg-indigo-700 focus-visible:ring-indigo-300 active:bg-indigo-800 disabled:bg-gray-100 disabled:text-gray-400",
|
|
34
|
+
gray: "bg-gray-600 text-white hover:bg-gray-700 focus-visible:ring-gray-300 active:bg-gray-800 disabled:bg-gray-100 disabled:text-gray-400",
|
|
28
35
|
};
|
|
29
|
-
export
|
|
36
|
+
export var size = {
|
|
37
|
+
xl: "!py-3.5 !px-6 text-base font-normal leading-normal",
|
|
38
|
+
lg: "!py-3 !px-5 text-base font-normal leading-normal",
|
|
39
|
+
md: "!py-2.5 !px-5 text-sm font-normal leading-5",
|
|
40
|
+
sm: "!py-2 !px-3 text-sm font-normal leading-5",
|
|
41
|
+
};
|
|
42
|
+
export var shape = {
|
|
43
|
+
"rounded-sm": "!rounded-sm",
|
|
44
|
+
"rounded-full": "!rounded-full",
|
|
45
|
+
};
|
|
46
|
+
export var variant = {
|
|
47
|
+
default: "",
|
|
48
|
+
link: "bg-transparent hover:bg-transparent focus:bg-transparent active:bg-transparent !p-0 underline-offset-4 hover:underline",
|
|
49
|
+
};
|
|
50
|
+
// Link variant text colors based on the color prop
|
|
51
|
+
export var linkColor = {
|
|
52
|
+
blue: "text-blue-600 hover:text-blue-700",
|
|
53
|
+
red: "text-red-600 hover:text-red-700",
|
|
54
|
+
green: "text-green-600 hover:text-green-700",
|
|
55
|
+
yellow: "text-yellow-500 hover:text-yellow-600",
|
|
56
|
+
indigo: "text-indigo-600 hover:text-indigo-700",
|
|
57
|
+
gray: "text-gray-600 hover:text-gray-700",
|
|
58
|
+
};
|
|
59
|
+
var buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
|
|
60
|
+
variants: {
|
|
61
|
+
color: color,
|
|
62
|
+
size: size,
|
|
63
|
+
shape: shape,
|
|
64
|
+
variant: variant,
|
|
65
|
+
},
|
|
66
|
+
defaultVariants: {
|
|
67
|
+
color: "blue",
|
|
68
|
+
size: "md",
|
|
69
|
+
shape: "rounded-sm",
|
|
70
|
+
variant: "default",
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
function Button(_a) {
|
|
74
|
+
var className = _a.className, _b = _a.color, color = _b === void 0 ? "blue" : _b, size = _a.size, shape = _a.shape, _c = _a.variant, variant = _c === void 0 ? "default" : _c, _d = _a.asChild, asChild = _d === void 0 ? false : _d, startIcon = _a.startIcon, endIcon = _a.endIcon, props = __rest(_a, ["className", "color", "size", "shape", "variant", "asChild", "startIcon", "endIcon"]);
|
|
75
|
+
var Comp = asChild ? Slot : "button";
|
|
76
|
+
// Map button size to appropriate icon sizes for start and end icons
|
|
77
|
+
var getIconSizes = function () {
|
|
78
|
+
if (size === "xl" || size === "lg" || size === "md") {
|
|
79
|
+
return {
|
|
80
|
+
startIcon: "md", // 16px (size-6) - matches iconSize.xl
|
|
81
|
+
endIcon: "xs", // 12px (size-3.5)
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
startIcon: "sm", // 14px (size-4)
|
|
86
|
+
endIcon: "xs", // 12px (size-3.5)
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
// Get icon sizes based on button size
|
|
90
|
+
var iconSizes = getIconSizes();
|
|
91
|
+
// Use the calculated sizes based on button size
|
|
92
|
+
var startIconSizeValue = iconSizes.startIcon;
|
|
93
|
+
var endIconSizeValue = iconSizes.endIcon;
|
|
94
|
+
// Apply appropriate text color for link variant
|
|
95
|
+
var extraClasses = variant === "link" && color
|
|
96
|
+
? linkColor[color]
|
|
97
|
+
: "";
|
|
98
|
+
return (_jsxs(Comp, __assign({ "data-slot": "button", className: cn(buttonVariants({ variant: variant, color: color, size: size, shape: shape, className: className }), extraClasses) }, props, { children: [startIcon && (_jsx(LUIcon, { size: startIconSizeValue, "data-testid": "start-icon", icon: startIcon })), props.children, endIcon && (_jsx(LUIcon, { size: endIconSizeValue, "data-testid": "end-icon", icon: endIcon }))] })));
|
|
99
|
+
}
|
|
100
|
+
export { Button, buttonVariants };
|
|
@@ -1,5 +1,124 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { StoryObj } from "@storybook/react";
|
|
2
|
+
import { Button } from "./Button";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof Button;
|
|
6
|
+
tags: string[];
|
|
7
|
+
parameters: {
|
|
8
|
+
docs: {
|
|
9
|
+
description: {
|
|
10
|
+
component: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
controls: {
|
|
14
|
+
expanded: boolean;
|
|
15
|
+
sort: string;
|
|
16
|
+
hideNoControlsWarning: boolean;
|
|
17
|
+
exclude: never[];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
args: {
|
|
21
|
+
color: "blue";
|
|
22
|
+
size: "md";
|
|
23
|
+
shape: "rounded-sm";
|
|
24
|
+
variant: "default";
|
|
25
|
+
};
|
|
26
|
+
argTypes: {
|
|
27
|
+
color: {
|
|
28
|
+
control: {
|
|
29
|
+
type: "select";
|
|
30
|
+
};
|
|
31
|
+
options: string[];
|
|
32
|
+
description: string;
|
|
33
|
+
defaultValue: string;
|
|
34
|
+
table: {
|
|
35
|
+
defaultValue: {
|
|
36
|
+
summary: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
size: {
|
|
41
|
+
control: {
|
|
42
|
+
type: "select";
|
|
43
|
+
};
|
|
44
|
+
options: string[];
|
|
45
|
+
description: string;
|
|
46
|
+
defaultValue: string;
|
|
47
|
+
table: {
|
|
48
|
+
defaultValue: {
|
|
49
|
+
summary: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
shape: {
|
|
54
|
+
control: {
|
|
55
|
+
type: "select";
|
|
56
|
+
};
|
|
57
|
+
options: string[];
|
|
58
|
+
description: string;
|
|
59
|
+
defaultValue: string;
|
|
60
|
+
table: {
|
|
61
|
+
defaultValue: {
|
|
62
|
+
summary: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
variant: {
|
|
67
|
+
control: {
|
|
68
|
+
type: "select";
|
|
69
|
+
};
|
|
70
|
+
options: string[];
|
|
71
|
+
description: string;
|
|
72
|
+
defaultValue: string;
|
|
73
|
+
table: {
|
|
74
|
+
defaultValue: {
|
|
75
|
+
summary: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
startIcon: {
|
|
80
|
+
control: "text";
|
|
81
|
+
description: string;
|
|
82
|
+
};
|
|
83
|
+
endIcon: {
|
|
84
|
+
control: "text";
|
|
85
|
+
description: string;
|
|
86
|
+
};
|
|
87
|
+
disabled: {
|
|
88
|
+
control: "boolean";
|
|
89
|
+
description: string;
|
|
90
|
+
};
|
|
91
|
+
asChild: {
|
|
92
|
+
control: "boolean";
|
|
93
|
+
description: string;
|
|
94
|
+
};
|
|
95
|
+
onClick: {
|
|
96
|
+
action: string;
|
|
97
|
+
description: string;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
export default meta;
|
|
102
|
+
type Story = StoryObj<typeof Button>;
|
|
103
|
+
export declare const Default: Story;
|
|
104
|
+
export declare const Blue: Story;
|
|
105
|
+
export declare const Red: Story;
|
|
106
|
+
export declare const Green: Story;
|
|
107
|
+
export declare const Yellow: Story;
|
|
108
|
+
export declare const Indigo: Story;
|
|
109
|
+
export declare const Gray: Story;
|
|
110
|
+
export declare const WithStartIcon: Story;
|
|
111
|
+
export declare const WithEndIcon: Story;
|
|
112
|
+
export declare const WithBothIcons: Story;
|
|
113
|
+
export declare const Small: Story;
|
|
114
|
+
export declare const Medium: Story;
|
|
115
|
+
export declare const Large: Story;
|
|
116
|
+
export declare const ExtraLarge: Story;
|
|
117
|
+
export declare const DefaultVariant: Story;
|
|
118
|
+
export declare const LinkVariant: Story;
|
|
119
|
+
export declare const LinkVariantRed: Story;
|
|
120
|
+
export declare const LinkVariantGreen: Story;
|
|
121
|
+
export declare const RoundedSmall: Story;
|
|
122
|
+
export declare const RoundedFull: Story;
|
|
123
|
+
export declare const Disabled: Story;
|
|
124
|
+
export declare const DisabledButton: Story;
|
|
@@ -1,63 +1,248 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { buttonShapes, buttonSizes, buttonColors } from ".";
|
|
14
|
-
import Button from "./Button";
|
|
15
|
-
export default {
|
|
16
|
-
title: "Components/Button/Button",
|
|
1
|
+
import { Button, size, color, shape, variant } from "./Button";
|
|
2
|
+
var meta = {
|
|
3
|
+
title: "Components/Button",
|
|
17
4
|
component: Button,
|
|
18
5
|
tags: ["autodocs"],
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
6
|
+
parameters: {
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: "Button component with default variants: color: blue, size: md, shape: rounded-sm, variant: default",
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
controls: {
|
|
13
|
+
expanded: true,
|
|
14
|
+
sort: "requiredFirst",
|
|
15
|
+
hideNoControlsWarning: true,
|
|
16
|
+
exclude: [],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
args: {
|
|
20
|
+
// Default values for all stories
|
|
21
|
+
color: "blue",
|
|
22
|
+
size: "md",
|
|
23
|
+
shape: "rounded-sm",
|
|
24
|
+
variant: "default",
|
|
25
|
+
},
|
|
26
|
+
argTypes: {
|
|
27
|
+
color: {
|
|
28
|
+
control: {
|
|
29
|
+
type: "select",
|
|
30
|
+
},
|
|
31
|
+
options: Object.keys(color),
|
|
32
|
+
description: "The color and visual style of the button",
|
|
33
|
+
defaultValue: "blue",
|
|
34
|
+
table: {
|
|
35
|
+
defaultValue: { summary: "blue" },
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
size: {
|
|
39
|
+
control: {
|
|
40
|
+
type: "select",
|
|
41
|
+
},
|
|
42
|
+
options: Object.keys(size),
|
|
43
|
+
description: "The size of the button",
|
|
44
|
+
defaultValue: "md",
|
|
45
|
+
table: {
|
|
46
|
+
defaultValue: { summary: "md" },
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
shape: {
|
|
50
|
+
control: {
|
|
51
|
+
type: "select",
|
|
52
|
+
},
|
|
53
|
+
options: Object.keys(shape),
|
|
54
|
+
description: "The shape of the button",
|
|
55
|
+
defaultValue: "rounded-sm",
|
|
56
|
+
table: {
|
|
57
|
+
defaultValue: { summary: "rounded-sm" },
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
variant: {
|
|
61
|
+
control: {
|
|
62
|
+
type: "select",
|
|
63
|
+
},
|
|
64
|
+
options: Object.keys(variant),
|
|
65
|
+
description: "The variant of the button (default or link)",
|
|
66
|
+
defaultValue: "default",
|
|
67
|
+
table: {
|
|
68
|
+
defaultValue: { summary: "default" },
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
startIcon: {
|
|
72
|
+
control: "text",
|
|
73
|
+
description: "Icon to display at the start of the button",
|
|
74
|
+
},
|
|
75
|
+
endIcon: {
|
|
76
|
+
control: "text",
|
|
77
|
+
description: "Icon to display at the end of the button",
|
|
78
|
+
},
|
|
79
|
+
disabled: {
|
|
80
|
+
control: "boolean",
|
|
81
|
+
description: "Whether the button is disabled",
|
|
82
|
+
},
|
|
83
|
+
asChild: {
|
|
84
|
+
control: "boolean",
|
|
85
|
+
description: "Whether to render as a child component",
|
|
86
|
+
},
|
|
87
|
+
onClick: {
|
|
88
|
+
action: "clicked",
|
|
89
|
+
description: "Function called when button is clicked",
|
|
90
|
+
},
|
|
26
91
|
},
|
|
27
92
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
93
|
+
export default meta;
|
|
94
|
+
// Display Default button with explicit default values
|
|
95
|
+
export var Default = {
|
|
96
|
+
args: {
|
|
97
|
+
children: "Button Text",
|
|
98
|
+
color: "blue",
|
|
99
|
+
size: "md",
|
|
100
|
+
shape: "rounded-sm",
|
|
101
|
+
variant: "default",
|
|
102
|
+
onClick: function () {
|
|
103
|
+
alert("Button clicked!");
|
|
33
104
|
},
|
|
34
|
-
options: Object.keys(buttonColors),
|
|
35
105
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
106
|
+
};
|
|
107
|
+
export var Blue = {
|
|
108
|
+
args: {
|
|
109
|
+
children: "Blue Button",
|
|
110
|
+
color: "blue",
|
|
111
|
+
size: "md",
|
|
39
112
|
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
113
|
+
};
|
|
114
|
+
export var Red = {
|
|
115
|
+
args: {
|
|
116
|
+
children: "Red Button",
|
|
117
|
+
color: "red",
|
|
118
|
+
size: "md",
|
|
43
119
|
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
120
|
+
};
|
|
121
|
+
export var Green = {
|
|
122
|
+
args: {
|
|
123
|
+
children: "Green Button",
|
|
124
|
+
color: "green",
|
|
125
|
+
size: "md",
|
|
50
126
|
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
description: "Select the size of the button",
|
|
127
|
+
};
|
|
128
|
+
export var Yellow = {
|
|
129
|
+
args: {
|
|
130
|
+
children: "Yellow Button",
|
|
131
|
+
color: "yellow",
|
|
132
|
+
size: "md",
|
|
58
133
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
134
|
+
};
|
|
135
|
+
export var Indigo = {
|
|
136
|
+
args: {
|
|
137
|
+
children: "Indigo Button",
|
|
138
|
+
color: "indigo",
|
|
139
|
+
size: "md",
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
export var Gray = {
|
|
143
|
+
args: {
|
|
144
|
+
children: "Gray Button",
|
|
145
|
+
color: "gray",
|
|
146
|
+
size: "md",
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
export var WithStartIcon = {
|
|
150
|
+
args: {
|
|
151
|
+
children: "Button with Start Icon",
|
|
152
|
+
startIcon: "arrow-right",
|
|
153
|
+
size: "md",
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
export var WithEndIcon = {
|
|
157
|
+
args: {
|
|
158
|
+
children: "Button with End Icon",
|
|
159
|
+
endIcon: "arrow-right",
|
|
160
|
+
size: "md",
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
export var WithBothIcons = {
|
|
164
|
+
args: {
|
|
165
|
+
children: "Button with Icons",
|
|
166
|
+
startIcon: "plus",
|
|
167
|
+
endIcon: "arrow-right",
|
|
168
|
+
size: "md",
|
|
169
|
+
},
|
|
170
|
+
};
|
|
171
|
+
export var Small = {
|
|
172
|
+
args: {
|
|
173
|
+
children: "Small Button",
|
|
174
|
+
size: "sm",
|
|
175
|
+
},
|
|
176
|
+
};
|
|
177
|
+
export var Medium = {
|
|
178
|
+
args: {
|
|
179
|
+
children: "Medium Button",
|
|
180
|
+
size: "md",
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
export var Large = {
|
|
184
|
+
args: {
|
|
185
|
+
children: "Large Button",
|
|
186
|
+
size: "lg",
|
|
187
|
+
},
|
|
188
|
+
};
|
|
189
|
+
export var ExtraLarge = {
|
|
190
|
+
args: {
|
|
191
|
+
children: "Extra Large Button",
|
|
192
|
+
size: "xl",
|
|
193
|
+
},
|
|
194
|
+
};
|
|
195
|
+
export var DefaultVariant = {
|
|
196
|
+
args: {
|
|
197
|
+
children: "Default Variant Button",
|
|
198
|
+
variant: "default",
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
export var LinkVariant = {
|
|
202
|
+
args: {
|
|
203
|
+
children: "Link Style Button",
|
|
204
|
+
variant: "link",
|
|
205
|
+
color: "blue",
|
|
206
|
+
},
|
|
207
|
+
};
|
|
208
|
+
export var LinkVariantRed = {
|
|
209
|
+
args: {
|
|
210
|
+
children: "Red Link Button",
|
|
211
|
+
variant: "link",
|
|
212
|
+
color: "red",
|
|
213
|
+
},
|
|
214
|
+
};
|
|
215
|
+
export var LinkVariantGreen = {
|
|
216
|
+
args: {
|
|
217
|
+
children: "Green Link Button",
|
|
218
|
+
variant: "link",
|
|
219
|
+
color: "green",
|
|
220
|
+
},
|
|
221
|
+
};
|
|
222
|
+
export var RoundedSmall = {
|
|
223
|
+
args: {
|
|
224
|
+
children: "Rounded Small",
|
|
225
|
+
shape: "rounded-sm",
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
export var RoundedFull = {
|
|
229
|
+
args: {
|
|
230
|
+
children: "Rounded Full",
|
|
231
|
+
shape: "rounded-full",
|
|
232
|
+
},
|
|
233
|
+
};
|
|
234
|
+
export var Disabled = {
|
|
235
|
+
args: {
|
|
236
|
+
children: "Disabled Button",
|
|
237
|
+
disabled: true,
|
|
238
|
+
},
|
|
239
|
+
};
|
|
240
|
+
// Color variants
|
|
241
|
+
// Example of color with different button states
|
|
242
|
+
export var DisabledButton = {
|
|
243
|
+
args: {
|
|
244
|
+
children: "Disabled Button",
|
|
245
|
+
color: "blue",
|
|
246
|
+
disabled: true,
|
|
62
247
|
},
|
|
63
248
|
};
|