linkedunion-design-kit 1.9.8 → 1.10.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.
Files changed (29) hide show
  1. package/dist/src/components/Alerts/AlertDialog/index.d.ts +1 -1
  2. package/dist/src/components/Badge/Badge.stories.d.ts +2 -2
  3. package/dist/src/components/Button/Button/Button.stories.d.ts +2 -2
  4. package/dist/src/components/Button/IconButton/IconButton.stories.d.ts +2 -2
  5. package/dist/src/components/Card/MultipleNews/MultiNews.d.ts +4 -1
  6. package/dist/src/components/Card/MultipleNews/MultiNews.js +14 -23
  7. package/dist/src/components/Card/MultipleNews/MultiNews.stories.d.ts +6 -3
  8. package/dist/src/components/Card/MultipleNews/MultiNews.stories.js +23 -26
  9. package/dist/src/components/Card/PostByCategory/PostByCategory.d.ts +4 -1
  10. package/dist/src/components/Card/PostByCategory/PostByCategory.js +2 -3
  11. package/dist/src/components/Card/PostByCategory/PostByCategory.stories.d.ts +6 -3
  12. package/dist/src/components/Card/PostByCategory/PostByCategory.stories.js +22 -26
  13. package/dist/src/components/Card/SinglePost/SinglePost.stories.d.ts +6 -3
  14. package/dist/src/components/Card/SinglePost/SinglePost.stories.js +10 -15
  15. package/dist/src/components/Card/card.d.ts +20 -2
  16. package/dist/src/components/Card/card.js +25 -29
  17. package/dist/src/components/Card/contactProfile/ContactProfile.stories.d.ts +6 -3
  18. package/dist/src/components/Card/contactProfile/ContactProfile.stories.js +22 -26
  19. package/dist/src/components/Card/photoAlbum/PhotoAlbum.d.ts +6 -1
  20. package/dist/src/components/Card/photoAlbum/PhotoAlbum.js +1 -1
  21. package/dist/src/components/Card/photoAlbum/PhotoAlbum.stories.d.ts +3 -2
  22. package/dist/src/components/Card/photoAlbum/PhotoAlbum.stories.js +13 -30
  23. package/dist/src/components/Card/photoGallery/PhotoGallery.d.ts +4 -1
  24. package/dist/src/components/Card/photoGallery/PhotoGallery.stories.d.ts +2 -2
  25. package/dist/src/components/Card/photoGallery/PhotoGallery.stories.js +13 -18
  26. package/dist/src/components/Card/type.d.ts +0 -2
  27. package/dist/src/components/SweetAlert/index.d.ts +1 -1
  28. package/dist/styles/global.css +18 -12
  29. package/package.json +1 -1
@@ -6,7 +6,7 @@ export declare const sizeOptions: Array<keyof typeof alertDialogVariants.size>;
6
6
  export declare const shadowOptions: Array<keyof typeof alertDialogVariants.shadow>;
7
7
  export declare const variantOptions: Array<keyof typeof alertDialogVariants.variant>;
8
8
  export declare const getButtonColor: (color: string) => string;
