@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
|
@@ -1588,7 +1588,9 @@ var CheckboxComponent = function CheckboxComponent(_ref, ref) {
|
|
|
1588
1588
|
checked = _ref.checked,
|
|
1589
1589
|
disabled = _ref.disabled,
|
|
1590
1590
|
indeterminate = _ref.indeterminate,
|
|
1591
|
-
|
|
1591
|
+
_ref$boxAlign = _ref.boxAlign,
|
|
1592
|
+
boxAlign = _ref$boxAlign === void 0 ? 'center' : _ref$boxAlign,
|
|
1593
|
+
props = _objectWithoutPropertiesLoose(_ref, ["label", "id", "name", "onChange", "checked", "disabled", "indeterminate", "boxAlign"]);
|
|
1592
1594
|
|
|
1593
1595
|
var inputRef = React.useRef(null);
|
|
1594
1596
|
var inputId = id || name;
|
|
@@ -1601,6 +1603,7 @@ var CheckboxComponent = function CheckboxComponent(_ref, ref) {
|
|
|
1601
1603
|
isIndeterminate = _React$useState2[0],
|
|
1602
1604
|
setIsIndeterminate = _React$useState2[1];
|
|
1603
1605
|
|
|
1606
|
+
var isCenterBoxAlign = boxAlign === 'center';
|
|
1604
1607
|
React.useEffect(function () {
|
|
1605
1608
|
setIsChecked(!!checked);
|
|
1606
1609
|
if (checked) setIsIndeterminate(false);
|
|
@@ -1619,11 +1622,11 @@ var CheckboxComponent = function CheckboxComponent(_ref, ref) {
|
|
|
1619
1622
|
};
|
|
1620
1623
|
|
|
1621
1624
|
var checkboxIconClasses = "transition duration-200 ease-in-out " + (isChecked || isIndeterminate ? 'scale-100' : 'scale-0');
|
|
1622
|
-
var checkboxIconContainerClasses = "border border-card-stroke transition duration-200 ease-in-out
|
|
1625
|
+
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 ";
|
|
1623
1626
|
var checkboxLabelClasses = "ml-1 input-label text-f6 tracking-4 leading-6 " + (disabled ? 'text-inverted-2' : '');
|
|
1624
1627
|
return React.createElement("label", {
|
|
1625
1628
|
htmlFor: inputId,
|
|
1626
|
-
className: "inline-flex items-
|
|
1629
|
+
className: "inline-flex items-" + boxAlign + " cursor-pointer"
|
|
1627
1630
|
}, React.createElement("span", {
|
|
1628
1631
|
className: "rounded z-50 flex items-center justify-center focus-within:ring-2 ring-focus"
|
|
1629
1632
|
}, React.createElement("input", Object.assign({
|