linkedunion-design-kit 1.6.3 → 1.6.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 (53) hide show
  1. package/dist/app/page.js +2 -3
  2. package/dist/index.d.ts +4 -4
  3. package/dist/index.js +4 -4
  4. package/dist/src/components/Button/Button.d.ts +45 -3
  5. package/dist/src/components/Button/Button.js +77 -6
  6. package/dist/src/components/Button/Button.stories.d.ts +124 -5
  7. package/dist/src/components/Button/Button.stories.js +236 -51
  8. package/dist/src/components/Button/Button.test.js +2 -54
  9. package/dist/src/components/Button/IconButton.d.ts +33 -3
  10. package/dist/src/components/Button/IconButton.js +54 -5
  11. package/dist/src/components/Button/IconButton.stories.js +24 -12
  12. package/dist/src/components/Button/IconButton.test.js +7 -9
  13. package/dist/src/components/Button/index.d.ts +0 -7
  14. package/dist/src/components/Button/index.js +5 -12
  15. package/dist/src/components/Button/type.d.ts +0 -22
  16. package/dist/src/components/Button/type.js +25 -1
  17. package/dist/src/components/Checkbox/checkbox.stories.js +2 -2
  18. package/dist/src/components/ColorPicker/ColorPicker.js +6 -1
  19. package/dist/src/components/EditorTooltip/EditorTooltip.js +2 -3
  20. package/dist/src/components/Icons/LUIcon.d.ts +1 -1
  21. package/dist/src/components/Icons/LUIcon.js +10 -4
  22. package/dist/src/components/Icons/LUIcon.stories.d.ts +3 -1
  23. package/dist/src/components/Icons/LUIcon.stories.js +51 -20
  24. package/dist/src/components/Icons/index.d.ts +64 -1
  25. package/dist/src/components/Icons/index.js +84 -14
  26. package/dist/src/components/Icons/type.d.ts +7 -3
  27. package/dist/src/components/ImageUploader/ImageUploader.stories.d.ts +1 -1
  28. package/dist/src/components/ImageUploader/ImageUploader.stories.js +1 -1
  29. package/dist/src/components/ImageUploader/imageUploader.d.ts +3 -0
  30. package/dist/src/components/ImageUploader/imageUploader.js +68 -0
  31. package/dist/src/components/Label/Label.d.ts +14 -3
  32. package/dist/src/components/Label/Label.js +19 -5
  33. package/dist/src/components/Label/Label.stories.d.ts +1 -2
  34. package/dist/src/components/Label/Label.stories.js +10 -4
  35. package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme1.js +2 -3
  36. package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme2.js +2 -3
  37. package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme1.js +2 -3
  38. package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme2.js +2 -3
  39. package/dist/src/components/ToolTip/Tooltip.js +1 -1
  40. package/dist/src/components/ToolTip/Tooltip.stories.js +2 -3
  41. package/dist/src/components/Typography/Body/body.d.ts +5 -5
  42. package/dist/src/components/Typography/Body/body.js +5 -5
  43. package/dist/src/components/Typography/Caption/Caption.stories.js +13 -1
  44. package/dist/src/components/Typography/Heading/heading.d.ts +1 -1
  45. package/dist/src/components/Typography/Heading/heading.js +4 -4
  46. package/dist/src/components/ui/body.d.ts +0 -35
  47. package/dist/src/components/ui/body.js +1 -61
  48. package/dist/src/components/ui/caption.d.ts +6 -2
  49. package/dist/src/components/ui/caption.js +7 -2
  50. package/dist/src/components/ui/imageUploader.js +2 -2
  51. package/dist/src/components/ui/typography.d.ts +1 -1
  52. package/dist/styles/global.css +140 -958
  53. package/package.json +2 -1
