bianic-ui 1.0.0-beta.12 → 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 +10 -9
- 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 +10 -9
- 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
|
@@ -249,8 +249,7 @@ var textClasses = {
|
|
|
249
249
|
var childrenElement = function (element) {
|
|
250
250
|
if (element === undefined)
|
|
251
251
|
return '';
|
|
252
|
-
if (typeof element === 'object')
|
|
253
|
-
return '';
|
|
252
|
+
// if (typeof element === 'object') return '';
|
|
254
253
|
return element;
|
|
255
254
|
};
|
|
256
255
|
var validUnion = function (value, union) {
|
|
@@ -380,10 +379,10 @@ var radiusConfig = {
|
|
|
380
379
|
},
|
|
381
380
|
};
|
|
382
381
|
var sizeConfig$a = {
|
|
383
|
-
lg: 'py-[10.5px] px-[13px] h-[48px] flex items-center justify-center gap-[10px]',
|
|
384
|
-
md: ' px-[11px] py-[9px] h-[40px] flex items-center justify-center gap-[5px] ',
|
|
385
|
-
sm: 'px-[8px] py-[6px] h-[30px] flex items-center justify-center gap-[5px] ',
|
|
386
|
-
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',
|
|
387
386
|
};
|
|
388
387
|
var iconOnlySizeConfig = {
|
|
389
388
|
lg: 'p-[13px] flex items-center justify-center gap-[10px]',
|
|
@@ -430,7 +429,7 @@ var variantUnion$1 = [
|
|
|
430
429
|
var radiusUnion = ['default', 'full-rounded'];
|
|
431
430
|
var sizeUnion$4 = ['md', 'lg', 'sm', 'tn'];
|
|
432
431
|
function Button(_a) {
|
|
433
|
-
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"]);
|
|
434
433
|
var validatedVariant = validUnion(variant, variantUnion$1);
|
|
435
434
|
var validatedSize = validUnion(size, sizeUnion$4);
|
|
436
435
|
var validatedRadius = validUnion(radius, radiusUnion);
|
|
@@ -439,9 +438,9 @@ function Button(_a) {
|
|
|
439
438
|
: iconOnlySizeConfig[validatedSize];
|
|
440
439
|
var classString = "\n ".concat(variantConfig$1[validatedVariant], " \n ").concat(sizeClass, " \n ").concat(radiusConfig[validatedRadius][validatedSize], " \n ").concat(className, "\n ");
|
|
441
440
|
return (React.createElement("button", __assign({ type: "button", className: "button flex justify-center items-center ".concat(classString), disabled: disabled }, props),
|
|
442
|
-
childrenElement(iconLeft),
|
|
441
|
+
childrenElement(iconLeft || left),
|
|
443
442
|
childrenElement(label),
|
|
444
|
-
childrenElement(iconRight)));
|
|
443
|
+
childrenElement(iconRight || right)));
|
|
445
444
|
}
|
|
446
445
|
Button.defaultProps = {
|
|
447
446
|
label: null,
|
|
@@ -452,6 +451,8 @@ Button.defaultProps = {
|
|
|
452
451
|
variant: 'default',
|
|
453
452
|
iconLeft: null,
|
|
454
453
|
iconRight: null,
|
|
454
|
+
left: null,
|
|
455
|
+
right: null,
|
|
455
456
|
};
|
|
456
457
|
|
|
457
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
|
@@ -247,8 +247,7 @@ var textClasses = {
|
|
|
247
247
|
var childrenElement = function (element) {
|
|
248
248
|
if (element === undefined)
|
|
249
249
|
return '';
|
|
250
|
-
if (typeof element === 'object')
|
|
251
|
-
return '';
|
|
250
|
+
// if (typeof element === 'object') return '';
|
|
252
251
|
return element;
|
|
253
252
|
};
|
|
254
253
|
var validUnion = function (value, union) {
|
|
@@ -378,10 +377,10 @@ var radiusConfig = {
|
|
|
378
377
|
},
|
|
379
378
|
};
|
|
380
379
|
var sizeConfig$a = {
|
|
381
|
-
lg: 'py-[10.5px] px-[13px] h-[48px] flex items-center justify-center gap-[10px]',
|
|
382
|
-
md: ' px-[11px] py-[9px] h-[40px] flex items-center justify-center gap-[5px] ',
|
|
383
|
-
sm: 'px-[8px] py-[6px] h-[30px] flex items-center justify-center gap-[5px] ',
|
|
384
|
-
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',
|
|
385
384
|
};
|
|
386
385
|
var iconOnlySizeConfig = {
|
|
387
386
|
lg: 'p-[13px] flex items-center justify-center gap-[10px]',
|
|
@@ -428,7 +427,7 @@ var variantUnion$1 = [
|
|
|
428
427
|
var radiusUnion = ['default', 'full-rounded'];
|
|
429
428
|
var sizeUnion$4 = ['md', 'lg', 'sm', 'tn'];
|
|
430
429
|
function Button(_a) {
|
|
431
|
-
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"]);
|
|
432
431
|
var validatedVariant = validUnion(variant, variantUnion$1);
|
|
433
432
|
var validatedSize = validUnion(size, sizeUnion$4);
|
|
434
433
|
var validatedRadius = validUnion(radius, radiusUnion);
|
|
@@ -437,9 +436,9 @@ function Button(_a) {
|
|
|
437
436
|
: iconOnlySizeConfig[validatedSize];
|
|
438
437
|
var classString = "\n ".concat(variantConfig$1[validatedVariant], " \n ").concat(sizeClass, " \n ").concat(radiusConfig[validatedRadius][validatedSize], " \n ").concat(className, "\n ");
|
|
439
438
|
return (React.createElement("button", __assign({ type: "button", className: "button flex justify-center items-center ".concat(classString), disabled: disabled }, props),
|
|
440
|
-
childrenElement(iconLeft),
|
|
439
|
+
childrenElement(iconLeft || left),
|
|
441
440
|
childrenElement(label),
|
|
442
|
-
childrenElement(iconRight)));
|
|
441
|
+
childrenElement(iconRight || right)));
|
|
443
442
|
}
|
|
444
443
|
Button.defaultProps = {
|
|
445
444
|
label: null,
|
|
@@ -450,6 +449,8 @@ Button.defaultProps = {
|
|
|
450
449
|
variant: 'default',
|
|
451
450
|
iconLeft: null,
|
|
452
451
|
iconRight: null,
|
|
452
|
+
left: null,
|
|
453
|
+
right: null,
|
|
453
454
|
};
|
|
454
455
|
|
|
455
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",
|