beem-component 1.3.7 → 1.4.0

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.
@@ -19,7 +19,7 @@ var _iconStyles = require("../iconStyles");
19
19
 
20
20
  var _icons = require("@material-ui/icons");
21
21
 
22
- var _excluded = ["children", "disabled", "expandIcon", "Open"],
22
+ var _excluded = ["children", "disabled", "expandIcon", "Open", "expandIconPosition"],
23
23
  _excluded2 = ["children", "leadingIcon", "trailingIcon", "size"];
24
24
 
25
25
  var _templateObject, _templateObject2, _templateObject3;
@@ -30,6 +30,12 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
30
30
 
31
31
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
32
32
 
33
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
34
+
35
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
36
+
37
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
38
+
33
39
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
34
40
 
35
41
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -85,6 +91,7 @@ var BmAccordion = function BmAccordion(_ref) {
85
91
  disabled = _ref.disabled,
86
92
  expandIcon = _ref.expandIcon,
87
93
  Open = _ref.Open,
94
+ expandIconPosition = _ref.expandIconPosition,
88
95
  rest = _objectWithoutProperties(_ref, _excluded);
89
96
 
90
97
  var _useState = (0, _react.useState)(Open ? true : false),
@@ -93,12 +100,13 @@ var BmAccordion = function BmAccordion(_ref) {
93
100
  setToggle = _useState2[1];
94
101
 
95
102
  return /*#__PURE__*/_react.default.createElement(BmAccordionWrapper, null, /*#__PURE__*/_react.default.createElement(Provider, {
96
- value: {
103
+ value: _objectSpread({
97
104
  toggle: toggle,
98
105
  setToggle: setToggle,
99
106
  disabled: disabled,
100
- expandIcon: expandIcon
101
- }
107
+ expandIcon: expandIcon,
108
+ expandIconPosition: expandIconPosition
109
+ }, rest)
102
110
  }, children));
103
111
  };
104
112
 
@@ -114,13 +122,13 @@ BmAccordion.Title = function (_ref2) {
114
122
  onClick: function onClick() {
115
123
  return !value.disabled || value.disabled === false ? value.setToggle(!value.toggle) : value.setToggle(false);
116
124
  }
117
- }), Dropdown(value, rest), leadingIcon && /*#__PURE__*/_react.default.createElement(_iconStyles.BmIcons, {
125
+ }), value.expandIconPosition === "left" || value.expandIconPosition === undefined && Dropdown(value, rest), leadingIcon && /*#__PURE__*/_react.default.createElement(_iconStyles.BmIcons, {
118
126
  icon: leadingIcon,
119
127
  size: size
120
128
  }), /*#__PURE__*/_react.default.createElement(BmAccordionDetails, null, children), trailingIcon && /*#__PURE__*/_react.default.createElement(_iconStyles.BmIcons, {
121
129
  icon: trailingIcon,
122
130
  size: size
123
- }));
131
+ }), value.expandIconPosition === "right" && Dropdown(value, rest));
124
132
  });
125
133
  };
126
134
 
@@ -135,6 +143,7 @@ BmAccordion.propTypes = {
135
143
  children: _propTypes.default.object,
136
144
  size: _propTypes.default.string,
137
145
  expandIcon: _propTypes.default.string,
146
+ expandIconPosition: _propTypes.default.string,
138
147
  leadingIcon: _propTypes.default.node,
139
148
  trailingIcon: _propTypes.default.node,
140
149
  disabled: _propTypes.default.bool,
@@ -61,6 +61,16 @@ var _default = {
61
61
  summary: undefined
62
62
  }
63
63
  },