@@ -1,16 +1,86 @@
1
1
  export var iconSize = {
2
- xxs: "w-2 h-2",
3
- xs: "w-3 h-3",
4
- sm: "w-3.5 h-3.5",
5
- md: "w-4 h-4",
6
- lg: "w-5 h-5",
7
- xl: "w-6 h-6",
8
- "2xl": "w-6 h-6",
9
- "3xl": "w-7 h-7",
10
- "4xl": "w-8 h-8",
11
- "5xl": "w-9 h-9",
12
- "6xl": "w-10 h-10",
13
- "7xl": "w-12 h-12",
14
- huge: "w-16 h-16",
15
- massive: "w-20 h-20",
2
+ xs: "size-3",
3
+ sm: "size-3.5",
4
+ md: "size-4",
5
+ lg: "size-5",
6
+ xl: "size-6",
7
+ "2xl": "size-7",
8
+ "3xl": "size-8",
9
+ "4xl": "size-9",
10
+ "5xl": "size-10",
11
+ "6xl": "size-11",
12
+ "7xl": "size-12",
13
+ huge: "size-14",
14
+ massive: "size-16",
15
+ };
16
+ //Icon with background
17
+ export var iconBackground = {
18
+ xs: "!p-1",
19
+ sm: "!p-2",
20
+ md: "!p-2",
21
+ lg: "!p-2",
22
+ xl: "!p-2",
23
+ "2xl": "!p-3",
24
+ "3xl": "!p-3",
25
+ "4xl": "!p-4",
26
+ "5xl": "!p-5",
27
+ "6xl": "p-6",
28
+ "7xl": "p-6",
29
+ huge: "p-8",
30
+ massive: "p-8",
31
+ };
32
+ export var IconShape = {
33
+ square: {
34
+ xs: "rounded-xs",
35
+ sm: "rounded-xs",
36
+ md: "rounded-xs",
37
+ lg: "rounded-xs",
38
+ xl: "rounded-md",
39
+ "2xl": "rounded-lg",
40
+ "3xl": "rounded-lg",
41
+ "4xl": "rounded-xl",
42
+ "5xl": "rounded-xl",
43
+ "6xl": "rounded-2xl",
44
+ "7xl": "rounded-2xl",
45
+ huge: "rounded-2xl",
46
+ massive: "rounded-2xl",
47
+ },
48
+ rounded: "rounded-full",
49
+ };
50
+ //icon color for padded icons
51
+ export var iconWithBgColor = {
52
+ blue: "bg-blue-600 text-blue-50",
53
+ "light-blue": "bg-blue-100 text-blue-600",
54
+ green: "bg-green-600 text-green-50",
55
+ "light-green": "bg-green-100 text-green-600",
56
+ yellow: "bg-yellow-500 text-yellow-950",
57
+ "light-yellow": "bg-yellow-100 text-yellow-900",
58
+ red: "bg-red-600 text-red-50",
59
+ "light-red": "bg-red-100 text-red-600",
60
+ indigo: "bg-indigo-600 text-indigo-50",
61
+ "light-indigo": "bg-indigo-100 text-indigo-600",
62
+ gray: "bg-gray-100 text-gray-950",
63
+ "dark-gray": "bg-gray-900 text-gray-50",
64
+ disabled: "bg-gray-100 text-gray-400",
65
+ };
66
+ //icon color for non-padded(default) icons
67
+ export var iconColor = {
68
+ blue: "text-blue-600",
69
+ "light-blue": "text-blue-100",
70
+ green: "text-green-600",
71
+ "light-green": "text-green-100",
72
+ yellow: "text-yellow-500",
73
+ "light-yellow": "text-yellow-100",
74
+ red: "text-red-600",
75
+ "light-red": "text-red-100",
76
+ indigo: "text-indigo-600",
77
+ "light-indigo": "text-indigo-100",
78
+ gray: "text-gray-100",
79
+ "dark-gray": "text-gray-900",
80
+ disabled: "text-gray-100",
81
+ };
82
+ export var getAppliedColor = function (variant, color) {
83
+ if (!color)
84
+ return "";
85
+ return variant === "padded" ? iconWithBgColor[color] : iconColor[color];
16
86
  };
@@ -1,7 +1,11 @@
1
- import { iconSize } from ".";
1
+ import { iconSize, iconWithBgColor, IconShape } from ".";
2
2
  export type iconSize = keyof typeof iconSize;
3
+ export type shape = keyof typeof IconShape;
4
+ export type color = keyof typeof iconWithBgColor;
3
5
  export interface IconProps extends React.HTMLAttributes<HTMLOrSVGElement> {
4
6
  size?: iconSize;
5
- icon?: string;
6
- className?: string;
7
+ icon: string;
8
+ variant?: "default" | "padded";
9
+ shape?: shape;
10
+ color?: color;
7
11
  }
@@ -1,5 +1,5 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
- import ImageUploader from "../ui/imageUploader";
2
+ import ImageUploader from "./imageUploader";
3
3
  declare const meta: Meta<typeof ImageUploader>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof ImageUploader>;
