@citygross/components 0.7.159 → 0.7.160

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.
@@ -9,5 +9,7 @@ export declare type TSideModal = {
9
9
  slideFrom?: 'left' | 'right';
10
10
  overlayBackground?: string;
11
11
  maxWidth?: string;
12
+ maxHeight?: string;
13
+ fullViewportHeight?: boolean;
12
14
  };
13
- export declare const SideModal: ({ onBackdropClick, background, overlayBackground, width, isVisible, slideFrom, querySelector, maxWidth, children }: TSideModal) => React.ReactPortal | null;
15
+ export declare const SideModal: ({ onBackdropClick, background, overlayBackground, width, isVisible, slideFrom, querySelector, maxWidth, maxHeight, children }: TSideModal) => React.ReactPortal | null;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Story } from '@storybook/react';
3
3
  declare const _default: {
4
- component: ({ onBackdropClick, background, overlayBackground, width, isVisible, slideFrom, querySelector, maxWidth, children }: import("./SideModal").TSideModal) => React.ReactPortal | null;
4
+ component: ({ onBackdropClick, background, overlayBackground, width, isVisible, slideFrom, querySelector, maxWidth, maxHeight, children }: import("./SideModal").TSideModal) => React.ReactPortal | null;
5
5
  title: string;
6
6
  };
7
7
  export default _default;
@@ -3,6 +3,7 @@ declare type TSideModalContainer = {
3
3
  background?: string;
4
4
  slideFrom?: 'left' | 'right';
5
5
  maxWidth?: string;
6
+ maxHeight?: string;
6
7
  };
7
8
  declare type TSideMoodalOverlay = {
8
9
  overlayBackground: string;
@@ -14,7 +14,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
14
14
 
15
15
  var SideModal = function (_a) {
16
16
  var _b, _c;
17
- var onBackdropClick = _a.onBackdropClick, _d = _a.background, background = _d === void 0 ? '#fff' : _d, _e = _a.overlayBackground, overlayBackground = _e === void 0 ? (_c = (_b = designTokens.theme.palette) === null || _b === void 0 ? void 0 : _b.darkOverlay) !== null && _c !== void 0 ? _c : '' : _e, _f = _a.width, width = _f === void 0 ? 375 : _f, isVisible = _a.isVisible, slideFrom = _a.slideFrom, _g = _a.querySelector, querySelector = _g === void 0 ? '#root' : _g, maxWidth = _a.maxWidth, children = _a.children;
17
+ var onBackdropClick = _a.onBackdropClick, _d = _a.background, background = _d === void 0 ? '#fff' : _d, _e = _a.overlayBackground, overlayBackground = _e === void 0 ? (_c = (_b = designTokens.theme.palette) === null || _b === void 0 ? void 0 : _b.darkOverlay) !== null && _c !== void 0 ? _c : '' : _e, _f = _a.width, width = _f === void 0 ? 375 : _f, isVisible = _a.isVisible, slideFrom = _a.slideFrom, _g = _a.querySelector, querySelector = _g === void 0 ? '#root' : _g, maxWidth = _a.maxWidth, maxHeight = _a.maxHeight, children = _a.children;
18
18
  var ref = React.useRef(null);
19
19
  var domSafe = typeof document !== 'undefined';
20
20
  return domSafe
@@ -25,7 +25,7 @@ var SideModal = function (_a) {
25
25
  }, overlayBackground: overlayBackground, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: {
26
26
  type: 'just'
27
27
  } },
28
- React__default["default"].createElement(SideModal_styles.SideModalContainer, { slideFrom: slideFrom, maxWidth: maxWidth, transition: { type: 'just' }, width: width, onClick: function (e) { return e.stopPropagation(); }, background: background, initial: { x: slideFrom === 'left' ? '-100%' : '100%' }, animate: { x: 0 }, exit: { x: slideFrom === 'left' ? '-100%' : '100%' } }, children)))), document.querySelector(querySelector) || document.body)
28
+ React__default["default"].createElement(SideModal_styles.SideModalContainer, { slideFrom: slideFrom, maxHeight: maxHeight, maxWidth: maxWidth, transition: { type: 'just' }, width: width, onClick: function (e) { return e.stopPropagation(); }, background: background, initial: { x: slideFrom === 'left' ? '-100%' : '100%' }, animate: { x: 0 }, exit: { x: slideFrom === 'left' ? '-100%' : '100%' } }, children)))), document.querySelector(querySelector) || document.body)
29
29
  : null;
30
30
  };
31
31
 
@@ -11,10 +11,13 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
11
11
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
12
12
 