9
- export declare const getIconForColor: (color: string) => "info" | "check" | "circle-exclamation" | "star";
9
+ export declare const getIconForColor: (color: string) => "check" | "info" | "circle-exclamation" | "star";
10
10
  export declare const getContentForColor: (color: string) => {
11
11
  title: string;
12
12
  description: string;
@@ -130,7 +130,7 @@ declare const meta: {
130
130
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
131
131
  autoFocus?: boolean | undefined | undefined;
132
132
  className?: string | undefined | undefined;
133
- contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
133
+ contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
134
134
  contextMenu?: string | undefined | undefined;
135
135
  dir?: string | undefined | undefined;
136
136
  draggable?: (boolean | "true" | "false") | undefined;
@@ -422,7 +422,7 @@ declare const meta: {
422
422
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
423
423
  autoFocus?: boolean | undefined | undefined;
424
424
  className?: string | undefined | undefined;
425
- contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
425
+ contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
426
426
  contextMenu?: string | undefined | undefined;
427
427
  dir?: string | undefined | undefined;
428
428
  draggable?: (boolean | "true" | "false") | undefined;
@@ -118,7 +118,7 @@ declare const meta: {
118
118
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
119
119
  autoFocus?: boolean | undefined | undefined;
120
120
  className?: string | undefined | undefined;
121
- contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
121
+ contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
122
122
  contextMenu?: string | undefined | undefined;
123
123
  dir?: string | undefined | undefined;
124
124
  draggable?: (boolean | "true" | "false") | undefined;
@@ -418,7 +418,7 @@ declare const meta: {
418
418
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
419
419
  autoFocus?: boolean | undefined | undefined;
420
420
  className?: string | undefined | undefined;
421
- contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
421
+ contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
422
422
  contextMenu?: string | undefined | undefined;
423
423
  dir?: string | undefined | undefined;
424
424
  draggable?: (boolean | "true" | "false") | undefined;
@@ -129,7 +129,7 @@ declare const meta: {
129
129
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
130
130
  autoFocus?: boolean | undefined | undefined;
131
131
  className?: string | undefined | undefined;
132
- contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
132
+ contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
133
133
  contextMenu?: string | undefined | undefined;
134
134
  dir?: string | undefined | undefined;
135
135
  draggable?: (boolean | "true" | "false") | undefined;
@@ -428,7 +428,7 @@ declare const meta: {
428
428
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
429
429
  autoFocus?: boolean | undefined | undefined;
430
430
  className?: string | undefined | undefined;
431
- contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
431
+ contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
432
432
  contextMenu?: string | undefined | undefined;
433
433
  dir?: string | undefined | undefined;
434
434
  draggable?: (boolean | "true" | "false") | undefined;
@@ -1,2 +1,5 @@
1
1
  import { CardInterface } from "../type";
2
- export declare const MultiNews: ({ item, image, href, btnLabel, editor, mediaPosition, orientation, }: CardInterface) => import("react/jsx-runtime").JSX.Element;
2
+ export interface MultiNewsProps extends Omit<CardInterface, "href" | "type"> {
3
+ onButtonClick?: () => void;
4
+ }
5
+ export declare const MultipleNewsCard: (props: MultiNewsProps) => import("react/jsx-runtime").JSX.Element;
@@ -9,47 +9,38 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import LuImage from "../../Images/LuImage";
14
- import Link from "next/link";
15
14
  import { Button } from "../../Button/Button/Button";
16
15
  import { Body } from "../../Typography/Body/body";
17
16
  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
- // Use destructuring to create cleaner code
21
- var modifiedItem = item;
22
- var modifiedEditor = editor;
23
- // Only swap for middle position
24
- if (mediaPosition === "middle") {
25
- // Swap for item
26
- modifiedItem = __assign(__assign({}, item), { description: item === null || item === void 0 ? void 0 : item.short_description, short_description: item === null || item === void 0 ? void 0 : item.description });
27
- // Swap for editor
28
- modifiedEditor = __assign(__assign({}, editor), { cardText: editor === null || editor === void 0 ? void 0 : editor.shortDescription, shortDescription: editor === null || editor === void 0 ? void 0 : editor.cardText });
29
- }
17
+ export var MultipleNewsCard = function (props) {
18
+ 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;
30
19
  // Common card media component
31
20
  var CardMedia = function (_a) {
32
21
  var _b = _a.className, className = _b === void 0 ? "" : _b;
33
- return (_jsx(LuImage, { src: image, width: 240, height: 240, className: " object-cover w-full ".concat(className, " ").concat(modifiedEditor === null || modifiedEditor === void 0 ? void 0 : modifiedEditor.cardImage), alt: "Image" }));
22
+ 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" }));
34
23
  };
35
24
  // Common content section
36
25
  var CardContent = function (_a) {
37
26
  var _b = _a.className, className = _b === void 0 ? "" : _b;
38
- return (_jsxs("div", { className: "flex flex-col !gap-1 ".concat(className), children: [_jsx(Heading, { variant: "h4-600", className: "line-clamp-1 capitalize ".concat(modifiedEditor === null || modifiedEditor === void 0 ? void 0 : modifiedEditor.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(modifiedEditor === null || modifiedEditor === void 0 ? void 0 : modifiedEditor.cardText), children: modifiedItem === null || modifiedItem === void 0 ? void 0 : modifiedItem.description })] }));
27
+ return (_jsxs("div", { className: "flex flex-col !gap-2 ".concat(className), children: [_jsx(Heading, { variant: "h4-600", className: "line-clamp-1 capitalize ".concat(editor === null || editor === void 0 ? void 0 : editor.cardTitle), children: item === null || item === void 0 ? void 0 : item.title }), (item === null || item === void 0 ? void 0 : item.short_description) && (_jsx(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), children: item === null || item === void 0 ? void 0 : item.short_description })), _jsx(Body, { variant: "body-lg", className: "text-gray-600 line-clamp-2 ".concat(editor === null || editor === void 0 ? void 0 : editor.cardText), dangerouslySetInnerHTML: {
28
+ __html: item.description || "",
29
+ } })] }));
39
30
  };
40
31
  // Common button component with conditional shape
41
32
  var ActionButton = function (_a) {
42
33
  var _b = _a.className, className = _b === void 0 ? "" : _b;
43
- return (_jsx(Link, { href: href, passHref: true, className: className, children: _jsx(Button, __assign({ endIcon: "angle-right", size: mediaPosition === "middle" ? "xl" : "sm" }, (mediaPosition === "middle" && { shape: "rounded-full" }), { className: "".concat(modifiedEditor === null || modifiedEditor === void 0 ? void 0 : modifiedEditor.cardBtn), children: btnLabel })) }));
34
+ return (_jsx("div", { children: btnLabel && (_jsx(Button, __assign({ 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, children: btnLabel }))) }));
44
35
  };
45
- // Optional subtitle component
46
- var Subtitle = function () { return (_jsx(_Fragment, { children: mediaPosition === "middle" && (_jsx(Body, { variant: "body-xl", className: "line-clamp-4 h-32 ".concat(modifiedEditor === null || modifiedEditor === void 0 ? void 0 : modifiedEditor.shortDescription), dangerouslySetInnerHTML: {
47
- __html: modifiedItem.short_description || "",
48
- } })) })); };
49
36
  // Horizontal layout
50
37
  if (orientation === "horizontal") {
51
- return (_jsxs("div", { className: "!p-5 bg-white rounded-2xl flex ".concat(mediaPosition === "right" ? "flex-row-reverse" : "", " !gap-5 items-center shadow-lg ").concat(modifiedEditor === null || modifiedEditor === void 0 ? void 0 : modifiedEditor.card), children: [_jsx(CardMedia, { className: "max-w-48 aspect-square rounded-lg" }), _jsxs("div", { className: "flex flex-col !gap-5 w-full", children: [_jsx(CardContent, {}), _jsx(ActionButton, {})] })] }));
38
+ return (_jsxs("div", { className: "!p-5 bg-white rounded-2xl flex max-sm:flex-col ".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: "w-full sm:max-w-48 aspect-square rounded-lg" }), _jsxs("div", { className: "flex flex-col !gap-5 w-full", children: [_jsx(CardContent, {}), _jsx(ActionButton, {})] })] }));
52
39
  }
53
40
  // Vertical layout
54
- return (_jsxs("div", { className: "p-8 bg-white rounded-2xl flex flex-col !gap-5 max-w-md shadow-lg ".concat(modifiedEditor === null || modifiedEditor === void 0 ? void 0 : modifiedEditor.card), children: [_jsxs("div", { className: "flex ".concat(mediaPosition === "top" ? "flex-col" : "flex-col-reverse", " !gap-4"), children: [_jsx(Subtitle, {}), _jsx(CardMedia, { className: "aspect-16/10" }), _jsx(CardContent, {})] }), _jsx(ActionButton, {})] }));
41
+ return (_jsxs("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), children: [_jsxs("div", { className: "flex ".concat(mediaPosition === "top" ? "flex-col" : "flex-col-reverse", " !gap-4"), children: [mediaPosition === "middle" && (_jsx(Body, { variant: "body-lg", className: "text-gray-600 line-clamp-2 h-14 ".concat(editor === null || editor === void 0 ? void 0 : editor.cardText), dangerouslySetInnerHTML: {
42
+ __html: item.description || "",
43
+ } })), _jsx(CardMedia, { className: "aspect-16/10" }), _jsxs("div", { className: "flex flex-col !gap-1", children: [_jsx(Heading, { variant: "h4-700", className: "line-clamp-1 capitalize ".concat(editor === null || editor === void 0 ? void 0 : editor.cardTitle), children: item === null || item === void 0 ? void 0 : item.title }), _jsx(Body, { "aria-description": "short-Description", variant: mediaPosition === "middle" ? "body-lg-500" : "body-xl", className: "".concat(item.description || mediaPosition === "middle" ? "line-clamp-1 text-gray-600" : "line-clamp-2 h-14 text-gray-600", " ").concat(editor === null || editor === void 0 ? void 0 : editor.shortDescription), children: item === null || item === void 0 ? void 0 : item.short_description }), mediaPosition !== "middle" && (_jsx(Body, { variant: "body-lg", className: "text-gray-600 line-clamp-2 ".concat(editor === null || editor === void 0 ? void 0 : editor.cardText), dangerouslySetInnerHTML: {
44
+ __html: item.description || "",
45
+ } }))] })] }), _jsx(ActionButton, {})] }));
55
46
  };
