@atlaskit/modal-dialog 12.4.0 → 12.4.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/codemods/migrations/map-actions-prop.tsx +8 -5
  3. package/dist/cjs/internal/components/scroll-container.js +2 -1
  4. package/dist/cjs/modal-title.js +2 -1
  5. package/dist/cjs/modal-wrapper.js +1 -1
  6. package/dist/cjs/version.json +1 -1
  7. package/dist/es2019/internal/components/scroll-container.js +2 -1
  8. package/dist/es2019/modal-title.js +2 -1
  9. package/dist/es2019/modal-wrapper.js +1 -1
  10. package/dist/es2019/version.json +1 -1
  11. package/dist/esm/internal/components/scroll-container.js +2 -1
  12. package/dist/esm/modal-title.js +2 -1
  13. package/dist/esm/modal-wrapper.js +1 -1
  14. package/dist/esm/version.json +1 -1
  15. package/package.json +6 -11
  16. package/report.api.md +51 -192
  17. package/dist/types-ts4.0/hooks.d.ts +0 -1
  18. package/dist/types-ts4.0/index.d.ts +0 -8
  19. package/dist/types-ts4.0/internal/components/modal-dialog.d.ts +0 -4
  20. package/dist/types-ts4.0/internal/components/positioner.d.ts +0 -11
  21. package/dist/types-ts4.0/internal/components/scroll-container.d.ts +0 -20
  22. package/dist/types-ts4.0/internal/constants.d.ts +0 -23
  23. package/dist/types-ts4.0/internal/context.d.ts +0 -20
  24. package/dist/types-ts4.0/internal/hooks/use-modal-stack.d.ts +0 -13
  25. package/dist/types-ts4.0/internal/hooks/use-on-motion-finish.d.ts +0 -7
  26. package/dist/types-ts4.0/internal/hooks/use-prevent-programmatic-scroll.d.ts +0 -7
  27. package/dist/types-ts4.0/internal/hooks/use-scroll.d.ts +0 -1
  28. package/dist/types-ts4.0/internal/utils.d.ts +0 -3
  29. package/dist/types-ts4.0/modal-body.d.ts +0 -26
  30. package/dist/types-ts4.0/modal-footer.d.ts +0 -26
  31. package/dist/types-ts4.0/modal-header.d.ts +0 -26
  32. package/dist/types-ts4.0/modal-title.d.ts +0 -36
  33. package/dist/types-ts4.0/modal-transition.d.ts +0 -13
  34. package/dist/types-ts4.0/modal-wrapper.d.ts +0 -16
  35. package/dist/types-ts4.0/types.d.ts +0 -90
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/modal-dialog
2
2
 
3
+ ## 12.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 12.4.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`9de88fa1e1e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9de88fa1e1e) - Internal changes to include spacing tokens in component implementations.
14
+
3
15
  ## 12.4.0
4
16
 
5
17
  ### Minor Changes
