@cleartrip/ct-design-bottomsheet 2.0.0 → 4.0.0-SNAPSHOT-rnfinaltest.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.
Files changed (44) hide show
  1. package/README.md +70 -0
  2. package/dist/BottomSheet.d.ts +6 -1
  3. package/dist/BottomSheet.d.ts.map +1 -1
  4. package/dist/BottomSheetHeader/BottomSheetHeader.d.ts +1 -4
  5. package/dist/BottomSheetHeader/BottomSheetHeader.d.ts.map +1 -1
  6. package/dist/NativeBottomSheet/BottomSheetNativeComponent/Cross.d.ts +8 -0
  7. package/dist/NativeBottomSheet/BottomSheetNativeComponent/Cross.d.ts.map +1 -0
  8. package/dist/NativeBottomSheet/BottomSheetNativeComponent/index.d.ts +30 -0
  9. package/dist/NativeBottomSheet/BottomSheetNativeComponent/index.d.ts.map +1 -0
  10. package/dist/NativeBottomSheet/BottomSheetPortal.d.ts +15 -0
  11. package/dist/NativeBottomSheet/BottomSheetPortal.d.ts.map +1 -0
  12. package/dist/NativeBottomSheet/Portal.d.ts +9 -0
  13. package/dist/NativeBottomSheet/Portal.d.ts.map +1 -0
  14. package/dist/NativeBottomSheet/style.d.ts +27 -0
  15. package/dist/NativeBottomSheet/style.d.ts.map +1 -0
  16. package/dist/NativeBottomSheet/useNativeBottomSheetPortal.d.ts +9 -0
  17. package/dist/NativeBottomSheet/useNativeBottomSheetPortal.d.ts.map +1 -0
  18. package/dist/ct-design-bottomsheet.browser.cjs.js +1 -1
  19. package/dist/ct-design-bottomsheet.browser.cjs.js.map +1 -1
  20. package/dist/ct-design-bottomsheet.browser.esm.js +1 -1
  21. package/dist/ct-design-bottomsheet.browser.esm.js.map +1 -1
  22. package/dist/ct-design-bottomsheet.cjs.js +177 -40
  23. package/dist/ct-design-bottomsheet.cjs.js.map +1 -1
  24. package/dist/ct-design-bottomsheet.esm.js +178 -42
  25. package/dist/ct-design-bottomsheet.esm.js.map +1 -1
  26. package/dist/ct-design-bottomsheet.umd.js +1816 -598
  27. package/dist/ct-design-bottomsheet.umd.js.map +1 -1
  28. package/dist/index.d.ts +1 -1
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/type.d.ts +65 -18
  31. package/dist/type.d.ts.map +1 -1
  32. package/package.json +34 -17
  33. package/src/BottomSheet.tsx +269 -0
  34. package/src/BottomSheetHeader/BottomSheetHeader.tsx +110 -0
  35. package/src/NativeBottomSheet/BottomSheetNativeComponent/Cross.tsx +8 -0
  36. package/src/NativeBottomSheet/BottomSheetNativeComponent/index.tsx +338 -0
  37. package/src/NativeBottomSheet/BottomSheetPortal.tsx +36 -0
  38. package/src/NativeBottomSheet/Portal.tsx +70 -0
  39. package/src/NativeBottomSheet/style.ts +29 -0
  40. package/src/NativeBottomSheet/useNativeBottomSheetPortal.tsx +26 -0
  41. package/src/index.ts +3 -0
  42. package/src/type.ts +173 -0
  43. package/dist/style.d.ts +0 -7
  44. package/dist/style.d.ts.map +0 -1
@@ -1,6 +1,5 @@
1
1
  'use strict';
2
2
 
3
- var tslib = require('tslib');
4
3
  var jsxRuntime = require('react/jsx-runtime');
5
4
  var ctDesignContainer = require('@cleartrip/ct-design-container');
6
5
  var ctDesignOutsideClickHandler = require('@cleartrip/ct-design-outside-click-handler');
@@ -10,87 +9,225 @@ var ctDesignTransition = require('@cleartrip/ct-design-transition');
10
9
  var react = require('react');
11
10
  var ctDesignIcons = require('@cleartrip/ct-design-icons');
12
11
  var ctDesignTheme = require('@cleartrip/ct-design-theme');
12
+ var ctDesignStyleManager = require('@cleartrip/ct-design-style-manager');
13
+ var css = require('@emotion/css');
14
+ var ctDesignBaseDragger = require('@cleartrip/ct-design-base-dragger');
13
15
 
16
+ exports.BottomSheetSnapPoint = void 0;
17
+ (function (BottomSheetSnapPoint) {
18
+ BottomSheetSnapPoint[BottomSheetSnapPoint["Hidden"] = 0] = "Hidden";
19
+ BottomSheetSnapPoint[BottomSheetSnapPoint["Partial"] = 1] = "Partial";
20
+ BottomSheetSnapPoint[BottomSheetSnapPoint["Full"] = 2] = "Full";
21
+ })(exports.BottomSheetSnapPoint || (exports.BottomSheetSnapPoint = {}));
14
22
  exports.DIRECTION = void 0;
15
23
  (function (DIRECTION) {
16
24
  DIRECTION["DOWN"] = "down";
17
25
  DIRECTION["UP"] = "up";
26
+ DIRECTION["LEFT"] = "left";
27
+ DIRECTION["RIGHT"] = "right";
18
28
  })(exports.DIRECTION || (exports.DIRECTION = {}));
19
29
 
20
- var getCloseButtonStyle = function (_a) {
21
- var theme = _a.theme, _b = _a.isTop, isTop = _b === void 0 ? true : _b;
22
- return (tslib.__assign({ position: 'absolute', right: '10px', backgroundColor: 'white', height: theme.size[8], width: theme.size[8], display: 'flex', alignItems: 'center', padding: theme.spacing[1], borderRadius: theme.border.radius['50P'], cursor: 'pointer', justifyContent: 'center' }, (isTop ? { top: '-44px' } : { bottom: '-44px' })));
23
- };
24
-
25
30
  var CLOSE_ICON_TYPE;