@@ -1,8 +1,11 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
- import Card from "../card";
3
- declare const meta: Meta<typeof Card>;
2
+ import { CardProps } from "../card";
3
+ type MultiNewsCardProps = Extract<CardProps, {
4
+ type: "multipleNews";
5
+ }>;
6
+ declare const meta: Meta<MultiNewsCardProps>;
4
7
  export default meta;
5
- type Story = StoryObj<typeof Card>;
8
+ type Story = StoryObj<MultiNewsCardProps>;
6
9
  export declare const CardHorizontalLeft: Story;
7
10
  export declare const CardHorizontalRight: Story;
8
11
  export declare const CardVerticalTop: Story;
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
- import { Dummy_Image, Dummy_Para, Dummy_Subtitle, Dummy_Title, Dummy_Url, } from "../../../utils/constants";
13
+ import { Dummy_Image, Dummy_Para, Dummy_Subtitle, Dummy_Title, } from "../../../utils/constants";
14
14
  import { OrientationEnum } from "../../../utils/enums";
15
15
  import Card from "../card";
16
16
  var meta = {
@@ -20,6 +20,12 @@ var meta = {
20
20
  layout: "centered",
21
21
  },
22
22
  argTypes: {
23
+ type: {
24
+ control: false,
25
+ table: {
26
+ disable: true,
27
+ },
28
+ },
23
29
  orientation: {
24
30
  control: "select",
25
31
  options: [OrientationEnum.horizontal, OrientationEnum.vertical],
@@ -29,29 +35,20 @@ var meta = {
29
35
  options: ["left", "right", "top", "middle", "bottom"],
30
36
  description: "For horizontal: use left/right. For vertical: use top/middle/bottom",
31
37
  },
32
- theme: {
33
- table: {
34
- disable: true,
35
- },
36
- },
37
- altText: {
38
- table: {
39
- disable: true,
40
- },
41
- },
42
38
  },
43
39
  decorators: [
44
40
  function (Story, context) {
45
41
  // Dynamically update mediaPosition options based on orientation
46
- var orientation = context.args.orientation;
42
+ var args = context.args;
43
+ var orientation = args.orientation;
47
44
  if (orientation === OrientationEnum.horizontal) {
48
45
  if (context.argTypes.mediaPosition) {
49
46
  context.argTypes.mediaPosition.options = ["left", "right"];
50
47
  }
51
48
  // Reset mediaPosition if it's not valid for horizontal
52
- if (context.args.mediaPosition &&
53
- !["left", "right"].includes(context.args.mediaPosition)) {
54
- context.args.mediaPosition = "left";
49
+ if (args.mediaPosition &&
50
+ !["left", "right"].includes(args.mediaPosition)) {
51
+ args.mediaPosition = "left";
55
52
  }
56
53
  }
57
54
  else if (orientation === OrientationEnum.vertical) {
@@ -59,18 +56,17 @@ var meta = {
59
56
  context.argTypes.mediaPosition.options = ["top", "middle", "bottom"];
60
57
  }
61
58
  // Reset mediaPosition if it's not valid for vertical
62
- if (context.args.mediaPosition &&
63
- !["top", "middle", "bottom"].includes(context.args.mediaPosition)) {
64
- context.args.mediaPosition = "top";
59
+ if (args.mediaPosition &&
60
+ !["top", "middle", "bottom"].includes(args.mediaPosition)) {
61
+ args.mediaPosition = "top";
65
62
  }
66
63
  }
67
- return _jsx(Story, __assign({}, context.args));
64
+ return _jsx(Story, {});
68
65
  },
69
66
  ],
70
67
  };
71
68
  export default meta;
72
69
  var baseCardArgs = {
73
- type: "multipleNews",
74
70
  item: {
75
71
  image: Dummy_Image,
76
72
  title: Dummy_Title,
@@ -78,7 +74,7 @@ var baseCardArgs = {
78
74
  short_description: Dummy_Subtitle,
79
75
  },
80
76
  image: Dummy_Image,
81
- href: Dummy_Url,
77
+ onButtonClick: function () { return alert("Button clicked"); },
82
78
  btnLabel: "View More",
83
79
  editor: {
84
80
  card: "",
@@ -86,20 +82,21 @@ var baseCardArgs = {
86
82
  cardTitle: "",
87
83
  cardText: "",
88
84
  cardBtn: "",
85
+ shortDescription: "",
89
86
  },
90
87
  };
91
88
  export var CardHorizontalLeft = {
92
- args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.horizontal, mediaPosition: "left" }),
89
+ args: __assign(__assign({ type: "multipleNews" }, baseCardArgs), { orientation: OrientationEnum.horizontal, mediaPosition: "left" }),
93
90
  };
94
91
  export var CardHorizontalRight = {
95
- args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.horizontal, mediaPosition: "right" }),
92
+ args: __assign(__assign({ type: "multipleNews" }, baseCardArgs), { orientation: OrientationEnum.horizontal, mediaPosition: "right" }),
96
93
  };
97
94
  export var CardVerticalTop = {
98
- args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "top" }),
95
+ args: __assign(__assign({ type: "multipleNews" }, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "top" }),
99
96
  };
100
97
  export var CardVerticalBottom = {
101
- args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "bottom" }),
98
+ args: __assign(__assign({ type: "multipleNews" }, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "bottom" }),
102
99
  };
