@mw-kit/mw-ui 1.7.63 → 1.7.64

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.
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { TabsProps } from './interfaces';
3
- declare const Tabs: (props: TabsProps) => JSX.Element;
3
+ declare const Tabs: (props: React.PropsWithChildren<TabsProps>) => JSX.Element;
4
4
  export default Tabs;
@@ -34,14 +34,18 @@ export interface TabsProps {
34
34
  * disable close button
35
35
  */
36
36
  alwaysOpen?: true;
37
+ /**
38
+ * border bottom style
39
+ */
40
+ delimiter?: 'blue' | 'grey' | 'none';
37
41
  }
38
42
  export interface StyledTabsProps {
39
43
  /**
40
44
  * Sets the style of the tabs to internal.
41
45
  */
42
- internal?: number;
46
+ $internal?: TabsProps['internal'];
43
47
  /**
44
48
  * Sets the style of the tab to active.
45
49
  */
46
- active?: number;
50
+ $active?: boolean;
47
51
  }
@@ -1,4 +1,9 @@
1
- import { StyledTabsProps } from './interfaces';
2
- export declare const Container: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledTabsProps, never>;
3
- export declare const Tabs: import("styled-components").StyledComponent<"ul", import("styled-components").DefaultTheme, StyledTabsProps, never>;
1
+ import { StyledTabsProps, TabsProps } from './interfaces';
2
+ export declare const Container: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
3
+ declare type TabsContainerProps = {
4
+ $internal?: TabsProps['internal'];
5
+ $delimiter?: TabsProps['delimiter'];
6
+ };
7
+ export declare const Tabs: import("styled-components").StyledComponent<"ul", import("styled-components").DefaultTheme, TabsContainerProps, never>;
4
8
  export declare const Tab: import("styled-components").StyledComponent<"li", import("styled-components").DefaultTheme, StyledTabsProps, never>;
9
+ export {};
package/dist/index.js CHANGED
@@ -18867,56 +18867,42 @@ var ProgressBar = function ProgressBar(props) {
18867
18867
  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', "%"));
18868
18868
  };
18869
18869
 
