@activecollab/components 2.0.435 → 2.0.436
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/dist/cjs/components/ConfirmDialog/ConfirmDialog.js +6 -5
- package/dist/cjs/components/ConfirmDialog/ConfirmDialog.js.map +1 -1
- package/dist/cjs/components/Dialog/Dialog.js +65 -43
- package/dist/cjs/components/Dialog/Dialog.js.map +1 -1
- package/dist/cjs/components/Dialog/DialogActions.js +13 -5
- package/dist/cjs/components/Dialog/DialogActions.js.map +1 -1
- package/dist/cjs/components/Dialog/DialogContent.js +4 -5
- package/dist/cjs/components/Dialog/DialogContent.js.map +1 -1
- package/dist/cjs/components/Dialog/DialogContext.js +14 -7
- package/dist/cjs/components/Dialog/DialogContext.js.map +1 -1
- package/dist/cjs/components/Dialog/DialogTitle.js +19 -5
- package/dist/cjs/components/Dialog/DialogTitle.js.map +1 -1
- package/dist/cjs/components/Dialog/Styles.js +55 -13
- package/dist/cjs/components/Dialog/Styles.js.map +1 -1
- package/dist/cjs/components/Dialog/index.js +11 -0
- package/dist/cjs/components/Dialog/index.js.map +1 -1
- package/dist/cjs/components/Modal/Modal.js +3 -2
- package/dist/cjs/components/Modal/Modal.js.map +1 -1
- package/dist/cjs/components/Transitions/Fade/Fade.js +11 -2
- package/dist/cjs/components/Transitions/Fade/Fade.js.map +1 -1
- package/dist/cjs/components/Transitions/SlideFromTop/SlideFromTop.js +46 -30
- package/dist/cjs/components/Transitions/SlideFromTop/SlideFromTop.js.map +1 -1
- package/dist/cjs/components/Wizard/Step.js +4 -1
- package/dist/cjs/components/Wizard/Step.js.map +1 -1
- package/dist/cjs/components/Wizard/Wizard.js +14 -2
- package/dist/cjs/components/Wizard/Wizard.js.map +1 -1
- package/dist/esm/components/ConfirmDialog/ConfirmDialog.d.ts +3 -0
- package/dist/esm/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -1
- package/dist/esm/components/ConfirmDialog/ConfirmDialog.js +6 -5
- package/dist/esm/components/ConfirmDialog/ConfirmDialog.js.map +1 -1
- package/dist/esm/components/Dialog/Dialog.d.ts +7 -2
- package/dist/esm/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/esm/components/Dialog/Dialog.js +65 -48
- package/dist/esm/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/components/Dialog/DialogActions.d.ts.map +1 -1
- package/dist/esm/components/Dialog/DialogActions.js +10 -5
- package/dist/esm/components/Dialog/DialogActions.js.map +1 -1
- package/dist/esm/components/Dialog/DialogContent.d.ts +5 -1
- package/dist/esm/components/Dialog/DialogContent.d.ts.map +1 -1
- package/dist/esm/components/Dialog/DialogContent.js +4 -5
- package/dist/esm/components/Dialog/DialogContent.js.map +1 -1
- package/dist/esm/components/Dialog/DialogContext.d.ts +11 -1
- package/dist/esm/components/Dialog/DialogContext.d.ts.map +1 -1
- package/dist/esm/components/Dialog/DialogContext.js +10 -8
- package/dist/esm/components/Dialog/DialogContext.js.map +1 -1
- package/dist/esm/components/Dialog/DialogTitle.d.ts +4 -1
- package/dist/esm/components/Dialog/DialogTitle.d.ts.map +1 -1
- package/dist/esm/components/Dialog/DialogTitle.js +20 -6
- package/dist/esm/components/Dialog/DialogTitle.js.map +1 -1
- package/dist/esm/components/Dialog/Styles.d.ts +19 -2
- package/dist/esm/components/Dialog/Styles.d.ts.map +1 -1
- package/dist/esm/components/Dialog/Styles.js +47 -11
- package/dist/esm/components/Dialog/Styles.js.map +1 -1
- package/dist/esm/components/Dialog/index.d.ts +1 -0
- package/dist/esm/components/Dialog/index.d.ts.map +1 -1
- package/dist/esm/components/Dialog/index.js +1 -0
- package/dist/esm/components/Dialog/index.js.map +1 -1
- package/dist/esm/components/Modal/Modal.d.ts.map +1 -1
- package/dist/esm/components/Modal/Modal.js +3 -2
- package/dist/esm/components/Modal/Modal.js.map +1 -1
- package/dist/esm/components/Transitions/Fade/Fade.d.ts.map +1 -1
- package/dist/esm/components/Transitions/Fade/Fade.js +11 -2
- package/dist/esm/components/Transitions/Fade/Fade.js.map +1 -1
- package/dist/esm/components/Transitions/SlideFromTop/SlideFromTop.d.ts +2 -0
- package/dist/esm/components/Transitions/SlideFromTop/SlideFromTop.d.ts.map +1 -1
- package/dist/esm/components/Transitions/SlideFromTop/SlideFromTop.js +46 -30
- package/dist/esm/components/Transitions/SlideFromTop/SlideFromTop.js.map +1 -1
- package/dist/esm/components/Wizard/Step.d.ts +4 -0
- package/dist/esm/components/Wizard/Step.d.ts.map +1 -1
- package/dist/esm/components/Wizard/Step.js +4 -1
- package/dist/esm/components/Wizard/Step.js.map +1 -1
- package/dist/esm/components/Wizard/Wizard.d.ts +3 -0
- package/dist/esm/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/esm/components/Wizard/Wizard.js +14 -2
- package/dist/esm/components/Wizard/Wizard.js.map +1 -1
- package/dist/index.js +257 -116
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15572,7 +15572,7 @@
|
|
|
15572
15572
|
return props.$isLight && styled.css(["background-color:var(--page-paper-main);box-shadow:var(--shadow-secondary);color:var(--color-theme-700);"]);
|
|
15573
15573
|
});
|
|
15574
15574
|
|
|
15575
|
-
var defaultStyle$
|
|
15575
|
+
var defaultStyle$2 = {
|
|
15576
15576
|
transitionProperty: "opacity, transform",
|
|
15577
15577
|
transitionDuration: ".15s, .10s, .15s",
|
|
15578
15578
|
transitionTimingFunction: "ease, ease, cubic-bezier(0.39, 0.575, 0.565, 1)",
|
|
@@ -15580,7 +15580,7 @@
|
|
|
15580
15580
|
transform: "scale(.85)",
|
|
15581
15581
|
opacity: 0
|
|
15582
15582
|
};
|
|
15583
|
-
var transitionStyles$
|
|
15583
|
+
var transitionStyles$3 = {
|
|
15584
15584
|
entering: {
|
|
15585
15585
|
opacity: 1,
|
|
15586
15586
|
transform: "scale(1)",
|
|
@@ -15618,7 +15618,7 @@
|
|
|
15618
15618
|
return /*#__PURE__*/React.cloneElement(children, {
|
|
15619
15619
|
style: _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
15620
15620
|
visibility: state === "exited" && !inProp ? "hidden" : undefined
|
|
15621
|
-
}, defaultStyle$
|
|
15621
|
+
}, defaultStyle$2), transitionStyles$3[state]), style), children.props.style)
|
|
15622
15622
|
});
|
|
15623
15623
|
});
|
|
15624
15624
|
};
|
|
@@ -16040,6 +16040,24 @@
|
|
|
16040
16040
|
});
|
|
16041
16041
|
Checkbox.displayName = "Checkbox";
|
|
16042
16042
|
|
|
16043
|
+
var DialogContext = /*#__PURE__*/React.createContext(null);
|
|
16044
|
+
var useDialogContext = function useDialogContext() {
|
|
16045
|
+
return React.useContext(DialogContext);
|
|
16046
|
+
};
|
|
16047
|
+
|
|
16048
|
+
/**
|
|
16049
|
+
* Closes the dialog the way clicking the overlay does: the exit transition runs first, and the
|
|
16050
|
+
* dialog's own onClose fires once it finishes. Use it for a Cancel button instead of calling the
|
|
16051
|
+
* parent's close handler, which would unmount the dialog before it can animate out.
|
|
16052
|
+
*/
|
|
16053
|
+
var useDialogClose = function useDialogClose(fallback) {
|
|
16054
|
+
var _ref, _context$requestClose;
|
|
16055
|
+
var context = React.useContext(DialogContext);
|
|
16056
|
+
return (_ref = (_context$requestClose = context === null || context === void 0 ? void 0 : context.requestClose) !== null && _context$requestClose !== void 0 ? _context$requestClose : fallback) !== null && _ref !== void 0 ? _ref : function () {
|
|
16057
|
+
return undefined;
|
|
16058
|
+
};
|
|
16059
|
+
};
|
|
16060
|
+
|
|
16043
16061
|
var size = {
|
|
16044
16062
|
sm: "640px",
|
|
16045
16063
|
md: "768px",
|
|
@@ -16066,57 +16084,104 @@
|
|
|
16066
16084
|
xxl: "@media (max-width: ".concat(below(size.xxl), ")")
|
|
16067
16085
|
};
|
|
16068
16086
|
|
|
16087
|
+
var dialogSizes = {
|
|
16088
|
+
s: 440,
|
|
16089
|
+
m: 540,
|
|
16090
|
+
l: 700,
|
|
16091
|
+
xl: 840,
|
|
16092
|
+
xxl: 1000,
|
|
16093
|
+
xxxl: 1120
|
|
16094
|
+
};
|
|
16095
|
+
var MIN_GAP = "2.5vh";
|
|
16096
|
+
var MAX_DIALOG_HEIGHT = "95vh";
|
|
16097
|
+
|
|
16098
|
+
// The dialog hangs at a fixed offset while there is room below it, then grows in both directions at
|
|
16099
|
+
// once. Two shrinkable spacers express that: only the lower one grows, and past the crossover both
|
|
16100
|
+
// shrink from the same basis, so the gaps stay equal down to MIN_GAP.
|
|
16101
|
+
var StyledDialogViewport = styled__default["default"].div.withConfig({
|
|
16102
|
+
displayName: "Styles__StyledDialogViewport",
|
|
16103
|
+
componentId: "sc-jwpvgm-0"
|
|
16104
|
+
})(["position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;padding-left:16px;padding-right:16px;pointer-events:none;--ac-dialog-offset:60px;", "{--ac-dialog-offset:126px;}&::before,&::after{content:\"\";flex-shrink:1;flex-basis:var(--ac-dialog-offset);min-height:", ";}&::before{flex-grow:0;}&::after{flex-grow:1;}", ""], screen.sm, MIN_GAP, BoxSizingStyle);
|
|
16105
|
+
StyledDialogViewport.displayName = "StyledDialogViewport";
|
|
16069
16106
|
var StyledDialog = styled__default["default"].div.withConfig({
|
|
16070
16107
|
displayName: "Styles__StyledDialog",
|
|
16071
|
-
componentId: "sc-jwpvgm-
|
|
16072
|
-
})(["display:flex;flex-direction:column;flex:
|
|
16108
|
+
componentId: "sc-jwpvgm-1"
|
|
16109
|
+
})(["display:flex;flex-direction:column;flex:0 0 auto;pointer-events:auto;width:100%;max-width:", "px;max-height:", ";background-color:var(--page-paper-main);color:var(--color-theme-900);box-shadow:var(--shadow-primary);border-radius:8px;position:relative;transition:max-width 0.2s ease,height 0.2s ease;@media (prefers-reduced-motion:reduce){transition:none;}", " ", " ", ""], function (props) {
|
|
16110
|
+
return props.$maxWidth;
|
|
16111
|
+
}, MAX_DIALOG_HEIGHT, function (props) {
|
|
16112
|
+
return props.$height && styled.css(["height:", ";"], props.$height);
|
|
16113
|
+
}, FontStyle, BoxSizingStyle);
|
|
16073
16114
|
StyledDialog.displayName = "StyledDialog";
|
|
16074
16115
|
var StyledDialogTitle = styled__default["default"].div.withConfig({
|
|
16075
16116
|
displayName: "Styles__StyledDialogTitle",
|
|
16076
|
-
componentId: "sc-jwpvgm-
|
|
16077
|
-
})(["padding:20px 30px;", " ", ""], FontStyle, BoxSizingStyle);
|
|
16117
|
+
componentId: "sc-jwpvgm-2"
|
|
16118
|
+
})(["padding:20px 30px;flex:0 0 auto;", " ", ""], FontStyle, BoxSizingStyle);
|
|
16078
16119
|
StyledDialogTitle.displayName = "StyledDialogTitle";
|
|
16120
|
+
|
|
16121
|
+
// The close button hangs 8px into the title padding, so it sits nearer the dialog edge than the
|
|
16122
|
+
// heading does. The bar reserves the rest, which keeps the gap to the heading unchanged.
|
|
16123
|
+
var CLOSE_OFFSET = 8;
|
|
16124
|
+
var CLOSE_RESERVE = 44 - CLOSE_OFFSET;
|
|
16125
|
+
|
|
16126
|
+
// The header is as tall as its heading, with or without a close button.
|
|
16127
|
+
var StyledDialogTitleBar = styled__default["default"].div.withConfig({
|
|
16128
|
+
displayName: "Styles__StyledDialogTitleBar",
|
|
16129
|
+
componentId: "sc-jwpvgm-3"
|
|
16130
|
+
})(["position:relative;display:flex;align-items:center;padding-right:", "px;"], CLOSE_RESERVE);
|
|
16131
|
+
StyledDialogTitleBar.displayName = "StyledDialogTitleBar";
|
|
16132
|
+
var StyledDialogTitleClose = styled__default["default"].div.withConfig({
|
|
16133
|
+
displayName: "Styles__StyledDialogTitleClose",
|
|
16134
|
+
componentId: "sc-jwpvgm-4"
|
|
16135
|
+
})(["position:absolute;right:-", "px;top:50%;transform:translateY(-50%);line-height:0;"], CLOSE_OFFSET);
|
|
16136
|
+
StyledDialogTitleClose.displayName = "StyledDialogTitleClose";
|
|
16079
16137
|
var StyledDialogContent = styled__default["default"].div.withConfig({
|
|
16080
16138
|
displayName: "Styles__StyledDialogContent",
|
|
16081
|
-
componentId: "sc-jwpvgm-
|
|
16082
|
-
})(["padding:20px 30px;
|
|
16139
|
+
componentId: "sc-jwpvgm-5"
|
|
16140
|
+
})(["padding:20px 30px;flex:1 1 auto;min-height:0;overflow-y:", ";", " ", ""], function (props) {
|
|
16141
|
+
return props.$scroll ? "auto" : "visible";
|
|
16142
|
+
}, FontStyle, BoxSizingStyle);
|
|
16083
16143
|
StyledDialogContent.displayName = "StyledDialogContent";
|
|
16084
16144
|
var StyledDialogContentDivider = styled__default["default"].div.withConfig({
|
|
16085
16145
|
displayName: "Styles__StyledDialogContentDivider",
|
|
16086
|
-
componentId: "sc-jwpvgm-
|
|
16087
|
-
})(["border-top:1px solid var(--border-primary);height:1px;"]);
|
|
16146
|
+
componentId: "sc-jwpvgm-6"
|
|
16147
|
+
})(["border-top:1px solid var(--border-primary);height:1px;flex:0 0 auto;"]);
|
|
16088
16148
|
StyledDialogContentDivider.displayName = "StyledDialogContentDivider";
|
|
16089
16149
|
var StyledDialogActions = styled__default["default"].div.withConfig({
|
|
16090
16150
|
displayName: "Styles__StyledDialogActions",
|
|
16091
|
-
componentId: "sc-jwpvgm-
|
|
16092
|
-
})(["padding:20px 30px;", " ", ""], FontStyle, BoxSizingStyle);
|
|
16151
|
+
componentId: "sc-jwpvgm-7"
|
|
16152
|
+
})(["padding:20px 30px;flex:0 0 auto;display:flex;align-items:center;gap:12px;", " ", ""], FontStyle, BoxSizingStyle);
|
|
16093
16153
|
StyledDialogActions.displayName = "StyledDialogActions";
|
|
16094
16154
|
|
|
16095
16155
|
var _excluded$1u = ["className", "children"];
|
|
16096
|
-
// import { useDialogContext } from "./DialogContext";
|
|
16097
|
-
|
|
16098
16156
|
var DialogActions = function DialogActions(_ref) {
|
|
16099
16157
|
var className = _ref.className,
|
|
16100
16158
|
children = _ref.children,
|
|
16101
16159
|
rest = _objectWithoutProperties(_ref, _excluded$1u);
|
|
16102
|
-
|
|
16103
|
-
|
|
16160
|
+
var dialog = useDialogContext();
|
|
16161
|
+
|
|
16162
|
+
// A footer button that does nothing but close gets the same path as clicking the overlay, so the
|
|
16163
|
+
// exit transition runs before the caller unmounts the dialog. Matching on identity leaves a
|
|
16164
|
+
// button that does anything else alone.
|
|
16165
|
+
var wired = dialog !== null && dialog !== void 0 && dialog.requestClose && dialog !== null && dialog !== void 0 && dialog.onClose ? React.Children.map(children, function (child) {
|
|
16166
|
+
return /*#__PURE__*/React.isValidElement(child) && child.props.onClick === dialog.onClose ? /*#__PURE__*/React.cloneElement(child, {
|
|
16167
|
+
onClick: dialog.requestClose
|
|
16168
|
+
}) : child;
|
|
16169
|
+
}) : children;
|
|
16104
16170
|
return /*#__PURE__*/React__default["default"].createElement(StyledDialogActions, _extends({
|
|
16105
16171
|
className: classNames__default["default"]("c-dialog-actions", className)
|
|
16106
|
-
}, rest),
|
|
16172
|
+
}, rest), wired);
|
|
16107
16173
|
};
|
|
16108
16174
|
DialogActions.displayName = "DialogActions";
|
|
16109
16175
|
|
|
16110
|
-
var _excluded$1t = ["className", "children"];
|
|
16111
|
-
// import { useDialogContext } from "./DialogContext";
|
|
16112
|
-
|
|
16176
|
+
var _excluded$1t = ["className", "children", "scroll"];
|
|
16113
16177
|
var DialogContent = function DialogContent(_ref) {
|
|
16114
16178
|
var className = _ref.className,
|
|
16115
16179
|
children = _ref.children,
|
|
16180
|
+
_ref$scroll = _ref.scroll,
|
|
16181
|
+
scroll = _ref$scroll === void 0 ? true : _ref$scroll,
|
|
16116
16182
|
rest = _objectWithoutProperties(_ref, _excluded$1t);
|
|
16117
|
-
// useDialogContext();
|
|
16118
|
-
|
|
16119
16183
|
return /*#__PURE__*/React__default["default"].createElement(StyledDialogContent, _extends({
|
|
16184
|
+
$scroll: scroll,
|
|
16120
16185
|
className: classNames__default["default"]("c-dialog-content", className)
|
|
16121
16186
|
}, rest), children);
|
|
16122
16187
|
};
|
|
@@ -16146,20 +16211,31 @@
|
|
|
16146
16211
|
});
|
|
16147
16212
|
Header3.displayName = "Header3";
|
|
16148
16213
|
|
|
16149
|
-
var _excluded$1r = ["children", "className", "disableDefaultHeading"];
|
|
16150
|
-
// import { useDialogContext } from "./DialogContext";
|
|
16151
|
-
|
|
16214
|
+
var _excluded$1r = ["children", "className", "disableDefaultHeading", "onClose", "closeLabel"];
|
|
16152
16215
|
var DialogTitle = function DialogTitle(_ref) {
|
|
16216
|
+
var _dialog$requestClose;
|
|
16153
16217
|
var children = _ref.children,
|
|
16154
16218
|
className = _ref.className,
|
|
16155
16219
|
_ref$disableDefaultHe = _ref.disableDefaultHeading,
|
|
16156
16220
|
disableDefaultHeading = _ref$disableDefaultHe === void 0 ? false : _ref$disableDefaultHe,
|
|
16221
|
+
onClose = _ref.onClose,
|
|
16222
|
+
_ref$closeLabel = _ref.closeLabel,
|
|
16223
|
+
closeLabel = _ref$closeLabel === void 0 ? "Close" : _ref$closeLabel,
|
|
16157
16224
|
rest = _objectWithoutProperties(_ref, _excluded$1r);
|
|
16158
|
-
|
|
16225
|
+
var dialog = useDialogContext();
|
|
16226
|
+
var heading = disableDefaultHeading ? children : /*#__PURE__*/React__default["default"].createElement(Header3, null, children);
|
|
16159
16227
|
|
|
16228
|
+
// Closing through the dialog lets the exit transition run; the caller's onClose fires once it
|
|
16229
|
+
// finishes. Falling back keeps a title used outside a dialog working.
|
|
16230
|
+
var handleClose = (_dialog$requestClose = dialog === null || dialog === void 0 ? void 0 : dialog.requestClose) !== null && _dialog$requestClose !== void 0 ? _dialog$requestClose : onClose;
|
|
16160
16231
|
return /*#__PURE__*/React__default["default"].createElement(StyledDialogTitle, _extends({
|
|
16161
16232
|
className: classNames__default["default"]("c-dialog-title-wrapper", className)
|
|
16162
|
-
}, rest),
|
|
16233
|
+
}, rest), onClose ? /*#__PURE__*/React__default["default"].createElement(StyledDialogTitleBar, null, heading, /*#__PURE__*/React__default["default"].createElement(StyledDialogTitleClose, null, /*#__PURE__*/React__default["default"].createElement(IconButton, {
|
|
16234
|
+
type: "button",
|
|
16235
|
+
variant: "text gray",
|
|
16236
|
+
"aria-label": closeLabel,
|
|
16237
|
+
onClick: handleClose
|
|
16238
|
+
}, /*#__PURE__*/React__default["default"].createElement(CancelCrossIcon$1, null)))) : heading);
|
|
16163
16239
|
};
|
|
16164
16240
|
DialogTitle.displayName = "DialogTitle";
|
|
16165
16241
|
|
|
@@ -16250,11 +16326,12 @@
|
|
|
16250
16326
|
props = {
|
|
16251
16327
|
onEnter: createChainedFunction(handleEnter, children.props.onEnter),
|
|
16252
16328
|
onExited: createChainedFunction(handleExited, children.props.onExited),
|
|
16253
|
-
in: open
|
|
16329
|
+
in: open,
|
|
16330
|
+
forceClose: handleClose
|
|
16254
16331
|
};
|
|
16255
16332
|
}
|
|
16256
16333
|
return props;
|
|
16257
|
-
}, [children, handleEnter, handleExited, hasTransition, open]);
|
|
16334
|
+
}, [children, handleClose, handleEnter, handleExited, hasTransition, open]);
|
|
16258
16335
|
if (!open && (!hasTransition || exited)) {
|
|
16259
16336
|
return null;
|
|
16260
16337
|
}
|
|
@@ -16271,14 +16348,14 @@
|
|
|
16271
16348
|
});
|
|
16272
16349
|
Modal.displayName = "Modal";
|
|
16273
16350
|
|
|
16274
|
-
var _excluded$1p = ["in", "children", "style", "timeout"];
|
|
16275
|
-
var defaultStyle$
|
|
16351
|
+
var _excluded$1p = ["in", "children", "style", "timeout", "onEnter"];
|
|
16352
|
+
var defaultStyle$1 = function defaultStyle(duration) {
|
|
16276
16353
|
return {
|
|
16277
16354
|
transition: "all ".concat(duration, "ms ease-in-out"),
|
|
16278
16355
|
opacity: 0
|
|
16279
16356
|
};
|
|
16280
16357
|
};
|
|
16281
|
-
var transitionStyles$
|
|
16358
|
+
var transitionStyles$2 = {
|
|
16282
16359
|
entering: {
|
|
16283
16360
|
opacity: 1
|
|
16284
16361
|
},
|
|
@@ -16299,16 +16376,25 @@
|
|
|
16299
16376
|
style = _ref.style,
|
|
16300
16377
|
_ref$timeout = _ref.timeout,
|
|
16301
16378
|
timeout = _ref$timeout === void 0 ? 500 : _ref$timeout,
|
|
16379
|
+
onEnter = _ref.onEnter,
|
|
16302
16380
|
rest = _objectWithoutProperties(_ref, _excluded$1p);
|
|
16381
|
+
// Same forced layout as SlideFromTop: without it the starting opacity never lands in the DOM.
|
|
16382
|
+
var handleEnter = function handleEnter(node, isAppearing) {
|
|
16383
|
+
if (node) {
|
|
16384
|
+
void node.offsetHeight;
|
|
16385
|
+
}
|
|
16386
|
+
onEnter === null || onEnter === void 0 || onEnter(node, isAppearing);
|
|
16387
|
+
};
|
|
16303
16388
|
return /*#__PURE__*/React__default["default"].createElement(reactTransitionGroup.Transition, _extends({
|
|
16304
16389
|
appear: true,
|
|
16305
16390
|
in: inProp,
|
|
16306
|
-
timeout: timeout
|
|
16391
|
+
timeout: timeout,
|
|
16392
|
+
onEnter: handleEnter
|
|
16307
16393
|
}, rest), function (state) {
|
|
16308
16394
|
return /*#__PURE__*/React.cloneElement(children, {
|
|
16309
16395
|
style: _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
16310
16396
|
visibility: state === "exited" && !inProp ? "hidden" : undefined
|
|
16311
|
-
}, defaultStyle$
|
|
16397
|
+
}, defaultStyle$1(timeout)), transitionStyles$2[state]), style), children.props.style)
|
|
16312
16398
|
});
|
|
16313
16399
|
});
|
|
16314
16400
|
};
|
|
@@ -16371,33 +16457,37 @@
|
|
|
16371
16457
|
};
|
|
16372
16458
|
Slide.displayName = "Slide";
|
|
16373
16459
|
|
|
16374
|
-
var
|
|
16375
|
-
|
|
16376
|
-
|
|
16377
|
-
|
|
16378
|
-
|
|
16379
|
-
|
|
16380
|
-
|
|
16381
|
-
|
|
16382
|
-
|
|
16383
|
-
|
|
16384
|
-
|
|
16385
|
-
|
|
16386
|
-
|
|
16387
|
-
|
|
16388
|
-
|
|
16389
|
-
|
|
16390
|
-
|
|
16391
|
-
|
|
16392
|
-
|
|
16393
|
-
|
|
16394
|
-
|
|
16395
|
-
|
|
16396
|
-
|
|
16397
|
-
|
|
16398
|
-
|
|
16399
|
-
|
|
16400
|
-
|
|
16460
|
+
var DEFAULT_DISTANCE = 25;
|
|
16461
|
+
var buildStyles = function buildStyles(distance) {
|
|
16462
|
+
var away = "translateY(-".concat(distance, "px)");
|
|
16463
|
+
return {
|
|
16464
|
+
base: {
|
|
16465
|
+
transitionProperty: "opacity, transform",
|
|
16466
|
+
transitionTimingFunction: "ease-out",
|
|
16467
|
+
transform: away,
|
|
16468
|
+
opacity: 0
|
|
16469
|
+
},
|
|
16470
|
+
entering: {
|
|
16471
|
+
opacity: 1,
|
|
16472
|
+
transform: "translateY(0)",
|
|
16473
|
+
transitionDuration: ".3s"
|
|
16474
|
+
},
|
|
16475
|
+
entered: {
|
|
16476
|
+
opacity: 1,
|
|
16477
|
+
transform: "translateY(0)",
|
|
16478
|
+
transitionDuration: ".3s"
|
|
16479
|
+
},
|
|
16480
|
+
exiting: {
|
|
16481
|
+
opacity: 0,
|
|
16482
|
+
transform: away,
|
|
16483
|
+
transitionDuration: ".2s"
|
|
16484
|
+
},
|
|
16485
|
+
exited: {
|
|
16486
|
+
opacity: 0,
|
|
16487
|
+
transform: away,
|
|
16488
|
+
transitionDuration: ".2s"
|
|
16489
|
+
}
|
|
16490
|
+
};
|
|
16401
16491
|
};
|
|
16402
16492
|
var SlideFromTop = function SlideFromTop(_ref) {
|
|
16403
16493
|
var _ref$in = _ref.in,
|
|
@@ -16407,18 +16497,30 @@
|
|
|
16407
16497
|
children = _ref.children,
|
|
16408
16498
|
style = _ref.style,
|
|
16409
16499
|
_ref$timeout = _ref.timeout,
|
|
16410
|
-
timeout = _ref$timeout === void 0 ? 400 : _ref$timeout
|
|
16500
|
+
timeout = _ref$timeout === void 0 ? 400 : _ref$timeout,
|
|
16501
|
+
_ref$distance = _ref.distance,
|
|
16502
|
+
distance = _ref$distance === void 0 ? DEFAULT_DISTANCE : _ref$distance;
|
|
16503
|
+
var styles = buildStyles(distance);
|
|
16504
|
+
|
|
16505
|
+
// React flushes the state change that follows onEnter before the browser paints, so without a
|
|
16506
|
+
// forced layout here the element never holds its starting style and the transition is skipped.
|
|
16507
|
+
var handleEnter = function handleEnter(node, isAppearing) {
|
|
16508
|
+
if (node) {
|
|
16509
|
+
void node.offsetHeight;
|
|
16510
|
+
}
|
|
16511
|
+
onEnter === null || onEnter === void 0 || onEnter(node, isAppearing);
|
|
16512
|
+
};
|
|
16411
16513
|
return /*#__PURE__*/React__default["default"].createElement(reactTransitionGroup.Transition, {
|
|
16412
16514
|
appear: true,
|
|
16413
16515
|
in: inProp,
|
|
16414
16516
|
timeout: timeout,
|
|
16415
|
-
onEnter:
|
|
16517
|
+
onEnter: handleEnter,
|
|
16416
16518
|
onExited: onExited
|
|
16417
16519
|
}, function (state) {
|
|
16418
16520
|
return /*#__PURE__*/React.cloneElement(children, {
|
|
16419
16521
|
style: _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
16420
16522
|
visibility: state === "exited" && !inProp ? "hidden" : undefined
|
|
16421
|
-
},
|
|
16523
|
+
}, styles.base), styles[state]), style), children.props.style)
|
|
16422
16524
|
});
|
|
16423
16525
|
});
|
|
16424
16526
|
};
|
|
@@ -16562,50 +16664,71 @@
|
|
|
16562
16664
|
};
|
|
16563
16665
|
Scale.displayName = "Scale";
|
|
16564
16666
|
|
|
16565
|
-
var _excluded$1l = ["children", "open", "onClose", "className", "enableBackgroundClick", "disableCloseOnEsc", "animate", "onClickOutside"];
|
|
16566
|
-
|
|
16567
|
-
|
|
16568
|
-
|
|
16569
|
-
|
|
16667
|
+
var _excluded$1l = ["children", "open", "onClose", "className", "enableBackgroundClick", "disableCloseOnEsc", "animate", "onClickOutside", "size", "height"];
|
|
16668
|
+
// Modal only treats a child as a transition when its props already carry `in`, so this element
|
|
16669
|
+
// must declare it even though Modal overwrites it on clone.
|
|
16670
|
+
var DialogSurface = function DialogSurface(_ref) {
|
|
16671
|
+
var _ref$in = _ref.in,
|
|
16672
|
+
inProp = _ref$in === void 0 ? false : _ref$in,
|
|
16673
|
+
onEnter = _ref.onEnter,
|
|
16674
|
+
onExited = _ref.onExited,
|
|
16675
|
+
forceClose = _ref.forceClose,
|
|
16570
16676
|
onClose = _ref.onClose,
|
|
16571
|
-
|
|
16572
|
-
|
|
16573
|
-
|
|
16574
|
-
|
|
16575
|
-
|
|
16576
|
-
|
|
16577
|
-
|
|
16578
|
-
|
|
16579
|
-
|
|
16580
|
-
|
|
16581
|
-
|
|
16582
|
-
|
|
16583
|
-
|
|
16584
|
-
|
|
16585
|
-
|
|
16586
|
-
|
|
16587
|
-
|
|
16588
|
-
|
|
16589
|
-
|
|
16590
|
-
|
|
16591
|
-
|
|
16592
|
-
|
|
16593
|
-
|
|
16594
|
-
|
|
16595
|
-
|
|
16596
|
-
|
|
16597
|
-
|
|
16598
|
-
|
|
16599
|
-
|
|
16600
|
-
|
|
16601
|
-
|
|
16602
|
-
|
|
16603
|
-
|
|
16604
|
-
|
|
16605
|
-
|
|
16606
|
-
|
|
16607
|
-
|
|
16608
|
-
|
|
16677
|
+
animate = _ref.animate,
|
|
16678
|
+
children = _ref.children;
|
|
16679
|
+
var Animation = animate === "fade" ? Fade : SlideFromTop;
|
|
16680
|
+
var value = React.useMemo(function () {
|
|
16681
|
+
return {
|
|
16682
|
+
requestClose: forceClose,
|
|
16683
|
+
onClose
|
|
16684
|
+
};
|
|
16685
|
+
}, [forceClose, onClose]);
|
|
16686
|
+
return /*#__PURE__*/React__default["default"].createElement(DialogContext.Provider, {
|
|
16687
|
+
value: value
|
|
16688
|
+
}, /*#__PURE__*/React__default["default"].createElement(StyledDialogViewport, {
|
|
16689
|
+
className: "c-dialog-viewport"
|
|
16690
|
+
}, /*#__PURE__*/React__default["default"].createElement(Animation, {
|
|
16691
|
+
in: inProp,
|
|
16692
|
+
onEnter: onEnter,
|
|
16693
|
+
onExited: onExited
|
|
16694
|
+
}, children)));
|
|
16695
|
+
};
|
|
16696
|
+
DialogSurface.displayName = "DialogSurface";
|
|
16697
|
+
var _Dialog = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
16698
|
+
var _dialogSizes$size;
|
|
16699
|
+
var children = _ref2.children,
|
|
16700
|
+
_ref2$open = _ref2.open,
|
|
16701
|
+
open = _ref2$open === void 0 ? false : _ref2$open,
|
|
16702
|
+
onClose = _ref2.onClose,
|
|
16703
|
+
className = _ref2.className,
|
|
16704
|
+
_ref2$enableBackgroun = _ref2.enableBackgroundClick,
|
|
16705
|
+
enableBackgroundClick = _ref2$enableBackgroun === void 0 ? false : _ref2$enableBackgroun,
|
|
16706
|
+
_ref2$disableCloseOnE = _ref2.disableCloseOnEsc,
|
|
16707
|
+
disableCloseOnEsc = _ref2$disableCloseOnE === void 0 ? false : _ref2$disableCloseOnE,
|
|
16708
|
+
_ref2$animate = _ref2.animate,
|
|
16709
|
+
animate = _ref2$animate === void 0 ? "slide" : _ref2$animate,
|
|
16710
|
+
onClickOutside = _ref2.onClickOutside,
|
|
16711
|
+
_ref2$size = _ref2.size,
|
|
16712
|
+
size = _ref2$size === void 0 ? "m" : _ref2$size,
|
|
16713
|
+
_ref2$height = _ref2.height,
|
|
16714
|
+
height = _ref2$height === void 0 ? "fluid" : _ref2$height,
|
|
16715
|
+
rest = _objectWithoutProperties(_ref2, _excluded$1l);
|
|
16716
|
+
return /*#__PURE__*/React__default["default"].createElement(Modal, _extends({
|
|
16717
|
+
ref: ref,
|
|
16718
|
+
open: open,
|
|
16719
|
+
onClose: onClose,
|
|
16720
|
+
disableBackgroundClick: !enableBackgroundClick,
|
|
16721
|
+
disableCloseOnEsc: disableCloseOnEsc,
|
|
16722
|
+
onClickOutside: onClickOutside
|
|
16723
|
+
}, rest), /*#__PURE__*/React__default["default"].createElement(DialogSurface, {
|
|
16724
|
+
in: open,
|
|
16725
|
+
onClose: onClose,
|
|
16726
|
+
animate: animate
|
|
16727
|
+
}, /*#__PURE__*/React__default["default"].createElement(StyledDialog, {
|
|
16728
|
+
$maxWidth: (_dialogSizes$size = dialogSizes[size]) !== null && _dialogSizes$size !== void 0 ? _dialogSizes$size : dialogSizes.m,
|
|
16729
|
+
$height: height === "fluid" ? undefined : height,
|
|
16730
|
+
className: classNames__default["default"]("c-dialog", className)
|
|
16731
|
+
}, children)));
|
|
16609
16732
|
});
|
|
16610
16733
|
_Dialog.displayName = "Dialog";
|
|
16611
16734
|
|
|
@@ -16642,7 +16765,9 @@
|
|
|
16642
16765
|
shouldShowCancelButton = _ref$shouldShowCancel === void 0 ? true : _ref$shouldShowCancel,
|
|
16643
16766
|
_ref$isLoading = _ref.isLoading,
|
|
16644
16767
|
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
16645
|
-
confirmationLabel = _ref.confirmationLabel
|
|
16768
|
+
confirmationLabel = _ref.confirmationLabel,
|
|
16769
|
+
size = _ref.size,
|
|
16770
|
+
height = _ref.height;
|
|
16646
16771
|
var _useState = React.useState(false),
|
|
16647
16772
|
_useState2 = _slicedToArray(_useState, 2),
|
|
16648
16773
|
confirmed = _useState2[0],
|
|
@@ -16675,7 +16800,9 @@
|
|
|
16675
16800
|
open: open,
|
|
16676
16801
|
onClose: onCancel,
|
|
16677
16802
|
className: classNames__default["default"]("c-confirm-dialog", className),
|
|
16678
|
-
disableCloseOnEsc: isLoading
|
|
16803
|
+
disableCloseOnEsc: isLoading,
|
|
16804
|
+
size: size,
|
|
16805
|
+
height: height
|
|
16679
16806
|
}, /*#__PURE__*/React__default["default"].createElement(Dialog.Title, null, dialogTitle), /*#__PURE__*/React__default["default"].createElement(Dialog.ContentDivider, null), /*#__PURE__*/React__default["default"].createElement(Dialog.Content, null, /*#__PURE__*/React__default["default"].createElement(Body2, {
|
|
16680
16807
|
lineHeight: "loose",
|
|
16681
16808
|
color: "secondary",
|
|
@@ -16693,9 +16820,6 @@
|
|
|
16693
16820
|
color: "secondary"
|
|
16694
16821
|
}, confirmationLabel))) : null), /*#__PURE__*/React__default["default"].createElement(Dialog.ContentDivider, null), /*#__PURE__*/React__default["default"].createElement(Dialog.Actions, null, /*#__PURE__*/React__default["default"].createElement(Button, {
|
|
16695
16822
|
variant: "primary",
|
|
16696
|
-
style: {
|
|
16697
|
-
marginRight: "12px"
|
|
16698
|
-
},
|
|
16699
16823
|
onClick: onConfirm,
|
|
16700
16824
|
disabled: isLoading || isConfirmBlocked
|
|
16701
16825
|
}, confirmBtnText), shouldShowCancelButton ? /*#__PURE__*/React__default["default"].createElement(Button, {
|
|
@@ -28604,6 +28728,8 @@
|
|
|
28604
28728
|
customRightHeader = _ref.customRightHeader,
|
|
28605
28729
|
_ref$skip = _ref.skip,
|
|
28606
28730
|
skip = _ref$skip === void 0 ? false : _ref$skip;
|
|
28731
|
+
// The close button goes through the dialog so the exit transition runs before the caller unmounts.
|
|
28732
|
+
var closeDialog = useDialogClose(onClose);
|
|
28607
28733
|
var onActionButtonClick = React.useCallback(function () {
|
|
28608
28734
|
if (isLast && onClose) {
|
|
28609
28735
|
return onClose();
|
|
@@ -28616,7 +28742,7 @@
|
|
|
28616
28742
|
className: "tw--ml-3 tw-mr-2",
|
|
28617
28743
|
disabled: changingStepInProgress
|
|
28618
28744
|
}, /*#__PURE__*/React__default["default"].createElement(ArrowBackMobileIcon$1, null)) : null, /*#__PURE__*/React__default["default"].createElement(StyledStepTitle, null, /*#__PURE__*/React__default["default"].createElement(Caption2, null, title), /*#__PURE__*/React__default["default"].createElement(Header3, null, subtitle))), customRightHeader ? customRightHeader : /*#__PURE__*/React__default["default"].createElement(IconButton, {
|
|
28619
|
-
onClick:
|
|
28745
|
+
onClick: closeDialog,
|
|
28620
28746
|
variant: "text gray",
|
|
28621
28747
|
disabled: changingStepInProgress
|
|
28622
28748
|
}, /*#__PURE__*/React__default["default"].createElement(CancelCrossIcon$1, null))), /*#__PURE__*/React__default["default"].createElement(Dialog.ContentDivider, null), shouldRenderNextButton ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Dialog.Content, null, children), /*#__PURE__*/React__default["default"].createElement(Dialog.ContentDivider, null), /*#__PURE__*/React__default["default"].createElement(Dialog.Actions, null, /*#__PURE__*/React__default["default"].createElement(StepActionButton, {
|
|
@@ -28628,13 +28754,18 @@
|
|
|
28628
28754
|
Step.displayName = "Step";
|
|
28629
28755
|
|
|
28630
28756
|
var Wizard = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
28757
|
+
var _activeStepProps$size, _activeStepProps$heig;
|
|
28631
28758
|
var title = _ref.title,
|
|
28632
28759
|
open = _ref.open,
|
|
28633
28760
|
onClose = _ref.onClose,
|
|
28634
28761
|
_ref$disableCloseOnEs = _ref.disableCloseOnEsc,
|
|
28635
28762
|
disableCloseOnEsc = _ref$disableCloseOnEs === void 0 ? false : _ref$disableCloseOnEs,
|
|
28636
28763
|
children = _ref.children,
|
|
28637
|
-
dialogClassName = _ref.dialogClassName
|
|
28764
|
+
dialogClassName = _ref.dialogClassName,
|
|
28765
|
+
_ref$size = _ref.size,
|
|
28766
|
+
size = _ref$size === void 0 ? "m" : _ref$size,
|
|
28767
|
+
_ref$height = _ref.height,
|
|
28768
|
+
height = _ref$height === void 0 ? "fluid" : _ref$height;
|
|
28638
28769
|
var childrenCollection = React.useMemo(function () {
|
|
28639
28770
|
return React__default["default"].Children.toArray(children);
|
|
28640
28771
|
}, [children]);
|
|
@@ -28671,6 +28802,11 @@
|
|
|
28671
28802
|
}
|
|
28672
28803
|
setActiveStep(index);
|
|
28673
28804
|
}, [activeStep, childrenCollection]);
|
|
28805
|
+
var activeStepProps = React.useMemo(function () {
|
|
28806
|
+
var _element$props;
|
|
28807
|
+
var element = childrenCollection[activeStep];
|
|
28808
|
+
return (_element$props = element === null || element === void 0 ? void 0 : element.props) !== null && _element$props !== void 0 ? _element$props : {};
|
|
28809
|
+
}, [activeStep, childrenCollection]);
|
|
28674
28810
|
var renderActiveStep = React.useMemo(function () {
|
|
28675
28811
|
var element = childrenCollection[activeStep];
|
|
28676
28812
|
if ((element === null || element === void 0 ? void 0 : element.type) === Step) {
|
|
@@ -28700,7 +28836,9 @@
|
|
|
28700
28836
|
open: open,
|
|
28701
28837
|
onClose: onClose,
|
|
28702
28838
|
disableCloseOnEsc: disableCloseOnEsc,
|
|
28703
|
-
className: dialogClassName
|
|
28839
|
+
className: dialogClassName,
|
|
28840
|
+
size: (_activeStepProps$size = activeStepProps.size) !== null && _activeStepProps$size !== void 0 ? _activeStepProps$size : size,
|
|
28841
|
+
height: (_activeStepProps$heig = activeStepProps.height) !== null && _activeStepProps$heig !== void 0 ? _activeStepProps$heig : height
|
|
28704
28842
|
}, renderActiveStep));
|
|
28705
28843
|
});
|
|
28706
28844
|
Wizard.displayName = "Wizard";
|
|
@@ -31157,6 +31295,7 @@
|
|
|
31157
31295
|
exports.DescriptionIcon = DescriptionIcon$1;
|
|
31158
31296
|
exports.DescriptionSmallIcon = DescriptionSmallIcon$1;
|
|
31159
31297
|
exports.Dialog = Dialog;
|
|
31298
|
+
exports.DialogContext = DialogContext;
|
|
31160
31299
|
exports.DiscussionAddIcon = DiscussionAddIcon$1;
|
|
31161
31300
|
exports.DiscussionIcon = DiscussionIcon$1;
|
|
31162
31301
|
exports.DisplayCurrency = DisplayCurrency;
|
|
@@ -31539,6 +31678,8 @@
|
|
|
31539
31678
|
exports.titledTextHeadings = titledTextHeadings;
|
|
31540
31679
|
exports.toMoment = toMoment;
|
|
31541
31680
|
exports.useContentStepperContext = useContentStepperContext;
|
|
31681
|
+
exports.useDialogClose = useDialogClose;
|
|
31682
|
+
exports.useDialogContext = useDialogContext;
|
|
31542
31683
|
exports.useEntityGroupContext = useEntityGroupContext;
|
|
31543
31684
|
exports.useForkRef = useForkRef;
|
|
31544
31685
|
exports.useHeight = useHeight;
|