linkedunion-design-kit 1.9.1 → 1.9.2

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 (262) hide show
  1. package/dist/index.d.ts +2 -1
  2. package/dist/index.js +2 -1
  3. package/dist/src/components/Accordion/accordion.js +1 -1
  4. package/dist/src/components/Alerts/Alert/alert.d.ts +19 -0
  5. package/dist/src/components/Alerts/Alert/alert.js +156 -0
  6. package/dist/src/components/Alerts/Alert/alert.stories.d.ts +30 -0
  7. package/dist/src/components/Alerts/Alert/alert.stories.js +166 -0
  8. package/dist/src/components/Alerts/AlertDialog/alert-dialog.d.ts +45 -0
  9. package/dist/src/components/Alerts/AlertDialog/alert-dialog.js +168 -0
  10. package/dist/src/components/Alerts/AlertDialog/alert-dialog.stories.d.ts +69 -0
  11. package/dist/src/components/Alerts/AlertDialog/alert-dialog.stories.js +213 -0
  12. package/dist/src/components/Alerts/AlertDialog/index.d.ts +44 -0
  13. package/dist/src/components/Alerts/AlertDialog/index.js +189 -0
  14. package/dist/src/components/Avatar/Avatar/Avatar.d.ts +12 -3
  15. package/dist/src/components/Avatar/Avatar/Avatar.js +49 -11
  16. package/dist/src/components/Avatar/Avatar/Avatar.stories.d.ts +16 -2
  17. package/dist/src/components/Avatar/Avatar/Avatar.stories.js +51 -25
  18. package/dist/src/components/Avatar/Avatar/Avatar.test.js +6 -46
  19. package/dist/src/components/Avatar/Avatar/Avatar1.stories.d.ts +17 -0
  20. package/dist/src/components/Avatar/Avatar/Avatar1.stories.js +68 -0
  21. package/dist/src/components/Avatar/Avatar/index.d.ts +51 -28
  22. package/dist/src/components/Avatar/Avatar/index.js +76 -28
  23. package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.js +1 -1
  24. package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.stories.js +1 -1
  25. package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.d.ts +3 -0
  26. package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.js +18 -0
  27. package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.stories.d.ts +44 -0
  28. package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.stories.js +41 -0
  29. package/dist/src/components/Avatar/StatusIndicator/index.d.ts +27 -0
  30. package/dist/src/components/Avatar/StatusIndicator/index.js +29 -0
  31. package/dist/src/components/Avatar/StatusIndicator/type.d.ts +6 -0
  32. package/dist/src/components/Badge/Badge.d.ts +21 -0
  33. package/dist/src/components/Badge/Badge.js +59 -0
  34. package/dist/src/components/Badge/Badge.stories.d.ts +719 -0
  35. package/dist/src/components/Badge/Badge.stories.js +145 -0
  36. package/dist/src/components/Badge/index.d.ts +47 -0
  37. package/dist/src/components/Badge/index.js +49 -0
  38. package/dist/src/components/Button/Button/Button.d.ts +2 -2
  39. package/dist/src/components/Button/Button/Button.stories.d.ts +4 -4
  40. package/dist/src/components/Button/IconButton/IconButton.d.ts +2 -2
  41. package/dist/src/components/Button/IconButton/IconButton.stories.d.ts +4 -4
  42. package/dist/src/components/Dropdown/Combobox/Combobox.d.ts +3 -0
  43. package/dist/src/components/Dropdown/Combobox/Combobox.js +160 -0
  44. package/dist/src/components/Dropdown/Combobox/Combobox.stories.d.ts +13 -0
  45. package/dist/src/components/Dropdown/Combobox/Combobox.stories.js +225 -0
  46. package/dist/src/components/Dropdown/Combobox/index.d.ts +35 -0
  47. package/dist/src/components/Dropdown/Combobox/index.js +36 -0
  48. package/dist/src/components/Dropdown/Combobox/type.d.ts +25 -0
  49. package/dist/src/components/Dropdown/Combobox/utils/getLabelVariant.d.ts +3 -0
  50. package/dist/src/components/Dropdown/Combobox/utils/getLabelVariant.js +7 -0
  51. package/dist/src/components/Dropdown/Combobox/utils/renderBadge.d.ts +6 -0
  52. package/dist/src/components/Dropdown/Combobox/utils/renderBadge.js +5 -0
  53. package/dist/src/components/Dropdown/Combobox/utils/useResponsiveBadge.d.ts +1 -0
  54. package/dist/src/components/Dropdown/Combobox/utils/useResponsiveBadge.js +14 -0
  55. package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.d.ts +37 -0
  56. package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.js +96 -0
  57. package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.stories.d.ts +25 -0
  58. package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.stories.js +253 -0
  59. package/dist/src/components/Dropdown/DropdownMenu/SelectAllSection.d.ts +3 -0
  60. package/dist/src/components/Dropdown/DropdownMenu/SelectAllSection.js +9 -0
  61. package/dist/src/components/Dropdown/DropdownMenu/index.d.ts +20 -0
  62. package/dist/src/components/Dropdown/DropdownMenu/index.js +21 -0
  63. package/dist/src/components/Dropdown/DropdownMenu/type.d.ts +7 -0
  64. package/dist/src/components/Dropdown/select.js +3 -3
  65. package/dist/src/components/Icons/LUIcon.d.ts +1 -1
  66. package/dist/src/components/Icons/LUIcon.js +15 -8
  67. package/dist/src/components/Icons/LUIcon.test.d.ts +0 -1
  68. package/dist/src/components/Icons/LUIcon.test.js +306 -253
  69. package/dist/src/components/Icons/index.d.ts +23 -8
  70. package/dist/src/components/Icons/index.js +43 -28
  71. package/dist/src/components/Icons/stories/InteractiveIconSelector.js +3 -3
  72. package/dist/src/components/Icons/stories/LUIcon.stories.d.ts +9 -5
  73. package/dist/src/components/Icons/stories/LUIcon.stories.js +28 -43
  74. package/dist/src/components/Icons/type.d.ts +0 -1
  75. package/dist/src/components/SweetAlert/SweetAlert.d.ts +40 -0
  76. package/dist/src/components/SweetAlert/SweetAlert.js +150 -0
  77. package/dist/src/components/SweetAlert/SweetAlert.stories.d.ts +86 -0
  78. package/dist/src/components/SweetAlert/SweetAlert.stories.js +305 -0
  79. package/dist/src/components/SweetAlert/index.d.ts +24 -0
  80. package/dist/src/components/SweetAlert/index.js +137 -0
  81. package/dist/src/components/ui/avatar.d.ts +10 -3
  82. package/dist/src/components/ui/avatar.js +27 -12
  83. package/dist/src/components/ui/command.d.ts +22 -0
  84. package/dist/src/components/ui/command.js +65 -0
  85. package/dist/src/components/ui/dialog.d.ts +15 -0
  86. package/dist/src/components/ui/dialog.js +68 -0
  87. package/dist/src/components/ui/popover.d.ts +7 -0
  88. package/dist/src/components/ui/popover.js +42 -0
  89. package/dist/src/utils/constants.d.ts +1 -0
  90. package/dist/src/utils/constants.js +1 -0
  91. package/dist/styles/global.css +727 -53
  92. package/dist/tailwind.config.js +6 -0
  93. package/package.json +6 -1
  94. package/dist/app/layout.jsx +0 -13
  95. package/dist/app/page.jsx +0 -5
  96. package/dist/next.config.d.ts +0 -8
  97. package/dist/next.config.js +0 -10
  98. package/dist/src/components/Accordion/Accordion.stories.jsx +0 -33
  99. package/dist/src/components/Accordion/accordion.jsx +0 -59
  100. package/dist/src/components/AppIcons/AndroidIcon.jsx +0 -24
  101. package/dist/src/components/AppIcons/AppIcon.jsx +0 -29
  102. package/dist/src/components/AppIcons/AppIcon.stories.jsx +0 -223
  103. package/dist/src/components/AppIcons/AppleIcon.jsx +0 -31
  104. package/dist/src/components/AppIcons/PlayStoreIcon.jsx +0 -29
  105. package/dist/src/components/Avatar/Avatar/Avatar.jsx +0 -17
  106. package/dist/src/components/Avatar/Avatar/Avatar.stories.jsx +0 -31
  107. package/dist/src/components/Avatar/Avatar/Avatar.test.jsx +0 -51
  108. package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.jsx +0 -17
  109. package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.stories.jsx +0 -32
  110. package/dist/src/components/Button/Button/Button.jsx +0 -73
  111. package/dist/src/components/Button/Button/Button.stories.jsx +0 -283
  112. package/dist/src/components/Button/Button/Button.test.jsx +0 -73
  113. package/dist/src/components/Button/Button/index.d.ts +0 -63
  114. package/dist/src/components/Button/Button/index.js +0 -64
  115. package/dist/src/components/Button/Button.d.ts +0 -20
  116. package/dist/src/components/Button/Button.js +0 -83
  117. package/dist/src/components/Button/Button.stories.d.ts +0 -725
  118. package/dist/src/components/Button/Button.stories.js +0 -288
  119. package/dist/src/components/Button/Button.test.js +0 -10
  120. package/dist/src/components/Button/IconButton/IconButton.jsx +0 -63
  121. package/dist/src/components/Button/IconButton/IconButton.stories.jsx +0 -128
  122. package/dist/src/components/Button/IconButton/IconButton.test.jsx +0 -28
  123. package/dist/src/components/Button/IconButton/index.d.ts +0 -0
  124. package/dist/src/components/Button/IconButton/index.js +0 -1
  125. package/dist/src/components/Button/IconButton.d.ts +0 -33
  126. package/dist/src/components/Button/IconButton.js +0 -79
  127. package/dist/src/components/Button/IconButton.stories.d.ts +0 -4
  128. package/dist/src/components/Button/IconButton.stories.js +0 -65
  129. package/dist/src/components/Button/IconButton.test.js +0 -28
  130. package/dist/src/components/Card/MultipleNews/MultiNews.jsx +0 -80
  131. package/dist/src/components/Card/MultipleNews/MultiNews.stories.jsx +0 -104
  132. package/dist/src/components/Card/PostByCategory/PostByCategory.jsx +0 -60
  133. package/dist/src/components/Card/PostByCategory/PostByCategory.stories.jsx +0 -106
  134. package/dist/src/components/Card/SinglePost/SinglePost.jsx +0 -26
  135. package/dist/src/components/Card/SinglePost/SinglePost.stories.jsx +0 -68
  136. package/dist/src/components/Card/card.jsx +0 -36
  137. package/dist/src/components/Card/contactProfile/ContactProfile.jsx +0 -60
  138. package/dist/src/components/Card/contactProfile/ContactProfile.stories.jsx +0 -103
  139. package/dist/src/components/Card/photoAlbum/PhotoAlbum.jsx +0 -41
  140. package/dist/src/components/Card/photoAlbum/PhotoAlbum.stories.jsx +0 -69
  141. package/dist/src/components/Card/photoGallery/PhotoGallery.jsx +0 -17
  142. package/dist/src/components/Card/photoGallery/PhotoGallery.stories.jsx +0 -39
  143. package/dist/src/components/Checkbox/checkbox.jsx +0 -47
  144. package/dist/src/components/Checkbox/checkbox.stories.jsx +0 -113
  145. package/dist/src/components/ColorPicker/ColorPicker.jsx +0 -67
  146. package/dist/src/components/ColorPicker/ColorPicker.stories.jsx +0 -138
  147. package/dist/src/components/Colors/color.jsx +0 -5
  148. package/dist/src/components/Colors/color.stories.jsx +0 -20
  149. package/dist/src/components/Colors/color.test.jsx +0 -23
  150. package/dist/src/components/Dropdown/Select.stories.jsx +0 -201
  151. package/dist/src/components/Dropdown/select.jsx +0 -94
  152. package/dist/src/components/Icons/IconList.test.d.ts +0 -1
  153. package/dist/src/components/Icons/IconList.test.js +0 -58
  154. package/dist/src/components/Icons/IconView.d.ts +0 -1
  155. package/dist/src/components/Icons/IconView.js +0 -8
  156. package/dist/src/components/Icons/IconView.stories.d.ts +0 -4
  157. package/dist/src/components/Icons/IconView.stories.js +0 -20
  158. package/dist/src/components/Icons/LUIcon.jsx +0 -36
  159. package/dist/src/components/Icons/LUIcon.stories.d.ts +0 -6
  160. package/dist/src/components/Icons/LUIcon.stories.js +0 -75
  161. package/dist/src/components/Icons/LUIcon.test.jsx +0 -243
  162. package/dist/src/components/Icons/SingleIcon.test.d.ts +0 -1
  163. package/dist/src/components/Icons/SingleIcon.test.js +0 -68
  164. package/dist/src/components/Icons/stories/IconDropdown.jsx +0 -67
  165. package/dist/src/components/Icons/stories/IconGallery.jsx +0 -77
  166. package/dist/src/components/Icons/stories/InteractiveIconSelector.jsx +0 -86
  167. package/dist/src/components/Icons/stories/LUIcon.stories.jsx +0 -96
  168. package/dist/src/components/ImageUploader/ImageUploader.stories.jsx +0 -50
  169. package/dist/src/components/ImageUploader/imageUploader.jsx +0 -94
  170. package/dist/src/components/Images/LuImage.jsx +0 -19
  171. package/dist/src/components/Images/LuImage.stories.jsx +0 -154
  172. package/dist/src/components/Images/LuImage.test.jsx +0 -44
  173. package/dist/src/components/Input/Input.stories.jsx +0 -250
  174. package/dist/src/components/Input/input.jsx +0 -110
  175. package/dist/src/components/Label/Label.jsx +0 -32
  176. package/dist/src/components/Label/Label.stories.jsx +0 -30
  177. package/dist/src/components/MediaCard/Card.d.ts +0 -3
  178. package/dist/src/components/MediaCard/Card.js +0 -45
  179. package/dist/src/components/MediaCard/Card.stories.d.ts +0 -4
  180. package/dist/src/components/MediaCard/Card.stories.js +0 -57
  181. package/dist/src/components/MediaCard/Card.test.d.ts +0 -1
  182. package/dist/src/components/MediaCard/Card.test.js +0 -28
  183. package/dist/src/components/MediaCard/ContactProfile/ContactProfile.d.ts +0 -2
  184. package/dist/src/components/MediaCard/ContactProfile/ContactProfile.js +0 -27
  185. package/dist/src/components/MediaCard/ContactProfile/ContactProfile.test.d.ts +0 -1
  186. package/dist/src/components/MediaCard/ContactProfile/ContactProfile.test.js +0 -61
  187. package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme1.d.ts +0 -2
  188. package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme1.js +0 -7
  189. package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme1.test.d.ts +0 -1
  190. package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme1.test.js +0 -99
  191. package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme2.d.ts +0 -2
  192. package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme2.js +0 -7
  193. package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme2.test.d.ts +0 -1
  194. package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme2.test.js +0 -99
  195. package/dist/src/components/MediaCard/PostByCategory/PostByCategory.d.ts +0 -2
  196. package/dist/src/components/MediaCard/PostByCategory/PostByCategory.js +0 -31
  197. package/dist/src/components/MediaCard/PostByCategory/PostByCategory.test.d.ts +0 -1
  198. package/dist/src/components/MediaCard/PostByCategory/PostByCategory.test.js +0 -62
  199. package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme1.d.ts +0 -2
  200. package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme1.js +0 -7
  201. package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme1.test.d.ts +0 -1
  202. package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme1.test.js +0 -99
  203. package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme2.d.ts +0 -2
  204. package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme2.js +0 -7
  205. package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme2.test.d.ts +0 -1
  206. package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme2.test.js +0 -99
  207. package/dist/src/components/MediaCard/VerticalCard/VerticalCard.d.ts +0 -3
  208. package/dist/src/components/MediaCard/VerticalCard/VerticalCard.js +0 -13
  209. package/dist/src/components/MediaCard/VerticalCard/VerticalCard.stories.d.ts +0 -5
  210. package/dist/src/components/MediaCard/VerticalCard/VerticalCard.stories.js +0 -40
  211. package/dist/src/components/MediaCard/index.d.ts +0 -9
  212. package/dist/src/components/MediaCard/index.js +0 -13
  213. package/dist/src/components/MediaCard/type.d.ts +0 -47
  214. package/dist/src/components/RadioButton/RadioButton.stories.d.ts +0 -10
  215. package/dist/src/components/RadioButton/RadioButton.stories.js +0 -82
  216. package/dist/src/components/RadioButton/RadioGroup.stories.d.ts +0 -10
  217. package/dist/src/components/RadioButton/RadioGroup.stories.js +0 -131
  218. package/dist/src/components/RadioButton/radio-button.d.ts +0 -14
  219. package/dist/src/components/RadioButton/radio-button.js +0 -57
  220. package/dist/src/components/RadioButton/radio-group.d.ts +0 -21
  221. package/dist/src/components/RadioButton/radio-group.js +0 -59
  222. package/dist/src/components/RadioGroup/RadioGroup.stories.jsx +0 -146
  223. package/dist/src/components/RadioGroup/radio-group.jsx +0 -49
  224. package/dist/src/components/Slider/Slider.stories.jsx +0 -159
  225. package/dist/src/components/Slider/slider.jsx +0 -31
  226. package/dist/src/components/Switch/Switch.stories.jsx +0 -66
  227. package/dist/src/components/Switch/switch.jsx +0 -61
  228. package/dist/src/components/Tabs/Tabs.stories.jsx +0 -29
  229. package/dist/src/components/Tabs/tabs.jsx +0 -32
  230. package/dist/src/components/Title/Title.jsx +0 -8
  231. package/dist/src/components/Title/Title.stories.jsx +0 -37
  232. package/dist/src/components/Title/Title.test.jsx +0 -24
  233. package/dist/src/components/ToolTip/Tooltip.jsx +0 -18
  234. package/dist/src/components/ToolTip/Tooltip.stories.jsx +0 -25
  235. package/dist/src/components/Typography/Body/Body.stories.jsx +0 -34
  236. package/dist/src/components/Typography/Body/body.jsx +0 -52
  237. package/dist/src/components/Typography/Caption/Caption.stories.jsx +0 -24
  238. package/dist/src/components/Typography/Caption/caption.jsx +0 -25
  239. package/dist/src/components/Typography/Display/Display.stories.jsx +0 -24
  240. package/dist/src/components/Typography/Display/display.jsx +0 -39
  241. package/dist/src/components/Typography/Heading/Heading.stories.jsx +0 -37
  242. package/dist/src/components/Typography/Heading/heading.jsx +0 -53
  243. package/dist/src/components/ui/accordion.d.ts +0 -7
  244. package/dist/src/components/ui/accordion.js +0 -64
  245. package/dist/src/components/ui/avatar.jsx +0 -27
  246. package/dist/src/components/ui/caption.d.ts +0 -8
  247. package/dist/src/components/ui/caption.js +0 -34
  248. package/dist/src/components/ui/checkbox.d.ts +0 -4
  249. package/dist/src/components/ui/checkbox.js +0 -31
  250. package/dist/src/components/ui/input.d.ts +0 -3
  251. package/dist/src/components/ui/input.js +0 -29
  252. package/dist/src/components/ui/switch.d.ts +0 -22
  253. package/dist/src/components/ui/switch.js +0 -70
  254. package/dist/src/components/ui/tooltip.jsx +0 -38
  255. package/dist/src/components/ui/typography.jsx +0 -56
  256. package/dist/src/context/LocalizationContext.d.ts +0 -23
  257. package/dist/src/context/LocalizationContext.js +0 -17
  258. package/dist/src/utils/index.d.ts +0 -17
  259. package/dist/src/utils/index.js +0 -20
  260. /package/dist/src/components/{MediaCard → Avatar/StatusIndicator}/type.js +0 -0
  261. /package/dist/src/components/{Button/Button.test.d.ts → Dropdown/Combobox/type.js} +0 -0
  262. /package/dist/src/components/{Button/IconButton.test.d.ts → Dropdown/DropdownMenu/type.js} +0 -0