64
+ expandIconPosition: {
65
+ options: ["left", "right"],
66
+ control: {
67
+ type: "select"
68
+ },
69
+ description: "Position of the expand Icon",
70
+ defaultValue: {
71
+ summary: "left"
72
+ }
73
+ },
64
74
  leadingIcon: {
65
75
  description: "Material-UI icon(optional)",
66
76
  defaultValue: {
@@ -81,6 +91,10 @@ var optionSize = {
81
91
  medium: "medium",
82
92
  large: "large"
83
93
  };
94
+ var optionExpandIcon = {
95
+ left: "left",
96
+ right: "medium"
97
+ };
84
98
 
85
99
  var Accordion = function Accordion() {
86
100
  return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Accordion.default, {
@@ -89,7 +103,8 @@ var Accordion = function Accordion() {
89
103
  }, /*#__PURE__*/_react.default.createElement(_Accordion.default.Title, {
90
104
  leadingIcon: /*#__PURE__*/_react.default.createElement(_icons.Home, null),
91
105
  trailingIcon: /*#__PURE__*/_react.default.createElement(_icons.Favorite, null),
92
- size: (0, _addonKnobs.select)("size", optionSize, "large")
106
+ size: (0, _addonKnobs.select)("size", optionSize, "large"),
107
+ expandIconPosition: (0, _addonKnobs.select)("expandIconPosition", optionExpandIcon, "left")
93
108
  }, /*#__PURE__*/_react.default.createElement("h3", null, (0, _addonKnobs.text)("children", "Accordion"))), /*#__PURE__*/_react.default.createElement(_Accordion.default.Body, null, "Accordion Body")));
94
109
  };
95
110
 
@@ -126,8 +126,7 @@ var BmProgressRing = function BmProgressRing(props) {
126
126
  var circleRef = (0, _react.useRef)(null);
127
127
  var size = props.size,
128
128
  progress = props.progress,
129
- variant = props.variant,
130
- children = props.children;
129
+ variant = props.variant;
131
130
  var initialMeasure = measurement(size);
132
131
  circumference = initialMeasure.circumference;
133
132
  radius = initialMeasure.radius;
@@ -31,10 +31,11 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
31
31
 
32
32
  var BmTabWrapper = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n padding: 1rem;\n background: ", ";\n box-shadow: ", ";\n > *:not(:last-child) {\n margin-right: 0.5rem;\n }\n ", "\n\n &:hover {\n box-shadow: ", ";\n }\n"])), _colors.BmPrimaryWhite, function (_ref) {
33
33
  var state = _ref.state,
34
- disabled = _ref.disabled;
34
+ disabled = _ref.disabled,
35
+ stateColor = _ref.stateColor;
35
36
 
36
37
  if (state === "active" && !disabled) {
37
- return "inset 0px -3px 0px ".concat(_colors.BmPrimaryBlue);
38
+ return "inset 0px -3px 0px ".concat(stateColor ? stateColor : _colors.BmPrimaryBlue);
38
39
  }
39
40
 
40
41
  return "none";
@@ -86,6 +87,7 @@ BmTab.propTypes = {
86
87
  leadingIcon: _propTypes.default.node,
87
88
  state: _propTypes.default.string,
88
89
  color: _propTypes.default.string,
90
+ stateColor: _propTypes.default.string,
89
91
  size: _propTypes.default.string,
90
92
  disabled: _propTypes.default.bool
91
93
  };
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports.DisabledTab = exports.BasicTab = void 0;
6
+ exports.default = exports.DisabledTab = exports.ColoredTab = exports.BasicTab = void 0;
7
7
 
8
8
  var _icons = require("@material-ui/icons");
9
9
 
@@ -31,6 +31,15 @@ var _default = {
31
31
  },
32
32
  description: "State of the Tabs (optional)"
33
33
  },
34
+ stateColor: {
35
+ control: {
36
+ type: "text"
37
+ },
38
+ description: "Color of the active state",
39
+ defaultValue: {
40
+ summary: "primary blue"
41
+ }
42
+ },
34
43
  size: {
35
44
  options: ["small", "medium", "large"],
36
45
  control: {
@@ -59,7 +68,7 @@ BasicTab.args = {
59
68
  leadingIcon: /*#__PURE__*/_react.default.createElement(_icons.Favorite, null),
60
69
  trailingIcon: /*#__PURE__*/_react.default.createElement(_icons.KeyboardArrowDown, null),
61
70
  disabled: false,
62
- state: 'active'
71
+ state: "active"
63
72
  };
64
73
  var DisabledTab = MainTab.bind({});
65
74
  exports.DisabledTab = DisabledTab;
@@ -68,4 +77,14 @@ DisabledTab.args = {
68
77
  leadingIcon: /*#__PURE__*/_react.default.createElement(_icons.Favorite, null),
69
78
  trailingIcon: /*#__PURE__*/_react.default.createElement(_icons.KeyboardArrowDown, null),
70
79
  disabled: true
80
+ };
81
+ var ColoredTab = MainTab.bind({});
82
+ exports.ColoredTab = ColoredTab;
83
+ ColoredTab.args = {
84
+ children: /*#__PURE__*/_react.default.createElement("h3", null, "Tabs"),
85
+ leadingIcon: /*#__PURE__*/_react.default.createElement(_icons.Favorite, null),
86
+ trailingIcon: /*#__PURE__*/_react.default.createElement(_icons.KeyboardArrowDown, null),
87
+ disabled: false,
88
+ state: "active",
89
+ stateColor: "red"
71
90
  };
@@ -35,16 +35,17 @@ var Wrapper = _styledComponents.default.div(_templateObject || (_templateObject
35
35
 
36
36
  var Drop = (0, _styledComponents.default)(_buttonIconsOnly.BmBtnIcon)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: ", ";\n border: 0.071rem solid\n ", ";\n border-left: 0.071rem solid\n ", ";\n border-top-left-radius: 0.071rem; */}\n border-bottom-left-radius: 0.071rem; */}\n padding: 0rem */}\n"])), function (_ref) {
37
37
  var variant = _ref.variant,
38
- disabled = _ref.disabled;
38
+ disabled = _ref.disabled,
39
+ color = _ref.color;
39
40
 
40
41
  if (!disabled) {
41
- if (variant === "primary") return "".concat(_colors.BmPrimaryBlue);
42
+ if (variant === "primary") return "".concat(color ? color : _colors.BmPrimaryBlue);
42
43
  if (variant === "secondary") return "none";
43
44
  if (variant === "tertiary") return "none";
44
45
  if (variant === "destructive") return "".concat(_colors.BmSecondaryRed);
45
46
  if (variant === "success") return "".concat(_colors.BmSecondaryDarkGreen);
46
47
  if (variant === "neutral") return "".concat(_colors.BmPrimaryWhite);
47
- return "".concat(_colors.BmPrimaryBlue);
48
+ return "".concat(color ? color : _colors.BmPrimaryBlue);
48
49
  } else {
49
50
  if (variant === "primary") return "".concat(_colors.BmGrey100);
50
51
  if (variant === "secondary") return "none";
@@ -53,16 +54,17 @@ var Drop = (0, _styledComponents.default)(_buttonIconsOnly.BmBtnIcon)(_templateO
53
54
  }
54
55
  }, function (_ref2) {
55
56
  var variant = _ref2.variant,
56
- disabled = _ref2.disabled;
57
+ disabled = _ref2.disabled,
58
+ color = _ref2.color;
57
59
 
58
60
  if (!disabled) {
59
- if (variant === "primary") return "".concat(_colors.BmPrimaryBlue);
60
- if (variant === "secondary") return "".concat(_colors.BmPrimaryBlue);
61
+ if (variant === "primary") return "".concat(color ? color : _colors.BmPrimaryBlue);
62
+ if (variant === "secondary") return "".concat(color ? color : _colors.BmPrimaryBlue);
61
63
  if (variant === "tertiary") return "transparent";
62
64
  if (variant === "destructive") return "".concat(_colors.BmSecondaryRed);
63
65
  if (variant === "success") return "".concat(_colors.BmSecondaryDarkGreen);
64
66
  if (variant === "neutral") return "".concat(_colors.BmGrey400);
65
- return "".concat(_colors.BmPrimaryBlue);
67
+ return "".concat(color ? color : _colors.BmPrimaryBlue);
66
68
  } else {
67
69
  if (variant === "primary") return "".concat(_colors.BmGrey100);
68
70
  if (variant === "secondary") return "".concat(_colors.BmGrey400);
@@ -70,11 +72,12 @@ var Drop = (0, _styledComponents.default)(_buttonIconsOnly.BmBtnIcon)(_templateO
70
72
  }
71
73
  }, function (_ref3) {
72
74
  var variant = _ref3.variant,
73
- disabled = _ref3.disabled;
75
+ disabled = _ref3.disabled,
76
+ color = _ref3.color;
74
77
 
75
78
  if (!disabled) {
76
79
  if (variant === "primary") return "".concat(_colors.BmPrimaryWhite);
77
- if (variant === "secondary") return "".concat(_colors.BmPrimaryBlue);
80
+ if (variant === "secondary") return "".concat(color ? color : _colors.BmPrimaryBlue);
78
81
  if (variant === "tertiary") return "transparent";
79
82
  if (variant === "destructive") return "".concat(_colors.BmSecondaryRed);
80
83
  if (variant === "success") return "".concat(_colors.BmSecondaryDarkGreen);
@@ -87,16 +90,7 @@ var Drop = (0, _styledComponents.default)(_buttonIconsOnly.BmBtnIcon)(_templateO
87
90
  }
88
91
  });
89
92
  exports.Drop = Drop;
90
- var Button = (0, _styledComponents.default)(_buttons.BmButton)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n border-top-right-radius: 0.071rem; */}\n border-bottom-right-radius: 0.071rem; */}\n ", "\n ", "\n border-radius: none;\n border-right: none;\n"])), ""
91
- /* padding: 0.714rem 1.143rem 0.714rem 1.714rem; */
92
- , ""
93
- /* padding: ${({ size }) => {
94
- if (size === "large") return "0.714rem 1.714rem";
95
- if (size === "medium") return "0.5rem 1.143rem";
96
- if (size === "small") return "0.429rem 0.857rem";
97
- return "0.714rem 1.714rem";
98
- }}; */
99
- );
93
+ var Button = (0, _styledComponents.default)(_buttons.BmButton)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n border-top-right-radius: 0.071rem; */}\n border-bottom-right-radius: 0.071rem; */}\n border-radius: none;\n border-right: none;\n"])));
100
94
  exports.Button = Button;
