Socket
Socket
Sign inDemoInstall

@react-types/dialog

Package Overview
Dependencies
Maintainers
2
Versions
741
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-types/dialog - npm Package Compare versions

Comparing version 3.0.0-alpha.1 to 3.0.0-nightly-4980928d3-240906

14

package.json
{
"name": "@react-types/dialog",
"version": "3.0.0-alpha.1",
"version": "3.0.0-nightly-4980928d3-240906",
"description": "Spectrum UI components in React",

@@ -9,10 +9,10 @@ "license": "Apache-2.0",

"type": "git",
"url": "https://github.com/adobe-private/react-spectrum-v3"
"url": "https://github.com/adobe/react-spectrum"
},
"dependencies": {
"@react-types/overlays": "^3.0.0-alpha.1",
"@react-types/shared": "^3.0.0-rc.2"
"@react-types/overlays": "^3.0.0-nightly-4980928d3-240906",
"@react-types/shared": "^3.0.0-nightly-4980928d3-240906"
},
"peerDependencies": {
"react": "^16.12.0"
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
},

@@ -22,3 +22,3 @@ "publishConfig": {

},
"gitHead": "207e6ee9076905c96638a7f81a367758872e1410"
}
"stableVersion": "3.5.12"
}
# @react-types/dialog
This package is part of [react-spectrum](https://github.com/adobe-private/react-spectrum-v3). See the repo for more details.
This package is part of [react-spectrum](https://github.com/adobe/react-spectrum). See the repo for more details.

@@ -13,37 +13,68 @@ /*

import {DOMProps, StyleProps} from '@react-types/shared';
import {PositionProps} from '@react-types/overlays';
import {ReactElement, ReactNode, RefObject} from 'react';
import {AriaLabelingProps, DOMProps, RefObject, StyleProps} from '@react-types/shared';
import {OverlayTriggerProps, PositionProps} from '@react-types/overlays';
import {ReactElement, ReactNode} from 'react';
export type SpectrumDialogClose = (close: () => void) => ReactElement;
export interface DialogTriggerProps {
isOpen?: boolean,
defaultOpen?: boolean,
onOpenChange?: (isOpen: boolean) => void
}
export interface SpectrumDialogTriggerProps extends PositionProps, DialogTriggerProps {
export interface SpectrumDialogTriggerProps extends OverlayTriggerProps, PositionProps {
/** The Dialog and its trigger element. See the DialogTrigger [Content section](#content) for more information on what to provide as children. */
children: [ReactElement, SpectrumDialogClose | ReactElement],
/**
* The type of Dialog that should be rendered. See the DialogTrigger [types section](#dialog-types) for an explanation on each.
* @default 'modal'
*/
type?: 'modal' | 'popover' | 'tray' | 'fullscreen' | 'fullscreenTakeover',
/** The type of Dialog that should be rendered when on a mobile device. See DialogTrigger [types section](#dialog-types) for an explanation on each. */
mobileType?: 'modal' | 'tray' | 'fullscreen' | 'fullscreenTakeover',
/**
* Whether a popover type Dialog's arrow should be hidden.
*/
hideArrow?: boolean,
targetRef?: RefObject<HTMLElement>,
isDismissable?: boolean
/** The ref of the element the Dialog should visually attach itself to. Defaults to the trigger button if not defined. */
targetRef?: RefObject<HTMLElement | null>,
/** Whether a modal type Dialog should be dismissable. */
isDismissable?: boolean,
/** Whether pressing the escape key to close the dialog should be disabled. */
isKeyboardDismissDisabled?: boolean
}
export interface SpectrumDialogProps extends DOMProps, StyleProps {
export interface SpectrumDialogContainerProps {
/** The Dialog to display, if any. */
children: ReactNode,
/** Handler that is called when the 'x' button of a dismissable Dialog is clicked. */
onDismiss: () => void,
/**
* The type of Dialog that should be rendered. See the visual options below for examples of each.
* @default 'modal'
*/
type?: 'modal' | 'fullscreen' | 'fullscreenTakeover',
/** Whether the Dialog is dismissable. See the [Dialog docs](Dialog.html#dismissable-dialogs) for more details. */
isDismissable?: boolean,
/** Whether pressing the escape key to close the dialog should be disabled. */
isKeyboardDismissDisabled?: boolean
}
export interface AriaDialogProps extends DOMProps, AriaLabelingProps {
/**
* The accessibility role for the dialog.
* @default 'dialog'
*/
role?: 'dialog' | 'alertdialog'
}
export interface SpectrumDialogProps extends AriaDialogProps, StyleProps {
/** The contents of the Dialog. */
children: ReactNode,
/** The size of the Dialog. Only applies to "modal" type Dialogs. */
size?: 'S' | 'M' | 'L' | 'fullscreen' | 'fullscreenTakeover',
/** Whether the Dialog is [dismissable](#dismissable). */
size?: 'S' | 'M' | 'L',
/** Whether the Dialog is dismissable. See the [examples](#examples) for more details. */
isDismissable?: boolean,
onDismiss?: () => void,
role?: 'dialog' | 'alertdialog'
/** Handler that is called when the 'x' button of a dismissable Dialog is clicked. */
onDismiss?: () => void
}
export interface SpectrumAlertDialogProps extends DOMProps, StyleProps {
/** The [visual style](https://spectrum.adobe.com/page/dialog/#Options) of the AlertDialog. */
variant?: 'confirmation' | 'information' | 'destructive' | 'error' | 'warning'
/** The [visual style](https://spectrum.adobe.com/page/alert-dialog/#Options) of the AlertDialog. */
variant?: 'confirmation' | 'information' | 'destructive' | 'error' | 'warning',
/** The title of the AlertDialog. */

@@ -69,6 +100,5 @@ title: string,

onSecondaryAction?: () => void,
/** Button to focus by default upon render. */
autoFocusButton?: 'cancel' | 'primary' | 'secondary',
/** Button to focus by default when the dialog opens. */
autoFocusButton?: 'cancel' | 'primary' | 'secondary'
// allowsKeyboardConfirmation?: boolean, // triggers primary action
// isKeyboardCancelDisabled?: boolean // needed?
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc