linkedunion-design-kit 1.9.2 → 1.9.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.
Files changed (142) hide show
  1. package/dist/app/layout.jsx +13 -0
  2. package/dist/app/page.jsx +25 -0
  3. package/dist/build/types/app/layout.d.ts +12 -0
  4. package/dist/build/types/app/layout.js +22 -0
  5. package/dist/build/types/app/page.d.ts +12 -0
  6. package/dist/build/types/app/page.js +22 -0
  7. package/dist/index.d.ts +4 -0
  8. package/dist/index.js +4 -0
  9. package/dist/src/components/Accordion/Accordion.stories.jsx +33 -0
  10. package/dist/src/components/Accordion/accordion.jsx +59 -0
  11. package/dist/src/components/Alerts/Alert/alert.jsx +152 -0
  12. package/dist/src/components/Alerts/Alert/alert.stories.jsx +344 -0
  13. package/dist/src/components/Alerts/AlertDialog/alert-dialog.jsx +170 -0
  14. package/dist/src/components/Alerts/AlertDialog/alert-dialog.stories.jsx +552 -0
  15. package/dist/src/components/AppIcons/AndroidIcon.jsx +24 -0
  16. package/dist/src/components/AppIcons/AppIcon.jsx +29 -0
  17. package/dist/src/components/AppIcons/AppIcon.stories.jsx +223 -0
  18. package/dist/src/components/AppIcons/AppleIcon.jsx +31 -0
  19. package/dist/src/components/AppIcons/PlayStoreIcon.jsx +29 -0
  20. package/dist/src/components/Avatar/Avatar/Avatar.jsx +45 -0
  21. package/dist/src/components/Avatar/Avatar/Avatar.stories.jsx +95 -0
  22. package/dist/src/components/Avatar/Avatar/Avatar.test.jsx +9 -0
  23. package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.jsx +17 -0
  24. package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.stories.jsx +32 -0
  25. package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.jsx +20 -0
  26. package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.stories.jsx +50 -0
  27. package/dist/src/components/Badge/Badge.jsx +54 -0
  28. package/dist/src/components/Badge/Badge.stories.jsx +201 -0
  29. package/dist/src/components/Button/Button/Button.d.ts +7 -6
  30. package/dist/src/components/Button/Button/Button.js +32 -9
  31. package/dist/src/components/Button/Button/Button.jsx +101 -0
  32. package/dist/src/components/Button/Button/Button.stories.jsx +283 -0
  33. package/dist/src/components/Button/Button/Button.test.jsx +73 -0
  34. package/dist/src/components/Button/IconButton/IconButton.jsx +63 -0
  35. package/dist/src/components/Button/IconButton/IconButton.stories.jsx +128 -0
  36. package/dist/src/components/Button/IconButton/IconButton.test.jsx +28 -0
  37. package/dist/src/components/Button/index.js +3 -3
  38. package/dist/src/components/Card/MultipleNews/MultiNews.jsx +80 -0
  39. package/dist/src/components/Card/MultipleNews/MultiNews.stories.jsx +104 -0
  40. package/dist/src/components/Card/PostByCategory/PostByCategory.jsx +60 -0
  41. package/dist/src/components/Card/PostByCategory/PostByCategory.stories.jsx +106 -0
  42. package/dist/src/components/Card/SinglePost/SinglePost.jsx +26 -0
  43. package/dist/src/components/Card/SinglePost/SinglePost.stories.jsx +68 -0
  44. package/dist/src/components/Card/card.jsx +36 -0
  45. package/dist/src/components/Card/contactProfile/ContactProfile.jsx +60 -0
  46. package/dist/src/components/Card/contactProfile/ContactProfile.stories.jsx +103 -0
  47. package/dist/src/components/Card/photoAlbum/PhotoAlbum.jsx +41 -0
  48. package/dist/src/components/Card/photoAlbum/PhotoAlbum.stories.jsx +69 -0
  49. package/dist/src/components/Card/photoGallery/PhotoGallery.jsx +17 -0
  50. package/dist/src/components/Card/photoGallery/PhotoGallery.stories.jsx +39 -0
  51. package/dist/src/components/Checkbox/checkbox.jsx +47 -0
  52. package/dist/src/components/Checkbox/checkbox.stories.jsx +113 -0
  53. package/dist/src/components/ColorPicker/ColorPicker.jsx +67 -0
  54. package/dist/src/components/ColorPicker/ColorPicker.stories.jsx +138 -0
  55. package/dist/src/components/Colors/color.jsx +5 -0
  56. package/dist/src/components/Colors/color.stories.jsx +20 -0
  57. package/dist/src/components/Colors/color.test.jsx +23 -0
  58. package/dist/src/components/Dropdown/Combobox/Combobox.jsx +198 -0
  59. package/dist/src/components/Dropdown/Combobox/Combobox.stories.jsx +289 -0
  60. package/dist/src/components/Dropdown/Combobox/utils/renderBadge.jsx +7 -0
  61. package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.jsx +102 -0
  62. package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.stories.jsx +464 -0
  63. package/dist/src/components/Dropdown/DropdownMenu/SelectAllSection.jsx +19 -0
  64. package/dist/src/components/Dropdown/Select.stories.jsx +201 -0
  65. package/dist/src/components/Dropdown/select.jsx +93 -0
  66. package/dist/src/components/Icons/LUIcon.jsx +41 -0
  67. package/dist/src/components/Icons/LUIcon.test.jsx +308 -0
  68. package/dist/src/components/Icons/stories/IconDropdown.jsx +67 -0
  69. package/dist/src/components/Icons/stories/IconGallery.jsx +77 -0
  70. package/dist/src/components/Icons/stories/InteractiveIconSelector.jsx +86 -0
  71. package/dist/src/components/Icons/stories/LUIcon.stories.jsx +108 -0
  72. package/dist/src/components/ImageUploader/ImageUploader.stories.jsx +50 -0
  73. package/dist/src/components/ImageUploader/imageUploader.jsx +94 -0
  74. package/dist/src/components/Images/LuImage.jsx +19 -0
  75. package/dist/src/components/Images/LuImage.stories.jsx +154 -0
  76. package/dist/src/components/Images/LuImage.test.jsx +44 -0
  77. package/dist/src/components/Input/Input.stories.jsx +250 -0
  78. package/dist/src/components/Input/input.jsx +110 -0
  79. package/dist/src/components/Label/Label.jsx +32 -0
  80. package/dist/src/components/Label/Label.stories.jsx +30 -0
  81. package/dist/src/components/Pagination/pagination.d.ts +33 -0
  82. package/dist/src/components/Pagination/pagination.js +68 -0
  83. package/dist/src/components/Pagination/pagination.jsx +68 -0
  84. package/dist/src/components/Pagination/pagination.stories.d.ts +74 -0
  85. package/dist/src/components/Pagination/pagination.stories.js +168 -0
  86. package/dist/src/components/Pagination/pagination.stories.jsx +114 -0
  87. package/dist/src/components/RadioGroup/RadioGroup.stories.jsx +146 -0
  88. package/dist/src/components/RadioGroup/radio-group.jsx +49 -0
  89. package/dist/src/components/Skeleton/skeleton.d.ts +117 -0
  90. package/dist/src/components/Skeleton/skeleton.js +140 -0
  91. package/dist/src/components/Skeleton/skeleton.stories.d.ts +153 -0
  92. package/dist/src/components/Skeleton/skeleton.stories.js +404 -0
  93. package/dist/src/components/Slider/Slider.stories.jsx +159 -0
  94. package/dist/src/components/Slider/slider.jsx +31 -0
  95. package/dist/src/components/SweetAlert/SweetAlert.jsx +147 -0
  96. package/dist/src/components/SweetAlert/SweetAlert.stories.jsx +505 -0
  97. package/dist/src/components/Switch/Switch.stories.jsx +66 -0
  98. package/dist/src/components/Switch/switch.jsx +61 -0
  99. package/dist/src/components/Table/Table.d.ts +26 -0
  100. package/dist/src/components/Table/Table.js +186 -0
  101. package/dist/src/components/Table/Table.jsx +221 -0
  102. package/dist/src/components/Table/Table.stories.d.ts +51 -0
  103. package/dist/src/components/Table/Table.stories.js +408 -0
  104. package/dist/src/components/Table/Table.stories.jsx +652 -0
  105. package/dist/src/components/Table/index.d.ts +20 -0
  106. package/dist/src/components/Table/index.js +20 -0
  107. package/dist/src/components/Tabs/Tabs.stories.jsx +29 -0
  108. package/dist/src/components/Tabs/tabs.jsx +32 -0
  109. package/dist/src/components/Title/Title.jsx +8 -0
  110. package/dist/src/components/Title/Title.stories.jsx +37 -0
  111. package/dist/src/components/Title/Title.test.jsx +24 -0
  112. package/dist/src/components/ToolTip/Tooltip.jsx +18 -0
  113. package/dist/src/components/ToolTip/Tooltip.stories.jsx +25 -0
  114. package/dist/src/components/Typography/Body/Body.stories.jsx +34 -0
  115. package/dist/src/components/Typography/Body/body.jsx +52 -0
  116. package/dist/src/components/Typography/Caption/Caption.stories.jsx +24 -0
  117. package/dist/src/components/Typography/Caption/caption.jsx +25 -0
  118. package/dist/src/components/Typography/Display/Display.stories.jsx +24 -0
  119. package/dist/src/components/Typography/Display/display.jsx +39 -0
  120. package/dist/src/components/Typography/Heading/Heading.stories.jsx +37 -0
  121. package/dist/src/components/Typography/Heading/heading.jsx +53 -0
  122. package/dist/src/components/ui/avatar.d.ts +3 -10
  123. package/dist/src/components/ui/avatar.js +12 -27
  124. package/dist/src/components/ui/avatar.jsx +27 -0
  125. package/dist/src/components/ui/button.d.ts +10 -0
  126. package/dist/src/components/ui/button.js +56 -0
  127. package/dist/src/components/ui/button.jsx +45 -0
  128. package/dist/src/components/ui/collapsible.d.ts +5 -0
  129. package/dist/src/components/ui/collapsible.js +5 -0
  130. package/dist/src/components/ui/collapsible.jsx +5 -0
  131. package/dist/src/components/ui/command.jsx +67 -0
  132. package/dist/src/components/ui/dialog.jsx +66 -0
  133. package/dist/src/components/ui/popover.jsx +33 -0
  134. package/dist/src/components/ui/tooltip.jsx +38 -0
  135. package/dist/src/components/ui/typography.jsx +56 -0
  136. package/dist/src/utils/colors.js +11 -11
  137. package/dist/src/utils/iconList.d.ts +4 -0
  138. package/dist/src/utils/iconList.js +4 -0
  139. package/dist/styles/global.css +209 -67
  140. package/package.json +1 -1
  141. package/dist/src/components/Avatar/Avatar/Avatar1.stories.d.ts +0 -17
  142. package/dist/src/components/Avatar/Avatar/Avatar1.stories.js +0 -68
