bianic-ui 2.14.0-beta.3 → 2.14.0-beta.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/cjs/index.js +22 -11
- package/dist/cjs/lib.css +1 -1
- package/dist/cjs/types/components/Forms/Toggle/configs.d.ts +13 -2
- package/dist/cjs/types/components/Forms/Toggle/index.d.ts +1 -1
- package/dist/esm/index.js +22 -11
- package/dist/esm/lib.css +1 -1
- package/dist/esm/types/components/Forms/Toggle/configs.d.ts +13 -2
- package/dist/esm/types/components/Forms/Toggle/index.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
declare const sizeConfig: {
|
|
2
2
|
md: {
|
|
3
3
|
containerSize: string;
|
|
4
|
-
|
|
4
|
+
trackBorder: string;
|
|
5
|
+
knobSize: string;
|
|
6
|
+
knobInset: string;
|
|
5
7
|
labelClass: string;
|
|
6
8
|
};
|
|
7
9
|
sm: {
|
|
8
10
|
containerSize: string;
|
|
9
|
-
|
|
11
|
+
trackBorder: string;
|
|
12
|
+
knobSize: string;
|
|
13
|
+
knobInset: string;
|
|
14
|
+
labelClass: string;
|
|
15
|
+
};
|
|
16
|
+
tn: {
|
|
17
|
+
containerSize: string;
|
|
18
|
+
trackBorder: string;
|
|
19
|
+
knobSize: string;
|
|
20
|
+
knobInset: string;
|
|
10
21
|
labelClass: string;
|
|
11
22
|
};
|
|
12
23
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ComponentPropsWithoutRef } from 'react';
|
|
2
2
|
interface CheckboxProps extends Omit<ComponentPropsWithoutRef<'input'>, 'size'> {
|
|
3
3
|
label?: string;
|
|
4
|
-
size?: 'md' | 'sm';
|
|
4
|
+
size?: 'md' | 'sm' | 'tn';
|
|
5
5
|
checked?: boolean;
|
|
6
6
|
id?: string;
|
|
7
7
|
onClick?: (event: React.MouseEvent<HTMLInputElement>) => void;
|
package/dist/esm/index.js
CHANGED
|
@@ -3383,27 +3383,38 @@ var TagLabelInput = forwardRef(TagLabelInputInner);
|
|
|
3383
3383
|
|
|
3384
3384
|
var sizeConfig$4 = {
|
|
3385
3385
|
md: {
|
|
3386
|
-
containerSize: 'w-[
|
|
3387
|
-
|
|
3388
|
-
|
|
3386
|
+
containerSize: 'w-[46px] h-[26px]',
|
|
3387
|
+
trackBorder: 'border-2',
|
|
3388
|
+
knobSize: 'size-[18px]',
|
|
3389
|
+
knobInset: 'mx-[4px]',
|
|
3390
|
+
labelClass: 'text-size-base',
|
|
3389
3391
|
},
|
|
3390
3392
|
sm: {
|
|
3391
|
-
containerSize: 'w-[
|
|
3392
|
-
|
|
3393
|
-
|
|
3393
|
+
containerSize: 'w-[32px] h-[20px]',
|
|
3394
|
+
trackBorder: 'border-2',
|
|
3395
|
+
knobSize: 'size-[12px]',
|
|
3396
|
+
knobInset: 'mx-[4px]',
|
|
3397
|
+
labelClass: 'text-size-sm',
|
|
3398
|
+
},
|
|
3399
|
+
tn: {
|
|
3400
|
+
containerSize: 'w-[22.4px] h-[14px]',
|
|
3401
|
+
trackBorder: 'border-[1.5px]',
|
|
3402
|
+
knobSize: 'size-[8.4px]',
|
|
3403
|
+
knobInset: 'mx-[2.8px]',
|
|
3404
|
+
labelClass: 'text-size-sm',
|
|
3394
3405
|
},
|
|
3395
3406
|
};
|
|
3396
3407
|
|
|
3397
3408
|
function Toggle(_a) {
|
|
3398
3409
|
var _b = _a.label, label = _b === void 0 ? '' : _b, _c = _a.size, size = _c === void 0 ? 'md' : _c, _d = _a.onClick, onClick = _d === void 0 ? function () { } : _d, _e = _a.checked, checked = _e === void 0 ? false : _e, _f = _a.id, id = _f === void 0 ? '' : _f, _g = _a.disabled, disabled = _g === void 0 ? false : _g;
|
|
3399
|
-
var _h = sizeConfig$4[size], containerSize = _h.containerSize,
|
|
3410
|
+
var _h = sizeConfig$4[size], containerSize = _h.containerSize, trackBorder = _h.trackBorder, knobSize = _h.knobSize, knobInset = _h.knobInset, labelClass = _h.labelClass;
|
|
3400
3411
|
var checkedClass = checked ? 'justify-end' : 'justify-start';
|
|
3401
3412
|
var containerClass = "".concat(checkedClass, " ").concat(containerSize);
|
|
3402
3413
|
return (React.createElement("div", { className: "flex items-center" },
|
|
3403
|
-
React.createElement("div", { className: "relative flex flex-shrink-0 cursor-pointer items-center rounded-full
|
|
3404
|
-
React.createElement("input", { id: id, checked: checked, disabled: disabled, className: "
|
|
3405
|
-
React.createElement("div", { className: "check-icon group peer z-10
|
|
3406
|
-
React.createElement("label", { htmlFor: id, className: "
|
|
3414
|
+
React.createElement("div", { className: "relative flex flex-shrink-0 cursor-pointer items-center rounded-full ".concat(containerClass), onClick: onClick },
|
|
3415
|
+
React.createElement("input", { id: id, checked: checked, disabled: disabled, className: "checkbox peer absolute h-full w-full cursor-pointer appearance-none rounded-full border-bia-grey bg-primary-white opacity-100 checked:border-bia-blue checked:bg-bia-blue hover:border-bia-blue-hover checked:hover:bg-bia-blue-hover focus:outline-none focus-visible:ring-1 focus-visible:ring-bia-blue focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:border-none disabled:bg-bia-grey-light-80 disabled:checked:bg-bia-blue-light-50 peer-hover:border-bia-blue-hover ".concat(trackBorder), type: "checkbox" }),
|
|
3416
|
+
React.createElement("div", { className: "check-icon group peer z-10 flex-shrink-0 rounded-full bg-bia-grey text-bia-grey peer-checked:bg-primary-white peer-checked:hover:bg-primary-white peer-hover:bg-bia-blue-hover peer-checked:peer-hover:bg-primary-white peer-disabled:cursor-not-allowed peer-disabled:bg-bia-grey-dark-10 peer-disabled:peer-checked:bg-bia-blue-light-90 ".concat(knobSize, " ").concat(knobInset) })),
|
|
3417
|
+
React.createElement("label", { htmlFor: id, className: "ml-2 font-normal leading-4 text-bia-black ".concat(labelClass), style: { color: disabled ? '#8C8CA6' : '' } }, label)));
|
|
3407
3418
|
}
|
|
3408
3419
|
|
|
3409
3420
|
var isSelectedConfig = {
|