beem-component 1.2.3 → 1.2.7

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") {
@@ -54,57 +54,38 @@ 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) {
62
- var size = _ref.size;
63
-
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";
69
- return size;
70
- }
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";
85
- });
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 ", "\n background: ", ";\n ", "\n width: auto;\n max-width: 100%;\n\n > *:not(:last-child) {\n margin-bottom: 1rem;\n }\n @media (min-width: 576px) {\n max-width: 500px;\n width: 500px;\n }\n"])), ''
62
+ /* margin: auto; */
63
+ , _colors.BmPrimaryWhite, ''
64
+ /* width: ${({ size }) => {
65
+ if (size) {
66
+ if (size === "small") return "300px";
67
+ if (size === "default") return "500px";
68
+ if (size === "large") return "800px";
69
+ if (size === "xlarge") return "1140px";
70
+ return size;
71
+ }
72
+ return "500px";
73
+ }}; */
74
+ );
86
75
 
87
76
  exports.ModalContent = ModalContent;
88
77
 
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
- });
78
+ 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
79
 
99
80
  exports.ModalWrapper = ModalWrapper;
100
81
 
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);
82
+ var BmModal = function BmModal(_ref) {
83
+ var children = _ref.children,
84
+ show = _ref.show,
85
+ size = _ref.size,
86
+ onHide = _ref.onHide,
87
+ centered = _ref.centered,
88
+ rest = _objectWithoutProperties(_ref, _excluded);
108
89
 
109
90
  var _useState = (0, _react.useState)(show),
110
91
  _useState2 = _slicedToArray(_useState, 2),
@@ -146,13 +127,13 @@ exports.BmModal = BmModal;
146
127
 
147
128
  var ModalHeader = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n"])));
148
129
 
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);
130
+ BmModal.Header = function (_ref2) {
131
+ var children = _ref2.children,
132
+ size = _ref2.size,
133
+ onHide = _ref2.onHide,
134
+ closeButton = _ref2.closeButton,
135
+ show = _ref2.show,
136
+ rest = _objectWithoutProperties(_ref2, _excluded2);
156
137
 
157
138
  return /*#__PURE__*/_react.default.createElement(Consumer, null, function (value) {
158
139
  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 +146,8 @@ BmModal.Header = function (_ref5) {
165
146
  });
166
147
  };
167
148
 
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;
149
+ 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 (_ref3) {
150
+ var size = _ref3.size;
170
151
 
171
152
  if (size) {
172
153
  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.3",
3
+ "version": "1.2.7",
4
4
  "private": false,
5
5
  "main": "dist/components/index.js",
6
6
  "scripts": {
@@ -73,4 +73,4 @@
73
73
  "@storybook/theming": "^6.4.9",
74
74
  "storybook-addon-jsx": "^7.3.14"
75
75
  }
76
- }
76
+ }
@@ -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";
@@ -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
  `;
@@ -22,48 +22,43 @@ export const ModalContent = styled.div`
22
22
  flex-direction: column;
23
23
  border-radius: 0.25rem;
24
24
  padding: 1rem;
25
- margin: auto;
25
+ ${'' /* margin: auto; */}
26
26
  background: ${BmPrimaryWhite};
27
- width: ${({ size }) => {
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";
33
- return size;
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";
29
+ if (size === "small") return "300px";
30
+ if (size === "default") return "500px";
31
+ if (size === "large") return "800px";
32
+ if (size === "xlarge") return "1140px";
43
33
  return size;
44
34
  }
45
- return "35.714rem";
46
- }};
35
+ return "500px";
36
+ }}; */}
37
+ width: auto;
38
+ max-width: 100%;
39
+
47
40
  > *:not(:last-child) {
48
41
  margin-bottom: 1rem;
49
42
  }
43
+ @media (min-width: 576px) {
44
+ max-width: 500px;
45
+ width: 500px;
46
+ }
50
47
  `;
51
48
 
52
49
  export const ModalWrapper = styled.div`
50
+ position: fixed;
51
+ top: 0;
52
+ left: 0;
53
53
  z-index: 9999;
54
- overflow-x: auto;
55
- overflow-y: auto;
54
+ display: block;
55
+ width: 100%;
56
+ height: 100%;
57
+ overflow: hidden;
56
58
  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%);
59
+ margin: 2rem auto;
60
+ overflow-x: hidden;
61
+ overflow-y: auto;
67
62
  `;
68
63
 
69
64
  export const BmModal = ({