@@ -0,0 +1,104 @@
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/MultiNews",
17
+ component: Card,
18
+ parameters: {
19
+ layout: "centered",
20
+ },
21
+ argTypes: {
22
+ orientation: {
23
+ control: "select",
24
+ options: [OrientationEnum.horizontal, OrientationEnum.vertical],
25
+ },
26
+ mediaPosition: {
27
+ control: "select",
28
+ options: ["left", "right", "top", "middle", "bottom"],
29
+ description: "For horizontal: use left/right. For vertical: use top/middle/bottom",
30
+ },
31
+ theme: {
32
+ table: {
33
+ disable: true,
34
+ },
35
+ },
36
+ altText: {
37
+ table: {
38
+ disable: true,
39
+ },
40
+ },
41
+ },
42
+ decorators: [
43
+ function (Story, context) {
44
+ // Dynamically update mediaPosition options based on orientation
45
+ var orientation = context.args.orientation;
46
+ if (orientation === OrientationEnum.horizontal) {
47
+ if (context.argTypes.mediaPosition) {
48
+ context.argTypes.mediaPosition.options = ["left", "right"];
49
+ }
50
+ // Reset mediaPosition if it's not valid for horizontal
51
+ if (context.args.mediaPosition &&
52
+ !["left", "right"].includes(context.args.mediaPosition)) {
53
+ context.args.mediaPosition = "left";
54
+ }
55
+ }
56
+ else if (orientation === OrientationEnum.vertical) {
57
+ if (context.argTypes.mediaPosition) {
58
+ context.argTypes.mediaPosition.options = ["top", "middle", "bottom"];
59
+ }
60
+ // Reset mediaPosition if it's not valid for vertical
61
+ if (context.args.mediaPosition &&
62
+ !["top", "middle", "bottom"].includes(context.args.mediaPosition)) {
63
+ context.args.mediaPosition = "top";
64
+ }
65
+ }
66
+ return <Story {...context.args}/>;
67
+ },
68
+ ],
69
+ };
70
+ export default meta;
71
+ var baseCardArgs = {
72
+ type: "multipleNews",
73
+ item: {
74
+ image: Dummy_Image,
75
+ title: Dummy_Title,
76
+ description: Dummy_Para,
77
+ short_description: Dummy_Subtitle,
78
+ },
79
+ image: Dummy_Image,
80
+ href: Dummy_Url,
81
+ btnLabel: "View More",
82
+ editor: {
83
+ card: "",
84
+ cardImage: "",
85
+ cardTitle: "",
86
+ cardText: "",
87
+ cardBtn: "",
88
+ },
89
+ };
90
+ export var CardHorizontalLeft = {
91
+ args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.horizontal, mediaPosition: "left" }),
92
+ };
93
+ export var CardHorizontalRight = {
94
+ args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.horizontal, mediaPosition: "right" }),
95
+ };
96
+ export var CardVerticalTop = {
97
+ args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "top" }),
98
+ };
99
+ export var CardVerticalBottom = {
100
+ args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "bottom" }),
101
+ };
102
+ export var CardVerticalMiddle = {
103
+ args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "middle" }),
104
+ };
@@ -0,0 +1,60 @@
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
+ };
@@ -0,0 +1,106 @@
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
+ orientation: {
23
+ control: "select",
24
+ options: [OrientationEnum.horizontal, OrientationEnum.vertical],
25
+ },
26
+ mediaPosition: {
27
+ control: "select",
28
+ options: ["left", "right", "top", "middle", "bottom"],
29
+ description: "For horizontal: use left/right. For vertical: use top/middle/bottom",
30
+ },
31
+ theme: {
32
+ table: {
33
+ disable: true,
34
+ },
35
+ },
36
+ altText: {
37
+ table: {
38
+ disable: true,
39
+ },
40
+ },
41
+ },
42
+ decorators: [
43
+ function (Story, context) {
44
+ // Dynamically update mediaPosition options based on orientation
45
+ var orientation = context.args.orientation;
46
+ if (orientation === OrientationEnum.horizontal) {
47
+ if (context.argTypes.mediaPosition) {
48
+ context.argTypes.mediaPosition.options = ["left", "right"];
49
+ }
50
+ // Reset mediaPosition if it's not valid for horizontal
51
+ if (context.args.mediaPosition &&
52
+ !["left", "right"].includes(context.args.mediaPosition)) {
53
+ context.args.mediaPosition = "left";
54
+ }
55
+ }
56
+ else if (orientation === OrientationEnum.vertical) {
57
+ if (context.argTypes.mediaPosition) {
58
+ context.argTypes.mediaPosition.options = ["top", "bottom"];
59
+ }
60
+ // Reset mediaPosition if it's not valid for vertical
61
+ if (context.args.mediaPosition &&
62
+ !["top", "middle", "bottom"].includes(context.args.mediaPosition)) {
63
+ context.args.mediaPosition = "top";
64
+ }
65
+ }
66
+ return <Story {...context.args}/>;
67
+ },
68
+ ],
69
+ };
70
+ export default meta;
71
+ // Base card args
72
+ var baseCardArgs = {
73
+ type: "postByCategory",
74
+ item: {
75
+ image: Dummy_Image,
76
+ title: Dummy_Title,
77
+ description: Dummy_Para,
78
+ short_description: Dummy_Subtitle,
79
+ },
80
+ image: Dummy_Image,
81
+ href: Dummy_Url,
82
+ btnLabel: "View More",
83
+ editor: {
84
+ card: "",
85
+ cardImage: "",
86
+ cardTitle: "",
87
+ cardText: "",
88
+ cardBtn: "",
89
+ },
90
+ };
91
+ // PostByCategory Card Stories
92
+ export var PostByCategoryHorizontalLeft = {
93
+ args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.horizontal, mediaPosition: "left" }),
94
+ };
95
+ export var PostByCategoryHorizontalRight = {
96
+ args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.horizontal, mediaPosition: "right" }),
97
+ };
98
+ export var PostByCategoryVerticalTop = {
99
+ args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "top" }),
100
+ };
101
+ export var PostByCategoryVerticalMiddle = {
102
+ args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "middle" }),
103
+ };
104
+ export var PostByCategoryVerticalBottom = {
105
+ args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "bottom" }),
106
+ };
@@ -0,0 +1,26 @@
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
+ };
@@ -0,0 +1,68 @@
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 { SinglePost } from "./SinglePost";
13
+ import { Dummy_Image, Dummy_Para, Dummy_Subtitle, Dummy_Title, Dummy_Url, } from "../../../utils/constants";
14
+ var meta = {
15
+ title: "Components/Cards/SinglePost",
16
+ component: SinglePost,
17
+ parameters: {
18
+ layout: "centered",
19
+ },
20
+ argTypes: {
21
+ orientation: {
22
+ table: {
23
+ disable: true,
24
+ },
25
+ },
26
+ mediaPosition: {
27
+ control: "select",
28
+ options: ["left", "right"],
29
+ description: "Position of media in horizontal layout",
30
+ },
31
+ theme: {
32
+ table: {
33
+ disable: true,
34
+ },
35
+ },
36
+ altText: {
37
+ table: {
38
+ disable: true,
39
+ },
40
+ },
41
+ },
42
+ };
43
+ export default meta;
44
+ var baseCardArgs = {
45
+ type: "singlePost",
46
+ item: {
47
+ image: Dummy_Image,
48
+ title: Dummy_Title,
49
+ description: Dummy_Para,
50
+ short_description: Dummy_Subtitle,
51
+ },
52
+ image: Dummy_Image,
53
+ href: Dummy_Url,
54
+ btnLabel: "View More",
55
+ editor: {
56
+ card: "",
57
+ cardImage: "",
58
+ cardTitle: "",
59
+ cardText: "",
60
+ cardBtn: "",
61
+ },
62
+ };
63
+ export var SinglePostHorizontalLeft = {
64
+ args: __assign(__assign({}, baseCardArgs), { orientation: "horizontal", mediaPosition: "left" }),
65
+ };
66
+ export var SinglePostHorizontalRight = {
67
+ args: __assign(__assign({}, baseCardArgs), { orientation: "horizontal", mediaPosition: "right" }),
68
+ };
@@ -0,0 +1,36 @@
1
+ import React from "react";
2
+ import { PostByCategory } from "./PostByCategory/PostByCategory";
3
+ import { MultiNews } from "./MultipleNews/MultiNews";
4
+ import { SinglePost } from "./SinglePost/SinglePost";
5
+ import { Dummy_Url } from "../../utils/constants";
6
+ import { ContactProfile } from "./contactProfile/ContactProfile";
7
+ import { PhotoGallery } from "./photoGallery/PhotoGallery";
8
+ import { PhotoAlbum } from "./photoAlbum/PhotoAlbum";
9
+ var Card = function (_a) {
10
+ 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;
11
+ var cardProps = {
12
+ item: item,
13
+ href: href,
14
+ image: image,
15
+ btnLabel: btnLabel,
16
+ editor: editor,
17
+ mediaPosition: mediaPosition,
18
+ orientation: orientation,
19
+ theme: theme,
20
+ };
21
+ // Using object approach for better performance and cleaner code
22
+ var cardComponents = {
23
+ postByCategory: PostByCategory,
24
+ contactProfile: ContactProfile,
25
+ multipleNews: MultiNews,
26
+ singlePost: SinglePost,
27
+ photoGallery: PhotoGallery,
28
+ photoAlbum: PhotoAlbum,
29
+ };
30
+ return (<>
31
+ {type && cardComponents[type]
32
+ ? React.createElement(cardComponents[type], cardProps)
33
+ : null}
34
+ </>);
35
+ };
36
+ export default Card;
@@ -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/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-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 bg-white rounded-xl flex ".concat(safeMediaPosition === "left" ? "sm:flex-row" : "sm:flex-row-reverse", " 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-3" : "order-1", " w-full max-w-40 aspect-square object-cover")}/>
46
+ <div className={"flex-1 flex flex-col !gap-1 md:!gap-2.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-6 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
+ };
@@ -0,0 +1,103 @@
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_Title, Dummy_Url, } from "../../../utils/constants";
13
+ import { OrientationEnum } from "../../../utils/enums";
14
+ import { ContactProfile } from "./ContactProfile";
15
+ var meta = {
16
+ title: "Components/Cards/ContactProfile",
17
+ component: ContactProfile,
18
+ parameters: {
19
+ layout: "centered",
20
+ },
21
+ argTypes: {
22
+ orientation: {
23
+ control: "select",
24
+ options: [OrientationEnum.horizontal, OrientationEnum.vertical],
25
+ },
26
+ mediaPosition: {
27
+ control: "select",
28
+ options: ["left", "right", "top", "middle", "bottom"],
29
+ description: "For horizontal: use left/right. For vertical: use top/middle/bottom",
30
+ },
31
+ theme: {
32
+ table: {
33
+ disable: true,
34
+ },
35
+ },
36
+ altText: {
37
+ table: {
38
+ disable: true,
39
+ },
40
+ },
41
+ },
42
+ decorators: [
43
+ function (Story, context) {
44
+ // Dynamically update mediaPosition options based on orientation
45
+ var orientation = context.args.orientation;
46
+ if (orientation === OrientationEnum.horizontal) {
47
+ if (context.argTypes.mediaPosition) {
48
+ context.argTypes.mediaPosition.options = ["left", "right"];
49
+ }
50
+ // Reset mediaPosition if it's not valid for horizontal
51
+ if (context.args.mediaPosition &&
52
+ !["left", "right"].includes(context.args.mediaPosition)) {
53
+ context.args.mediaPosition = "left";
54
+ }
55
+ }
56
+ else if (orientation === OrientationEnum.vertical) {
57
+ if (context.argTypes.mediaPosition) {
58
+ context.argTypes.mediaPosition.options = ["top", "middle", "bottom"];
59
+ }
60
+ // Reset mediaPosition if it's not valid for vertical
61
+ if (context.args.mediaPosition &&
62
+ !["top", "middle", "bottom"].includes(context.args.mediaPosition)) {
63
+ context.args.mediaPosition = "top";
64
+ }
65
+ }
66
+ return <Story {...context.args}/>;
67
+ },
68
+ ],
69
+ };
70
+ export default meta;
71
+ var baseCardArgs = {
72
+ type: "contactProfile",
73
+ item: {
74
+ image: Dummy_Image,
75
+ title: Dummy_Title,
76
+ description: Dummy_Para,
77
+ },
78
+ image: Dummy_Image,
79
+ href: Dummy_Url,
80
+ btnLabel: "View More",
81
+ editor: {
82
+ card: "",
83
+ cardImage: "",
84
+ cardTitle: "",
85
+ cardText: "",
86
+ cardBtn: "",
87
+ },
88
+ };
89
+ export var ContactProfileHorizontalLeft = {
90
+ args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.horizontal, mediaPosition: "left" }),
91
+ };
92
+ export var ContactProfileHorizontalRight = {
93
+ args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.horizontal, mediaPosition: "right" }),
94
+ };
95
+ export var ContactProfileVerticalTop = {
96
+ args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "top" }),
97
+ };
98
+ export var ContactProfileVerticalMiddle = {
99
+ args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "middle" }),
100
+ };
101
+ export var ContactProfileVerticalBottom = {
102
+ args: __assign(__assign({}, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "bottom" }),
103
+ };
@@ -0,0 +1,41 @@
1
+ import LuImage from "../../../components/Images/LuImage";
2
+ import { Heading } from "../../../components/Typography/Heading/heading";
3
+ import LUIcon from "../../../components/Icons/LUIcon";
4
+ import { AvatarGroup } from "../../Avatar/AvatarGroup/AvatarGroup";
5
+ export var PhotoAlbum = function (_a) {
6
+ 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 hasImages = Array.isArray(item === null || item === void 0 ? void 0 : item.images) && item.images.length > 0;
8
+ return (<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)}>
9
+ <LuImage src={image} width={448} height={448} alt={altText} className={"aspect-square object-cover transition-transform"}/>
10
+ <div className={"absolute inset-0 ".concat(editor === null || editor === void 0 ? void 0 : editor.cardOverlay, " bg-linear-to-t from-black to-transparent")}></div>
11
+ {theme === "theme2" ? (<div className="absolute bottom-0 right-0 w-full bg-black/75 !px-5 !py-3 flex items-center justify-between duration-300
12
+ group-hover:bg-transparent">
13
+ <Heading variant="h4-700" className={"line-clamp-1 text-white uppercase ".concat(editor === null || editor === void 0 ? void 0 : editor.cardText)}>
14
+ {item === null || item === void 0 ? void 0 : item.title}
15
+ </Heading>
16
+ {hasImages && (<div>
17
+ <AvatarGroup images={((item === null || item === void 0 ? void 0 : item.images) || []).map(function (img) { return ({
18
+ id: img.gallery_id,
19
+ image: img.gallery_image,
20
+ }); })}/>
21
+ </div>)}
22
+ </div>) : (<>
23
+ {hasImages && (<div className="absolute top-0 right-0 !px-5 !py-3">
24
+ <AvatarGroup images={((item === null || item === void 0 ? void 0 : item.images) || []).map(function (img) { return ({
25
+ id: img.gallery_id,
26
+ image: img.gallery_image,
27
+ }); })}/>
28
+ </div>)}
29
+ <div className="absolute !px-5 !py-3 bottom-0">
30
+ <Heading variant="h4-700" className={"line-clamp-1 text-white uppercase ".concat(editor === null || editor === void 0 ? void 0 : editor.cardText)}>
31
+ {item === null || item === void 0 ? void 0 : item.title}
32
+ </Heading>
33
+ </div>
34
+ </>)}
35
+
36
+ {/* Search icon - appears on hover */}
37
+ <div className={"absolute inset-0 flex items-center justify-center opacity-0 group-hover:!opacity-100 duration-300 ease-out ".concat(theme === "theme2" ? "bg-black/75 origin-bottom scale-y-0 transition-all group-hover:scale-y-100" : "bg-black/30")}>
38
+ <LUIcon icon="magnifying-glass" size="4xl" className={"".concat(editor === null || editor === void 0 ? void 0 : editor.cardText, " text-gray-100")}/>
39
+ </div>
40
+ </div>);
41
+ };