@rahmatsaputra-my-id/react-js-library 0.0.98 → 0.0.99

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.
@@ -4,6 +4,8 @@ export interface BottomSheetProps {
4
4
  onClose: () => void;
5
5
  title?: string;
6
6
  children?: ReactNode;
7
+ containerStyles?: any;
8
+ showCloseButton: boolean;
7
9
  }
8
10
  export interface StyleMap {
9
11
  [key: string]: CSSProperties;
package/dist/index.es.js CHANGED
@@ -142,8 +142,8 @@ var styles$l = {
142
142
  };
143
143
 
144
144
  var BottomSheet = function (_a) {
145
- var visible = _a.visible, onClose = _a.onClose, _b = _a.title, title = _b === void 0 ? '' : _b, children = _a.children;
146
- var _c = useState(20), paddingBottom = _c[0], setPaddingBottom = _c[1];
145
+ var visible = _a.visible, onClose = _a.onClose, _b = _a.title, title = _b === void 0 ? '' : _b, children = _a.children, containerStyles = _a.containerStyles, _c = _a.showCloseButton, showCloseButton = _c === void 0 ? true : _c;
146
+ var _d = useState(20), paddingBottom = _d[0], setPaddingBottom = _d[1];
147
147
  useEffect(function () {
148
148
  function detectPadding() {
149
149
  var basePadding = 20;
@@ -186,7 +186,7 @@ var BottomSheet = function (_a) {
186
186
  }, [visible, onClose]);
187
187
  if (!visible)
188
188
  return null;
189
- return ReactDOM.createPortal(jsx("div", __assign({ style: styles$l.backdrop, onClick: onClose }, { children: jsxs("div", __assign({ style: __assign(__assign({}, styles$l.sheet), { paddingBottom: paddingBottom }), onClick: function (e) { return e.stopPropagation(); } }, { children: [jsxs("div", __assign({ style: styles$l.header }, { children: [jsx("span", __assign({ style: styles$l.title }, { children: title })), jsx("button", __assign({ style: styles$l.closeButton, onClick: onClose }, { children: "\u00D7" }))] })), jsx("div", __assign({ style: styles$l.content }, { children: children }))] })) })), document.body);
189
+ return ReactDOM.createPortal(jsx("div", __assign({ style: styles$l.backdrop, onClick: onClose }, { children: jsxs("div", __assign({ style: __assign(__assign(__assign({}, styles$l.sheet), containerStyles), { paddingBottom: paddingBottom }), onClick: function (e) { return e.stopPropagation(); } }, { children: [jsxs("div", __assign({ style: styles$l.header }, { children: [jsx("span", __assign({ style: styles$l.title }, { children: title })), showCloseButton ? (jsx("button", { style: styles$l.closeButton, onClick: onClose, children: 'x' })) : null] })), jsx("div", __assign({ style: styles$l.content }, { children: children }))] })) })), document.body);
190
190
  };
191
191
 
192
192
  var styles$k = {
package/dist/index.js CHANGED
@@ -151,8 +151,8 @@ var styles$l = {
151
151
  };
152
152
 
153
153
  var BottomSheet = function (_a) {
154
- var visible = _a.visible, onClose = _a.onClose, _b = _a.title, title = _b === void 0 ? '' : _b, children = _a.children;
155
- var _c = React.useState(20), paddingBottom = _c[0], setPaddingBottom = _c[1];
154
+ var visible = _a.visible, onClose = _a.onClose, _b = _a.title, title = _b === void 0 ? '' : _b, children = _a.children, containerStyles = _a.containerStyles, _c = _a.showCloseButton, showCloseButton = _c === void 0 ? true : _c;
155
+ var _d = React.useState(20), paddingBottom = _d[0], setPaddingBottom = _d[1];
156
156
  React.useEffect(function () {
157
157
  function detectPadding() {
158
158
  var basePadding = 20;
@@ -195,7 +195,7 @@ var BottomSheet = function (_a) {
195
195
  }, [visible, onClose]);
196
196
  if (!visible)
197
197
  return null;
198
- return ReactDOM__default["default"].createPortal(jsxRuntime.jsx("div", __assign({ style: styles$l.backdrop, onClick: onClose }, { children: jsxRuntime.jsxs("div", __assign({ style: __assign(__assign({}, styles$l.sheet), { paddingBottom: paddingBottom }), onClick: function (e) { return e.stopPropagation(); } }, { children: [jsxRuntime.jsxs("div", __assign({ style: styles$l.header }, { children: [jsxRuntime.jsx("span", __assign({ style: styles$l.title }, { children: title })), jsxRuntime.jsx("button", __assign({ style: styles$l.closeButton, onClick: onClose }, { children: "\u00D7" }))] })), jsxRuntime.jsx("div", __assign({ style: styles$l.content }, { children: children }))] })) })), document.body);
198
+ return ReactDOM__default["default"].createPortal(jsxRuntime.jsx("div", __assign({ style: styles$l.backdrop, onClick: onClose }, { children: jsxRuntime.jsxs("div", __assign({ style: __assign(__assign(__assign({}, styles$l.sheet), containerStyles), { paddingBottom: paddingBottom }), onClick: function (e) { return e.stopPropagation(); } }, { children: [jsxRuntime.jsxs("div", __assign({ style: styles$l.header }, { children: [jsxRuntime.jsx("span", __assign({ style: styles$l.title }, { children: title })), showCloseButton ? (jsxRuntime.jsx("button", { style: styles$l.closeButton, onClick: onClose, children: 'x' })) : null] })), jsxRuntime.jsx("div", __assign({ style: styles$l.content }, { children: children }))] })) })), document.body);
199
199
  };
200
200
 
201
201
  var styles$k = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rahmatsaputra-my-id/react-js-library",
3
- "version": "0.0.98",
3
+ "version": "0.0.99",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",