linkedunion-design-kit 1.7.2 → 1.7.3

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.
@@ -0,0 +1,2 @@
1
+ import { CardInterface } from "../type";
2
+ export declare const MultiNews: ({ item, image, href, btnLabel, editor, mediaPosition, orientation, }: CardInterface) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,48 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
13
+ import LuImage from "../../Images/LuImage";
14
+ import Link from "next/link";
15
+ import { Button } from "../../Button/Button";
16
+ import { Body } from "../../Typography/Body/body";
17
+ import { Heading } from "../../Typography/Heading/heading";
18
+ export var MultiNews = function (_a) {
19
+ var item = _a.item, image = _a.image, _b = _a.href, href = _b === void 0 ? "https://www.google.com/" : _b, _c = _a.btnLabel, btnLabel = _c === void 0 ? "View More" : _c, editor = _a.editor, _d = _a.mediaPosition, mediaPosition = _d === void 0 ? "right" : _d, orientation = _a.orientation;
20
+ // Create modified item with shuffled subtitle and description when mediaPosition is middle
21
+ var modifiedItem = mediaPosition === "middle"
22
+ ? __assign(__assign({}, item), { description: item.subtitle, subtitle: item.description }) : item;
23
+ // Common card media component
24
+ var CardMedia = function (_a) {
25
+ var _b = _a.className, className = _b === void 0 ? "" : _b;
26
+ return (_jsx(LuImage, { src: image, width: 240, height: 240, className: " object-cover w-full ".concat(className, " ").concat(editor === null || editor === void 0 ? void 0 : editor.cardImage), alt: "Image" }));
27
+ };
28
+ // Common content section
29
+ var CardContent = function (_a) {
30
+ var _b = _a.className, className = _b === void 0 ? "" : _b;
31
+ return (_jsxs("div", { className: "flex flex-col !gap-1 ".concat(className), children: [_jsx(Heading, { variant: "h5-700", className: "line-clamp-1 capitalize ".concat(editor === null || editor === void 0 ? void 0 : editor.cardTitle), children: modifiedItem === null || modifiedItem === void 0 ? void 0 : modifiedItem.title }), _jsx(Body, { variant: "body-xl", className: "".concat(mediaPosition === "middle" ? "line-clamp-1" : "line-clamp-2 h-16", " ").concat(editor === null || editor === void 0 ? void 0 : editor.cardText), children: modifiedItem === null || modifiedItem === void 0 ? void 0 : modifiedItem.description })] }));
32
+ };
33
+ // Common button component with conditional shape
34
+ var ActionButton = function (_a) {
35
+ var _b = _a.className, className = _b === void 0 ? "" : _b;
36
+ return (_jsx(Link, { href: href, passHref: true, className: className, children: _jsx(Button, __assign({ endIcon: "angle-right", size: mediaPosition === "middle" ? "xl" : "lg" }, (mediaPosition === "middle" && { shape: "rounded-full" }), { className: "".concat(editor === null || editor === void 0 ? void 0 : editor.cardBtn), children: btnLabel })) }));
37
+ };
38
+ // Optional subtitle component
39
+ var Subtitle = function () { return (_jsx(_Fragment, { children: mediaPosition === "middle" && (_jsx(Body, { variant: "body-xl", className: "line-clamp-4 h-32 ".concat(editor === null || editor === void 0 ? void 0 : editor.cardSubtitle), dangerouslySetInnerHTML: {
40
+ __html: modifiedItem.subtitle || "",
41
+ } })) })); };
42
+ // Horizontal layout
43
+ if (orientation === "horizontal") {
44
+ return (_jsxs("div", { className: "!p-5 bg-white rounded-2xl flex ".concat(mediaPosition === "right" ? "flex-row-reverse" : "", " !gap-5 items-center shadow-lg ").concat(editor === null || editor === void 0 ? void 0 : editor.card), children: [_jsx(CardMedia, { className: "max-w-40 aspect-square rounded-lg" }), _jsxs("div", { className: "flex flex-col !gap-5 w-full", children: [_jsx(CardContent, {}), _jsx(ActionButton, {})] })] }));
45
+ }
46
+ // Vertical layout
47
+ return (_jsxs("div", { className: "p-8 bg-white rounded-2xl flex flex-col !gap-5 max-w-md shadow-lg ".concat(editor === null || editor === void 0 ? void 0 : editor.card), children: [_jsxs("div", { className: "flex ".concat(mediaPosition === "top" ? "flex-col" : "flex-col-reverse", " !gap-5"), children: [_jsx(Subtitle, {}), _jsx(CardMedia, { className: "aspect-16/10" }), _jsx(CardContent, {})] }), _jsx(ActionButton, {})] }));
48
+ };
@@ -0,0 +1,9 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { MultiNews } from "./MultiNews";
3
+ declare const meta: Meta<typeof MultiNews>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof MultiNews>;
6
+ export declare const MultiNewsHorizontalLeft: Story;
7
+ export declare const MultiNewsHorizontalRight: Story;
8
+ export declare const MultiNewsVerticalTop: Story;
9
+ export declare const MultiNewsVerticalBottom: Story;
@@ -0,0 +1,52 @@
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 { MultiNews } from "./MultiNews";
13
+ import { Dummy_Image, Dummy_Para, Dummy_Subtitle, Dummy_Title, Dummy_Url, } from "../../../utils/constants";
14
+ var meta = {
15
+ title: "Components/NewCard/MultiNews",
16
+ component: MultiNews,
17
+ parameters: {
18
+ layout: "centered",
19
+ },
20
+ };
21
+ export default meta;
22
+ var baseCardArgs = {
23
+ type: "multipleNews",
24
+ item: {
25
+ image: Dummy_Image,
26
+ title: Dummy_Title,
27
+ description: Dummy_Para,
28
+ subtitle: Dummy_Subtitle,
29
+ },
30
+ image: Dummy_Image,
31
+ href: Dummy_Url,
32
+ btnLabel: "View More",
33
+ editor: {
34
+ card: "",
35
+ cardImage: "",
36
+ cardTitle: "",
37
+ cardText: "",
38
+ cardBtn: "",
39
+ },
40
+ };
41
+ export var MultiNewsHorizontalLeft = {
42
+ args: __assign(__assign({}, baseCardArgs), { orientation: "horizontal", mediaPosition: "left" }),
43
+ };
44
+ export var MultiNewsHorizontalRight = {
45
+ args: __assign(__assign({}, baseCardArgs), { orientation: "horizontal", mediaPosition: "right" }),
46
+ };
47
+ export var MultiNewsVerticalTop = {
48
+ args: __assign(__assign({}, baseCardArgs), { orientation: "vertical", mediaPosition: "top" }),
49
+ };
50
+ export var MultiNewsVerticalBottom = {
51
+ args: __assign(__assign({}, baseCardArgs), { orientation: "vertical", mediaPosition: "bottom" }),
52
+ };
@@ -1,7 +1,7 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
2
  import React from "react";