103
100
  export var CardVerticalMiddle = {
104
- args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "middle" }),
101
+ args: __assign(__assign({ type: "multipleNews" }, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "middle" }),
105
102
  };
@@ -1,2 +1,5 @@
1
1
  import { CardInterface } from "../type";
2
- export declare const PostByCategory: ({ item, image, href, btnLabel, editor, mediaPosition, orientation, }: CardInterface) => import("react/jsx-runtime").JSX.Element;
2
+ export interface PostByCategoryProps extends Omit<CardInterface, "href" | "type"> {
3
+ onButtonClick?: () => void;
4
+ }
5
+ export declare const PostByCategory: ({ item, image, btnLabel, onButtonClick, editor, mediaPosition, orientation, }: PostByCategoryProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import LuImage from "../../Images/LuImage";
3
- import Link from "next/link";
4
3
  import { Heading } from "../../Typography/Heading/heading";
5
4
  import { Body } from "../../Typography/Body/body";
6
5
  import { Button } from "../../Button/Button/Button";
7
6
  export var PostByCategory = function (_a) {
8
- var item = _a.item, image = _a.image, href = _a.href, btnLabel = _a.btnLabel, editor = _a.editor, mediaPosition = _a.mediaPosition, orientation = _a.orientation;
7
+ var item = _a.item, image = _a.image, btnLabel = _a.btnLabel, onButtonClick = _a.onButtonClick, editor = _a.editor, mediaPosition = _a.mediaPosition, orientation = _a.orientation;
9
8
  // Normalize mediaPosition based on orientation
10
9
  var safeMediaPosition = orientation === "horizontal"
11
10
  ? mediaPosition === "left" || mediaPosition === "right"
@@ -27,7 +26,7 @@ export var PostByCategory = function (_a) {
27
26
  // Common button component
28
27
  var CardButton = function (_a) {
29
28
  var _b = _a.className, className = _b === void 0 ? "" : _b;
30
- return (_jsx(Link, { href: href || "#", passHref: true, children: _jsx(Button, { endIcon: "angle-right", size: "sm", className: "".concat(editor === null || editor === void 0 ? void 0 : editor.cardBtn, " ").concat(className), children: btnLabel }) }));
29
+ return (_jsx(Button, { endIcon: "angle-right", size: "sm", className: "w-fit ".concat(className, " ").concat(editor === null || editor === void 0 ? void 0 : editor.cardBtn), onClick: onButtonClick, children: btnLabel }));
31
30
  };
32
31
  // Horizontal layout
33
32
  if (orientation === "horizontal") {
@@ -1,8 +1,11 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
- import Card from "../card";
3
- declare const meta: Meta<typeof Card>;
2
+ import { CardProps } from "../card";
3
+ type PostByCategoryCardProps = Extract<CardProps, {
4
+ type: "postByCategory";
5
+ }>;
6
+ declare const meta: Meta<PostByCategoryCardProps>;
4
7
  export default meta;
5
- type Story = StoryObj<typeof Card>;
8
+ type Story = StoryObj<PostByCategoryCardProps>;
6
9
  export declare const PostByCategoryHorizontalLeft: Story;
7
10
  export declare const PostByCategoryHorizontalRight: Story;
8
11
  export declare const PostByCategoryVerticalTop: Story;
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
- import { Dummy_Image, Dummy_Para, Dummy_Subtitle, Dummy_Title, Dummy_Url, } from "../../../utils/constants";
13
+ import { Dummy_Image, Dummy_Para, Dummy_Subtitle, Dummy_Title, } from "../../../utils/constants";
14
14
  import { OrientationEnum } from "../../../utils/enums";
15
15
  import Card from "../card";
16
16
  var meta = {
@@ -20,6 +20,12 @@ var meta = {
20
20
  layout: "centered",
21
21
  },
22
22
  argTypes: {
23
+ type: {
24
+ control: false,
25
+ table: {
26
+ disable: true,
27
+ },
28
+ },
23
29
  orientation: {
24
30
  control: "select",
25
31
  options: [OrientationEnum.horizontal, OrientationEnum.vertical],
@@ -29,29 +35,20 @@ var meta = {
29
35
  options: ["left", "right", "top", "middle", "bottom"],
30
36
  description: "For horizontal: use left/right. For vertical: use top/middle/bottom",
31
37
  },
32
- theme: {
33
- table: {
34
- disable: true,
35
- },
36
- },
37
- altText: {
38
- table: {
39
- disable: true,
40
- },
41
- },
42
38
  },
43
39
  decorators: [
44
40
  function (Story, context) {
45
41
  // Dynamically update mediaPosition options based on orientation
46
- var orientation = context.args.orientation;
42
+ var args = context.args;
43
+ var orientation = args.orientation;
47
44
  if (orientation === OrientationEnum.horizontal) {
48
45
  if (context.argTypes.mediaPosition) {
49
46
  context.argTypes.mediaPosition.options = ["left", "right"];
50
47
  }
51
48
  // Reset mediaPosition if it's not valid for horizontal
52
- if (context.args.mediaPosition &&
53
- !["left", "right"].includes(context.args.mediaPosition)) {
54
- context.args.mediaPosition = "left";
49
+ if (args.mediaPosition &&
50
+ !["left", "right"].includes(args.mediaPosition)) {
51
+ args.mediaPosition = "left";
55
52
  }
56
53
  }
57
54
  else if (orientation === OrientationEnum.vertical) {
@@ -59,19 +56,18 @@ var meta = {
59
56
  context.argTypes.mediaPosition.options = ["top", "bottom"];
60
57
  }
61
58
  // Reset mediaPosition if it's not valid for vertical
62
- if (context.args.mediaPosition &&
63
- !["top", "middle", "bottom"].includes(context.args.mediaPosition)) {
64
- context.args.mediaPosition = "top";
59
+ if (args.mediaPosition &&
60
+ !["top", "middle", "bottom"].includes(args.mediaPosition)) {
61
+ args.mediaPosition = "top";
65
62
  }
66
63
  }
67
- return _jsx(Story, __assign({}, context.args));
64
+ return _jsx(Story, {});
68
65
  },
69
66
  ],
70
67
  };
71
68
  export default meta;
72
69
  // Base card args
73
70
  var baseCardArgs = {
74
- type: "postByCategory",
75
71
  item: {
76
72
  image: Dummy_Image,
77
73
  title: Dummy_Title,
@@ -79,7 +75,7 @@ var baseCardArgs = {
79
75
  short_description: Dummy_Subtitle,
80
76
  },
81
77
  image: Dummy_Image,
82
- href: Dummy_Url,
78
+ onButtonClick: function () { return alert("Button clicked"); },
83
79
  btnLabel: "View More",
84
80
  editor: {
85
81
  card: "",
@@ -91,17 +87,17 @@ var baseCardArgs = {
91
87
  };
92
88
  // PostByCategory Card Stories
93
89
  export var PostByCategoryHorizontalLeft = {
94
- args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.horizontal, mediaPosition: "left" }),
90
+ args: __assign(__assign({ type: "postByCategory" }, baseCardArgs), { orientation: OrientationEnum.horizontal, mediaPosition: "left" }),
95
91
  };
96
92
  export var PostByCategoryHorizontalRight = {
97
- args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.horizontal, mediaPosition: "right" }),
93
+ args: __assign(__assign({ type: "postByCategory" }, baseCardArgs), { orientation: OrientationEnum.horizontal, mediaPosition: "right" }),
98
94
  };
99
95
  export var PostByCategoryVerticalTop = {
100
- args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "top" }),
96
+ args: __assign(__assign({ type: "postByCategory" }, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "top" }),
101
97
  };
102
98
  export var PostByCategoryVerticalMiddle = {
103
- args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "middle" }),
99
+ args: __assign(__assign({ type: "postByCategory" }, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "middle" }),
104
100
  };
105
101
  export var PostByCategoryVerticalBottom = {
106
- args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "bottom" }),
102
+ args: __assign(__assign({ type: "postByCategory" }, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "bottom" }),
107
103
  };