@@ -1,4 +1,4 @@
1
- import ImageUploader from "../ui/imageUploader";
1
+ import ImageUploader from "./imageUploader";
2
2
  var meta = {
3
3
  title: "Components/ImageUploader",
4
4
  component: ImageUploader,
@@ -0,0 +1,3 @@
1
+ import { ImageUploaderProps } from "../ImageUploader/type";
2
+ declare const ImageUploader: ({ value, onChange, required, className, maxFileSizeMB, acceptedTypes, }: ImageUploaderProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default ImageUploader;
@@ -0,0 +1,68 @@
1
+ "use client";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { useState, useEffect } from "react";
15
+ import { useDropzone } from "react-dropzone";
16
+ import { cn } from "../../lib/utils";
17
+ import LUIcon from "../Icons/LUIcon";
18
+ import LuImage from "../Images/LuImage";
19
+ import { Body } from "../Typography/Body/body";
20
+ import { Button } from "../Button/Button";
21
+ var ImageUploader = function (_a) {
22
+ var value = _a.value, onChange = _a.onChange, required = _a.required, className = _a.className, _b = _a.maxFileSizeMB, maxFileSizeMB = _b === void 0 ? 6 : _b, _c = _a.acceptedTypes, acceptedTypes = _c === void 0 ? ["image/png", "image/jpeg", "image/jpg", "image/svg+xml"] : _c;
23
+ var _d = useState(null), preview = _d[0], setPreview = _d[1];
24
+ var _e = useState(""), fileError = _e[0], setFileError = _e[1];
25
+ useEffect(function () {
26
+ if (value && typeof value === "string") {
27
+ setPreview(value);
28
+ }
29
+ else if (value instanceof File) {
30
+ setPreview(URL.createObjectURL(value));
31
+ }
32
+ else {
33
+ setPreview(null);
34
+ }
35
+ }, [value]);
36
+ var onDrop = function (acceptedFiles) {
37
+ var file = acceptedFiles[0];
38
+ if (!file)
39
+ return;
40
+ if (!acceptedTypes.includes(file.type)) {
41
+ setFileError("Only JPEG, PNG, JPG, and SVG files are supported.");
42
+ return;
43
+ }
44
+ var sizeMB = file.size / 1024 / 1024;
45
+ if (sizeMB > maxFileSizeMB) {
46
+ setFileError("File size exceeds ".concat(maxFileSizeMB, "MB."));
47
+ return;
48
+ }
49
+ var previewUrl = URL.createObjectURL(file);
50
+ setPreview(previewUrl);
51
+ setFileError("");
52
+ onChange(previewUrl, file);
53
+ };
54
+ var removeFile = function () {
55
+ setPreview(null);
56
+ setFileError("");
57
+ onChange(null, null);
58
+ };
59
+ var _f = useDropzone({
60
+ onDrop: onDrop,
61
+ multiple: false,
62
+ accept: {
63
+ "image/*": acceptedTypes,
64
+ },
65
+ }), getRootProps = _f.getRootProps, getInputProps = _f.getInputProps;
66
+ return (_jsxs("div", { className: cn("flex flex-col items-center", className), children: [_jsx("div", __assign({}, getRootProps(), { className: cn("!border !border-dashed !border-gray-300 !rounded-lg cursor-pointer w-64 !p-2"), children: _jsxs("div", { className: "min-h-40 flex items-center justify-center bg-gray-100 !rounded-lg", children: [_jsx("input", __assign({}, getInputProps())), preview ? (_jsx("div", { className: "relative w-full h-40 !mx-auto overflow-hidden", children: _jsx(LuImage, { src: preview, alt: "Uploaded", className: "aspect-square object-contain", fill: true }) })) : (_jsxs("div", { className: "text-center text-sm text-muted-foreground", children: [_jsx(LUIcon, { icon: "upload", size: "lg", className: "!mx-auto !mb-4" }), _jsx(Body, { variant: "body-xs-600", className: "!px-1", children: "Choose a file or drag & drop it here" }), _jsx("p", { className: "text-xs text-muted-foreground", children: "JPEG, PNG, and SVG formats" })] }))] }) })), fileError && (_jsx("p", { className: "text-sm text-red-500 text-center mt-2", children: fileError })), required && !preview && !fileError && (_jsx("p", { className: "text-sm text-red-500 text-center", children: "Image is required." })), preview && (_jsx(Button, { variant: "link", color: "gray", onClick: removeFile, className: "!mt-2 text-sm text-gray-700", children: "Remove Image" }))] }));
67
+ };
68
+ export default ImageUploader;
@@ -1,3 +1,14 @@
1
- import { LabelProps } from "./type";
2
- declare const Label: ({ htmlFor, children, ...props }: LabelProps) => import("react/jsx-runtime").JSX.Element;
3
- export default Label;
1
+ import * as React from "react";
2
+ import * as LabelPrimitive from "@radix-ui/react-label";
3
+ import { type VariantProps } from "class-variance-authority";
4
+ export declare const variant: {
5
+ "label-xl": string;
6
+ "label-lg": string;
7
+ "label-md": string;
8
+ "label-sm": string;
9
+ };
10
+ declare const labelVariants: (props?: ({
11
+ variant?: "label-sm" | "label-xl" | "label-lg" | "label-md" | null | undefined;
12
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
13
+ declare function Label({ className, variant, ...props }: React.ComponentProps<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants>): import("react/jsx-runtime").JSX.Element;
14
+ export { Label, labelVariants };
@@ -21,9 +21,23 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  return t;
22
22
  };
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
- import { Label as ShadLabel } from "../../components/ui/label";
25
- var Label = function (_a) {
26
- var _b = _a.htmlFor, htmlFor = _b === void 0 ? "text" : _b, _c = _a.children, children = _c === void 0 ? "Label" : _c, props = __rest(_a, ["htmlFor", "children"]);
27
- return (_jsx(ShadLabel, __assign({ htmlFor: htmlFor }, props, { children: children })));
24
+ import * as LabelPrimitive from "@radix-ui/react-label";
25
+ import { cva } from "class-variance-authority";
26
+ import { cn } from "../../lib/utils";
27
+ export var variant = {
28
+ "label-xl": "!text-xl",
29
+ "label-lg": "text-lg",
30
+ "label-md": "text-base",
31
+ "label-sm": "text-sm",
28
32
  };
29
- export default Label;
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", {
34
+ variants: { variant: variant },
35
+ defaultVariants: {
36
+ variant: "label-sm",
37
+ },
38
+ });
39
+ function Label(_a) {
40
+ var className = _a.className, variant = _a.variant, props = __rest(_a, ["className", "variant"]);
41
+ return (_jsx(LabelPrimitive.Root, __assign({ "data-slot": "label", className: cn(labelVariants({ variant: variant, className: className })) }, props)));
42
+ }
43
+ export { Label, labelVariants };
@@ -1,5 +1,4 @@
1
1
  import { Meta } from "@storybook/react";
2
- import { LabelProps } from "./type";
3
2
  declare const _default: Meta;
4
3
  export default _default;
5
- export declare const _Label: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, LabelProps>;
4
+ export declare const _Label: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("@storybook/react").Args>;
@@ -10,8 +10,7 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
- import Label from "./Label";
14
- import { variant } from "../ui/label";
13
+ import { Label, variant } from "./Label";
15
14
  export default {
16
15
  title: "Components/Label",
17
16
  component: Label,
@@ -21,7 +20,7 @@ var Template = function (args) { return _jsx(Label, __assign({}, args)); };
21
20
  export var _Label = Template.bind({});
22
21
  _Label.args = {
23
22
  children: "Label",
24
- variant: "default",
23
+ variant: "label-sm",
25
24
  };
26
25
  _Label.argTypes = {
27
26
  variant: {
@@ -29,7 +28,14 @@ _Label.argTypes = {
29
28
  options: Object.keys(variant),
30
29
  description: "Label variant",
31
30
  table: {
32
- defaultValue: { summary: "default" },
31
+ defaultValue: { summary: "label-sm" },
32
+ type: { summary: "string" },
33
+ },
34
+ },
35
+ htmlFor: {
36
+ control: "text",
37
+ description: "ID of the input element this label is for",
38
+ table: {
33
39
  type: { summary: "string" },
34
40
  },
35
41
  },
@@ -1,8 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import Link from "next/link";
3
3
  import LuImage from "../../../components/Images/LuImage";
4
- import Button from "../../../components/Button/Button";
5
- import LUIcon from "../../../components/Icons/LUIcon";
4
+ import { Button } from "../../../components/Button/Button";
6
5
  export var ContactProfileTheme1 = function (props) {
7
- return (_jsxs("div", { "data-testid": "contact-profile-theme1", className: "p-5 card_bg_ContactProfile_".concat(props.id, " rounded-xl ").concat(props.className, " card_shadow_ContactProfile_").concat(props.id), children: [_jsxs("div", { className: "flex gap-x-5", children: [_jsx("div", { className: "max-w-[240px] overflow-hidden aspect-square max-xs:hidden", children: _jsx(LuImage, { src: props.image, width: 160, height: 160, className: "rounded-full h-full object-cover", alt: "Contact Profile" }) }), _jsx("div", { className: "flex flex-1 flex-col", children: _jsxs("div", { className: "flex flex-col justify-center flex-1 h-full", children: [_jsx("div", { className: "card_ContactProfile_title_color_".concat(props.id, " text-2xl font-semibold capitalize line-clamp-1"), children: props.heading }), _jsx("p", { className: "text-base font-extralight line-clamp-2 max-xs:line-clamp-1 max-xs:mt-[7px] card_ContactProfile_designation_color_".concat(props.id), children: props.body })] }) })] }), _jsx(Link, { href: props.href, passHref: true, className: "w-full no-underline", children: _jsx(Button, { endIcon: _jsx(LUIcon, { icon: "angle-right", size: "sm" }), size: "lg", className: "rounded justify-between w-full mt-4 max-xs:mt-2.5 card_ContactProfile_btn_".concat(props.id), children: props.btnLabel }) })] }));
6
+ return (_jsxs("div", { "data-testid": "contact-profile-theme1", className: "p-5 card_bg_ContactProfile_".concat(props.id, " rounded-xl ").concat(props.className, " card_shadow_ContactProfile_").concat(props.id), children: [_jsxs("div", { className: "flex gap-x-5", children: [_jsx("div", { className: "max-w-[240px] overflow-hidden aspect-square max-xs:hidden", children: _jsx(LuImage, { src: props.image, width: 160, height: 160, className: "rounded-full h-full object-cover", alt: "Contact Profile" }) }), _jsx("div", { className: "flex flex-1 flex-col", children: _jsxs("div", { className: "flex flex-col justify-center flex-1 h-full", children: [_jsx("div", { className: "card_ContactProfile_title_color_".concat(props.id, " text-2xl font-semibold capitalize line-clamp-1"), children: props.heading }), _jsx("p", { className: "text-base font-extralight line-clamp-2 max-xs:line-clamp-1 max-xs:mt-[7px] card_ContactProfile_designation_color_".concat(props.id), children: props.body })] }) })] }), _jsx(Link, { href: props.href, passHref: true, className: "w-full no-underline", children: _jsx(Button, { endIcon: "angle-right", size: "lg", className: "rounded justify-between w-full mt-4 max-xs:mt-2.5 card_ContactProfile_btn_".concat(props.id), children: props.btnLabel }) })] }));
8
7
  };
@@ -1,8 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import Link from "next/link";
3
3
  import LuImage from "../../../components/Images/LuImage";
4
- import Button from "../../../components/Button/Button";
5
- import LUIcon from "../../../components/Icons/LUIcon";
4
+ import { Button } from "../../../components/Button/Button";
6
5
  export var ContactProfileTheme2 = function (props) {
7
- return (_jsxs("div", { "data-testid": "contact-profile-theme2", className: "p-8 card_bg_ContactProfile_".concat(props.id, " rounded-xl ").concat(props.className, " card_shadow_ContactProfile_").concat(props.id, " flex flex-col items-center"), children: [_jsx("div", { className: "max-w-[160px] overflow-hidden aspect-square", children: _jsx(LuImage, { src: props.image, width: 160, height: 160, className: "h-full object-cover rounded-full", alt: "Contact Profile" }) }), _jsxs("div", { className: "flex flex-col items-center flex-grow m-5 text-center h-[100px]", children: [_jsx("div", { className: "card_ContactProfile_title_color_".concat(props.id, " text-2xl font-semibold line-clamp-1 capitalize"), children: props.heading }), _jsx("p", { className: "text-base\tfont-extralight\tcard_ContactProfile_designation_color_".concat(props.id, " line-clamp-2"), children: props.body })] }), _jsx(Link, { href: props.href, passHref: true, className: "w-full no-underline", children: _jsx(Button, { endIcon: _jsx(LUIcon, { icon: "angle-right", size: "sm" }), size: "lg", className: "rounded justify-between w-full card_ContactProfile_btn_".concat(props.id), children: props.btnLabel }) })] }));
6
+ return (_jsxs("div", { "data-testid": "contact-profile-theme2", className: "p-8 card_bg_ContactProfile_".concat(props.id, " rounded-xl ").concat(props.className, " card_shadow_ContactProfile_").concat(props.id, " flex flex-col items-center"), children: [_jsx("div", { className: "max-w-[160px] overflow-hidden aspect-square", children: _jsx(LuImage, { src: props.image, width: 160, height: 160, className: "h-full object-cover rounded-full", alt: "Contact Profile" }) }), _jsxs("div", { className: "flex flex-col items-center flex-grow m-5 text-center h-[100px]", children: [_jsx("div", { className: "card_ContactProfile_title_color_".concat(props.id, " text-2xl font-semibold line-clamp-1 capitalize"), children: props.heading }), _jsx("p", { className: "text-base\tfont-extralight\tcard_ContactProfile_designation_color_".concat(props.id, " line-clamp-2"), children: props.body })] }), _jsx(Link, { href: props.href, passHref: true, className: "w-full no-underline", children: _jsx(Button, { endIcon: "angle-right", size: "lg", className: "rounded justify-between w-full card_ContactProfile_btn_".concat(props.id), children: props.btnLabel }) })] }));
8
7
  };
@@ -1,8 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import Link from "next/link";
3
3
  import LuImage from "../../../components/Images/LuImage";
4
- import Button from "../../../components/Button/Button";
5
- import LUIcon from "../../../components/Icons/LUIcon";
4
+ import { Button } from "../../../components/Button/Button";
6
5
  export var PostByCategoryTheme1 = function (props) {
7
- return (_jsxs("div", { "data-testid": "postByCategory-theme1", className: "p-5 card_bg_PostByCategory_".concat(props.id, " rounded-xl ").concat(props.className, " card_shadow_PostByCategory_").concat(props.id, " flex gap-x-[20px] w-full"), children: [_jsx("div", { className: "max-w-[240px] overflow-hidden aspect-square max-xs:hidden", children: _jsx(LuImage, { src: props.image, width: 240, height: 240, className: "rounded-lg w-full h-full object-cover", alt: "Post By Category" }) }), _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: "card_PostByCategory_title_color_".concat(props.id, " text-2xl font-semibold capitalize line-clamp-1"), children: props.heading }), _jsx("p", { className: "card_PostByCategory_description_color_".concat(props.id, " text-base font-extralight line-clamp-2 max-xs:line-clamp-1 max-xs:mt-[7px]"), children: props.body })] }), _jsx(Link, { href: props.href, passHref: true, className: "w-full no-underline", children: _jsx(Button, { endIcon: _jsx(LUIcon, { icon: "angle-right", size: "sm" }), size: "lg", className: "rounded justify-between w-full max-xs:mt-2.5 card_PostByCategory_btn_".concat(props.id), children: props.btnLabel }) })] })] }));
6
+ return (_jsxs("div", { "data-testid": "postByCategory-theme1", className: "p-5 card_bg_PostByCategory_".concat(props.id, " rounded-xl ").concat(props.className, " card_shadow_PostByCategory_").concat(props.id, " flex gap-x-[20px] w-full"), children: [_jsx("div", { className: "max-w-[240px] overflow-hidden aspect-square max-xs:hidden", children: _jsx(LuImage, { src: props.image, width: 240, height: 240, className: "rounded-lg w-full h-full object-cover", alt: "Post By Category" }) }), _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: "card_PostByCategory_title_color_".concat(props.id, " text-2xl font-semibold capitalize line-clamp-1"), children: props.heading }), _jsx("p", { className: "card_PostByCategory_description_color_".concat(props.id, " text-base font-extralight line-clamp-2 max-xs:line-clamp-1 max-xs:mt-[7px]"), children: props.body })] }), _jsx(Link, { href: props.href, passHref: true, className: "w-full no-underline", children: _jsx(Button, { endIcon: "angle-right", size: "lg", className: "rounded justify-between w-full max-xs:mt-2.5 card_PostByCategory_btn_".concat(props.id), children: props.btnLabel }) })] })] }));
8
7
  };
