bianic-ui 1.0.0-beta.13 → 1.0.0-beta.14
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/cjs/index.js +9 -7
- package/dist/cjs/types/components/Button/configs.d.ts +0 -6
- package/dist/cjs/types/components/Button/index.d.ts +5 -1
- package/dist/esm/index.js +9 -7
- package/dist/esm/types/components/Button/configs.d.ts +0 -6
- package/dist/esm/types/components/Button/index.d.ts +5 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -379,10 +379,10 @@ var radiusConfig = {
|
|
|
379
379
|
},
|
|
380
380
|
};
|
|
381
381
|
var sizeConfig$a = {
|
|
382
|
-
lg: 'py-[10.5px] px-[13px] h-[48px] flex items-center justify-center gap-[10px]',
|
|
383
|
-
md: ' px-[11px] py-[9px] h-[40px] flex items-center justify-center gap-[5px] ',
|
|
384
|
-
sm: 'px-[8px] py-[6px] h-[30px] flex items-center justify-center gap-[5px] ',
|
|
385
|
-
tn: 'px-[4px] py-[2px] h-[22px] flex items-center justify-center gap-[3px]',
|
|
382
|
+
lg: 'py-[10.5px] px-[13px] h-[48px] flex items-center justify-center gap-[10px] text-size-md',
|
|
383
|
+
md: ' px-[11px] py-[9px] h-[40px] flex items-center justify-center gap-[5px] text-size-base',
|
|
384
|
+
sm: 'px-[8px] py-[6px] h-[30px] flex items-center justify-center gap-[5px] text-size-sm',
|
|
385
|
+
tn: 'px-[4px] py-[2px] h-[22px] flex items-center justify-center gap-[3px] text-size-tiny',
|
|
386
386
|
};
|
|
387
387
|
var iconOnlySizeConfig = {
|
|
388
388
|
lg: 'p-[13px] flex items-center justify-center gap-[10px]',
|
|
@@ -429,7 +429,7 @@ var variantUnion$1 = [
|
|
|
429
429
|
var radiusUnion = ['default', 'full-rounded'];
|
|
430
430
|
var sizeUnion$4 = ['md', 'lg', 'sm', 'tn'];
|
|
431
431
|
function Button(_a) {
|
|
432
|
-
var label = _a.label, _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.radius, radius = _d === void 0 ? 'default' : _d, _e = _a.size, size = _e === void 0 ? 'md' : _e, _f = _a.variant, variant = _f === void 0 ? 'default' : _f, _g = _a.iconLeft, iconLeft = _g === void 0 ? null : _g, _h = _a.iconRight, iconRight = _h === void 0 ? null : _h, props = __rest(_a, ["label", "className", "disabled", "radius", "size", "variant", "iconLeft", "iconRight"]);
|
|
432
|
+
var label = _a.label, _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.radius, radius = _d === void 0 ? 'default' : _d, _e = _a.size, size = _e === void 0 ? 'md' : _e, _f = _a.variant, variant = _f === void 0 ? 'default' : _f, _g = _a.iconLeft, iconLeft = _g === void 0 ? null : _g, _h = _a.iconRight, iconRight = _h === void 0 ? null : _h, _j = _a.left, left = _j === void 0 ? null : _j, _k = _a.right, right = _k === void 0 ? null : _k, props = __rest(_a, ["label", "className", "disabled", "radius", "size", "variant", "iconLeft", "iconRight", "left", "right"]);
|
|
433
433
|
var validatedVariant = validUnion(variant, variantUnion$1);
|
|
434
434
|
var validatedSize = validUnion(size, sizeUnion$4);
|
|
435
435
|
var validatedRadius = validUnion(radius, radiusUnion);
|
|
@@ -438,9 +438,9 @@ function Button(_a) {
|
|
|
438
438
|
: iconOnlySizeConfig[validatedSize];
|
|
439
439
|
var classString = "\n ".concat(variantConfig$1[validatedVariant], " \n ").concat(sizeClass, " \n ").concat(radiusConfig[validatedRadius][validatedSize], " \n ").concat(className, "\n ");
|
|
440
440
|
return (React.createElement("button", __assign({ type: "button", className: "button flex justify-center items-center ".concat(classString), disabled: disabled }, props),
|
|
441
|
-
childrenElement(iconLeft),
|
|
441
|
+
childrenElement(iconLeft || left),
|
|
442
442
|
childrenElement(label),
|
|
443
|
-
childrenElement(iconRight)));
|
|
443
|
+
childrenElement(iconRight || right)));
|
|
444
444
|
}
|
|
445
445
|
Button.defaultProps = {
|
|
446
446
|
label: null,
|
|
@@ -451,6 +451,8 @@ Button.defaultProps = {
|
|
|
451
451
|
variant: 'default',
|
|
452
452
|
iconLeft: null,
|
|
453
453
|
iconRight: null,
|
|
454
|
+
left: null,
|
|
455
|
+
right: null,
|
|
454
456
|
};
|
|
455
457
|
|
|
456
458
|
var AvatarConfig = {
|
|
@@ -24,12 +24,6 @@ export declare const iconOnlySizeConfig: {
|
|
|
24
24
|
sm: string;
|
|
25
25
|
tn: string;
|
|
26
26
|
};
|
|
27
|
-
export declare const textConfig: {
|
|
28
|
-
lg: string;
|
|
29
|
-
md: string;
|
|
30
|
-
sm: string;
|
|
31
|
-
tn: string;
|
|
32
|
-
};
|
|
33
27
|
export declare const variantConfig: {
|
|
34
28
|
default: string;
|
|
35
29
|
primary: string;
|
|
@@ -4,12 +4,14 @@ interface ButtonProps extends ComponentPropsWithoutRef<'button'> {
|
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
iconRight?: React.ReactNode;
|
|
6
6
|
iconLeft?: React.ReactNode;
|
|
7
|
+
right?: React.ReactNode;
|
|
8
|
+
left?: React.ReactNode;
|
|
7
9
|
label?: string;
|
|
8
10
|
radius?: 'default' | 'full-rounded';
|
|
9
11
|
size?: 'lg' | 'md' | 'sm' | 'tn';
|
|
10
12
|
variant?: 'default' | 'danger' | 'info' | 'link' | 'primary' | 'subtle' | 'subtle-link' | 'success' | 'warning' | 'default-outlined' | 'danger-outlined' | 'info-outlined' | 'primary-outlined' | 'success-outlined' | 'warning-outlined';
|
|
11
13
|
}
|
|
12
|
-
declare function Button({ label, className, disabled, radius, size, variant, iconLeft, iconRight, ...props }: ButtonProps): React.JSX.Element;
|
|
14
|
+
declare function Button({ label, className, disabled, radius, size, variant, iconLeft, iconRight, left, right, ...props }: ButtonProps): React.JSX.Element;
|
|
13
15
|
declare namespace Button {
|
|
14
16
|
var defaultProps: {
|
|
15
17
|
label: null;
|
|
@@ -20,6 +22,8 @@ declare namespace Button {
|
|
|
20
22
|
variant: string;
|
|
21
23
|
iconLeft: null;
|
|
22
24
|
iconRight: null;
|
|
25
|
+
left: null;
|
|
26
|
+
right: null;
|
|
23
27
|
};
|
|
24
28
|
}
|
|
25
29
|
export default Button;
|
package/dist/esm/index.js
CHANGED
|
@@ -377,10 +377,10 @@ var radiusConfig = {
|
|
|
377
377
|
},
|
|
378
378
|
};
|
|
379
379
|
var sizeConfig$a = {
|
|
380
|
-
lg: 'py-[10.5px] px-[13px] h-[48px] flex items-center justify-center gap-[10px]',
|
|
381
|
-
md: ' px-[11px] py-[9px] h-[40px] flex items-center justify-center gap-[5px] ',
|
|
382
|
-
sm: 'px-[8px] py-[6px] h-[30px] flex items-center justify-center gap-[5px] ',
|
|
383
|
-
tn: 'px-[4px] py-[2px] h-[22px] flex items-center justify-center gap-[3px]',
|
|
380
|
+
lg: 'py-[10.5px] px-[13px] h-[48px] flex items-center justify-center gap-[10px] text-size-md',
|
|
381
|
+
md: ' px-[11px] py-[9px] h-[40px] flex items-center justify-center gap-[5px] text-size-base',
|
|
382
|
+
sm: 'px-[8px] py-[6px] h-[30px] flex items-center justify-center gap-[5px] text-size-sm',
|
|
383
|
+
tn: 'px-[4px] py-[2px] h-[22px] flex items-center justify-center gap-[3px] text-size-tiny',
|
|
384
384
|
};
|
|
385
385
|
var iconOnlySizeConfig = {
|
|
386
386
|
lg: 'p-[13px] flex items-center justify-center gap-[10px]',
|
|
@@ -427,7 +427,7 @@ var variantUnion$1 = [
|
|
|
427
427
|
var radiusUnion = ['default', 'full-rounded'];
|
|
428
428
|
var sizeUnion$4 = ['md', 'lg', 'sm', 'tn'];
|
|
429
429
|
function Button(_a) {
|
|
430
|
-
var label = _a.label, _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.radius, radius = _d === void 0 ? 'default' : _d, _e = _a.size, size = _e === void 0 ? 'md' : _e, _f = _a.variant, variant = _f === void 0 ? 'default' : _f, _g = _a.iconLeft, iconLeft = _g === void 0 ? null : _g, _h = _a.iconRight, iconRight = _h === void 0 ? null : _h, props = __rest(_a, ["label", "className", "disabled", "radius", "size", "variant", "iconLeft", "iconRight"]);
|
|
430
|
+
var label = _a.label, _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.radius, radius = _d === void 0 ? 'default' : _d, _e = _a.size, size = _e === void 0 ? 'md' : _e, _f = _a.variant, variant = _f === void 0 ? 'default' : _f, _g = _a.iconLeft, iconLeft = _g === void 0 ? null : _g, _h = _a.iconRight, iconRight = _h === void 0 ? null : _h, _j = _a.left, left = _j === void 0 ? null : _j, _k = _a.right, right = _k === void 0 ? null : _k, props = __rest(_a, ["label", "className", "disabled", "radius", "size", "variant", "iconLeft", "iconRight", "left", "right"]);
|
|
431
431
|
var validatedVariant = validUnion(variant, variantUnion$1);
|
|
432
432
|
var validatedSize = validUnion(size, sizeUnion$4);
|
|
433
433
|
var validatedRadius = validUnion(radius, radiusUnion);
|
|
@@ -436,9 +436,9 @@ function Button(_a) {
|
|
|
436
436
|
: iconOnlySizeConfig[validatedSize];
|
|
437
437
|
var classString = "\n ".concat(variantConfig$1[validatedVariant], " \n ").concat(sizeClass, " \n ").concat(radiusConfig[validatedRadius][validatedSize], " \n ").concat(className, "\n ");
|
|
438
438
|
return (React.createElement("button", __assign({ type: "button", className: "button flex justify-center items-center ".concat(classString), disabled: disabled }, props),
|
|
439
|
-
childrenElement(iconLeft),
|
|
439
|
+
childrenElement(iconLeft || left),
|
|
440
440
|
childrenElement(label),
|
|
441
|
-
childrenElement(iconRight)));
|
|
441
|
+
childrenElement(iconRight || right)));
|
|
442
442
|
}
|
|
443
443
|
Button.defaultProps = {
|
|
444
444
|
label: null,
|
|
@@ -449,6 +449,8 @@ Button.defaultProps = {
|
|
|
449
449
|
variant: 'default',
|
|
450
450
|
iconLeft: null,
|
|
451
451
|
iconRight: null,
|
|
452
|
+
left: null,
|
|
453
|
+
right: null,
|
|
452
454
|
};
|
|
453
455
|
|
|
454
456
|
var AvatarConfig = {
|
|
@@ -24,12 +24,6 @@ export declare const iconOnlySizeConfig: {
|
|
|
24
24
|
sm: string;
|
|
25
25
|
tn: string;
|
|
26
26
|
};
|
|
27
|
-
export declare const textConfig: {
|
|
28
|
-
lg: string;
|
|
29
|
-
md: string;
|
|
30
|
-
sm: string;
|
|
31
|
-
tn: string;
|
|
32
|
-
};
|
|
33
27
|
export declare const variantConfig: {
|
|
34
28
|
default: string;
|
|
35
29
|
primary: string;
|
|
@@ -4,12 +4,14 @@ interface ButtonProps extends ComponentPropsWithoutRef<'button'> {
|
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
iconRight?: React.ReactNode;
|
|
6
6
|
iconLeft?: React.ReactNode;
|
|
7
|
+
right?: React.ReactNode;
|
|
8
|
+
left?: React.ReactNode;
|
|
7
9
|
label?: string;
|
|
8
10
|
radius?: 'default' | 'full-rounded';
|
|
9
11
|
size?: 'lg' | 'md' | 'sm' | 'tn';
|
|
10
12
|
variant?: 'default' | 'danger' | 'info' | 'link' | 'primary' | 'subtle' | 'subtle-link' | 'success' | 'warning' | 'default-outlined' | 'danger-outlined' | 'info-outlined' | 'primary-outlined' | 'success-outlined' | 'warning-outlined';
|
|
11
13
|
}
|
|
12
|
-
declare function Button({ label, className, disabled, radius, size, variant, iconLeft, iconRight, ...props }: ButtonProps): React.JSX.Element;
|
|
14
|
+
declare function Button({ label, className, disabled, radius, size, variant, iconLeft, iconRight, left, right, ...props }: ButtonProps): React.JSX.Element;
|
|
13
15
|
declare namespace Button {
|
|
14
16
|
var defaultProps: {
|
|
15
17
|
label: null;
|
|
@@ -20,6 +22,8 @@ declare namespace Button {
|
|
|
20
22
|
variant: string;
|
|
21
23
|
iconLeft: null;
|
|
22
24
|
iconRight: null;
|
|
25
|
+
left: null;
|
|
26
|
+
right: null;
|
|
23
27
|
};
|
|
24
28
|
}
|
|
25
29
|
export default Button;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"@biaenergi:registry": "https://gitlab.com/api/v4/projects/50905269/packages/npm/"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.0.0-beta.
|
|
6
|
+
"version": "1.0.0-beta.14",
|
|
7
7
|
"description": "Design Language System develop by BIAENERGI",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"rollup": "rollup -c",
|