@@ -1,7 +1,10 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
- import { SinglePost } from "./SinglePost";
3
- declare const meta: Meta<typeof SinglePost>;
2
+ import { CardProps } from "../card";
3
+ type SinglePostCardProps = Extract<CardProps, {
4
+ type: "singlePost";
5
+ }>;
6
+ declare const meta: Meta<SinglePostCardProps>;
4
7
  export default meta;
5
- type Story = StoryObj<typeof SinglePost>;
8
+ type Story = StoryObj<SinglePostCardProps>;
6
9
  export declare const SinglePostHorizontalLeft: Story;
7
10
  export declare const SinglePostHorizontalRight: Story;
@@ -9,15 +9,21 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- import { SinglePost } from "./SinglePost";
12
+ import Card from "../card";
13
13
  import { Dummy_Image, Dummy_Para, Dummy_Subtitle, Dummy_Title, Dummy_Url, } from "../../../utils/constants";
14
14
  var meta = {
15
15
  title: "Components/Cards/SinglePost",
16
- component: SinglePost,
16
+ component: Card,
17
17
  parameters: {
18
18
  layout: "centered",
19
19
  },
20
20
  argTypes: {
21
+ type: {
22
+ control: false,
23
+ table: {
24
+ disable: true,
25
+ },
26
+ },
21
27
  orientation: {
22
28
  table: {
23
29
  disable: true,
@@ -28,21 +34,10 @@ var meta = {
28
34
  options: ["left", "right"],
29
35
  description: "Position of media in horizontal layout",
30
36
  },
31
- theme: {
32
- table: {
33
- disable: true,
34
- },
35
- },
36
- altText: {
37
- table: {
38
- disable: true,
39
- },
40
- },
41
37
  },
42
38
  };
43
39
  export default meta;
44
40
  var baseCardArgs = {
45
- type: "singlePost",
46
41
  item: {
47
42
  image: Dummy_Image,
48
43
  title: Dummy_Title,
@@ -61,8 +56,8 @@ var baseCardArgs = {
61
56
  },
62
57
  };
63
58
  export var SinglePostHorizontalLeft = {
64
- args: __assign(__assign({}, baseCardArgs), { orientation: "horizontal", mediaPosition: "left" }),
59
+ args: __assign(__assign({ type: "singlePost" }, baseCardArgs), { orientation: "horizontal", mediaPosition: "left" }),
65
60
  };
66
61
  export var SinglePostHorizontalRight = {
67
- args: __assign(__assign({}, baseCardArgs), { orientation: "horizontal", mediaPosition: "right" }),
62
+ args: __assign(__assign({ type: "singlePost" }, baseCardArgs), { orientation: "horizontal", mediaPosition: "right" }),
68
63
  };
@@ -1,3 +1,21 @@
1
- import { CardInterface } from "./type";
2
- declare const Card: ({ item, image, href, btnLabel, editor, mediaPosition, type, orientation, theme, }: CardInterface) => import("react/jsx-runtime").JSX.Element;
1
+ import type { MultiNewsProps } from "./MultipleNews/MultiNews";
2
+ import type { CardInterface } from "./type";
3
+ import { PostByCategoryProps } from "./PostByCategory/PostByCategory";
4
+ import { PhotoGalleryProps } from "./photoGallery/PhotoGallery";
5
+ import { PhotoAlbumProps } from "./photoAlbum/PhotoAlbum";
6
+ type CardTypesWithCardInterface = "contactProfile" | "singlePost";
7
+ export type CardProps = ({
8
+ type: "multipleNews";
9
+ } & MultiNewsProps) | ({
10
+ type: "photoGallery";
11
+ } & PhotoGalleryProps) | ({
12
+ type: "photoAlbum";
13
+ } & PhotoAlbumProps) | ({
14
+ type: "postByCategory";
15
+ } & PostByCategoryProps) | {
16
+ [K in CardTypesWithCardInterface]: {
17
+ type: K;
18
+ } & CardInterface;
19
+ }[CardTypesWithCardInterface];
20
+ declare const Card: (props: CardProps) => import("react/jsx-runtime").JSX.Element | null;
3
21
  export default Card;
@@ -1,35 +1,31 @@
1
- import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
- import React from "react";
3
- import { PostByCategory } from "./PostByCategory/PostByCategory";
4
- import { MultiNews } from "./MultipleNews/MultiNews";
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 } from "react/jsx-runtime";
13
+ import { PostByCategory, } from "./PostByCategory/PostByCategory";
14
+ import { MultipleNewsCard } from "./MultipleNews/MultiNews";
5
15
  import { SinglePost } from "./SinglePost/SinglePost";
6
- import { Dummy_Url } from "../../utils/constants";
7
16
  import { ContactProfile } from "./contactProfile/ContactProfile";
8
17
  import { PhotoGallery } from "./photoGallery/PhotoGallery";
9
18
  import { PhotoAlbum } from "./photoAlbum/PhotoAlbum";
10
- var Card = function (_a) {
11
- 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, _g = _a.theme, theme = _g === void 0 ? "theme1" : _g;
12
- var cardProps = {
13
- item: item,
14
- href: href,
15
- image: image,
16
- btnLabel: btnLabel,
17
- editor: editor,
18
- mediaPosition: mediaPosition,
19
- orientation: orientation,
20
- theme: theme,
21
- };
22
- // Using object approach for better performance and cleaner code
23
- var cardComponents = {
24
- postByCategory: PostByCategory,
25
- contactProfile: ContactProfile,
26
- multipleNews: MultiNews,
27
- singlePost: SinglePost,
28
- photoGallery: PhotoGallery,
29
- photoAlbum: PhotoAlbum,
30
- };
31
- return (_jsx(_Fragment, { children: type && cardComponents[type]
32
- ? React.createElement(cardComponents[type], cardProps)
33
- : null }));
19
+ var cardComponents = {
20
+ postByCategory: PostByCategory,
21
+ contactProfile: ContactProfile,
22
+ multipleNews: MultipleNewsCard,
23
+ singlePost: SinglePost,
24
+ photoGallery: PhotoGallery,
25
+ photoAlbum: PhotoAlbum,
26
+ };
27
+ var Card = function (props) {
28
+ var Component = cardComponents[props.type];
29
+ return Component ? _jsx(Component, __assign({}, props)) : null;
34
30
  };
35
31
  export default Card;
@@ -1,8 +1,11 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
- import { ContactProfile } from "./ContactProfile";
3
- declare const meta: Meta<typeof ContactProfile>;
2
+ import { CardProps } from "../card";
3
+ type ContactProfileCardProps = Extract<CardProps, {
4
+ type: "contactProfile";
5
+ }>;
6
+ declare const meta: Meta<ContactProfileCardProps>;
4
7
  export default meta;
5
- type Story = StoryObj<typeof ContactProfile>;
8
+ type Story = StoryObj<ContactProfileCardProps>;
6
9
  export declare const ContactProfileHorizontalLeft: Story;
7
10
  export declare const ContactProfileHorizontalRight: Story;
8
11
  export declare const ContactProfileVerticalTop: Story;
@@ -12,14 +12,20 @@ var __assign = (this && this.__assign) || function () {
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { Dummy_Image, Dummy_Para, Dummy_Title, Dummy_Url, } from "../../../utils/constants";
14
14
  import { OrientationEnum } from "../../../utils/enums";
15
- import { ContactProfile } from "./ContactProfile";
15
+ import Card from "../card";
16
16
  var meta = {
17
17
  title: "Components/Cards/ContactProfile",
18
- component: ContactProfile,
18
+ component: Card,
19
19
  parameters: {
20
20
  layout: "centered",
21
21
  },
22
22
  argTypes: {
23
+ type: {
24
+ control: false,
25
+ table: {
26
+ disable: true,
27
+ },
28
+ },
23
29
  orientation: {
24
30
  control: "select",
25
31
  options: [OrientationEnum.horizontal, OrientationEnum.vertical],
@@ -29,29 +35,20 @@ var meta = {
29
35
  options: ["left", "right", "top", "middle", "bottom"],
30
36
  description: "For horizontal: use left/right. For vertical: use top/middle/bottom",
31
37
  },
32
- theme: {
33
- table: {
34
- disable: true,
35
- },
36
- },
37
- altText: {
38
- table: {
39
- disable: true,
40
- },
41
- },
42
38
  },
43
39
  decorators: [
44
40
  function (Story, context) {
45
41
  // Dynamically update mediaPosition options based on orientation
46
- var orientation = context.args.orientation;
42
+ var args = context.args;
43
+ var orientation = args.orientation;
47
44
  if (orientation === OrientationEnum.horizontal) {
48
45
  if (context.argTypes.mediaPosition) {
49
46
  context.argTypes.mediaPosition.options = ["left", "right"];
50
47
  }
51
48
  // Reset mediaPosition if it's not valid for horizontal
52
- if (context.args.mediaPosition &&
53
- !["left", "right"].includes(context.args.mediaPosition)) {
54
- context.args.mediaPosition = "left";
49
+ if (args.mediaPosition &&
50
+ !["left", "right"].includes(args.mediaPosition)) {
51
+ args.mediaPosition = "left";
55
52
  }
56
53
  }
57
54
  else if (orientation === OrientationEnum.vertical) {
@@ -59,18 +56,17 @@ var meta = {
59
56
  context.argTypes.mediaPosition.options = ["top", "middle", "bottom"];
60
57
  }
61
58
  // Reset mediaPosition if it's not valid for vertical
62
- if (context.args.mediaPosition &&
63
- !["top", "middle", "bottom"].includes(context.args.mediaPosition)) {
64
- context.args.mediaPosition = "top";
59
+ if (args.mediaPosition &&
60
+ !["top", "middle", "bottom"].includes(args.mediaPosition)) {
61
+ args.mediaPosition = "top";
65
62
  }
66
63
  }
67
- return _jsx(Story, __assign({}, context.args));
64
+ return _jsx(Story, {});
68
65
  },
69
66
  ],
70
67
  };
71
68
  export default meta;
72
69
  var baseCardArgs = {
73
- type: "contactProfile",
74
70
  item: {
75
71
  image: Dummy_Image,
76
72
  title: Dummy_Title,
@@ -88,17 +84,17 @@ var baseCardArgs = {
88
84
  },
89
85
  };
90
86
  export var ContactProfileHorizontalLeft = {
91
- args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.horizontal, mediaPosition: "left" }),
87
+ args: __assign(__assign({ type: "contactProfile" }, baseCardArgs), { orientation: OrientationEnum.horizontal, mediaPosition: "left" }),
92
88
  };
93
89
  export var ContactProfileHorizontalRight = {
94
- args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.horizontal, mediaPosition: "right" }),
90
+ args: __assign(__assign({ type: "contactProfile" }, baseCardArgs), { orientation: OrientationEnum.horizontal, mediaPosition: "right" }),
95
91
  };
96
92
  export var ContactProfileVerticalTop = {
97
- args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "top" }),
93
+ args: __assign(__assign({ type: "contactProfile" }, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "top" }),
98
94
  };
99
95
  export var ContactProfileVerticalMiddle = {
100
- args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "middle" }),
96
+ args: __assign(__assign({ type: "contactProfile" }, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "middle" }),
101
97
  };
