beem-component 1.2.2 → 1.2.6

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.
@@ -0,0 +1,42 @@
1
+ $breakpoints: ( xs: 0, sm: 480px, md: 720px, lg: 960px, xl: 1200px, xxl: 1400px);
2
+ @mixin xs {
3
+ @media (min-width: map-get($breakpoints, 'xs')) {
4
+ @content;
5
+ }
6
+ }
7
+
8
+ @mixin sm {
9
+ @media (min-width: map-get($breakpoints, 'sm')) {
10
+ @content;
11
+ }
12
+ }
13
+
14
+ @mixin md {
15
+ @media (min-width: map-get($breakpoints, 'md')) {
16
+ @content;
17
+ }
18
+ }
19
+
20
+ @mixin lg {
21
+ @media (min-width: map-get($breakpoints, 'lg')) {
22
+ @content;
23
+ }
24
+ }
25
+
26
+ @mixin xl {
27
+ @media (min-width: map-get($breakpoints, 'xl')) {
28
+ @content;
29
+ }
30
+ }
31
+
32
+ @mixin xxl {
33
+ @media (min-width: map-get($breakpoints, 'xxl')) {
34
+ @content;
35
+ }
36
+ }
37
+
38
+ @mixin breakpoint($bp: 0) {
39
+ @media (min-width: $bp) {
40
+ @content;
41
+ }
42
+ }
@@ -41,11 +41,9 @@ var BmChat = _styledComponents.default.div(_templateObject || (_templateObject =
41
41
  /* border: 0.071rem solid ${BmGrey400}; */
42
42
  );
43
43
 
44
- BmChat.Body = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n padding: 0rem 1.5rem;\n flex-grow: 1;\n overflow: auto;\n"])));
44
+ BmChat.Body = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column-reverse;\n padding: 0rem 1.5rem;\n flex-grow: 1;\n overflow: auto;\n height: 100%;\n"])));
45
45
 
46
- var Details = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n ", "\n justify-content: ", ";\n > *:not(:last-child) {\n margin-right: 1rem;\n margin-bottom: 0.5rem;\n }\n overflow-wrap: break-word !important;\n word-wrap: break-word !important;\n margin: 0rem;\n flex-grow: 1;\n"])), ""
47
- /* align-items: center; */
48
- , function (_ref) {
46
+ var Details = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: ", ";\n > *:not(:last-child) {\n margin-right: 1rem;\n margin-bottom: 0.5rem;\n }\n overflow-wrap: break-word !important;\n word-wrap: break-word !important;\n margin: 0rem;\n flex-grow: 1;\n"])), function (_ref) {
49
47
  var state = _ref.state;
50
48
 
51
49
  if (state === "inbound") {
@@ -59,7 +57,7 @@ var Details = _styledComponents.default.div(_templateObject3 || (_templateObject
59
57
  return "row";
60
58
  });
61
59
 
62
- var MessageDetails = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n max-width: 50%;\n > * {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n }\n"])));
60
+ var MessageDetails = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n max-width: 70%;\n > * {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n }\n"])));
63
61
 
64
62
  var Messages = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0.5rem;\n background: ", ";\n color: ", ";\n border-radius: ", ";\n border: 0.071rem solid ", ";\n word-break: break-all;\n margin: 0rem;\n"])), function (_ref2) {
65
63
  var state = _ref2.state;
@@ -54,57 +54,37 @@ var _React$createContext = /*#__PURE__*/_react.default.createContext(),
54
54
  Provider = _React$createContext.Provider,
55
55
  Consumer = _React$createContext.Consumer;
56
56
 
57
- var Overlay = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n \tposition: fixed;\n top: 0;\n left: 0;\n z-index: 9999;\n width: 100%;\n height: 100%;\n background-color: ", ";\n}\n"])), _colors.BmBgGrey45);
57
+ var Overlay = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n \tposition: fixed;\n top: 0;\n left: 0;\n z-index: 9999;\n width: 100vw;\n height: 100vh;\n background-color: ", ";\n}\n"])), _colors.BmBgGrey45);
58
58
 
59
59
  exports.Overlay = Overlay;
60
60
 
61
- var ModalContent = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n border-radius: 0.25rem;\n padding: 1rem;\n margin: auto;\n background: ", ";\n width: ", ";\n max-width: ", ";\n > *:not(:last-child) {\n margin-bottom: 1rem;\n }\n"])), _colors.BmPrimaryWhite, function (_ref) {
61
+ var ModalContent = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n border-radius: 0.25rem;\n padding: 1rem;\n margin: auto;\n background: ", ";\n width: ", ";\n > *:not(:last-child) {\n margin-bottom: 1rem;\n }\n @media (min-width: 576px) {\n max-width: 500px;\n width: 500px;\n }\n"])), _colors.BmPrimaryWhite, function (_ref) {
62
62
  var size = _ref.size;
63
63
 
64
64
  if (size) {
65
- if (size === "small") return "21.429rem";
66
- if (size === "default") return "35.714rem";
67
- if (size === "large") return "57.143rem";
68
- if (size === "xlarge") return "81.429rem";
65
+ if (size === "small") return "300px";
66
+ if (size === "default") return "500px";
67
+ if (size === "large") return "800px";
68
+ if (size === "xlarge") return "1140px";
69
69
  return size;
70
70
  }
71
71
 
72
- return "35.714rem";
73
- }, function (_ref2) {
74
- var size = _ref2.size;
75
-
76
- if (size) {
77
- if (size === "small") return "21.429rem";
78
- if (size === "default") return "35.714rem";
79
- if (size === "large") return "57.143rem";
80
- if (size === "xlarge") return "81.429rem";
81
- return size;
82
- }
83
-
84
- return "35.714rem";
72
+ return "500px";
85
73
  });
