Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@kalamazoo/modal-dialog

stevenselcuk18Apache-2.01.0.2TypeScript support: included

A React component that displays content in a layer blocking the interaction with the page.

atlaskit, react, ui

readme

ModalDialog

This component displays content in a layer that sits above the rest of the page content. Users won't be able to interact with the page until the dialog is closed.

Installation

yarn add @kalamazoo/modal-dialog

Usage

Detailed docs and example usage can be found here.

changelog

@kalamazoo/modal-dialog

10.5.0

Minor Changes

  • [minor]24865cfaff:

    Allowing support for using with new react-beautiful-dnd 12.x API

Patch Changes

10.4.0

Minor Changes

  • [minor]1ed27f5f85:

    Adds prop types for Header / Footer render props.

10.3.6

10.3.5

Patch Changes

  • [patch]b39742b616:

    fixed type for the actions props

10.3.4

Patch Changes

  • [patch]f86839ca4e:

    @kalamazoo/portal had an issue in IE11 and this is fixed in 3.1.2

10.3.3

Patch Changes

  • [patch]35d2229b2a:

    Adding missing license to packages and update to Copyright 2019 Atlassian Pty Ltd.

10.3.2

Patch Changes

  • [patch]a2d0043716:

    Updated version of analytics-next to fix potential incompatibilities with TS 3.6

10.3.1

10.3.0

Minor Changes

  • [minor]66e147e6a1:

    Adding an optional prop testId that will set the attribute value data-testid. It will help products to write better integration and end to end tests.

10.2.1

10.2.0

Minor Changes

10.1.9

Patch Changes

  • [patch]097b696613:

    Components now depend on TS 3.6 internally, in order to fix an issue with TS resolving non-relative imports as relative imports

10.1.8

Patch Changes

  • [patch]0d7d459f1a:

    Fixes type errors which were incompatible with TS 3.6

10.1.7

Patch Changes

  • [patch]f4ba40109f:

    Refactors modal-dialog's styled component props

10.1.6

Patch Changes

10.1.5

Patch Changes

  • [patch]708028db86:

    Change all the imports to theme in Core to use multi entry points

10.1.4

Patch Changes

  • [patch]de35ce8c67:

    Updates component maintainers

10.1.3

Patch Changes

  • [patch]926b43142b:

    Analytics-next has been converted to Typescript. Typescript consumers will now get static type safety. Flow types are no longer provided. No behavioural changes.

    Breaking changes

    • withAnalyticsForSumTypeProps alias has been removed, please use withAnalyticsEvents
    • AnalyticsContextWrappedComp alias has been removed, please use withAnalyticsContext

    Breaking changes to TypeScript annotations

    • withAnalyticsEvents now infers proptypes automatically, consumers no longer need to provide props as a generic type.
    • withAnalyticsContext now infers proptypes automatically, consumers no longer need to provide props as a generic type.
    • Type WithAnalyticsEventProps has been renamed to WithAnalyticsEventsProps to match source code
    • Type CreateUIAnalyticsEventSignature has been renamed to CreateUIAnalyticsEvent to match source code
    • Type UIAnalyticsEventHandlerSignature has been renamed to UIAnalyticsEventHandler to match source code
    • Type AnalyticsEventsPayload has been renamed to AnalyticsEventPayload
    • Type ObjectType has been removed, please use Record<string, any> or [key: string]: any
    • Type UIAnalyticsEventInterface has been removed, please use UIAnalyticsEvent
    • Type AnalyticsEventInterface has been removed, please use AnalyticsEvent
    • Type CreateAndFireEventFunction removed and should now be inferred by TypeScript
    • Type AnalyticsEventUpdater removed and should now be inferred by TypeScript

10.1.2

10.1.1

Patch Changes

  • [patch]688f2957ca:

    Fixes various TypeScript errors which were previously failing silently

10.1.0

Minor Changes

  • [minor]eb7b748d59:

    Modal-dialog padding now matches AGD and GUI pack