102
98
  export var ContactProfileVerticalBottom = {
103
- args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "bottom" }),
99
+ args: __assign(__assign({ type: "contactProfile" }, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "bottom" }),
104
100
  };
@@ -1,2 +1,7 @@
1
1
  import { CardInterface } from "../type";
2
- export declare const PhotoAlbum: ({ image, item, altText, editor, theme, }: CardInterface) => import("react/jsx-runtime").JSX.Element;
2
+ import { Themes } from "./PhotoAlbum.stories";
3
+ export interface PhotoAlbumProps extends Omit<CardInterface, "href" | "orientation" | "mediaPosition" | "btnLabel"> {
4
+ altText?: string;
5
+ theme?: (typeof Themes)[number];
6
+ }
7
+ export declare const PhotoAlbum: ({ image, item, altText, editor, theme, }: PhotoAlbumProps) => import("react/jsx-runtime").JSX.Element;
@@ -4,7 +4,7 @@ import { Heading } from "../../../components/Typography/Heading/heading";
4
4
  import LUIcon from "../../../components/Icons/LUIcon";
5
5
  import { AvatarGroup } from "../../Avatar/AvatarGroup/AvatarGroup";
6
6
  export var PhotoAlbum = function (_a) {
7
- var image = _a.image, item = _a.item, _b = _a.altText, altText = _b === void 0 ? "Photo Album" : _b, editor = _a.editor, theme = _a.theme;
7
+ var image = _a.image, item = _a.item, _b = _a.altText, altText = _b === void 0 ? "Photo Album" : _b, editor = _a.editor, _c = _a.theme, theme = _c === void 0 ? "theme1" : _c;
8
8
  var hasImages = Array.isArray(item === null || item === void 0 ? void 0 : item.images) && item.images.length > 0;
9
9
  return (_jsxs("div", { className: "group relative max-w-md cursor-pointer ".concat(editor === null || editor === void 0 ? void 0 : editor.card, " ").concat(editor === null || editor === void 0 ? void 0 : editor.cardImage), children: [_jsx(LuImage, { src: image, width: 448, height: 448, alt: altText, className: "aspect-square object-cover transition-transform" }), _jsx("div", { className: "absolute inset-0 ".concat(editor === null || editor === void 0 ? void 0 : editor.cardOverlay, " bg-linear-to-t from-black to-transparent") }), theme === "theme2" ? (_jsxs("div", { className: "absolute bottom-0 right-0 w-full bg-black/75 !px-5 !py-3 flex items-center justify-between duration-300\n group-hover:bg-transparent", children: [_jsx(Heading, { variant: "h4-700", className: "line-clamp-1 text-white uppercase ".concat(editor === null || editor === void 0 ? void 0 : editor.cardText), children: item === null || item === void 0 ? void 0 : item.title }), hasImages && (_jsx("div", { children: _jsx(AvatarGroup, { images: ((item === null || item === void 0 ? void 0 : item.images) || []).map(function (img) { return ({
10
10
  id: img.gallery_id,
@@ -1,5 +1,6 @@
1
1
  import { Meta } from "@storybook/react";
2
- import { CardInterface } from "../type";
2
+ import type { CardProps } from "../card";
3
+ export declare const Themes: readonly ["theme1", "theme2"];
3
4
  declare const _default: Meta;
4
5
  export default _default;
5
- export declare const Default: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, CardInterface>;
6
+ export declare const Default: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, CardProps>;
@@ -12,17 +12,25 @@ var __assign = (this && this.__assign) || function () {
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { Dummy_Image, Dummy_Title } from "../../../utils/constants";
14
14
  import Card from "../card";
15
- import { PhotoAlbum } from "./PhotoAlbum";
15
+ export var Themes = ["theme1", "theme2"];
16
16
  export default {
17
17
  title: "Components/Cards/PhotoAlbum",
18
- component: PhotoAlbum,
18
+ component: Card,
19
19
  tags: ["autodocs"],
20
+ argTypes: {
21
+ theme: {
22
+ control: "select",
23
+ options: Themes,
24
+ description: "Select the card theme",
25
+ },
26
+ },
20
27
  };
21
28
  var Template = function (args) { return _jsx(Card, __assign({}, args)); };
22
29
  export var Default = Template.bind({});
23
30
  Default.args = {
24
31
  type: "photoAlbum",
25
32
  theme: "theme1",
33
+ altText: "Photo Album",
26
34
  item: {
27
35
  title: Dummy_Title,
28
36
  images: [
@@ -39,10 +47,10 @@ Default.args = {
39
47
  description: "This is another sample image description.",
40
48
  },
41
49
  {
42
- gallery_name: "Another Gallery",
50
+ gallery_name: "Third Gallery",
43
51
  gallery_image: Dummy_Image,
44
- gallery_id: 2,
45
- description: "https://randomuser.me/api/portraits/men/45.jpg",
52
+ gallery_id: 3,
53
+ description: "This is a third sample image description.",
46
54
  },
47
55
  ],
48
56
  },
@@ -54,28 +62,3 @@ Default.args = {
54
62
  cardText: "",
55
63
  },
56
64
  };
57
- Default.argTypes = {
58
- type: {
59
- control: false,
60
- table: {
61
- type: { summary: "string" },
62
- defaultValue: {
63
- summary: "photoAlbum",
64
- },
65
- },
66
- },
67
- theme: {
68
- control: {
69
- type: "select",
70
- labels: ["theme1", "theme2"],
71
- },
72
- options: ["theme1", "theme2"],
73
- defaultValue: {
74
- summary: "theme1",
75
- },
76
- },
77
- href: { control: false },
78
- btnLabel: { control: false },
79
- mediaPosition: { control: false },
80
- orientation: { control: false },
81
- };
@@ -1,2 +1,5 @@
1
1
  import { CardInterface } from "../type";
2
- export declare const PhotoGallery: ({ image, item, altText, editor, }: CardInterface) => import("react/jsx-runtime").JSX.Element;
2
+ export interface PhotoGalleryProps extends Omit<CardInterface, "href" | "orientation" | "mediaPosition" | "btnLabel"> {
3
+ altText?: string;
4
+ }
5
+ export declare const PhotoGallery: ({ image, item, altText, editor, }: PhotoGalleryProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { Meta } from "@storybook/react";
2
- import { CardInterface } from "../type";
2
+ import { CardProps } from "../card";
3
3
  declare const _default: Meta;
4
4
  export default _default;
5
- export declare const Default: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, CardInterface>;
5
+ export declare const Default: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, CardProps>;
@@ -10,13 +10,23 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ // import { CardInterface } from "../type";
13
14
  import { Dummy_Image, Dummy_Title } from "../../../utils/constants";
14
15
  import Card from "../card";
15
- import { PhotoGallery } from "./PhotoGallery";
16
16
  export default {
17
17
  title: "Components/Cards/PhotoGallery",
18
- component: PhotoGallery,
18
+ component: Card,
19
19
  tags: ["autodocs"],
20
+ argTypes: {
21
+ altText: {
22
+ control: { type: "text", disabled: true },
23
+ description: 'Alternative text for the image (default: "Photo Gallery")',
24
+ table: {
25
+ type: { summary: "string" },
26
+ defaultValue: { summary: "Photo Gallery" },
27
+ },
28
+ },
29
+ },
20
30
  };
21
31
  var Template = function (args) { return _jsx(Card, __assign({}, args)); };
22
32
  export var Default = Template.bind({});
@@ -26,6 +36,7 @@ Default.args = {
26
36
  title: Dummy_Title,
27
37
  },
28
38
  image: Dummy_Image,
39
+ altText: "Photo Gallery",
29
40
  editor: {
30
41
  card: "",
31
42
  cardImage: "",
@@ -33,19 +44,3 @@ Default.args = {
33
44
  cardText: "",
34
45
  },
35
46
  };
36
- Default.argTypes = {
37
- type: {
38
- control: false,
39
- table: {
40
- type: { summary: "string" },
41
- defaultValue: {
42
- summary: "photoGallery",
43
- },
44
- },
45
- },
46
- href: { control: false },
47
- btnLabel: { control: false },
48
- mediaPosition: { control: false },
49
- orientation: { control: false },
50
- theme: { control: false },
51
- };
@@ -29,6 +29,4 @@ export interface CardInterface {
29
29
  editor?: EditorInterface;
30
30
  type?: "postByCategory" | "contactProfile" | "multipleNews" | "singlePost" | "photoGallery" | "photoAlbum";
31
31
  orientation?: "horizontal" | "vertical";
32
- altText?: string;
33
- theme?: "theme1" | "theme2";
34
32
  }
@@ -3,7 +3,7 @@ import { sweetAlertVariants } from "./SweetAlert";
3
3
  export declare const colorOptions: Array<keyof typeof sweetAlertVariants.color>;
4
4
  export declare const shadowOptions: Array<keyof typeof sweetAlertVariants.shadow>;
5
5
  export declare const variantOptions: Array<keyof typeof sweetAlertVariants.variant>;
6
- export declare const getIconForColor: (color: string) => "info" | "check" | "circle-exclamation" | "star" | "question";
6
+ export declare const getIconForColor: (color: string) => "check" | "info" | "circle-exclamation" | "star" | "question";
7
7
  export declare const getContentForColor: (color: string) => {
8
8
  title: string;
9
9
  description: string;
@@ -444,12 +444,6 @@
444
444
  -webkit-box-orient: vertical;
445
445
  -webkit-line-clamp: 2;
446
446
  }
447
- .line-clamp-4 {
448
- overflow: hidden;
449
- display: -webkit-box;
450
- -webkit-box-orient: vertical;
451
- -webkit-line-clamp: 4;
452
- }
453
447
  .block {
454
448
  display: block;
455
449
  }
@@ -674,9 +668,6 @@
674
668
  .h-20 {
675
669
  height: calc(var(--spacing) * 20);
676
670
  }
677
- .h-32 {
678
- height: calc(var(--spacing) * 32);
679
- }
680
671
  .h-36 {
681
672
  height: calc(var(--spacing) * 36);
682
673
  }
@@ -851,9 +842,6 @@
851
842
  .max-w-40 {
852
843
  max-width: calc(var(--spacing) * 40);
853
844
  }
854
- .max-w-48 {
855
- max-width: calc(var(--spacing) * 48);
856
- }
857
845
  .max-w-\[17ch\] {
858
846
  max-width: 17ch;
859
847
  }
@@ -1891,6 +1879,10 @@
1891
1879
  --tw-font-weight: var(--font-weight-normal) !important;
1892
1880
  font-weight: var(--font-weight-normal) !important;
1893
1881
  }
1882
+ .\!font-semibold {
1883
+ --tw-font-weight: var(--font-weight-semibold) !important;
1884
+ font-weight: var(--font-weight-semibold) !important;
1885
+ }
1894
1886
  .font-bold {
1895
1887
  --tw-font-weight: var(--font-weight-bold);
1896
1888
  font-weight: var(--font-weight-bold);
@@ -2199,6 +2191,10 @@
2199
2191
  --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
2200
2192
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
2201
2193
  }
2194
+ .shadow-md {
2195
+ --tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
2196
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
2197
+ }
2202
2198
  .shadow-sm {
2203
2199
  --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
2204
2200
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
@@ -4140,6 +4136,11 @@
4140
4136
  width: 100%;
4141
4137
  }
4142
4138
  }
4139
+ .max-sm\:flex-col {
4140
+ @media (width < 40rem) {
4141
+ flex-direction: column;
4142
+ }
4143
+ }
4143
4144
  .sm\:col-span-2 {
4144
4145
  @media (width >= 40rem) {
4145
4146
  grid-column: span 2 / span 2;
@@ -4155,6 +4156,11 @@
4155
4156
  max-height: 320px;
4156
4157
  }
4157
4158
  }
4159
+ .sm\:max-w-48 {
4160
+ @media (width >= 40rem) {
4161
+ max-width: calc(var(--spacing) * 48);
4162
+ }
4163
+ }
4158
4164
  .sm\:max-w-lg {
4159
4165
  @media (width >= 40rem) {
4160
4166
  max-width: var(--container-lg);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linkedunion-design-kit",
3
- "version": "1.9.8",
3
+ "version": "1.10.1",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",