linkedunion-design-kit 1.1.5 → 1.1.6

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.
@@ -5,7 +5,7 @@ import { avtarBackgroundSize } from "../../utils";
5
5
  export var Avatar = function (_a) {
6
6
  var image = _a.image, _b = _a.icon, icon = _b === void 0 ? 'user' : _b, shape = _a.shape, size = _a.size, className = _a.className;
7
7
  var defaultIcon = iconList.find(function (item) { return item.key === (icon || "user"); });
8
- return (_jsx(_Fragment, { children: _jsx("div", { className: "".concat(image ? 'bg-primary-200' : 'bg-gray-100', " flex items-center justify-center ").concat(shape, " overflow-hidden ").concat(className), style: avtarBackgroundSize(size), children: image ?
8
+ return (_jsx(_Fragment, { children: _jsx("div", { className: "".concat(image ? 'bg-primary-200' : 'bg-gray-100', " flex items-center justify-center ").concat(shape, " overflow-hidden ").concat(className), style: avtarBackgroundSize(size), "data-testid": "lu-avatar", children: image ?
9
9
  _jsx("img", { src: image, alt: "image", className: "w-full h-full object-cover" })
10
10
  :
11
11
  _jsx(LUIcon, { size: size, icon: defaultIcon === null || defaultIcon === void 0 ? void 0 : defaultIcon.key, fill: "lu-neutral-icon-dark", className: "" }) }) }));
@@ -19,7 +19,7 @@ export default {
19
19
  var Template = function (args) { return _jsx(Avatar, __assign({}, args)); };
20
20
  export var avatar = Template.bind({});
21
21
  avatar.args = {
22
- image: '/images/sanjna.jpg',
22
+ image: '/images/avatar.png',
23
23
  shape: 'square',
24
24
  size: 'lu-avatar-massive',
25
25
  className: '',
@@ -1,2 +1,2 @@
1
1
  import { AspectRatioProps } from "@/types/interface";
2
- export declare const Image: ({ image, aspectRatio, className }: AspectRatioProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const LuImage: ({ image, aspectRatio, className }: AspectRatioProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- export var Image = function (_a) {
2
+ import Image from "next/image";
3
+ export var LuImage = function (_a) {
3
4
  var image = _a.image, aspectRatio = _a.aspectRatio, className = _a.className;
4
- return (_jsx("div", { "data-testid": "lu-image", children: _jsx("img", { src: image || '', alt: "Image", className: "w-[240px] ".concat(aspectRatio, " ").concat(className) }) }));
5
+ return (_jsx(Image, { src: image || '', alt: "Image", width: 240, height: 160, className: "".concat(aspectRatio, " ").concat(className) }));
5
6
  };
@@ -10,12 +10,12 @@ 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 { Image } from "./LuImage";
13
+ import { LuImage } from "./LuImage";
14
14
  import { landscapeaspectRatioList, portraitaspectRatioList } from "../../utils";
15
15
  import { orientationEnum } from "../../utils/enum";
16
16
  export default {
17
17
  title: "Components/Image",
18
- component: Image,
18
+ component: LuImage,
19
19
  };
20
20
  var Template = function (args, _a) {
21
21
  var argTypes = _a.argTypes;
@@ -26,7 +26,7 @@ var Template = function (args, _a) {
26
26
  ratio.key,
27
27
  ratio.label,
28
28
  ]; }));
29
- return _jsx(Image, __assign({}, args));
29
+ return _jsx(LuImage, __assign({}, args));
30
30
  };
31
31
  export var image = Template.bind({});
32
32
  image.args = {
@@ -1,2 +1,2 @@
1
1
  import { CardProps } from "@/types/interface";
2
- export declare const Card: ({ image, layout, mediaPosition, heading, body, className, btnLabel }: CardProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const Card: ({ type, image, layout, mediaPosition, heading, body, className, btnLabel }: CardProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,10 +1,29 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Image } from "../Images/LuImage";
3
- import { Button } from "../Button/Button";
4
- import { cardLayoutEnum, contentTypeEnum, orientationEnum } from "../../utils/enum";
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, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { cardLayoutEnum, orientationEnum, sectionType } from "../../utils/enum";
14
+ import { PostByCategory } from "./PostByCategory";
15
+ import { ContactProfile } from "./ContactProfile";
5
16
  export var Card = function (_a) {
6
- var _b = _a.image, image = _b === void 0 ? '/images/demo-image.jpg' : _b, _c = _a.layout, layout = _c === void 0 ? cardLayoutEnum.horizontal : _c, _d = _a.mediaPosition, mediaPosition = _d === void 0 ? orientationEnum.landscape : _d, _e = _a.heading, heading = _e === void 0 ? 'Heading Text' : _e, _f = _a.body, body = _f === void 0 ? 'The quick brown fox jumps over the lazy dog.' : _f, _g = _a.className, className = _g === void 0 ? '' : _g, _h = _a.btnLabel, btnLabel = _h === void 0 ? 'View More' : _h;
7
- return (_jsx(_Fragment, { children: layout === cardLayoutEnum.horizontal ?
8
- _jsxs("div", { className: "lu-pd-250 bg-white lu-border-rounded-xl ".concat(className, " lu-shadow-md flex gap-x-[20px] w-fit"), children: [_jsx(Image, { image: image, aspectRatio: "lu-aspect-square", className: "lu-border-rounded-lg", orientation: mediaPosition }), _jsxs("div", { className: "flex flex-1 flex-col", children: [_jsxs("div", { className: "flex flex-col justify-center flex-1 h-full", children: [_jsx("div", { className: "text-gray-950 lu-font-size-2x-large lu-font-weight-semibold", children: heading }), _jsx("p", { className: "lu-base-font-size lu-font-weight-extra-light horizontal_body_text", children: body })] }), _jsx(Button, { contentType: contentTypeEnum.text_with_icon, label: btnLabel, variant: 'lu-btn-gray', iconRight: "angle-right", rightIconSize: "lu-icon-small", size: "lu-btn-lg", className: "lu-border-rounded-sm justify-between lu-width-100" })] })] })
9
- : (_jsx(_Fragment, { children: _jsxs("div", { className: "lu-pd-400 bg-white lu-border-rounded-xl ".concat(className, " lu-shadow-md flex flex-col items-center w-full"), children: [_jsx(Image, { image: image, aspectRatio: "lu-aspect-square", className: "lu-border-rounded-lg", orientation: mediaPosition }), _jsxs("div", { className: "flex flex-col items-center flex-grow lu-m-250 text-center h-[175px]", children: [_jsx("div", { className: "text-gray-950 lu-font-size-2x-large lu-font-weight-semibold vertical_card_heading", children: heading }), _jsx("p", { className: "lu-base-font-size lu-font-weight-extra-light vertical_body_text", children: body })] }), _jsx(Button, { contentType: contentTypeEnum.text_with_icon, label: btnLabel, variant: 'lu-btn-gray', iconRight: "angle-right", rightIconSize: "lu-icon-small", size: "lu-btn-lg", className: "lu-border-rounded-sm justify-between lu-width-100" })] }) })) }));
17
+ var _b = _a.type, type = _b === void 0 ? sectionType.postByCategoriesTheme : _b, _c = _a.image, image = _c === void 0 ? '/images/demo-image.jpg' : _c, _d = _a.layout, layout = _d === void 0 ? cardLayoutEnum.horizontal : _d, _e = _a.mediaPosition, mediaPosition = _e === void 0 ? orientationEnum.landscape : _e, _f = _a.heading, heading = _f === void 0 ? 'Heading Text' : _f, _g = _a.body, body = _g === void 0 ? 'The quick brown fox jumps over the lazy dog.' : _g, _h = _a.className, className = _h === void 0 ? '' : _h, _j = _a.btnLabel, btnLabel = _j === void 0 ? 'View More' : _j;
18
+ var data = {
19
+ type: type,
20
+ image: image,
21
+ layout: layout,
22
+ mediaPosition: mediaPosition,
23
+ heading: heading,
24
+ body: body,
25
+ className: className,
26
+ btnLabel: btnLabel,
27
+ };
28
+ return (_jsxs(_Fragment, { children: [type === sectionType.postByCategoriesTheme && _jsx(PostByCategory, __assign({}, data)), type === sectionType.contactsProfileTheme && _jsx(ContactProfile, __assign({}, data))] }));
10
29
  };
@@ -11,7 +11,8 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { Card } from "./Card";
14
- import { cardLayoutEnum, orientationEnum } from "../../utils/enum";
14
+ import { cardLayoutEnum, orientationEnum, sectionType } from "../../utils/enum";
15
+ import { sectionTypeList } from "../../utils";
15
16
  export default {
16
17
  title: "Components/Card",
17
18
  component: Card,
@@ -19,12 +20,13 @@ export default {
19
20
  var Template = function (args) { return _jsx(Card, __assign({}, args)); };
20
21
  export var card = Template.bind({});
21
22
  card.args = {
23
+ type: sectionType.postByCategoriesTheme,
22
24
  image: '/images/demo-image.jpg',
23
25
  heading: 'Heading Text',
24
26
  body: 'The quick brown fox jumps over the lazy dog.',
25
27
  mediaPosition: orientationEnum.landscape,
26
28
  layout: cardLayoutEnum.horizontal,
27
- btnLabel: 'View More'
29
+ btnLabel: 'View More',
28
30
  };
29
31
  card.argTypes = {
30
32
  mediaPosition: {
@@ -35,4 +37,8 @@ card.argTypes = {
35
37
  control: { type: "select" },
36
38
  options: [cardLayoutEnum.horizontal, cardLayoutEnum.vertical],
37
39
  },
40
+ type: {
41
+ control: { type: "select", labels: Object.fromEntries(sectionTypeList.map(function (type) { return [type.key, type.label]; })) },
42
+ options: sectionTypeList.map(function (type) { return type.key; }),
43
+ }
38
44
  };
@@ -0,0 +1,2 @@
1
+ import { CardProps } from "@/types/interface";
2
+ export declare const ContactProfile: ({ image, layout, mediaPosition, heading, body, className, btnLabel }: CardProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { cardLayoutEnum, contentTypeEnum, orientationEnum } from "../../utils/enum";
3
+ import { LuImage } from "../Images/LuImage";
4
+ import { Button } from "../Button/Button";
5
+ export var ContactProfile = function (_a) {
6
+ var _b = _a.image, image = _b === void 0 ? '/images/demo-image.jpg' : _b, _c = _a.layout, layout = _c === void 0 ? cardLayoutEnum.horizontal : _c, _d = _a.mediaPosition, mediaPosition = _d === void 0 ? orientationEnum.landscape : _d, _e = _a.heading, heading = _e === void 0 ? 'Heading Text' : _e, _f = _a.body, body = _f === void 0 ? 'The quick brown fox jumps over the lazy dog.' : _f, _g = _a.className, className = _g === void 0 ? '' : _g, _h = _a.btnLabel, btnLabel = _h === void 0 ? 'View More' : _h;
7
+ return (_jsx(_Fragment, { children: layout === cardLayoutEnum.horizontal ?
8
+ _jsxs("div", { className: "lu-pd-250 bg-white lu-border-rounded-xl ".concat(className, " lu-shadow-md flex gap-x-[20px] lu-width-100"), children: [_jsx("div", { className: "lu-width-100 max-w-[240px] overflow-hidden lu-aspect-square", children: _jsx(LuImage, { image: image, aspectRatio: "", className: "lu-border-rounded-full lu-width-100 lu-height-100 object-cover", orientation: mediaPosition }) }), _jsxs("div", { className: "flex flex-1 flex-col", children: [_jsxs("div", { className: "flex flex-col justify-center flex-1 h-full", children: [_jsx("div", { className: "text-gray-950 lu-font-size-2x-large lu-font-weight-semibold horizontal_card_heading", children: heading }), _jsx("p", { className: "lu-base-font-size lu-font-weight-extra-light horizontal_body_text", children: body })] }), _jsx(Button, { contentType: contentTypeEnum.text_with_icon, label: btnLabel, variant: 'lu-btn-gray', iconRight: "angle-right", rightIconSize: "lu-icon-small", size: "lu-btn-lg", className: "lu-border-rounded-sm justify-between lu-width-100" })] })] })
9
+ : (_jsx(_Fragment, { children: _jsxs("div", { className: "lu-pd-400 bg-white lu-border-rounded-xl ".concat(className, " lu-shadow-md flex flex-col items-center lu-width-100"), children: [_jsx("div", { className: "lu-width-100 max-w-[240px] overflow-hidden lu-aspect-square", children: _jsx(LuImage, { image: image, className: "lu-width-100 lu-height-100 object-cover lu-border-rounded-full", orientation: mediaPosition }) }), _jsxs("div", { className: "flex flex-col items-center flex-grow lu-m-250 text-center h-[100px]", children: [_jsx("div", { className: "text-gray-950 lu-font-size-2x-large lu-font-weight-semibold vertical_card_heading", children: heading }), _jsx("p", { className: "lu-base-font-size lu-font-weight-extra-light vertical_body_text", children: body })] }), _jsx(Button, { contentType: contentTypeEnum.text_with_icon, label: btnLabel, variant: 'lu-btn-gray', iconRight: "angle-right", rightIconSize: "lu-icon-small", size: "lu-btn-lg", className: "lu-border-rounded-sm justify-between lu-width-100" })] }) })) }));
10
+ };
@@ -0,0 +1,2 @@
1
+ import { CardProps } from "@/types/interface";
2
+ export declare const PostByCategory: ({ image, layout, mediaPosition, heading, body, className, btnLabel }: CardProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { cardLayoutEnum, contentTypeEnum, orientationEnum } from "../../utils/enum";
3
+ import { LuImage } from "../Images/LuImage";
4
+ import { Button } from "../Button/Button";
5
+ export var PostByCategory = function (_a) {
6
+ var _b = _a.image, image = _b === void 0 ? '/images/demo-image.jpg' : _b, _c = _a.layout, layout = _c === void 0 ? cardLayoutEnum.horizontal : _c, _d = _a.mediaPosition, mediaPosition = _d === void 0 ? orientationEnum.landscape : _d, _e = _a.heading, heading = _e === void 0 ? 'Heading Text' : _e, _f = _a.body, body = _f === void 0 ? 'The quick brown fox jumps over the lazy dog.' : _f, _g = _a.className, className = _g === void 0 ? '' : _g, _h = _a.btnLabel, btnLabel = _h === void 0 ? 'View More' : _h;
7
+ return (_jsx(_Fragment, { children: layout === cardLayoutEnum.horizontal ?
8
+ _jsxs("div", { className: "lu-pd-250 bg-white lu-border-rounded-xl ".concat(className, " lu-shadow-md flex gap-x-[20px] lu-width-100"), children: [_jsx("div", { className: "lu-width-100 max-w-[240px] overflow-hidden lu-aspect-square", children: _jsx(LuImage, { image: image, aspectRatio: "", className: "lu-border-rounded-lg lu-width-100 lu-height-100 object-cover", orientation: mediaPosition }) }), _jsxs("div", { className: "flex flex-1 flex-col", children: [_jsxs("div", { className: "flex flex-col justify-center flex-1 h-full", children: [_jsx("div", { className: "text-gray-950 lu-font-size-2x-large lu-font-weight-semibold horizontal_card_heading", children: heading }), _jsx("p", { className: "lu-base-font-size lu-font-weight-extra-light horizontal_body_text", children: body })] }), _jsx(Button, { contentType: contentTypeEnum.text_with_icon, label: btnLabel, variant: 'lu-btn-gray', iconRight: "angle-right", rightIconSize: "lu-icon-small", size: "lu-btn-lg", className: "lu-border-rounded-sm justify-between lu-width-100" })] })] })
9
+ : (_jsx(_Fragment, { children: _jsxs("div", { className: "lu-pd-400 bg-white lu-border-rounded-xl ".concat(className, " lu-shadow-md flex flex-col items-center lu-width-100"), children: [_jsx("div", { className: "lu-width-100 max-w-[240px] overflow-hidden lu-aspect-square", children: _jsx(LuImage, { image: image, className: "lu-width-100 lu-height-100 object-cover", orientation: mediaPosition }) }), _jsxs("div", { className: "flex flex-col items-center flex-grow lu-m-250 text-center h-[100px]", children: [_jsx("div", { className: "text-gray-950 lu-font-size-2x-large lu-font-weight-semibold vertical_card_heading", children: heading }), _jsx("p", { className: "lu-base-font-size lu-font-weight-extra-light vertical_body_text", children: body })] }), _jsx(Button, { contentType: contentTypeEnum.text_with_icon, label: btnLabel, variant: 'lu-btn-gray', iconRight: "angle-right", rightIconSize: "lu-icon-small", size: "lu-btn-lg", className: "lu-border-rounded-sm justify-between lu-width-100" })] }) })) }));
10
+ };
@@ -613,8 +613,8 @@ video {
613
613
  .h-48 {
614
614
  height: 12rem;
615
615
  }
616
- .h-\[175px\] {
617
- height: 175px;
616
+ .h-\[100px\] {
617
+ height: 100px;
618
618
  }
619
619
  .h-full {
620
620
  height: 100%;
@@ -679,9 +679,6 @@ video {
679
679
  .w-10 {
680
680
  width: 2.5rem;
681
681
  }
682
- .w-\[240px\] {
683
- width: 240px;
684
- }
685
682
  .w-fit {
686
683
  width: -moz-fit-content;
687
684
  width: fit-content;
@@ -746,6 +743,9 @@ video {
746
743
  .max-w-5xl {
747
744
  max-width: 64rem;
748
745
  }
746
+ .max-w-\[240px\] {
747
+ max-width: 240px;
748
+ }
749
749
  .max-w-\[30ch\] {
750
750
  max-width: 30ch;
751
751
  }
@@ -10632,17 +10632,18 @@ table, th, td {
10632
10632
  -webkit-box-orient: vertical;
10633
10633
  overflow: hidden;
10634
10634
  }
10635
- @media (max-width: 430px) {
10636
- .horizontal_body_text {
10637
- display: -webkit-box;
10638
- -webkit-line-clamp: 2;
10639
- /* Limits text to 2 lines */
10640
- line-clamp: 2;
10641
- /* Limits text to 2 lines */
10642
- -webkit-box-orient: vertical;
10643
- overflow: hidden;
10644
- text-overflow: ellipsis;
10645
- }
10635
+ .horizontal_body_text {
10636
+ display: -webkit-box;
10637
+ -webkit-line-clamp: 2;
10638
+ -webkit-box-orient: vertical;
10639
+ overflow: hidden;
10640
+ }
10641
+ .horizontal_card_heading{
10642
+ display: -webkit-box;
10643
+ -webkit-line-clamp: 1;
10644
+ -webkit-box-orient: vertical;
10645
+ overflow: hidden;
10646
+ text-transform: capitalize;
10646
10647
  }
10647
10648
  .before\:absolute::before {
10648
10649
  content: var(--tw-content);
@@ -15,3 +15,11 @@ export declare const cardLayoutEnum: {
15
15
  horizontal: string;
16
16
  vertical: string;
17
17
  };
18
+ export declare const sectionType: {
19
+ multiplePostsTheme: string;
20
+ singlePostTheme: string;
21
+ postByCategoriesTheme: string;
22
+ contactsProfileTheme: string;
23
+ galleryTheme: string;
24
+ albumTheme: string;
25
+ };
@@ -15,3 +15,11 @@ export var cardLayoutEnum = {
15
15
  horizontal: 'Horizontal',
16
16
  vertical: 'Vertical'
17
17
  };
18
+ export var sectionType = {
19
+ multiplePostsTheme: "Multiple Posts",
20
+ singlePostTheme: 'Single Post',
21
+ postByCategoriesTheme: 'Post By Categories',
22
+ contactsProfileTheme: 'Contacts Profile',
23
+ galleryTheme: 'Gallery',
24
+ albumTheme: 'Album'
25
+ };
@@ -111,6 +111,10 @@ export declare const avtarBackgroundSize: (size: string) => {
111
111
  width: string;
112
112
  height: string;
113
113
  } | undefined;
114
+ export declare const sectionTypeList: {
115
+ key: string;
116
+ label: string;
117
+ }[];
114
118
  export default function generateUtilities(property: string, theme: (property: string) => Record<string, string>): Record<string, Record<string, string>>;
115
119
  export declare const customColors: {
116
120
  white: string;
@@ -1,3 +1,4 @@
1
+ import { sectionType } from "./enum";
1
2
  //************Used for typography and color utilities Storybook************
2
3
  export var text = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.";
3
4
  export var colorGroups = {
@@ -416,6 +417,14 @@ export var avtarBackgroundSize = function (size) {
416
417
  };
417
418
  }
418
419
  };
420
+ export var sectionTypeList = [
421
+ { key: sectionType.multiplePostsTheme, label: sectionType.multiplePostsTheme },
422
+ { key: sectionType.albumTheme, label: sectionType.albumTheme },
423
+ { key: sectionType.contactsProfileTheme, label: sectionType.contactsProfileTheme },
424
+ { key: sectionType.singlePostTheme, label: sectionType.singlePostTheme },
425
+ { key: sectionType.postByCategoriesTheme, label: sectionType.postByCategoriesTheme },
426
+ { key: sectionType.galleryTheme, label: sectionType.galleryTheme }
427
+ ];
419
428
  //Plugin for generating utilities (Used in tailwind.config.js)
420
429
  export default function generateUtilities(property, theme) {
421
430
  var utilities = theme(property);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linkedunion-design-kit",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",