@mw-kit/mw-ui 1.7.12 → 1.7.13

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.
@@ -15411,25 +15411,25 @@ var DatePicker = React__default.forwardRef(function (props, ref) {
15411
15411
  DatePicker.displayName = 'DatePicker';
15412
15412
 
15413
15413
  var _templateObject$r, _templateObject2$k, _templateObject3$g, _templateObject4$d, _templateObject5$c, _templateObject6$a, _templateObject7$9;
15414
- var LabelContainer$3 = styled.div(_templateObject$r || (_templateObject$r = _taggedTemplateLiteralLoose(["\n ", "\n line-height: 14px;\n display: flex;\n align-items: center;\n"])), function (_ref) {
15414
+ var LabelContainer$3 = styled.div(_templateObject$r || (_templateObject$r = _taggedTemplateLiteralLoose(["\n ", "\n line-height: 14px;\n display: flex;\n align-items: center;\n\n ", "\n"])), function (_ref) {
15415
15415
  var theme = _ref.theme;
15416
15416
  return theme.useTypography('p');
15417
+ }, function (_ref2) {
15418
+ var required = _ref2.required;
15419
+ if (!required) return;
15420
+ return css(_templateObject2$k || (_templateObject2$k = _taggedTemplateLiteralLoose(["\n :after {\n content: '*';\n }\n "])));
15417
15421
  });
15418
- var Label$3 = styled.label(_templateObject2$k || (_templateObject2$k = _taggedTemplateLiteralLoose(["\n display: flex;\n gap: ", ";\n position: relative;\n\n ", "\n\n ", "\n\n ", "\n\n > input {\n position: absolute;\n height: 0%;\n width: 0%;\n opacity: 0;\n }\n\n > span {\n position: relative;\n width: 50px;\n height: calc(", " + 1px);\n background-color: ", ";\n border-radius: 20px;\n transition-property: background-color;\n transition-duration: 0.4s;\n transition-timing-function: ease-in-out;\n box-sizing: content-box;\n :before {\n content: '';\n transition-property: left;\n transition-duration: 0.4s;\n transition-timing-function: ease-in-out;\n position: absolute;\n border-width: 1px;\n border-style: solid;\n border-radius: 100%;\n left: 0;\n box-shadow: 0px 1px 3px ", ";\n width: calc(", " - 1px);\n height: calc(", " - 1px);\n background-color: ", ";\n }\n }\n\n > input:checked + span {\n :before {\n left: calc(100% - ", " - 1px);\n }\n }\n"])), function (_ref2) {
15419
- var theme = _ref2.theme;
15422
+ var Label$3 = styled.label(_templateObject3$g || (_templateObject3$g = _taggedTemplateLiteralLoose(["\n display: flex;\n gap: ", ";\n position: relative;\n\n ", "\n\n ", "\n\n > input {\n position: absolute;\n height: 0%;\n width: 0%;\n opacity: 0;\n }\n\n > span {\n position: relative;\n width: 50px;\n height: calc(", " + 1px);\n background-color: ", ";\n border-radius: 20px;\n transition-property: background-color;\n transition-duration: 0.4s;\n transition-timing-function: ease-in-out;\n box-sizing: content-box;\n :before {\n content: '';\n transition-property: left;\n transition-duration: 0.4s;\n transition-timing-function: ease-in-out;\n position: absolute;\n border-width: 1px;\n border-style: solid;\n border-radius: 100%;\n left: 0;\n box-shadow: 0px 1px 3px ", ";\n width: calc(", " - 1px);\n height: calc(", " - 1px);\n background-color: ", ";\n }\n }\n\n > input:checked + span {\n :before {\n left: calc(100% - ", " - 1px);\n }\n }\n"])), function (_ref3) {
15423
+ var theme = _ref3.theme;
15420
15424
  return theme.spacings.s1;
15421
- }, function (_ref3) {
15422
- var disabled = _ref3.disabled;
15425
+ }, function (_ref4) {
15426
+ var disabled = _ref4.disabled;
15423
15427
 
15424
15428
  if (!disabled) {
15425
- return css(_templateObject3$g || (_templateObject3$g = _taggedTemplateLiteralLoose(["\n > span {\n cursor: pointer;\n }\n "])));
15429
+ return css(_templateObject4$d || (_templateObject4$d = _taggedTemplateLiteralLoose(["\n > span {\n cursor: pointer;\n }\n "])));
15426
15430
  }
15427
15431
 
15428
- return css(_templateObject4$d || (_templateObject4$d = _taggedTemplateLiteralLoose(["\n opacity: 0.5;\n "])));
15429
- }, function (_ref4) {
15430
- var required = _ref4.required;
15431
- if (!required) return;
15432
- return css(_templateObject5$c || (_templateObject5$c = _taggedTemplateLiteralLoose(["\n > ", " {\n :after {\n content: '*';\n }\n }\n "])), LabelContainer$3);
15432
+ return css(_templateObject5$c || (_templateObject5$c = _taggedTemplateLiteralLoose(["\n opacity: 0.5;\n "])));
15433
15433
  }, function (_ref5) {
15434
15434
  var invalid = _ref5.invalid;
15435
15435
 
@@ -15474,18 +15474,21 @@ var Label$3 = styled.label(_templateObject2$k || (_templateObject2$k = _taggedTe
15474
15474
  });
15475
15475
 
15476
15476
  var Switch = function Switch(props) {
15477
- var label = props.label,
15478
- disabled = props.disabled,
15477
+ var disabled = props.disabled,
15479
15478
  required = props.required,
15480
15479
  invalid = props.invalid;
15480
+ var label = isObject(props.label) ? props.label : {
15481
+ label: props.label
15482
+ };
15481
15483
  var htmlProps = filterObject(props, ['label', 'invalid', 'required']);
15482
15484
  return React__default.createElement(Label$3, {
15483
15485
  disabled: disabled ? 1 : 0,
15484
- required: required ? 1 : 0,
15485
15486
  invalid: invalid ? 1 : 0
15486
- }, React__default.createElement("input", Object.assign({}, htmlProps, {
15487
+ }, label.label && React__default.createElement(LabelContainer$3, {
15488
+ required: required ? 1 : 0
15489
+ }, label.label), label.before && React__default.createElement(LabelContainer$3, null, label.before), React__default.createElement("input", Object.assign({}, htmlProps, {
15487
15490
  type: 'checkbox'
15488
- })), React__default.createElement("span", null), label && React__default.createElement(LabelContainer$3, null, label));
15491
+ })), React__default.createElement("span", null), label.after && React__default.createElement(LabelContainer$3, null, label.after));
15489
15492
  };
15490
15493
 
15491
15494
  var _templateObject$s, _templateObject2$l, _templateObject3$h, _templateObject4$e, _templateObject5$d, _templateObject6$b, _templateObject7$a, _templateObject8$7, _templateObject9$7, _templateObject10$4, _templateObject11$3, _templateObject12$2, _templateObject13$2, _templateObject14$2, _templateObject15$1, _templateObject16;