10.0.14

Patch Changes

  • [patch]9f8ab1084b:

    Consume analytics-next ts type definitions as an ambient declaration.

10.0.13

Patch Changes

  • [patch]bbff8a7d87:

    Fixes bug, missing version.json file

10.0.12

Patch Changes

  • [patch]18dfac7332:

    In this PR, we are:

    • Re-introducing dist build folders
    • Adding back cjs
    • Replacing es5 by cjs and es2015 by esm
    • Creating folders at the root for entry-points
    • Removing the generation of the entry-points at the root Please see this ticket or this page for further details

10.0.11

Patch Changes

  • [patch]d0db01b410:

    TypeScript users of withAnalyticsEvents and withAnalyticsContext are now required to provide props as a generic type. This is so that TypeScript can correctly calculate the props and defaultProps of the returned component.

    Before:

    withAnalyticsEvents()(Button) as ComponentClass<Props>;

    After:

    withAnalyticsEvents<Props>()(Button);

10.0.10

10.0.9

Patch Changes

  • [patch]0342746c45:

    Closing a dialog in IE11 specific event key

10.0.8

10.0.7

10.0.6

Patch Changes

  • [patch]4615439434:

    index.ts will now be ignored when publishing to npm

10.0.5

Patch Changes

  • [patch]02f1f73671:

    heading prop type changed from string to React.ReactNode. This provides more flexibility for consumers to provide i18n components like FormattedMessage.

10.0.4

10.0.3

10.0.2

10.0.1

  • [patch]b0ef06c685:

    • This is just a safety release in case anything strange happened in in the previous one. See Pull Request #5942 for details

10.0.0

  • [major]06c5cccf9d:

    • modal-dialog has been converted to Typescript. Typescript consumers will now get static type safety. Flow types are no longer provided. No API or behavioural changes.
  • [patch]c3ab82ed42:

    • Bump react-focus-lock to latest 1.19.1, it will fix a bug with document.activeElement
  • Updated dependencies dacfb81ca1:

9.0.0

  • [major]7c17b35107:

    • Updates react and react-dom peer dependencies to react@^16.8.0 and react-dom@^16.8.0. To use this package, please ensure you use at least this version of react and react-dom.

8.0.9

8.0.8

8.0.7

8.0.6

8.0.5

  • [patch]cc8378fcd4:

    • Modal-dialog has been migrated from styled-components to Emotion (v10)
    • styled-components is no longer a peer-dependency
    • Render props Body, Header, Footer and Container continue to get styles applied via className
    • Fixes an issue with modal contents that re-rendered on resize
    • Fixes an issue with forms losing state
    • SSR now works out of the box

    Warning

    Emotion 10 does not provide support for Enzyme shallow rendering. This is due to the fact that uses it's own JSX pragma to support the CSS prop. The pragma internally wraps components and attaches a sibling style tag. Consequently, these implementation details may now be visible as conflicts in your snapshot tests and may be the cause of test failures for cases that reach into modal-dialog.

    If you are using Enzyme to test components dependent on Modal-Dialog, you may need to replace calls to shallow() with a call to mount() instead.

    For more information please see: Migrating to Emotion 10

8.0.4

8.0.3

8.0.2

8.0.1

  • [patch]0f764dbd7c:

    • Modal-dialog no longer shows unnecessary scrollbars in modern browsers

