flipper-ui 0.25.10 → 0.25.11
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.
- package/core/Dialog.d.ts +1 -1
- package/package.json +1 -1
- package/stories/Dialog.stories.js +32 -2
package/core/Dialog.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ interface DialogProps extends DefaultProps {
|
|
|
21
21
|
snippetContentStyle?: CSSProperties;
|
|
22
22
|
contentTextStyle?: CSSProperties;
|
|
23
23
|
scroll?: 'body' | 'paper' | 'unset-paper' | 'unset-body';
|
|
24
|
-
onClose?: () => void;
|
|
24
|
+
onClose?: (event: Event) => void;
|
|
25
25
|
}
|
|
26
26
|
declare const Dialog: FC<DialogProps>;
|
|
27
27
|
export default Dialog;
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.WithTypography = exports.Default = exports["default"] = void 0;
|
|
10
|
+
exports.WithTypography = exports.WithAlertOnClose = exports.Default = exports["default"] = void 0;
|
|
11
11
|
|
|
12
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
13
|
|
|
@@ -52,12 +52,42 @@ var Default = function Default() {
|
|
|
52
52
|
|
|
53
53
|
exports.Default = Default;
|
|
54
54
|
|
|
55
|
-
var
|
|
55
|
+
var WithAlertOnClose = function WithAlertOnClose() {
|
|
56
56
|
var _useState3 = (0, _react.useState)(false),
|
|
57
57
|
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
58
58
|
open = _useState4[0],
|
|
59
59
|
setOpen = _useState4[1];
|
|
60
60
|
|
|
61
|
+
var handleClose = function handleClose(e) {
|
|
62
|
+
e.preventDefault();
|
|
63
|
+
alert('I prevented dialog to close');
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
67
|
+
onClick: function onClick() {
|
|
68
|
+
return setOpen(true);
|
|
69
|
+
}
|
|
70
|
+
}, "Open dialog"), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
71
|
+
open: open,
|
|
72
|
+
title: "My beautiful Dialog",
|
|
73
|
+
text: 'Isn\'t it?',
|
|
74
|
+
onClose: handleClose,
|
|
75
|
+
actions: /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
76
|
+
onClick: function onClick() {
|
|
77
|
+
return setOpen(false);
|
|
78
|
+
}
|
|
79
|
+
}, "Close dialog")
|
|
80
|
+
}));
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
exports.WithAlertOnClose = WithAlertOnClose;
|
|
84
|
+
|
|
85
|
+
var WithTypography = function WithTypography() {
|
|
86
|
+
var _useState5 = (0, _react.useState)(false),
|
|
87
|
+
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
|
88
|
+
open = _useState6[0],
|
|
89
|
+
setOpen = _useState6[1];
|
|
90
|
+
|
|
61
91
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
62
92
|
onClick: function onClick() {
|
|
63
93
|
return setOpen(true);
|