@@ -1,8 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import Link from "next/link";
3
3
  import LuImage from "../../../components/Images/LuImage";
4
- import Button from "../../../components/Button/Button";
5
- import LUIcon from "../../../components/Icons/LUIcon";
4
+ import { Button } from "../../../components/Button/Button";
6
5
  export var PostByCategoryTheme2 = function (props) {
7
- return (_jsxs("div", { "data-testid": "postByCategory-theme2", className: "p-8 card_bg_PostByCategory_".concat(props.id, " rounded-xl ").concat(props.className, " card_shadow_PostByCategory_").concat(props.id, " flex flex-col items-center w-full"), children: [_jsx("div", { className: "w-full max-w-[240px] overflow-hidden aspect-square", children: _jsx(LuImage, { src: props.image, width: 240, height: 240, className: "w-full h-full object-cover card_PostByCategory_theme2_image_".concat(props === null || props === void 0 ? void 0 : props.id), alt: "Post By Category" }) }), _jsxs("div", { className: "flex flex-col items-center flex-grow m-5 text-center h-[100px]", children: [_jsx("div", { className: "text-default card_PostByCategory_title_color_".concat(props.id, " text-2xl font-semibold capitalize line-clamp-1"), children: props.heading }), _jsx("p", { className: "card_PostByCategory_description_color_".concat(props.id, " text-base font-extralight line-clamp-2 max-xs:line-clamp-1 max-sm:mt-[7px]"), children: props.body })] }), _jsx(Link, { href: props.href, passHref: true, className: "w-full no-underline", children: _jsx(Button, { endIcon: _jsx(LUIcon, { icon: "angle-right", size: "sm" }), size: "lg", className: "rounded justify-between w-full card_PostByCategory_btn_".concat(props.id), children: props.btnLabel }) })] }));
6
+ return (_jsxs("div", { "data-testid": "postByCategory-theme2", className: "p-8 card_bg_PostByCategory_".concat(props.id, " rounded-xl ").concat(props.className, " card_shadow_PostByCategory_").concat(props.id, " flex flex-col items-center w-full"), children: [_jsx("div", { className: "w-full max-w-[240px] overflow-hidden aspect-square", children: _jsx(LuImage, { src: props.image, width: 240, height: 240, className: "w-full h-full object-cover card_PostByCategory_theme2_image_".concat(props === null || props === void 0 ? void 0 : props.id), alt: "Post By Category" }) }), _jsxs("div", { className: "flex flex-col items-center flex-grow m-5 text-center h-[100px]", children: [_jsx("div", { className: "text-default card_PostByCategory_title_color_".concat(props.id, " text-2xl font-semibold capitalize line-clamp-1"), children: props.heading }), _jsx("p", { className: "card_PostByCategory_description_color_".concat(props.id, " text-base font-extralight line-clamp-2 max-xs:line-clamp-1 max-sm:mt-[7px]"), children: props.body })] }), _jsx(Link, { href: props.href, passHref: true, className: "w-full no-underline", children: _jsx(Button, { endIcon: "angle-right", size: "lg", className: "rounded justify-between w-full card_PostByCategory_btn_".concat(props.id), children: props.btnLabel }) })] }));
8
7
  };