8.0.0

  • [major]76299208e6:

    • Drop ES5 from all the flow modules

    Dropping CJS support in all @atlaskit packages

    As a breaking change, all @atlaskit packages will be dropping cjs distributions and will only distribute esm. This means all distributed code will be transpiled, but will still contain import and export declarations.

    The major reason for doing this is to allow us to support multiple entry points in packages, e.g:

    import colors from `@kalamazoo/theme/colors`;

    Previously this was sort of possible for consumers by doing something like:

    import colors from `@kalamazoo/theme/dist/esm/colors`;

    This has a couple of issues. 1, it treats the file system as API making internal refactors harder, we have to worry about how consumers might be using things that aren't actually supposed to be used. 2. We are unable to do this internally in @atlaskit packages. This leads to lots of packages bundling all of theme, just to use a single color, especially in situations where tree shaking fails.

    To support being able to use multiple entrypoints internally, we unfortunately cannot have multiple distributions as they would need to have very different imports from of their own internal dependencies.

    ES Modules are widely supported by all modern bundlers and can be worked around in node environments.

    We may choose to revisit this solution in the future if we find any unintended condequences, but we see this as a pretty sane path forward which should lead to some major bundle size decreases, saner API's and simpler package architecture.

    Please reach out to #fabric-build (if in Atlassian) or create an issue in Design System Support (for external) if you have any questions or queries about this.

7.3.0

  • [minor]f26a3d0235:

    • Added media queries to make Modal Dialogs Responsive

7.2.4

7.2.3

  • [patch]06713e0a0c:

    • popup select "target" is now a function that must resolve to a node

7.2.2

  • [patch]a7670c1488:

    • Enabling handling focus in model-dialog by rendering component in model-dialog only after portal in model-dialog is attached to DOM.
  • Updated dependencies 27cacd44ab:

7.2.1

7.2.0

  • [minor]07c4cd1:

    • Feature: components prop now has an optional container entry that is wrapped around the header, body and footer. This provides compatibility for forms with fields in the body, and submit buttons in the footer
    • API changes:
      • The header, body and footer props have been deprecated; such custom components should be passed within the components prop instead.
      • Custom Body components passed in using the new method must contain a ref element; this can be done using forwardRef, as seen in the custom example.
    • Documentation: Examples have been updated to demonstrate the new container prop, as well as utilise the new composition method for custom header/body/footers.

7.1.2

  • [patch]2686f21:

    • Removed example demonstrating deprecated reference behaviour

7.1.1

7.1.0

  • [minor]7f99dec:

    • Fix usage of PopupSelect inside ModalDialog

7.0.14

7.0.13

7.0.12

7.0.11

  • [patch]abd3a39:

    • Bump react-beautiful-dnd dependency to v10.0.2

7.0.10

7.0.9

  • [patch]1fb2c2a:

    • Fixed issue where tooltips and modals would initially render in the wrong location

7.0.8

7.0.7

  • [patch]a637f5e:

    • Refine and fix some flow type errors found by fixing @kalamazoo/analytics-next HOCs to allow flow to type check properly

7.0.6

  • [patch]7cbd729:

    • Fixes visual bug where header and footer keylines appeared below textboxes and other components

7.0.5

  • [patch]72bc8da:

    • Removes reference to window in initial state to properly support ssr
  • [patch]b332c91:

    • upgrades verison of react-scrolllock to SSR safe version

7.0.4

7.0.3

  • [patch] Adds missing implicit @babel/runtime dependency b71751b

7.0.2

7.0.1

7.0.0

  • [patch] Updates dependency on portal b46385f
  • [major] Changes the pattern for using dialogs. Adds ModalTransition component to @kalamazoo/modal-dialog. See the migration guide for more information. d5a043a

6.0.12

  • [patch] Bump react-focus-lock to fix issues with selecting text in Safari. 62dc9fc

6.0.11

  • [patch] Adds sideEffects: false to allow proper tree shaking b5d6d04

6.0.9

6.0.8

6.0.7

  • [patch] Bumping react-beautiful-dnd to version 9. Making use of use onBeforeDragStart for dynamic table 9cbd494
  • [none] Updated dependencies 9cbd494

6.0.6

6.0.5

6.0.4

6.0.3

  • [patch] Upgrading react-beautiful-dnd to 8.0.1 87cd977
  • [patch] Upgrading react-beautiful-dnd to 8.0.0 22efc08
  • [none] Updated dependencies 87cd977
  • [none] Updated dependencies 22efc08