86
74
 
87
75
  exports.ModalContent = ModalContent;
88
76
 
89
- var ModalWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n z-index: 9999;\n overflow-x: auto;\n overflow-y: auto;\n outline: 0;\n position: fixed;\n height: auto;\n top: ", ";\n left: 50%;\n transform: translate(-50%, -50%);\n"])), function (_ref3) {
90
- var centered = _ref3.centered;
91
-
92
- if (centered) {
93
- return "50%";
94
- }
95
-
96
- return "15%";
97
- });
77
+ var ModalWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: fixed;\n top: 0;\n left: 0;\n z-index: 9999;\n display: block;\n width: 100%;\n height: 100%;\n overflow: hidden;\n outline: 0;\n margin: 2rem auto;\n overflow-x: hidden;\n overflow-y: auto;\n"])));
98
78
 
99
79
  exports.ModalWrapper = ModalWrapper;
100
80
 
101
- var BmModal = function BmModal(_ref4) {
102
- var children = _ref4.children,
103
- show = _ref4.show,
104
- size = _ref4.size,
105
- onHide = _ref4.onHide,
106
- centered = _ref4.centered,
107
- rest = _objectWithoutProperties(_ref4, _excluded);
81
+ var BmModal = function BmModal(_ref2) {
82
+ var children = _ref2.children,
83
+ show = _ref2.show,
84
+ size = _ref2.size,
85
+ onHide = _ref2.onHide,
86
+ centered = _ref2.centered,
87
+ rest = _objectWithoutProperties(_ref2, _excluded);
108
88
 
109
89
  var _useState = (0, _react.useState)(show),
110
90
  _useState2 = _slicedToArray(_useState, 2),
@@ -146,13 +126,13 @@ exports.BmModal = BmModal;
146
126
 
147
127
  var ModalHeader = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n"])));
148
128
 
149
- BmModal.Header = function (_ref5) {
150
- var children = _ref5.children,
151
- size = _ref5.size,
152
- onHide = _ref5.onHide,
153
- closeButton = _ref5.closeButton,
154
- show = _ref5.show,
155
- rest = _objectWithoutProperties(_ref5, _excluded2);
129
+ BmModal.Header = function (_ref3) {
130
+ var children = _ref3.children,
131
+ size = _ref3.size,
132
+ onHide = _ref3.onHide,
133
+ closeButton = _ref3.closeButton,
134
+ show = _ref3.show,
135
+ rest = _objectWithoutProperties(_ref3, _excluded2);
156
136
 
157
137
  return /*#__PURE__*/_react.default.createElement(Consumer, null, function (value) {
158
138
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(ModalHeader, rest, children, closeButton && /*#__PURE__*/_react.default.createElement(_iconStyles.BmIcons, _extends({
@@ -165,8 +145,8 @@ BmModal.Header = function (_ref5) {
165
145
  });
166
146
  };
167
147
 
168
- BmModal.Body = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n > *:not(:last-child) {\n margin-bottom: 0.5rem;\n }\n max-height: ", ";\n overflow: auto;\n"])), function (_ref6) {
169
- var size = _ref6.size;
148
+ BmModal.Body = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n > *:not(:last-child) {\n margin-bottom: 0.5rem;\n }\n max-height: ", ";\n overflow: auto;\n"])), function (_ref4) {
149
+ var size = _ref4.size;
170
150
 
171
151
  if (size) {
172
152
  if (size === "small") return "21.429rem";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beem-component",
3
- "version": "1.2.2",
3
+ "version": "1.2.6",
4
4
  "private": false,
5
5
  "main": "dist/components/index.js",
6
6
  "scripts": {
@@ -0,0 +1,42 @@
1
+ $breakpoints: ( xs: 0, sm: 480px, md: 720px, lg: 960px, xl: 1200px, xxl: 1400px);
2
+ @mixin xs {
3
+ @media (min-width: map-get($breakpoints, 'xs')) {
4
+ @content;
5
+ }
6
+ }
7
+
8
+ @mixin sm {
9
+ @media (min-width: map-get($breakpoints, 'sm')) {
10
+ @content;
11
+ }
12
+ }
13
+
14
+ @mixin md {
15
+ @media (min-width: map-get($breakpoints, 'md')) {
16
+ @content;
17
+ }
18
+ }
19
+
20
+ @mixin lg {
21
+ @media (min-width: map-get($breakpoints, 'lg')) {
22
+ @content;
23
+ }
24
+ }
25
+
26
+ @mixin xl {
27
+ @media (min-width: map-get($breakpoints, 'xl')) {
28
+ @content;
29
+ }
30
+ }
31
+
32
+ @mixin xxl {
33
+ @media (min-width: map-get($breakpoints, 'xxl')) {
34
+ @content;
35
+ }
36
+ }
37
+
38
+ @mixin breakpoint($bp: 0) {
39
+ @media (min-width: $bp) {
40
+ @content;
41
+ }
42
+ }
@@ -23,15 +23,15 @@ const BmChat = styled.div`
23
23
 
24
24
  BmChat.Body = styled.div`
25
25
  display: flex;
26
- flex-direction: column;
26
+ flex-direction: column-reverse;
27
27
  padding: 0rem 1.5rem;
28
28
  flex-grow: 1;
29
29
  overflow: auto;
30
+ height: 100%;
30
31
  `;
31
32
 
32
33
  const Details = styled.div`
33
34
  display: flex;
34
- ${"" /* align-items: center; */}
35
35
  justify-content: ${({ state }) => {
36
36
  if (state === "inbound") {
37
37
  return "flex-start";
@@ -54,7 +54,7 @@ const Details = styled.div`
54
54
  const MessageDetails = styled.div`
55
55
  display: flex;
56
56
  flex-direction: column;
57
- max-width: 50%;
57
+ max-width: 70%;
58
58
  > * {
59
59
  margin-top: 0.5rem;
60
60
  margin-bottom: 0.5rem;
@@ -12,8 +12,8 @@ export const Overlay = styled.div`
12
12
  top: 0;
13
13
  left: 0;
14
14
  z-index: 9999;
15
- width: 100%;
16
- height: 100%;
15
+ width: 100vw;
16
+ height: 100vh;
17
17
  background-color: ${BmBgGrey45};
18
18
  }
19
19
  `;
@@ -26,44 +26,36 @@ export const ModalContent = styled.div`
26
26
  background: ${BmPrimaryWhite};
27
27
  width: ${({ size }) => {
28
28
  if (size) {
29
- if (size === "small") return "21.429rem";
30
- if (size === "default") return "35.714rem";
31
- if (size === "large") return "57.143rem";
32
- if (size === "xlarge") return "81.429rem";
29
+ if (size === "small") return "300px";
30
+ if (size === "default") return "500px";
31
+ if (size === "large") return "800px";
32
+ if (size === "xlarge") return "1140px";
33
33
  return size;
34
34
  }
35
- return "35.714rem";
36
- }};
37
- max-width: ${({ size }) => {
38
- if (size) {
39
- if (size === "small") return "21.429rem";
40
- if (size === "default") return "35.714rem";
41
- if (size === "large") return "57.143rem";
42
- if (size === "xlarge") return "81.429rem";
43
- return size;
44
- }
45
- return "35.714rem";
35
+ return "500px";
46
36
  }};
47
37
  > *:not(:last-child) {
48
38
  margin-bottom: 1rem;
49
39
  }
40
+ @media (min-width: 576px) {
41
+ max-width: 500px;
42
+ width: 500px;
43
+ }
50
44
  `;
51
45
 
52
46
  export const ModalWrapper = styled.div`
47
+ position: fixed;
48
+ top: 0;
49
+ left: 0;
53
50
  z-index: 9999;
54
- overflow-x: auto;
55
- overflow-y: auto;
51
+ display: block;
52
+ width: 100%;
53
+ height: 100%;
54
+ overflow: hidden;
56
55
  outline: 0;
57
- position: fixed;
58
- height: auto;
59
- top: ${({ centered }) => {
60
- if (centered) {
61
- return "50%";
62
- }
63
- return "15%";
64
- }};
65
- left: 50%;
66
- transform: translate(-50%, -50%);
56
+ margin: 2rem auto;
57
+ overflow-x: hidden;
58
+ overflow-y: auto;
67
59
  `;
68
60
 
69
61
  export const BmModal = ({