beem-component 0.9.5 → 0.9.9
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.
- package/dist/components/Accordicon.js +51 -0
- package/dist/components/Accordion.js +138 -0
- package/dist/components/CustomerInfo/infoAccordion.js +1 -3
- package/dist/components/CustomerInfo/labelsInfo.js +37 -0
- package/dist/components/CustomerInfo/notesInfo.js +2 -6
- package/dist/components/Modals/noteModalFooter.js +3 -1
- package/dist/components/globalStyles.js +1 -1
- package/dist/components/index.js +51 -7
- package/dist/components/tags.js +4 -3
- package/dist/components/text.js +4 -2
- package/package.json +2 -2
- package/src/App.js +10 -1
- package/src/examples/CustomerInfo.js +107 -5
- package/src/lib/components/Accordicon.js +43 -0
- package/src/lib/components/Accordion.js +103 -0
- package/src/lib/components/CustomerInfo/infoAccordion.js +0 -1
- package/src/lib/components/CustomerInfo/labelsInfo.js +37 -0
- package/src/lib/components/CustomerInfo/notesInfo.js +0 -2
- package/src/lib/components/Modals/noteModalFooter.js +1 -1
- package/src/lib/components/globalStyles.js +2 -1
- package/src/lib/components/index.js +17 -3
- package/src/lib/components/tags.js +5 -4
- package/src/lib/components/text.js +7 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BmAccordicon = exports.BmAccordiconDetails = exports.BmAccordiconMenu = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
+
|
|
12
|
+
var _colors = require("./colors");
|
|
13
|
+
|
|
14
|
+
var _iconStyles = require("./iconStyles");
|
|
15
|
+
|
|
16
|
+
var _excluded = ["children", "isOpen", "dropdown", "trailingIcon"];
|
|
17
|
+
|
|
18
|
+
var _templateObject, _templateObject2;
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
23
|
+
|
|
24
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
25
|
+
|
|
26
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
27
|
+
|
|
28
|
+
var BmAccordiconMenu = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n ", "\n padding: 0.571rem 1.143rem;\n background: ", ";\n box-shadow: ", ";\n > *:not(:last-child) {\n margin-right: 0.5rem;\n }\n"])), ""
|
|
29
|
+
/* justify-content: space-between; */
|
|
30
|
+
, _colors.BmPrimaryWhite, function (isOpen) {
|
|
31
|
+
if (isOpen) return "inset 0rem 0.071rem 0rem ".concat(_colors.BmGrey400);
|
|
32
|
+
return "inset 0rem -0.071rem 0rem ".concat(_colors.BmGrey400, ", inset 0rem 0.071rem 0rem ").concat(_colors.BmGrey400, ";");
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
exports.BmAccordiconMenu = BmAccordiconMenu;
|
|
36
|
+
|
|
37
|
+
var BmAccordiconDetails = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n width: 100%;\n"])));
|
|
38
|
+
|
|
39
|
+
exports.BmAccordiconDetails = BmAccordiconDetails;
|
|
40
|
+
|
|
41
|
+
var BmAccordicon = function BmAccordicon(_ref) {
|
|
42
|
+
var children = _ref.children,
|
|
43
|
+
isOpen = _ref.isOpen,
|
|
44
|
+
dropdown = _ref.dropdown,
|
|
45
|
+
trailingIcon = _ref.trailingIcon,
|
|
46
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
47
|
+
|
|
48
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(BmAccordiconMenu, rest, dropdown && (isOpen ? /*#__PURE__*/_react.default.createElement(_iconStyles.BmDropupIcon, rest) : /*#__PURE__*/_react.default.createElement(_iconStyles.BmDropdownIcon, rest)), /*#__PURE__*/_react.default.createElement(BmAccordiconDetails, null, children)));
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
exports.BmAccordicon = BmAccordicon;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
|
|
16
|
+
var _colors = require("./colors");
|
|
17
|
+
|
|
18
|
+
var _iconStyles = require("./iconStyles");
|
|
19
|
+
|
|
20
|
+
var _excluded = ["children", "disabled", "expandIcon"],
|
|
21
|
+
_excluded2 = ["children", "leadingIcon", "trailingIcon", "size"];
|
|
22
|
+
|
|
23
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
24
|
+
|
|
25
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
|
+
|
|
27
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
28
|
+
|
|
29
|
+
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; }
|
|
30
|
+
|
|
31
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
32
|
+
|
|
33
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
34
|
+
|
|
35
|
+
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."); }
|
|
36
|
+
|
|
37
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
38
|
+
|
|
39
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
40
|
+
|
|
41
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
42
|
+
|
|
43
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
44
|
+
|
|
45
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
46
|
+
|
|
47
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
48
|
+
|
|
49
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
50
|
+
|
|
51
|
+
var _React$createContext = /*#__PURE__*/_react.default.createContext({}),
|
|
52
|
+
Provider = _React$createContext.Provider,
|
|
53
|
+
Consumer = _React$createContext.Consumer;
|
|
54
|
+
|
|
55
|
+
var Dropdown = function Dropdown(value, rest) {
|
|
56
|
+
if (value.expandIcon && value.expandIcon === "none") {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (!value.expandIcon) {
|
|
61
|
+
return value.toggle ? /*#__PURE__*/_react.default.createElement(_iconStyles.BmDropupIcon, rest) : /*#__PURE__*/_react.default.createElement(_iconStyles.BmDropdownIcon, rest);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (value.expandIcon && value.expandIcon !== "none") {
|
|
65
|
+
return /*#__PURE__*/_react.default.createElement(_iconStyles.BmIcons, {
|
|
66
|
+
icon: value.expandIcon
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
var BmAccordionMenu = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n flex-direction: row;\n ", "\n padding: 0.571rem 1.143rem;\n border: 1px solid \n background: ", ";\n > *:not(:last-child) {\n margin-right: 0.5rem;\n }\n"])), ""
|
|
72
|
+
/* padding: 0.571rem; */
|
|
73
|
+
, _colors.BmPrimaryWhite);
|
|
74
|
+
|
|
75
|
+
var BmAccordionDetails = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n width: 100%;\n"])));
|
|
76
|
+
|
|
77
|
+
var BmAccordionWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n"])));
|
|
78
|
+
|
|
79
|
+
var BmAccordion = function BmAccordion(_ref) {
|
|
80
|
+
var children = _ref.children,
|
|
81
|
+
disabled = _ref.disabled,
|
|
82
|
+
expandIcon = _ref.expandIcon,
|
|
83
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
84
|
+
|
|
85
|
+
var _useState = (0, _react.useState)(false),
|
|
86
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
87
|
+
toggle = _useState2[0],
|
|
88
|
+
setToggle = _useState2[1];
|
|
89
|
+
|
|
90
|
+
return /*#__PURE__*/_react.default.createElement(BmAccordionWrapper, null, /*#__PURE__*/_react.default.createElement(Provider, {
|
|
91
|
+
value: {
|
|
92
|
+
toggle: toggle,
|
|
93
|
+
setToggle: setToggle,
|
|
94
|
+
disabled: disabled,
|
|
95
|
+
expandIcon: expandIcon
|
|
96
|
+
}
|
|
97
|
+
}, children));
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
BmAccordion.Title = function (_ref2) {
|
|
101
|
+
var children = _ref2.children,
|
|
102
|
+
leadingIcon = _ref2.leadingIcon,
|
|
103
|
+
trailingIcon = _ref2.trailingIcon,
|
|
104
|
+
size = _ref2.size,
|
|
105
|
+
rest = _objectWithoutProperties(_ref2, _excluded2);
|
|
106
|
+
|
|
107
|
+
return /*#__PURE__*/_react.default.createElement(Consumer, null, function (value) {
|
|
108
|
+
return /*#__PURE__*/_react.default.createElement(BmAccordionMenu, _extends({}, rest, {
|
|
109
|
+
onClick: function onClick() {
|
|
110
|
+
return !value.disabled || value.disabled === false ? value.setToggle(!value.toggle) : value.setToggle(false);
|
|
111
|
+
}
|
|
112
|
+
}), Dropdown(value, rest), leadingIcon && /*#__PURE__*/_react.default.createElement(_iconStyles.BmIcons, {
|
|
113
|
+
icon: leadingIcon,
|
|
114
|
+
size: size
|
|
115
|
+
}), /*#__PURE__*/_react.default.createElement(BmAccordionDetails, null, children), trailingIcon && /*#__PURE__*/_react.default.createElement(_iconStyles.BmIcons, {
|
|
116
|
+
icon: trailingIcon,
|
|
117
|
+
size: size
|
|
118
|
+
}));
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
BmAccordion.Body = function (_ref3) {
|
|
123
|
+
var children = _ref3.children;
|
|
124
|
+
return /*#__PURE__*/_react.default.createElement(Consumer, null, function (value) {
|
|
125
|
+
return value.toggle && /*#__PURE__*/_react.default.createElement("div", null, children);
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
BmAccordion.propTypes = {
|
|
130
|
+
children: _propTypes.default.object,
|
|
131
|
+
size: _propTypes.default.string,
|
|
132
|
+
expandIcon: _propTypes.default.string,
|
|
133
|
+
leadingIcon: _propTypes.default.node,
|
|
134
|
+
trailingIcon: _propTypes.default.node,
|
|
135
|
+
disabled: _propTypes.default.bool
|
|
136
|
+
};
|
|
137
|
+
var _default = BmAccordion;
|
|
138
|
+
exports.default = _default;
|
|
@@ -69,9 +69,7 @@ var BmInfoContentItem = _styledComponents.default.div(_templateObject7 || (_temp
|
|
|
69
69
|
|
|
70
70
|
exports.BmInfoContentItem = BmInfoContentItem;
|
|
71
71
|
|
|
72
|
-
var BmInfoContentLabel = _styledComponents.default.h4(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n color: ", ";\n margin: 0rem;\n
|
|
73
|
-
/* padding: 0rem; */
|
|
74
|
-
);
|
|
72
|
+
var BmInfoContentLabel = _styledComponents.default.h4(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n color: ", ";\n margin: 0rem;\n text-align: left;\n width: 50%;\n overflow: hidden;\n text-overflow: ellipsis;\n"])), _colors.BmPrimaryBlack);
|
|
75
73
|
|
|
76
74
|
exports.BmInfoContentLabel = BmInfoContentLabel;
|
|
77
75
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BmLabelInfo = exports.BmColorLabelPicker = exports.BmColorLabel = exports.BmLabels = exports.BmAddLabel = void 0;
|
|
7
|
+
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
+
|
|
10
|
+
var _input = require("../input");
|
|
11
|
+
|
|
12
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
17
|
+
|
|
18
|
+
var BmAddLabel = (0, _styledComponents.default)(_input.BmInput)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n margin-bottom: 0.5rem;\n"])));
|
|
19
|
+
exports.BmAddLabel = BmAddLabel;
|
|
20
|
+
|
|
21
|
+
var BmLabels = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n width: 100%;\n flex-wrap: wrap;\n"])));
|
|
22
|
+
|
|
23
|
+
exports.BmLabels = BmLabels;
|
|
24
|
+
|
|
25
|
+
var BmColorLabel = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n"])));
|
|
26
|
+
|
|
27
|
+
exports.BmColorLabel = BmColorLabel;
|
|
28
|
+
|
|
29
|
+
var BmColorLabelPicker = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: 1.429rem;\n height: 1.429rem;\n border-radius: 50%;\n margin: 0.5rem;\n background: ", ";\n"])), function (props) {
|
|
30
|
+
return props.color ? props.color : "green";
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
exports.BmColorLabelPicker = BmColorLabelPicker;
|
|
34
|
+
|
|
35
|
+
var BmLabelInfo = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n width: 100%;\n > *:not(:first-child) {\n margin-top: 1.143rem;\n }\n"])));
|
|
36
|
+
|
|
37
|
+
exports.BmLabelInfo = BmLabelInfo;
|
|
@@ -30,14 +30,10 @@ var BmNote = _styledComponents.default.div(_templateObject3 || (_templateObject3
|
|
|
30
30
|
|
|
31
31
|
exports.BmNote = BmNote;
|
|
32
32
|
|
|
33
|
-
var BmNoteDetails = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n margin-top: 0.857rem;\n width: 50%;\n
|
|
34
|
-
/* padding: 1rem 1.143rem; */
|
|
35
|
-
);
|
|
33
|
+
var BmNoteDetails = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n margin-top: 0.857rem;\n width: 50%;\n"])));
|
|
36
34
|
|
|
37
35
|
exports.BmNoteDetails = BmNoteDetails;
|
|
38
36
|
|
|
39
|
-
var BmNoteFooter = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n margin-top: 0.857rem;\n width: 100%;\n > * {\n &:last-child {\n margin-left: auto;\n }\n }\n
|
|
40
|
-
/* padding: 1rem 1.143rem; */
|
|
41
|
-
);
|
|
37
|
+
var BmNoteFooter = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n margin-top: 0.857rem;\n width: 100%;\n > * {\n &:last-child {\n margin-left: auto;\n }\n }\n"])));
|
|
42
38
|
|
|
43
39
|
exports.BmNoteFooter = BmNoteFooter;
|
|
@@ -17,6 +17,8 @@ var ModalFooter = _styledComponents.default.div(_templateObject || (_templateObj
|
|
|
17
17
|
|
|
18
18
|
exports.ModalFooter = ModalFooter;
|
|
19
19
|
|
|
20
|
-
var BmFooterButtons = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n margin-left: auto;\n
|
|
20
|
+
var BmFooterButtons = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n margin-left: auto;\n ", "\n align-items: center;\n justify-content: space-between;\n"])), ''
|
|
21
|
+
/* width: 50%; */
|
|
22
|
+
);
|
|
21
23
|
|
|
22
24
|
exports.BmFooterButtons = BmFooterButtons;
|
|
@@ -13,5 +13,5 @@ var _templateObject;
|
|
|
13
13
|
|
|
14
14
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
15
15
|
|
|
16
|
-
var GlobalStyle = (0, _styledComponents.createGlobalStyle)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n* { font-size: 14px;}\n h1 { ", " }\n h2 { ", " }\n h3 { ", " }\n h4 { ", " }\n p { ", " }\n input {", "}\n"])), _text.h1, _text.h2, _text.h3, _text.h4, _text.p, _text.input);
|
|
16
|
+
var GlobalStyle = (0, _styledComponents.createGlobalStyle)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n* { font-size: 14px;}\n h1 { ", " }\n h2 { ", " }\n h3 { ", " }\n h4 { ", " }\n p { ", " }\n input {", "}\n a {", "}\n"])), _text.h1, _text.h2, _text.h3, _text.h4, _text.p, _text.input, _text.a);
|
|
17
17
|
exports.GlobalStyle = GlobalStyle;
|
package/dist/components/index.js
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "BmAccordion", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _Accordion.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
6
12
|
Object.defineProperty(exports, "BmAvatar", {
|
|
7
13
|
enumerable: true,
|
|
8
14
|
get: function get() {
|
|
@@ -333,12 +339,6 @@ Object.defineProperty(exports, "BmMessageTabInput", {
|
|
|
333
339
|
return _chatInput.BmMessageTabInput;
|
|
334
340
|
}
|
|
335
341
|
});
|
|
336
|
-
Object.defineProperty(exports, "BmSendIcon", {
|
|
337
|
-
enumerable: true,
|
|
338
|
-
get: function get() {
|
|
339
|
-
return _chatInput.BmSendIcon;
|
|
340
|
-
}
|
|
341
|
-
});
|
|
342
342
|
Object.defineProperty(exports, "BmSend", {
|
|
343
343
|
enumerable: true,
|
|
344
344
|
get: function get() {
|
|
@@ -1149,6 +1149,44 @@ Object.defineProperty(exports, "BmNoteDetails", {
|
|
|
1149
1149
|
return _notesInfo.BmNoteDetails;
|
|
1150
1150
|
}
|
|
1151
1151
|
});
|
|
1152
|
+
Object.defineProperty(exports, "BmAddLabel", {
|
|
1153
|
+
enumerable: true,
|
|
1154
|
+
get: function get() {
|
|
1155
|
+
return _labelsInfo.BmAddLabel;
|
|
1156
|
+
}
|
|
1157
|
+
});
|
|
1158
|
+
Object.defineProperty(exports, "BmLabelInfo", {
|
|
1159
|
+
enumerable: true,
|
|
1160
|
+
get: function get() {
|
|
1161
|
+
return _labelsInfo.BmLabelInfo;
|
|
1162
|
+
}
|
|
1163
|
+
});
|
|
1164
|
+
Object.defineProperty(exports, "BmLabels", {
|
|
1165
|
+
enumerable: true,
|
|
1166
|
+
get: function get() {
|
|
1167
|
+
return _labelsInfo.BmLabels;
|
|
1168
|
+
}
|
|
1169
|
+
});
|
|
1170
|
+
Object.defineProperty(exports, "BmColorLabel", {
|
|
1171
|
+
enumerable: true,
|
|
1172
|
+
get: function get() {
|
|
1173
|
+
return _labelsInfo.BmColorLabel;
|
|
1174
|
+
}
|
|
1175
|
+
});
|
|
1176
|
+
Object.defineProperty(exports, "BmColorLabelPicker", {
|
|
1177
|
+
enumerable: true,
|
|
1178
|
+
get: function get() {
|
|
1179
|
+
return _labelsInfo.BmColorLabelPicker;
|
|
1180
|
+
}
|
|
1181
|
+
});
|
|
1182
|
+
Object.defineProperty(exports, "BmAccordicon", {
|
|
1183
|
+
enumerable: true,
|
|
1184
|
+
get: function get() {
|
|
1185
|
+
return _Accordicon.BmAccordicon;
|
|
1186
|
+
}
|
|
1187
|
+
});
|
|
1188
|
+
|
|
1189
|
+
var _Accordion = _interopRequireDefault(require("./Accordion"));
|
|
1152
1190
|
|
|
1153
1191
|
var _avatars = require("./avatars");
|
|
1154
1192
|
|
|
@@ -1240,4 +1278,10 @@ var _infoNote = require("./infoNote");
|
|
|
1240
1278
|
|
|
1241
1279
|
var _checkbox = require("./checkbox");
|
|
1242
1280
|
|
|
1243
|
-
var _notesInfo = require("./CustomerInfo/notesInfo");
|
|
1281
|
+
var _notesInfo = require("./CustomerInfo/notesInfo");
|
|
1282
|
+
|
|
1283
|
+
var _labelsInfo = require("./CustomerInfo/labelsInfo");
|
|
1284
|
+
|
|
1285
|
+
var _Accordicon = require("./Accordicon");
|
|
1286
|
+
|
|
1287
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/dist/components/tags.js
CHANGED
|
@@ -44,7 +44,8 @@ var BeemTag = _styledComponents.default.button(_templateObject || (_templateObje
|
|
|
44
44
|
if (variant === "warning") return "".concat(_colors.BmPrimaryGold);
|
|
45
45
|
if (variant === "error") return "".concat(_colors.BmSecondaryRed);
|
|
46
46
|
if (variant === "light") return "".concat(_colors.BmPrimaryWhite);
|
|
47
|
-
return "".concat(_colors.BmGrey100);
|
|
47
|
+
if (variant === undefined) return "".concat(_colors.BmGrey100);
|
|
48
|
+
return variant;
|
|
48
49
|
}, function (_ref4) {
|
|
49
50
|
var variant = _ref4.variant;
|
|
50
51
|
if (variant === "neutral") return "".concat(_colors.BmGrey100);
|
|
@@ -61,9 +62,9 @@ var TagText = _styledComponents.default.p(_templateObject2 || (_templateObject2
|
|
|
61
62
|
return "".concat(_colors.BmPrimaryWhite);
|
|
62
63
|
});
|
|
63
64
|
|
|
64
|
-
var BmLeftIcon = (0, _styledComponents.default)(_iconStyles.BmTagIcon)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n
|
|
65
|
+
var BmLeftIcon = (0, _styledComponents.default)(_iconStyles.BmTagIcon)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-right: 0.643rem;\n"])));
|
|
65
66
|
exports.BmLeftIcon = BmLeftIcon;
|
|
66
|
-
var BmRightIcon = (0, _styledComponents.default)(_iconStyles.BmTagIcon)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n
|
|
67
|
+
var BmRightIcon = (0, _styledComponents.default)(_iconStyles.BmTagIcon)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin-left: 0.643rem;\n"])));
|
|
67
68
|
exports.BmRightIcon = BmRightIcon;
|
|
68
69
|
|
|
69
70
|
var BmTag = function BmTag(props) {
|
package/dist/components/text.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.input = exports.p = exports.h4 = exports.h3 = exports.h2 = exports.h1 = void 0;
|
|
6
|
+
exports.a = exports.input = exports.p = exports.h4 = exports.h3 = exports.h2 = exports.h1 = void 0;
|
|
7
7
|
|
|
8
8
|
var _typography = require("./typography");
|
|
9
9
|
|
|
@@ -18,4 +18,6 @@ exports.h4 = h4;
|
|
|
18
18
|
var p = "font-family: ".concat(_typography.OpenSans, ";\nfont-style: normal;\nfont-weight: normal;\nfont-size: 1rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
|
|
19
19
|
exports.p = p;
|
|
20
20
|
var input = " font-family: ".concat(_typography.OpenSans, ";\nfont-style: normal;\nfont-weight: normal;\nfont-size: 1rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
|
|
21
|
-
exports.input = input;
|
|
21
|
+
exports.input = input;
|
|
22
|
+
var a = "font-family: ".concat(_typography.OpenSans, ";\nfont-style: normal;\nfont-weight: normal;\nfont-size: 1rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
|
|
23
|
+
exports.a = a;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "beem-component",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.9",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "dist/components/index.js",
|
|
6
6
|
"peerDependencies": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"@material-ui/core": "^4.11.4",
|
|
14
14
|
"@material-ui/icons": "^4.11.2",
|
|
15
15
|
"@mui/icons-material": "^5.0.3",
|
|
16
|
-
"node-sass": "^
|
|
16
|
+
"node-sass": "^6.0.1",
|
|
17
17
|
"react": "^17.0.2",
|
|
18
18
|
"react-dom": "^17.0.2",
|
|
19
19
|
"react-scripts": "4.0.3",
|
package/src/App.js
CHANGED
|
@@ -7,12 +7,21 @@ import { Complete } from "./Complete";
|
|
|
7
7
|
import { CreateSegment } from "./CreateSegments";
|
|
8
8
|
// import Buttons from "../src/examples/Buttons";
|
|
9
9
|
import Chat from "./CHAT";
|
|
10
|
-
|
|
10
|
+
import { BmAccordicon } from "./lib/components/Accordicon";
|
|
11
|
+
import BmAccordion from "./lib/components/Accordion";
|
|
11
12
|
export const App = () => {
|
|
12
13
|
return (
|
|
13
14
|
<>
|
|
14
15
|
<GlobalStyle />
|
|
16
|
+
<BmAccordicon dropdown trailingIcon>
|
|
17
|
+
<h4>jclkdj</h4>
|
|
18
|
+
<h2>kghgfih</h2>
|
|
19
|
+
</BmAccordicon>
|
|
15
20
|
<Chat />
|
|
21
|
+
<BmAccordion>
|
|
22
|
+
<BmAccordion.Title>SMS</BmAccordion.Title>
|
|
23
|
+
<BmAccordion.Body>Reports</BmAccordion.Body>
|
|
24
|
+
</BmAccordion>
|
|
16
25
|
{/* <Buttons /> */}
|
|
17
26
|
{/* <h1>hello</h1> */}
|
|
18
27
|
{/* <MainWrapper>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
1
2
|
import React, { useState } from "react";
|
|
2
3
|
import {
|
|
3
4
|
BmCustomer,
|
|
@@ -32,12 +33,41 @@ import {
|
|
|
32
33
|
BmNoteDetails,
|
|
33
34
|
BmNoteFooter,
|
|
34
35
|
} from "../lib/components/CustomerInfo/notesInfo";
|
|
35
|
-
import {
|
|
36
|
+
import {
|
|
37
|
+
BmAddLabel,
|
|
38
|
+
BmColorLabel,
|
|
39
|
+
BmColorLabelContainer,
|
|
40
|
+
BmColorLabelPicker,
|
|
41
|
+
BmLabelInfo,
|
|
42
|
+
BmLabels,
|
|
43
|
+
} from "../lib/components/CustomerInfo/labelsInfo";
|
|
44
|
+
import {
|
|
45
|
+
BmIcons,
|
|
46
|
+
BmTagIcon,
|
|
47
|
+
CopyToClipBoard,
|
|
48
|
+
} from "../lib/components/iconStyles";
|
|
36
49
|
import { Delete, Edit } from "@material-ui/icons";
|
|
50
|
+
import { BmTag } from "../lib/components/tags";
|
|
51
|
+
import { BmAccordicon } from "../lib/components/Accordicon";
|
|
52
|
+
import { ModalBody } from "../lib/components/Modals/noteModalBody";
|
|
53
|
+
import {
|
|
54
|
+
BmFooterButtons,
|
|
55
|
+
ModalFooter,
|
|
56
|
+
} from "../lib/components/Modals/noteModalFooter";
|
|
57
|
+
import {
|
|
58
|
+
CloseModal,
|
|
59
|
+
HeaderText,
|
|
60
|
+
Modal,
|
|
61
|
+
ModalHeader,
|
|
62
|
+
} from "../lib/components/Modals/noteModalHeader";
|
|
63
|
+
import { BmInput } from "../lib/components/input";
|
|
64
|
+
import { BmButton } from "../lib/components/buttons";
|
|
37
65
|
|
|
38
66
|
const CustomerInformation = () => {
|
|
39
67
|
const [isOpen, setIsOpen] = useState(true);
|
|
40
68
|
const toggling = () => setIsOpen(!isOpen);
|
|
69
|
+
const [showModal, setShowModal] = useState(false);
|
|
70
|
+
|
|
41
71
|
return (
|
|
42
72
|
<>
|
|
43
73
|
{/* Main Customer SideBar */}
|
|
@@ -111,9 +141,9 @@ const CustomerInformation = () => {
|
|
|
111
141
|
</BmInformation>
|
|
112
142
|
<BmInformation>
|
|
113
143
|
{/* Notes */}
|
|
114
|
-
<
|
|
115
|
-
Notes
|
|
116
|
-
</
|
|
144
|
+
<BmAccordicon dropdown onClick={toggling} isOpen={isOpen}>
|
|
145
|
+
<h3>Notes</h3>
|
|
146
|
+
</BmAccordicon>
|
|
117
147
|
<BmInfoContent isOpen={isOpen}>
|
|
118
148
|
<BmInfoContentItem>
|
|
119
149
|
<BmNoteInfo>
|
|
@@ -124,7 +154,11 @@ const CustomerInformation = () => {
|
|
|
124
154
|
despite following the instructions
|
|
125
155
|
</p>
|
|
126
156
|
<BmNoteDetails>
|
|
127
|
-
<BmIcons
|
|
157
|
+
<BmIcons
|
|
158
|
+
icon={<Edit />}
|
|
159
|
+
size="xsmall"
|
|
160
|
+
onClick={() => alert("hello")}
|
|
161
|
+
/>
|
|
128
162
|
<BmIcons icon={<CopyToClipBoard />} size="xsmall" />
|
|
129
163
|
<BmIcons icon={<Delete />} size="xsmall" />
|
|
130
164
|
</BmNoteDetails>
|
|
@@ -137,8 +171,76 @@ const CustomerInformation = () => {
|
|
|
137
171
|
</BmInfoContentItem>
|
|
138
172
|
</BmInfoContent>
|
|
139
173
|
</BmInformation>
|
|
174
|
+
{/* Labels */}
|
|
175
|
+
<BmInformation>
|
|
176
|
+
<BmAccordicon dropdown onClick={toggling} isOpen={isOpen}>
|
|
177
|
+
<h3>Labels</h3>
|
|
178
|
+
<a
|
|
179
|
+
onClick={() => {
|
|
180
|
+
setShowModal(true);
|
|
181
|
+
}}
|
|
182
|
+
>
|
|
183
|
+
Manage Labels
|
|
184
|
+
</a>
|
|
185
|
+
</BmAccordicon>
|
|
186
|
+
<BmInfoContent isOpen={isOpen}>
|
|
187
|
+
<BmInfoContentItem>
|
|
188
|
+
<BmLabelInfo>
|
|
189
|
+
{/* SearchIcon */}
|
|
190
|
+
<BmAddNote type="text" placeholder="Add Note" />
|
|
191
|
+
<h4>Added Labels</h4>
|
|
192
|
+
<BmLabels>
|
|
193
|
+
<BmTag variant="#33b1ba" trailingIcon={<Delete />}>
|
|
194
|
+
A
|
|
195
|
+
</BmTag>
|
|
196
|
+
<BmTag variant="purple" trailingIcon={<Delete />}>
|
|
197
|
+
B
|
|
198
|
+
</BmTag>
|
|
199
|
+
<BmTag variant="orange" trailingIcon={<Delete />}>
|
|
200
|
+
C
|
|
201
|
+
</BmTag>
|
|
202
|
+
</BmLabels>
|
|
203
|
+
</BmLabelInfo>
|
|
204
|
+
</BmInfoContentItem>
|
|
205
|
+
</BmInfoContent>
|
|
206
|
+
</BmInformation>
|
|
140
207
|
</BmCustomerInfoAccordicon>
|
|
141
208
|
</BmCustomerBar>
|
|
209
|
+
<Modal
|
|
210
|
+
show={showModal}
|
|
211
|
+
setShowModal={() => {
|
|
212
|
+
setShowModal(!showModal);
|
|
213
|
+
}}
|
|
214
|
+
>
|
|
215
|
+
<ModalHeader>
|
|
216
|
+
<HeaderText>Add Labels</HeaderText>
|
|
217
|
+
<CloseModal
|
|
218
|
+
onClick={() => {
|
|
219
|
+
setShowModal(!showModal);
|
|
220
|
+
}}
|
|
221
|
+
/>
|
|
222
|
+
</ModalHeader>
|
|
223
|
+
<ModalBody>
|
|
224
|
+
<BmAddLabel type="text" placeholder="Add label" />
|
|
225
|
+
<BmColorLabel>
|
|
226
|
+
{["#33b1ba", "#000000", "#F62E48", "#8CC63F"].map((color) => (
|
|
227
|
+
<BmColorLabelPicker
|
|
228
|
+
color={color}
|
|
229
|
+
onClick={() => {
|
|
230
|
+
alert(color);
|
|
231
|
+
}}
|
|
232
|
+
/>
|
|
233
|
+
))}
|
|
234
|
+
</BmColorLabel>
|
|
235
|
+
</ModalBody>
|
|
236
|
+
<ModalFooter>
|
|
237
|
+
<BmFooterButtons>
|
|
238
|
+
<BmButton variant="primary" size="medium">
|
|
239
|
+
Save
|
|
240
|
+
</BmButton>
|
|
241
|
+
</BmFooterButtons>
|
|
242
|
+
</ModalFooter>
|
|
243
|
+
</Modal>
|
|
142
244
|
</>
|
|
143
245
|
);
|
|
144
246
|
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { BmPrimaryWhite, BmGrey400 } from "./colors";
|
|
4
|
+
import { BmDropdownIcon, BmDropupIcon } from "./iconStyles";
|
|
5
|
+
|
|
6
|
+
export const BmAccordiconMenu = styled.div`
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: row;
|
|
9
|
+
${"" /* justify-content: space-between; */}
|
|
10
|
+
padding: 0.571rem 1.143rem;
|
|
11
|
+
background: ${BmPrimaryWhite};
|
|
12
|
+
box-shadow: ${(isOpen) => {
|
|
13
|
+
if (isOpen) return `inset 0rem 0.071rem 0rem ${BmGrey400}`;
|
|
14
|
+
return `inset 0rem -0.071rem 0rem ${BmGrey400}, inset 0rem 0.071rem 0rem ${BmGrey400};`;
|
|
15
|
+
}};
|
|
16
|
+
> *:not(:last-child) {
|
|
17
|
+
margin-right: 0.5rem;
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
export const BmAccordiconDetails = styled.div`
|
|
22
|
+
display: flex;
|
|
23
|
+
justify-content: space-between;
|
|
24
|
+
width: 100%;
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
export const BmAccordicon = ({
|
|
28
|
+
children,
|
|
29
|
+
isOpen,
|
|
30
|
+
dropdown,
|
|
31
|
+
trailingIcon,
|
|
32
|
+
...rest
|
|
33
|
+
}) => {
|
|
34
|
+
return (
|
|
35
|
+
<>
|
|
36
|
+
<BmAccordiconMenu {...rest}>
|
|
37
|
+
{dropdown &&
|
|
38
|
+
(isOpen ? <BmDropupIcon {...rest} /> : <BmDropdownIcon {...rest} />)}
|
|
39
|
+
<BmAccordiconDetails>{children}</BmAccordiconDetails>
|
|
40
|
+
</BmAccordiconMenu>
|
|
41
|
+
</>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import { BmPrimaryWhite } from "./colors";
|
|
5
|
+
import { BmDropdownIcon, BmDropupIcon, BmIcons } from "./iconStyles";
|
|
6
|
+
|
|
7
|
+
const { Provider, Consumer } = React.createContext({});
|
|
8
|
+
|
|
9
|
+
const Dropdown = (value, rest) => {
|
|
10
|
+
if (value.expandIcon && value.expandIcon === "none") {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (!value.expandIcon) {
|
|
14
|
+
return value.toggle ? (
|
|
15
|
+
<BmDropupIcon {...rest} />
|
|
16
|
+
) : (
|
|
17
|
+
<BmDropdownIcon {...rest} />
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
if (value.expandIcon && value.expandIcon !== "none") {
|
|
21
|
+
return <BmIcons icon={value.expandIcon} />;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const BmAccordionMenu = styled.div`
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
flex-direction: row;
|
|
28
|
+
${"" /* padding: 0.571rem; */}
|
|
29
|
+
padding: 0.571rem 1.143rem;
|
|
30
|
+
border: 1px solid
|
|
31
|
+
background: ${BmPrimaryWhite};
|
|
32
|
+
> *:not(:last-child) {
|
|
33
|
+
margin-right: 0.5rem;
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
const BmAccordionDetails = styled.div`
|
|
38
|
+
display: flex;
|
|
39
|
+
justify-content: space-between;
|
|
40
|
+
width: 100%;
|
|
41
|
+
`;
|
|
42
|
+
|
|
43
|
+
const BmAccordionWrapper = styled.div`
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
`;
|
|
47
|
+
|
|
48
|
+
const BmAccordion = ({ children, disabled, expandIcon, ...rest }) => {
|
|
49
|
+
const [toggle, setToggle] = useState(false);
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<BmAccordionWrapper>
|
|
53
|
+
<Provider value={{ toggle, setToggle, disabled, expandIcon }}>
|
|
54
|
+
{children}
|
|
55
|
+
</Provider>
|
|
56
|
+
</BmAccordionWrapper>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
BmAccordion.Title = ({
|
|
61
|
+
children,
|
|
62
|
+
leadingIcon,
|
|
63
|
+
trailingIcon,
|
|
64
|
+
size,
|
|
65
|
+
...rest
|
|
66
|
+
}) => {
|
|
67
|
+
return (
|
|
68
|
+
<Consumer>
|
|
69
|
+
{(value) => (
|
|
70
|
+
<BmAccordionMenu
|
|
71
|
+
{...rest}
|
|
72
|
+
onClick={() =>
|
|
73
|
+
!value.disabled || value.disabled === false
|
|
74
|
+
? value.setToggle(!value.toggle)
|
|
75
|
+
: value.setToggle(false)
|
|
76
|
+
}
|
|
77
|
+
>
|
|
78
|
+
{Dropdown(value, rest)}
|
|
79
|
+
{leadingIcon && <BmIcons icon={leadingIcon} size={size} />}
|
|
80
|
+
<BmAccordionDetails>{children}</BmAccordionDetails>
|
|
81
|
+
{trailingIcon && <BmIcons icon={trailingIcon} size={size} />}
|
|
82
|
+
</BmAccordionMenu>
|
|
83
|
+
)}
|
|
84
|
+
</Consumer>
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
BmAccordion.Body = ({ children }) => {
|
|
89
|
+
return (
|
|
90
|
+
<Consumer>{(value) => value.toggle && <div>{children}</div>}</Consumer>
|
|
91
|
+
);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
BmAccordion.propTypes = {
|
|
95
|
+
children: PropTypes.object,
|
|
96
|
+
size: PropTypes.string,
|
|
97
|
+
expandIcon: PropTypes.string,
|
|
98
|
+
leadingIcon: PropTypes.node,
|
|
99
|
+
trailingIcon: PropTypes.node,
|
|
100
|
+
disabled: PropTypes.bool,
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export default BmAccordion;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { BmInput } from "../input";
|
|
3
|
+
|
|
4
|
+
export const BmAddLabel = styled(BmInput)`
|
|
5
|
+
width: 100%;
|
|
6
|
+
margin-bottom: 0.5rem;
|
|
7
|
+
`;
|
|
8
|
+
|
|
9
|
+
export const BmLabels = styled.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: row;
|
|
12
|
+
justify-content: space-between;
|
|
13
|
+
width: 100%;
|
|
14
|
+
flex-wrap: wrap;
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
export const BmColorLabel = styled.div`
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: row;
|
|
20
|
+
justify-content: space-between;
|
|
21
|
+
`;
|
|
22
|
+
export const BmColorLabelPicker = styled.div`
|
|
23
|
+
width: 1.429rem;
|
|
24
|
+
height: 1.429rem;
|
|
25
|
+
border-radius: 50%;
|
|
26
|
+
margin: 0.5rem;
|
|
27
|
+
background: ${(props) => (props.color ? props.color : "green")};
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
export const BmLabelInfo = styled.div`
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
width: 100%;
|
|
34
|
+
> *:not(:first-child) {
|
|
35
|
+
margin-top: 1.143rem;
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
@@ -45,7 +45,6 @@ export const BmNoteDetails = styled.div`
|
|
|
45
45
|
justify-content: space-between;
|
|
46
46
|
margin-top: 0.857rem;
|
|
47
47
|
width: 50%;
|
|
48
|
-
${"" /* padding: 1rem 1.143rem; */}
|
|
49
48
|
`;
|
|
50
49
|
|
|
51
50
|
export const BmNoteFooter = styled.div`
|
|
@@ -59,5 +58,4 @@ export const BmNoteFooter = styled.div`
|
|
|
59
58
|
margin-left: auto;
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
|
-
${"" /* padding: 1rem 1.143rem; */}
|
|
63
61
|
`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createGlobalStyle } from "styled-components";
|
|
2
|
-
import { h1, h2, h3, h4, p, input } from "./text";
|
|
2
|
+
import { h1, h2, h3, h4, p, input, a } from "./text";
|
|
3
3
|
|
|
4
4
|
export const GlobalStyle = createGlobalStyle`
|
|
5
5
|
* { font-size: 14px;}
|
|
@@ -9,4 +9,5 @@ export const GlobalStyle = createGlobalStyle`
|
|
|
9
9
|
h4 { ${h4} }
|
|
10
10
|
p { ${p} }
|
|
11
11
|
input {${input}}
|
|
12
|
+
a {${a}}
|
|
12
13
|
`;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import BmAccordion from "./Accordion";
|
|
1
2
|
import { BmAvatar } from "./avatars";
|
|
2
3
|
import { BmAlertIcon } from "./buttonAlertIcons";
|
|
3
4
|
import { BmBtnIcon } from "./buttonIconsOnly";
|
|
@@ -69,7 +70,6 @@ import {
|
|
|
69
70
|
import {
|
|
70
71
|
BmMessageTab,
|
|
71
72
|
BmMessageTabInput,
|
|
72
|
-
BmSendIcon,
|
|
73
73
|
BmSend,
|
|
74
74
|
BmAttachment,
|
|
75
75
|
BmMessage,
|
|
@@ -257,8 +257,17 @@ import {
|
|
|
257
257
|
BmNoteFooter,
|
|
258
258
|
BmNoteDetails,
|
|
259
259
|
} from "./CustomerInfo/notesInfo";
|
|
260
|
+
import {
|
|
261
|
+
BmAddLabel,
|
|
262
|
+
BmLabelInfo,
|
|
263
|
+
BmLabels,
|
|
264
|
+
BmColorLabel,
|
|
265
|
+
BmColorLabelPicker,
|
|
266
|
+
} from "./CustomerInfo/labelsInfo";
|
|
267
|
+
import { BmAccordicon } from "./Accordicon";
|
|
260
268
|
|
|
261
269
|
export {
|
|
270
|
+
BmAccordion,
|
|
262
271
|
BmButton,
|
|
263
272
|
BmAvatar,
|
|
264
273
|
BmAlertIcon,
|
|
@@ -296,7 +305,6 @@ export {
|
|
|
296
305
|
BmImageChat,
|
|
297
306
|
BmMessageTab,
|
|
298
307
|
BmMessageTabInput,
|
|
299
|
-
BmSendIcon,
|
|
300
308
|
BmSend,
|
|
301
309
|
BmAttachment,
|
|
302
310
|
BmMessage,
|
|
@@ -449,5 +457,11 @@ export {
|
|
|
449
457
|
BmNote,
|
|
450
458
|
BmNoteFooter,
|
|
451
459
|
BmNoteDetails,
|
|
452
|
-
CopyToClipBoard
|
|
460
|
+
CopyToClipBoard,
|
|
461
|
+
BmAddLabel,
|
|
462
|
+
BmLabelInfo,
|
|
463
|
+
BmLabels,
|
|
464
|
+
BmColorLabel,
|
|
465
|
+
BmColorLabelPicker,
|
|
466
|
+
BmAccordicon,
|
|
453
467
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from "react";
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
import {
|
|
4
4
|
BmPrimaryWhite,
|
|
@@ -33,7 +33,8 @@ const BeemTag = styled.button`
|
|
|
33
33
|
if (variant === "warning") return `${BmPrimaryGold}`;
|
|
34
34
|
if (variant === "error") return `${BmSecondaryRed}`;
|
|
35
35
|
if (variant === "light") return `${BmPrimaryWhite}`;
|
|
36
|
-
return `${BmGrey100}`;
|
|
36
|
+
if (variant === undefined) return `${BmGrey100}`;
|
|
37
|
+
return variant;
|
|
37
38
|
}};
|
|
38
39
|
border: 0.071rem solid
|
|
39
40
|
${({ variant }) => {
|
|
@@ -57,11 +58,11 @@ const TagText = styled.p`
|
|
|
57
58
|
`;
|
|
58
59
|
|
|
59
60
|
export const BmLeftIcon = styled(BmTagIcon)`
|
|
60
|
-
|
|
61
|
+
margin-right: 0.643rem;
|
|
61
62
|
`;
|
|
62
63
|
|
|
63
64
|
export const BmRightIcon = styled(BmTagIcon)`
|
|
64
|
-
|
|
65
|
+
margin-left: 0.643rem;
|
|
65
66
|
`;
|
|
66
67
|
|
|
67
68
|
export const BmTag = (props) => {
|