6.0.2

  • [patch] Upgrading react-beautiful-dnd to 8.0.5 6052132
  • [none] Updated dependencies 6052132

6.0.1

6.0.0

5.2.8

5.2.7

5.2.6

5.2.5

5.2.4

5.2.3

  • [patch] Upgrading react-beautiful-dnd dependency to ^7.1.3 024b7fb
  • [patch] Updated dependencies 024b7fb

5.2.2

5.2.1

  • [patch] Removes tabbable and focusin dependencies 274e773
  • [none] Updated dependencies 274e773

5.2.0

5.1.1

5.1.0

5.0.1

5.0.0

4.0.5

4.0.2

  • [patch] AK-4416 changes meaning of autofocus prop values c831a3d

4.0.1

  • [patch] Add possibility to display heading in modal in one line (with ellipsis if content is wider than modal) 30883b4

4.0.0

  • [major] Bump to React 16.3. 4251858

3.5.1

  • [patch] Re-releasing due to potentially broken babel release 9ed0bba

3.5.0

  • [minor] Updated website to use iframe to load examples. Example loader now in a separate react app. Webpack config refactored to compile separate example loader, chunking refactored to be more performant with the new website changes. Updated modal-dialog to use new component structure to optionally specify a Body wrapping component. e1fdfd8

3.4.0

  • [minor] Update styled-components dependency to support versions 1.4.6 - 3 ceccf30

3.3.15

3.3.14

  • [patch] Fix react-beautiful-dnd position issues when used inside a modal dialog cfda546

3.3.12

  • [patch] Remove babel-plugin-react-flow-props-to-prop-types 06c1f08

3.3.11

  • [patch] Packages Flow types for elements components 3111e74

3.3.9

  • [patch] Updated inline-dialog to include boundaries element prop, updated Layer to have dynamic boolean escapeWithReference property, updated modal-dialog Content component with overflow-x:hidden' cb72752

3.3.8

  • [patch] Prevent window from being scrolled programmatically 3e3085c

3.3.5

  • [patch] Migrate Navigation from Ak repo to ak mk 2 repo, Fixed flow typing inconsistencies in ak mk 2 bdeef5b

3.3.4

  • [patch] Fix modal appearing behind navigation's drawer blanket when layer manager is not used a6c6e5e

3.3.3

  • [patch] Resolved low hanging flow errors in field-base field-text comment icon item and website, $ 007de27

3.3.2

  • [patch] Fix modal height being clipped by destination parent c30e7b0

3.3.1

  • [patch] Migration of Blanket to mk2 repo 1c55d97

3.3.0

  • [minor] Add React 16 support. 12ea6e4

3.2.5

  • [patch] Migrate modal-dialog to ak mk 2 update deps and add flow types a91cefe

3.2.4 (2017-11-30)

  • bug fix; fix modal dialog not shrinking to viewport height in IE11 (issues closed: ak-3879) (d3bb5cd)

3.2.3 (2017-11-30)

  • bug fix; release stories with fixed console errors (3321c2b)

3.2.2 (2017-11-17)

  • bug fix; bumping internal dependencies to latest major version (3aefbce)