13
13
  var SideModalOverlay = styled__default["default"](framerMotion.motion.div)(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n display: flex;\n z-index: ", ";\n background: ", ";\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n height: 100%;\n justify-content: center;\n align-items: center;\n\n @media (min-width: ", "px) {\n padding: ", "px;\n }\n"], ["\n display: flex;\n z-index: ", ";\n background: ", ";\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n height: 100%;\n justify-content: center;\n align-items: center;\n\n @media (min-width: ", "px) {\n padding: ", "px;\n }\n"])), function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.zIndex.modal; }, function (props) { return props.overlayBackground; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.lg; });
14
- var SideModalContainer = styled__default["default"](framerMotion.motion.div)(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n height: 100vh;\n background: ", ";\n width: 100%;\n ", ";\n position: absolute;\n ", ";\n top: 0;\n z-index: ", ";\n\n overflow: auto;\n -ms-overflow-style: none;\n scrollbar-width: none;\n &::-webkit-scrollbar {\n display: none;\n }\n\n @media (min-width: ", "px) {\n width: ", "px;\n }\n"], ["\n height: 100vh;\n background: ", ";\n width: 100%;\n ", ";\n position: absolute;\n ", ";\n top: 0;\n z-index: ", ";\n\n overflow: auto;\n -ms-overflow-style: none;\n scrollbar-width: none;\n &::-webkit-scrollbar {\n display: none;\n }\n\n @media (min-width: ", "px) {\n width: ", "px;\n }\n"])), function (props) { return props.background; }, function (_a) {
14
+ var SideModalContainer = styled__default["default"](framerMotion.motion.div)(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n height: 100vh;\n background: ", ";\n width: 100%;\n\n ", ";\n position: absolute;\n ", ";\n top: 0;\n z-index: ", ";\n ", ";\n overflow: auto;\n -ms-overflow-style: none;\n scrollbar-width: none;\n &::-webkit-scrollbar {\n display: none;\n }\n\n @media (min-width: ", "px) {\n max-height: unset;\n width: ", "px;\n }\n"], ["\n height: 100vh;\n background: ", ";\n width: 100%;\n\n ", ";\n position: absolute;\n ", ";\n top: 0;\n z-index: ", ";\n ", ";\n overflow: auto;\n -ms-overflow-style: none;\n scrollbar-width: none;\n &::-webkit-scrollbar {\n display: none;\n }\n\n @media (min-width: ", "px) {\n max-height: unset;\n width: ", "px;\n }\n"])), function (props) { return props.background; }, function (_a) {
15
15
  var maxWidth = _a.maxWidth;
16
16
  return maxWidth && "max-width:".concat(maxWidth);
17
- }, function (props) { return ((props === null || props === void 0 ? void 0 : props.slideFrom) === 'left' ? "left: 0px" : 'right: 0px'); }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.zIndex.modal; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { return props.width; });
17
+ }, function (props) { return ((props === null || props === void 0 ? void 0 : props.slideFrom) === 'left' ? "left: 0px" : 'right: 0px'); }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.zIndex.modal; }, function (props) {
18
+ return props.maxHeight &&
19
+ "\n max-height: ".concat(props.maxHeight, ";\n ");
20
+ }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { return props.width; });
18
21
  var templateObject_1, templateObject_2;
19
22
 
20
23
  exports.SideModalContainer = SideModalContainer;
@@ -1 +1 @@
1
- {"version":3,"file":"SideModal.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SideModal.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -6,7 +6,7 @@ import { theme } from '@citygross/design-tokens';
6
6
 
7
7
  var SideModal = function (_a) {
8
8
  var _b, _c;
9
- var onBackdropClick = _a.onBackdropClick, _d = _a.background, background = _d === void 0 ? '#fff' : _d, _e = _a.overlayBackground, overlayBackground = _e === void 0 ? (_c = (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.darkOverlay) !== null && _c !== void 0 ? _c : '' : _e, _f = _a.width, width = _f === void 0 ? 375 : _f, isVisible = _a.isVisible, slideFrom = _a.slideFrom, _g = _a.querySelector, querySelector = _g === void 0 ? '#root' : _g, maxWidth = _a.maxWidth, children = _a.children;
9
+ var onBackdropClick = _a.onBackdropClick, _d = _a.background, background = _d === void 0 ? '#fff' : _d, _e = _a.overlayBackground, overlayBackground = _e === void 0 ? (_c = (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.darkOverlay) !== null && _c !== void 0 ? _c : '' : _e, _f = _a.width, width = _f === void 0 ? 375 : _f, isVisible = _a.isVisible, slideFrom = _a.slideFrom, _g = _a.querySelector, querySelector = _g === void 0 ? '#root' : _g, maxWidth = _a.maxWidth, maxHeight = _a.maxHeight, children = _a.children;
10
10
  var ref = useRef(null);
11
11
  var domSafe = typeof document !== 'undefined';
12
12
  return domSafe
@@ -17,7 +17,7 @@ var SideModal = function (_a) {
17
17
  }, overlayBackground: overlayBackground, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: {
18
18
  type: 'just'
19
19
  } },
20
- React.createElement(SideModalContainer, { slideFrom: slideFrom, maxWidth: maxWidth, transition: { type: 'just' }, width: width, onClick: function (e) { return e.stopPropagation(); }, background: background, initial: { x: slideFrom === 'left' ? '-100%' : '100%' }, animate: { x: 0 }, exit: { x: slideFrom === 'left' ? '-100%' : '100%' } }, children)))), document.querySelector(querySelector) || document.body)
20
+ React.createElement(SideModalContainer, { slideFrom: slideFrom, maxHeight: maxHeight, maxWidth: maxWidth, transition: { type: 'just' }, width: width, onClick: function (e) { return e.stopPropagation(); }, background: background, initial: { x: slideFrom === 'left' ? '-100%' : '100%' }, animate: { x: 0 }, exit: { x: slideFrom === 'left' ? '-100%' : '100%' } }, children)))), document.querySelector(querySelector) || document.body)
21
21
  : null;
