linkedunion-design-kit 1.9.6-beta.0 → 1.9.6-beta.1
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/build/types/validator.js +12 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/src/components/Badge/Badge.stories.d.ts +1 -1
- package/dist/src/components/Badge/Badge.stories.js +1 -1
- package/dist/src/components/Button/Button/Button.module.css +1 -1
- package/dist/src/components/Card/MultipleNews/MultiNews.js +2 -2
- package/dist/src/components/Pagination/pagination.js +7 -7
- package/dist/src/components/Skeleton/skeleton.stories.d.ts +3 -1
- package/dist/src/components/Skeleton/skeleton.stories.js +48 -38
- package/dist/src/components/Title/Title.module.css +1 -1
- package/dist/src/components/Typography/Heading/heading.module.css +1 -1
- package/dist/src/components/VerticalTabs/VerticalTabs.d.ts +18 -0
- package/dist/src/components/VerticalTabs/VerticalTabs.js +60 -0
- package/dist/src/components/VerticalTabs/VerticalTabs.stories.d.ts +11 -0
- package/dist/src/components/VerticalTabs/VerticalTabs.stories.js +100 -0
- package/dist/src/components/VerticalTabs/VerticalTabs.test.d.ts +1 -0
- package/dist/src/components/VerticalTabs/VerticalTabs.test.js +48 -0
- package/dist/styles/global.css +118 -6
- package/package.json +2 -2
- package/dist/app/layout.jsx +0 -13
- package/dist/app/page.jsx +0 -5
- package/dist/src/components/Accordion/Accordion.stories.jsx +0 -33
- package/dist/src/components/Accordion/accordion.jsx +0 -59
- package/dist/src/components/Alerts/Alert/alert.jsx +0 -152
- package/dist/src/components/Alerts/Alert/alert.stories.jsx +0 -344
- package/dist/src/components/Alerts/AlertDialog/alert-dialog.jsx +0 -170
- package/dist/src/components/Alerts/AlertDialog/alert-dialog.stories.jsx +0 -552
- package/dist/src/components/AppIcons/AndroidIcon.jsx +0 -24
- package/dist/src/components/AppIcons/AppIcon.jsx +0 -29
- package/dist/src/components/AppIcons/AppIcon.stories.jsx +0 -223
- package/dist/src/components/AppIcons/AppleIcon.jsx +0 -31
- package/dist/src/components/AppIcons/PlayStoreIcon.jsx +0 -29
- package/dist/src/components/Avatar/Avatar/Avatar.jsx +0 -45
- package/dist/src/components/Avatar/Avatar/Avatar.stories.jsx +0 -95
- package/dist/src/components/Avatar/Avatar/Avatar.test.jsx +0 -9
- package/dist/src/components/Avatar/Avatar/type.d.ts +0 -12
- package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.jsx +0 -17
- package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.stories.jsx +0 -32
- package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.jsx +0 -20
- package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.stories.jsx +0 -50
- package/dist/src/components/Badge/Badge.jsx +0 -54
- package/dist/src/components/Badge/Badge.stories.jsx +0 -201
- package/dist/src/components/Button/Button/Button.jsx +0 -96
- package/dist/src/components/Button/Button/Button.stories.jsx +0 -283
- package/dist/src/components/Button/Button/Button.test.jsx +0 -73
- package/dist/src/components/Button/IconButton/IconButton.jsx +0 -63
- package/dist/src/components/Button/IconButton/IconButton.stories.jsx +0 -128
- package/dist/src/components/Button/IconButton/IconButton.test.jsx +0 -28
- package/dist/src/components/Card/MultipleNews/MultiNews.jsx +0 -70
- package/dist/src/components/Card/MultipleNews/MultiNews.stories.jsx +0 -101
- package/dist/src/components/Card/PostByCategory/PostByCategory.jsx +0 -60
- package/dist/src/components/Card/PostByCategory/PostByCategory.stories.jsx +0 -102
- package/dist/src/components/Card/SinglePost/SinglePost.jsx +0 -26
- package/dist/src/components/Card/SinglePost/SinglePost.stories.jsx +0 -63
- package/dist/src/components/Card/card.jsx +0 -20
- package/dist/src/components/Card/contactProfile/ContactProfile.jsx +0 -60
- package/dist/src/components/Card/contactProfile/ContactProfile.stories.jsx +0 -99
- package/dist/src/components/Card/photoAlbum/PhotoAlbum.jsx +0 -41
- package/dist/src/components/Card/photoAlbum/PhotoAlbum.stories.jsx +0 -51
- package/dist/src/components/Card/photoGallery/PhotoGallery.jsx +0 -17
- package/dist/src/components/Card/photoGallery/PhotoGallery.stories.jsx +0 -34
- package/dist/src/components/Checkbox/checkbox.jsx +0 -47
- package/dist/src/components/Checkbox/checkbox.stories.jsx +0 -113
- package/dist/src/components/ColorPicker/ColorPicker.jsx +0 -67
- package/dist/src/components/ColorPicker/ColorPicker.stories.jsx +0 -138
- package/dist/src/components/Colors/color.jsx +0 -5
- package/dist/src/components/Colors/color.stories.jsx +0 -20
- package/dist/src/components/Colors/color.test.jsx +0 -23
- package/dist/src/components/Dropdown/Combobox/Combobox.jsx +0 -198
- package/dist/src/components/Dropdown/Combobox/Combobox.stories.jsx +0 -289
- package/dist/src/components/Dropdown/Combobox/utils/renderBadge.jsx +0 -7
- package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.jsx +0 -102
- package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.stories.jsx +0 -464
- package/dist/src/components/Dropdown/DropdownMenu/SelectAllSection.jsx +0 -19
- package/dist/src/components/Dropdown/Select.stories.jsx +0 -201
- package/dist/src/components/Dropdown/select.jsx +0 -93
- package/dist/src/components/Icons/LUIcon.jsx +0 -41
- package/dist/src/components/Icons/LUIcon.test.jsx +0 -308
- package/dist/src/components/Icons/stories/IconDropdown.jsx +0 -67
- package/dist/src/components/Icons/stories/IconGallery.jsx +0 -77
- package/dist/src/components/Icons/stories/InteractiveIconSelector.jsx +0 -86
- package/dist/src/components/Icons/stories/LUIcon.stories.jsx +0 -108
- package/dist/src/components/ImageUploader/ImageUploader.stories.jsx +0 -50
- package/dist/src/components/ImageUploader/imageUploader.jsx +0 -94
- package/dist/src/components/Images/LuImage.jsx +0 -19
- package/dist/src/components/Images/LuImage.stories.jsx +0 -154
- package/dist/src/components/Images/LuImage.test.jsx +0 -44
- package/dist/src/components/Input/Input.stories.jsx +0 -250
- package/dist/src/components/Input/input.jsx +0 -110
- package/dist/src/components/Label/Label.jsx +0 -32
- package/dist/src/components/Label/Label.stories.jsx +0 -30
- package/dist/src/components/Pagination/pagination.jsx +0 -65
- package/dist/src/components/Pagination/pagination.stories.jsx +0 -301
- package/dist/src/components/RadioGroup/RadioGroup.stories.jsx +0 -146
- package/dist/src/components/RadioGroup/radio-group.jsx +0 -49
- package/dist/src/components/Slider/Slider.stories.jsx +0 -159
- package/dist/src/components/Slider/slider.jsx +0 -31
- package/dist/src/components/SweetAlert/SweetAlert.jsx +0 -147
- package/dist/src/components/SweetAlert/SweetAlert.stories.jsx +0 -505
- package/dist/src/components/Switch/Switch.stories.jsx +0 -66
- package/dist/src/components/Switch/switch.jsx +0 -61
- package/dist/src/components/Table/Table.jsx +0 -221
- package/dist/src/components/Table/Table.stories.jsx +0 -652
- package/dist/src/components/Tabs/Tabs.stories.jsx +0 -29
- package/dist/src/components/Tabs/tabs.jsx +0 -32
- package/dist/src/components/Title/Title.jsx +0 -8
- package/dist/src/components/Title/Title.stories.jsx +0 -37
- package/dist/src/components/Title/Title.test.jsx +0 -24
- package/dist/src/components/ToolTip/Tooltip.jsx +0 -18
- package/dist/src/components/ToolTip/Tooltip.stories.jsx +0 -25
- package/dist/src/components/Typography/Body/Body.stories.jsx +0 -34
- package/dist/src/components/Typography/Body/body.jsx +0 -52
- package/dist/src/components/Typography/Caption/Caption.stories.jsx +0 -24
- package/dist/src/components/Typography/Caption/caption.jsx +0 -25
- package/dist/src/components/Typography/Display/Display.stories.jsx +0 -24
- package/dist/src/components/Typography/Display/display.jsx +0 -39
- package/dist/src/components/Typography/Heading/Heading.stories.jsx +0 -37
- package/dist/src/components/Typography/Heading/heading.jsx +0 -53
- package/dist/src/components/ui/avatar.d.ts +0 -6
- package/dist/src/components/ui/avatar.js +0 -38
- package/dist/src/components/ui/avatar.jsx +0 -27
- package/dist/src/components/ui/button.d.ts +0 -10
- package/dist/src/components/ui/button.js +0 -56
- package/dist/src/components/ui/button.jsx +0 -45
- package/dist/src/components/ui/collapsible.jsx +0 -5
- package/dist/src/components/ui/command.jsx +0 -67
- package/dist/src/components/ui/dialog.jsx +0 -66
- package/dist/src/components/ui/popover.jsx +0 -33
- package/dist/src/components/ui/tooltip.jsx +0 -38
- package/dist/src/components/ui/typography.jsx +0 -56
- /package/dist/{src/components/Avatar/Avatar/type.js → build/types/validator.d.ts} +0 -0
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { render, screen } from "@testing-library/react";
|
|
2
|
-
import { Dummy_label } from "../../../utils/constants";
|
|
3
|
-
import { Button } from "./Button";
|
|
4
|
-
describe("Button Component", function () {
|
|
5
|
-
it("renders default button component", function () {
|
|
6
|
-
render(<Button>{Dummy_label}</Button>);
|
|
7
|
-
expect(screen.getByRole("button")).toBeInTheDocument();
|
|
8
|
-
});
|
|
9
|
-
});
|
|
10
|
-
// it("renders button with a custom label", () => {
|
|
11
|
-
// render(<Button>{Dummy_label}</Button>);
|
|
12
|
-
// expect(
|
|
13
|
-
// screen.getByRole("button", { name: Dummy_label }),
|
|
14
|
-
// ).toBeInTheDocument();
|
|
15
|
-
// });
|
|
16
|
-
// it("calls onClick handler when clicked", () => {
|
|
17
|
-
// const handleClick = jest.fn();
|
|
18
|
-
// render(<Button onClick={handleClick}>Click</Button>);
|
|
19
|
-
// fireEvent.click(screen.getByRole("button"));
|
|
20
|
-
// expect(handleClick).toHaveBeenCalledTimes(1);
|
|
21
|
-
// });
|
|
22
|
-
// it("renders startIcon when provided", () => {
|
|
23
|
-
// render(<Button startIcon={<span>*</span>}>{Dummy_label}</Button>);
|
|
24
|
-
// expect(screen.getByTestId("start-icon")).toBeInTheDocument();
|
|
25
|
-
// });
|
|
26
|
-
// it("renders endIcon when provided", () => {
|
|
27
|
-
// render(<Button endIcon={<span>*</span>}>{Dummy_label}</Button>);
|
|
28
|
-
// expect(screen.getByTestId("end-icon")).toBeInTheDocument();
|
|
29
|
-
// });
|
|
30
|
-
// it("applies correct color, shape, and size classes", () => {
|
|
31
|
-
// render(
|
|
32
|
-
// <Button color="primary" shape="rounded-full" size="lg">
|
|
33
|
-
// {Dummy_label}
|
|
34
|
-
// </Button>,
|
|
35
|
-
// );
|
|
36
|
-
// const buttonElement = screen.getByRole("button");
|
|
37
|
-
// expect(buttonElement).toHaveClass(
|
|
38
|
-
// buttonColors["primary"],
|
|
39
|
-
// buttonShapes["rounded-full"],
|
|
40
|
-
// buttonSizes["lg"],
|
|
41
|
-
// );
|
|
42
|
-
// });
|
|
43
|
-
// it("applies additional className when provided", () => {
|
|
44
|
-
// render(<Button className="custom-class">{Dummy_label}</Button>);
|
|
45
|
-
// expect(screen.getByRole("button")).toHaveClass("custom-class");
|
|
46
|
-
// });
|
|
47
|
-
// it("renders without crashing when no props are provided", () => {
|
|
48
|
-
// render(<Button>{Dummy_label}</Button>);
|
|
49
|
-
// expect(screen.getByRole("button")).toBeInTheDocument();
|
|
50
|
-
// });
|
|
51
|
-
// it("renders button with both startIcon and endIcon", () => {
|
|
52
|
-
// render(
|
|
53
|
-
// <Button startIcon={<span>*</span>} endIcon={<span>*</span>}>
|
|
54
|
-
// {Dummy_label}
|
|
55
|
-
// </Button>,
|
|
56
|
-
// );
|
|
57
|
-
// expect(screen.getByTestId("start-icon")).toBeInTheDocument();
|
|
58
|
-
// expect(screen.getByTestId("end-icon")).toBeInTheDocument();
|
|
59
|
-
// });
|
|
60
|
-
// it("does not render startIcon when not provided", () => {
|
|
61
|
-
// render(<Button>{Dummy_label}</Button>);
|
|
62
|
-
// expect(screen.queryByTestId("start-icon")).not.toBeInTheDocument();
|
|
63
|
-
// });
|
|
64
|
-
// it("does not render endIcon when not provided", () => {
|
|
65
|
-
// render(<Button>{Dummy_label}</Button>);
|
|
66
|
-
// expect(screen.queryByTestId("end-icon")).not.toBeInTheDocument();
|
|
67
|
-
// });
|
|
68
|
-
// it("renders correctly without a className prop", () => {
|
|
69
|
-
// render(<Button>{Dummy_label}</Button>);
|
|
70
|
-
// const buttonElement = screen.getByRole("button");
|
|
71
|
-
// expect(buttonElement).not.toHaveClass("custom-class");
|
|
72
|
-
// });
|
|
73
|
-
// });
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import * as React from "react";
|
|
13
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
14
|
-
import { cva } from "class-variance-authority";
|
|
15
|
-
import { cn } from "../../../lib/utils";
|
|
16
|
-
import LUIcon from "../../Icons/LUIcon";
|
|
17
|
-
import { buttonStyles } from "..";
|
|
18
|
-
export var variant = {
|
|
19
|
-
fill: "",
|
|
20
|
-
outline: "border bg-transparent",
|
|
21
|
-
ghost: "bg-transparent border-none",
|
|
22
|
-
};
|
|
23
|
-
var buttonVariants = cva("inline-flex items-center justify-center whitespace-nowrap rounded-md 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-[3px] focus-visible:ring-blue-200 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer", {
|
|
24
|
-
variants: {
|
|
25
|
-
color: buttonStyles.fillColor,
|
|
26
|
-
size: buttonStyles.iconButtonSize,
|
|
27
|
-
shape: buttonStyles.shape,
|
|
28
|
-
variant: variant,
|
|
29
|
-
},
|
|
30
|
-
defaultVariants: {
|
|
31
|
-
color: "blue",
|
|
32
|
-
size: "md",
|
|
33
|
-
shape: "rounded-sm",
|
|
34
|
-
variant: "fill",
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
function IconButton(_a) {
|
|
38
|
-
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 ? "fill" : _c, _d = _a.asChild, asChild = _d === void 0 ? false : _d, icon = _a.icon, props = __rest(_a, ["className", "color", "size", "shape", "variant", "asChild", "icon"]);
|
|
39
|
-
var Comp = asChild ? Slot : "button";
|
|
40
|
-
// Map button size to appropriate icon sizes for the icon
|
|
41
|
-
var getIconSize = function () {
|
|
42
|
-
if (size === "xl" || size === "lg") {
|
|
43
|
-
return "xl";
|
|
44
|
-
}
|
|
45
|
-
else if (size === "md") {
|
|
46
|
-
return "lg";
|
|
47
|
-
}
|
|
48
|
-
else if (size === "sm") {
|
|
49
|
-
return "md";
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
// Apply appropriate text color for link variant
|
|
53
|
-
var extraClasses = variant === "outline" && color
|
|
54
|
-
? buttonStyles.outlineColor[color]
|
|
55
|
-
: variant === "ghost" && color
|
|
56
|
-
? buttonStyles.ghostColor[color]
|
|
57
|
-
: buttonStyles.fillColor[color];
|
|
58
|
-
var iconSize = getIconSize();
|
|
59
|
-
return (<Comp data-slot="button" className={cn(buttonVariants({ color: color, size: size, shape: shape, variant: variant, className: className }), extraClasses)} {...props}>
|
|
60
|
-
<LUIcon size={iconSize} data-testid="icon" icon={icon !== null && icon !== void 0 ? icon : "info"}/>
|
|
61
|
-
</Comp>);
|
|
62
|
-
}
|
|
63
|
-
export { IconButton, buttonVariants };
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { iconList } from "../../../utils/iconList";
|
|
2
|
-
import { IconButton, variant } from "./IconButton";
|
|
3
|
-
import { buttonStyles } from "..";
|
|
4
|
-
var meta = {
|
|
5
|
-
title: "Components/Button/IconButton",
|
|
6
|
-
component: IconButton,
|
|
7
|
-
tags: ["autodocs"],
|
|
8
|
-
parameters: {
|
|
9
|
-
docs: {
|
|
10
|
-
description: {
|
|
11
|
-
component: "Icon Button component with default variants: color: blue, size: md, shape: rounded-sm, variant: default",
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
controls: {
|
|
15
|
-
expanded: true,
|
|
16
|
-
sort: "requiredFirst",
|
|
17
|
-
hideNoControlsWarning: true,
|
|
18
|
-
exclude: [],
|
|
19
|
-
},
|
|
20
|
-
className: "",
|
|
21
|
-
},
|
|
22
|
-
args: {
|
|
23
|
-
// Default values for all stories
|
|
24
|
-
color: "blue",
|
|
25
|
-
size: "md",
|
|
26
|
-
shape: "rounded-sm",
|
|
27
|
-
variant: "fill",
|
|
28
|
-
icon: "chart-simple",
|
|
29
|
-
},
|
|
30
|
-
argTypes: {
|
|
31
|
-
color: {
|
|
32
|
-
control: {
|
|
33
|
-
type: "select",
|
|
34
|
-
labels: Object.keys(buttonStyles.fillColor),
|
|
35
|
-
},
|
|
36
|
-
options: Object.keys(buttonStyles.fillColor),
|
|
37
|
-
},
|
|
38
|
-
shape: {
|
|
39
|
-
control: {
|
|
40
|
-
type: "select",
|
|
41
|
-
labels: Object.keys(buttonStyles.shape),
|
|
42
|
-
},
|
|
43
|
-
options: Object.keys(buttonStyles.shape),
|
|
44
|
-
description: "Select the shape of the button",
|
|
45
|
-
table: {
|
|
46
|
-
defaultValue: { summary: "rounded-sm" },
|
|
47
|
-
type: { summary: "string" },
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
variant: {
|
|
51
|
-
control: {
|
|
52
|
-
type: "select",
|
|
53
|
-
},
|
|
54
|
-
options: Object.keys(variant),
|
|
55
|
-
description: "The variant of the button (default or link)",
|
|
56
|
-
defaultValue: "fill",
|
|
57
|
-
table: {
|
|
58
|
-
defaultValue: { summary: "fill" },
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
size: {
|
|
62
|
-
control: {
|
|
63
|
-
type: "select",
|
|
64
|
-
labels: Object.keys(buttonStyles.iconButtonSize),
|
|
65
|
-
},
|
|
66
|
-
options: Object.keys(buttonStyles.iconButtonSize),
|
|
67
|
-
description: "Select the size of the button",
|
|
68
|
-
table: {
|
|
69
|
-
defaultValue: { summary: "md" },
|
|
70
|
-
type: { summary: "string" },
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
icon: {
|
|
74
|
-
control: {
|
|
75
|
-
type: "select",
|
|
76
|
-
labels: Object.fromEntries(Object.keys(iconList).map(function (key) { return [key, key]; })),
|
|
77
|
-
},
|
|
78
|
-
options: Object.keys(iconList),
|
|
79
|
-
description: "Icon (React component)",
|
|
80
|
-
},
|
|
81
|
-
className: {
|
|
82
|
-
control: { type: "text" },
|
|
83
|
-
description: "Custom class name for the IconButton",
|
|
84
|
-
table: {
|
|
85
|
-
type: { summary: "string" },
|
|
86
|
-
defaultValue: { summary: "" },
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
onClick: {
|
|
90
|
-
action: "clicked",
|
|
91
|
-
description: "Function called when button is clicked",
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
decorators: [
|
|
95
|
-
function (Story, context) {
|
|
96
|
-
var currentVariant = context.args.variant;
|
|
97
|
-
var isOutline = currentVariant === "outline";
|
|
98
|
-
var isGhost = currentVariant === "ghost";
|
|
99
|
-
var isFill = currentVariant === "fill";
|
|
100
|
-
if (context.argTypes) {
|
|
101
|
-
// ✅ Update Link color and size options
|
|
102
|
-
if (context.argTypes.color) {
|
|
103
|
-
context.argTypes.color.options = isOutline
|
|
104
|
-
? Object.keys(buttonStyles.outlineColor)
|
|
105
|
-
: isGhost
|
|
106
|
-
? Object.keys(buttonStyles.ghostColor)
|
|
107
|
-
: isFill
|
|
108
|
-
? Object.keys(buttonStyles.fillColor)
|
|
109
|
-
: Object.keys(buttonStyles.fillColor);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
return <Story {...context}/>;
|
|
113
|
-
},
|
|
114
|
-
],
|
|
115
|
-
};
|
|
116
|
-
export default meta;
|
|
117
|
-
// Display Default button with explicit default values
|
|
118
|
-
export var Default = {
|
|
119
|
-
args: {
|
|
120
|
-
color: "blue",
|
|
121
|
-
size: "md",
|
|
122
|
-
shape: "rounded-sm",
|
|
123
|
-
variant: "fill",
|
|
124
|
-
onClick: function () {
|
|
125
|
-
alert("Button clicked!");
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { fireEvent, render, screen } from "@testing-library/react";
|
|
2
|
-
import { IconButton } from "./IconButton";
|
|
3
|
-
import { buttonStyles } from "..";
|
|
4
|
-
describe("Icon Button Component", function () {
|
|
5
|
-
it("renders icon button with required icon prop", function () {
|
|
6
|
-
render(<IconButton icon="chart-simple"/>);
|
|
7
|
-
expect(screen.getByRole("button")).toBeInTheDocument();
|
|
8
|
-
});
|
|
9
|
-
it("calls onClick handler when clicked", function () {
|
|
10
|
-
var handleClick = jest.fn();
|
|
11
|
-
render(<IconButton onClick={handleClick} icon="chart-simple"/>);
|
|
12
|
-
fireEvent.click(screen.getByRole("button"));
|
|
13
|
-
expect(handleClick).toHaveBeenCalledTimes(1);
|
|
14
|
-
});
|
|
15
|
-
it("applies correct color, shape, and size classes", function () {
|
|
16
|
-
render(<IconButton color="blue" shape="rounded-full" size="lg" icon="chart-simple"/>);
|
|
17
|
-
var buttonElement = screen.getByRole("button");
|
|
18
|
-
expect(buttonElement).toHaveClass(buttonStyles.fillColor["blue"], buttonStyles.shape["rounded-full"], buttonStyles.iconButtonSize["lg"]);
|
|
19
|
-
});
|
|
20
|
-
it("applies additional className when provided", function () {
|
|
21
|
-
render(<IconButton className="custom-class" icon="chart-simple"/>);
|
|
22
|
-
expect(screen.getByRole("button")).toHaveClass("custom-class");
|
|
23
|
-
});
|
|
24
|
-
it("renders without crashing when all required props are provided", function () {
|
|
25
|
-
render(<IconButton icon="chart-simple"/>);
|
|
26
|
-
expect(screen.getByRole("button")).toBeInTheDocument();
|
|
27
|
-
});
|
|
28
|
-
});
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import LuImage from "../../Images/LuImage";
|
|
2
|
-
import { Button } from "../../Button/Button/Button";
|
|
3
|
-
import { Body } from "../../Typography/Body/body";
|
|
4
|
-
import { Heading } from "../../Typography/Heading/heading";
|
|
5
|
-
export var MultipleNewsCard = function (props) {
|
|
6
|
-
var item = props.item, image = props.image, btnLabel = props.btnLabel, editor = props.editor, _a = props.mediaPosition, mediaPosition = _a === void 0 ? "right" : _a, orientation = props.orientation, onButtonClick = props.onButtonClick;
|
|
7
|
-
// Common card media component
|
|
8
|
-
var CardMedia = function (_a) {
|
|
9
|
-
var _b = _a.className, className = _b === void 0 ? "" : _b;
|
|
10
|
-
return (<LuImage src={image} width={240} height={240} className={"object-cover w-full ".concat(className, " ").concat(editor === null || editor === void 0 ? void 0 : editor.cardImage)} alt="Image"/>);
|
|
11
|
-
};
|
|
12
|
-
// Common content section
|
|
13
|
-
var CardContent = function (_a) {
|
|
14
|
-
var _b = _a.className, className = _b === void 0 ? "" : _b;
|
|
15
|
-
return (<div className={"flex flex-col !gap-2 ".concat(className)}>
|
|
16
|
-
<Heading variant="h4-600" className={"line-clamp-1 capitalize ".concat(editor === null || editor === void 0 ? void 0 : editor.cardTitle)}>
|
|
17
|
-
{item === null || item === void 0 ? void 0 : item.title}
|
|
18
|
-
</Heading>
|
|
19
|
-
|
|
20
|
-
{(item === null || item === void 0 ? void 0 : item.short_description) && (<Body variant="body-xl" className={"".concat(item.description ? "line-clamp-1 text-gray-900" : "line-clamp-2 text-gray-600", " ").concat(editor === null || editor === void 0 ? void 0 : editor.shortDescription)}>
|
|
21
|
-
{item === null || item === void 0 ? void 0 : item.short_description}
|
|
22
|
-
</Body>)}
|
|
23
|
-
<Body variant="body-lg" className={"text-gray-600 line-clamp-2 ".concat(editor === null || editor === void 0 ? void 0 : editor.cardText)} dangerouslySetInnerHTML={{
|
|
24
|
-
__html: item.description || "",
|
|
25
|
-
}}/>
|
|
26
|
-
</div>);
|
|
27
|
-
};
|
|
28
|
-
// Common button component with conditional shape
|
|
29
|
-
var ActionButton = function (_a) {
|
|
30
|
-
var _b = _a.className, className = _b === void 0 ? "" : _b;
|
|
31
|
-
return (<div>
|
|
32
|
-
{btnLabel && (<Button endIcon={"angle-right"} size={"sm"} {...(mediaPosition === "middle" && { shape: "rounded-full" })} className={"".concat(mediaPosition === "middle" && "shadow-md !font-semibold", " ").concat(editor === null || editor === void 0 ? void 0 : editor.cardBtn, " ").concat(className)} onClick={onButtonClick}>
|
|
33
|
-
{btnLabel}
|
|
34
|
-
</Button>)}
|
|
35
|
-
</div>);
|
|
36
|
-
};
|
|
37
|
-
// Horizontal layout
|
|
38
|
-
if (orientation === "horizontal") {
|
|
39
|
-
return (<div className={"!p-5 bg-white rounded-2xl flex ".concat(mediaPosition === "right" ? "flex-row-reverse" : "", " !gap-5 items-center shadow-lg ").concat(editor === null || editor === void 0 ? void 0 : editor.card)}>
|
|
40
|
-
<CardMedia className="max-w-48 aspect-square rounded-lg"/>
|
|
41
|
-
<div className="flex flex-col !gap-5 w-full">
|
|
42
|
-
<CardContent />
|
|
43
|
-
|
|
44
|
-
<ActionButton />
|
|
45
|
-
</div>
|
|
46
|
-
</div>);
|
|
47
|
-
}
|
|
48
|
-
// Vertical layout
|
|
49
|
-
return (<div className={"!p-4 bg-white rounded-2xl flex flex-col !gap-5 max-w-md shadow-lg ".concat(editor === null || editor === void 0 ? void 0 : editor.card)}>
|
|
50
|
-
<div className={"flex ".concat(mediaPosition === "top" ? "flex-col" : "flex-col-reverse", " !gap-4")}>
|
|
51
|
-
{mediaPosition === "middle" && (<Body variant="body-lg" className={"text-gray-600 line-clamp-2 ".concat(editor === null || editor === void 0 ? void 0 : editor.cardText)} dangerouslySetInnerHTML={{
|
|
52
|
-
__html: item.description || "",
|
|
53
|
-
}}/>)}
|
|
54
|
-
<CardMedia className="aspect-16/10"/>
|
|
55
|
-
<div className={"flex flex-col !gap-1"}>
|
|
56
|
-
<Heading variant="h4-700" className={"line-clamp-1 capitalize ".concat(editor === null || editor === void 0 ? void 0 : editor.cardTitle)}>
|
|
57
|
-
{item === null || item === void 0 ? void 0 : item.title}
|
|
58
|
-
</Heading>
|
|
59
|
-
|
|
60
|
-
{(item === null || item === void 0 ? void 0 : item.short_description) && (<Body variant={mediaPosition === "middle" ? "body-lg-500" : "body-xl"} className={"".concat(item.description ? "line-clamp-1 text-gray-600" : "line-clamp-2 h-14 text-gray-600", " ").concat(editor === null || editor === void 0 ? void 0 : editor.shortDescription)}>
|
|
61
|
-
{item === null || item === void 0 ? void 0 : item.short_description}
|
|
62
|
-
</Body>)}
|
|
63
|
-
{mediaPosition !== "middle" && (<Body variant="body-lg" className={"text-gray-600 line-clamp-2 ".concat(editor === null || editor === void 0 ? void 0 : editor.cardText)} dangerouslySetInnerHTML={{
|
|
64
|
-
__html: item.description || "",
|
|
65
|
-
}}/>)}
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|
|
68
|
-
<ActionButton />
|
|
69
|
-
</div>);
|
|
70
|
-
};
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
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 { Dummy_Image, Dummy_Para, Dummy_Subtitle, Dummy_Title, } from "../../../utils/constants";
|
|
13
|
-
import { OrientationEnum } from "../../../utils/enums";
|
|
14
|
-
import Card from "../card";
|
|
15
|
-
var meta = {
|
|
16
|
-
title: "Components/Cards/MultiNews",
|
|
17
|
-
component: Card,
|
|
18
|
-
parameters: {
|
|
19
|
-
layout: "centered",
|
|
20
|
-
},
|
|
21
|
-
argTypes: {
|
|
22
|
-
type: {
|
|
23
|
-
control: false,
|
|
24
|
-
table: {
|
|
25
|
-
disable: true,
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
orientation: {
|
|
29
|
-
control: "select",
|
|
30
|
-
options: [OrientationEnum.horizontal, OrientationEnum.vertical],
|
|
31
|
-
},
|
|
32
|
-
mediaPosition: {
|
|
33
|
-
control: "select",
|
|
34
|
-
options: ["left", "right", "top", "middle", "bottom"],
|
|
35
|
-
description: "For horizontal: use left/right. For vertical: use top/middle/bottom",
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
decorators: [
|
|
39
|
-
function (Story, context) {
|
|
40
|
-
// Dynamically update mediaPosition options based on orientation
|
|
41
|
-
var args = context.args;
|
|
42
|
-
var orientation = args.orientation;
|
|
43
|
-
if (orientation === OrientationEnum.horizontal) {
|
|
44
|
-
if (context.argTypes.mediaPosition) {
|
|
45
|
-
context.argTypes.mediaPosition.options = ["left", "right"];
|
|
46
|
-
}
|
|
47
|
-
// Reset mediaPosition if it's not valid for horizontal
|
|
48
|
-
if (args.mediaPosition &&
|
|
49
|
-
!["left", "right"].includes(args.mediaPosition)) {
|
|
50
|
-
args.mediaPosition = "left";
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
else if (orientation === OrientationEnum.vertical) {
|
|
54
|
-
if (context.argTypes.mediaPosition) {
|
|
55
|
-
context.argTypes.mediaPosition.options = ["top", "middle", "bottom"];
|
|
56
|
-
}
|
|
57
|
-
// Reset mediaPosition if it's not valid for vertical
|
|
58
|
-
if (args.mediaPosition &&
|
|
59
|
-
!["top", "middle", "bottom"].includes(args.mediaPosition)) {
|
|
60
|
-
args.mediaPosition = "top";
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return <Story />;
|
|
64
|
-
},
|
|
65
|
-
],
|
|
66
|
-
};
|
|
67
|
-
export default meta;
|
|
68
|
-
var baseCardArgs = {
|
|
69
|
-
item: {
|
|
70
|
-
image: Dummy_Image,
|
|
71
|
-
title: Dummy_Title,
|
|
72
|
-
description: Dummy_Para,
|
|
73
|
-
short_description: Dummy_Subtitle,
|
|
74
|
-
},
|
|
75
|
-
image: Dummy_Image,
|
|
76
|
-
onButtonClick: function () { return console.log("Button clicked"); },
|
|
77
|
-
btnLabel: "View More",
|
|
78
|
-
editor: {
|
|
79
|
-
card: "",
|
|
80
|
-
cardImage: "",
|
|
81
|
-
cardTitle: "",
|
|
82
|
-
cardText: "",
|
|
83
|
-
cardBtn: "",
|
|
84
|
-
shortDescription: "",
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
export var CardHorizontalLeft = {
|
|
88
|
-
args: __assign(__assign({ type: "multipleNews" }, baseCardArgs), { orientation: OrientationEnum.horizontal, mediaPosition: "left" }),
|
|
89
|
-
};
|
|
90
|
-
export var CardHorizontalRight = {
|
|
91
|
-
args: __assign(__assign({ type: "multipleNews" }, baseCardArgs), { orientation: OrientationEnum.horizontal, mediaPosition: "right" }),
|
|
92
|
-
};
|
|
93
|
-
export var CardVerticalTop = {
|
|
94
|
-
args: __assign(__assign({ type: "multipleNews" }, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "top" }),
|
|
95
|
-
};
|
|
96
|
-
export var CardVerticalBottom = {
|
|
97
|
-
args: __assign(__assign({ type: "multipleNews" }, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "bottom" }),
|
|
98
|
-
};
|
|
99
|
-
export var CardVerticalMiddle = {
|
|
100
|
-
args: __assign(__assign({ type: "multipleNews" }, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "middle" }),
|
|
101
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import LuImage from "../../Images/LuImage";
|
|
2
|
-
import Link from "next/link";
|
|
3
|
-
import { Heading } from "../../Typography/Heading/heading";
|
|
4
|
-
import { Body } from "../../Typography/Body/body";
|
|
5
|
-
import { Button } from "../../Button/Button/Button";
|
|
6
|
-
export var PostByCategory = function (_a) {
|
|
7
|
-
var item = _a.item, image = _a.image, href = _a.href, btnLabel = _a.btnLabel, editor = _a.editor, mediaPosition = _a.mediaPosition, orientation = _a.orientation;
|
|
8
|
-
// Normalize mediaPosition based on orientation
|
|
9
|
-
var safeMediaPosition = orientation === "horizontal"
|
|
10
|
-
? mediaPosition === "left" || mediaPosition === "right"
|
|
11
|
-
? mediaPosition
|
|
12
|
-
: "right"
|
|
13
|
-
: mediaPosition === "top" || mediaPosition === "bottom"
|
|
14
|
-
? mediaPosition
|
|
15
|
-
: "top";
|
|
16
|
-
// Common card media component to avoid duplication
|
|
17
|
-
var CardMedia = function (_a) {
|
|
18
|
-
var _b = _a.className, className = _b === void 0 ? "" : _b;
|
|
19
|
-
return (<LuImage src={image} width={240} height={240} className={"!rounded-lg ".concat(className, " ").concat(editor === null || editor === void 0 ? void 0 : editor.cardImage)} alt="Image"/>);
|
|
20
|
-
};
|
|
21
|
-
// Common content section component
|
|
22
|
-
var CardContent = function (_a) {
|
|
23
|
-
var _b = _a.className, className = _b === void 0 ? "" : _b;
|
|
24
|
-
return (<div className={"flex flex-col !gap-1 ".concat(className, " ")}>
|
|
25
|
-
<Heading variant="h4-600" className={"".concat(editor === null || editor === void 0 ? void 0 : editor.cardTitle, " capitalize line-clamp-1 !m-0")}>
|
|
26
|
-
{item === null || item === void 0 ? void 0 : item.title}
|
|
27
|
-
</Heading>
|
|
28
|
-
<Body variant="body-md" className={" ".concat(orientation === "horizontal" ? "line-clamp-1" : "line-clamp-2", " ").concat(editor === null || editor === void 0 ? void 0 : editor.cardText)}>
|
|
29
|
-
{item === null || item === void 0 ? void 0 : item.description}
|
|
30
|
-
</Body>
|
|
31
|
-
</div>);
|
|
32
|
-
};
|
|
33
|
-
// Common button component
|
|
34
|
-
var CardButton = function (_a) {
|
|
35
|
-
var _b = _a.className, className = _b === void 0 ? "" : _b;
|
|
36
|
-
return (<Link href={href || "#"} passHref>
|
|
37
|
-
<Button endIcon={"angle-right"} size="sm" className={"".concat(editor === null || editor === void 0 ? void 0 : editor.cardBtn, " ").concat(className)}>
|
|
38
|
-
{btnLabel}
|
|
39
|
-
</Button>
|
|
40
|
-
</Link>);
|
|
41
|
-
};
|
|
42
|
-
// Horizontal layout
|
|
43
|
-
if (orientation === "horizontal") {
|
|
44
|
-
return (<div className={"!p-5 rounded-xl grid grid-cols-1 sm:grid-cols-3 max-w-5xl !gap-5 items-center shadow-lg ".concat(editor === null || editor === void 0 ? void 0 : editor.card)}>
|
|
45
|
-
<CardMedia className={"".concat(safeMediaPosition === "right" && " order-last", " w-full aspect-5/4 sm:aspect-square object-cover")}/>
|
|
46
|
-
<div className="flex flex-col !gap-2 md:!gap-5 sm:col-span-2 h-full justify-center">
|
|
47
|
-
<CardContent />
|
|
48
|
-
<CardButton />
|
|
49
|
-
</div>
|
|
50
|
-
</div>);
|
|
51
|
-
}
|
|
52
|
-
// Vertical layout
|
|
53
|
-
return (<div className={"!p-5 sm:p-8 rounded-xl flex flex-col !gap-5 max-w-[480px] shadow-lg ".concat(editor === null || editor === void 0 ? void 0 : editor.card)}>
|
|
54
|
-
<div className={"flex w-full ".concat(safeMediaPosition === "top" ? "flex-col" : "flex-col-reverse", " items-center !gap-5 ")}>
|
|
55
|
-
<CardMedia className="w-full h-full aspect-5/4 object-cover"/>
|
|
56
|
-
<CardContent className="h-20"/>
|
|
57
|
-
</div>
|
|
58
|
-
<CardButton />
|
|
59
|
-
</div>);
|
|
60
|
-
};
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
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 { Dummy_Image, Dummy_Para, Dummy_Subtitle, Dummy_Title, Dummy_Url, } from "../../../utils/constants";
|
|
13
|
-
import { OrientationEnum } from "../../../utils/enums";
|
|
14
|
-
import Card from "../card";
|
|
15
|
-
var meta = {
|
|
16
|
-
title: "Components/Cards/PostByCategory",
|
|
17
|
-
component: Card,
|
|
18
|
-
parameters: {
|
|
19
|
-
layout: "centered",
|
|
20
|
-
},
|
|
21
|
-
argTypes: {
|
|
22
|
-
type: {
|
|
23
|
-
control: false,
|
|
24
|
-
table: {
|
|
25
|
-
disable: true,
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
orientation: {
|
|
29
|
-
control: "select",
|
|
30
|
-
options: [OrientationEnum.horizontal, OrientationEnum.vertical],
|
|
31
|
-
},
|
|
32
|
-
mediaPosition: {
|
|
33
|
-
control: "select",
|
|
34
|
-
options: ["left", "right", "top", "middle", "bottom"],
|
|
35
|
-
description: "For horizontal: use left/right. For vertical: use top/middle/bottom",
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
decorators: [
|
|
39
|
-
function (Story, context) {
|
|
40
|
-
// Dynamically update mediaPosition options based on orientation
|
|
41
|
-
var args = context.args;
|
|
42
|
-
var orientation = args.orientation;
|
|
43
|
-
if (orientation === OrientationEnum.horizontal) {
|
|
44
|
-
if (context.argTypes.mediaPosition) {
|
|
45
|
-
context.argTypes.mediaPosition.options = ["left", "right"];
|
|
46
|
-
}
|
|
47
|
-
// Reset mediaPosition if it's not valid for horizontal
|
|
48
|
-
if (args.mediaPosition &&
|
|
49
|
-
!["left", "right"].includes(args.mediaPosition)) {
|
|
50
|
-
args.mediaPosition = "left";
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
else if (orientation === OrientationEnum.vertical) {
|
|
54
|
-
if (context.argTypes.mediaPosition) {
|
|
55
|
-
context.argTypes.mediaPosition.options = ["top", "bottom"];
|
|
56
|
-
}
|
|
57
|
-
// Reset mediaPosition if it's not valid for vertical
|
|
58
|
-
if (args.mediaPosition &&
|
|
59
|
-
!["top", "middle", "bottom"].includes(args.mediaPosition)) {
|
|
60
|
-
args.mediaPosition = "top";
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return <Story />;
|
|
64
|
-
},
|
|
65
|
-
],
|
|
66
|
-
};
|
|
67
|
-
export default meta;
|
|
68
|
-
// Base card args
|
|
69
|
-
var baseCardArgs = {
|
|
70
|
-
item: {
|
|
71
|
-
image: Dummy_Image,
|
|
72
|
-
title: Dummy_Title,
|
|
73
|
-
description: Dummy_Para,
|
|
74
|
-
short_description: Dummy_Subtitle,
|
|
75
|
-
},
|
|
76
|
-
image: Dummy_Image,
|
|
77
|
-
href: Dummy_Url,
|
|
78
|
-
btnLabel: "View More",
|
|
79
|
-
editor: {
|
|
80
|
-
card: "",
|
|
81
|
-
cardImage: "",
|
|
82
|
-
cardTitle: "",
|
|
83
|
-
cardText: "",
|
|
84
|
-
cardBtn: "",
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
// PostByCategory Card Stories
|
|
88
|
-
export var PostByCategoryHorizontalLeft = {
|
|
89
|
-
args: __assign(__assign({ type: "postByCategory" }, baseCardArgs), { orientation: OrientationEnum.horizontal, mediaPosition: "left" }),
|
|
90
|
-
};
|
|
91
|
-
export var PostByCategoryHorizontalRight = {
|
|
92
|
-
args: __assign(__assign({ type: "postByCategory" }, baseCardArgs), { orientation: OrientationEnum.horizontal, mediaPosition: "right" }),
|
|
93
|
-
};
|
|
94
|
-
export var PostByCategoryVerticalTop = {
|
|
95
|
-
args: __assign(__assign({ type: "postByCategory" }, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "top" }),
|
|
96
|
-
};
|
|
97
|
-
export var PostByCategoryVerticalMiddle = {
|
|
98
|
-
args: __assign(__assign({ type: "postByCategory" }, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "middle" }),
|
|
99
|
-
};
|
|
100
|
-
export var PostByCategoryVerticalBottom = {
|
|
101
|
-
args: __assign(__assign({ type: "postByCategory" }, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "bottom" }),
|
|
102
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import LuImage from "../../Images/LuImage";
|
|
2
|
-
import Link from "next/link";
|
|
3
|
-
import { Heading } from "../../Typography/Heading/heading";
|
|
4
|
-
import { Body } from "../../Typography/Body/body";
|
|
5
|
-
import { Button } from "../../Button/Button/Button";
|
|
6
|
-
export var SinglePost = function (_a) {
|
|
7
|
-
var item = _a.item, image = _a.image, _b = _a.href, href = _b === void 0 ? "https://www.google.com/" : _b, _c = _a.btnLabel, btnLabel = _c === void 0 ? "View More" : _c, editor = _a.editor, _d = _a.mediaPosition, mediaPosition = _d === void 0 ? "right" : _d;
|
|
8
|
-
return (<div className={" bg-white rounded-3xl grid grid-cols-1 sm:grid-cols-2 overflow-hidden items-stretch shadow-lg ".concat(editor === null || editor === void 0 ? void 0 : editor.card)}>
|
|
9
|
-
<LuImage src={image} width={240} height={240} className={"w-full h-full ".concat(mediaPosition === "right" ? "order-1" : "", " aspect-5/4 object-cover ").concat(editor === null || editor === void 0 ? void 0 : editor.cardImage)} alt="Image"/>
|
|
10
|
-
<div className="p-9 grid grid-rows-[1fr] items-center !gap-2 ">
|
|
11
|
-
<div className="flex flex-col !gap-3 ">
|
|
12
|
-
<Heading variant="h2-500" className={"line-clamp-1 md:line-clamp-2 ".concat(editor === null || editor === void 0 ? void 0 : editor.cardTitle)}>
|
|
13
|
-
{item === null || item === void 0 ? void 0 : item.title}
|
|
14
|
-
</Heading>
|
|
15
|
-
<Body variant="body-xl" className={"line-clamp-2 ".concat(editor === null || editor === void 0 ? void 0 : editor.cardText, " ")}>
|
|
16
|
-
{item === null || item === void 0 ? void 0 : item.description}
|
|
17
|
-
</Body>
|
|
18
|
-
</div>
|
|
19
|
-
<Link href={href} passHref>
|
|
20
|
-
<Button endIcon={"angle-right"} size="lg" className={"".concat(editor === null || editor === void 0 ? void 0 : editor.cardBtn)}>
|
|
21
|
-
{btnLabel}
|
|
22
|
-
</Button>
|
|
23
|
-
</Link>
|
|
24
|
-
</div>
|
|
25
|
-
</div>);
|
|
26
|
-
};
|