@@ -1,65 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import { color, IconButton, shape, size } from "./IconButton";
14
- import { iconList } from "../../utils/iconList";
15
- export default {
16
- title: "Components/Button/IconButton",
17
- component: IconButton,
18
- tags: ["autodocs"],
19
- };
20
- var Template = function (args) { return (_jsx(IconButton, __assign({ icon: "chart-simple", size: "md" }, args))); };
21
- export var _IconButton = Template.bind({});
22
- _IconButton.args = {
23
- icon: "chart-simple",
24
- };
25
- _IconButton.argTypes = {
26
- color: {
27
- control: {
28
- type: "select",
29
- labels: Object.keys(color),
30
- },
31
- options: Object.keys(color),
32
- },
33
- shape: {
34
- control: {
35
- type: "select",
36
- labels: Object.keys(shape),
37
- },
38
- options: Object.keys(shape),
39
- description: "Select the shape of the button",
40
- table: {
41
- defaultValue: { summary: "rounded-sm" },
42
- type: { summary: "string" },
43
- },
44
- },
45
- size: {
46
- control: {
47
- type: "select",
48
- labels: Object.keys(size),
49
- },
50
- options: Object.keys(size),
51
- description: "Select the size of the button",
52
- table: {
53
- defaultValue: { summary: "md" },
54
- type: { summary: "string" },
55
- },
56
- },
57
- icon: {
58
- control: {
59
- type: "select",
60
- labels: Object.fromEntries(iconList.map(function (icon) { return [icon.key, icon.label]; })),
61
- },
62
- options: iconList.map(function (icon) { return icon.key; }),
63
- description: "Icon (React component)",
64
- },
65
- };
@@ -1,28 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { fireEvent, render, screen } from "@testing-library/react";
3
- import { color, IconButton, shape, size } from "./IconButton";
4
- describe("Icon Button Component", function () {
5
- it("renders icon button with required icon prop", function () {
6
- render(_jsx(IconButton, { icon: "chart-simple" }));
7
- expect(screen.getByRole("button")).toBeInTheDocument();
8
- });
9
- it("calls onClick handler when clicked", function () {
10
- var handleClick = jest.fn();
11
- render(_jsx(IconButton, { onClick: handleClick, icon: "chart-simple" }));
12
- fireEvent.click(screen.getByRole("button"));
13
- expect(handleClick).toHaveBeenCalledTimes(1);
14
- });
15
- it("applies correct color, shape, and size classes", function () {
16
- render(_jsx(IconButton, { color: "blue", shape: "rounded-full", size: "lg", icon: "chart-simple" }));
17
- var buttonElement = screen.getByRole("button");
18
- expect(buttonElement).toHaveClass(color["blue"], shape["rounded-full"], size["lg"]);
19
- });
20
- it("applies additional className when provided", function () {
21
- render(_jsx(IconButton, { className: "custom-class", icon: "chart-simple" }));
22
- expect(screen.getByRole("button")).toHaveClass("custom-class");
23
- });
24
- it("renders without crashing when all required props are provided", function () {
25
- render(_jsx(IconButton, { icon: "chart-simple" }));
26
- expect(screen.getByRole("button")).toBeInTheDocument();
27
- });
28
- });
@@ -1,80 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import LuImage from "../../Images/LuImage";
13
- import Link from "next/link";
14
- import { Button } from "../../Button/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
- // Use destructuring to create cleaner code
20
- var modifiedItem = item;
21
- var modifiedEditor = editor;
22
- // Only swap for middle position
23
- if (mediaPosition === "middle") {
24
- // Swap for item
25
- 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 });
26
- // Swap for editor
27
- modifiedEditor = __assign(__assign({}, editor), { cardText: editor === null || editor === void 0 ? void 0 : editor.shortDescription, shortDescription: editor === null || editor === void 0 ? void 0 : editor.cardText });
28
- }
29
- // Common card media component
30
- var CardMedia = function (_a) {
31
- var _b = _a.className, className = _b === void 0 ? "" : _b;
32
- return (<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"/>);
33
- };
34
- // Common content section
35
- var CardContent = function (_a) {
36
- var _b = _a.className, className = _b === void 0 ? "" : _b;
37
- return (<div className={"flex flex-col !gap-1 ".concat(className)}>
38
- <Heading variant="h4-600" className={"line-clamp-1 capitalize ".concat(modifiedEditor === null || modifiedEditor === void 0 ? void 0 : modifiedEditor.cardTitle)}>
39
- {modifiedItem === null || modifiedItem === void 0 ? void 0 : modifiedItem.title}
40
- </Heading>
41
- <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)}>
42
- {modifiedItem === null || modifiedItem === void 0 ? void 0 : modifiedItem.description}
43
- </Body>
44
- </div>);
45
- };
46
- // Common button component with conditional shape
47
- var ActionButton = function (_a) {
48
- var _b = _a.className, className = _b === void 0 ? "" : _b;
49
- return (<Link href={href} passHref className={className}>
50
- <Button endIcon={"angle-right"} size={mediaPosition === "middle" ? "xl" : "sm"} {...(mediaPosition === "middle" && { shape: "rounded-full" })} className={"".concat(modifiedEditor === null || modifiedEditor === void 0 ? void 0 : modifiedEditor.cardBtn)}>
51
- {btnLabel}
52
- </Button>
53
- </Link>);
54
- };
55
- // Optional subtitle component
56
- var Subtitle = function () { return (<>
57
- {mediaPosition === "middle" && (<Body variant="body-xl" className={"line-clamp-4 h-32 ".concat(modifiedEditor === null || modifiedEditor === void 0 ? void 0 : modifiedEditor.shortDescription)} dangerouslySetInnerHTML={{
58
- __html: modifiedItem.short_description || "",
59
- }}/>)}
60
- </>); };
61
- // Horizontal layout
62
- if (orientation === "horizontal") {
63
- return (<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)}>
64
- <CardMedia className="max-w-48 aspect-square rounded-lg"/>
65
- <div className="flex flex-col !gap-5 w-full">
66
- <CardContent />
67
- <ActionButton />
68
- </div>
69
- </div>);
70
- }
71
- // Vertical layout
72
- return (<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)}>
73
- <div className={"flex ".concat(mediaPosition === "top" ? "flex-col" : "flex-col-reverse", " !gap-4")}>
74
- <Subtitle />
75
- <CardMedia className="aspect-16/10"/>
76
- <CardContent />
77
- </div>
78
- <ActionButton />
79
- </div>);
80
- };
@@ -1,104 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import { Dummy_Image, Dummy_Para, Dummy_Subtitle, Dummy_Title, Dummy_Url, } from "../../../utils/constants";
13
- import { OrientationEnum } from "../../../utils/enums";
14
- import Card from "../card";
15
- var meta = {
16
- title: "Components/Cards/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
- };
@@ -1,60 +0,0 @@
1
- import LuImage from "../../Images/LuImage";
2
- import Link from "next/link";
3
- import { Heading } from "../../Typography/Heading/heading";
4
- import { Body } from "../../Typography/Body/body";
5
- import { Button } from "../../Button/Button/Button";
6
- export var PostByCategory = function (_a) {
7
- var item = _a.item, image = _a.image, href = _a.href, btnLabel = _a.btnLabel, editor = _a.editor, mediaPosition = _a.mediaPosition, orientation = _a.orientation;
8
- // Normalize mediaPosition based on orientation
9
- var safeMediaPosition = orientation === "horizontal"
10
- ? mediaPosition === "left" || mediaPosition === "right"
11
- ? mediaPosition
12
- : "right"
13
- : mediaPosition === "top" || mediaPosition === "bottom"
14
- ? mediaPosition
15
- : "top";
16
- // Common card media component to avoid duplication
17
- var CardMedia = function (_a) {
18
- var _b = _a.className, className = _b === void 0 ? "" : _b;
19
- return (<LuImage src={image} width={240} height={240} className={"!rounded-lg ".concat(className, " ").concat(editor === null || editor === void 0 ? void 0 : editor.cardImage)} alt="Image"/>);
20
- };
21
- // Common content section component
22
- var CardContent = function (_a) {
23
- var _b = _a.className, className = _b === void 0 ? "" : _b;
24
- return (<div className={"flex flex-col !gap-1 ".concat(className, " ")}>
25
- <Heading variant="h4-600" className={"".concat(editor === null || editor === void 0 ? void 0 : editor.cardTitle, " capitalize line-clamp-1 !m-0")}>
26
- {item === null || item === void 0 ? void 0 : item.title}
27
- </Heading>
28
- <Body variant="body-md" className={" ".concat(orientation === "horizontal" ? "line-clamp-1" : "line-clamp-2", " ").concat(editor === null || editor === void 0 ? void 0 : editor.cardText)}>
29
- {item === null || item === void 0 ? void 0 : item.description}
30
- </Body>
31
- </div>);
32
- };
33
- // Common button component
34
- var CardButton = function (_a) {
35
- var _b = _a.className, className = _b === void 0 ? "" : _b;
36
- return (<Link href={href || "#"} passHref>
37
- <Button endIcon={"angle-right"} size="sm" className={"".concat(editor === null || editor === void 0 ? void 0 : editor.cardBtn, " ").concat(className)}>
38
- {btnLabel}
39
- </Button>
40
- </Link>);
41
- };
42
- // Horizontal layout
43
- if (orientation === "horizontal") {
44
- return (<div className={"!p-5 rounded-xl grid grid-cols-1 sm:grid-cols-3 max-w-5xl !gap-5 items-center shadow-lg ".concat(editor === null || editor === void 0 ? void 0 : editor.card)}>
45
- <CardMedia className={"".concat(safeMediaPosition === "right" && " order-last", " w-full aspect-5/4 sm:aspect-square object-cover")}/>
46
- <div className="flex flex-col !gap-2 md:!gap-5 sm:col-span-2 h-full justify-center">
47
- <CardContent />
48
- <CardButton />
49
- </div>
50
- </div>);
51
- }
52
- // Vertical layout
53
- return (<div className={"!p-5 sm:p-8 rounded-xl flex flex-col !gap-5 max-w-[480px] shadow-lg ".concat(editor === null || editor === void 0 ? void 0 : editor.card)}>
54
- <div className={"flex w-full ".concat(safeMediaPosition === "top" ? "flex-col" : "flex-col-reverse", " items-center !gap-5 ")}>
55
- <CardMedia className="w-full h-full aspect-5/4 object-cover"/>
56
- <CardContent className="h-20"/>
57
- </div>
58
- <CardButton />
59
- </div>);
60
- };
@@ -1,106 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import { Dummy_Image, Dummy_Para, Dummy_Subtitle, Dummy_Title, Dummy_Url, } from "../../../utils/constants";
13
- import { OrientationEnum } from "../../../utils/enums";
14
- import Card from "../card";
15
- var meta = {
16
- title: "Components/Cards/PostByCategory",
17
- component: Card,
18
- parameters: {
19
- layout: "centered",
20
- },
21
- argTypes: {
22
- 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
- };
@@ -1,26 +0,0 @@
1
- import LuImage from "../../Images/LuImage";
2
- import Link from "next/link";
3
- import { Heading } from "../../Typography/Heading/heading";
4
- import { Body } from "../../Typography/Body/body";
5
- import { Button } from "../../Button/Button/Button";
6
- export var SinglePost = function (_a) {
7
- var item = _a.item, image = _a.image, _b = _a.href, href = _b === void 0 ? "https://www.google.com/" : _b, _c = _a.btnLabel, btnLabel = _c === void 0 ? "View More" : _c, editor = _a.editor, _d = _a.mediaPosition, mediaPosition = _d === void 0 ? "right" : _d;
8
- return (<div className={" bg-white rounded-3xl grid grid-cols-1 sm:grid-cols-2 overflow-hidden items-stretch shadow-lg ".concat(editor === null || editor === void 0 ? void 0 : editor.card)}>
9
- <LuImage src={image} width={240} height={240} className={"w-full h-full ".concat(mediaPosition === "right" ? "order-1" : "", " aspect-5/4 object-cover ").concat(editor === null || editor === void 0 ? void 0 : editor.cardImage)} alt="Image"/>
10
- <div className="p-9 grid grid-rows-[1fr] items-center !gap-2 ">
11
- <div className="flex flex-col !gap-3 ">
12
- <Heading variant="h2-500" className={"line-clamp-1 md:line-clamp-2 ".concat(editor === null || editor === void 0 ? void 0 : editor.cardTitle)}>
13
- {item === null || item === void 0 ? void 0 : item.title}
14
- </Heading>
15
- <Body variant="body-xl" className={"line-clamp-2 ".concat(editor === null || editor === void 0 ? void 0 : editor.cardText, " ")}>
16
- {item === null || item === void 0 ? void 0 : item.description}
17
- </Body>
18
- </div>
19
- <Link href={href} passHref>
20
- <Button endIcon={"angle-right"} size="lg" className={"".concat(editor === null || editor === void 0 ? void 0 : editor.cardBtn)}>
21
- {btnLabel}
22
- </Button>
23
- </Link>
24
- </div>
25
- </div>);
26
- };
@@ -1,68 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import { 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
- };
@@ -1,36 +0,0 @@
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;
@@ -1,60 +0,0 @@
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
- };