26
31
  (function (CLOSE_ICON_TYPE) {
27
32
  CLOSE_ICON_TYPE["CROSS"] = "CROSS";
28
33
  CLOSE_ICON_TYPE["BACK"] = "BACK";
29
34
  })(CLOSE_ICON_TYPE || (CLOSE_ICON_TYPE = {}));
30
- var BottomSheetHeader = function (props) {
31
- var handleClose = props.handleClose, styleConfig = props.styleConfig, isBack = props.isBack, children = props.children, _a = props.showBorderRadius, showBorderRadius = _a === void 0 ? true : _a, _b = props.direction, direction = _b === void 0 ? exports.DIRECTION.DOWN : _b;
32
- var theme = ctDesignTheme.useTheme();
33
- var headerContainer = (styleConfig || {}).headerContainer;
34
- var closeButtonStyles = getCloseButtonStyle({ theme: theme, isTop: direction === exports.DIRECTION.DOWN });
35
- var getCloseIcon = function (isBack) {
36
- if (isBack === void 0) { isBack = false; }
35
+ const staticBottomSheetHeaderStyles = ctDesignStyleManager.makeStyles((theme) => {
36
+ return {
37
+ headerContainer: {
38
+ backgroundColor: theme.color.background.neutral,
39
+ zIndex: theme.zIndex.bottomSheet,
40
+ },
41
+ headerContainerWithBorderRadius: {
42
+ backgroundColor: theme.color.background.neutral,
43
+ zIndex: theme.zIndex.bottomSheet,
44
+ borderTopLeftRadius: theme.border.radius[16],
45
+ borderTopRightRadius: theme.border.radius[16],
46
+ },
47
+ closeButton: {
48
+ position: 'absolute',
49
+ right: theme.spacing[2],
50
+ backgroundColor: theme.color.background.neutral,
51
+ height: theme.size[8],
52
+ width: theme.size[8],
53
+ display: 'flex',
54
+ alignItems: 'center',
55
+ padding: theme.spacing[1],
56
+ borderRadius: theme.border.radius[32],
57
+ cursor: 'pointer',
58
+ justifyContent: 'center',
59
+ },
60
+ };
61
+ });
62
+ const BottomSheetHeader = (props) => {
63
+ const { handleClose, styleConfig, isBack, children, showBorderRadius = true, hideHeaderDismissIcon = false, direction = exports.DIRECTION.DOWN, } = props;
64
+ const theme = ctDesignTheme.useTheme();
65
+ const { headerContainer: customHeaderContainerStyles = [], closeButton: customCloseButtonStyles = [] } = styleConfig || {};
66
+ const isTop = direction === exports.DIRECTION.DOWN;
67
+ const dynamicCloseButtonStyles = ctDesignStyleManager.useStyles((theme) => {
68
+ return {
69
+ closeButton: Object.assign({}, (isTop ? { top: -theme.spacing[10] } : { bottom: -theme.spacing[10] })),
70
+ };
71
+ }, [isTop]);
72
+ const getCloseIcon = (isBack = false) => {
73
+ if (hideHeaderDismissIcon) {
74
+ return null;
75
+ }
37
76
  if (isBack) {
38
77
  return jsxRuntime.jsx(ctDesignIcons.ModalBack, {});
39
78
  }
40
79
  return jsxRuntime.jsx(ctDesignIcons.Cross, { height: 24, width: 24, crossColor: theme.color.background.primary });
41
80
  };
42
- var CloseIcon = getCloseIcon(isBack);
43
- return (jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({ className: headerContainer === null || headerContainer === void 0 ? void 0 : headerContainer.className, css: tslib.__assign(tslib.__assign({ backgroundColor: theme.color.background.neutral, zIndex: theme.zIndex.bottomSheet }, (showBorderRadius &&
44
- direction === exports.DIRECTION.DOWN && {
45
- borderTopLeftRadius: theme.border.radius[16],
46
- borderTopRightRadius: theme.border.radius[16],
47
- })), headerContainer === null || headerContainer === void 0 ? void 0 : headerContainer.css) }, { children: [jsxRuntime.jsx(ctDesignContainer.Container, tslib.__assign({ css: tslib.__assign({}, closeButtonStyles), onClick: handleClose }, { children: CloseIcon })), children] })));
81
+ const CloseIcon = getCloseIcon(isBack);
82
+ return (jsxRuntime.jsxs(ctDesignContainer.Container, { styleConfig: {
83
+ root: [
84
+ showBorderRadius && direction === exports.DIRECTION.DOWN
85
+ ? staticBottomSheetHeaderStyles.headerContainerWithBorderRadius
86
+ : staticBottomSheetHeaderStyles.headerContainer,
87
+ ...customHeaderContainerStyles,
88
+ ],
89
+ }, children: [jsxRuntime.jsx(ctDesignContainer.Container, { styleConfig: {
90
+ root: [
91
+ staticBottomSheetHeaderStyles.closeButton,
92
+ dynamicCloseButtonStyles.closeButton,
93
+ ...customCloseButtonStyles,
94
+ ],
95
+ }, onClick: handleClose, children: CloseIcon }), children] }));
48
96
  };
49
- BottomSheetHeader.defaultProps = {};
50
97
 
51
- var slideDirection = {
98
+ const slideDirection = {
52
99
  up: 'down',
53
100
  down: 'up',
54
101
  };
55
- var handleWindowResize = function () {
56
- var vh = window.innerHeight * 0.01;
57
- document.documentElement.style.setProperty('--mvh', "".concat(vh, "px"));
102
+ const staticBottomSheetStyles = ctDesignStyleManager.makeStyles((theme) => {
103
+ return {
104
+ bottomSheetContainer: {
105
+ position: 'relative',
106
+ width: '100%',
107
+ display: 'flex',
108
+ flexDirection: 'column',
109
+ maxHeight: 'calc(var(--mvh) * 92)',
110
+ boxShadow: theme.elevation.bottomE2,
111
+ },
112
+ overlayWrapper: {
113
+ top: 0,
114
+ left: 0,
115
+ right: 0,
116
+ bottom: 0,
117
+ display: 'flex',
118
+ flexDirection: 'column',
119
+ justifyContent: 'flex-end',
120
+ },
121
+ };
122
+ });
123
+ const webStaticBottomSheetStyles = css.css({
124
+ position: 'fixed',
125
+ });
126
+ const handleWindowResize = () => {
127
+ const vh = window.innerHeight * 0.01;
128
+ document.documentElement.style.setProperty('--mvh', `${vh}px`);
58
129
  };
59
- var BottomSheet = function (_a) {
60
- var _b = _a.direction, direction = _b === void 0 ? 'down' : _b, children = _a.children, header = _a.header, onClose = _a.onClose, _c = _a.isOpen, isOpen = _c === void 0 ? false : _c, _d = _a.transitionDuration, timeout = _d === void 0 ? 200 : _d, overlayCloseIcon = _a.overlayCloseIcon, _e = _a.allowedBackdropClose, allowedBackdropClose = _e === void 0 ? true : _e, _f = _a.showBorderRadius, showBorderRadius = _f === void 0 ? true : _f, _g = _a.styleConfig, styleConfig = _g === void 0 ? {} : _g, _h = _a.disableOutSideClick, disableOutSideClick = _h === void 0 ? false : _h;
61
- var _j = react.useState(isOpen), isVisible = _j[0], setIsVisible = _j[1];
62
- var theme = ctDesignTheme.useTheme();
63
- react.useEffect(function () {
130
+ const BottomSheet = ({ open, onDismiss, backgroundColor: backdropColor, containerSheetBackgroundColor = 'white', cornerRadius = 16, showCloseButton = true, showBackButton = false, showBackdrop = true, children, header, direction = exports.DIRECTION.DOWN, transitionDuration: timeout = 250, allowedBackdropClose = true, styleConfig = {}, disableOutSideClick = false, disablePortal = false, draggableConfig, }) => {
131
+ const [isVisible, setIsVisible] = react.useState(open);
132
+ react.useEffect(() => {
64
133
  handleWindowResize();
65
134
  window.addEventListener('resize', handleWindowResize);
66
- return function () {
135
+ return () => {
67
136
  window.removeEventListener('resize', handleWindowResize);
68
137
  };
69
138
  }, []);
70
- var _k = overlayCloseIcon || {}, _l = _k.show, show = _l === void 0 ? false : _l, _m = _k.isBack, isBack = _m === void 0 ? false : _m;
71
- var _o = styleConfig || {}, bottomSheetContainer = _o.bottomSheetContainer, overlayWrapper = _o.overlayWrapper;
72
- var handleCloseBottomSheet = function (event) {
139
+ const { bottomSheetContainer: customBottomSheetContainerStyles = [], overlayWrapper: customOverlayWrapperStyles = [], } = styleConfig || {};
140
+ const handleCloseBottomSheet = (event) => {
73
141
  if (disableOutSideClick)
74
142
  return;
75
143
  event.preventDefault();
76
- if (allowedBackdropClose && onClose) {
77
- onClose({ isClosedByOutSideClick: true });
144
+ if (allowedBackdropClose && onDismiss) {
145
+ onDismiss({ isClosedByOutSideClick: true });
78
146
  }
79
147
  };
80
- var handleExited = function () {
148
+ const handleExited = () => {
81
149
  setIsVisible(false);
82
150
  };
83
- react.useEffect(function () {
84
- if (isOpen) {
151
+ const handleClose = () => {
152
+ onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
153
+ };
154
+ react.useEffect(() => {
155
+ if (open) {
85
156
  setIsVisible(true);
86
157
  }
87
- }, [isOpen]);
158
+ }, [open]);
159
+ const dynamicBottomSheetContainerStyles = ctDesignStyleManager.useStyles(() => {
160
+ return {
161
+ bottomSheetContainer: Object.assign(Object.assign({}, ((draggableConfig === null || draggableConfig === void 0 ? void 0 : draggableConfig.isDraggable) ? { height: undefined } : {})), { backgroundColor: containerSheetBackgroundColor, borderTopLeftRadius: cornerRadius, borderTopRightRadius: cornerRadius }),
162
+ };
163
+ }, [draggableConfig === null || draggableConfig === void 0 ? void 0 : draggableConfig.isDraggable, containerSheetBackgroundColor, cornerRadius]);
164
+ const dynamicOverlayWrapperStyles = ctDesignStyleManager.useStyles((theme) => {
165
+ return {
166
+ overlayWrapper: Object.assign({ zIndex: theme.zIndex.bottomSheet, alignItems: exports.DIRECTION.DOWN ? 'flex-end' : 'flex-start', backgroundColor: backdropColor || (!showBackdrop ? 'transparent' : undefined) }, (!showBackdrop
167
+ ? {
168
+ boxShadow: '0px -4px 16px 0px rgba(26, 26, 26, 0.08)',
169
+ }
170
+ : {})),
171
+ };
172
+ }, [showBackdrop, backdropColor, direction]);
173
+ const renderBottomsheetHeader = () => {
174
+ const headerComponent = (jsxRuntime.jsx(BottomSheetHeader, { direction: direction, showBorderRadius: cornerRadius > 0, handleClose: handleClose, isBack: showBackButton, children: header, hideHeaderDismissIcon: !showCloseButton }));
175
+ if (draggableConfig === null || draggableConfig === void 0 ? void 0 : draggableConfig.isDraggable) {
176
+ return jsxRuntime.jsx(ctDesignBaseDragger.BaseDraggerHeader, { children: headerComponent });
177
+ }
178
+ return headerComponent;
179
+ };
180
+ const renderBottomsheetWithTransition = ({ ref, onReactTransitionGroupEnd, }) => {
181
+ return (jsxRuntime.jsx(ctDesignTransition.Transition, { type: 'slide', slideDirection: slideDirection[direction], timeout: timeout, mountOnEnter: true, unmountOnExit: true, appear: true, in: open, onExited: handleExited, onEntered: () => {
182
+ onReactTransitionGroupEnd && onReactTransitionGroupEnd();
183
+ }, children: jsxRuntime.jsx("div", { ref: ref, children: jsxRuntime.jsxs(ctDesignContainer.Container, { styleConfig: {
184
+ root: [
185
+ staticBottomSheetStyles.bottomSheetContainer,
186
+ dynamicBottomSheetContainerStyles.bottomSheetContainer,
187
+ ...customBottomSheetContainerStyles,
188
+ ],
189
+ }, children: [showCloseButton && renderBottomsheetHeader(), children] }) }) }));
190
+ };
191
+ const renderBottomsheetWithDragger = () => {
192
+ if (draggableConfig === null || draggableConfig === void 0 ? void 0 : draggableConfig.isDraggable) {
193
+ return (jsxRuntime.jsx(ctDesignBaseDragger.BaseDragger, Object.assign({ isWrappedWithTransitionGroup: true }, draggableConfig, { isVisible: open, children: ({ ref, onReactTransitionGroupEnd }) => {
194
+ return renderBottomsheetWithTransition({ ref, onReactTransitionGroupEnd });
195
+ } })));
196
+ }
197
+ return renderBottomsheetWithTransition({});
198
+ };
199
+ const renderBottomsheetWithOutsideClickHandler = () => {
200
+ return (jsxRuntime.jsx(ctDesignOutsideClickHandler.OutsideClickHandler, { disabled: disableOutSideClick, onOutsideClick: handleCloseBottomSheet, wrapperProps: { style: { width: '100%' } }, children: renderBottomsheetWithDragger() }));
201
+ };
202
+ const renderBottomsheetWithOverlay = () => {
203
+ return (jsxRuntime.jsx(ctDesignOverlay.Overlay, { blur: showBackdrop, styleConfig: {
204
+ root: [
205
+ staticBottomSheetStyles.overlayWrapper,
206
+ webStaticBottomSheetStyles,
207
+ dynamicOverlayWrapperStyles.overlayWrapper,
208
+ ...customOverlayWrapperStyles,
209
+ ],
210
+ }, children: renderBottomsheetWithOutsideClickHandler() }));
211
+ };
88
212
  if (isVisible) {
89
- return (jsxRuntime.jsx(ctDesignPortal.Portal, { children: jsxRuntime.jsx(ctDesignOverlay.Overlay, tslib.__assign({ blur: true, customOverlayWrapperClass: overlayWrapper === null || overlayWrapper === void 0 ? void 0 : overlayWrapper.className, css: tslib.__assign({ position: 'fixed', bottom: 0, justifyContent: 'center', zIndex: theme.zIndex.bottomSheet, alignItems: "".concat(direction === 'down' ? 'flex-end' : 'flex-start') }, overlayWrapper === null || overlayWrapper === void 0 ? void 0 : overlayWrapper.css) }, { children: jsxRuntime.jsx(ctDesignOutsideClickHandler.OutsideClickHandler, tslib.__assign({ disabled: disableOutSideClick, onOutsideClick: handleCloseBottomSheet, wrapperProps: { style: { width: '100%' } } }, { children: jsxRuntime.jsx(ctDesignTransition.Transition, tslib.__assign({ type: 'slide', slideDirection: slideDirection[direction], timeout: timeout, mountOnEnter: true, unmountOnExit: true, appear: true, in: isOpen, onExited: handleExited }, { children: jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({ className: bottomSheetContainer === null || bottomSheetContainer === void 0 ? void 0 : bottomSheetContainer.className, css: tslib.__assign({ position: 'relative', width: '100%', height: '100%', display: 'flex', flexDirection: 'column', background: 'white', borderTopLeftRadius: 16, borderTopRightRadius: 16, maxHeight: 'calc(var(--mvh) * 90)', boxShadow: theme.elevation.bottomE2 }, bottomSheetContainer === null || bottomSheetContainer === void 0 ? void 0 : bottomSheetContainer.css) }, { children: [show && (jsxRuntime.jsx(BottomSheetHeader, { direction: direction, showBorderRadius: showBorderRadius, handleClose: onClose, isBack: isBack, children: header })), children] })) })) })) })) }));
213
+ if (disablePortal) {
214
+ return renderBottomsheetWithOverlay();
215
+ }
216
+ return jsxRuntime.jsx(ctDesignPortal.Portal, { id: 'bottomsheet', children: renderBottomsheetWithOverlay() });
90
217
  }
91
218
  return null;
92
219
  };
220
+ class BottomSheetComponent extends react.Component {
221
+ dismiss() {
222
+ var _a, _b;
223
+ (_b = (_a = this.props).onDismiss) === null || _b === void 0 ? void 0 : _b.call(_a);
224
+ }
225
+ render() {
226
+ return jsxRuntime.jsx(BottomSheet, Object.assign({}, this.props));
227
+ }
228
+ }
93
229
 
94
230
  exports.BottomSheet = BottomSheet;
231
+ exports.BottomSheetComponent = BottomSheetComponent;
95
232
  exports.BottomSheetHeader = BottomSheetHeader;
96
233
  //# sourceMappingURL=ct-design-bottomsheet.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ct-design-bottomsheet.cjs.js","sources":["../packages/components/Bottomsheet/src/type.ts","../packages/components/Bottomsheet/src/style.ts","../packages/components/Bottomsheet/src/BottomSheetHeader/BottomSheetHeader.tsx","../packages/components/Bottomsheet/src/BottomSheet.tsx"],"sourcesContent":[null,null,null,null],"names":["DIRECTION","useTheme","_jsx","ModalBack","Cross","_jsxs","Container","__assign","useState","useEffect","Portal","Overlay","OutsideClickHandler","Transition"],"mappings":";;;;;;;;;;;;;AA+EkBA,2BAGjB;AAHD,CAAA,UAAkB,SAAS,EAAA;AACzB,IAAA,SAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,SAAA,CAAA,IAAA,CAAA,GAAA,IAAS,CAAA;AACX,CAAC,EAHiBA,iBAAS,KAATA,iBAAS,GAG1B,EAAA,CAAA,CAAA;;AC/EM,IAAM,mBAAmB,GAAG,UAAC,EAAgD,EAAA;AAA9C,IAAA,IAAA,KAAK,WAAA,EAAE,EAAA,GAAA,EAAA,CAAA,KAAY,EAAZ,KAAK,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,IAAI,GAAA,EAAA,CAAA;AAA2C,IAAA,yBAClG,QAAQ,EAAE,UAAU,EACpB,KAAK,EAAE,MAAM,EACb,eAAe,EAAE,OAAO,EACxB,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EACrB,KAAK,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,CAAC,SAAS,CAAC,EACzC,OAAO,EAAE,OAAO,EAChB,YAAY,EAAA,IAAA,EACZ,aAAa,EAAA,IAAA,EACb,MAAM,EACN,IAAA,EAAA,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,YAAY,EAAA,EAAA,EAAA,QAAA,EAEtBF,eAAC,CAAAC,2BAAS,EACRC,cAAA,CAAA,EAAA,SAAS,EAAE,oBAAoB,KAAA,IAAA,IAApB,oBAAoB,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAApB,oBAAoB,CAAE,SAAS,EAC1C,GAAG,EACDA,cAAA,CAAA,EAAA,QAAQ,EAAE,UAAU,EACpB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,QAAQ,EACvB,UAAU,EAAE,OAAO,EACnB,mBAAmB,EAAE,EAAE,EACvB,oBAAoB,EAAE,EAAE,EACxB,SAAS,EAAE,uBAAuB,EAClC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,QAAQ,EAAA,EAChC,oBAAoB,KAAA,IAAA,IAApB,oBAAoB,KAApB,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,oBAAoB,CAAE,GAAG,CAG7B,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,IAAI,KACHL,cAAA,CAAC,iBAAiB,EAAA,EAChB,SAAS,EAAE,SAAS,EACpB,gBAAgB,EAAE,gBAAgB,EAClC,WAAW,EAAE,OAAO,EACpB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,CAAA,CACH,EACA,QAAQ,CACC,EAAA,CAAA,CAAA,EAAA,CAAA,CACD,EACO,CAAA,CAAA,EAAA,CAAA,CACd,EACH,CAAA,EACT;AACH,KAAA;AACD,IAAA,OAAO,IAAI,CAAC;AACd;;;;;"}
1
+ {"version":3,"file":"ct-design-bottomsheet.cjs.js","sources":["../packages/components/Bottomsheet/src/type.ts","../packages/components/Bottomsheet/src/BottomSheetHeader/BottomSheetHeader.tsx","../packages/components/Bottomsheet/src/BottomSheet.tsx"],"sourcesContent":[null,null,null],"names":["BottomSheetSnapPoint","DIRECTION","makeStyles","useTheme","useStyles","_jsx","ModalBack","Cross","_jsxs","Container","css","useState","useEffect","BaseDraggerHeader","Transition","BaseDragger","OutsideClickHandler","Overlay","Portal","Component"],"mappings":";;;;;;;;;;;;;;;AAMYA,sCAIX;AAJD,CAAA,UAAY,oBAAoB,EAAA;AAC9B,IAAA,oBAAA,CAAA,oBAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAM,CAAA;AACN,IAAA,oBAAA,CAAA,oBAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAO,CAAA;AACP,IAAA,oBAAA,CAAA,oBAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAI,CAAA;AACN,CAAC,EAJWA,4BAAoB,KAApBA,4BAAoB,GAI/B,EAAA,CAAA,CAAA,CAAA;AA6JiBC,2BAKjB;AALD,CAAA,UAAkB,SAAS,EAAA;AACzB,IAAA,SAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,SAAA,CAAA,IAAA,CAAA,GAAA,IAAS,CAAA;AACT,IAAA,SAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,SAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACjB,CAAC,EALiBA,iBAAS,KAATA,iBAAS,GAK1B,EAAA,CAAA,CAAA;;ACrKD,IAAkB,eAGjB,CAAA;AAHD,CAAA,UAAkB,eAAe,EAAA;AAC/B,IAAA,eAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,eAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACf,CAAC,EAHiB,eAAe,KAAf,eAAe,GAGhC,EAAA,CAAA,CAAA,CAAA;AAED,MAAM,6BAA6B,GAAGC,+BAAU,CAAC,CAAC,KAA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W,EAAE;AACX,gBAAA,IAAI,EAAE;AACJ,oBAAA,uBAAuB,CAAC,cAAc;oBAEtC,0BAA0B;AAC1B,oBAAA,2BAA2B,CAAC,cAAc;AAC1C,oBAAA,GAAG,0BAA0B;AAC9B,iBAAA;AACF,aAAA,EAAA,QAAA,EAEA,wCAAwC,EAAE,EACnC,CAAA,EACV;AACJ,KAAC,CAAC;IAEF,IAAI,SAAS,EAAE;QACb,IAAI,aAAa,EAAE;YACjB,OAAO,4BAA4B,EAAE,CAAC;SACvC;QACD,OAAOZ,cAAA,CAACa,qBAAM,EAAA,EAAC,EAAE,EAAC,aAAa,EAAE,QAAA,EAAA,4BAA4B,EAAE,EAAA,CAAU,CAAC;KAC3E;AACD,IAAA,OAAO,IAAI,CAAC;AACd,EAAE;AAEI,MAAO,oBAAqB,SAAQC,eAAqC,CAAA;IAC7E,OAAO,GAAA;;AACL,QAAA,CAAA,EAAA,GAAA,MAAA,IAAI,CAAC,KAAK,EAAC,SAAS,kDAAI,CAAC;KAC1B;IACD,MAAM,GAAA;AACJ,QAAA,OAAOd,eAAC,WAAW,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,IAAI,CAAC,KAAK,EAAI,CAAC;KACxC;AACF;;;;;;"}
@@ -1,93 +1,229 @@
1
- import { __assign } from 'tslib';
2
1
  import { jsxs, jsx } from 'react/jsx-runtime';
3
2
  import { Container } from '@cleartrip/ct-design-container';
4
3
  import { OutsideClickHandler } from '@cleartrip/ct-design-outside-click-handler';
5
4
  import { Overlay } from '@cleartrip/ct-design-overlay';
6
5
  import { Portal } from '@cleartrip/ct-design-portal';
7
6
  import { Transition } from '@cleartrip/ct-design-transition';
8
- import { useState, useEffect } from 'react';
7
+ import { useState, useEffect, Component } from 'react';
9
8
  import { ModalBack, Cross } from '@cleartrip/ct-design-icons';
10
9
  import { useTheme } from '@cleartrip/ct-design-theme';
10
+ import { makeStyles, useStyles } from '@cleartrip/ct-design-style-manager';
11
+ import { css } from '@emotion/css';
12
+ import { BaseDragger, BaseDraggerHeader } from '@cleartrip/ct-design-base-dragger';
11
13
 
14
+ var BottomSheetSnapPoint;
15
+ (function (BottomSheetSnapPoint) {
16
+ BottomSheetSnapPoint[BottomSheetSnapPoint["Hidden"] = 0] = "Hidden";
17
+ BottomSheetSnapPoint[BottomSheetSnapPoint["Partial"] = 1] = "Partial";
18
+ BottomSheetSnapPoint[BottomSheetSnapPoint["Full"] = 2] = "Full";
19
+ })(BottomSheetSnapPoint || (BottomSheetSnapPoint = {}));
12
20
  var DIRECTION;
13
21
  (function (DIRECTION) {
14
22
  DIRECTION["DOWN"] = "down";
15
23
  DIRECTION["UP"] = "up";
24
+ DIRECTION["LEFT"] = "left";
25
+ DIRECTION["RIGHT"] = "right";
16
26
  })(DIRECTION || (DIRECTION = {}));
17
27
 
18
- var getCloseButtonStyle = function (_a) {
19
- var theme = _a.theme, _b = _a.isTop, isTop = _b === void 0 ? true : _b;
20
- return (__assign({ position: 'absolute', right: '10px', backgroundColor: 'white', height: theme.size[8], width: theme.size[8], display: 'flex', alignItems: 'center', padding: theme.spacing[1], borderRadius: theme.border.radius['50P'], cursor: 'pointer', justifyContent: 'center' }, (isTop ? { top: '-44px' } : { bottom: '-44px' })));
21
- };
22
-
23
28
  var CLOSE_ICON_TYPE;
24
29
  (function (CLOSE_ICON_TYPE) {
25
30
  CLOSE_ICON_TYPE["CROSS"] = "CROSS";
26
31
  CLOSE_ICON_TYPE["BACK"] = "BACK";
27
32
  })(CLOSE_ICON_TYPE || (CLOSE_ICON_TYPE = {}));
28
- var BottomSheetHeader = function (props) {
29
- var handleClose = props.handleClose, styleConfig = props.styleConfig, isBack = props.isBack, children = props.children, _a = props.showBorderRadius, showBorderRadius = _a === void 0 ? true : _a, _b = props.direction, direction = _b === void 0 ? DIRECTION.DOWN : _b;
30
- var theme = useTheme();
31
- var headerContainer = (styleConfig || {}).headerContainer;
32
- var closeButtonStyles = getCloseButtonStyle({ theme: theme, isTop: direction === DIRECTION.DOWN });
33
- var getCloseIcon = function (isBack) {
34
- if (isBack === void 0) { isBack = false; }
33
+ const staticBottomSheetHeaderStyles = makeStyles((theme) => {
34
+ return {
35
+ headerContainer: {
36
+ backgroundColor: theme.color.background.neutral,
37
+ zIndex: theme.zIndex.bottomSheet,
38
+ },
39
+ headerContainerWithBorderRadius: {
40
+ backgroundColor: theme.color.background.neutral,
41
+ zIndex: theme.zIndex.bottomSheet,
42
+ borderTopLeftRadius: theme.border.radius[16],
43
+ borderTopRightRadius: theme.border.radius[16],
44
+ },
45
+ closeButton: {
46
+ position: 'absolute',
47
+ right: theme.spacing[2],
48
+ backgroundColor: theme.color.background.neutral,
49
+ height: theme.size[8],
50
+ width: theme.size[8],
51
+ display: 'flex',
52
+ alignItems: 'center',
53
+ padding: theme.spacing[1],
54
+ borderRadius: theme.border.radius[32],
55
+ cursor: 'pointer',
56
+ justifyContent: 'center',
57
+ },
58
+ };
59
+ });
60
+ const BottomSheetHeader = (props) => {
61
+ const { handleClose, styleConfig, isBack, children, showBorderRadius = true, hideHeaderDismissIcon = false, direction = DIRECTION.DOWN, } = props;
62
+ const theme = useTheme();
63
+ const { headerContainer: customHeaderContainerStyles = [], closeButton: customCloseButtonStyles = [] } = styleConfig || {};
64
+ const isTop = direction === DIRECTION.DOWN;
65
+ const dynamicCloseButtonStyles = useStyles((theme) => {
66
+ return {
67
+ closeButton: Object.assign({}, (isTop ? { top: -theme.spacing[10] } : { bottom: -theme.spacing[10] })),
68
+ };
69
+ }, [isTop]);
70
+ const getCloseIcon = (isBack = false) => {
71
+ if (hideHeaderDismissIcon) {
72
+ return null;
73
+ }
35
74
  if (isBack) {
36
75
  return jsx(ModalBack, {});
37
76
  }
38
77
  return jsx(Cross, { height: 24, width: 24, crossColor: theme.color.background.primary });
39
78
  };
40
- var CloseIcon = getCloseIcon(isBack);
41
- return (jsxs(Container, __assign({ className: headerContainer === null || headerContainer === void 0 ? void 0 : headerContainer.className, css: __assign(__assign({ backgroundColor: theme.color.background.neutral, zIndex: theme.zIndex.bottomSheet }, (showBorderRadius &&
42
- direction === DIRECTION.DOWN && {
43
- borderTopLeftRadius: theme.border.radius[16],
44
- borderTopRightRadius: theme.border.radius[16],
45
- })), headerContainer === null || headerContainer === void 0 ? void 0 : headerContainer.css) }, { children: [jsx(Container, __assign({ css: __assign({}, closeButtonStyles), onClick: handleClose }, { children: CloseIcon })), children] })));
79
+ const CloseIcon = getCloseIcon(isBack);
80
+ return (jsxs(Container, { styleConfig: {
81
+ root: [
82
+ showBorderRadius && direction === DIRECTION.DOWN
83
+ ? staticBottomSheetHeaderStyles.headerContainerWithBorderRadius
84
+ : staticBottomSheetHeaderStyles.headerContainer,
85
+ ...customHeaderContainerStyles,
86
+ ],
87
+ }, children: [jsx(Container, { styleConfig: {
88
+ root: [
89
+ staticBottomSheetHeaderStyles.closeButton,
90
+ dynamicCloseButtonStyles.closeButton,
91
+ ...customCloseButtonStyles,
92
+ ],
93
+ }, onClick: handleClose, children: CloseIcon }), children] }));
46
94
  };
47
- BottomSheetHeader.defaultProps = {};
48
95
 
49
- var slideDirection = {
96
+ const slideDirection = {
50
97
  up: 'down',
51
98
  down: 'up',
52
99
  };
53
- var handleWindowResize = function () {
54
- var vh = window.innerHeight * 0.01;
55
- document.documentElement.style.setProperty('--mvh', "".concat(vh, "px"));
100
+ const staticBottomSheetStyles = makeStyles((theme) => {
101
+ return {
102
+ bottomSheetContainer: {
103
+ position: 'relative',
104
+ width: '100%',
105
+ display: 'flex',
106
+ flexDirection: 'column',
107
+ maxHeight: 'calc(var(--mvh) * 92)',
108
+ boxShadow: theme.elevation.bottomE2,
109
+ },
110
+ overlayWrapper: {
111
+ top: 0,
112
+ left: 0,
113
+ right: 0,
114
+ bottom: 0,
115
+ display: 'flex',
116
+ flexDirection: 'column',
117
+ justifyContent: 'flex-end',
118
+ },
119
+ };
120
+ });
121
+ const webStaticBottomSheetStyles = css({
122
+ position: 'fixed',
123
+ });
124
+ const handleWindowResize = () => {
125
+ const vh = window.innerHeight * 0.01;
126
+ document.documentElement.style.setProperty('--mvh', `${vh}px`);
56
127
  };
57
- var BottomSheet = function (_a) {
58
- var _b = _a.direction, direction = _b === void 0 ? 'down' : _b, children = _a.children, header = _a.header, onClose = _a.onClose, _c = _a.isOpen, isOpen = _c === void 0 ? false : _c, _d = _a.transitionDuration, timeout = _d === void 0 ? 200 : _d, overlayCloseIcon = _a.overlayCloseIcon, _e = _a.allowedBackdropClose, allowedBackdropClose = _e === void 0 ? true : _e, _f = _a.showBorderRadius, showBorderRadius = _f === void 0 ? true : _f, _g = _a.styleConfig, styleConfig = _g === void 0 ? {} : _g, _h = _a.disableOutSideClick, disableOutSideClick = _h === void 0 ? false : _h;
59
- var _j = useState(isOpen), isVisible = _j[0], setIsVisible = _j[1];
60
- var theme = useTheme();
61
- useEffect(function () {
128
+ const BottomSheet = ({ open, onDismiss, backgroundColor: backdropColor, containerSheetBackgroundColor = 'white', cornerRadius = 16, showCloseButton = true, showBackButton = false, showBackdrop = true, children, header, direction = DIRECTION.DOWN, transitionDuration: timeout = 250, allowedBackdropClose = true, styleConfig = {}, disableOutSideClick = false, disablePortal = false, draggableConfig, }) => {
129
+ const [isVisible, setIsVisible] = useState(open);
130
+ useEffect(() => {
62
131
  handleWindowResize();
63
132
  window.addEventListener('resize', handleWindowResize);
64
- return function () {
133
+ return () => {
65
134
  window.removeEventListener('resize', handleWindowResize);
66
135
  };
67
136
  }, []);
68
- var _k = overlayCloseIcon || {}, _l = _k.show, show = _l === void 0 ? false : _l, _m = _k.isBack, isBack = _m === void 0 ? false : _m;
69
- var _o = styleConfig || {}, bottomSheetContainer = _o.bottomSheetContainer, overlayWrapper = _o.overlayWrapper;
70
- var handleCloseBottomSheet = function (event) {
137
+ const { bottomSheetContainer: customBottomSheetContainerStyles = [], overlayWrapper: customOverlayWrapperStyles = [], } = styleConfig || {};
138
+ const handleCloseBottomSheet = (event) => {
71
139
  if (disableOutSideClick)
72
140
  return;
73
141
  event.preventDefault();
74
- if (allowedBackdropClose && onClose) {
75
- onClose({ isClosedByOutSideClick: true });
142
+ if (allowedBackdropClose && onDismiss) {
143
+ onDismiss({ isClosedByOutSideClick: true });
76
144
  }
77
145
  };
78
- var handleExited = function () {
146
+ const handleExited = () => {
79
147
  setIsVisible(false);
80
148
  };
81
- useEffect(function () {
82
- if (isOpen) {
149
+ const handleClose = () => {
150
+ onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
151
+ };
152
+ useEffect(() => {
153
+ if (open) {
83
154
  setIsVisible(true);
84
155
  }
85
- }, [isOpen]);
156
+ }, [open]);
157
+ const dynamicBottomSheetContainerStyles = useStyles(() => {
158
+ return {
159
+ bottomSheetContainer: Object.assign(Object.assign({}, ((draggableConfig === null || draggableConfig === void 0 ? void 0 : draggableConfig.isDraggable) ? { height: undefined } : {})), { backgroundColor: containerSheetBackgroundColor, borderTopLeftRadius: cornerRadius, borderTopRightRadius: cornerRadius }),
160
+ };
161
+ }, [draggableConfig === null || draggableConfig === void 0 ? void 0 : draggableConfig.isDraggable, containerSheetBackgroundColor, cornerRadius]);
162
+ const dynamicOverlayWrapperStyles = useStyles((theme) => {
163
+ return {
164
+ overlayWrapper: Object.assign({ zIndex: theme.zIndex.bottomSheet, alignItems: DIRECTION.DOWN ? 'flex-end' : 'flex-start', backgroundColor: backdropColor || (!showBackdrop ? 'transparent' : undefined) }, (!showBackdrop
165
+ ? {
166
+ boxShadow: '0px -4px 16px 0px rgba(26, 26, 26, 0.08)',
167
+ }
168
+ : {})),
169
+ };
170
+ }, [showBackdrop, backdropColor, direction]);
171
+ const renderBottomsheetHeader = () => {
172
+ const headerComponent = (jsx(BottomSheetHeader, { direction: direction, showBorderRadius: cornerRadius > 0, handleClose: handleClose, isBack: showBackButton, children: header, hideHeaderDismissIcon: !showCloseButton }));
173
+ if (draggableConfig === null || draggableConfig === void 0 ? void 0 : draggableConfig.isDraggable) {
174
+ return jsx(BaseDraggerHeader, { children: headerComponent });
175
+ }
176
+ return headerComponent;
177
+ };
178
+ const renderBottomsheetWithTransition = ({ ref, onReactTransitionGroupEnd, }) => {
179
+ return (jsx(Transition, { type: 'slide', slideDirection: slideDirection[direction], timeout: timeout, mountOnEnter: true, unmountOnExit: true, appear: true, in: open, onExited: handleExited, onEntered: () => {
180
+ onReactTransitionGroupEnd && onReactTransitionGroupEnd();
181
+ }, children: jsx("div", { ref: ref, children: jsxs(Container, { styleConfig: {
182
+ root: [
183
+ staticBottomSheetStyles.bottomSheetContainer,
184
+ dynamicBottomSheetContainerStyles.bottomSheetContainer,
185
+ ...customBottomSheetContainerStyles,
186
+ ],
187
+ }, children: [showCloseButton && renderBottomsheetHeader(), children] }) }) }));
188
+ };
189
+ const renderBottomsheetWithDragger = () => {
190
+ if (draggableConfig === null || draggableConfig === void 0 ? void 0 : draggableConfig.isDraggable) {
191
+ return (jsx(BaseDragger, Object.assign({ isWrappedWithTransitionGroup: true }, draggableConfig, { isVisible: open, children: ({ ref, onReactTransitionGroupEnd }) => {
192
+ return renderBottomsheetWithTransition({ ref, onReactTransitionGroupEnd });
193
+ } })));
194
+ }
195
+ return renderBottomsheetWithTransition({});
196
+ };
197
+ const renderBottomsheetWithOutsideClickHandler = () => {
198
+ return (jsx(OutsideClickHandler, { disabled: disableOutSideClick, onOutsideClick: handleCloseBottomSheet, wrapperProps: { style: { width: '100%' } }, children: renderBottomsheetWithDragger() }));
199
+ };
200
+ const renderBottomsheetWithOverlay = () => {
201
+ return (jsx(Overlay, { blur: showBackdrop, styleConfig: {
202
+ root: [
203
+ staticBottomSheetStyles.overlayWrapper,
204
+ webStaticBottomSheetStyles,
205
+ dynamicOverlayWrapperStyles.overlayWrapper,
206
+ ...customOverlayWrapperStyles,
207
+ ],
208
+ }, children: renderBottomsheetWithOutsideClickHandler() }));
209
+ };
86
210
  if (isVisible) {
87
- return (jsx(Portal, { children: jsx(Overlay, __assign({ blur: true, customOverlayWrapperClass: overlayWrapper === null || overlayWrapper === void 0 ? void 0 : overlayWrapper.className, css: __assign({ position: 'fixed', bottom: 0, justifyContent: 'center', zIndex: theme.zIndex.bottomSheet, alignItems: "".concat(direction === 'down' ? 'flex-end' : 'flex-start') }, overlayWrapper === null || overlayWrapper === void 0 ? void 0 : overlayWrapper.css) }, { children: jsx(OutsideClickHandler, __assign({ disabled: disableOutSideClick, onOutsideClick: handleCloseBottomSheet, wrapperProps: { style: { width: '100%' } } }, { children: jsx(Transition, __assign({ type: 'slide', slideDirection: slideDirection[direction], timeout: timeout, mountOnEnter: true, unmountOnExit: true, appear: true, in: isOpen, onExited: handleExited }, { children: jsxs(Container, __assign({ className: bottomSheetContainer === null || bottomSheetContainer === void 0 ? void 0 : bottomSheetContainer.className, css: __assign({ position: 'relative', width: '100%', height: '100%', display: 'flex', flexDirection: 'column', background: 'white', borderTopLeftRadius: 16, borderTopRightRadius: 16, maxHeight: 'calc(var(--mvh) * 90)', boxShadow: theme.elevation.bottomE2 }, bottomSheetContainer === null || bottomSheetContainer === void 0 ? void 0 : bottomSheetContainer.css) }, { children: [show && (jsx(BottomSheetHeader, { direction: direction, showBorderRadius: showBorderRadius, handleClose: onClose, isBack: isBack, children: header })), children] })) })) })) })) }));
211
+ if (disablePortal) {
212
+ return renderBottomsheetWithOverlay();
213
+ }
214
+ return jsx(Portal, { id: 'bottomsheet', children: renderBottomsheetWithOverlay() });
88
215
  }
89
216
  return null;
90
217
  };
218
+ class BottomSheetComponent extends Component {
219
+ dismiss() {
220
+ var _a, _b;
221
+ (_b = (_a = this.props).onDismiss) === null || _b === void 0 ? void 0 : _b.call(_a);
222
+ }
223
+ render() {
224
+ return jsx(BottomSheet, Object.assign({}, this.props));
225
+ }
226
+ }
91
227
 
92
- export { BottomSheet, BottomSheetHeader, DIRECTION };
228
+ export { BottomSheet, BottomSheetComponent, BottomSheetHeader, BottomSheetSnapPoint, DIRECTION };
93
229
  //# sourceMappingURL=ct-design-bottomsheet.esm.js.map