101
95
 
102
96
  var BmButtonDropDown = function BmButtonDropDown(_ref4) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beem-component",
3
- "version": "1.3.7",
3
+ "version": "1.4.0",
4
4
  "private": false,
5
5
  "main": "dist/components/index.js",
6
6
  "scripts": {
package/src/App.js CHANGED
@@ -1,76 +1,20 @@
1
1
  import React from "react";
2
2
  import "../src/main.scss";
3
- import {
4
- BmButton,
5
- BmCard,
6
- BmIcons,
7
- BmNoteBar,
8
- BmTab,
9
- BmAccordion,
10
- BmBtnIcon,
11
- MainWrapper,
12
- } from "./lib/components";
3
+ import { BmAccordion, BmTab } from "./lib/components";
13
4
  import { GlobalStyle } from "./lib/components/globalStyles";
14
5
  import "./lib/assets/css/sidebar.scss";
15
- import BmBanner from "./lib/components/BannerCard/bannerCards";
16
- import { FileCopyOutlined, Home } from "@material-ui/icons";
17
- import BmProgressRing from "./lib/components/ProgressRing/progressRing";
18
6
 
19
7
  export const App = () => {
20
8
  return (
21
9
  <>
22
10
  <GlobalStyle />
23
11
  {/* <MainWrapper> */}
24
- <BmNoteBar type="warning" color="purple">
25
- Hello
26
- </BmNoteBar>
27
- <BmButton color="purple" variant="neutral" leadingIcon={<Home />}>
28
- Hello
29
- </BmButton>
30
- <BmBtnIcon icon={<Home />} color="red" />
31
- <BmButton color="pink" variant="secondary">
32
- Hello
33
- </BmButton>
34
- <BmButton color="pink" variant="tertiary" disabled>
35
- Hello
36
- </BmButton>
37
- <BmBanner
38
- border="dashed"
39
- content="center"
40
- bannerBg="default"
41
- closeButton
42
- color="red"
43
- >
44
- <BmIcons icon={<FileCopyOutlined />} />
45
- <h3>Message Title</h3>
46
- <p>Message Text</p>
47
- <div>
48
- <BmButton variant="neutral" size="small">
49
- Label
50
- </BmButton>
51
- </div>
52
- </BmBanner>
53
- <BmCard>
54
- <BmCard.Header>
55
- <h3>Card Header</h3>
56
- </BmCard.Header>
57
- <BmCard.Body>
12
+ <BmAccordion>
13
+ <BmAccordion.Title>
58
14
  <p>Hello</p>
59
- <BmProgressRing progress="70" size="50" />
60
- </BmCard.Body>
61
- <BmCard.Footer>Card Footer</BmCard.Footer>
62
- </BmCard>
63
- <BmProgressRing progress="70" size="45" />
64
- <BmTab state="active">
65
- <h3>Tabs</h3>
66
- </BmTab>
67
- <BmNoteBar closeButton>
68
- <p>Hello</p>
69
- </BmNoteBar>
70
- <BmAccordion Open>
71
- <BmAccordion.Title>Hello</BmAccordion.Title>
72
- <BmAccordion.Body>Helloooo</BmAccordion.Body>
15
+ </BmAccordion.Title>
73
16
  </BmAccordion>
17
+ <BmTab state="active" stateColor="red">Hello</BmTab>
74
18
  {/* </MainWrapper> */}
75
19
  </>
76
20
  );
@@ -44,12 +44,12 @@ const BmAccordionWrapper = styled.div`
44
44
  flex-direction: column;
45
45
  `;
46
46
 
47
- const BmAccordion = ({ children, disabled, expandIcon, Open, ...rest }) => {
47
+ const BmAccordion = ({ children, disabled, expandIcon, Open, expandIconPosition, ...rest }) => {
48
48
  const [toggle, setToggle] = useState(Open ? true : false);
49
49
 
50
50
  return (
51
51
  <BmAccordionWrapper>
52
- <Provider value={{ toggle, setToggle, disabled, expandIcon }}>
52
+ <Provider value={{ toggle, setToggle, disabled, expandIcon, expandIconPosition, ...rest }}>
53
53
  {children}
54
54
  </Provider>
55
55
  </BmAccordionWrapper>
@@ -74,10 +74,12 @@ BmAccordion.Title = ({
74
74
  : value.setToggle(false)
75
75
  }
76
76
  >
77
- {Dropdown(value, rest)}
77
+ {value.expandIconPosition === "left" ||
78
+ (value.expandIconPosition === undefined && Dropdown(value, rest))}
78
79
  {leadingIcon && <BmIcons icon={leadingIcon} size={size} />}
79
80
  <BmAccordionDetails>{children}</BmAccordionDetails>
80
81
  {trailingIcon && <BmIcons icon={trailingIcon} size={size} />}
82
+ {value.expandIconPosition === "right" && Dropdown(value, rest)}
81
83
  </BmAccordionMenu>
82
84
  )}
83
85
  </Consumer>
@@ -94,6 +96,7 @@ BmAccordion.propTypes = {
94
96
  children: PropTypes.object,
95
97
  size: PropTypes.string,
96
98
  expandIcon: PropTypes.string,
99
+ expandIconPosition: PropTypes.string,
97
100
  leadingIcon: PropTypes.node,
98
101
  trailingIcon: PropTypes.node,
99
102
  disabled: PropTypes.bool,
@@ -33,6 +33,12 @@ export default {
33
33
  description: "'none' or Material-UI icon (optional)",
34
34
  defaultValue: { summary: undefined },
35
35
  },
36
+ expandIconPosition: {
37
+ options: ["left", "right"],
38
+ control: { type: "select" },
39
+ description: "Position of the expand Icon",
40
+ defaultValue: { summary: "left" },
41
+ },
36
42
  leadingIcon: {
37
43
  description: "Material-UI icon(optional)",
38
44
  defaultValue: { summary: undefined },
@@ -50,14 +56,27 @@ const optionSize = {
50
56
  large: "large",
51
57
  };
52
58
 
59
+ const optionExpandIcon = {
60
+ left: "left",
61
+ right: "medium",
62
+ };
63
+
53
64
  export const Accordion = () => {
54
65
  return (
55
66
  <div>
56
- <BmAccordion disabled={boolean("disabled", false)} Open={boolean("disabled", false)}>
67
+ <BmAccordion
68
+ disabled={boolean("disabled", false)}
69
+ Open={boolean("disabled", false)}
70
+ >
57
71
  <BmAccordion.Title
58
72
  leadingIcon={<Home />}
59
73
  trailingIcon={<Favorite />}
60
74
  size={select("size", optionSize, "large")}
75
+ expandIconPosition={select(
76
+ "expandIconPosition",
77
+ optionExpandIcon,
78
+ "left",
79
+ )}
61
80
  >
62
81
  <h3>{text("children", "Accordion")}</h3>
63
82
  </BmAccordion.Title>
@@ -88,7 +88,7 @@ const Text = styled.text`
88
88
  const BmProgressRing = (props) => {
89
89
  const [offset, setOffset] = useState(0);
90
90
  const circleRef = useRef(null);
91
- const { size, progress, variant, children } = props;
91
+ const { size, progress, variant } = props;
92
92
 
93
93
  const initialMeasure = measurement(size);
94
94
 
@@ -11,9 +11,9 @@ const BmTabWrapper = styled.div`
11
11
  align-items: center;
12
12
  padding: 1rem;
13
13
  background: ${BmPrimaryWhite};
14
- box-shadow: ${({ state, disabled }) => {
14
+ box-shadow: ${({ state, disabled, stateColor }) => {
15
15
  if (state === "active" && !disabled) {
16
- return `inset 0px -3px 0px ${BmPrimaryBlue}`;
16
+ return `inset 0px -3px 0px ${stateColor ? stateColor : BmPrimaryBlue}`;
17
17
  }
18
18
  return "none";
19
19
  }};
@@ -86,6 +86,7 @@ BmTab.propTypes = {
86
86
  leadingIcon: PropTypes.node,
87
87
  state: PropTypes.string,
88
88
  color: PropTypes.string,
89
+ stateColor: PropTypes.string,
89
90
  size: PropTypes.string,
90
91
  disabled: PropTypes.bool,
91
92
  };
@@ -16,6 +16,11 @@ export default {
16
16
  control: { type: "select" },
17
17
  description: "State of the Tabs (optional)",
18
18
  },
19
+ stateColor: {
20
+ control: { type: "text" },
21
+ description: "Color of the active state",
22
+ defaultValue: { summary: "primary blue" },
23
+ },
19
24
  size: {
20
25
  options: ["small", "medium", "large"],
21
26
  control: { type: "select" },
@@ -23,8 +28,7 @@ export default {
23
28
  defaultValue: { summary: "large" },
24
29
  },
25
30
  disabled: {
26
- description:
27
- "Disabled tab",
31
+ description: "Disabled tab",
28
32
  },
29
33
  },
30
34
  };
@@ -37,7 +41,7 @@ BasicTab.args = {
37
41
  leadingIcon: <Favorite />,
38
42
  trailingIcon: <KeyboardArrowDown />,
39
43
  disabled: false,
40
- state: 'active',
44
+ state: "active",
41
45
  };
42
46
 
43
47
  export const DisabledTab = MainTab.bind({});
@@ -47,3 +51,13 @@ DisabledTab.args = {
47
51
  trailingIcon: <KeyboardArrowDown />,
48
52
  disabled: true,
49
53
  };
54
+
55
+ export const ColoredTab = MainTab.bind({});
56
+ ColoredTab.args = {
57
+ children: <h3>Tabs</h3>,
58
+ leadingIcon: <Favorite />,
59
+ trailingIcon: <KeyboardArrowDown />,
60
+ disabled: false,
61
+ state: "active",
62
+ stateColor: "red",
63
+ };
@@ -19,15 +19,15 @@ const Wrapper = styled.div`
19
19
  `;
20
20
 
21
21
  export const Drop = styled(BmBtnIcon)`
22
- background: ${({ variant, disabled }) => {
22
+ background: ${({ variant, disabled, color }) => {
23
23
  if (!disabled) {
24
- if (variant === "primary") return `${BmPrimaryBlue}`;
24
+ if (variant === "primary") return `${color ? color : BmPrimaryBlue}`
25
25
  if (variant === "secondary") return "none";
26
26
  if (variant === "tertiary") return "none";
27
27
  if (variant === "destructive") return `${BmSecondaryRed}`;
28
28
  if (variant === "success") return `${BmSecondaryDarkGreen}`;
29
29
  if (variant === "neutral") return `${BmPrimaryWhite}`;
30
- return `${BmPrimaryBlue}`;
30
+ return `${color ? color : BmPrimaryBlue}`
31
31
  } else {
32
32
  if (variant === "primary") return `${BmGrey100}`;
33
33
  if (variant === "secondary") return "none";
@@ -36,15 +36,15 @@ export const Drop = styled(BmBtnIcon)`
36
36
  }
37
37
  }};
38
38
  border: 0.071rem solid
39
- ${({ variant, disabled }) => {
39
+ ${({ variant, disabled, color }) => {
40
40
  if (!disabled) {
41
- if (variant === "primary") return `${BmPrimaryBlue}`;
42
- if (variant === "secondary") return `${BmPrimaryBlue}`;
41
+ if (variant === "primary") return `${color ? color : BmPrimaryBlue}`
42
+ if (variant === "secondary") return `${color ? color : BmPrimaryBlue}`
43
43
  if (variant === "tertiary") return "transparent";
44
44
  if (variant === "destructive") return `${BmSecondaryRed}`;
45
45
  if (variant === "success") return `${BmSecondaryDarkGreen}`;
46
46
  if (variant === "neutral") return `${BmGrey400}`;
47
- return `${BmPrimaryBlue}`;
47
+ return `${color ? color : BmPrimaryBlue}`
48
48
  } else {
49
49
  if (variant === "primary") return `${BmGrey100}`;
50
50
  if (variant === "secondary") return `${BmGrey400}`;
@@ -52,10 +52,10 @@ export const Drop = styled(BmBtnIcon)`
52
52
  }
53
53
  }};
54
54
  border-left: 0.071rem solid
55
- ${({ variant, disabled }) => {
55
+ ${({ variant, disabled, color }) => {
56
56
  if (!disabled) {
57
57
  if (variant === "primary") return `${BmPrimaryWhite}`;
58
- if (variant === "secondary") return `${BmPrimaryBlue}`;
58
+ if (variant === "secondary") return `${color ? color : BmPrimaryBlue}`
59
59
  if (variant === "tertiary") return "transparent";
60
60
  if (variant === "destructive") return `${BmSecondaryRed}`;
61
61
  if (variant === "success") return `${BmSecondaryDarkGreen}`;
@@ -75,15 +75,6 @@ export const Drop = styled(BmBtnIcon)`
75
75
  export const Button = styled(BmButton)`
76
76
  border-top-right-radius: 0.071rem; */}
77
77
  border-bottom-right-radius: 0.071rem; */}
78
- ${"" /* padding: 0.714rem 1.143rem 0.714rem 1.714rem; */}
79
- ${
80
- "" /* padding: ${({ size }) => {
81
- if (size === "large") return "0.714rem 1.714rem";
82
- if (size === "medium") return "0.5rem 1.143rem";
83
- if (size === "small") return "0.429rem 0.857rem";
84
- return "0.714rem 1.714rem";
85
- }}; */
86
- }
87
78
  border-radius: none;
88
79
  border-right: none;
89
80
  `;