22
22
  };
23
23
 
@@ -3,10 +3,13 @@ import styled from 'styled-components';
3
3
  import { motion } from 'framer-motion';
4
4
 
5
5
  var SideModalOverlay = styled(motion.div)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n z-index: ", ";\n background: ", ";\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n height: 100%;\n justify-content: center;\n align-items: center;\n\n @media (min-width: ", "px) {\n padding: ", "px;\n }\n"], ["\n display: flex;\n z-index: ", ";\n background: ", ";\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n height: 100%;\n justify-content: center;\n align-items: center;\n\n @media (min-width: ", "px) {\n padding: ", "px;\n }\n"])), function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.zIndex.modal; }, function (props) { return props.overlayBackground; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.lg; });
6
- var SideModalContainer = styled(motion.div)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 100vh;\n background: ", ";\n width: 100%;\n ", ";\n position: absolute;\n ", ";\n top: 0;\n z-index: ", ";\n\n overflow: auto;\n -ms-overflow-style: none;\n scrollbar-width: none;\n &::-webkit-scrollbar {\n display: none;\n }\n\n @media (min-width: ", "px) {\n width: ", "px;\n }\n"], ["\n height: 100vh;\n background: ", ";\n width: 100%;\n ", ";\n position: absolute;\n ", ";\n top: 0;\n z-index: ", ";\n\n overflow: auto;\n -ms-overflow-style: none;\n scrollbar-width: none;\n &::-webkit-scrollbar {\n display: none;\n }\n\n @media (min-width: ", "px) {\n width: ", "px;\n }\n"])), function (props) { return props.background; }, function (_a) {
6
+ var SideModalContainer = styled(motion.div)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 100vh;\n background: ", ";\n width: 100%;\n\n ", ";\n position: absolute;\n ", ";\n top: 0;\n z-index: ", ";\n ", ";\n overflow: auto;\n -ms-overflow-style: none;\n scrollbar-width: none;\n &::-webkit-scrollbar {\n display: none;\n }\n\n @media (min-width: ", "px) {\n max-height: unset;\n width: ", "px;\n }\n"], ["\n height: 100vh;\n background: ", ";\n width: 100%;\n\n ", ";\n position: absolute;\n ", ";\n top: 0;\n z-index: ", ";\n ", ";\n overflow: auto;\n -ms-overflow-style: none;\n scrollbar-width: none;\n &::-webkit-scrollbar {\n display: none;\n }\n\n @media (min-width: ", "px) {\n max-height: unset;\n width: ", "px;\n }\n"])), function (props) { return props.background; }, function (_a) {
7
7
  var maxWidth = _a.maxWidth;
8
8
  return maxWidth && "max-width:".concat(maxWidth);
9
- }, function (props) { return ((props === null || props === void 0 ? void 0 : props.slideFrom) === 'left' ? "left: 0px" : 'right: 0px'); }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.zIndex.modal; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { return props.width; });
9
+ }, function (props) { return ((props === null || props === void 0 ? void 0 : props.slideFrom) === 'left' ? "left: 0px" : 'right: 0px'); }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.zIndex.modal; }, function (props) {
10
+ return props.maxHeight &&
11
+ "\n max-height: ".concat(props.maxHeight, ";\n ");
12
+ }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { return props.width; });
10
13
  var templateObject_1, templateObject_2;
11
14
 
12
15
  export { SideModalContainer, SideModalOverlay };
@@ -1 +1 @@
1
- {"version":3,"file":"SideModal.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SideModal.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citygross/components",
3
- "version": "0.7.159",
3
+ "version": "0.7.160",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "./build/cjs/components/src/index.js",
@@ -71,5 +71,5 @@
71
71
  "moment": "^2.29.1",
72
72
  "react-loading-skeleton": "^2.2.0"
73
73
  },
74
- "gitHead": "c1a37d9d5da6fb0afe59c6ce5bd2d7900683519b"
74
+ "gitHead": "fcdf1d8bd7d7acb07d4bc8573e68b4027e1c214c"
75
75
  }