3.2.1 (2017-11-13)

  • bug fix; remove chrome from the wrapping dialog (issues closed: #67) (21f3a0e)

3.2.0 (2017-10-26)

  • bug fix; add deprecation warning to spotlight package (3ea2312)
  • feature; cleanup layer-manager and modal-dialog in preparation for onboarding (02a516b)

3.1.3 (2017-10-26)

  • bug fix; fix to rebuild stories (793b2a7)

3.1.2 (2017-10-22)

  • bug fix; update styled-components dep and react peerDep (6a67bf8)

3.1.1 (2017-10-12)

  • bug fix; bumps version of Page (issues closed: ak-3680) (8713649)

3.1.0 (2017-10-11)

  • feature; add chromeless option to modal to support Connect JSAPI (5ca6a65)

3.0.2 (2017-10-05)

  • bug fix; resolve error in modal dialog (issues closed: ak-3623) (2052679)

3.0.1 (2017-09-26)

  • bug fix; update webpack raw path (issues closed: ak-3589) (0aa9737)

3.0.0 (2017-09-13)

  • breaking; onDialogDismissed = onClose, isOpen prop removed, just render the modal to display it (3819bac)
  • breaking; major overhaul to modal implementation and behaviour (issues closed: ak-2972, ak-3343) (3819bac)

2.6.0 (2017-08-07)

  • feature; Added support for custom modal heights, with the new ModalDialog.height prop. It accepts a number (converted to px) or string (not converted to px, so you can use any unit you like such as %, vh, etc). (issues closed: ak-1723) (3c1f537)

2.5.2 (2017-07-27)

  • fix; rename jsnext:main to jsnext:experimental:main temporarily (c7508e0)

2.5.1 (2017-07-25)

  • fix; use class transform in loose mode in babel to improve load performance in apps (fde719a)

2.2.0 (2017-07-17)

  • fix; rerelease, failed prepublish scripts (5fd82f8)

2.2.0 (2017-07-17)

  • feature; added ES module builds to dist and add jsnext:main to most ADG packages (ea76507)

2.1.2 (2017-06-15)

  • fix; avoid unwanted re-render of modal children when state/props change (7ae6324)

2.1.1 (2017-05-26)

  • fix; add prop-types as a dependency to avoid React 15.x warnings (92598eb)
  • fix; pin react-lorem-component version to avoid newly released broken version (6f3d9c6)

2.1.0 (2017-05-06)

  • feature; animated entry/exit of modal dialog (e721aaa)

2.0.0 (2017-05-05)

  • switch modal styling to styled-components (f9510b4)
  • breaking; Modal dialog now has a peerDependency on the styled-components package.
  • ISSUES CLOSED: AK-2290

1.3.3 (2017-05-03)

  • fix; Fix child position:fixed elements being clipped (fc0a894)

1.3.2 (2017-04-27)

  • fix; update legal copy to be more clear. Not all modules include ADG license. (f3a945e)

1.3.1 (2017-04-26)

  • fix; update legal copy and fix broken links for component README on npm. New contribution and (0b3e454)

1.3.0 (2017-04-20)

  • feature; removed explicit style! imports, set style-loader in webpack config (891fc3c)

1.2.15 (2017-03-31)

  • fix; update modal story to use latest navigation devDep (5ed9946)
  • fix; update modal story to use latest navigation devDep (c074080)

1.2.14 (2017-03-29)

  • fix; only show scrolling keylines when header or footer shown (fd1c68a)

1.2.13 (2017-03-29)

  • fix; fire onDialogDismissed when clicking on blanket directly below modal (1c9efb0)

1.2.10 (2017-03-21)

  • fix; render rounded corners correctly when header/footer omitted (724480d)
  • fix; maintainers for all the packages were added (261d00a)

1.2.9 (2017-02-28)

  • fix; dummy commit to release stories (3df5d9f)

1.2.7 (2017-02-28)

  • fix; dummy commit to fix broken stories and missing registry pages (a31e92a)

1.2.7 (2017-02-28)

  • fix; dummy commit to release stories for components (a105c02)

1.2.6 (2017-02-28)

  • fix; removes jsdoc annotations and moves content to usage.md (14f941a)

1.2.5 (2017-02-27)

  • empty commit to make components release themselves (5511fbe)

1.2.4 (2017-02-13)

  • Fix types for modal-dialog typescript declaration file (533adea)

1.2.3 (2017-02-08)

  • fix; trigger modal close handler on esc key in older browsers (a692683)

1.2.2 (2017-02-07)

  • fix; render dropdown in modal above footer (2b76812)

1.2.1 (2017-02-06)

  • fix; layer navigation at correct level so it works with modal (5bef9db)