3
3
  import { PostByCategory } from "./PostByCategory/PostByCategory";
4
- import { MultiNews } from "./MultiNews";
4
+ import { MultiNews } from "./MultipleNews/MultiNews";
5
5
  import { SinglePost } from "./SinglePost";
6
6
  import { Dummy_Url } from "../../utils/constants";
7
7
  import { PhotoGallery } from "./PhotoGallery";
@@ -28,7 +28,7 @@ export var variant = {
28
28
  "label-xl": "!text-xl",
29
29
  "label-lg": "!text-lg",
30
30
  "label-md": "!text-base",
31
- "label-sm": "!text-sm",
31
+ "label-sm": "!text-sm !font-normal",
32
32
  };
33
33
  var labelVariants = cva("flex items-center !gap-2 select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50 !font-medium !leading-normal m-0", {
34
34
  variants: { variant: variant },
@@ -64,6 +64,6 @@ function Heading(_a) {
64
64
  if (variant === null || variant === void 0 ? void 0 : variant.startsWith("h")) {
65
65
  Tag = variant.split("-")[0];
66
66
  }
67
- return (_jsx(Tag, __assign({ className: cn(headingVariants({ variant: variant, className: className })) }, props, { children: children })));
67
+ return (_jsx(Tag, __assign({ className: cn(headingVariants({ variant: variant, className: className }), "m-0") }, props, { children: children })));
68
68
  }
69
69
  export { Heading, headingVariants };
@@ -284,9 +284,6 @@
284
284
  .mt-4 {
285
285
  margin-top: calc(var(--spacing) * 4);
286
286
  }
287
- .mt-5 {
288
- margin-top: calc(var(--spacing) * 5);
289
- }
290
287
  .\!mb-4 {
291
288
  margin-bottom: calc(var(--spacing) * 4) !important;
292
289
  }
@@ -305,6 +302,12 @@
305
302
  -webkit-box-orient: vertical;
306
303
  -webkit-line-clamp: 2;
307
304
  }
305
+ .line-clamp-4 {
306
+ overflow: hidden;
307
+ display: -webkit-box;
308
+ -webkit-box-orient: vertical;
309
+ -webkit-line-clamp: 4;
310
+ }
308
311
  .block {
309
312
  display: block;
310
313
  }
@@ -3261,7 +3264,7 @@
3261
3264
  --card-foreground: oklch(0.145 0 0);
3262
3265
  --popover: oklch(1 0 0);
3263
3266
  --popover-foreground: oklch(0.145 0 0);
3264
- --primary: #276ab3;
3267
+ --primary: oklch(0.205 0 0);
3265
3268
  --primary-foreground: oklch(0.985 0 0);
3266
3269
  --secondary: oklch(0.97 0 0);
3267
3270
  --secondary-foreground: oklch(0.205 0 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linkedunion-design-kit",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",