@atlaskit/modal-dialog 13.0.0 → 13.0.2
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/CHANGELOG.md +17 -0
- package/dist/cjs/internal/components/modal-dialog.js +2 -4
- package/dist/cjs/internal/components/positioner.js +6 -11
- package/dist/cjs/internal/components/scroll-container.js +7 -7
- package/dist/cjs/internal/utils.js +13 -4
- package/dist/cjs/modal-body.js +1 -3
- package/dist/cjs/modal-footer.js +1 -3
- package/dist/cjs/modal-header.js +1 -3
- package/dist/cjs/modal-title.js +6 -2
- package/dist/cjs/modal-wrapper.js +1 -1
- package/dist/es2019/internal/components/modal-dialog.js +3 -5
- package/dist/es2019/internal/components/positioner.js +2 -8
- package/dist/es2019/internal/components/scroll-container.js +5 -5
- package/dist/es2019/internal/utils.js +10 -1
- package/dist/es2019/modal-body.js +1 -3
- package/dist/es2019/modal-footer.js +1 -3
- package/dist/es2019/modal-header.js +1 -3
- package/dist/es2019/modal-title.js +5 -1
- package/dist/es2019/modal-wrapper.js +1 -1
- package/dist/esm/internal/components/modal-dialog.js +3 -5
- package/dist/esm/internal/components/positioner.js +2 -8
- package/dist/esm/internal/components/scroll-container.js +5 -5
- package/dist/esm/internal/utils.js +10 -1
- package/dist/esm/modal-body.js +1 -3
- package/dist/esm/modal-footer.js +1 -3
- package/dist/esm/modal-header.js +1 -3
- package/dist/esm/modal-title.js +5 -1
- package/dist/esm/modal-wrapper.js +1 -1
- package/dist/types/internal/utils.d.ts +10 -1
- package/dist/types/types.d.ts +1 -1
- package/dist/types-ts4.5/internal/utils.d.ts +10 -1
- package/dist/types-ts4.5/types.d.ts +1 -1
- package/package.json +8 -9
- package/dist/cjs/internal/constants.js +0 -29
- package/dist/es2019/internal/constants.js +0 -25
- package/dist/esm/internal/constants.js +0 -25
- package/dist/types/internal/constants.d.ts +0 -21
- package/dist/types-ts4.5/internal/constants.d.ts +0 -21
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/modal-dialog
|
|
2
2
|
|
|
3
|
+
## 13.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#116010](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/116010)
|
|
8
|
+
[`1b66beb10e972`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1b66beb10e972) -
|
|
9
|
+
Update dependencies.
|
|
10
|
+
- [#118470](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/118470)
|
|
11
|
+
[`687094c7a76b3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/687094c7a76b3) -
|
|
12
|
+
Internal refactoring to reduce singleton exports.
|
|
13
|
+
|
|
14
|
+
## 13.0.1
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 13.0.0
|
|
4
21
|
|
|
5
22
|
### Major Changes
|
|
@@ -21,7 +21,6 @@ var _combine = require("@atlaskit/pragmatic-drag-and-drop/combine");
|
|
|
21
21
|
var _primitives = require("@atlaskit/primitives");
|
|
22
22
|
var _colors = require("@atlaskit/theme/colors");
|
|
23
23
|
var _tokens = require("@atlaskit/tokens");
|
|
24
|
-
var _constants = require("../constants");
|
|
25
24
|
var _context = require("../context");
|
|
26
25
|
var _useOnMotionFinish3 = _interopRequireDefault(require("../hooks/use-on-motion-finish"));
|
|
27
26
|
var _element = require("../pragmatic-drag-and-drop/disable-dragging-to-cross-origin-iframes/element");
|
|
@@ -46,12 +45,11 @@ var dialogStyles = (0, _react2.css)((0, _defineProperty2.default)((0, _definePro
|
|
|
46
45
|
flexDirection: 'column',
|
|
47
46
|
backgroundColor: "var(--ds-surface-overlay, ".concat(_colors.N0, ")"),
|
|
48
47
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
49
|
-
color:
|
|
48
|
+
color: "var(--ds-text, ".concat(_colors.N900, ")")
|
|
50
49
|
}, _tokens.CURRENT_SURFACE_CSS_VAR, "var(--ds-surface-overlay, ".concat(_colors.N0, ")")), "pointerEvents", 'auto'), _primitives.media.above.xs, {
|
|
51
50
|
width: 'var(--modal-dialog-width)',
|
|
52
51
|
maxWidth: 'inherit',
|
|
53
|
-
|
|
54
|
-
borderRadius: _constants.borderRadius,
|
|
52
|
+
borderRadius: "var(--ds-border-radius, 3px)",
|
|
55
53
|
boxShadow: "var(--ds-shadow-overlay, ".concat("0 0 0 1px ".concat(_colors.N30A, ", 0 2px 1px ").concat(_colors.N30A, ", 0 0 20px -6px ").concat(_colors.N60A), ")"),
|
|
56
54
|
marginInlineEnd: 'inherit',
|
|
57
55
|
marginInlineStart: 'inherit'
|
|
@@ -11,8 +11,6 @@ var _curves = require("@atlaskit/motion/curves");
|
|
|
11
11
|
var _durations = require("@atlaskit/motion/durations");
|
|
12
12
|
var _primitives = require("@atlaskit/primitives");
|
|
13
13
|
var _constants = require("@atlaskit/theme/constants");
|
|
14
|
-
var _constants2 = require("../constants");
|
|
15
|
-
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
16
14
|
/**
|
|
17
15
|
* @jsxRuntime classic
|
|
18
16
|
* @jsx jsx
|
|
@@ -20,10 +18,9 @@ var _constants2 = require("../constants");
|
|
|
20
18
|
|
|
21
19
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
var maxWidthDimensions = "calc(100vw - ".concat(
|
|
25
|
-
|
|
26
|
-
var maxHeightDimensions = "calc(100vh - ".concat(_constants2.gutter * 2 - 1, "px)");
|
|
21
|
+
var gutter = 60;
|
|
22
|
+
var maxWidthDimensions = "calc(100vw - ".concat(gutter * 2, "px)");
|
|
23
|
+
var maxHeightDimensions = "calc(100vh - ".concat(gutter * 2 - 1, "px)");
|
|
27
24
|
|
|
28
25
|
// Flex and min-content are set to constrain the height of the body and support multi-column scrolling experiences
|
|
29
26
|
var positionerStyles = (0, _react.css)({
|
|
@@ -41,16 +38,14 @@ var viewportScrollStyles = (0, _react.css)((0, _defineProperty2.default)({
|
|
|
41
38
|
height: 'auto',
|
|
42
39
|
position: 'relative'
|
|
43
40
|
}, _primitives.media.above.xs, {
|
|
44
|
-
|
|
45
|
-
margin: "".concat(_constants2.gutter, "px auto"),
|
|
41
|
+
margin: "".concat(gutter, "px auto"),
|
|
46
42
|
pointerEvents: 'none'
|
|
47
43
|
}));
|
|
48
44
|
var bodyScrollStyles = (0, _react.css)((0, _defineProperty2.default)({}, _primitives.media.above.xs, {
|
|
49
45
|
maxWidth: maxWidthDimensions,
|
|
50
46
|
maxHeight: maxHeightDimensions,
|
|
51
47
|
position: 'absolute',
|
|
52
|
-
|
|
53
|
-
insetBlockStart: "".concat(_constants2.gutter, "px"),
|
|
48
|
+
insetBlockStart: "".concat(gutter, "px"),
|
|
54
49
|
insetInlineEnd: 0,
|
|
55
50
|
insetInlineStart: 0,
|
|
56
51
|
marginInlineEnd: 'auto',
|
|
@@ -87,7 +82,7 @@ var Positioner = function Positioner(props) {
|
|
|
87
82
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
88
83
|
style: {
|
|
89
84
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
90
|
-
'--modal-dialog-translate-y': "".concat(stackIndex * (
|
|
85
|
+
'--modal-dialog-translate-y': "calc(".concat(stackIndex, "px * ", "var(--ds-space-100, 8px)", ")")
|
|
91
86
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
92
87
|
},
|
|
93
88
|
css: [positionerStyles, stackTransitionStyles, /* We only want to apply transform on modals shifting to the back of the stack. */
|
|
@@ -17,7 +17,7 @@ var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
|
17
17
|
var _useLazyCallback = _interopRequireDefault(require("@atlaskit/ds-lib/use-lazy-callback"));
|
|
18
18
|
var _focusRing = _interopRequireDefault(require("@atlaskit/focus-ring"));
|
|
19
19
|
var _primitives = require("@atlaskit/primitives");
|
|
20
|
-
var
|
|
20
|
+
var _colors = require("@atlaskit/theme/colors");
|
|
21
21
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
22
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
23
|
/**
|
|
@@ -27,6 +27,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
27
27
|
|
|
28
28
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
29
29
|
|
|
30
|
+
var keylineColor = "var(--ds-border, ".concat(_colors.N30, ")");
|
|
30
31
|
var baseStyles = (0, _react2.css)((0, _defineProperty2.default)({
|
|
31
32
|
display: 'inherit',
|
|
32
33
|
margin: "var(--ds-space-0, 0px)",
|
|
@@ -39,13 +40,12 @@ var baseStyles = (0, _react2.css)((0, _defineProperty2.default)({
|
|
|
39
40
|
height: 'unset',
|
|
40
41
|
overflowY: 'auto'
|
|
41
42
|
}));
|
|
43
|
+
var keylineHeight = 2;
|
|
42
44
|
var topKeylineStyles = (0, _react2.css)({
|
|
43
|
-
|
|
44
|
-
borderBlockStart: "".concat(_constants.keylineHeight, "px solid ").concat(_constants.keylineColor)
|
|
45
|
+
borderBlockStart: "var(--ds-border-width-outline, 2px)".concat(" solid ", keylineColor)
|
|
45
46
|
});
|
|
46
47
|
var bottomKeylineStyles = (0, _react2.css)({
|
|
47
|
-
|
|
48
|
-
borderBlockEnd: "".concat(_constants.keylineHeight, "px solid ").concat(_constants.keylineColor)
|
|
48
|
+
borderBlockEnd: "var(--ds-border-width-outline, 2px)".concat(" solid ", keylineColor)
|
|
49
49
|
});
|
|
50
50
|
/**
|
|
51
51
|
* A container that shows top and bottom keylines when the
|
|
@@ -82,10 +82,10 @@ var ScrollContainer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
82
82
|
if (target) {
|
|
83
83
|
var scrollableDistance = target.scrollHeight - target.clientHeight;
|
|
84
84
|
if (target.previousElementSibling) {
|
|
85
|
-
setTopKeyline(target.scrollTop >
|
|
85
|
+
setTopKeyline(target.scrollTop > keylineHeight);
|
|
86
86
|
}
|
|
87
87
|
if (target.nextElementSibling) {
|
|
88
|
-
setBottomKeyline(target.scrollTop <= scrollableDistance -
|
|
88
|
+
setBottomKeyline(target.scrollTop <= scrollableDistance - keylineHeight);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
}));
|
|
@@ -3,16 +3,25 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.dialogWidth = exports.dialogHeight = void 0;
|
|
7
|
-
var
|
|
6
|
+
exports.width = exports.dialogWidth = exports.dialogHeight = void 0;
|
|
7
|
+
var width = exports.width = {
|
|
8
|
+
values: ['small', 'medium', 'large', 'x-large'],
|
|
9
|
+
widths: {
|
|
10
|
+
small: 400,
|
|
11
|
+
medium: 600,
|
|
12
|
+
large: 800,
|
|
13
|
+
'x-large': 968
|
|
14
|
+
},
|
|
15
|
+
defaultValue: 'medium'
|
|
16
|
+
};
|
|
8
17
|
var dialogWidth = exports.dialogWidth = function dialogWidth(input) {
|
|
9
18
|
if (!input) {
|
|
10
19
|
return 'auto';
|
|
11
20
|
}
|
|
12
|
-
var isWidthName =
|
|
21
|
+
var isWidthName = width.values.indexOf(input.toString()) !== -1;
|
|
13
22
|
var widthName = isWidthName && input;
|
|
14
23
|
if (widthName) {
|
|
15
|
-
return "".concat(
|
|
24
|
+
return "".concat(width.widths[widthName], "px");
|
|
16
25
|
}
|
|
17
26
|
return typeof input === 'number' ? "".concat(input, "px") : input;
|
|
18
27
|
};
|
package/dist/cjs/modal-body.js
CHANGED
|
@@ -10,7 +10,6 @@ var _react2 = require("@emotion/react");
|
|
|
10
10
|
var _reactScrolllock = require("react-scrolllock");
|
|
11
11
|
var _hooks = require("./hooks");
|
|
12
12
|
var _scrollContainer = _interopRequireDefault(require("./internal/components/scroll-container"));
|
|
13
|
-
var _constants = require("./internal/constants");
|
|
14
13
|
var _useScroll = _interopRequireDefault(require("./internal/hooks/use-scroll"));
|
|
15
14
|
/**
|
|
16
15
|
* @jsxRuntime classic
|
|
@@ -30,8 +29,7 @@ var bodyStyles = (0, _react2.css)({
|
|
|
30
29
|
* keyline height from header and footer using negative margins.
|
|
31
30
|
*/
|
|
32
31
|
var bodyScrollStyles = (0, _react2.css)({
|
|
33
|
-
|
|
34
|
-
paddingBlock: _constants.keylineHeight,
|
|
32
|
+
paddingBlock: "var(--ds-border-width-outline, 2px)",
|
|
35
33
|
paddingInline: "var(--ds-space-300, 24px)"
|
|
36
34
|
});
|
|
37
35
|
|
package/dist/cjs/modal-footer.js
CHANGED
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _hooks = require("./hooks");
|
|
9
|
-
var _constants = require("./internal/constants");
|
|
10
9
|
/**
|
|
11
10
|
* @jsxRuntime classic
|
|
12
11
|
* @jsx jsx
|
|
@@ -20,8 +19,7 @@ var footerStyles = (0, _react.css)({
|
|
|
20
19
|
alignItems: 'center',
|
|
21
20
|
justifyContent: 'flex-end',
|
|
22
21
|
gap: "var(--ds-space-100, 8px)",
|
|
23
|
-
|
|
24
|
-
marginBlockStart: -_constants.keylineHeight,
|
|
22
|
+
marginBlockStart: "calc(-1 * ".concat("var(--ds-border-width-outline, 2px)", ")"),
|
|
25
23
|
paddingBlockEnd: "var(--ds-space-300, 24px)",
|
|
26
24
|
paddingBlockStart: "var(--ds-space-200, 16px)",
|
|
27
25
|
paddingInline: "var(--ds-space-300, 24px)"
|
package/dist/cjs/modal-header.js
CHANGED
|
@@ -8,7 +8,6 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _react2 = require("@emotion/react");
|
|
10
10
|
var _hooks = require("./hooks");
|
|
11
|
-
var _constants = require("./internal/constants");
|
|
12
11
|
/**
|
|
13
12
|
* @jsxRuntime classic
|
|
14
13
|
* @jsx jsx
|
|
@@ -21,8 +20,7 @@ var headerStyles = (0, _react2.css)({
|
|
|
21
20
|
position: 'relative',
|
|
22
21
|
alignItems: 'center',
|
|
23
22
|
justifyContent: 'space-between',
|
|
24
|
-
|
|
25
|
-
marginBlockEnd: -_constants.keylineHeight,
|
|
23
|
+
marginBlockEnd: "calc(-1 * ".concat("var(--ds-border-width-outline, 2px)", ")"),
|
|
26
24
|
paddingBlockEnd: "var(--ds-space-200, 16px)",
|
|
27
25
|
paddingBlockStart: "var(--ds-space-300, 24px)",
|
|
28
26
|
paddingInline: "var(--ds-space-300, 24px)"
|
package/dist/cjs/modal-title.js
CHANGED
|
@@ -8,8 +8,8 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = require("@emotion/react");
|
|
9
9
|
var _error = _interopRequireDefault(require("@atlaskit/icon/core/migration/error"));
|
|
10
10
|
var _warning = _interopRequireDefault(require("@atlaskit/icon/core/migration/warning"));
|
|
11
|
+
var _colors = require("@atlaskit/theme/colors");
|
|
11
12
|
var _hooks = require("./hooks");
|
|
12
|
-
var _constants = require("./internal/constants");
|
|
13
13
|
/**
|
|
14
14
|
* @jsxRuntime classic
|
|
15
15
|
* @jsx jsx
|
|
@@ -17,6 +17,10 @@ var _constants = require("./internal/constants");
|
|
|
17
17
|
|
|
18
18
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
19
19
|
|
|
20
|
+
var iconColor = {
|
|
21
|
+
danger: "var(--ds-icon-danger, ".concat(_colors.R400, ")"),
|
|
22
|
+
warning: "var(--ds-icon-warning, #D97008)"
|
|
23
|
+
};
|
|
20
24
|
var titleStyles = (0, _react.css)({
|
|
21
25
|
display: 'flex',
|
|
22
26
|
minWidth: 0,
|
|
@@ -62,7 +66,7 @@ var TitleIcon = function TitleIcon(_ref) {
|
|
|
62
66
|
css: iconStyles
|
|
63
67
|
}, (0, _react.jsx)(Icon, {
|
|
64
68
|
label: appearance,
|
|
65
|
-
color:
|
|
69
|
+
color: iconColor[appearance],
|
|
66
70
|
spacing: "spacious"
|
|
67
71
|
}));
|
|
68
72
|
};
|
|
@@ -103,7 +103,7 @@ var ModalWrapper = function ModalWrapper(props) {
|
|
|
103
103
|
action: 'closed',
|
|
104
104
|
componentName: 'modalDialog',
|
|
105
105
|
packageName: "@atlaskit/modal-dialog",
|
|
106
|
-
packageVersion: "13.0.
|
|
106
|
+
packageVersion: "13.0.2"
|
|
107
107
|
});
|
|
108
108
|
var onBlanketClicked = (0, _react.useCallback)(function (e) {
|
|
109
109
|
if (shouldCloseOnOverlayClick) {
|
|
@@ -14,9 +14,8 @@ import { useCloseOnEscapePress, useLayering } from '@atlaskit/layering';
|
|
|
14
14
|
import FadeIn from '@atlaskit/motion/fade-in';
|
|
15
15
|
import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
|
|
16
16
|
import { media } from '@atlaskit/primitives';
|
|
17
|
-
import { N0, N30A, N60A } from '@atlaskit/theme/colors';
|
|
17
|
+
import { N0, N30A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
18
18
|
import { CURRENT_SURFACE_CSS_VAR } from '@atlaskit/tokens';
|
|
19
|
-
import { borderRadius, textColor } from '../constants';
|
|
20
19
|
import { ModalContext, ScrollContext } from '../context';
|
|
21
20
|
import useOnMotionFinish from '../hooks/use-on-motion-finish';
|
|
22
21
|
import { disableDraggingToCrossOriginIFramesForElement } from '../pragmatic-drag-and-drop/disable-dragging-to-cross-origin-iframes/element';
|
|
@@ -36,14 +35,13 @@ const dialogStyles = css({
|
|
|
36
35
|
flexDirection: 'column',
|
|
37
36
|
backgroundColor: `var(--ds-surface-overlay, ${N0})`,
|
|
38
37
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
39
|
-
color:
|
|
38
|
+
color: `var(--ds-text, ${N900})`,
|
|
40
39
|
[CURRENT_SURFACE_CSS_VAR]: `var(--ds-surface-overlay, ${N0})`,
|
|
41
40
|
pointerEvents: 'auto',
|
|
42
41
|
[media.above.xs]: {
|
|
43
42
|
width: 'var(--modal-dialog-width)',
|
|
44
43
|
maxWidth: 'inherit',
|
|
45
|
-
|
|
46
|
-
borderRadius: borderRadius,
|
|
44
|
+
borderRadius: "var(--ds-border-radius, 3px)",
|
|
47
45
|
boxShadow: `var(--ds-shadow-overlay, ${`0 0 0 1px ${N30A}, 0 2px 1px ${N30A}, 0 0 20px -6px ${N60A}`})`,
|
|
48
46
|
marginInlineEnd: 'inherit',
|
|
49
47
|
marginInlineStart: 'inherit'
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
2
1
|
/**
|
|
3
2
|
* @jsxRuntime classic
|
|
4
3
|
* @jsx jsx
|
|
@@ -10,11 +9,8 @@ import { easeInOut } from '@atlaskit/motion/curves';
|
|
|
10
9
|
import { durations } from '@atlaskit/motion/durations';
|
|
11
10
|
import { media } from '@atlaskit/primitives';
|
|
12
11
|
import { layers } from '@atlaskit/theme/constants';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
12
|
+
const gutter = 60;
|
|
16
13
|
const maxWidthDimensions = `calc(100vw - ${gutter * 2}px)`;
|
|
17
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
18
14
|
const maxHeightDimensions = `calc(100vh - ${gutter * 2 - 1}px)`;
|
|
19
15
|
|
|
20
16
|
// Flex and min-content are set to constrain the height of the body and support multi-column scrolling experiences
|
|
@@ -33,7 +29,6 @@ const viewportScrollStyles = css({
|
|
|
33
29
|
height: 'auto',
|
|
34
30
|
position: 'relative',
|
|
35
31
|
[media.above.xs]: {
|
|
36
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
37
32
|
margin: `${gutter}px auto`,
|
|
38
33
|
pointerEvents: 'none'
|
|
39
34
|
}
|
|
@@ -43,7 +38,6 @@ const bodyScrollStyles = css({
|
|
|
43
38
|
maxWidth: maxWidthDimensions,
|
|
44
39
|
maxHeight: maxHeightDimensions,
|
|
45
40
|
position: 'absolute',
|
|
46
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
47
41
|
insetBlockStart: `${gutter}px`,
|
|
48
42
|
insetInlineEnd: 0,
|
|
49
43
|
insetInlineStart: 0,
|
|
@@ -84,7 +78,7 @@ const Positioner = props => {
|
|
|
84
78
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
85
79
|
style: {
|
|
86
80
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
87
|
-
'--modal-dialog-translate-y':
|
|
81
|
+
'--modal-dialog-translate-y': `calc(${stackIndex}px * ${"var(--ds-space-100, 8px)"})`
|
|
88
82
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
89
83
|
},
|
|
90
84
|
css: [positionerStyles, stackTransitionStyles, /* We only want to apply transform on modals shifting to the back of the stack. */
|
|
@@ -14,7 +14,8 @@ import noop from '@atlaskit/ds-lib/noop';
|
|
|
14
14
|
import useLazyCallback from '@atlaskit/ds-lib/use-lazy-callback';
|
|
15
15
|
import FocusRing from '@atlaskit/focus-ring';
|
|
16
16
|
import { media } from '@atlaskit/primitives';
|
|
17
|
-
import {
|
|
17
|
+
import { N30 } from '@atlaskit/theme/colors';
|
|
18
|
+
const keylineColor = `var(--ds-border, ${N30})`;
|
|
18
19
|
const baseStyles = css({
|
|
19
20
|
display: 'inherit',
|
|
20
21
|
margin: "var(--ds-space-0, 0px)",
|
|
@@ -28,13 +29,12 @@ const baseStyles = css({
|
|
|
28
29
|
overflowY: 'auto'
|
|
29
30
|
}
|
|
30
31
|
});
|
|
32
|
+
const keylineHeight = 2;
|
|
31
33
|
const topKeylineStyles = css({
|
|
32
|
-
|
|
33
|
-
borderBlockStart: `${keylineHeight}px solid ${keylineColor}`
|
|
34
|
+
borderBlockStart: `${"var(--ds-border-width-outline, 2px)"} solid ${keylineColor}`
|
|
34
35
|
});
|
|
35
36
|
const bottomKeylineStyles = css({
|
|
36
|
-
|
|
37
|
-
borderBlockEnd: `${keylineHeight}px solid ${keylineColor}`
|
|
37
|
+
borderBlockEnd: `${"var(--ds-border-width-outline, 2px)"} solid ${keylineColor}`
|
|
38
38
|
});
|
|
39
39
|
/**
|
|
40
40
|
* A container that shows top and bottom keylines when the
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
export const width = {
|
|
2
|
+
values: ['small', 'medium', 'large', 'x-large'],
|
|
3
|
+
widths: {
|
|
4
|
+
small: 400,
|
|
5
|
+
medium: 600,
|
|
6
|
+
large: 800,
|
|
7
|
+
'x-large': 968
|
|
8
|
+
},
|
|
9
|
+
defaultValue: 'medium'
|
|
10
|
+
};
|
|
2
11
|
export const dialogWidth = input => {
|
|
3
12
|
if (!input) {
|
|
4
13
|
return 'auto';
|
|
@@ -10,7 +10,6 @@ import { css, jsx } from '@emotion/react';
|
|
|
10
10
|
import { TouchScrollable } from 'react-scrolllock';
|
|
11
11
|
import { useModal } from './hooks';
|
|
12
12
|
import ScrollContainer from './internal/components/scroll-container';
|
|
13
|
-
import { keylineHeight } from './internal/constants';
|
|
14
13
|
import useScroll from './internal/hooks/use-scroll';
|
|
15
14
|
const bodyStyles = css({
|
|
16
15
|
/* This ensures the body fills the whole space between header and footer. */
|
|
@@ -23,8 +22,7 @@ const bodyStyles = css({
|
|
|
23
22
|
* keyline height from header and footer using negative margins.
|
|
24
23
|
*/
|
|
25
24
|
const bodyScrollStyles = css({
|
|
26
|
-
|
|
27
|
-
paddingBlock: keylineHeight,
|
|
25
|
+
paddingBlock: "var(--ds-border-width-outline, 2px)",
|
|
28
26
|
paddingInline: "var(--ds-space-300, 24px)"
|
|
29
27
|
});
|
|
30
28
|
|
|
@@ -6,15 +6,13 @@
|
|
|
6
6
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
7
|
import { css, jsx } from '@emotion/react';
|
|
8
8
|
import { useModal } from './hooks';
|
|
9
|
-
import { keylineHeight } from './internal/constants';
|
|
10
9
|
const footerStyles = css({
|
|
11
10
|
display: 'flex',
|
|
12
11
|
position: 'relative',
|
|
13
12
|
alignItems: 'center',
|
|
14
13
|
justifyContent: 'flex-end',
|
|
15
14
|
gap: "var(--ds-space-100, 8px)",
|
|
16
|
-
|
|
17
|
-
marginBlockStart: -keylineHeight,
|
|
15
|
+
marginBlockStart: `calc(-1 * ${"var(--ds-border-width-outline, 2px)"})`,
|
|
18
16
|
paddingBlockEnd: "var(--ds-space-300, 24px)",
|
|
19
17
|
paddingBlockStart: "var(--ds-space-200, 16px)",
|
|
20
18
|
paddingInline: "var(--ds-space-300, 24px)"
|
|
@@ -7,14 +7,12 @@ import React from 'react';
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import { useModal } from './hooks';
|
|
10
|
-
import { keylineHeight } from './internal/constants';
|
|
11
10
|
const headerStyles = css({
|
|
12
11
|
display: 'flex',
|
|
13
12
|
position: 'relative',
|
|
14
13
|
alignItems: 'center',
|
|
15
14
|
justifyContent: 'space-between',
|
|
16
|
-
|
|
17
|
-
marginBlockEnd: -keylineHeight,
|
|
15
|
+
marginBlockEnd: `calc(-1 * ${"var(--ds-border-width-outline, 2px)"})`,
|
|
18
16
|
paddingBlockEnd: "var(--ds-space-200, 16px)",
|
|
19
17
|
paddingBlockStart: "var(--ds-space-300, 24px)",
|
|
20
18
|
paddingInline: "var(--ds-space-300, 24px)"
|
|
@@ -7,8 +7,12 @@
|
|
|
7
7
|
import { css, jsx } from '@emotion/react';
|
|
8
8
|
import ErrorIcon from '@atlaskit/icon/core/migration/error';
|
|
9
9
|
import WarningIcon from '@atlaskit/icon/core/migration/warning';
|
|
10
|
+
import { R400 } from '@atlaskit/theme/colors';
|
|
10
11
|
import { useModal } from './hooks';
|
|
11
|
-
|
|
12
|
+
const iconColor = {
|
|
13
|
+
danger: `var(--ds-icon-danger, ${R400})`,
|
|
14
|
+
warning: "var(--ds-icon-warning, #D97008)"
|
|
15
|
+
};
|
|
12
16
|
const titleStyles = css({
|
|
13
17
|
display: 'flex',
|
|
14
18
|
minWidth: 0,
|
|
@@ -88,7 +88,7 @@ const ModalWrapper = props => {
|
|
|
88
88
|
action: 'closed',
|
|
89
89
|
componentName: 'modalDialog',
|
|
90
90
|
packageName: "@atlaskit/modal-dialog",
|
|
91
|
-
packageVersion: "13.0.
|
|
91
|
+
packageVersion: "13.0.2"
|
|
92
92
|
});
|
|
93
93
|
const onBlanketClicked = useCallback(e => {
|
|
94
94
|
if (shouldCloseOnOverlayClick) {
|
|
@@ -17,9 +17,8 @@ import { useCloseOnEscapePress, useLayering } from '@atlaskit/layering';
|
|
|
17
17
|
import FadeIn from '@atlaskit/motion/fade-in';
|
|
18
18
|
import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
|
|
19
19
|
import { media } from '@atlaskit/primitives';
|
|
20
|
-
import { N0, N30A, N60A } from '@atlaskit/theme/colors';
|
|
20
|
+
import { N0, N30A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
21
21
|
import { CURRENT_SURFACE_CSS_VAR } from '@atlaskit/tokens';
|
|
22
|
-
import { borderRadius, textColor } from '../constants';
|
|
23
22
|
import { ModalContext, ScrollContext } from '../context';
|
|
24
23
|
import useOnMotionFinish from '../hooks/use-on-motion-finish';
|
|
25
24
|
import { disableDraggingToCrossOriginIFramesForElement } from '../pragmatic-drag-and-drop/disable-dragging-to-cross-origin-iframes/element';
|
|
@@ -39,12 +38,11 @@ var dialogStyles = css(_defineProperty(_defineProperty(_defineProperty(_definePr
|
|
|
39
38
|
flexDirection: 'column',
|
|
40
39
|
backgroundColor: "var(--ds-surface-overlay, ".concat(N0, ")"),
|
|
41
40
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
42
|
-
color:
|
|
41
|
+
color: "var(--ds-text, ".concat(N900, ")")
|
|
43
42
|
}, CURRENT_SURFACE_CSS_VAR, "var(--ds-surface-overlay, ".concat(N0, ")")), "pointerEvents", 'auto'), media.above.xs, {
|
|
44
43
|
width: 'var(--modal-dialog-width)',
|
|
45
44
|
maxWidth: 'inherit',
|
|
46
|
-
|
|
47
|
-
borderRadius: borderRadius,
|
|
45
|
+
borderRadius: "var(--ds-border-radius, 3px)",
|
|
48
46
|
boxShadow: "var(--ds-shadow-overlay, ".concat("0 0 0 1px ".concat(N30A, ", 0 2px 1px ").concat(N30A, ", 0 0 20px -6px ").concat(N60A), ")"),
|
|
49
47
|
marginInlineEnd: 'inherit',
|
|
50
48
|
marginInlineStart: 'inherit'
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
3
2
|
/**
|
|
4
3
|
* @jsxRuntime classic
|
|
5
4
|
* @jsx jsx
|
|
@@ -11,11 +10,8 @@ import { easeInOut } from '@atlaskit/motion/curves';
|
|
|
11
10
|
import { durations } from '@atlaskit/motion/durations';
|
|
12
11
|
import { media } from '@atlaskit/primitives';
|
|
13
12
|
import { layers } from '@atlaskit/theme/constants';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
13
|
+
var gutter = 60;
|
|
17
14
|
var maxWidthDimensions = "calc(100vw - ".concat(gutter * 2, "px)");
|
|
18
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
19
15
|
var maxHeightDimensions = "calc(100vh - ".concat(gutter * 2 - 1, "px)");
|
|
20
16
|
|
|
21
17
|
// Flex and min-content are set to constrain the height of the body and support multi-column scrolling experiences
|
|
@@ -34,7 +30,6 @@ var viewportScrollStyles = css(_defineProperty({
|
|
|
34
30
|
height: 'auto',
|
|
35
31
|
position: 'relative'
|
|
36
32
|
}, media.above.xs, {
|
|
37
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
38
33
|
margin: "".concat(gutter, "px auto"),
|
|
39
34
|
pointerEvents: 'none'
|
|
40
35
|
}));
|
|
@@ -42,7 +37,6 @@ var bodyScrollStyles = css(_defineProperty({}, media.above.xs, {
|
|
|
42
37
|
maxWidth: maxWidthDimensions,
|
|
43
38
|
maxHeight: maxHeightDimensions,
|
|
44
39
|
position: 'absolute',
|
|
45
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
46
40
|
insetBlockStart: "".concat(gutter, "px"),
|
|
47
41
|
insetInlineEnd: 0,
|
|
48
42
|
insetInlineStart: 0,
|
|
@@ -80,7 +74,7 @@ var Positioner = function Positioner(props) {
|
|
|
80
74
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
81
75
|
style: {
|
|
82
76
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
83
|
-
'--modal-dialog-translate-y': "".concat(stackIndex * (
|
|
77
|
+
'--modal-dialog-translate-y': "calc(".concat(stackIndex, "px * ", "var(--ds-space-100, 8px)", ")")
|
|
84
78
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
85
79
|
},
|
|
86
80
|
css: [positionerStyles, stackTransitionStyles, /* We only want to apply transform on modals shifting to the back of the stack. */
|
|
@@ -16,7 +16,8 @@ import noop from '@atlaskit/ds-lib/noop';
|
|
|
16
16
|
import useLazyCallback from '@atlaskit/ds-lib/use-lazy-callback';
|
|
17
17
|
import FocusRing from '@atlaskit/focus-ring';
|
|
18
18
|
import { media } from '@atlaskit/primitives';
|
|
19
|
-
import {
|
|
19
|
+
import { N30 } from '@atlaskit/theme/colors';
|
|
20
|
+
var keylineColor = "var(--ds-border, ".concat(N30, ")");
|
|
20
21
|
var baseStyles = css(_defineProperty({
|
|
21
22
|
display: 'inherit',
|
|
22
23
|
margin: "var(--ds-space-0, 0px)",
|
|
@@ -29,13 +30,12 @@ var baseStyles = css(_defineProperty({
|
|
|
29
30
|
height: 'unset',
|
|
30
31
|
overflowY: 'auto'
|
|
31
32
|
}));
|
|
33
|
+
var keylineHeight = 2;
|
|
32
34
|
var topKeylineStyles = css({
|
|
33
|
-
|
|
34
|
-
borderBlockStart: "".concat(keylineHeight, "px solid ").concat(keylineColor)
|
|
35
|
+
borderBlockStart: "var(--ds-border-width-outline, 2px)".concat(" solid ", keylineColor)
|
|
35
36
|
});
|
|
36
37
|
var bottomKeylineStyles = css({
|
|
37
|
-
|
|
38
|
-
borderBlockEnd: "".concat(keylineHeight, "px solid ").concat(keylineColor)
|
|
38
|
+
borderBlockEnd: "var(--ds-border-width-outline, 2px)".concat(" solid ", keylineColor)
|
|
39
39
|
});
|
|
40
40
|
/**
|
|
41
41
|
* A container that shows top and bottom keylines when the
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
export var width = {
|
|
2
|
+
values: ['small', 'medium', 'large', 'x-large'],
|
|
3
|
+
widths: {
|
|
4
|
+
small: 400,
|
|
5
|
+
medium: 600,
|
|
6
|
+
large: 800,
|
|
7
|
+
'x-large': 968
|
|
8
|
+
},
|
|
9
|
+
defaultValue: 'medium'
|
|
10
|
+
};
|
|
2
11
|
export var dialogWidth = function dialogWidth(input) {
|
|
3
12
|
if (!input) {
|
|
4
13
|
return 'auto';
|
package/dist/esm/modal-body.js
CHANGED
|
@@ -10,7 +10,6 @@ import { css, jsx } from '@emotion/react';
|
|
|
10
10
|
import { TouchScrollable } from 'react-scrolllock';
|
|
11
11
|
import { useModal } from './hooks';
|
|
12
12
|
import ScrollContainer from './internal/components/scroll-container';
|
|
13
|
-
import { keylineHeight } from './internal/constants';
|
|
14
13
|
import useScroll from './internal/hooks/use-scroll';
|
|
15
14
|
var bodyStyles = css({
|
|
16
15
|
/* This ensures the body fills the whole space between header and footer. */
|
|
@@ -23,8 +22,7 @@ var bodyStyles = css({
|
|
|
23
22
|
* keyline height from header and footer using negative margins.
|
|
24
23
|
*/
|
|
25
24
|
var bodyScrollStyles = css({
|
|
26
|
-
|
|
27
|
-
paddingBlock: keylineHeight,
|
|
25
|
+
paddingBlock: "var(--ds-border-width-outline, 2px)",
|
|
28
26
|
paddingInline: "var(--ds-space-300, 24px)"
|
|
29
27
|
});
|
|
30
28
|
|
package/dist/esm/modal-footer.js
CHANGED
|
@@ -6,15 +6,13 @@
|
|
|
6
6
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
7
|
import { css, jsx } from '@emotion/react';
|
|
8
8
|
import { useModal } from './hooks';
|
|
9
|
-
import { keylineHeight } from './internal/constants';
|
|
10
9
|
var footerStyles = css({
|
|
11
10
|
display: 'flex',
|
|
12
11
|
position: 'relative',
|
|
13
12
|
alignItems: 'center',
|
|
14
13
|
justifyContent: 'flex-end',
|
|
15
14
|
gap: "var(--ds-space-100, 8px)",
|
|
16
|
-
|
|
17
|
-
marginBlockStart: -keylineHeight,
|
|
15
|
+
marginBlockStart: "calc(-1 * ".concat("var(--ds-border-width-outline, 2px)", ")"),
|
|
18
16
|
paddingBlockEnd: "var(--ds-space-300, 24px)",
|
|
19
17
|
paddingBlockStart: "var(--ds-space-200, 16px)",
|
|
20
18
|
paddingInline: "var(--ds-space-300, 24px)"
|
package/dist/esm/modal-header.js
CHANGED
|
@@ -7,14 +7,12 @@ import React from 'react';
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import { useModal } from './hooks';
|
|
10
|
-
import { keylineHeight } from './internal/constants';
|
|
11
10
|
var headerStyles = css({
|
|
12
11
|
display: 'flex',
|
|
13
12
|
position: 'relative',
|
|
14
13
|
alignItems: 'center',
|
|
15
14
|
justifyContent: 'space-between',
|
|
16
|
-
|
|
17
|
-
marginBlockEnd: -keylineHeight,
|
|
15
|
+
marginBlockEnd: "calc(-1 * ".concat("var(--ds-border-width-outline, 2px)", ")"),
|
|
18
16
|
paddingBlockEnd: "var(--ds-space-200, 16px)",
|
|
19
17
|
paddingBlockStart: "var(--ds-space-300, 24px)",
|
|
20
18
|
paddingInline: "var(--ds-space-300, 24px)"
|
package/dist/esm/modal-title.js
CHANGED
|
@@ -7,8 +7,12 @@
|
|
|
7
7
|
import { css, jsx } from '@emotion/react';
|
|
8
8
|
import ErrorIcon from '@atlaskit/icon/core/migration/error';
|
|
9
9
|
import WarningIcon from '@atlaskit/icon/core/migration/warning';
|
|
10
|
+
import { R400 } from '@atlaskit/theme/colors';
|
|
10
11
|
import { useModal } from './hooks';
|
|
11
|
-
|
|
12
|
+
var iconColor = {
|
|
13
|
+
danger: "var(--ds-icon-danger, ".concat(R400, ")"),
|
|
14
|
+
warning: "var(--ds-icon-warning, #D97008)"
|
|
15
|
+
};
|
|
12
16
|
var titleStyles = css({
|
|
13
17
|
display: 'flex',
|
|
14
18
|
minWidth: 0,
|
|
@@ -93,7 +93,7 @@ var ModalWrapper = function ModalWrapper(props) {
|
|
|
93
93
|
action: 'closed',
|
|
94
94
|
componentName: 'modalDialog',
|
|
95
95
|
packageName: "@atlaskit/modal-dialog",
|
|
96
|
-
packageVersion: "13.0.
|
|
96
|
+
packageVersion: "13.0.2"
|
|
97
97
|
});
|
|
98
98
|
var onBlanketClicked = useCallback(function (e) {
|
|
99
99
|
if (shouldCloseOnOverlayClick) {
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
import { type ModalDialogProps } from '../types';
|
|
1
|
+
import { type ModalDialogProps, type WidthNames } from '../types';
|
|
2
|
+
interface Width {
|
|
3
|
+
values: string[];
|
|
4
|
+
widths: {
|
|
5
|
+
[index in WidthNames]: number;
|
|
6
|
+
};
|
|
7
|
+
defaultValue: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const width: Width;
|
|
2
10
|
export declare const dialogWidth: (input?: ModalDialogProps['width']) => string;
|
|
3
11
|
export declare const dialogHeight: (input?: ModalDialogProps['height']) => string;
|
|
12
|
+
export {};
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type default as React, type RefObject } from 'react';
|
|
2
2
|
import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
-
|
|
3
|
+
export type WidthNames = 'small' | 'medium' | 'large' | 'x-large';
|
|
4
4
|
export type KeyboardOrMouseEvent = React.MouseEvent<any> | React.KeyboardEvent<any> | KeyboardEvent;
|
|
5
5
|
export type Appearance = 'danger' | 'warning';
|
|
6
6
|
export type OnCloseHandler = (e: KeyboardOrMouseEvent, analyticEvent: UIAnalyticsEvent) => void;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
import { type ModalDialogProps } from '../types';
|
|
1
|
+
import { type ModalDialogProps, type WidthNames } from '../types';
|
|
2
|
+
interface Width {
|
|
3
|
+
values: string[];
|
|
4
|
+
widths: {
|
|
5
|
+
[index in WidthNames]: number;
|
|
6
|
+
};
|
|
7
|
+
defaultValue: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const width: Width;
|
|
2
10
|
export declare const dialogWidth: (input?: ModalDialogProps['width']) => string;
|
|
3
11
|
export declare const dialogHeight: (input?: ModalDialogProps['height']) => string;
|
|
12
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type default as React, type RefObject } from 'react';
|
|
2
2
|
import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
-
|
|
3
|
+
export type WidthNames = 'small' | 'medium' | 'large' | 'x-large';
|
|
4
4
|
export type KeyboardOrMouseEvent = React.MouseEvent<any> | React.KeyboardEvent<any> | KeyboardEvent;
|
|
5
5
|
export type Appearance = 'danger' | 'warning';
|
|
6
6
|
export type OnCloseHandler = (e: KeyboardOrMouseEvent, analyticEvent: UIAnalyticsEvent) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/modal-dialog",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.2",
|
|
4
4
|
"description": "A modal dialog displays content that requires user interaction, in a layer above the page.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
34
34
|
"@atlaskit/ds-lib": "^4.0.0",
|
|
35
35
|
"@atlaskit/focus-ring": "^3.0.0",
|
|
36
|
-
"@atlaskit/icon": "^24.
|
|
36
|
+
"@atlaskit/icon": "^24.1.0",
|
|
37
37
|
"@atlaskit/layering": "^2.0.0",
|
|
38
|
-
"@atlaskit/motion": "^
|
|
38
|
+
"@atlaskit/motion": "^5.0.0",
|
|
39
39
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
40
40
|
"@atlaskit/portal": "^5.0.0",
|
|
41
41
|
"@atlaskit/pragmatic-drag-and-drop": "^1.5.0",
|
|
42
|
-
"@atlaskit/primitives": "^14.
|
|
42
|
+
"@atlaskit/primitives": "^14.1.0",
|
|
43
43
|
"@atlaskit/theme": "^17.0.0",
|
|
44
|
-
"@atlaskit/tokens": "^4.
|
|
44
|
+
"@atlaskit/tokens": "^4.2.0",
|
|
45
45
|
"@babel/runtime": "^7.0.0",
|
|
46
46
|
"@emotion/react": "^11.7.1",
|
|
47
47
|
"bind-event-listener": "^3.0.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@af/accessibility-testing": "*",
|
|
57
57
|
"@af/integration-testing": "*",
|
|
58
58
|
"@af/visual-regression": "*",
|
|
59
|
-
"@atlaskit/avatar": "^
|
|
59
|
+
"@atlaskit/avatar": "^23.0.0",
|
|
60
60
|
"@atlaskit/avatar-group": "^12.0.0",
|
|
61
61
|
"@atlaskit/banner": "^13.0.0",
|
|
62
62
|
"@atlaskit/breadcrumbs": "^15.0.0",
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
"@atlaskit/datetime-picker": "^16.0.0",
|
|
66
66
|
"@atlaskit/docs": "*",
|
|
67
67
|
"@atlaskit/dropdown-menu": "^13.0.0",
|
|
68
|
-
"@atlaskit/flag": "^16.
|
|
68
|
+
"@atlaskit/flag": "^16.1.0",
|
|
69
69
|
"@atlaskit/form": "^12.0.0",
|
|
70
|
-
"@atlaskit/heading": "^5.
|
|
70
|
+
"@atlaskit/heading": "^5.1.0",
|
|
71
71
|
"@atlaskit/image": "^2.0.0",
|
|
72
72
|
"@atlaskit/inline-dialog": "^17.0.0",
|
|
73
73
|
"@atlaskit/link": "^3.0.0",
|
|
@@ -83,7 +83,6 @@
|
|
|
83
83
|
"@testing-library/react": "^13.4.0",
|
|
84
84
|
"@testing-library/user-event": "^14.4.3",
|
|
85
85
|
"@types/raf-schd": "^4.0.1",
|
|
86
|
-
"jscodeshift": "^0.13.0",
|
|
87
86
|
"react-dom": "^18.2.0",
|
|
88
87
|
"react-lorem-component": "^0.13.0",
|
|
89
88
|
"react-sweet-state": "^2.6.5",
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.width = exports.verticalOffset = exports.textColor = exports.keylineHeight = exports.keylineColor = exports.iconColor = exports.gutter = exports.borderRadius = void 0;
|
|
7
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
8
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
9
|
-
var width = exports.width = {
|
|
10
|
-
values: ['small', 'medium', 'large', 'x-large'],
|
|
11
|
-
widths: {
|
|
12
|
-
small: 400,
|
|
13
|
-
medium: 600,
|
|
14
|
-
large: 800,
|
|
15
|
-
'x-large': 968
|
|
16
|
-
},
|
|
17
|
-
defaultValue: 'medium'
|
|
18
|
-
};
|
|
19
|
-
var gutter = exports.gutter = 60;
|
|
20
|
-
var gridSize = (0, _constants.gridSize)();
|
|
21
|
-
var borderRadius = exports.borderRadius = (0, _constants.borderRadius)();
|
|
22
|
-
var verticalOffset = exports.verticalOffset = gridSize * 2;
|
|
23
|
-
var keylineHeight = exports.keylineHeight = 2;
|
|
24
|
-
var keylineColor = exports.keylineColor = "var(--ds-border, ".concat(_colors.N30, ")");
|
|
25
|
-
var textColor = exports.textColor = "var(--ds-text, ".concat(_colors.N900, ")");
|
|
26
|
-
var iconColor = exports.iconColor = {
|
|
27
|
-
danger: "var(--ds-icon-danger, ".concat(_colors.R400, ")"),
|
|
28
|
-
warning: "var(--ds-icon-warning, #D97008)"
|
|
29
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { N30, N900, R400 } from '@atlaskit/theme/colors';
|
|
2
|
-
import { borderRadius as getBorderRadius,
|
|
3
|
-
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
4
|
-
gridSize as getGridSize } from '@atlaskit/theme/constants';
|
|
5
|
-
export const width = {
|
|
6
|
-
values: ['small', 'medium', 'large', 'x-large'],
|
|
7
|
-
widths: {
|
|
8
|
-
small: 400,
|
|
9
|
-
medium: 600,
|
|
10
|
-
large: 800,
|
|
11
|
-
'x-large': 968
|
|
12
|
-
},
|
|
13
|
-
defaultValue: 'medium'
|
|
14
|
-
};
|
|
15
|
-
export const gutter = 60;
|
|
16
|
-
const gridSize = getGridSize();
|
|
17
|
-
export const borderRadius = getBorderRadius();
|
|
18
|
-
export const verticalOffset = gridSize * 2;
|
|
19
|
-
export const keylineHeight = 2;
|
|
20
|
-
export const keylineColor = `var(--ds-border, ${N30})`;
|
|
21
|
-
export const textColor = `var(--ds-text, ${N900})`;
|
|
22
|
-
export const iconColor = {
|
|
23
|
-
danger: `var(--ds-icon-danger, ${R400})`,
|
|
24
|
-
warning: "var(--ds-icon-warning, #D97008)"
|
|
25
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { N30, N900, R400 } from '@atlaskit/theme/colors';
|
|
2
|
-
import { borderRadius as getBorderRadius,
|
|
3
|
-
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
4
|
-
gridSize as getGridSize } from '@atlaskit/theme/constants';
|
|
5
|
-
export var width = {
|
|
6
|
-
values: ['small', 'medium', 'large', 'x-large'],
|
|
7
|
-
widths: {
|
|
8
|
-
small: 400,
|
|
9
|
-
medium: 600,
|
|
10
|
-
large: 800,
|
|
11
|
-
'x-large': 968
|
|
12
|
-
},
|
|
13
|
-
defaultValue: 'medium'
|
|
14
|
-
};
|
|
15
|
-
export var gutter = 60;
|
|
16
|
-
var gridSize = getGridSize();
|
|
17
|
-
export var borderRadius = getBorderRadius();
|
|
18
|
-
export var verticalOffset = gridSize * 2;
|
|
19
|
-
export var keylineHeight = 2;
|
|
20
|
-
export var keylineColor = "var(--ds-border, ".concat(N30, ")");
|
|
21
|
-
export var textColor = "var(--ds-text, ".concat(N900, ")");
|
|
22
|
-
export var iconColor = {
|
|
23
|
-
danger: "var(--ds-icon-danger, ".concat(R400, ")"),
|
|
24
|
-
warning: "var(--ds-icon-warning, #D97008)"
|
|
25
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type NewIconProps } from '@atlaskit/icon';
|
|
2
|
-
import type { Appearance } from '../types';
|
|
3
|
-
export type WidthNames = 'small' | 'medium' | 'large' | 'x-large';
|
|
4
|
-
interface Width {
|
|
5
|
-
values: string[];
|
|
6
|
-
widths: {
|
|
7
|
-
[index in WidthNames]: number;
|
|
8
|
-
};
|
|
9
|
-
defaultValue: string;
|
|
10
|
-
}
|
|
11
|
-
export declare const width: Width;
|
|
12
|
-
export declare const gutter = 60;
|
|
13
|
-
export declare const borderRadius: number;
|
|
14
|
-
export declare const verticalOffset: number;
|
|
15
|
-
export declare const keylineHeight = 2;
|
|
16
|
-
export declare const keylineColor: "var(--ds-border)";
|
|
17
|
-
export declare const textColor: "var(--ds-text)";
|
|
18
|
-
export declare const iconColor: {
|
|
19
|
-
[key in Appearance]: NewIconProps['color'];
|
|
20
|
-
};
|
|
21
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type NewIconProps } from '@atlaskit/icon';
|
|
2
|
-
import type { Appearance } from '../types';
|
|
3
|
-
export type WidthNames = 'small' | 'medium' | 'large' | 'x-large';
|
|
4
|
-
interface Width {
|
|
5
|
-
values: string[];
|
|
6
|
-
widths: {
|
|
7
|
-
[index in WidthNames]: number;
|
|
8
|
-
};
|
|
9
|
-
defaultValue: string;
|
|
10
|
-
}
|
|
11
|
-
export declare const width: Width;
|
|
12
|
-
export declare const gutter = 60;
|
|
13
|
-
export declare const borderRadius: number;
|
|
14
|
-
export declare const verticalOffset: number;
|
|
15
|
-
export declare const keylineHeight = 2;
|
|
16
|
-
export declare const keylineColor: "var(--ds-border)";
|
|
17
|
-
export declare const textColor: "var(--ds-text)";
|
|
18
|
-
export declare const iconColor: {
|
|
19
|
-
[key in Appearance]: NewIconProps['color'];
|
|
20
|
-
};
|
|
21
|
-
export {};
|