linkedunion-design-kit 1.7.2 → 1.7.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/src/components/Button/Button.js +4 -4
- package/dist/src/components/Card/{MultiNews.d.ts → MultipleNews/MultiNews.d.ts} +1 -1
- package/dist/src/components/Card/MultipleNews/MultiNews.js +48 -0
- package/dist/src/components/Card/MultipleNews/MultiNews.jsx +73 -0
- package/dist/src/components/Card/MultipleNews/MultiNews.stories.d.ts +9 -0
- package/dist/src/components/Card/{MultiNews.stories.js → MultipleNews/MultiNews.stories.js} +7 -7
- package/dist/src/components/Card/{MultiNews.stories.jsx → MultipleNews/MultiNews.stories.jsx} +1 -1
- package/dist/src/components/Card/PhotoGallery.jsx +17 -0
- package/dist/src/components/Card/PhotoGallery.stories.jsx +34 -0
- package/dist/src/components/Card/PostByCategory/PostByCategory.jsx +10 -10
- package/dist/src/components/Card/SinglePost/SinglePost.d.ts +2 -0
- package/dist/src/components/Card/SinglePost/SinglePost.js +10 -0
- package/dist/src/components/Card/SinglePost/SinglePost.stories.d.ts +7 -0
- package/dist/src/components/Card/{ContactProfile.stories.js → SinglePost/SinglePost.stories.js} +7 -13
- package/dist/src/components/Card/card.js +2 -2
- package/dist/src/components/Card/card.jsx +4 -2
- package/dist/src/components/Card/contactProfile/ContactProfile.jsx +60 -0
- package/dist/src/components/Card/{ContactProfile.stories.jsx → contactProfile/ContactProfile.stories.jsx} +1 -1
- package/dist/src/components/Icons/LUIcon.jsx +1 -1
- package/dist/src/components/ImageUploader/imageUploader.js +1 -1
- package/dist/src/components/ImageUploader/imageUploader.jsx +4 -2
- package/dist/src/components/Label/Label.js +1 -1
- package/dist/src/components/Label/Label.jsx +1 -1
- package/dist/src/components/RadioButton/radio-button.jsx +0 -1
- package/dist/src/components/Slider/Slider.stories.jsx +159 -0
- package/dist/src/components/Slider/slider.jsx +31 -0
- package/dist/src/components/Typography/Heading/heading.js +1 -1
- package/dist/src/components/Typography/Heading/heading.jsx +1 -1
- package/dist/src/components/ui/accordion.js +1 -1
- package/dist/src/components/ui/accordion.jsx +4 -4
- package/dist/src/components/ui/switch.js +4 -4
- package/dist/src/components/ui/tabs.js +2 -2
- package/dist/src/components/ui/tabs.jsx +2 -3
- package/dist/src/utils/iconList.js +1 -1
- package/dist/styles/global.css +53 -30
- package/package.json +1 -1
- package/dist/src/components/Card/ContactProfile.d.ts +0 -2
- package/dist/src/components/Card/ContactProfile.js +0 -35
- package/dist/src/components/Card/ContactProfile.jsx +0 -57
- package/dist/src/components/Card/ContactProfile.stories.d.ts +0 -9
- package/dist/src/components/Card/MultiNews.js +0 -43
- package/dist/src/components/Card/MultiNews.jsx +0 -59
- package/dist/src/components/Card/MultiNews.stories.d.ts +0 -9
- package/dist/src/components/Card/PostByCategory.d.ts +0 -2
- package/dist/src/components/Card/PostByCategory.js +0 -38
- package/dist/src/components/Card/PostByCategory.stories.d.ts +0 -9
- package/dist/src/components/Card/PostByCategory.stories.js +0 -54
- package/dist/src/components/EditorTooltip/EditorTooltip.d.ts +0 -5
- package/dist/src/components/EditorTooltip/EditorTooltip.js +0 -8
- package/dist/src/components/EditorTooltip/EditorTooltip.stories.d.ts +0 -6
- package/dist/src/components/EditorTooltip/EditorTooltip.stories.js +0 -24
- package/dist/src/components/Label/type.d.ts +0 -9
- package/dist/src/components/Label/type.js +0 -1
- package/dist/src/components/ui/body.d.ts +0 -0
- package/dist/src/components/ui/body.js +0 -1
- package/dist/src/components/ui/label.d.ts +0 -12
- package/dist/src/components/ui/label.js +0 -41
- package/dist/src/components/ui/radio-button.d.ts +0 -3
- package/dist/src/components/ui/radio-button.js +0 -42
|
@@ -34,10 +34,10 @@ export var color = {
|
|
|
34
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",
|
|
35
35
|
};
|
|
36
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",
|
|
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
41
|
};
|
|
42
42
|
export var shape = {
|
|
43
43
|
"rounded-sm": "!rounded-sm",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CardInterface } from "
|
|
1
|
+
import { CardInterface } from "../type";
|
|
2
2
|
export declare const MultiNews: ({ item, image, href, btnLabel, editor, mediaPosition, orientation, }: CardInterface) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,48 @@
|
|
|
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 { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
import LuImage from "../../Images/LuImage";
|
|
14
|
+
import Link from "next/link";
|
|
15
|
+
import { Button } from "../../Button/Button";
|
|
16
|
+
import { Body } from "../../Typography/Body/body";
|
|
17
|
+
import { Heading } from "../../Typography/Heading/heading";
|
|
18
|
+
export var MultiNews = function (_a) {
|
|
19
|
+
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, orientation = _a.orientation;
|
|
20
|
+
// Create modified item with shuffled subtitle and description when mediaPosition is middle
|
|
21
|
+
var modifiedItem = mediaPosition === "middle"
|
|
22
|
+
? __assign(__assign({}, item), { description: item.subtitle, subtitle: item.description }) : item;
|
|
23
|
+
// Common card media component
|
|
24
|
+
var CardMedia = function (_a) {
|
|
25
|
+
var _b = _a.className, className = _b === void 0 ? "" : _b;
|
|
26
|
+
return (_jsx(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" }));
|
|
27
|
+
};
|
|
28
|
+
// Common content section
|
|
29
|
+
var CardContent = function (_a) {
|
|
30
|
+
var _b = _a.className, className = _b === void 0 ? "" : _b;
|
|
31
|
+
return (_jsxs("div", { className: "flex flex-col !gap-1 ".concat(className), children: [_jsx(Heading, { variant: "h5-700", className: "line-clamp-1 capitalize ".concat(editor === null || editor === void 0 ? void 0 : editor.cardTitle), children: modifiedItem === null || modifiedItem === void 0 ? void 0 : modifiedItem.title }), _jsx(Body, { variant: "body-xl", className: "".concat(mediaPosition === "middle" ? "line-clamp-1" : "line-clamp-2 h-16", " ").concat(editor === null || editor === void 0 ? void 0 : editor.cardText), children: modifiedItem === null || modifiedItem === void 0 ? void 0 : modifiedItem.description })] }));
|
|
32
|
+
};
|
|
33
|
+
// Common button component with conditional shape
|
|
34
|
+
var ActionButton = function (_a) {
|
|
35
|
+
var _b = _a.className, className = _b === void 0 ? "" : _b;
|
|
36
|
+
return (_jsx(Link, { href: href, passHref: true, className: className, children: _jsx(Button, __assign({ endIcon: "angle-right", size: mediaPosition === "middle" ? "xl" : "lg" }, (mediaPosition === "middle" && { shape: "rounded-full" }), { className: "".concat(editor === null || editor === void 0 ? void 0 : editor.cardBtn), children: btnLabel })) }));
|
|
37
|
+
};
|
|
38
|
+
// Optional subtitle component
|
|
39
|
+
var Subtitle = function () { return (_jsx(_Fragment, { children: mediaPosition === "middle" && (_jsx(Body, { variant: "body-xl", className: "line-clamp-4 h-32 ".concat(editor === null || editor === void 0 ? void 0 : editor.cardSubtitle), dangerouslySetInnerHTML: {
|
|
40
|
+
__html: modifiedItem.subtitle || "",
|
|
41
|
+
} })) })); };
|
|
42
|
+
// Horizontal layout
|
|
43
|
+
if (orientation === "horizontal") {
|
|
44
|
+
return (_jsxs("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), children: [_jsx(CardMedia, { className: "max-w-40 aspect-square rounded-lg" }), _jsxs("div", { className: "flex flex-col !gap-5 w-full", children: [_jsx(CardContent, {}), _jsx(ActionButton, {})] })] }));
|
|
45
|
+
}
|
|
46
|
+
// Vertical layout
|
|
47
|
+
return (_jsxs("div", { className: "p-8 bg-white rounded-2xl flex flex-col !gap-5 max-w-md shadow-lg ".concat(editor === null || editor === void 0 ? void 0 : editor.card), children: [_jsxs("div", { className: "flex ".concat(mediaPosition === "top" ? "flex-col" : "flex-col-reverse", " !gap-5"), children: [_jsx(Subtitle, {}), _jsx(CardMedia, { className: "aspect-16/10" }), _jsx(CardContent, {})] }), _jsx(ActionButton, {})] }));
|
|
48
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
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 LuImage from "../../Images/LuImage";
|
|
13
|
+
import Link from "next/link";
|
|
14
|
+
import { Button } from "../../Button/Button";
|
|
15
|
+
import { Body } from "../../Typography/Body/body";
|
|
16
|
+
import { Heading } from "../../Typography/Heading/heading";
|
|
17
|
+
export var MultiNews = function (_a) {
|
|
18
|
+
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, orientation = _a.orientation;
|
|
19
|
+
// Create modified item with shuffled subtitle and description when mediaPosition is middle
|
|
20
|
+
var modifiedItem = mediaPosition === "middle"
|
|
21
|
+
? __assign(__assign({}, item), { description: item.subtitle, subtitle: item.description }) : item;
|
|
22
|
+
// Common card media component
|
|
23
|
+
var CardMedia = function (_a) {
|
|
24
|
+
var _b = _a.className, className = _b === void 0 ? "" : _b;
|
|
25
|
+
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"/>);
|
|
26
|
+
};
|
|
27
|
+
// Common content section
|
|
28
|
+
var CardContent = function (_a) {
|
|
29
|
+
var _b = _a.className, className = _b === void 0 ? "" : _b;
|
|
30
|
+
return (<div className={"flex flex-col !gap-1 ".concat(className)}>
|
|
31
|
+
<Heading variant="h5-700" className={"line-clamp-1 capitalize ".concat(editor === null || editor === void 0 ? void 0 : editor.cardTitle)}>
|
|
32
|
+
{modifiedItem === null || modifiedItem === void 0 ? void 0 : modifiedItem.title}
|
|
33
|
+
</Heading>
|
|
34
|
+
<Body variant="body-xl" className={"".concat(mediaPosition === "middle" ? "line-clamp-1" : "line-clamp-2 h-16", " ").concat(editor === null || editor === void 0 ? void 0 : editor.cardText)}>
|
|
35
|
+
{modifiedItem === null || modifiedItem === void 0 ? void 0 : modifiedItem.description}
|
|
36
|
+
</Body>
|
|
37
|
+
</div>);
|
|
38
|
+
};
|
|
39
|
+
// Common button component with conditional shape
|
|
40
|
+
var ActionButton = function (_a) {
|
|
41
|
+
var _b = _a.className, className = _b === void 0 ? "" : _b;
|
|
42
|
+
return (<Link href={href} passHref className={className}>
|
|
43
|
+
<Button endIcon={"angle-right"} size={mediaPosition === "middle" ? "xl" : "lg"} {...(mediaPosition === "middle" && { shape: "rounded-full" })} className={"".concat(editor === null || editor === void 0 ? void 0 : editor.cardBtn)}>
|
|
44
|
+
{btnLabel}
|
|
45
|
+
</Button>
|
|
46
|
+
</Link>);
|
|
47
|
+
};
|
|
48
|
+
// Optional subtitle component
|
|
49
|
+
var Subtitle = function () { return (<>
|
|
50
|
+
{mediaPosition === "middle" && (<Body variant="body-xl" className={"line-clamp-4 h-32 ".concat(editor === null || editor === void 0 ? void 0 : editor.cardSubtitle)} dangerouslySetInnerHTML={{
|
|
51
|
+
__html: modifiedItem.subtitle || "",
|
|
52
|
+
}}/>)}
|
|
53
|
+
</>); };
|
|
54
|
+
// Horizontal layout
|
|
55
|
+
if (orientation === "horizontal") {
|
|
56
|
+
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)}>
|
|
57
|
+
<CardMedia className="max-w-40 aspect-square rounded-lg"/>
|
|
58
|
+
<div className="flex flex-col !gap-5 w-full">
|
|
59
|
+
<CardContent />
|
|
60
|
+
<ActionButton />
|
|
61
|
+
</div>
|
|
62
|
+
</div>);
|
|
63
|
+
}
|
|
64
|
+
// Vertical layout
|
|
65
|
+
return (<div className={"p-8 bg-white rounded-2xl flex flex-col !gap-5 max-w-md shadow-lg ".concat(editor === null || editor === void 0 ? void 0 : editor.card)}>
|
|
66
|
+
<div className={"flex ".concat(mediaPosition === "top" ? "flex-col" : "flex-col-reverse", " !gap-5")}>
|
|
67
|
+
<Subtitle />
|
|
68
|
+
<CardMedia className="aspect-16/10"/>
|
|
69
|
+
<CardContent />
|
|
70
|
+
</div>
|
|
71
|
+
<ActionButton />
|
|
72
|
+
</div>);
|
|
73
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Card from "../card";
|
|
3
|
+
declare const meta: Meta<typeof Card>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Card>;
|
|
6
|
+
export declare const CardHorizontalLeft: Story;
|
|
7
|
+
export declare const CardHorizontalRight: Story;
|
|
8
|
+
export declare const CardVerticalTop: Story;
|
|
9
|
+
export declare const CardVerticalBottom: Story;
|
|
@@ -9,11 +9,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
12
|
+
import { Dummy_Image, Dummy_Para, Dummy_Subtitle, Dummy_Title, Dummy_Url, } from "../../../utils/constants";
|
|
13
|
+
import Card from "../card";
|
|
14
14
|
var meta = {
|
|
15
15
|
title: "Components/NewCard/MultiNews",
|
|
16
|
-
component:
|
|
16
|
+
component: Card,
|
|
17
17
|
parameters: {
|
|
18
18
|
layout: "centered",
|
|
19
19
|
},
|
|
@@ -38,15 +38,15 @@ var baseCardArgs = {
|
|
|
38
38
|
cardBtn: "",
|
|
39
39
|
},
|
|
40
40
|
};
|
|
41
|
-
export var
|
|
41
|
+
export var CardHorizontalLeft = {
|
|
42
42
|
args: __assign(__assign({}, baseCardArgs), { orientation: "horizontal", mediaPosition: "left" }),
|
|
43
43
|
};
|
|
44
|
-
export var
|
|
44
|
+
export var CardHorizontalRight = {
|
|
45
45
|
args: __assign(__assign({}, baseCardArgs), { orientation: "horizontal", mediaPosition: "right" }),
|
|
46
46
|
};
|
|
47
|
-
export var
|
|
47
|
+
export var CardVerticalTop = {
|
|
48
48
|
args: __assign(__assign({}, baseCardArgs), { orientation: "vertical", mediaPosition: "top" }),
|
|
49
49
|
};
|
|
50
|
-
export var
|
|
50
|
+
export var CardVerticalBottom = {
|
|
51
51
|
args: __assign(__assign({}, baseCardArgs), { orientation: "vertical", mediaPosition: "bottom" }),
|
|
52
52
|
};
|
package/dist/src/components/Card/{MultiNews.stories.jsx → MultipleNews/MultiNews.stories.jsx}
RENAMED
|
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { MultiNews } from "./MultiNews";
|
|
13
|
-
import { Dummy_Image, Dummy_Para, Dummy_Subtitle, Dummy_Title, Dummy_Url, } from "
|
|
13
|
+
import { Dummy_Image, Dummy_Para, Dummy_Subtitle, Dummy_Title, Dummy_Url, } from "../../../utils/constants";
|
|
14
14
|
var meta = {
|
|
15
15
|
title: "Components/NewCard/MultiNews",
|
|
16
16
|
component: MultiNews,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import LUIcon from "../Icons/LUIcon";
|
|
2
|
+
import LuImage from "../Images/LuImage";
|
|
3
|
+
import { Heading } from "../Typography/Heading/heading";
|
|
4
|
+
export var PhotoGallery = function (_a) {
|
|
5
|
+
var image = _a.image, item = _a.item, _b = _a.altText, altText = _b === void 0 ? "Photo Gallery" : _b, editor = _a.editor;
|
|
6
|
+
return (<div className={"group relative max-w-md max-h-md ".concat(editor === null || editor === void 0 ? void 0 : editor.card, " ").concat(editor === null || editor === void 0 ? void 0 : editor.cardImage)}>
|
|
7
|
+
<LuImage src={image} width={448} height={448} alt={altText} className={"aspect-square object-cover transition-transform"}/>
|
|
8
|
+
<div className={"absolute ".concat(editor === null || editor === void 0 ? void 0 : editor.cardOverlay, " inset-0 bg-linear-to-t from-black to-transparent")}></div>
|
|
9
|
+
<Heading variant="h4-700" className={"absolute line-clamp-1 text-white bottom-4 uppercase !px-5 ".concat(editor === null || editor === void 0 ? void 0 : editor.cardText)}>
|
|
10
|
+
{item === null || item === void 0 ? void 0 : item.title}
|
|
11
|
+
</Heading>
|
|
12
|
+
{/* Search icon - appears on hover */}
|
|
13
|
+
<div className="absolute inset-0 flex items-center justify-center bg-black/40 opacity-0 group-hover:!opacity-100 transition-opacity duration-300 ease-out">
|
|
14
|
+
<LUIcon icon="magnifying-glass" size="4xl" className={"".concat(editor === null || editor === void 0 ? void 0 : editor.cardText, " text-gray-100")}/>
|
|
15
|
+
</div>
|
|
16
|
+
</div>);
|
|
17
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { PhotoGallery } from "./PhotoGallery";
|
|
2
|
+
import { Dummy_Image, Dummy_Title } from "../../utils/constants";
|
|
3
|
+
import Card from "./card";
|
|
4
|
+
export default {
|
|
5
|
+
title: "Components/NewCard/PhotoGallery",
|
|
6
|
+
component: PhotoGallery,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
};
|
|
9
|
+
var Template = function (args) { return <Card {...args}/>; };
|
|
10
|
+
export var Default = Template.bind({});
|
|
11
|
+
Default.args = {
|
|
12
|
+
type: "photoGallery",
|
|
13
|
+
item: {
|
|
14
|
+
title: Dummy_Title,
|
|
15
|
+
},
|
|
16
|
+
image: Dummy_Image,
|
|
17
|
+
editor: {
|
|
18
|
+
card: "",
|
|
19
|
+
cardImage: "",
|
|
20
|
+
cardOverlay: "",
|
|
21
|
+
cardText: "",
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
Default.argTypes = {
|
|
25
|
+
type: {
|
|
26
|
+
control: false,
|
|
27
|
+
table: {
|
|
28
|
+
type: { summary: "string" },
|
|
29
|
+
defaultValue: {
|
|
30
|
+
summary: "photoGallery",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
@@ -16,13 +16,13 @@ export var PostByCategory = function (_a) {
|
|
|
16
16
|
// Common card media component to avoid duplication
|
|
17
17
|
var CardMedia = function (_a) {
|
|
18
18
|
var _b = _a.className, className = _b === void 0 ? "" : _b;
|
|
19
|
-
return (<LuImage src={image} width={240} height={240} className={"".concat(className, " ").concat(editor === null || editor === void 0 ? void 0 : editor.cardImage)} alt="Image"/>);
|
|
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
20
|
};
|
|
21
21
|
// Common content section component
|
|
22
22
|
var CardContent = function (_a) {
|
|
23
23
|
var _b = _a.className, className = _b === void 0 ? "" : _b;
|
|
24
24
|
return (<div className={"flex flex-col !gap-1 ".concat(className, " ")}>
|
|
25
|
-
<Heading variant="h5-700" className={"".concat(editor === null || editor === void 0 ? void 0 : editor.cardTitle, " line-clamp-1")}>
|
|
25
|
+
<Heading variant="h5-700" className={"".concat(editor === null || editor === void 0 ? void 0 : editor.cardTitle, " capitalize line-clamp-1 !m-0")}>
|
|
26
26
|
{item === null || item === void 0 ? void 0 : item.title}
|
|
27
27
|
</Heading>
|
|
28
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)}>
|
|
@@ -34,26 +34,26 @@ export var PostByCategory = function (_a) {
|
|
|
34
34
|
var CardButton = function (_a) {
|
|
35
35
|
var _b = _a.className, className = _b === void 0 ? "" : _b;
|
|
36
36
|
return (<Link href={href || "#"} passHref>
|
|
37
|
-
<Button endIcon={"angle-right"} size="lg" className={"".concat(editor === null || editor === void 0 ? void 0 : editor.cardBtn, "
|
|
37
|
+
<Button endIcon={"angle-right"} size="lg" className={"".concat(editor === null || editor === void 0 ? void 0 : editor.cardBtn, " ").concat(className)}>
|
|
38
38
|
{btnLabel}
|
|
39
39
|
</Button>
|
|
40
40
|
</Link>);
|
|
41
41
|
};
|
|
42
42
|
// Horizontal layout
|
|
43
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
|
|
45
|
-
<CardMedia className={"".concat(safeMediaPosition === "right" && " order-last", " w-full aspect-5/4 sm:aspect-square
|
|
46
|
-
<div className="flex flex-col !gap-
|
|
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-1 md:!gap-5 sm:col-span-2 text-center sm:!text-left h-full justify-center">
|
|
47
47
|
<CardContent />
|
|
48
|
-
<CardButton
|
|
48
|
+
<CardButton />
|
|
49
49
|
</div>
|
|
50
50
|
</div>);
|
|
51
51
|
}
|
|
52
52
|
// Vertical layout
|
|
53
|
-
return (<div className={"p-8 rounded-xl
|
|
54
|
-
<div className={"flex ".concat(safeMediaPosition === "top" ? "flex-col" : "flex-col-reverse", " items-center !gap-5 text-center")}>
|
|
53
|
+
return (<div className={"p-8 rounded-xl flex flex-col !gap-5 max-w-[480px] items-center 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 text-center")}>
|
|
55
55
|
<CardMedia className="w-full h-full aspect-5/4 object-cover"/>
|
|
56
|
-
<CardContent />
|
|
56
|
+
<CardContent className="h-20"/>
|
|
57
57
|
</div>
|
|
58
58
|
<CardButton />
|
|
59
59
|
</div>);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import LuImage from "../../Images/LuImage";
|
|
3
|
+
import Link from "next/link";
|
|
4
|
+
import { Heading } from "../../Typography/Heading/heading";
|
|
5
|
+
import { Body } from "../../Typography/Body/body";
|
|
6
|
+
import { Button } from "../../Button/Button";
|
|
7
|
+
export var SinglePost = function (_a) {
|
|
8
|
+
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;
|
|
9
|
+
return (_jsxs("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), children: [_jsx(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" }), _jsxs("div", { className: "p-9 grid grid-rows-[1fr] items-center !gap-2 ", children: [_jsxs("div", { className: "flex flex-col !gap-3 ", children: [_jsx(Heading, { variant: "h2", className: "line-clamp-1 md:line-clamp-2 ".concat(editor === null || editor === void 0 ? void 0 : editor.cardTitle), children: item === null || item === void 0 ? void 0 : item.title }), _jsx(Body, { variant: "body-xl", className: "line-clamp-2 ".concat(editor === null || editor === void 0 ? void 0 : editor.cardText, " "), children: item === null || item === void 0 ? void 0 : item.description })] }), _jsx(Link, { href: href, passHref: true, children: _jsx(Button, { endIcon: "angle-right", size: "lg", className: "".concat(editor === null || editor === void 0 ? void 0 : editor.cardBtn), children: btnLabel }) })] })] }));
|
|
10
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { SinglePost } from "./SinglePost";
|
|
3
|
+
declare const meta: Meta<typeof SinglePost>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof SinglePost>;
|
|
6
|
+
export declare const SinglePostHorizontalLeft: Story;
|
|
7
|
+
export declare const SinglePostHorizontalRight: Story;
|
package/dist/src/components/Card/{ContactProfile.stories.js → SinglePost/SinglePost.stories.js}
RENAMED
|
@@ -9,18 +9,18 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import {
|
|
13
|
-
import { Dummy_Image, Dummy_Para, Dummy_Subtitle, Dummy_Title, Dummy_Url, } from "
|
|
12
|
+
import { SinglePost } from "./SinglePost";
|
|
13
|
+
import { Dummy_Image, Dummy_Para, Dummy_Subtitle, Dummy_Title, Dummy_Url, } from "../../../utils/constants";
|
|
14
14
|
var meta = {
|
|
15
|
-
title: "Components/NewCard/
|
|
16
|
-
component:
|
|
15
|
+
title: "Components/NewCard/SinglePost",
|
|
16
|
+
component: SinglePost,
|
|
17
17
|
parameters: {
|
|
18
18
|
layout: "centered",
|
|
19
19
|
},
|
|
20
20
|
};
|
|
21
21
|
export default meta;
|
|
22
22
|
var baseCardArgs = {
|
|
23
|
-
type: "
|
|
23
|
+
type: "singlePost",
|
|
24
24
|
item: {
|
|
25
25
|
image: Dummy_Image,
|
|
26
26
|
title: Dummy_Title,
|
|
@@ -38,15 +38,9 @@ var baseCardArgs = {
|
|
|
38
38
|
cardBtn: "",
|
|
39
39
|
},
|
|
40
40
|
};
|
|
41
|
-
export var
|
|
41
|
+
export var SinglePostHorizontalLeft = {
|
|
42
42
|
args: __assign(__assign({}, baseCardArgs), { orientation: "horizontal", mediaPosition: "left" }),
|
|
43
43
|
};
|
|
44
|
-
export var
|
|
44
|
+
export var SinglePostHorizontalRight = {
|
|
45
45
|
args: __assign(__assign({}, baseCardArgs), { orientation: "horizontal", mediaPosition: "right" }),
|
|
46
46
|
};
|
|
47
|
-
export var ContactProfileVerticalTop = {
|
|
48
|
-
args: __assign(__assign({}, baseCardArgs), { orientation: "vertical", mediaPosition: "top" }),
|
|
49
|
-
};
|
|
50
|
-
export var ContactProfileVerticalBottom = {
|
|
51
|
-
args: __assign(__assign({}, baseCardArgs), { orientation: "vertical", mediaPosition: "bottom" }),
|
|
52
|
-
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { PostByCategory } from "./PostByCategory/PostByCategory";
|
|
4
|
-
import { MultiNews } from "./MultiNews";
|
|
5
|
-
import { SinglePost } from "./SinglePost";
|
|
4
|
+
import { MultiNews } from "./MultipleNews/MultiNews";
|
|
5
|
+
import { SinglePost } from "./SinglePost/SinglePost";
|
|
6
6
|
import { Dummy_Url } from "../../utils/constants";
|
|
7
7
|
import { PhotoGallery } from "./PhotoGallery";
|
|
8
8
|
import { ContactProfile } from "./contactProfile/ContactProfile";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { PostByCategory } from "./PostByCategory/PostByCategory";
|
|
3
|
-
import {
|
|
4
|
-
import { MultiNews } from "./MultiNews";
|
|
3
|
+
import { MultiNews } from "./MultipleNews/MultiNews";
|
|
5
4
|
import { SinglePost } from "./SinglePost";
|
|
6
5
|
import { Dummy_Url } from "../../utils/constants";
|
|
6
|
+
import { PhotoGallery } from "./PhotoGallery";
|
|
7
|
+
import { ContactProfile } from "./contactProfile/ContactProfile";
|
|
7
8
|
var Card = function (_a) {
|
|
8
9
|
var item = _a.item, image = _a.image, _b = _a.href, href = _b === void 0 ? Dummy_Url : _b, _c = _a.btnLabel, btnLabel = _c === void 0 ? "View More" : _c, editor = _a.editor, _d = _a.mediaPosition, mediaPosition = _d === void 0 ? "left" : _d, _e = _a.type, type = _e === void 0 ? "postByCategory" : _e, _f = _a.orientation, orientation = _f === void 0 ? "horizontal" : _f;
|
|
9
10
|
var cardProps = {
|
|
@@ -21,6 +22,7 @@ var Card = function (_a) {
|
|
|
21
22
|
contactProfile: ContactProfile,
|
|
22
23
|
multipleNews: MultiNews,
|
|
23
24
|
singlePost: SinglePost,
|
|
25
|
+
photoGallery: PhotoGallery,
|
|
24
26
|
};
|
|
25
27
|
return (<>
|
|
26
28
|
{type && cardComponents[type]
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import Link from "next/link";
|
|
2
|
+
import LuImage from "../../Images/LuImage";
|
|
3
|
+
import { Heading } from "../../Typography/Heading/heading";
|
|
4
|
+
import { Body } from "../../Typography/Body/body";
|
|
5
|
+
import { Button } from "../../Button/Button";
|
|
6
|
+
export var ContactProfile = 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={"w-full h-full rounded-full max-w-40 mx-auto aspect-square object-cover ".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="h5-700" 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 bg-white rounded-xl grid ".concat(safeMediaPosition === "left" ? "sm:grid-cols-[auto_1fr]" : "sm:grid-cols-[1fr_auto]", " max-w-5xl !gap-10 items-center shadow-lg ").concat(editor === null || editor === void 0 ? void 0 : editor.card)}>
|
|
45
|
+
<CardMedia className={"".concat(safeMediaPosition === "right" ? "order-3" : "order-1", " w-full max-w-40 aspect-square object-cover")}/>
|
|
46
|
+
<div className={"flex flex-col !gap-1 md:!gap-5 text-center sm:!text-left h-full justify-center ".concat(safeMediaPosition === "right" ? "order-1" : "order-2")}>
|
|
47
|
+
<CardContent />
|
|
48
|
+
<CardButton />
|
|
49
|
+
</div>
|
|
50
|
+
</div>);
|
|
51
|
+
}
|
|
52
|
+
// Vertical layout
|
|
53
|
+
return (<div className={"p-8 bg-white rounded-xl flex flex-col !gap-5 max-w-md items-center 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 text-center")}>
|
|
55
|
+
<CardMedia className="w-full h-full aspect-5/4 object-cover"/>
|
|
56
|
+
<CardContent className="h-20"/>
|
|
57
|
+
</div>
|
|
58
|
+
<CardButton />
|
|
59
|
+
</div>);
|
|
60
|
+
};
|
|
@@ -9,8 +9,8 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
import { Dummy_Image, Dummy_Para, Dummy_Subtitle, Dummy_Title, Dummy_Url, } from "../../../utils/constants";
|
|
12
13
|
import { ContactProfile } from "./ContactProfile";
|
|
13
|
-
import { Dummy_Image, Dummy_Para, Dummy_Subtitle, Dummy_Title, Dummy_Url, } from "../../utils/constants";
|
|
14
14
|
var meta = {
|
|
15
15
|
title: "Components/NewCard/ContactProfile",
|
|
16
16
|
component: ContactProfile,
|
|
@@ -28,7 +28,7 @@ var LUIcon = function (_a) {
|
|
|
28
28
|
</defs>
|
|
29
29
|
</svg>);
|
|
30
30
|
if (variant === "padded") {
|
|
31
|
-
return (<div className={"inline-flex items-center justify-center ".concat(paddingIcon, " ").concat(shape === "rounded" ? IconShape.rounded : IconShape.square[size], " ").concat(className, " ").concat(getAppliedColor(variant, color))}>
|
|
31
|
+
return (<div className={"luIcon-wrapper inline-flex items-center justify-center ".concat(paddingIcon, " ").concat(shape === "rounded" ? IconShape.rounded : IconShape.square[size], " ").concat(className, " ").concat(getAppliedColor(variant, color))}>
|
|
32
32
|
{svg}
|
|
33
33
|
</div>);
|
|
34
34
|
}
|
|
@@ -63,6 +63,6 @@ var ImageUploader = function (_a) {
|
|
|
63
63
|
"image/*": acceptedTypes,
|
|
64
64
|
},
|
|
65
65
|
}), getRootProps = _f.getRootProps, getInputProps = _f.getInputProps;
|
|
66
|
-
return (_jsxs("div", { className: cn("flex flex-col items-center", className), children: [_jsx("div", __assign({}, getRootProps(), { className: cn("!border !border-dashed !border-gray-300 !rounded-lg cursor-pointer w-64 !p-2"), children: _jsxs("div", { className: "min-h-40 flex items-center justify-center bg-gray-100 !rounded-lg", children: [_jsx("input", __assign({}, getInputProps())), preview ? (_jsx("div", { className: "relative w-full h-40 !mx-auto overflow-hidden", children: _jsx(LuImage, { src: preview, alt: "Uploaded", className: "aspect-square object-contain", fill: true }) })) : (_jsxs("div", { className: "text-center text-sm text-muted-foreground", children: [_jsx(LUIcon, { icon: "upload", size: "lg", className: "!mx-auto !mb-4" }), _jsx(Body, { variant: "body-xs-600", className: "!px-1", children: "Choose a file or drag & drop it here" }), _jsx("p", { className: "text-xs text-muted-foreground", children: "JPEG, PNG, and SVG formats" })] }))] }) })), fileError && (_jsx("p", { className: "text-sm text-red-500 text-center mt-2", children: fileError })), required && !preview && !fileError && (_jsx("p", { className: "text-sm text-red-500 text-center", children: "Image is required." })), preview && (_jsx(Button, { variant: "link", color: "
|
|
66
|
+
return (_jsxs("div", { className: cn("flex flex-col items-center", className), children: [_jsx("div", __assign({}, getRootProps(), { className: cn("!border !border-dashed !border-gray-300 !rounded-lg cursor-pointer w-64 !p-2"), children: _jsxs("div", { className: "min-h-40 flex items-center justify-center bg-gray-100 !rounded-lg", children: [_jsx("input", __assign({}, getInputProps())), preview ? (_jsx("div", { className: "relative w-full h-40 !mx-auto overflow-hidden", children: _jsx(LuImage, { src: preview, alt: "Uploaded", className: "aspect-square object-contain", fill: true }) })) : (_jsxs("div", { className: "text-center text-sm text-muted-foreground", children: [_jsx(LUIcon, { icon: "upload", size: "lg", className: "!mx-auto !mb-4" }), _jsx(Body, { variant: "body-xs-600", className: "!px-1", children: "Choose a file or drag & drop it here" }), _jsx("p", { className: "text-xs text-muted-foreground", children: "JPEG, PNG, and SVG formats" })] }))] }) })), fileError && (_jsx("p", { className: "text-sm text-red-500 text-center mt-2", children: fileError })), required && !preview && !fileError && (_jsx("p", { className: "text-sm text-red-500 text-center !mt-2", children: "Image is required." })), preview && (_jsx(Button, { variant: "link", color: "red", onClick: removeFile, className: "!mt-2", children: "Remove Image" }))] }));
|
|
67
67
|
};
|
|
68
68
|
export default ImageUploader;
|
|
@@ -71,9 +71,11 @@ var ImageUploader = function (_a) {
|
|
|
71
71
|
</div>
|
|
72
72
|
{fileError && (<p className="text-sm text-red-500 text-center mt-2">{fileError}</p>)}
|
|
73
73
|
|
|
74
|
-
{required && !preview && !fileError && (<p className="text-sm text-red-500 text-center">
|
|
74
|
+
{required && !preview && !fileError && (<p className="text-sm text-red-500 text-center !mt-2">
|
|
75
|
+
Image is required.
|
|
76
|
+
</p>)}
|
|
75
77
|
|
|
76
|
-
{preview && (<Button variant="link" color="
|
|
78
|
+
{preview && (<Button variant="link" color="red" onClick={removeFile} className="!mt-2">
|
|
77
79
|
Remove Image
|
|
78
80
|
</Button>)}
|
|
79
81
|
</div>);
|
|
@@ -28,7 +28,7 @@ export var variant = {
|
|
|
28
28
|
"label-xl": "!text-xl",
|
|
29
29
|
"label-lg": "!text-lg",
|
|
30
30
|
"label-md": "!text-base",
|
|
31
|
-
"label-sm": "!text-sm",
|
|
31
|
+
"label-sm": "!text-sm !font-normal",
|
|
32
32
|
};
|
|
33
33
|
var labelVariants = cva("flex items-center !gap-2 select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50 !font-medium !leading-normal m-0", {
|
|
34
34
|
variants: { variant: variant },
|
|
@@ -17,7 +17,7 @@ export var variant = {
|
|
|
17
17
|
"label-xl": "!text-xl",
|
|
18
18
|
"label-lg": "!text-lg",
|
|
19
19
|
"label-md": "!text-base",
|
|
20
|
-
"label-sm": "!text-sm",
|
|
20
|
+
"label-sm": "!text-sm !font-normal",
|
|
21
21
|
};
|
|
22
22
|
var labelVariants = cva("flex items-center !gap-2 select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50 !font-medium !leading-normal m-0", {
|
|
23
23
|
variants: { variant: variant },
|