Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ModalDialog available in package API #960

Merged
merged 3 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/feedback/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const noop = () => {};

/**
* Show a modal
* @deprecated - Use `ModalDialog` instead
*/
const ModalNext = function Modal({
children,
Expand Down
9 changes: 8 additions & 1 deletion src/next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ export {
TableRow,
Thumbnail,
} from './components/data';
export { Dialog, Modal, Spinner, SpinnerOverlay } from './components/feedback';
export {
Dialog,
Modal,
ModalDialog,
Spinner,
SpinnerOverlay,
} from './components/feedback';
export {
Button,
ButtonBase,
Expand Down Expand Up @@ -78,6 +84,7 @@ export type {
export type {
DialogProps,
ModalProps,
ModalDialogProps,
SpinnerProps,
SpinnerOverlayProps,
} from './components/feedback';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,10 +407,6 @@ export default function DialogPage() {
deprecated <code>Modal</code> component.
</strong>
</p>
<p>
<code>ModalDialog</code> is still under development and is not yet
part of the package API.
</p>
<Library.Example title="Migrating to this component from Modal">
<Library.Changelog>
<Library.ChangelogItem status="changed">
Expand Down Expand Up @@ -497,11 +493,6 @@ export default function DialogPage() {
tables (ARIA <code>{'`role="grid"`'}</code>) or tabs (ARIA{' '}
<code>{'`role="tablist"`'}</code>).
</p>
<p>
<strong>
Keyboard navigation for embedded widgets is under development.
</strong>
</p>
<Library.Demo title="Modal with embedded ARIA widgets" withSource>
<ModalDialog_
buttons={<DialogButtons />}
Expand Down
13 changes: 13 additions & 0 deletions src/pattern-library/components/patterns/feedback/ModalPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,19 @@ export default function ModalPage() {
</p>
}
>
<Library.Pattern title="Status">
<Library.Changelog>
<Library.ChangelogItem status="deprecated">
This implementation of
<s>
<code>Modal</code>
</s>{' '}
is deprecated. Use
<code>ModalDialog</code> or <code>Dialog</code> instead, which
provide a similar API and enhanced accessibility.
</Library.ChangelogItem>
</Library.Changelog>
</Library.Pattern>
<Library.Pattern title="Usage">
<Library.Usage componentName="Modal" />
<Library.Demo title="Basic modal" withSource>
Expand Down