@@ -87,8 +87,9 @@ export const mapActionsProp = (
87
87
  .forEach((element: ASTPath<JSXElement>) => {
88
88
  getJSXAttributesByName(j, element, ACTIONS_PROP_NAME).forEach(
89
89
  (attribute: ASTPath<JSXAttribute>) => {
90
- const actionsPropValue = (attribute.node
91
- .value as JSXExpressionContainer)?.expression;
90
+ const actionsPropValue = (
91
+ attribute.node.value as JSXExpressionContainer
92
+ )?.expression;
92
93
 
93
94
  if (
94
95
  !actionsPropValue ||
@@ -380,8 +381,9 @@ const findAppearanceInActions = (
380
381
  * If actions prop is declared as variable, and we can find the declaration
381
382
  * in the same file, we check if there's any appearance property set.
382
383
  */
383
- const actionPropVariableValue = (actionsVariableDeclaration as any)?.nodes()[0]
384
- .declarations[0]?.init;
384
+ const actionPropVariableValue = (
385
+ actionsVariableDeclaration as any
386
+ )?.nodes()[0].declarations[0]?.init;
385
387
 
386
388
  return checkAppearancePropertyExistence(actionPropVariableValue);
387
389
  }
@@ -419,7 +421,8 @@ const getVariableDeclarationByName = (
419
421
  .filter((variableDeclaration: ASTPath<VariableDeclaration>) => {
420
422
  return variableDeclaration.node.declarations.some(
421
423
  (variableDeclarator) => {
422
- const variableDeclaratorTyped = variableDeclarator as VariableDeclarator;
424
+ const variableDeclaratorTyped =
425
+ variableDeclarator as VariableDeclarator;
423
426
  return (
424
427
  variableDeclaratorTyped.id.type === 'Identifier' &&
425
428
  variableDeclaratorTyped.id.name === variableName
@@ -38,7 +38,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
38
38
  /** @jsx jsx */
39
39
  var baseStyles = (0, _react2.css)({
40
40
  display: 'inherit',
41
- margin: 0,
41
+ // TODO Delete this comment after verifying spacing token -> previous value `0`
42
+ margin: "var(--ds-scale-0, 0px)",
42
43
  flex: 'inherit',
43
44
  flexDirection: 'inherit',
44
45
  flexGrow: 1,
@@ -24,7 +24,8 @@ var adjustedLineHeight = 1.2;
24
24
  var titleStyles = (0, _react.css)({
25
25
  display: 'flex',
26
26
  minWidth: 0,
27
- margin: 0,
27
+ // TODO Delete this comment after verifying spacing token -> previous value `0`
28
+ margin: "var(--ds-scale-0, 0px)",
28
29
  alignItems: 'center',
29
30
  fontSize: "".concat(fontSize, "px"),
30
31
  fontStyle: 'inherit',
@@ -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: "12.4.0"
106
+ packageVersion: "12.4.2"
107
107
  });
108
108
  var onBlanketClicked = (0, _react.useCallback)(function (e) {
109
109
  if (shouldCloseOnOverlayClick) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/modal-dialog",
3
- "version": "12.4.0",
3
+ "version": "12.4.2",
4
4
  "sideEffects": false
5
5
  }
@@ -11,7 +11,8 @@ import FocusRing from '@atlaskit/focus-ring';
11
11
  import { keylineColor, keylineHeight } from '../constants';
12
12
  const baseStyles = css({
13
13
  display: 'inherit',
14
- margin: 0,
14
+ // TODO Delete this comment after verifying spacing token -> previous value `0`
15
+ margin: "var(--ds-scale-0, 0px)",
15
16
  flex: 'inherit',
16
17
  flexDirection: 'inherit',
17
18
  flexGrow: 1,
@@ -10,7 +10,8 @@ const adjustedLineHeight = 1.2;
10
10
  const titleStyles = css({
11
11
  display: 'flex',
12
12
  minWidth: 0,
13
- margin: 0,
13
+ // TODO Delete this comment after verifying spacing token -> previous value `0`
14
+ margin: "var(--ds-scale-0, 0px)",
14
15
  alignItems: 'center',
15
16
  fontSize: `${fontSize}px`,
16
17
  fontStyle: 'inherit',
@@ -70,7 +70,7 @@ const ModalWrapper = props => {
70
70
  action: 'closed',
71
71
  componentName: 'modalDialog',
72
72
  packageName: "@atlaskit/modal-dialog",
73
- packageVersion: "12.4.0"
73
+ packageVersion: "12.4.2"
74
74
  });
75
75
  const onBlanketClicked = useCallback(e => {
76
76
  if (shouldCloseOnOverlayClick) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/modal-dialog",
3
- "version": "12.4.0",
3
+ "version": "12.4.2",
4
4
  "sideEffects": false
5
5
  }
@@ -13,7 +13,8 @@ import FocusRing from '@atlaskit/focus-ring';
13
13
  import { keylineColor, keylineHeight } from '../constants';
14
14
  var baseStyles = css({
15
15
  display: 'inherit',
16
- margin: 0,
16
+ // TODO Delete this comment after verifying spacing token -> previous value `0`
17
+ margin: "var(--ds-scale-0, 0px)",
17
18
  flex: 'inherit',
18
19
  flexDirection: 'inherit',
19
20
  flexGrow: 1,
@@ -10,7 +10,8 @@ var adjustedLineHeight = 1.2;
10
10
  var titleStyles = css({
11
11
  display: 'flex',
12
12
  minWidth: 0,
13
- margin: 0,
13
+ // TODO Delete this comment after verifying spacing token -> previous value `0`
14
+ margin: "var(--ds-scale-0, 0px)",
14
15
  alignItems: 'center',
15
16
  fontSize: "".concat(fontSize, "px"),
16
17
  fontStyle: 'inherit',
@@ -74,7 +74,7 @@ var ModalWrapper = function ModalWrapper(props) {
74
74
  action: 'closed',
75
75
  componentName: 'modalDialog',
76
76
  packageName: "@atlaskit/modal-dialog",
77
- packageVersion: "12.4.0"
77
+ packageVersion: "12.4.2"
78
78
  });
79
79
  var onBlanketClicked = useCallback(function (e) {
80
80
  if (shouldCloseOnOverlayClick) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/modal-dialog",
3
- "version": "12.4.0",
3
+ "version": "12.4.2",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/modal-dialog",
3
- "version": "12.4.0",
3
+ "version": "12.4.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/"
@@ -12,13 +12,6 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
- "typesVersions": {
16
- ">=4.0 <4.5": {
17
- "*": [
18
- "dist/types-ts4.0/*"
19
- ]
20
- }
21
- },
22
15
  "sideEffects": false,
23
16
  "af:exports": {
24
17
  ".": "./src/index.tsx",
@@ -33,6 +26,7 @@
33
26
  },
34
27
  "atlaskit:src": "src/index.tsx",
35
28
  "atlassian": {
29
+ "disableProductCI": true,
36
30
  "team": "Design System Team",
37
31
  "releaseModel": "scheduled",
38
32
  "website": {
@@ -48,12 +42,12 @@
48
42
  "@atlaskit/blanket": "^12.3.0",
49
43
  "@atlaskit/codemod-utils": "^4.1.0",
50
44
  "@atlaskit/ds-lib": "^2.1.0",
51
- "@atlaskit/focus-ring": "^1.1.0",
45
+ "@atlaskit/focus-ring": "^1.2.0",
52
46
  "@atlaskit/icon": "^21.11.0",
53
- "@atlaskit/motion": "^1.2.0",
47
+ "@atlaskit/motion": "^1.3.0",
54
48
  "@atlaskit/portal": "^4.1.0",
55
49
  "@atlaskit/theme": "^12.2.0",
56
- "@atlaskit/tokens": "^0.10.0",
50
+ "@atlaskit/tokens": "^0.11.0",
57
51
  "@babel/runtime": "^7.0.0",
58
52
  "@emotion/react": "^11.7.1",
59
53
  "bind-event-listener": "^2.1.1",
@@ -114,6 +108,7 @@
114
108
  "design-system": "v1",
115
109
  "ui-components": "lite-mode",
116
110
  "analytics": "analytics-next",
111
+ "design-tokens": "spacing",
117
112
  "theming": "tokens",
118
113
  "deprecation": "no-deprecated-imports",
119
114
  "styling": [
package/report.api.md CHANGED
@@ -1,6 +1,10 @@
1
- ## API Report File for "@atlaskit/modal-dialog".
1
+ ## API Report File for "@atlaskit/modal-dialog"
2
2
 
3
- > Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ <!--
6
+ Generated API Report version: 2.0
7
+ -->
4
8
 
5
9
  [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
6
10
 
@@ -14,255 +18,110 @@ import { ReactNode } from 'react';
14
18
  import { RefObject } from 'react';
15
19
  import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
16
20
 
17
- export declare type Appearance = 'danger' | 'warning';
21
+ // @public (undocumented)
22
+ export type Appearance = 'danger' | 'warning';
18
23
 
19
- export declare type KeyboardOrMouseEvent =
24
+ // @public (undocumented)
25
+ export type KeyboardOrMouseEvent =
20
26
  | React_2.MouseEvent<any>
21
27
  | React_2.KeyboardEvent<any>
22
28
  | KeyboardEvent;
23
29
 
24
- export declare type ModalAttributes = {
25
- /**
26
- * Test id passed to the modal dialog.
27
- */
30
+ // @public (undocumented)
31
+ export type ModalAttributes = {
28
32
  testId?: ModalDialogProps['testId'];
29
- /**
30
- * Id referenced by the modal dialog's `aria-labelledby` attribute.
31
- * This id should be assigned to the modal title element.
32
- */
33
33
  titleId: string;
34
- /**
35
- * Callback function called when the modal dialog is requesting to be closed,
36
- * wrapped in modal dialog's analytic event context.
37
- */
38
34
  onClose?: OnCloseHandler;
39
35
  };
40
36
 
41
- /**
42
- * __Modal body__
43
- *
44
- * A modal body is used to display the main content of a modal.
45
- *
46
- * - [Examples](https://atlassian.design/components/modal-dialog/examples)
47
- * - [Code](https://atlassian.design/components/modal-dialog/code#modal-body-props)
48
- * - [Usage](https://atlassian.design/components/modal-dialog/usage)
49
- */
50
- export declare const ModalBody: (props: ModalBodyProps) => jsx.JSX.Element;
37
+ // @public
38
+ export const ModalBody: (props: ModalBodyProps) => jsx.JSX.Element;
51
39
 
52
- export declare interface ModalBodyProps {
53
- /**
54
- * Children of modal dialog footer.
55
- */
40
+ // @public (undocumented)
41
+ export interface ModalBodyProps {
56
42
  children: React_2.ReactNode;
57
- /**
58
- * A `testId` prop is provided for specified elements,
59
- * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
60
- * serving as a hook for automated tests.
61
- */
62
43
  testId?: string;
63
44
  }
64
45
 
65
- export declare interface ModalDialogProps {
66
- /**
67
- * Focus is moved to the first interactive element inside the modal dialog when `true`.
68
- * Pass an element `ref` to focus on a specific element.
69
- */
46
+ // @public (undocumented)
47
+ export interface ModalDialogProps {
70
48
  autoFocus?: boolean | RefObject<HTMLElement | null | undefined>;
71
- /**
72
- * Contents of the modal dialog.
73
- */
74
49
  children?: React_2.ReactNode;
75
- /**
76
- * Height of the modal dialog.
77
- * When unset the modal dialog will grow to fill the viewport and then start overflowing its contents.
78
- */
79
50
  height?: number | string;
80
- /**
81
- * Width of the modal dialog.
82
- * The recommended way to specify modal width is using named size options.
83
- */
84
- width?: number | string | WidthNames;
85
- /**
86
- * Callback function called when the modal dialog is requesting to be closed.
87
- */
51
+ isBlanketHidden?: boolean;
88
52
  onClose?: OnCloseHandler;
89
- /**
90
- * Callback function called when the modal dialog has finished closing.
91
- */
92
53
  onCloseComplete?: OnCloseCompleteHandler;
93
- /**
94
- * Callback function called when the modal dialog has finished opening.
95
- */
96
54
  onOpenComplete?: OnOpenCompleteHandler;
97
- /**
98
- * Callback function called when the modal changes position in the stack.
99
- */
100
55
  onStackChange?: OnStackChangeHandler;
101
- /**
102
- * Will set the scroll boundary to the viewport.
103
- * If set to false, the scroll boundary is set to the modal dialog body.
104
- */
105
- shouldScrollInViewport?: boolean;
106
- /**
107
- * Calls `onClose` when clicking the blanket behind the modal dialog.
108
- */
109
- shouldCloseOnOverlayClick?: boolean;
110
- /**
111
- * Calls `onClose` when pressing escape.
112
- */
113
56
  shouldCloseOnEscapePress?: boolean;
114
- /**
115
- * Will remove the blanket tinted background color.
116
- */
117
- isBlanketHidden?: boolean;
118
- /**
119
- * Number representing where in the stack of modals this modal sits.
120
- * This offsets the modal dialogs vertical position.
121
- */
57
+ shouldCloseOnOverlayClick?: boolean;
58
+ shouldScrollInViewport?: boolean;
122
59
  stackIndex?: number;
123
- /**
124
- * A `testId` prop is provided for specified elements,
125
- * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
126
- * serving as a hook for automated tests.
127
- *
128
- * If not overridden using `testId` prop in the respective components,
129
- * this will set `data-testid` on these elements when defined:
130
- *
131
- * - Modal dialog - `{testId}`
132
- * - Modal header - `{testId}--header`
133
- * - Modal title - `{testId}--title`
134
- * - Modal body - `{testId}--body`
135
- * - Modal footer - `{testId}--footer`
136
- * - Scrollable element - `{testId}--scrollable`
137
- * - Blanket - `{testId}--blanket`
138
- */
139
60
  testId?: string;
61
+ width?: number | string | WidthNames;
140
62
  }
141
63
 
142
- /**
143
- * __Modal footer__
144
- *
145
- * A modal footer often contains a primary action and the ability to cancel and close the dialog, though can contain any React element.
146
- *
147
- * - [Examples](https://atlassian.design/components/modal-dialog/examples#modal-footer)
148
- * - [Code](https://atlassian.design/components/modal-dialog/code#modal-footer-props)
149
- * - [Usage](https://atlassian.design/components/modal-dialog/usage)
150
- */
151
- export declare const ModalFooter: (props: ModalFooterProps) => jsx.JSX.Element;
64
+ // @public
65
+ export const ModalFooter: (props: ModalFooterProps) => jsx.JSX.Element;
152
66
 
153
- export declare interface ModalFooterProps {
154
- /**
155
- * Children of modal dialog footer.
156
- */
67
+ // @public (undocumented)
68
+ export interface ModalFooterProps {
157
69
  children?: ReactNode;
158
- /**
159
- * A `testId` prop is provided for specified elements,
160
- * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
161
- * serving as a hook for automated tests.
162
- */
163
70
  testId?: string;
164
71
  }
165
72
 
166
- /**
167
- * __Modal header__
168
- *
169
- * A modal header contains the title of the modal and can contain other React elements such as a close button.
170
- *
171
- * - [Examples](https://atlassian.design/components/modal-dialog/examples#modal-header)
172
- * - [Code](https://atlassian.design/components/modal-dialog/code#modal-header-props)
173
- * - [Usage](https://atlassian.design/components/modal-dialog/usage)
174
- */
175
- export declare const ModalHeader: (props: ModalHeaderProps) => jsx.JSX.Element;
73
+ // @public
74
+ export const ModalHeader: (props: ModalHeaderProps) => jsx.JSX.Element;
176
75
 
177
- export declare interface ModalHeaderProps {
178
- /**
179
- * Children of modal dialog header.
180
- */
76
+ // @public (undocumented)
77
+ export interface ModalHeaderProps {
181
78
  children?: React_2.ReactNode;
182
- /**
183
- * A `testId` prop is provided for specified elements,
184
- * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
185
- * serving as a hook for automated tests.
186
- */
187
79
  testId?: string;
188
80
  }
189
81
 
190
- /**
191
- * __Modal title__
192
- *
193
- * A modal title is used to display a title within a modal.
194
- *
195
- * - [Examples](https://atlassian.design/components/modal-dialog/examples)
196
- * - [Code](https://atlassian.design/components/modal-dialog/code)
197
- * - [Usage](https://atlassian.design/components/modal-dialog/usage)
198
- */
199
- export declare const ModalTitle: (props: ModalTitleProps) => jsx.JSX.Element;
82
+ // @public
83
+ export const ModalTitle: (props: ModalTitleProps) => jsx.JSX.Element;
200
84
 
201
- export declare interface ModalTitleProps {
202
- /**
203
- * Appearance of the modal that changes the color of the primary action and adds an icon to the title.
204
- */
85
+ // @public (undocumented)
86
+ export interface ModalTitleProps {
205
87
  appearance?: Appearance;
206
- /**
207
- * Children of modal dialog header.
208
- */
209
88
  children?: ReactNode;
210
- /**
211
- * When `true` will allow the title to span multiple lines.
212
- * Defaults to `true`.
213
- */
214
89
  isMultiline?: boolean;
215
- /**
216
- * A `testId` prop is provided for specified elements,
217
- * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
218
- * serving as a hook for automated tests.
219
- */
220
90
  testId?: string;
221
91
  }
222
92
 
223
- /**
224
- * __Modal transition__
225
- *
226
- * A modal transition wraps a modal to provide a fluid transition upon opening and closing.
227
- *
228
- * - [Examples](https://atlassian.design/components/modal-dialog/examples)
229
- * - [Code](https://atlassian.design/components/modal-dialog/code)
230
- * - [Usage](https://atlassian.design/components/modal-dialog/usage)
231
- */
232
- export declare const ModalTransition: (
93
+ // @public
94
+ export const ModalTransition: (
233
95
  props: Pick<ExitingPersistenceProps, 'children'>,
234
96
  ) => JSX.Element;
235
97
 
236
- /**
237
- * __Modal wrapper__
238
- *
239
- * A modal wrapper displays content that requires user interaction, in a layer above the page.
240
- * This component is primary container for other modal components.
241
- *
242
- * - [Examples](https://atlassian.design/components/modal-dialog/examples)
243
- * - [Code](https://atlassian.design/components/modal-dialog/code)
244
- * - [Usage](https://atlassian.design/components/modal-dialog/usage)
245
- */
246
- declare const ModalWrapper: (props: ModalDialogProps) => jsx.JSX.Element;
98
+ // @public
99
+ const ModalWrapper: (props: ModalDialogProps) => jsx.JSX.Element;
247
100
  export default ModalWrapper;
248
101
 
249
- export declare type OnCloseCompleteHandler = (element: HTMLElement) => void;
102
+ // @public (undocumented)
103
+ export type OnCloseCompleteHandler = (element: HTMLElement) => void;
250
104
 
251
- export declare type OnCloseHandler = (
105
+ // @public (undocumented)
106
+ export type OnCloseHandler = (
252
107
  e: KeyboardOrMouseEvent,
253
108
  analyticEvent: UIAnalyticsEvent,
254
109
  ) => void;
255
110
 
256
- export declare type OnOpenCompleteHandler = (
111
+ // @public (undocumented)
112
+ export type OnOpenCompleteHandler = (
257
113
  node: HTMLElement,
258
114
  isAppearing: boolean,
259
115
  ) => void;
260
116
 
261
- export declare type OnStackChangeHandler = (stackIndex: number) => void;
117
+ // @public (undocumented)
118
+ export type OnStackChangeHandler = (stackIndex: number) => void;
262
119
 
263
- export declare const useModal: () => ModalAttributes;
120
+ // @public (undocumented)
121
+ export const useModal: () => ModalAttributes;
264
122
 
265
- declare type WidthNames = 'small' | 'medium' | 'large' | 'x-large';
123
+ // @public (undocumented)
124
+ type WidthNames = 'small' | 'medium' | 'large' | 'x-large';
266
125
 
267
- export {};
126
+ // (No @packageDocumentation comment for this package)
268
127
  ```
@@ -1 +0,0 @@
1
- export declare const useModal: () => import("./internal/context").ModalAttributes;
@@ -1,8 +0,0 @@
1
- export { default } from './modal-wrapper';
2
- export { default as ModalTransition } from './modal-transition';
3
- export type { KeyboardOrMouseEvent, Appearance, ModalAttributes, ModalDialogProps, ModalHeaderProps, ModalTitleProps, ModalBodyProps, ModalFooterProps, OnCloseHandler, OnCloseCompleteHandler, OnOpenCompleteHandler, OnStackChangeHandler, } from './types';
4
- export { default as ModalHeader } from './modal-header';
5
- export { default as ModalTitle } from './modal-title';
6
- export { default as ModalBody } from './modal-body';
7
- export { default as ModalFooter } from './modal-footer';
8
- export { useModal } from './hooks';
@@ -1,4 +0,0 @@
1
- import { jsx } from '@emotion/react';
2
- import type { ModalDialogProps } from '../../types';
3
- declare const ModalDialog: (props: ModalDialogProps) => jsx.JSX.Element;
4
- export default ModalDialog;
@@ -1,11 +0,0 @@
1
- /** @jsx jsx */
2
- import { ReactNode } from 'react';
3
- import { jsx } from '@emotion/react';
4
- interface PositionerProps {
5
- children?: ReactNode;
6
- stackIndex: number;
7
- shouldScrollInViewport: boolean;
8
- testId?: string;
9
- }
10
- declare const Positioner: (props: PositionerProps) => jsx.JSX.Element;
11
- export default Positioner;
@@ -1,20 +0,0 @@
1
- /** @jsx jsx */
2
- import React from 'react';
3
- interface ScrollContainerProps {
4
- /**
5
- * Children of the body within modal dialog.
6
- */
7
- children: React.ReactNode;
8
- /**
9
- * A `testId` prop is provided for specified elements,
10
- * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
11
- * serving as a hook for automated tests.
12
- */
13
- testId?: string;
14
- }
15
- /**
16
- * A container that shows top and bottom keylines when the
17
- * content overflows into the scrollable element.
18
- */
19
- declare const ScrollContainer: React.ForwardRefExoticComponent<ScrollContainerProps & React.RefAttributes<HTMLElement | null>>;
20
- export default ScrollContainer;
@@ -1,23 +0,0 @@
1
- import type { Appearance } from '../types';
2
- export declare type WidthNames = 'small' | 'medium' | 'large' | 'x-large';
3
- interface Width {
4
- values: string[];
5
- widths: {
6
- [index in WidthNames]: number;
7
- };
8
- defaultValue: string;
9
- }
10
- export declare const width: Width;
11
- export declare const gutter = 60;
12
- export declare const borderRadius: number;
13
- export declare const verticalOffset: number;
14
- export declare const padding: number;
15
- export declare const footerItemGap: number;
16
- export declare const titleIconMargin: number;
17
- export declare const keylineHeight = 2;
18
- export declare const keylineColor: "var(--ds-border)";
19
- export declare const textColor: "var(--ds-text)";
20
- export declare const iconColor: {
21
- [key in Appearance]: string;
22
- };
23
- export {};
@@ -1,20 +0,0 @@
1
- /// <reference types="react" />
2
- import { ModalDialogProps, OnCloseHandler } from '../types';
3
- export declare type ModalAttributes = {
4
- /**
5
- * Test id passed to the modal dialog.
6
- */
7
- testId?: ModalDialogProps['testId'];
8
- /**
9
- * Id referenced by the modal dialog's `aria-labelledby` attribute.
10
- * This id should be assigned to the modal title element.
11
- */
12
- titleId: string;
13
- /**
14
- * Callback function called when the modal dialog is requesting to be closed,
15
- * wrapped in modal dialog's analytic event context.
16
- */
17
- onClose?: OnCloseHandler;
18
- };
19
- export declare const ModalContext: import("react").Context<ModalAttributes | null>;
20
- export declare const ScrollContext: import("react").Context<boolean | null>;
@@ -1,13 +0,0 @@
1
- interface ModalStackOpts {
2
- /**
3
- * Fired when the modal dialog stack has changed.
4
- */
5
- onStackChange: (newStackIndex: number) => void;
6
- }
7
- /**
8
- * Returns the position of the calling modal dialog in the modal dialog stack.
9
- * Stack index of `0` is the highest position in the stack,
10
- * with every higher number being behind in the stack.
11
- */
12
- export default function useModalStack({ onStackChange, }: ModalStackOpts): number;
13
- export {};
@@ -1,7 +0,0 @@
1
- import { RefObject } from 'react';
2
- import type { Transition } from '@atlaskit/motion/types';
3
- import { ModalDialogProps } from '../../types';
4
- export default function useOnMotionFinish({ onOpenComplete, onCloseComplete, }: Pick<ModalDialogProps, 'onOpenComplete' | 'onCloseComplete'>): [
5
- RefObject<HTMLElement>,
6
- (state: Transition) => void
7
- ];
@@ -1,7 +0,0 @@
1
- /**
2
- * Prevents programatic scrolling of the viewport with `scrollIntoView`.
3
- * Should be used in conjunction with a scroll lock to prevent a user from scrolling.
4
- *
5
- * @returns scroll top offset of the viewport
6
- */
7
- export default function usePreventProgrammaticScroll(): number;
@@ -1 +0,0 @@
1
- export default function useScroll(): boolean;
@@ -1,3 +0,0 @@
1
- import { ModalDialogProps } from '../types';
2
- export declare const dialogWidth: (input?: ModalDialogProps['width']) => string;
3
- export declare const dialogHeight: (input?: ModalDialogProps['height']) => string;
@@ -1,26 +0,0 @@
1
- /** @jsx jsx */
2
- import React from 'react';
3
- import { jsx } from '@emotion/react';
4
- export interface ModalBodyProps {
5
- /**
6
- * Children of modal dialog footer.
7
- */
8
- children: React.ReactNode;
9
- /**
10
- * A `testId` prop is provided for specified elements,
11
- * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
12
- * serving as a hook for automated tests.
13
- */
14
- testId?: string;
15
- }
16
- /**
17
- * __Modal body__
18
- *
19
- * A modal body is used to display the main content of a modal.
20
- *
21
- * - [Examples](https://atlassian.design/components/modal-dialog/examples)
22
- * - [Code](https://atlassian.design/components/modal-dialog/code#modal-body-props)
23
- * - [Usage](https://atlassian.design/components/modal-dialog/usage)
24
- */
25
- declare const ModalBody: (props: ModalBodyProps) => jsx.JSX.Element;
26
- export default ModalBody;
@@ -1,26 +0,0 @@
1
- /** @jsx jsx */
2
- import { ReactNode } from 'react';
3
- import { jsx } from '@emotion/react';
4
- export interface ModalFooterProps {
5
- /**
6
- * Children of modal dialog footer.
7
- */
8
- children?: ReactNode;
9
- /**
10
- * A `testId` prop is provided for specified elements,
11
- * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
12
- * serving as a hook for automated tests.
13
- */
14
- testId?: string;
15
- }
16
- /**
17
- * __Modal footer__
18
- *
19
- * A modal footer often contains a primary action and the ability to cancel and close the dialog, though can contain any React element.
20
- *
21
- * - [Examples](https://atlassian.design/components/modal-dialog/examples#modal-footer)
22
- * - [Code](https://atlassian.design/components/modal-dialog/code#modal-footer-props)
23
- * - [Usage](https://atlassian.design/components/modal-dialog/usage)
24
- */
25
- declare const ModalFooter: (props: ModalFooterProps) => jsx.JSX.Element;
26
- export default ModalFooter;
@@ -1,26 +0,0 @@
1
- /** @jsx jsx */
2
- import React from 'react';
3
- import { jsx } from '@emotion/react';
4
- export interface ModalHeaderProps {
5
- /**
6
- * Children of modal dialog header.
7
- */
8
- children?: React.ReactNode;
9
- /**
10
- * A `testId` prop is provided for specified elements,
11
- * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
12
- * serving as a hook for automated tests.
13
- */
14
- testId?: string;
15
- }
16
- /**
17
- * __Modal header__
18
- *
19
- * A modal header contains the title of the modal and can contain other React elements such as a close button.
20
- *
21
- * - [Examples](https://atlassian.design/components/modal-dialog/examples#modal-header)
22
- * - [Code](https://atlassian.design/components/modal-dialog/code#modal-header-props)
23
- * - [Usage](https://atlassian.design/components/modal-dialog/usage)
24
- */
25
- declare const ModalHeader: (props: ModalHeaderProps) => jsx.JSX.Element;
26
- export default ModalHeader;
@@ -1,36 +0,0 @@
1
- /** @jsx jsx */
2
- import { ReactNode } from 'react';
3
- import { jsx } from '@emotion/react';
4
- import { Appearance } from './types';
5
- export interface ModalTitleProps {
6
- /**
7
- * Appearance of the modal that changes the color of the primary action and adds an icon to the title.
8
- */
9
- appearance?: Appearance;
10
- /**
11
- * Children of modal dialog header.
12
- */
13
- children?: ReactNode;
14
- /**
15
- * When `true` will allow the title to span multiple lines.
16
- * Defaults to `true`.
17
- */
18
- isMultiline?: boolean;
19
- /**
20
- * A `testId` prop is provided for specified elements,
21
- * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
22
- * serving as a hook for automated tests.
23
- */
24
- testId?: string;
25
- }
26
- /**
27
- * __Modal title__
28
- *
29
- * A modal title is used to display a title within a modal.
30
- *
31
- * - [Examples](https://atlassian.design/components/modal-dialog/examples)
32
- * - [Code](https://atlassian.design/components/modal-dialog/code)
33
- * - [Usage](https://atlassian.design/components/modal-dialog/usage)
34
- */
35
- declare const ModalTitle: (props: ModalTitleProps) => jsx.JSX.Element;
36
- export default ModalTitle;
@@ -1,13 +0,0 @@
1
- /// <reference types="react" />
2
- import { ExitingPersistenceProps } from '@atlaskit/motion/exiting-persistence';
3
- /**
4
- * __Modal transition__
5
- *
6
- * A modal transition wraps a modal to provide a fluid transition upon opening and closing.
7
- *
8
- * - [Examples](https://atlassian.design/components/modal-dialog/examples)
9
- * - [Code](https://atlassian.design/components/modal-dialog/code)
10
- * - [Usage](https://atlassian.design/components/modal-dialog/usage)
11
- */
12
- declare const ModalTransition: (props: Pick<ExitingPersistenceProps, 'children'>) => JSX.Element;
13
- export default ModalTransition;
@@ -1,16 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/react';
3
- import type { ModalDialogProps } from './types';
4
- export type { ModalDialogProps };
5
- /**
6
- * __Modal wrapper__
7
- *
8
- * A modal wrapper displays content that requires user interaction, in a layer above the page.
9
- * This component is primary container for other modal components.
10
- *
11
- * - [Examples](https://atlassian.design/components/modal-dialog/examples)
12
- * - [Code](https://atlassian.design/components/modal-dialog/code)
13
- * - [Usage](https://atlassian.design/components/modal-dialog/usage)
14
- */
15
- declare const ModalWrapper: (props: ModalDialogProps) => jsx.JSX.Element;
16
- export default ModalWrapper;
@@ -1,90 +0,0 @@
1
- import React, { RefObject } from 'react';
2
- import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
3
- import type { WidthNames } from './internal/constants';
4
- export declare type KeyboardOrMouseEvent = React.MouseEvent<any> | React.KeyboardEvent<any> | KeyboardEvent;
5
- export declare type Appearance = 'danger' | 'warning';
6
- export declare type OnCloseHandler = (e: KeyboardOrMouseEvent, analyticEvent: UIAnalyticsEvent) => void;
7
- export declare type OnCloseCompleteHandler = (element: HTMLElement) => void;
8
- export declare type OnOpenCompleteHandler = (node: HTMLElement, isAppearing: boolean) => void;
9
- export declare type OnStackChangeHandler = (stackIndex: number) => void;
10
- export type { ModalHeaderProps } from './modal-header';
11
- export type { ModalTitleProps } from './modal-title';
12
- export type { ModalBodyProps } from './modal-body';
13
- export type { ModalFooterProps } from './modal-footer';
14
- export type { ModalAttributes } from './internal/context';
15
- export interface ModalDialogProps {
16
- /**
17
- * Focus is moved to the first interactive element inside the modal dialog when `true`.
18
- * Pass an element `ref` to focus on a specific element.
19
- */
20
- autoFocus?: boolean | RefObject<HTMLElement | null | undefined>;
21
- /**
22
- * Contents of the modal dialog.
23
- */
24
- children?: React.ReactNode;
25
- /**
26
- * Height of the modal dialog.
27
- * When unset the modal dialog will grow to fill the viewport and then start overflowing its contents.
28
- */
29
- height?: number | string;
30
- /**
31
- * Width of the modal dialog.
32
- * The recommended way to specify modal width is using named size options.
33
- */
34
- width?: number | string | WidthNames;
35
- /**
36
- * Callback function called when the modal dialog is requesting to be closed.
37
- */
38
- onClose?: OnCloseHandler;
39
- /**
40
- * Callback function called when the modal dialog has finished closing.
41
- */
42
- onCloseComplete?: OnCloseCompleteHandler;
43
- /**
44
- * Callback function called when the modal dialog has finished opening.
45
- */
46
- onOpenComplete?: OnOpenCompleteHandler;
47
- /**
48
- * Callback function called when the modal changes position in the stack.
49
- */
50
- onStackChange?: OnStackChangeHandler;
51
- /**
52
- * Will set the scroll boundary to the viewport.
53
- * If set to false, the scroll boundary is set to the modal dialog body.
54
- */
55
- shouldScrollInViewport?: boolean;
56
- /**
57
- * Calls `onClose` when clicking the blanket behind the modal dialog.
58
- */
59
- shouldCloseOnOverlayClick?: boolean;
60
- /**
61
- * Calls `onClose` when pressing escape.
62
- */
63
- shouldCloseOnEscapePress?: boolean;
64
- /**
65
- * Will remove the blanket tinted background color.
66
- */
67
- isBlanketHidden?: boolean;
68
- /**
69
- * Number representing where in the stack of modals this modal sits.
70
- * This offsets the modal dialogs vertical position.
71
- */
72
- stackIndex?: number;
73
- /**
74
- * A `testId` prop is provided for specified elements,
75
- * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
76
- * serving as a hook for automated tests.
77
- *
78
- * If not overridden using `testId` prop in the respective components,
79
- * this will set `data-testid` on these elements when defined:
80
- *
81
- * - Modal dialog - `{testId}`
82
- * - Modal header - `{testId}--header`
83
- * - Modal title - `{testId}--title`
84
- * - Modal body - `{testId}--body`
85
- * - Modal footer - `{testId}--footer`
86
- * - Scrollable element - `{testId}--scrollable`
87
- * - Blanket - `{testId}--blanket`
88
- */
89
- testId?: string;
90
- }