linkedunion-design-kit 0.1.3 → 0.1.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.
- package/dist/.next/types/app/page.d.ts +8 -0
- package/dist/.next/types/app/page.js +22 -0
- package/dist/app/layout.d.ts +1 -1
- package/dist/app/layout.jsx +1 -1
- package/dist/components/Border/BorderRadius/BorderRadius.d.ts +2 -0
- package/dist/components/Border/BorderRadius/BorderRadius.jsx +12 -0
- package/dist/components/Border/BorderRadius/BorderRadius.stories.d.ts +4 -0
- package/dist/components/Border/BorderRadius/BorderRadius.stories.jsx +17 -0
- package/dist/components/Border/BorderRadius/BorderRadiusTable.d.ts +1 -0
- package/dist/components/Border/BorderRadius/BorderRadiusTable.jsx +61 -0
- package/dist/components/Border/BorderRadius/BorderRadiusView.d.ts +2 -0
- package/dist/components/Border/BorderRadius/BorderRadiusView.jsx +8 -0
- package/dist/components/Border/BorderWidth/BorderWidth.d.ts +2 -0
- package/dist/components/Border/BorderWidth/BorderWidth.jsx +12 -0
- package/dist/components/Border/BorderWidth/BorderWidth.stories.d.ts +4 -0
- package/dist/components/Border/BorderWidth/BorderWidth.stories.jsx +17 -0
- package/dist/components/Border/BorderWidth/BorderWidthTable.d.ts +1 -0
- package/dist/components/Border/BorderWidth/BorderWidthTable.jsx +36 -0
- package/dist/components/Border/BorderWidth/ViewBorderWidth.d.ts +2 -0
- package/dist/components/Border/BorderWidth/ViewBorderWidth.jsx +8 -0
- package/dist/components/Button/Button.d.ts +2 -0
- package/dist/components/Button/Button.jsx +16 -0
- package/dist/components/Button/Button.stories.d.ts +4 -0
- package/dist/components/Button/Button.stories.jsx +109 -0
- package/dist/components/Icons/IconView.d.ts +1 -0
- package/dist/components/Icons/IconView.jsx +23 -0
- package/dist/components/Icons/IconView.stories.d.ts +4 -0
- package/dist/components/Icons/IconView.stories.jsx +8 -0
- package/dist/components/Icons/LUIcon.d.ts +2 -0
- package/dist/components/Icons/LUIcon.jsx +20 -0
- package/dist/components/Icons/LUIcon.stories.d.ts +4 -0
- package/dist/components/Icons/LUIcon.stories.jsx +29 -0
- package/dist/components/Images/LuImage.d.ts +2 -0
- package/dist/components/Images/LuImage.jsx +6 -0
- package/dist/components/Images/LuImage.stories.d.ts +4 -0
- package/dist/components/Images/LuImage.stories.jsx +37 -0
- package/dist/components/Size/MinWidthHeight.d.ts +2 -0
- package/dist/components/Size/MinWidthHeight.jsx +8 -0
- package/dist/components/Size/MinWidthHeight.stories.d.ts +5 -0
- package/dist/components/Size/MinWidthHeight.stories.jsx +22 -0
- package/dist/components/Size/WidthHeight.d.ts +2 -0
- package/dist/components/Size/{Resizable.jsx → WidthHeight.jsx} +3 -3
- package/dist/components/Size/WidthHeight.stories.d.ts +5 -0
- package/dist/components/Size/{Resizable.stories.jsx → WidthHeight.stories.jsx} +9 -9
- package/dist/components/Spacing/Margin/Margin.d.ts +1 -0
- package/dist/components/Spacing/Margin/Margin.jsx +86 -0
- package/dist/components/Spacing/Margin/MarginBottom.d.ts +1 -0
- package/dist/components/Spacing/Margin/MarginBottom.jsx +86 -0
- package/dist/components/Spacing/Margin/MarginLeft.d.ts +1 -0
- package/dist/components/Spacing/Margin/MarginLeft.jsx +86 -0
- package/dist/components/Spacing/Margin/MarginRight.d.ts +1 -0
- package/dist/components/Spacing/Margin/MarginRight.jsx +86 -0
- package/dist/components/Spacing/Margin/MarginToken.d.ts +1 -0
- package/dist/components/Spacing/Margin/MarginToken.jsx +27 -0
- package/dist/components/Spacing/Margin/MarginToken.stories.d.ts +4 -0
- package/dist/components/Spacing/Margin/MarginToken.stories.jsx +7 -0
- package/dist/components/Spacing/Margin/MarginTop.d.ts +1 -0
- package/dist/components/Spacing/Margin/MarginTop.jsx +87 -0
- package/dist/components/Spacing/Padding/Padding.d.ts +1 -0
- package/dist/components/Spacing/Padding/Padding.jsx +87 -0
- package/dist/components/Spacing/Padding/PaddingBottom.d.ts +1 -0
- package/dist/components/Spacing/Padding/PaddingBottom.jsx +86 -0
- package/dist/components/Spacing/Padding/PaddingLeft.d.ts +1 -0
- package/dist/components/Spacing/Padding/PaddingLeft.jsx +86 -0
- package/dist/components/Spacing/Padding/PaddingRight.d.ts +1 -0
- package/dist/components/Spacing/Padding/PaddingRight.jsx +87 -0
- package/dist/components/Spacing/Padding/PaddingToken.d.ts +1 -0
- package/dist/components/Spacing/Padding/PaddingToken.jsx +27 -0
- package/dist/components/Spacing/Padding/PaddingToken.stories.d.ts +4 -0
- package/dist/components/Spacing/Padding/PaddingToken.stories.jsx +7 -0
- package/dist/components/Spacing/Padding/PaddingTop.d.ts +1 -0
- package/dist/components/Spacing/Padding/PaddingTop.jsx +87 -0
- package/dist/global.css +2094 -5489
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/tailwind.config.js +42 -10
- package/dist/utils/enum.d.ts +13 -0
- package/dist/utils/enum.js +13 -0
- package/dist/utils/iconList.d.ts +5 -0
- package/dist/utils/iconList.js +807 -0
- package/dist/utils/index.d.ts +1082 -45
- package/dist/utils/index.js +1127 -90
- package/package.json +5 -2
- package/dist/components/Size/Resizable.d.ts +0 -2
- package/dist/components/Size/Resizable.stories.d.ts +0 -5
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// File: /Users/avialdosolutions/linkedunion-design-kit/linkedunion-design-kit/app/page.tsx
|
|
2
|
+
import * as entry from '../../../app/page.js';
|
|
3
|
+
// Check that the entry is a valid entry
|
|
4
|
+
checkFields();
|
|
5
|
+
// Check the prop type of the entry function
|
|
6
|
+
checkFields();
|
|
7
|
+
// Check the arguments and return type of the generateMetadata function
|
|
8
|
+
if ('generateMetadata' in entry) {
|
|
9
|
+
checkFields();
|
|
10
|
+
checkFields();
|
|
11
|
+
}
|
|
12
|
+
// Check the arguments and return type of the generateViewport function
|
|
13
|
+
if ('generateViewport' in entry) {
|
|
14
|
+
checkFields();
|
|
15
|
+
checkFields();
|
|
16
|
+
}
|
|
17
|
+
// Check the arguments and return type of the generateStaticParams function
|
|
18
|
+
if ('generateStaticParams' in entry) {
|
|
19
|
+
checkFields();
|
|
20
|
+
checkFields();
|
|
21
|
+
}
|
|
22
|
+
function checkFields() { }
|
package/dist/app/layout.d.ts
CHANGED
package/dist/app/layout.jsx
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BorderRadiusTable } from "./BorderRadiusTable";
|
|
2
|
+
import { BorderRadiusView } from "./BorderRadiusView";
|
|
3
|
+
export var BorderRadius = function (_a) {
|
|
4
|
+
var borderRadius = _a.borderRadius;
|
|
5
|
+
return (<>
|
|
6
|
+
<div className="lu-font-size-large lu-font-weight-semibold lu-text-center lu-text-uppercase lu-text-decoration-underline lu-mb-100">Border Radius</div>
|
|
7
|
+
<BorderRadiusTable />
|
|
8
|
+
<div className="lu-mt-150">
|
|
9
|
+
<BorderRadiusView borderRadius={borderRadius}/>
|
|
10
|
+
</div>
|
|
11
|
+
</>);
|
|
12
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BorderRadius } from "./BorderRadius";
|
|
2
|
+
import { borderRadiusList } from "../../../utils";
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/Border",
|
|
5
|
+
component: BorderRadius,
|
|
6
|
+
};
|
|
7
|
+
var Template = function (args) { return <BorderRadius {...args}/>; };
|
|
8
|
+
export var borderRadius = Template.bind({});
|
|
9
|
+
borderRadius.args = {
|
|
10
|
+
borderRadius: 'lu-border-rounded-xs',
|
|
11
|
+
};
|
|
12
|
+
borderRadius.argTypes = {
|
|
13
|
+
borderRadius: {
|
|
14
|
+
control: { type: "select", labels: Object.fromEntries(borderRadiusList.map(function (borderRadius) { return [borderRadius.key, borderRadius.label]; })) },
|
|
15
|
+
options: borderRadiusList.map(function (borderRadius) { return borderRadius.key; }),
|
|
16
|
+
},
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BorderRadiusTable: () => import("react").JSX.Element;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { table_data_className, table_header_className, table_row_className } from "../../../utils";
|
|
2
|
+
export var BorderRadiusTable = function () {
|
|
3
|
+
return (<>
|
|
4
|
+
<table className="lu-width-100 lu-font-size-x-small lu-font-weight-medium">
|
|
5
|
+
<thead className="bg-primary-100">
|
|
6
|
+
<tr>
|
|
7
|
+
<th className={"".concat(table_header_className)}>Alias Token Name</th>
|
|
8
|
+
<th className={"".concat(table_header_className)}>Base unit Multiplier of 8</th>
|
|
9
|
+
<th className={"".concat(table_header_className)}>Value(PX)(REM)</th>
|
|
10
|
+
</tr>
|
|
11
|
+
</thead>
|
|
12
|
+
<tbody>
|
|
13
|
+
<tr>
|
|
14
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>lu-border-rounded-none</span></td>
|
|
15
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>0x</span></td>
|
|
16
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>0px = 0rem</span></td>
|
|
17
|
+
</tr>
|
|
18
|
+
<tr>
|
|
19
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>lu-border-rounded-xs</span></td>
|
|
20
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>0.25x</span></td>
|
|
21
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>2px = 0.125rem</span></td>
|
|
22
|
+
</tr>
|
|
23
|
+
<tr>
|
|
24
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>lu-border-rounded-sm</span></td>
|
|
25
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>0.5x</span></td>
|
|
26
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>4px = 0.25rem</span></td>
|
|
27
|
+
</tr>
|
|
28
|
+
<tr>
|
|
29
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>lu-border-rounded-md</span></td>
|
|
30
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>0.75x</span></td>
|
|
31
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>6px = 0.375rem</span></td>
|
|
32
|
+
</tr>
|
|
33
|
+
<tr>
|
|
34
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>lu-border-rounded-lg</span></td>
|
|
35
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>1x</span></td>
|
|
36
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>8px = 0.5rem</span></td>
|
|
37
|
+
</tr>
|
|
38
|
+
<tr>
|
|
39
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>lu-border-rounded-xl</span></td>
|
|
40
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>1.5x</span></td>
|
|
41
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>12px = 0.75rem</span></td>
|
|
42
|
+
</tr>
|
|
43
|
+
<tr>
|
|
44
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>lu-border-rounded-2xl</span></td>
|
|
45
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>2x</span></td>
|
|
46
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>16px = 1rem</span></td>
|
|
47
|
+
</tr>
|
|
48
|
+
<tr>
|
|
49
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>lu-border-rounded-3xl</span></td>
|
|
50
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>3x</span></td>
|
|
51
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>24px = 1.5rem</span></td>
|
|
52
|
+
</tr>
|
|
53
|
+
<tr>
|
|
54
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>lu-border-rounded-full</span></td>
|
|
55
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>100x</span></td>
|
|
56
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>9999px</span></td>
|
|
57
|
+
</tr>
|
|
58
|
+
</tbody>
|
|
59
|
+
</table>
|
|
60
|
+
</>);
|
|
61
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export var BorderRadiusView = function (_a) {
|
|
2
|
+
var borderRadius = _a.borderRadius;
|
|
3
|
+
return (<>
|
|
4
|
+
<div className={"border-primary-600 lu-pd-200 lu-size-2500 lu-border-width-125 ".concat(borderRadius)} data-testid="border-radius">
|
|
5
|
+
<p className="bg-gray-100 lu-pt-050 lu-pr-100 lu-pb-050 lu-pl-100 rounded lu-font-size-x-small">{borderRadius}</p>
|
|
6
|
+
</div>
|
|
7
|
+
</>);
|
|
8
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BorderWidthTable } from "./BorderWidthTable";
|
|
2
|
+
import { ViewBorderWidth } from "./ViewBorderWidth";
|
|
3
|
+
export var BorderWidth = function (_a) {
|
|
4
|
+
var border = _a.border;
|
|
5
|
+
return (<>
|
|
6
|
+
<div className="lu-font-size-large lu-font-weight-semibold lu-text-center lu-text-uppercase lu-text-decoration-underline lu-mb-100">Border Width</div>
|
|
7
|
+
<BorderWidthTable />
|
|
8
|
+
<div className="lu-mt-150">
|
|
9
|
+
<ViewBorderWidth border={border}/>
|
|
10
|
+
</div>
|
|
11
|
+
</>);
|
|
12
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BorderWidth } from "./BorderWidth";
|
|
2
|
+
import { borderWidthList } from "../../../utils";
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/Border",
|
|
5
|
+
component: BorderWidth,
|
|
6
|
+
};
|
|
7
|
+
var Template = function (args) { return <BorderWidth {...args}/>; };
|
|
8
|
+
export var borderWidth = Template.bind({});
|
|
9
|
+
borderWidth.args = {
|
|
10
|
+
border: 'lu-border-width-125',
|
|
11
|
+
};
|
|
12
|
+
borderWidth.argTypes = {
|
|
13
|
+
border: {
|
|
14
|
+
control: { type: "select", labels: Object.fromEntries(borderWidthList.map(function (borderWidth) { return [borderWidth.key, borderWidth.label]; })) },
|
|
15
|
+
options: borderWidthList.map(function (borderWidth) { return borderWidth.key; }),
|
|
16
|
+
},
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BorderWidthTable: () => import("react").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { table_data_className, table_header_className, table_row_className } from "../../../utils";
|
|
2
|
+
export var BorderWidthTable = function () {
|
|
3
|
+
return (<>
|
|
4
|
+
<table className="lu-width-100 lu-font-size-x-small lu-font-weight-medium">
|
|
5
|
+
<thead className="bg-primary-100">
|
|
6
|
+
<tr>
|
|
7
|
+
<th className={"".concat(table_header_className)}>Alias Token Name</th>
|
|
8
|
+
<th className={"".concat(table_header_className)}>Base unit Multiplier of 8</th>
|
|
9
|
+
<th className={"".concat(table_header_className)}>Value(PX)(REM)</th>
|
|
10
|
+
</tr>
|
|
11
|
+
</thead>
|
|
12
|
+
<tbody>
|
|
13
|
+
<tr>
|
|
14
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>lu-border-width-125</span></td>
|
|
15
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>0.125x</span></td>
|
|
16
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>1px = 0.063rem</span></td>
|
|
17
|
+
</tr>
|
|
18
|
+
<tr>
|
|
19
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>lu-border-width-025</span></td>
|
|
20
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>0.25x</span></td>
|
|
21
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>2px = 0.125rem</span></td>
|
|
22
|
+
</tr>
|
|
23
|
+
<tr>
|
|
24
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>lu-border-width-050</span></td>
|
|
25
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>0.50x</span></td>
|
|
26
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>4px = 0.25rem</span></td>
|
|
27
|
+
</tr>
|
|
28
|
+
<tr>
|
|
29
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>lu-border-width-100</span></td>
|
|
30
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>1x</span></td>
|
|
31
|
+
<td className={"".concat(table_row_className)}><span className={"".concat(table_data_className)}>8px = 0.5rem</span></td>
|
|
32
|
+
</tr>
|
|
33
|
+
</tbody>
|
|
34
|
+
</table>
|
|
35
|
+
</>);
|
|
36
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export var ViewBorderWidth = function (_a) {
|
|
2
|
+
var border = _a.border;
|
|
3
|
+
return (<>
|
|
4
|
+
<div className={"border-primary-600 lu-border-rounded-2xl lu-pd-200 lu-size-2500 ".concat(border)} data-testid="border-width">
|
|
5
|
+
<p className="bg-gray-100 lu-pt-050 lu-pr-100 lu-pb-050 lu-pl-100 rounded lu-font-size-x-small lu-text-center">{border}</p>
|
|
6
|
+
</div>
|
|
7
|
+
</>);
|
|
8
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LUIcon } from "../Icons/LUIcon";
|
|
2
|
+
import { buttonTypeEnum, contentTypeEnum } from "../../utils/enum";
|
|
3
|
+
export var Button = function (_a) {
|
|
4
|
+
var contentType = _a.contentType, variant = _a.variant, label = _a.label, iconLeft = _a.iconLeft, iconRight = _a.iconRight, onClick = _a.onClick, shape = _a.shape, size = _a.size, leftIconSize = _a.leftIconSize, rightIconSize = _a.rightIconSize, className = _a.className, icon = _a.icon, iconSize = _a.iconSize, type = _a.type;
|
|
5
|
+
return (<>
|
|
6
|
+
<button className={"flex items-center ".concat(shape, " ").concat(type === buttonTypeEnum.outline ? "outline-button ".concat(variant) : variant, " ").concat(className, " ").concat(contentType === contentTypeEnum.icon_only ? "icon-only ".concat(size) : size)} onClick={onClick}>
|
|
7
|
+
{contentType === contentTypeEnum.none && label}
|
|
8
|
+
{contentType === contentTypeEnum.icon_only && icon && (<LUIcon size={iconSize} icon={icon} fill={type === buttonTypeEnum.outline ? "outline-button ".concat(variant) : variant}/>)}
|
|
9
|
+
{contentType === contentTypeEnum.text_with_icon && (<>
|
|
10
|
+
{iconLeft && iconLeft !== 'none' && (<LUIcon size={leftIconSize} icon={iconLeft} fill={type === buttonTypeEnum.outline ? "outline-button ".concat(variant) : variant} className="lu-mr-100"/>)}
|
|
11
|
+
{label}
|
|
12
|
+
{iconRight && iconRight !== 'none' && (<LUIcon size={rightIconSize} icon={iconRight} fill={type === buttonTypeEnum.outline ? "outline-button ".concat(variant) : variant} className="lu-ml-100"/>)}
|
|
13
|
+
</>)}
|
|
14
|
+
</button>
|
|
15
|
+
</>);
|
|
16
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
10
|
+
import { Button } from "./Button";
|
|
11
|
+
import { borderRadiusList, buttonColorsList, buttonIconSizeList, buttonWithIconList, butttonSizeList } from "../../utils";
|
|
12
|
+
import { iconList } from "../../utils/iconList";
|
|
13
|
+
import { buttonTypeEnum, contentTypeEnum } from "../../utils/enum";
|
|
14
|
+
export default {
|
|
15
|
+
title: "Components/Button",
|
|
16
|
+
component: Button,
|
|
17
|
+
tags: ['autodocs'],
|
|
18
|
+
};
|
|
19
|
+
var Template = function (args) { return <Button {...args}/>; };
|
|
20
|
+
export var button = Template.bind({});
|
|
21
|
+
button.args = {
|
|
22
|
+
contentType: contentTypeEnum.none,
|
|
23
|
+
variant: 'lu-btn-primary',
|
|
24
|
+
label: 'Button Text',
|
|
25
|
+
onClick: function () { return alert('Button Clicked'); },
|
|
26
|
+
shape: 'lu-border-rounded-sm',
|
|
27
|
+
size: 'lu-btn-md',
|
|
28
|
+
iconLeft: 'chart-simple',
|
|
29
|
+
leftIconSize: 'lu-icon-small',
|
|
30
|
+
icon: 'chart-simple',
|
|
31
|
+
iconSize: 'lu-icon-small',
|
|
32
|
+
type: buttonTypeEnum.fill,
|
|
33
|
+
};
|
|
34
|
+
button.argTypes = {
|
|
35
|
+
contentType: {
|
|
36
|
+
control: { type: "select" },
|
|
37
|
+
options: [contentTypeEnum.none, contentTypeEnum.text_with_icon, contentTypeEnum.icon_only],
|
|
38
|
+
description: "Determines the content of the button",
|
|
39
|
+
},
|
|
40
|
+
label: {
|
|
41
|
+
control: { type: "text" },
|
|
42
|
+
description: "Button label text",
|
|
43
|
+
if: { arg: "contentType", neq: contentTypeEnum.icon_only },
|
|
44
|
+
},
|
|
45
|
+
variant: {
|
|
46
|
+
control: { type: "select", labels: Object.fromEntries(buttonColorsList.map(function (btnColor) { return [btnColor.key, btnColor.label]; })) },
|
|
47
|
+
options: buttonColorsList.map(function (btnColor) { return btnColor.key; }),
|
|
48
|
+
},
|
|
49
|
+
iconLeft: {
|
|
50
|
+
control: { type: "select", labels: Object.fromEntries(iconList.map(function (icon) { return [icon.key, icon.label]; })) },
|
|
51
|
+
options: __spreadArray(["none"], iconList.map(function (icon) { return icon.key; }), true),
|
|
52
|
+
if: { arg: "contentType", eq: contentTypeEnum.text_with_icon },
|
|
53
|
+
},
|
|
54
|
+
iconRight: {
|
|
55
|
+
control: { type: "select", labels: Object.fromEntries(iconList.map(function (icon) { return [icon.key, icon.label]; })) },
|
|
56
|
+
options: __spreadArray(["none"], iconList.map(function (icon) { return icon.key; }), true),
|
|
57
|
+
if: { arg: "contentType", eq: contentTypeEnum.text_with_icon },
|
|
58
|
+
},
|
|
59
|
+
shape: {
|
|
60
|
+
control: { type: "select", labels: Object.fromEntries(borderRadiusList.map(function (borderRadius) { return [borderRadius.key, borderRadius.label]; })) },
|
|
61
|
+
options: borderRadiusList.map(function (borderRadius) { return borderRadius.key; }),
|
|
62
|
+
},
|
|
63
|
+
size: {
|
|
64
|
+
control: { type: "select", labels: Object.fromEntries(butttonSizeList.map(function (size) { return [size.key, size.label]; })) },
|
|
65
|
+
options: butttonSizeList.map(function (size) { return size.key; }),
|
|
66
|
+
description: "Select the size of the button",
|
|
67
|
+
update: function (args) {
|
|
68
|
+
var isIconOnly = args.contentType === contentTypeEnum.icon_only;
|
|
69
|
+
// Dynamically update options and labels based on contentType
|
|
70
|
+
return {
|
|
71
|
+
options: isIconOnly
|
|
72
|
+
? buttonWithIconList.map(function (size) { return size.key; })
|
|
73
|
+
: butttonSizeList.map(function (size) { return size.key; }),
|
|
74
|
+
control: {
|
|
75
|
+
type: "select",
|
|
76
|
+
labels: Object.fromEntries((isIconOnly ? buttonWithIconList : butttonSizeList).map(function (size) { return [
|
|
77
|
+
size.key,
|
|
78
|
+
size.label,
|
|
79
|
+
]; })),
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
leftIconSize: {
|
|
85
|
+
control: { type: "select", labels: Object.fromEntries(buttonIconSizeList.map(function (size) { return [size.key, size.label]; })) },
|
|
86
|
+
options: buttonIconSizeList.map(function (size) { return size.key; }),
|
|
87
|
+
if: { arg: "contentType", eq: contentTypeEnum.text_with_icon },
|
|
88
|
+
},
|
|
89
|
+
rightIconSize: {
|
|
90
|
+
control: { type: "select", labels: Object.fromEntries(buttonIconSizeList.map(function (size) { return [size.key, size.label]; })) },
|
|
91
|
+
options: buttonIconSizeList.map(function (size) { return size.key; }),
|
|
92
|
+
if: { arg: "contentType", eq: contentTypeEnum.text_with_icon },
|
|
93
|
+
},
|
|
94
|
+
icon: {
|
|
95
|
+
control: { type: "select", labels: Object.fromEntries(iconList.map(function (icon) { return [icon.key, icon.label]; })) },
|
|
96
|
+
options: iconList.map(function (icon) { return icon.key; }),
|
|
97
|
+
if: { arg: "contentType", eq: contentTypeEnum.icon_only },
|
|
98
|
+
},
|
|
99
|
+
iconSize: {
|
|
100
|
+
control: { type: "select", labels: Object.fromEntries(buttonIconSizeList.map(function (size) { return [size.key, size.label]; })) },
|
|
101
|
+
options: buttonIconSizeList.map(function (size) { return size.key; }),
|
|
102
|
+
if: { arg: "contentType", eq: contentTypeEnum.icon_only },
|
|
103
|
+
},
|
|
104
|
+
type: {
|
|
105
|
+
control: { type: "select" },
|
|
106
|
+
options: [buttonTypeEnum.fill, buttonTypeEnum.outline],
|
|
107
|
+
description: "Determines the type of the button",
|
|
108
|
+
},
|
|
109
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const IconView: () => import("react").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { iconList } from "../../utils/iconList";
|
|
2
|
+
export var IconView = function () {
|
|
3
|
+
return (<>
|
|
4
|
+
<div className="grid grid-cols-3 sm:grid-cols-4 md:grid-cols-6 lg:grid-cols-6 gap-6" data-testid="icons-list">
|
|
5
|
+
{iconList.map(function (icon, index) {
|
|
6
|
+
return (<div key={index} className="flex flex-col items-center justify-center bg-gray-100 lu-border-rounded-lg lu-pd-200 shadow-md hover:bg-gray-200" data-testid="single-icon">
|
|
7
|
+
<svg width="25" height="25" viewBox="0 0 32 32" fill="none" className="mb-2" role="img">
|
|
8
|
+
<g clipPath="url(#clip0_9168_14965)">
|
|
9
|
+
<path d={icon === null || icon === void 0 ? void 0 : icon.path} fill="#070808"/>
|
|
10
|
+
</g>
|
|
11
|
+
<defs>
|
|
12
|
+
<clipPath id="clip0_9168_14965">
|
|
13
|
+
<rect width="32" height="32" fill="black"/>
|
|
14
|
+
</clipPath>
|
|
15
|
+
</defs>
|
|
16
|
+
</svg>
|
|
17
|
+
<p className="lu-font-size-x-small lu-font-weight-regular text-gray-700 text-center">{icon === null || icon === void 0 ? void 0 : icon.label}</p>
|
|
18
|
+
</div>);
|
|
19
|
+
})}
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
</>);
|
|
23
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { iconList } from "../../utils/iconList";
|
|
2
|
+
export var LUIcon = function (_a) {
|
|
3
|
+
var _b;
|
|
4
|
+
var size = _a.size, fill = _a.fill, icon = _a.icon, className = _a.className;
|
|
5
|
+
var selectedIcon = iconList.find(function (item) { return item.key === icon; });
|
|
6
|
+
return (<>
|
|
7
|
+
<div data-testid="single-icon">
|
|
8
|
+
<svg className={"".concat(size, " ").concat(className)} viewBox="0 0 32 32" fill="none">
|
|
9
|
+
<g clip-path="url(#clip0_9168_14965)">
|
|
10
|
+
<path d={(_b = selectedIcon === null || selectedIcon === void 0 ? void 0 : selectedIcon.path) !== null && _b !== void 0 ? _b : ''} className={"".concat(fill, " icon")}/>
|
|
11
|
+
</g>
|
|
12
|
+
<defs>
|
|
13
|
+
<clipPath id="clip0_9168_14965">
|
|
14
|
+
<rect width="32" height="32" fill="black"/>
|
|
15
|
+
</clipPath>
|
|
16
|
+
</defs>
|
|
17
|
+
</svg>
|
|
18
|
+
</div>
|
|
19
|
+
</>);
|
|
20
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { LUIcon } from "./LUIcon";
|
|
2
|
+
import { iconColorList, iconSizeList } from "../../utils";
|
|
3
|
+
import { iconList } from "../../utils/iconList";
|
|
4
|
+
export default {
|
|
5
|
+
title: "Components/Icon",
|
|
6
|
+
component: LUIcon,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
};
|
|
9
|
+
var Template = function (args) { return <LUIcon {...args}/>; };
|
|
10
|
+
export var icon = Template.bind({});
|
|
11
|
+
icon.args = {
|
|
12
|
+
size: 'lu-icon-x-small',
|
|
13
|
+
fill: 'lu-primary-icon-default',
|
|
14
|
+
icon: iconList[0].key,
|
|
15
|
+
};
|
|
16
|
+
icon.argTypes = {
|
|
17
|
+
size: {
|
|
18
|
+
control: { type: "select", labels: Object.fromEntries(iconSizeList.map(function (size) { return [size.key, size.label]; })) },
|
|
19
|
+
options: iconSizeList.map(function (size) { return size.key; }),
|
|
20
|
+
},
|
|
21
|
+
fill: {
|
|
22
|
+
control: { type: "select", labels: Object.fromEntries(iconColorList.map(function (color) { return [color.key, color.label]; })) },
|
|
23
|
+
options: iconColorList.map(function (color) { return color.key; }),
|
|
24
|
+
},
|
|
25
|
+
icon: {
|
|
26
|
+
control: { type: "select", labels: Object.fromEntries(iconList.map(function (icon) { return [icon.key, icon.label]; })) },
|
|
27
|
+
options: iconList.map(function (icon) { return icon.key; }),
|
|
28
|
+
}
|
|
29
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export var Image = function (_a) {
|
|
2
|
+
var image = _a.image, aspectRatio = _a.aspectRatio, className = _a.className;
|
|
3
|
+
return (<div className="lu-width-25 lu-height-25" data-testid="lu-image">
|
|
4
|
+
<img src={image || ''} alt="Image" className={"lu-width-100 ".concat(aspectRatio, " ").concat(className)}/>
|
|
5
|
+
</div>);
|
|
6
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Image } from "./LuImage";
|
|
2
|
+
import { landscapeaspectRatioList, portraitaspectRatioList } from "../../utils";
|
|
3
|
+
import { orientationEnum } from "../../utils/enum";
|
|
4
|
+
export default {
|
|
5
|
+
title: "Components/Image",
|
|
6
|
+
component: Image,
|
|
7
|
+
};
|
|
8
|
+
var Template = function (args, _a) {
|
|
9
|
+
var argTypes = _a.argTypes;
|
|
10
|
+
//Show aspectRatio options based on orientation(landscape)
|
|
11
|
+
var isLandscape = args.orientation === orientationEnum.landscape;
|
|
12
|
+
argTypes.aspectRatio.options = isLandscape ? landscapeaspectRatioList.map(function (ratio) { return ratio.key; }) : portraitaspectRatioList.map(function (ratio) { return ratio.key; });
|
|
13
|
+
argTypes.aspectRatio.control.labels = Object.fromEntries((isLandscape ? landscapeaspectRatioList : portraitaspectRatioList).map(function (ratio) { return [
|
|
14
|
+
ratio.key,
|
|
15
|
+
ratio.label,
|
|
16
|
+
]; }));
|
|
17
|
+
return <Image {...args}/>;
|
|
18
|
+
};
|
|
19
|
+
export var image = Template.bind({});
|
|
20
|
+
image.args = {
|
|
21
|
+
image: '/images/demo-image.jpg',
|
|
22
|
+
orientation: orientationEnum.portrait,
|
|
23
|
+
aspectRatio: portraitaspectRatioList[0].key,
|
|
24
|
+
className: ''
|
|
25
|
+
};
|
|
26
|
+
image.argTypes = {
|
|
27
|
+
orientation: {
|
|
28
|
+
control: { type: "select" },
|
|
29
|
+
options: [orientationEnum.portrait, orientationEnum.landscape],
|
|
30
|
+
},
|
|
31
|
+
//Show Default aspectRatio options for portrait orientation
|
|
32
|
+
aspectRatio: {
|
|
33
|
+
control: { type: "select" },
|
|
34
|
+
options: portraitaspectRatioList.map(function (ratio) { return ratio.key; }),
|
|
35
|
+
labels: Object.fromEntries(portraitaspectRatioList.map(function (ratio) { return [ratio.key, ratio.label]; })),
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export var MinWidthHeight = function (_a) {
|
|
2
|
+
var minWidth = _a.minWidth, minHeight = _a.minHeight;
|
|
3
|
+
return (<>
|
|
4
|
+
<div className="w-fit">
|
|
5
|
+
<div className={"bg-blue-500 ".concat(minWidth, " ").concat(minHeight, " rounded")} data-testid="minWidthHeight-box"></div>
|
|
6
|
+
</div>
|
|
7
|
+
</>);
|
|
8
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Meta } from "@storybook/react";
|
|
2
|
+
import { MinWidthHeightProps } from "@/types/interface";
|
|
3
|
+
declare const _default: Meta;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const minWidthAndHeight: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, MinWidthHeightProps>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { MinWidthHeight } from "../../components/Size/MinWidthHeight";
|
|
2
|
+
import { minHeights, minWidths } from "../../utils";
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/Size",
|
|
5
|
+
component: MinWidthHeight,
|
|
6
|
+
};
|
|
7
|
+
var Template = function (args) { return <MinWidthHeight {...args}/>; };
|
|
8
|
+
export var minWidthAndHeight = Template.bind({});
|
|
9
|
+
minWidthAndHeight.args = {
|
|
10
|
+
minWidth: 'lu-min-width-100',
|
|
11
|
+
minHeight: 'lu-min-height-100',
|
|
12
|
+
};
|
|
13
|
+
minWidthAndHeight.argTypes = {
|
|
14
|
+
minWidth: {
|
|
15
|
+
control: { type: "select", labels: Object.fromEntries(minWidths.map(function (size) { return [size.key, size.label]; })) },
|
|
16
|
+
options: minWidths.map(function (size) { return size.key; }),
|
|
17
|
+
},
|
|
18
|
+
minHeight: {
|
|
19
|
+
control: { type: "select", labels: Object.fromEntries(minHeights.map(function (size) { return [size.key, size.label]; })) },
|
|
20
|
+
options: minHeights.map(function (size) { return size.key; }),
|
|
21
|
+
},
|
|
22
|
+
};
|