@xqmsg/ui-core 0.16.5 → 0.16.7
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/theme/components/form.d.ts +1 -3
- package/dist/ui-core.cjs.development.js +15 -11
- package/dist/ui-core.cjs.development.js.map +1 -1
- package/dist/ui-core.cjs.production.min.js +1 -1
- package/dist/ui-core.cjs.production.min.js.map +1 -1
- package/dist/ui-core.esm.js +15 -11
- package/dist/ui-core.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/input/Input.stories.tsx +56 -2
- package/src/components/input/StackedCheckbox/StackedCheckbox.tsx +12 -4
- package/src/components/input/components/label/index.tsx +1 -1
- package/src/components/input/index.tsx +6 -3
- package/src/theme/components/form.ts +1 -3
package/dist/ui-core.esm.js
CHANGED
|
@@ -492,12 +492,20 @@ function Form(_ref) {
|
|
|
492
492
|
var StackedCheckbox = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref) {
|
|
493
493
|
var value = _ref2.value,
|
|
494
494
|
label = _ref2.label,
|
|
495
|
-
|
|
495
|
+
_onChange = _ref2.onChange;
|
|
496
|
+
if (value === null) return null;
|
|
496
497
|
return /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
497
498
|
ref: _ref,
|
|
498
499
|
value: String(value),
|
|
499
|
-
defaultChecked: Boolean(
|
|
500
|
-
|
|
500
|
+
defaultChecked: Boolean(value),
|
|
501
|
+
defaultValue: value,
|
|
502
|
+
onChange: function onChange(e) {
|
|
503
|
+
if (_onChange) return _onChange(e.target.checked);
|
|
504
|
+
}
|
|
505
|
+
}, /*#__PURE__*/React__default.createElement(Text$2, {
|
|
506
|
+
fontSize: "13px",
|
|
507
|
+
alignSelf: "center"
|
|
508
|
+
}, label));
|
|
501
509
|
});
|
|
502
510
|
|
|
503
511
|
function _extends$2() {
|
|
@@ -1566,8 +1574,7 @@ var Label$1 = function Label(_ref) {
|
|
|
1566
1574
|
isRequired = _ref.isRequired,
|
|
1567
1575
|
label = _ref.label;
|
|
1568
1576
|
return /*#__PURE__*/React__default.createElement(FormLabel$1, {
|
|
1569
|
-
display: "flex"
|
|
1570
|
-
alignItems: "center"
|
|
1577
|
+
display: "flex"
|
|
1571
1578
|
}, label, isRequired && /*#__PURE__*/React__default.createElement(Box, {
|
|
1572
1579
|
ml: 1,
|
|
1573
1580
|
color: colors.label.error
|
|
@@ -1689,7 +1696,6 @@ function Input(_ref) {
|
|
|
1689
1696
|
onChange: onChange,
|
|
1690
1697
|
onBlur: onBlur,
|
|
1691
1698
|
ref: ref,
|
|
1692
|
-
disabled: disabled,
|
|
1693
1699
|
value: value,
|
|
1694
1700
|
defaultValue: defaultValue,
|
|
1695
1701
|
label: label
|
|
@@ -1771,8 +1777,8 @@ function Input(_ref) {
|
|
|
1771
1777
|
id: name,
|
|
1772
1778
|
isInvalid: isInvalid,
|
|
1773
1779
|
position: "relative",
|
|
1774
|
-
py: label || helperText || isInvalid ? 6 : 0
|
|
1775
|
-
}, label && /*#__PURE__*/React__default.createElement(Label$1, {
|
|
1780
|
+
py: (label || helperText || isInvalid) && inputType !== 'checkbox' ? 6 : 0
|
|
1781
|
+
}, label && inputType !== 'checkbox' && /*#__PURE__*/React__default.createElement(Label$1, {
|
|
1776
1782
|
tooltipText: tooltipText,
|
|
1777
1783
|
label: label,
|
|
1778
1784
|
isRequired: isRequired
|
|
@@ -2445,11 +2451,9 @@ function baseStyleRequiredIndicator() {
|
|
|
2445
2451
|
|
|
2446
2452
|
function baseStyleHelperText() {
|
|
2447
2453
|
return {
|
|
2448
|
-
position: 'absolute',
|
|
2449
|
-
color: colors.label.secondary.light,
|
|
2450
2454
|
mt: 1,
|
|
2451
2455
|
ml: 1,
|
|
2452
|
-
|
|
2456
|
+
color: colors.label.secondary.light,
|
|
2453
2457
|
fontSize: '13px'
|
|
2454
2458
|
};
|
|
2455
2459
|
}
|