@@ -3,6 +3,6 @@ import { Tooltip as ShadTooltip, TooltipContent, TooltipProvider, TooltipTrigger
3
3
  import { Body } from "../Typography/Body/body";
4
4
  var Tooltip = function (_a) {
5
5
  var title = _a.title, className = _a.className, children = _a.children;
6
- return (_jsx(TooltipProvider, { children: _jsxs(ShadTooltip, { children: [_jsx(TooltipTrigger, { asChild: true, className: className, children: children }), _jsx(TooltipContent, { children: _jsx(Body, { variant: "body-base", className: "text-center", children: title }) })] }) }));
6
+ return (_jsx(TooltipProvider, { children: _jsxs(ShadTooltip, { children: [_jsx(TooltipTrigger, { asChild: true, className: className, children: children }), _jsx(TooltipContent, { children: _jsx(Body, { variant: "body-md", className: "text-center", children: title }) })] }) }));
7
7
  };
8
8
  export default Tooltip;
@@ -11,8 +11,7 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import Tooltip from "./Tooltip";
14
- import IconButton from "../Button/IconButton";
15
- import LUIcon from "../Icons/LUIcon";
14
+ import { IconButton } from "../Button/IconButton";
16
15
  export default {
17
16
  title: "Components/Tooltip",
18
17
  component: Tooltip,
@@ -21,7 +20,7 @@ export default {
21
20
  var Template = function (args) { return (_jsx(Tooltip, __assign({}, args))); };
22
21
  export var _ToolTip = Template.bind({});
23
22
  _ToolTip.args = {
24
- children: (_jsx(IconButton, { icon: _jsx(LUIcon, { icon: "volume-high", size: "sm" }), shape: "rounded-full" })),
23
+ children: _jsx(IconButton, { icon: "volume-high", shape: "rounded-full" }),
25
24
  title: "Tooltip",
26
25
  };
27
26
  _ToolTip.argTypes = {
@@ -9,10 +9,10 @@ export declare const variant: {
9
9
  "body-lg-500": string;
10
10
  "body-lg-600": string;
11
11
  "body-lg-700": string;
12
- "body-base": string;
13
- "body-base-500": string;
14
- "body-base-600": string;
15
- "body-base-700": string;
12
+ "body-md": string;
13
+ "body-md-500": string;
14
+ "body-md-600": string;
15
+ "body-md-700": string;
16
16
  "body-sm": string;
17
17
  "body-sm-500": string;
18
18
  "body-sm-600": string;
@@ -23,7 +23,7 @@ export declare const variant: {
23
23
  "body-xs-700": string;
24
24
  };
25
25
  declare const bodyVariants: (props?: ({
26
- variant?: "body-base" | "body-xl" | "body-xl-500" | "body-xl-600" | "body-xl-700" | "body-lg" | "body-lg-500" | "body-lg-600" | "body-lg-700" | "body-base-500" | "body-base-600" | "body-base-700" | "body-sm" | "body-sm-500" | "body-sm-600" | "body-sm-700" | "body-xs" | "body-xs-500" | "body-xs-600" | "body-xs-700" | null | undefined;
26
+ variant?: "body-md" | "body-xl" | "body-xl-500" | "body-xl-600" | "body-xl-700" | "body-lg" | "body-lg-500" | "body-lg-600" | "body-lg-700" | "body-md-500" | "body-md-600" | "body-md-700" | "body-sm" | "body-sm-500" | "body-sm-600" | "body-sm-700" | "body-xs" | "body-xs-500" | "body-xs-600" | "body-xs-700" | null | undefined;
27
27
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
28
28
  type AllowedTags = "p" | "span";
29
29
  type BodyProps<T extends AllowedTags = "p"> = {
@@ -32,10 +32,10 @@ export var variant = {
32
32
  "body-lg-500": "text-lg font-medium",
33
33
  "body-lg-600": "text-lg font-semibold",
34
34
  "body-lg-700": "text-lg font-bold",
35
- "body-base": "text-base font-normal",
36
- "body-base-500": "text-base font-medium",
37
- "body-base-600": "text-base font-semibold",
38
- "body-base-700": "text-base font-bold",
35
+ "body-md": "text-base font-normal",
36
+ "body-md-500": "text-base font-medium",
37
+ "body-md-600": "text-base font-semibold",
38
+ "body-md-700": "text-base font-bold",
39
39
  "body-sm": "text-sm font-normal",
40
40
  "body-sm-500": "text-sm font-medium",
41
41
  "body-sm-600": "text-sm font-semibold",
@@ -50,7 +50,7 @@ var bodyVariants = cva("!leading-normal m-0", {
50
50
  variant: variant,
51
51
  },
52
52
  defaultVariants: {
53
- variant: "body-base",
53
+ variant: "body-md",
54
54
  },
55
55
  });
56
56
  function Body(_a) {
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { Dummy_Para } from "../../../utils/constants";
14
- import { Caption } from "../../../components/ui/caption";
14
+ import { Caption, variantClasses } from "../../../components/ui/caption";
15
15
  export default {
16
16
  title: "Components/Typography/Caption",
17
17
  component: Caption,
@@ -21,4 +21,16 @@ var Template = function (args) { return _jsx(Caption, __assign({}, args)); };
21
21
  export var _Caption = Template.bind({});
22
22
  _Caption.args = {
23
23
  children: Dummy_Para,
24
+ variant: "md",
25
+ };
26
+ _Caption.argTypes = {
27
+ variant: {
28
+ control: { type: "select" },
29
+ options: Object.keys(variantClasses),
30
+ description: "Caption Variant",
31
+ table: {
32
+ defaultValue: { summary: "md" },
33
+ type: { summary: "string" },
34
+ },
35
+ },
24
36
  };
@@ -27,7 +27,7 @@ export declare const variant: {
27
27
  "h6-700": string;
28
28
  };
29
29
  declare const headingVariants: (props?: ({
30
- variant?: "h2" | "h1" | "h3" | "h4" | "h5" | "h6" | "h1-500" | "h1-600" | "h1-700" | "h2-500" | "h2-600" | "h2-700" | "h3-500" | "h3-600" | "h3-700" | "h4-500" | "h4-600" | "h4-700" | "h5-500" | "h5-600" | "h5-700" | "h6-500" | "h6-600" | "h6-700" | null | undefined;
30
+ variant?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "h1-500" | "h1-600" | "h1-700" | "h2-500" | "h2-600" | "h2-700" | "h3-500" | "h3-600" | "h3-700" | "h4-500" | "h4-600" | "h4-700" | "h5-500" | "h5-600" | "h5-700" | "h6-500" | "h6-600" | "h6-700" | null | undefined;
31
31
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
32
32
  type HeadingProps = React.HTMLProps<HTMLElement> & VariantProps<typeof headingVariants> & {
33
33
  variant?: keyof typeof variant;
@@ -44,10 +44,10 @@ export var variant = {
44
44
  "h5-500": "text-xl font-medium",
45
45
  "h5-600": "text-xl font-semibold",
46
46
  "h5-700": "text-xl font-bold",
47
- h6: "text-lg font-normal",
48
- "h6-500": "text-lg font-medium",
49
- "h6-600": "text-lg font-semibold",
50
- "h6-700": "text-lg font-bold",
47
+ h6: "!text-lg !font-normal",
48
+ "h6-500": "!text-lg !font-medium",
49
+ "h6-600": "!text-lg !font-semibold",
50
+ "h6-700": "!text-lg !font-bold",
51
51
  };
52
52
  var headingVariants = cva("!leading-normal", // Default base class
53
53
  {
@@ -1,35 +0,0 @@
1
- import * as React from "react";
2
- import { type VariantProps } from "class-variance-authority";
3
- export declare const variant: {
4
- "body-xl": string;
5
- "body-xl-500": string;
6
- "body-xl-600": string;
7
- "body-xl-700": string;
8
- "body-lg": string;
9
- "body-lg-500": string;
10
- "body-lg-600": string;
11
- "body-lg-700": string;
12
- "body-base": string;
13
- "body-base-500": string;
14
- "body-base-600": string;
15
- "body-base-700": string;
16
- "body-sm": string;
17
- "body-sm-500": string;
18
- "body-sm-600": string;
19
- "body-sm-700": string;
20
- "body-xs": string;
21
- "body-xs-500": string;
22
- "body-xs-600": string;
23
- "body-xs-700": string;
24
- };
25
- declare const bodyVariants: (props?: ({
26
- variant?: "body-base" | "body-xl" | "body-xl-500" | "body-xl-600" | "body-xl-700" | "body-lg" | "body-lg-500" | "body-lg-600" | "body-lg-700" | "body-base-500" | "body-base-600" | "body-base-700" | "body-sm" | "body-sm-500" | "body-sm-600" | "body-sm-700" | "body-xs" | "body-xs-500" | "body-xs-600" | "body-xs-700" | null | undefined;
27
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
28
- type AllowedTags = "p" | "span";
29
- type BodyProps<T extends AllowedTags = "p"> = {
30
- as?: T;
31
- className?: string;
32
- children?: React.ReactNode;
33
- } & Omit<React.ComponentPropsWithoutRef<T>, "as" | "className"> & VariantProps<typeof bodyVariants>;
34
- declare function Body<T extends AllowedTags = "p">({ as, className, variant, children, ...props }: BodyProps<T>): import("react/jsx-runtime").JSX.Element;
35
- export { Body, bodyVariants };
@@ -1,61 +1 @@
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
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
- import { jsx as _jsx } from "react/jsx-runtime";
24
- import { cva } from "class-variance-authority";
25
- import { cn } from "../../lib/utils";
26
- export var variant = {
27
- "body-xl": "text-xl font-normal",
28
- "body-xl-500": "text-xl font-medium",
29
- "body-xl-600": "text-xl font-semibold",
30
- "body-xl-700": "text-xl font-bold",
31
- "body-lg": "text-lg font-normal",
32
- "body-lg-500": "text-lg font-medium",
33
- "body-lg-600": "text-lg font-semibold",
34
- "body-lg-700": "text-lg font-bold",
35
- "body-base": "text-base font-normal",
36
- "body-base-500": "text-base font-medium",
37
- "body-base-600": "text-base font-semibold",
38
- "body-base-700": "text-base font-bold",
39
- "body-sm": "text-sm font-normal",
40
- "body-sm-500": "text-sm font-medium",
41
- "body-sm-600": "text-sm font-semibold",
42
- "body-sm-700": "text-sm font-bold",
43
- "body-xs": "text-xs font-normal",
44
- "body-xs-500": "text-xs font-medium",
45
- "body-xs-600": "text-xs font-semibold",
46
- "body-xs-700": "text-xs font-bold",
47
- };
48
- var bodyVariants = cva("!leading-normal m-0", {
49
- variants: {
50
- variant: variant,
51
- },
52
- defaultVariants: {
53
- variant: "body-base",
54
- },
55
- });
56
- function Body(_a) {
57
- var as = _a.as, className = _a.className, variant = _a.variant, children = _a.children, props = __rest(_a, ["as", "className", "variant", "children"]);
58
- var Tag = as || "p";
59
- return (_jsx(Tag, __assign({ className: cn(bodyVariants({ variant: variant }), className) }, props, { children: children })));
60
- }
61
- export { Body, bodyVariants };
1
+ "use strict";
@@ -1,4 +1,8 @@
1
1
  import * as React from "react";
2
- type CaptionProps = React.HTMLAttributes<HTMLTableCaptionElement>;
3
- declare function Caption({ className, children, ...props }: CaptionProps): import("react/jsx-runtime").JSX.Element;
2
+ type CaptionVariant = "sm" | "md" | "lg";
3
+ type CaptionProps = React.HTMLAttributes<HTMLTableCaptionElement> & {
4
+ variant?: CaptionVariant;
5
+ };
6
+ export declare const variantClasses: Record<CaptionVariant, string>;
7
+ declare function Caption({ className, children, variant, ...props }: CaptionProps): import("react/jsx-runtime").JSX.Element;
4
8
  export { Caption };
@@ -22,8 +22,13 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  };
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
24
  import { cn } from "../../lib/utils";
25
+ export var variantClasses = {
26
+ sm: "text-xs",
27
+ md: "text-sm",
28
+ lg: "text-base",
29
+ };
25
30
  function Caption(_a) {
26
- var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
27
- return (_jsx("caption", __assign({ className: cn("text-xs font-normal leading-normal inline", className) }, props, { children: children })));
31
+ var className = _a.className, children = _a.children, _b = _a.variant, variant = _b === void 0 ? "md" : _b, props = __rest(_a, ["className", "children", "variant"]);
32
+ return (_jsx("p", __assign({ className: cn("font-normal leading-normal inline", variantClasses[variant], className) }, props, { children: children })));
28
33
  }
29
34
  export { Caption };