@react-spectrum/dialog 3.0.0-nightly.1663 → 3.0.0-nightly.1675

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/dialog",
3
- "version": "3.0.0-nightly.1663+2a6c48eb0",
3
+ "version": "3.0.0-nightly.1675+7cebb4eea",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -32,30 +32,30 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@babel/runtime": "^7.6.2",
35
- "@react-aria/dialog": "3.0.0-nightly.1663+2a6c48eb0",
36
- "@react-aria/focus": "3.0.0-nightly.1663+2a6c48eb0",
37
- "@react-aria/i18n": "3.0.0-nightly.1663+2a6c48eb0",
38
- "@react-aria/interactions": "3.0.0-nightly.1663+2a6c48eb0",
39
- "@react-aria/overlays": "3.0.0-nightly.1663+2a6c48eb0",
40
- "@react-aria/utils": "3.0.0-nightly.1663+2a6c48eb0",
41
- "@react-spectrum/button": "3.0.0-nightly.1663+2a6c48eb0",
42
- "@react-spectrum/buttongroup": "3.3.2-nightly.3363+2a6c48eb0",
43
- "@react-spectrum/divider": "3.0.0-nightly.1663+2a6c48eb0",
44
- "@react-spectrum/layout": "3.3.2-nightly.3363+2a6c48eb0",
45
- "@react-spectrum/overlays": "3.0.0-nightly.1663+2a6c48eb0",
46
- "@react-spectrum/text": "3.2.2-nightly.3363+2a6c48eb0",
47
- "@react-spectrum/utils": "3.0.0-nightly.1663+2a6c48eb0",
48
- "@react-spectrum/view": "3.0.0-nightly.1663+2a6c48eb0",
49
- "@react-stately/overlays": "3.3.2-nightly.3363+2a6c48eb0",
50
- "@react-stately/utils": "3.0.0-nightly.1663+2a6c48eb0",
51
- "@react-types/button": "3.5.2-nightly.3363+2a6c48eb0",
52
- "@react-types/dialog": "3.4.2-nightly.3363+2a6c48eb0",
53
- "@react-types/shared": "3.0.0-nightly.1663+2a6c48eb0",
54
- "@spectrum-icons/ui": "3.0.0-nightly.1663+2a6c48eb0"
35
+ "@react-aria/dialog": "3.0.0-nightly.1675+7cebb4eea",
36
+ "@react-aria/focus": "3.0.0-nightly.1675+7cebb4eea",
37
+ "@react-aria/i18n": "3.0.0-nightly.1675+7cebb4eea",
38
+ "@react-aria/interactions": "3.0.0-nightly.1675+7cebb4eea",
39
+ "@react-aria/overlays": "3.0.0-nightly.1675+7cebb4eea",
40
+ "@react-aria/utils": "3.0.0-nightly.1675+7cebb4eea",
41
+ "@react-spectrum/button": "3.0.0-nightly.1675+7cebb4eea",
42
+ "@react-spectrum/buttongroup": "3.3.2-nightly.3375+7cebb4eea",
43
+ "@react-spectrum/divider": "3.0.0-nightly.1675+7cebb4eea",
44
+ "@react-spectrum/layout": "3.3.2-nightly.3375+7cebb4eea",
45
+ "@react-spectrum/overlays": "3.0.0-nightly.1675+7cebb4eea",
46
+ "@react-spectrum/text": "3.2.2-nightly.3375+7cebb4eea",
47
+ "@react-spectrum/utils": "3.0.0-nightly.1675+7cebb4eea",
48
+ "@react-spectrum/view": "3.0.0-nightly.1675+7cebb4eea",
49
+ "@react-stately/overlays": "3.3.2-nightly.3375+7cebb4eea",
50
+ "@react-stately/utils": "3.0.0-nightly.1675+7cebb4eea",
51
+ "@react-types/button": "3.5.2-nightly.3375+7cebb4eea",
52
+ "@react-types/dialog": "3.4.2-nightly.3375+7cebb4eea",
53
+ "@react-types/shared": "3.0.0-nightly.1675+7cebb4eea",
54
+ "@spectrum-icons/ui": "3.0.0-nightly.1675+7cebb4eea"
55
55
  },
56
56
  "devDependencies": {
57
- "@adobe/spectrum-css-temp": "3.0.0-nightly.1663+2a6c48eb0",
58
- "@react-spectrum/test-utils": "3.0.0-nightly.1663+2a6c48eb0"
57
+ "@adobe/spectrum-css-temp": "3.0.0-nightly.1675+7cebb4eea",
58
+ "@react-spectrum/test-utils": "3.0.0-nightly.1675+7cebb4eea"
59
59
  },
