@mw-kit/mw-ui 1.7.63 → 1.7.65

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.
@@ -18864,56 +18864,57 @@ var ProgressBar = function ProgressBar(props) {
18864
18864
  return React__default.createElement(Container$m, null, React__default.createElement(Progress, Object.assign({}, props), React__default.createElement("div", null)), React__default.createElement("span", null, " ", props.value || '0', "%"));
18865
18865
  };
18866
18866
 
18867
- var _path$4n;
18867
+ var _templateObject$13, _templateObject2$P, _templateObject3$I, _templateObject4$v, _templateObject5$s, _templateObject6$q, _templateObject7$q, _templateObject8$m;
18868
+ var Container$n = styled.div(_templateObject$13 || (_templateObject$13 = _taggedTemplateLiteralLoose(["\n display: block;\n"])));
18869
+ var delimiters = {
18870
+ blue: ['blue'],
18871
+ grey: ['warningGray']
18872
+ };
18873
+ var Tabs = styled.ul(_templateObject2$P || (_templateObject2$P = _taggedTemplateLiteralLoose(["\n user-select: none;\n list-style: none;\n display: inline-flex;\n width: 100%;\n\n ", "\n\n ", ";\n\n gap: ", ";\n"])), function (_ref) {
18874
+ var spacing = _ref.$spacing;
18868
18875
 
18869
- function _extends$4w() {
18870
- _extends$4w = Object.assign ? Object.assign.bind() : function (target) {
18871
- for (var i = 1; i < arguments.length; i++) {
18872
- var source = arguments[i];
18876
+ var _getSpacings$split = getSpacings(spacing || {}, {
18877
+ top: '0',
18878
+ right: '0',
18879
+ bottom: 's4',
18880
+ left: '0'
18881
+ }).split(' '),
18882
+ top = _getSpacings$split[0],
18883
+ right = _getSpacings$split[1],
18884
+ bottom = _getSpacings$split[2],
18885
+ left = _getSpacings$split[3];
18886
+
18887
+ return css(_templateObject3$I || (_templateObject3$I = _taggedTemplateLiteralLoose(["\n margin: ", " 0 ", " 0;\n padding: 0 ", " 0 ", ";\n "])), top, bottom, right, left);
18888
+ }, function (_ref2) {
18889
+ var theme = _ref2.theme,
18890
+ internal = _ref2.$internal,
18891
+ delimiter = _ref2.$delimiter;
18873
18892
 
18874
- for (var key in source) {
18875
- if (Object.prototype.hasOwnProperty.call(source, key)) {
18876
- target[key] = source[key];
18877
- }
18878
- }
18893
+ var border = function () {
18894
+ if (delimiter === 'none') {
18895
+ return 'none';
18879
18896
  }
18880
18897
 
18881
- return target;
18882
- };
18883
- return _extends$4w.apply(this, arguments);
18884
- }
18885
-
18886
- function SvgClose(props) {
18887
- return /*#__PURE__*/createElement("svg", _extends$4w({
18888
- xmlns: "http://www.w3.org/2000/svg",
18889
- width: 24,
18890
- height: 24,
18891
- fill: "none",
18892
- stroke: "currentColor",
18893
- strokeWidth: 2,
18894
- strokeLinecap: "round",
18895
- strokeLinejoin: "round",
18896
- className: "close_svg__feather close_svg__feather-x"
18897
- }, props), _path$4n || (_path$4n = /*#__PURE__*/createElement("path", {
18898
- d: "M18 6L6 18M6 6l12 12"
18899
- })));
18900
- }
18898
+ return internal ? "1px solid " + theme.getColor.apply(theme, delimiters[delimiter || 'grey']) : "2px solid " + theme.getColor.apply(theme, delimiters[delimiter || 'blue']);
18899
+ }();
18901
18900
 
18902
- var _templateObject$13, _templateObject2$P, _templateObject3$I, _templateObject4$v, _templateObject5$s, _templateObject6$q;
18903
- var Container$n = styled.div(_templateObject$13 || (_templateObject$13 = _taggedTemplateLiteralLoose(["\n display: block;\n border-bottom-style: solid;\n\n ", "\n"])), function (_ref) {
18904
- var theme = _ref.theme,
18905
- internal = _ref.internal;
18906
- return css(_templateObject2$P || (_templateObject2$P = _taggedTemplateLiteralLoose(["\n margin-bottom: ", ";\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "])), theme.spacings.s2, internal ? '1px' : '2px', internal ? theme.getColor('lightestGrey', 50) : theme.colors.blue);
18907
- });
18908
- var Tabs = styled.ul(_templateObject3$I || (_templateObject3$I = _taggedTemplateLiteralLoose(["\n user-select: none;\n list-style: none;\n display: inline-flex;\n gap: 1px;\n padding: 0;\n margin: 0;\n\n ", "\n"])), function (_ref2) {
18909
- var theme = _ref2.theme,
18910
- internal = _ref2.internal;
18911
- return css(_templateObject4$v || (_templateObject4$v = _taggedTemplateLiteralLoose(["\n height: ", ";\n box-shadow: 0 0 10px 0 ", ";\n "])), internal ? '41px' : '49px', theme.getColor('black', 10));
18912
- });
18913
- var Tab = styled.li(_templateObject5$s || (_templateObject5$s = _taggedTemplateLiteralLoose(["\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-radius: 4px 4px 0 0;\n\n svg {\n transform: scale(calc(18 / 24));\n stroke-width: 2px;\n }\n\n ", "\n"])), function (_ref3) {
18901
+ return css(_templateObject4$v || (_templateObject4$v = _taggedTemplateLiteralLoose(["\n border-bottom: ", ";\n\n + div {\n border: 1px solid ", ";\n border-top-width: 0px;\n border-radius: 0px 0px 2px 2px;\n padding: ", ";\n }\n "])), border, theme.getColor.apply(theme, delimiters.grey), theme.spacings.s3);
18902
+ }, function (_ref3) {
18914
18903
  var theme = _ref3.theme,
18915
- active = _ref3.active;
18916
- return css(_templateObject6$q || (_templateObject6$q = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n padding: 0 ", ";\n gap: ", ";\n\n span {\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n\n color: ", ";\n }\n\n svg {\n stroke: ", ";\n\n &:hover {\n stroke: ", ";\n }\n }\n "])), theme.colors[active ? 'blue' : 'white'], theme.spacings.s2, theme.spacings.s2, theme.typographies.h2.fontFamily, theme.typographies.h2.fontSize, theme.typographies.h2.fontWeight, theme.colors[active ? 'white' : 'darkBlue'], theme.colors[active ? 'white' : 'darkBlue'], theme.colors.red);
18904
+ internal = _ref3.$internal;
18905
+ return internal ? theme.spacings.s6 : 0;
18906
+ });
18907
+ var Tab = styled.li(_templateObject5$s || (_templateObject5$s = _taggedTemplateLiteralLoose(["\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n ", "\n"])), function (_ref4) {
18908
+ var theme = _ref4.theme,
18909
+ active = _ref4.$active,
18910
+ internal = _ref4.$internal;
18911
+ return css(_templateObject6$q || (_templateObject6$q = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n padding: ", ";\n gap: ", ";\n\n ", "\n\n span {\n color: ", ";\n }\n "])), theme.colors[active ? 'blue' : 'white'], theme.spacings.s3, theme.spacings.s3, internal ? css(_templateObject7$q || (_templateObject7$q = _taggedTemplateLiteralLoose(["\n border-radius: 4px 4px 0 0;\n\n > span {\n ", "\n line-height: 17px;\n }\n "])), function (_ref5) {
18912
+ var theme = _ref5.theme;
18913
+ return theme.useTypography('h4');
18914
+ }) : css(_templateObject8$m || (_templateObject8$m = _taggedTemplateLiteralLoose(["\n box-shadow: 0px 3px 6px ", ";\n\n > span {\n ", "\n line-height: 19px;\n }\n "])), theme.getColor('black', 15), function (_ref6) {
18915
+ var theme = _ref6.theme;
18916
+ return theme.useTypography('h2');
18917
+ }), theme.colors[active ? 'white' : 'darkBlue']);
18917
18918
  });
18918
18919
 
18919
18920
  var initialStatus = function initialStatus(active, length) {
@@ -18924,8 +18925,7 @@ var initialStatus = function initialStatus(active, length) {
18924
18925
 
18925
18926
  var Tabs$1 = function Tabs$1(props) {
18926
18927
  var options = props.options,
18927
- activeState = props.activeState,
18928
- internal = props.internal;
18928
+ activeState = props.activeState;
18929
18929
  var active = activeState[0],
18930
18930
  setActive = activeState[1];
18931
18931
 
@@ -19011,25 +19011,34 @@ var Tabs$1 = function Tabs$1(props) {
19011
19011
  });
19012
19012
  };
19013
19013
 
19014
- var Close = props.alwaysOpen ? function () {
19015
- return null;
19016
- } : SvgClose;
19017
- return React__default.createElement(Container$n, null, React__default.createElement(Tabs, {
19018
- internal: +(internal || false)
19014
+ var divProps = filterObject(props, ['options', 'activeState', 'internal', 'maxTabs', 'onMaxTabsExceeded', 'alwaysOpen', 'delimiter', 'spacing']);
19015
+ return React__default.createElement(Container$n, Object.assign({}, divProps), React__default.createElement(Tabs, {
19016
+ "$internal": props.internal,
19017
+ "$delimiter": props.delimiter,
19018
+ "$spacing": props.spacing
19019
19019
  }, options.reduce(function (elements, tab, index) {
19020
19020
  if (status[index] === 'closed') return elements;
19021
19021
  return [].concat(elements, [React__default.createElement(Tab, {
19022
19022
  key: index,
19023
- active: +(status[index] === 'active'),
19023
+ "$active": status[index] === 'active',
19024
+ "$internal": props.internal,
19024
19025
  onClick: function onClick(event) {
19025
19026
  return onClickActivate(index, event);
19026
19027
  }
19027
- }, React__default.createElement("span", null, tab.label), React__default.createElement(Close, {
19028
+ }, React__default.createElement("span", null, tab.label), !props.alwaysOpen && React__default.createElement(Icon, {
19029
+ type: 'feather',
19030
+ icon: 'x',
19028
19031
  onClick: function onClick() {
19029
19032
  return onClickClose(index);
19030
- }
19033
+ },
19034
+ width: '14px',
19035
+ height: '14px',
19036
+ strokeWidth: '3px',
19037
+ color: status[index] === 'active' ? 'white' : 'darkBlue'
19031
19038
  }))]);
19032
- }, [])));
19039
+ }, [])), props.children && React__default.createElement("div", {
19040
+ children: props.children
19041
+ }));
19033
19042
  };
19034
19043
 
19035
19044
  var _templateObject$14;