18870
- var _path$4n;
18871
-
18872
- function _extends$4w() {
18873
- _extends$4w = Object.assign ? Object.assign.bind() : function (target) {
18874
- for (var i = 1; i < arguments.length; i++) {
18875
- var source = arguments[i];
18870
+ var _templateObject$13, _templateObject2$P, _templateObject3$I, _templateObject4$v, _templateObject5$s, _templateObject6$q, _templateObject7$q;
18871
+ var Container$n = styled__default.div(_templateObject$13 || (_templateObject$13 = _taggedTemplateLiteralLoose(["\n display: block;\n"])));
18872
+ var delimiters = {
18873
+ blue: ['blue'],
18874
+ grey: ['warningGray']
18875
+ };
18876
+ var Tabs = styled__default.ul(_templateObject2$P || (_templateObject2$P = _taggedTemplateLiteralLoose(["\n user-select: none;\n list-style: none;\n display: inline-flex;\n padding: 0;\n margin: 0;\n width: 100%;\n\n ", ";\n\n gap: ", ";\n"])), function (_ref) {
18877
+ var theme = _ref.theme,
18878
+ internal = _ref.$internal,
18879
+ delimiter = _ref.$delimiter;
18876
18880
 
18877
- for (var key in source) {
18878
- if (Object.prototype.hasOwnProperty.call(source, key)) {
18879
- target[key] = source[key];
18880
- }
18881
- }
18881
+ var border = function () {
18882
+ if (delimiter === 'none') {
18883
+ return 'none';
18882
18884
  }
18883
18885
 
18884
- return target;
18885
- };
18886
- return _extends$4w.apply(this, arguments);
18887
- }
18888
-
18889
- function SvgClose(props) {
18890
- return /*#__PURE__*/React.createElement("svg", _extends$4w({
18891
- xmlns: "http://www.w3.org/2000/svg",
18892
- width: 24,
18893
- height: 24,
18894
- fill: "none",
18895
- stroke: "currentColor",
18896
- strokeWidth: 2,
18897
- strokeLinecap: "round",
18898
- strokeLinejoin: "round",
18899
- className: "close_svg__feather close_svg__feather-x"
18900
- }, props), _path$4n || (_path$4n = /*#__PURE__*/React.createElement("path", {
18901
- d: "M18 6L6 18M6 6l12 12"
18902
- })));
18903
- }
18886
+ return internal ? "1px solid " + theme.getColor.apply(theme, delimiters[delimiter || 'grey']) : "2px solid " + theme.getColor.apply(theme, delimiters[delimiter || 'blue']);
18887
+ }();
18904
18888
 
18905
- var _templateObject$13, _templateObject2$P, _templateObject3$I, _templateObject4$v, _templateObject5$s, _templateObject6$q;
18906
- var Container$n = styled__default.div(_templateObject$13 || (_templateObject$13 = _taggedTemplateLiteralLoose(["\n display: block;\n border-bottom-style: solid;\n\n ", "\n"])), function (_ref) {
18907
- var theme = _ref.theme,
18908
- internal = _ref.internal;
18909
- return styled.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);
18910
- });
18911
- var Tabs = styled__default.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) {
18889
+ return styled.css(_templateObject3$I || (_templateObject3$I = _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);
18890
+ }, function (_ref2) {
18912
18891
  var theme = _ref2.theme,
18913
- internal = _ref2.internal;
18914
- return styled.css(_templateObject4$v || (_templateObject4$v = _taggedTemplateLiteralLoose(["\n height: ", ";\n box-shadow: 0 0 10px 0 ", ";\n "])), internal ? '41px' : '49px', theme.getColor('black', 10));
18892
+ internal = _ref2.$internal;
18893
+ return internal ? theme.spacings.s6 : 0;
18915
18894
  });
18916
- var Tab = styled__default.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) {
18895
+ var Tab = styled__default.li(_templateObject4$v || (_templateObject4$v = _taggedTemplateLiteralLoose(["\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n ", "\n"])), function (_ref3) {
18917
18896
  var theme = _ref3.theme,
18918
- active = _ref3.active;
18919
- return styled.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);
18897
+ active = _ref3.$active,
18898
+ internal = _ref3.$internal;
18899
+ return styled.css(_templateObject5$s || (_templateObject5$s = _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 ? styled.css(_templateObject6$q || (_templateObject6$q = _taggedTemplateLiteralLoose(["\n border-radius: 4px 4px 0 0;\n\n > span {\n ", "\n line-height: 17px;\n }\n "])), function (_ref4) {
18900
+ var theme = _ref4.theme;
18901
+ return theme.useTypography('h4');
18902
+ }) : styled.css(_templateObject7$q || (_templateObject7$q = _taggedTemplateLiteralLoose(["\n box-shadow: 0px 3px 6px ", ";\n\n > span {\n ", "\n line-height: 19px;\n }\n "])), theme.getColor('black', 15), function (_ref5) {
18903
+ var theme = _ref5.theme;
18904
+ return theme.useTypography('h2');
18905
+ }), theme.colors[active ? 'white' : 'darkBlue']);
18920
18906
  });
18921
18907
 
18922
18908
  var initialStatus = function initialStatus(active, length) {
@@ -18927,8 +18913,7 @@ var initialStatus = function initialStatus(active, length) {
18927
18913
 
18928
18914
  var Tabs$1 = function Tabs$1(props) {
18929
18915
  var options = props.options,
18930
- activeState = props.activeState,
18931
- internal = props.internal;
18916
+ activeState = props.activeState;
18932
18917
  var active = activeState[0],
18933
18918
  setActive = activeState[1];
18934
18919
 
@@ -19014,25 +18999,32 @@ var Tabs$1 = function Tabs$1(props) {
19014
18999
  });
19015
19000
  };
19016
19001
 
19017
- var Close = props.alwaysOpen ? function () {
19018
- return null;
19019
- } : SvgClose;
19020
19002
  return React__default.createElement(Container$n, null, React__default.createElement(Tabs, {
19021
- internal: +(internal || false)
19003
+ "$internal": props.internal,
19004
+ "$delimiter": props.delimiter
19022
19005
  }, options.reduce(function (elements, tab, index) {
19023
19006
  if (status[index] === 'closed') return elements;
19024
19007
  return [].concat(elements, [React__default.createElement(Tab, {
19025
19008
  key: index,
19026
- active: +(status[index] === 'active'),
19009
+ "$active": status[index] === 'active',
19010
+ "$internal": props.internal,
19027
19011
  onClick: function onClick(event) {
19028
19012
  return onClickActivate(index, event);
19029
19013
  }
19030
- }, React__default.createElement("span", null, tab.label), React__default.createElement(Close, {
19014
+ }, React__default.createElement("span", null, tab.label), !props.alwaysOpen && React__default.createElement(Icon, {
19015
+ type: 'feather',
19016
+ icon: 'x',
19031
19017
  onClick: function onClick() {
19032
19018
  return onClickClose(index);
19033
- }
19019
+ },
19020
+ width: '14px',
19021
+ height: '14px',
19022
+ strokeWidth: '3px',
19023
+ color: status[index] === 'active' ? 'white' : 'darkBlue'
19034
19024
  }))]);
19035
- }, [])));
19025
+ }, [])), props.children && React__default.createElement("div", {
19026
+ children: props.children
19027
+ }));
19036
19028
  };
19037
19029
 
19038
19030
  var _templateObject$14;