60
60
  "peerDependencies": {
61
61
  "@react-spectrum/provider": "^3.0.0",
@@ -65,5 +65,5 @@
65
65
  "publishConfig": {
66
66
  "access": "public"
67
67
  },
68
- "gitHead": "2a6c48eb0099671cf9b530ec3d75882c549e9cb5"
68
+ "gitHead": "7cebb4eea31f383f1eec06cc53a7909f8736f66a"
69
69
  }
@@ -27,7 +27,7 @@ import React, {forwardRef, useContext} from 'react';
27
27
  import {SpectrumAlertDialogProps} from '@react-types/dialog';
28
28
  import {SpectrumButtonProps} from '@react-types/button';
29
29
  import styles from '@adobe/spectrum-css-temp/components/dialog/vars.css';
30
- import {useMessageFormatter} from '@react-aria/i18n';
30
+ import {useLocalizedStringFormatter} from '@react-aria/i18n';
31
31
 
32
32
  /**
33
33
  * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.
@@ -53,7 +53,7 @@ function AlertDialog(props: SpectrumAlertDialogProps, ref: DOMRef) {
53
53
  ...otherProps
54
54
  } = props;
55
55
  let {styleProps} = useStyleProps(otherProps);
56
- let formatMessage = useMessageFormatter(intlMessages);
56
+ let stringFormatter = useLocalizedStringFormatter(intlMessages);
57
57
 
58
58
  let confirmVariant: SpectrumButtonProps['variant'] = 'primary';
59
59
  if (variant) {
@@ -76,7 +76,7 @@ function AlertDialog(props: SpectrumAlertDialogProps, ref: DOMRef) {
76
76
  {(variant === 'error' || variant === 'warning') &&
77
77
  <AlertMedium
78
78
  slot="typeIcon"
79
- aria-label={formatMessage('alert')} />
79
+ aria-label={stringFormatter.format('alert')} />
80
80
  }
81
81
  <Divider />
82
82
  <Content>{children}</Content>
package/src/Dialog.tsx CHANGED
@@ -25,7 +25,7 @@ import React, {useContext, useMemo, useRef} from 'react';
25
25
  import {SpectrumDialogProps} from '@react-types/dialog';
26
26
  import styles from '@adobe/spectrum-css-temp/components/dialog/vars.css';
27
27
  import {useDialog} from '@react-aria/dialog';
28
- import {useMessageFormatter} from '@react-aria/i18n';
28
+ import {useLocalizedStringFormatter} from '@react-aria/i18n';
29
29
 
30
30
  let sizeMap = {
31
31
  S: 'small',
@@ -47,7 +47,7 @@ function Dialog(props: SpectrumDialogProps, ref: DOMRef) {
47
47
  size,
48
48
  ...otherProps
49
49
  } = props;
50
- let formatMessage = useMessageFormatter(intlMessages);
50
+ let stringFormatter = useLocalizedStringFormatter(intlMessages);
51
51
  let {styleProps} = useStyleProps(otherProps);
52
52
 
53
53
  size = type === 'popover' ? (size || 'S') : (size || 'L');
@@ -103,7 +103,7 @@ function Dialog(props: SpectrumDialogProps, ref: DOMRef) {
103
103
  <ActionButton
104
104
  UNSAFE_className={styles['spectrum-Dialog-closeButton']}
105
105
  isQuiet
106
- aria-label={formatMessage('dismiss')}
106
+ aria-label={stringFormatter.format('dismiss')}
107
107
  onPress={onDismiss}>
108
108
  <CrossLarge />
109
109
  </ActionButton>
package/src/index.ts CHANGED
@@ -17,3 +17,6 @@ export {Dialog} from './Dialog';
17
17
  export {DialogTrigger} from './DialogTrigger';
18
18
  export {DialogContainer} from './DialogContainer';
19
19
  export {useDialogContainer} from './useDialogContainer';
20
+
21
+ export type {SpectrumAlertDialogProps, SpectrumDialogProps, SpectrumDialogContainerProps, SpectrumDialogTriggerProps} from '@react-types/dialog';
22
+ export type {DialogContainerValue} from './useDialogContainer';
@@ -13,12 +13,12 @@
13
13
  import {DialogContext} from './context';
14
14
  import {useContext} from 'react';
15
15
 
16
- interface DialogContainer {
16
+ export interface DialogContainerValue {
17
17
  type: 'modal' | 'popover' | 'tray' | 'fullscreen' | 'fullscreenTakeover',
18
18
  dismiss(): void
19
19
  }
20
20
 
21
- export function useDialogContainer(): DialogContainer {
21
+ export function useDialogContainer(): DialogContainerValue {
22
22
  let context = useContext(DialogContext);
23
23
  if (!context) {
24
24
  throw new Error('Cannot call useDialogContext outside a <DialogTrigger> or <DialogContainer>.');