@mw-kit/mw-ui 1.7.11 → 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.
@@ -12604,6 +12604,15 @@ var Tabs$1 = function Tabs$1(props) {
12604
12604
  });
12605
12605
  };
12606
12606
 
12607
+ var getClose = props.alwaysOpen ? function () {
12608
+ return undefined;
12609
+ } : function (index) {
12610
+ return React__default.createElement(SvgClose, {
12611
+ onClick: function onClick() {
12612
+ return removeTab(index);
12613
+ }
12614
+ });
12615
+ };
12607
12616
  return React__default.createElement(Container$6, null, React__default.createElement(Tabs, {
12608
12617
  internal: +(internal || false)
12609
12618
  }, tabs.map(function (tab, index) {
@@ -12613,11 +12622,7 @@ var Tabs$1 = function Tabs$1(props) {
12613
12622
  onClick: function onClick(event) {
12614
12623
  return updateActiveTab(index, event);
12615
12624
  }
12616
- }, React__default.createElement("span", null, tab.label), React__default.createElement(SvgClose, {
12617
- onClick: function onClick() {
12618
- return removeTab(index);
12619
- }
12620
- }));
12625
+ }, React__default.createElement("span", null, tab.label), getClose(index));
12621
12626
  })));
12622
12627
  };
12623
12628
 
@@ -15406,25 +15411,25 @@ var DatePicker = React__default.forwardRef(function (props, ref) {
15406
15411
  DatePicker.displayName = 'DatePicker';
15407
15412
 
15408
15413
  var _templateObject$r, _templateObject2$k, _templateObject3$g, _templateObject4$d, _templateObject5$c, _templateObject6$a, _templateObject7$9;
15409
- 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) {
15410
15415
  var theme = _ref.theme;
15411
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 "])));
15412
15421
  });
15413
- 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) {
15414
- 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;
15415
15424
  return theme.spacings.s1;
15416
- }, function (_ref3) {
15417
- var disabled = _ref3.disabled;
15425
+ }, function (_ref4) {
15426
+ var disabled = _ref4.disabled;
15418
15427
 
15419
15428
  if (!disabled) {
15420
- 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 "])));
15421
15430
  }
15422
15431
 
15423
- return css(_templateObject4$d || (_templateObject4$d = _taggedTemplateLiteralLoose(["\n opacity: 0.5;\n "])));
15424
- }, function (_ref4) {
15425
- var required = _ref4.required;
15426
- if (!required) return;
15427
- 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 "])));
15428
15433
  }, function (_ref5) {
15429
15434
  var invalid = _ref5.invalid;
15430
15435
 
@@ -15469,18 +15474,21 @@ var Label$3 = styled.label(_templateObject2$k || (_templateObject2$k = _taggedTe
15469
15474
  });
15470
15475
 
15471
15476
  var Switch = function Switch(props) {
15472
- var label = props.label,
15473
- disabled = props.disabled,
15477
+ var disabled = props.disabled,
15474
15478
  required = props.required,
15475
15479
  invalid = props.invalid;
15480
+ var label = isObject(props.label) ? props.label : {
15481
+ label: props.label
15482
+ };
15476
15483
  var htmlProps = filterObject(props, ['label', 'invalid', 'required']);
15477
15484
  return React__default.createElement(Label$3, {
15478
15485
  disabled: disabled ? 1 : 0,
15479
- required: required ? 1 : 0,
15480
15486
  invalid: invalid ? 1 : 0
15481
- }, 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, {
15482
15490
  type: 'checkbox'
15483
- })), 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));
15484
15492
  };
15485
15493
 
15486
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;