@loja-integrada/admin-components 0.9.3 → 0.9.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/Forms/Checkbox/Checkbox.d.ts +1 -0
- package/dist/admin-components.cjs.development.js +6 -3
- package/dist/admin-components.cjs.development.js.map +1 -1
- package/dist/admin-components.cjs.production.min.js +1 -1
- package/dist/admin-components.cjs.production.min.js.map +1 -1
- package/dist/admin-components.esm.js +6 -3
- package/dist/admin-components.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/Forms/Checkbox/Checkbox.tsx +15 -8
|
@@ -1596,7 +1596,9 @@ var CheckboxComponent = function CheckboxComponent(_ref, ref) {
|
|
|
1596
1596
|
checked = _ref.checked,
|
|
1597
1597
|
disabled = _ref.disabled,
|
|
1598
1598
|
indeterminate = _ref.indeterminate,
|
|
1599
|
-
|
|
1599
|
+
_ref$boxAlign = _ref.boxAlign,
|
|
1600
|
+
boxAlign = _ref$boxAlign === void 0 ? 'center' : _ref$boxAlign,
|
|
1601
|
+
props = _objectWithoutPropertiesLoose(_ref, ["label", "id", "name", "onChange", "checked", "disabled", "indeterminate", "boxAlign"]);
|
|
1600
1602
|
|
|
1601
1603
|
var inputRef = React__default.useRef(null);
|
|
1602
1604
|
var inputId = id || name;
|
|
@@ -1609,6 +1611,7 @@ var CheckboxComponent = function CheckboxComponent(_ref, ref) {
|
|
|
1609
1611
|
isIndeterminate = _React$useState2[0],
|
|
1610
1612
|
setIsIndeterminate = _React$useState2[1];
|
|
1611
1613
|
|
|
1614
|
+
var isCenterBoxAlign = boxAlign === 'center';
|
|
1612
1615
|
React__default.useEffect(function () {
|
|
1613
1616
|
setIsChecked(!!checked);
|
|
1614
1617
|
if (checked) setIsIndeterminate(false);
|
|
@@ -1627,11 +1630,11 @@ var CheckboxComponent = function CheckboxComponent(_ref, ref) {
|
|
|
1627
1630
|
};
|
|
1628
1631
|
|
|
1629
1632
|
var checkboxIconClasses = "transition duration-200 ease-in-out " + (isChecked || isIndeterminate ? 'scale-100' : 'scale-0');
|
|
1630
|
-
var checkboxIconContainerClasses = "border border-card-stroke transition duration-200 ease-in-out
|
|
1633
|
+
var checkboxIconContainerClasses = "border border-card-stroke transition duration-200 ease-in-out\n " + (disabled ? 'bg-base-4' : isChecked || isIndeterminate ? 'bg-primary border-primary' : 'bg-base-1') + "\n " + (isCenterBoxAlign ? 'items-center' : '') + "\n rounded w-4 h-4 flex justify-center m-px\n ";
|
|
1631
1634
|
var checkboxLabelClasses = "ml-1 input-label text-f6 tracking-4 leading-6 " + (disabled ? 'text-inverted-2' : '');
|
|
1632
1635
|
return React__default.createElement("label", {
|
|
1633
1636
|
htmlFor: inputId,
|
|
1634
|
-
className: "inline-flex items-
|
|
1637
|
+
className: "inline-flex items-" + boxAlign + " cursor-pointer"
|
|
1635
1638
|
}, React__default.createElement("span", {
|
|
1636
1639
|
className: "rounded z-50 flex items-center justify-center focus-within:ring-2 ring-focus"
|
|
1637
1640
|
}, React__default.createElement("input", Object.assign({
|