@react-spectrum/dialog 3.8.10 → 3.8.12
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/dist/AlertDialog.main.js +9 -9
- package/dist/AlertDialog.mjs +10 -10
- package/dist/AlertDialog.module.js +9 -9
- package/dist/Dialog.main.js +33 -33
- package/dist/Dialog.mjs +34 -34
- package/dist/Dialog.module.js +33 -33
- package/dist/DialogContainer.main.js +2 -2
- package/dist/DialogContainer.mjs +3 -3
- package/dist/DialogContainer.module.js +2 -2
- package/dist/DialogTrigger.main.js +15 -15
- package/dist/DialogTrigger.mjs +16 -16
- package/dist/DialogTrigger.module.js +15 -15
- package/dist/ar-AE.mjs +1 -1
- package/dist/bg-BG.mjs +1 -1
- package/dist/context.mjs +1 -1
- package/dist/cs-CZ.mjs +1 -1
- package/dist/da-DK.mjs +1 -1
- package/dist/de-DE.mjs +1 -1
- package/dist/dialog_vars_css.mjs +1 -1
- package/dist/el-GR.mjs +1 -1
- package/dist/en-US.mjs +1 -1
- package/dist/es-ES.mjs +1 -1
- package/dist/et-EE.mjs +1 -1
- package/dist/fi-FI.mjs +1 -1
- package/dist/fr-FR.mjs +1 -1
- package/dist/he-IL.mjs +1 -1
- package/dist/hr-HR.mjs +1 -1
- package/dist/hu-HU.mjs +1 -1
- package/dist/intlStrings.mjs +1 -1
- package/dist/it-IT.mjs +1 -1
- package/dist/ja-JP.mjs +1 -1
- package/dist/ko-KR.mjs +1 -1
- package/dist/lt-LT.mjs +1 -1
- package/dist/lv-LV.mjs +1 -1
- package/dist/nb-NO.mjs +1 -1
- package/dist/nl-NL.mjs +1 -1
- package/dist/pl-PL.mjs +1 -1
- package/dist/pt-BR.mjs +1 -1
- package/dist/pt-PT.mjs +1 -1
- package/dist/ro-RO.mjs +1 -1
- package/dist/ru-RU.mjs +1 -1
- package/dist/sk-SK.mjs +1 -1
- package/dist/sl-SI.mjs +1 -1
- package/dist/sr-SP.mjs +1 -1
- package/dist/sv-SE.mjs +1 -1
- package/dist/tr-TR.mjs +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/uk-UA.mjs +1 -1
- package/dist/useDialogContainer.main.js +1 -1
- package/dist/useDialogContainer.mjs +2 -2
- package/dist/useDialogContainer.module.js +1 -1
- package/dist/zh-CN.mjs +1 -1
- package/dist/zh-TW.mjs +1 -1
- package/package.json +22 -22
package/dist/AlertDialog.main.js
CHANGED
|
@@ -54,11 +54,11 @@ $parcel$export(module.exports, "AlertDialog", () => $66f8653ff750aa27$export$de4
|
|
|
54
54
|
let { onClose: onClose = ()=>{} } = (0, $cXXKy$react.useContext)((0, $0eb909ad2388d989$exports.DialogContext)) || {};
|
|
55
55
|
let { variant: variant, children: children, primaryActionLabel: primaryActionLabel, secondaryActionLabel: secondaryActionLabel, cancelLabel: cancelLabel, autoFocusButton: autoFocusButton, title: title, isPrimaryActionDisabled: isPrimaryActionDisabled, isSecondaryActionDisabled: isSecondaryActionDisabled, onCancel: onCancel = ()=>{}, onPrimaryAction: onPrimaryAction = ()=>{}, onSecondaryAction: onSecondaryAction = ()=>{}, ...otherProps } = props;
|
|
56
56
|
let { styleProps: styleProps } = (0, $cXXKy$reactspectrumutils.useStyleProps)(otherProps);
|
|
57
|
-
let stringFormatter = (0, $cXXKy$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($7827d180f5c8b41b$exports))),
|
|
58
|
-
let confirmVariant =
|
|
57
|
+
let stringFormatter = (0, $cXXKy$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($7827d180f5c8b41b$exports))), '@react-spectrum/dialog');
|
|
58
|
+
let confirmVariant = 'primary';
|
|
59
59
|
if (variant) {
|
|
60
|
-
if (variant ===
|
|
61
|
-
else if (variant ===
|
|
60
|
+
if (variant === 'confirmation') confirmVariant = 'cta';
|
|
61
|
+
else if (variant === 'destructive') confirmVariant = 'negative';
|
|
62
62
|
}
|
|
63
63
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $a57fc2323bf98a33$exports.Dialog), {
|
|
64
64
|
UNSAFE_style: styleProps.style,
|
|
@@ -69,25 +69,25 @@ $parcel$export(module.exports, "AlertDialog", () => $66f8653ff750aa27$export$de4
|
|
|
69
69
|
size: "M",
|
|
70
70
|
role: "alertdialog",
|
|
71
71
|
ref: ref
|
|
72
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $cXXKy$reactspectrumtext.Heading), null, title), (variant ===
|
|
72
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $cXXKy$reactspectrumtext.Heading), null, title), (variant === 'error' || variant === 'warning') && /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, ($parcel$interopDefault($cXXKy$spectrumiconsuiAlertMedium))), {
|
|
73
73
|
slot: "typeIcon",
|
|
74
|
-
"aria-label": stringFormatter.format(
|
|
74
|
+
"aria-label": stringFormatter.format('alert')
|
|
75
75
|
}), /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $cXXKy$reactspectrumdivider.Divider), null), /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $cXXKy$reactspectrumview.Content), null, children), /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $cXXKy$reactspectrumbuttongroup.ButtonGroup), {
|
|
76
76
|
align: "end"
|
|
77
77
|
}, cancelLabel && /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $cXXKy$reactspectrumbutton.Button), {
|
|
78
78
|
variant: "secondary",
|
|
79
79
|
onPress: ()=>(0, $cXXKy$reactariautils.chain)(onClose(), onCancel()),
|
|
80
|
-
autoFocus: autoFocusButton ===
|
|
80
|
+
autoFocus: autoFocusButton === 'cancel'
|
|
81
81
|
}, cancelLabel), secondaryActionLabel && /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $cXXKy$reactspectrumbutton.Button), {
|
|
82
82
|
variant: "secondary",
|
|
83
83
|
onPress: ()=>(0, $cXXKy$reactariautils.chain)(onClose(), onSecondaryAction()),
|
|
84
84
|
isDisabled: isSecondaryActionDisabled,
|
|
85
|
-
autoFocus: autoFocusButton ===
|
|
85
|
+
autoFocus: autoFocusButton === 'secondary'
|
|
86
86
|
}, secondaryActionLabel), /*#__PURE__*/ (0, ($parcel$interopDefault($cXXKy$react))).createElement((0, $cXXKy$reactspectrumbutton.Button), {
|
|
87
87
|
variant: confirmVariant,
|
|
88
88
|
onPress: ()=>(0, $cXXKy$reactariautils.chain)(onClose(), onPrimaryAction()),
|
|
89
89
|
isDisabled: isPrimaryActionDisabled,
|
|
90
|
-
autoFocus: autoFocusButton ===
|
|
90
|
+
autoFocus: autoFocusButton === 'primary'
|
|
91
91
|
}, primaryActionLabel)));
|
|
92
92
|
}
|
|
93
93
|
/**
|
package/dist/AlertDialog.mjs
CHANGED
|
@@ -48,11 +48,11 @@ function $parcel$interopDefault(a) {
|
|
|
48
48
|
let { onClose: onClose = ()=>{} } = (0, $7TaMJ$useContext)((0, $97b119e05830ea0d$export$8b93a07348a7730c)) || {};
|
|
49
49
|
let { variant: variant, children: children, primaryActionLabel: primaryActionLabel, secondaryActionLabel: secondaryActionLabel, cancelLabel: cancelLabel, autoFocusButton: autoFocusButton, title: title, isPrimaryActionDisabled: isPrimaryActionDisabled, isSecondaryActionDisabled: isSecondaryActionDisabled, onCancel: onCancel = ()=>{}, onPrimaryAction: onPrimaryAction = ()=>{}, onSecondaryAction: onSecondaryAction = ()=>{}, ...otherProps } = props;
|
|
50
50
|
let { styleProps: styleProps } = (0, $7TaMJ$useStyleProps)(otherProps);
|
|
51
|
-
let stringFormatter = (0, $7TaMJ$useLocalizedStringFormatter)((0, ($parcel$interopDefault($7TaMJ$intlStringsmodulejs))),
|
|
52
|
-
let confirmVariant =
|
|
51
|
+
let stringFormatter = (0, $7TaMJ$useLocalizedStringFormatter)((0, ($parcel$interopDefault($7TaMJ$intlStringsmodulejs))), '@react-spectrum/dialog');
|
|
52
|
+
let confirmVariant = 'primary';
|
|
53
53
|
if (variant) {
|
|
54
|
-
if (variant ===
|
|
55
|
-
else if (variant ===
|
|
54
|
+
if (variant === 'confirmation') confirmVariant = 'cta';
|
|
55
|
+
else if (variant === 'destructive') confirmVariant = 'negative';
|
|
56
56
|
}
|
|
57
57
|
return /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $99cd51dc4eb569f7$export$3ddf2d174ce01153), {
|
|
58
58
|
UNSAFE_style: styleProps.style,
|
|
@@ -63,25 +63,25 @@ function $parcel$interopDefault(a) {
|
|
|
63
63
|
size: "M",
|
|
64
64
|
role: "alertdialog",
|
|
65
65
|
ref: ref
|
|
66
|
-
}, /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Heading), null, title), (variant ===
|
|
66
|
+
}, /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Heading), null, title), (variant === 'error' || variant === 'warning') && /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$spectrumiconsuiAlertMedium), {
|
|
67
67
|
slot: "typeIcon",
|
|
68
|
-
"aria-label": stringFormatter.format(
|
|
68
|
+
"aria-label": stringFormatter.format('alert')
|
|
69
69
|
}), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Divider), null), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Content), null, children), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$ButtonGroup), {
|
|
70
70
|
align: "end"
|
|
71
71
|
}, cancelLabel && /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Button), {
|
|
72
72
|
variant: "secondary",
|
|
73
73
|
onPress: ()=>(0, $7TaMJ$chain)(onClose(), onCancel()),
|
|
74
|
-
autoFocus: autoFocusButton ===
|
|
74
|
+
autoFocus: autoFocusButton === 'cancel'
|
|
75
75
|
}, cancelLabel), secondaryActionLabel && /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Button), {
|
|
76
76
|
variant: "secondary",
|
|
77
77
|
onPress: ()=>(0, $7TaMJ$chain)(onClose(), onSecondaryAction()),
|
|
78
78
|
isDisabled: isSecondaryActionDisabled,
|
|
79
|
-
autoFocus: autoFocusButton ===
|
|
79
|
+
autoFocus: autoFocusButton === 'secondary'
|
|
80
80
|
}, secondaryActionLabel), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Button), {
|
|
81
81
|
variant: confirmVariant,
|
|
82
82
|
onPress: ()=>(0, $7TaMJ$chain)(onClose(), onPrimaryAction()),
|
|
83
83
|
isDisabled: isPrimaryActionDisabled,
|
|
84
|
-
autoFocus: autoFocusButton ===
|
|
84
|
+
autoFocus: autoFocusButton === 'primary'
|
|
85
85
|
}, primaryActionLabel)));
|
|
86
86
|
}
|
|
87
87
|
/**
|
|
@@ -90,4 +90,4 @@ function $parcel$interopDefault(a) {
|
|
|
90
90
|
|
|
91
91
|
|
|
92
92
|
export {$2a8395160fff9af3$export$de466dd8317b0b75 as AlertDialog};
|
|
93
|
-
//# sourceMappingURL=AlertDialog.
|
|
93
|
+
//# sourceMappingURL=AlertDialog.module.js.map
|
|
@@ -48,11 +48,11 @@ function $parcel$interopDefault(a) {
|
|
|
48
48
|
let { onClose: onClose = ()=>{} } = (0, $7TaMJ$useContext)((0, $97b119e05830ea0d$export$8b93a07348a7730c)) || {};
|
|
49
49
|
let { variant: variant, children: children, primaryActionLabel: primaryActionLabel, secondaryActionLabel: secondaryActionLabel, cancelLabel: cancelLabel, autoFocusButton: autoFocusButton, title: title, isPrimaryActionDisabled: isPrimaryActionDisabled, isSecondaryActionDisabled: isSecondaryActionDisabled, onCancel: onCancel = ()=>{}, onPrimaryAction: onPrimaryAction = ()=>{}, onSecondaryAction: onSecondaryAction = ()=>{}, ...otherProps } = props;
|
|
50
50
|
let { styleProps: styleProps } = (0, $7TaMJ$useStyleProps)(otherProps);
|
|
51
|
-
let stringFormatter = (0, $7TaMJ$useLocalizedStringFormatter)((0, ($parcel$interopDefault($7TaMJ$intlStringsmodulejs))),
|
|
52
|
-
let confirmVariant =
|
|
51
|
+
let stringFormatter = (0, $7TaMJ$useLocalizedStringFormatter)((0, ($parcel$interopDefault($7TaMJ$intlStringsmodulejs))), '@react-spectrum/dialog');
|
|
52
|
+
let confirmVariant = 'primary';
|
|
53
53
|
if (variant) {
|
|
54
|
-
if (variant ===
|
|
55
|
-
else if (variant ===
|
|
54
|
+
if (variant === 'confirmation') confirmVariant = 'cta';
|
|
55
|
+
else if (variant === 'destructive') confirmVariant = 'negative';
|
|
56
56
|
}
|
|
57
57
|
return /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $99cd51dc4eb569f7$export$3ddf2d174ce01153), {
|
|
58
58
|
UNSAFE_style: styleProps.style,
|
|
@@ -63,25 +63,25 @@ function $parcel$interopDefault(a) {
|
|
|
63
63
|
size: "M",
|
|
64
64
|
role: "alertdialog",
|
|
65
65
|
ref: ref
|
|
66
|
-
}, /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Heading), null, title), (variant ===
|
|
66
|
+
}, /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Heading), null, title), (variant === 'error' || variant === 'warning') && /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$spectrumiconsuiAlertMedium), {
|
|
67
67
|
slot: "typeIcon",
|
|
68
|
-
"aria-label": stringFormatter.format(
|
|
68
|
+
"aria-label": stringFormatter.format('alert')
|
|
69
69
|
}), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Divider), null), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Content), null, children), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$ButtonGroup), {
|
|
70
70
|
align: "end"
|
|
71
71
|
}, cancelLabel && /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Button), {
|
|
72
72
|
variant: "secondary",
|
|
73
73
|
onPress: ()=>(0, $7TaMJ$chain)(onClose(), onCancel()),
|
|
74
|
-
autoFocus: autoFocusButton ===
|
|
74
|
+
autoFocus: autoFocusButton === 'cancel'
|
|
75
75
|
}, cancelLabel), secondaryActionLabel && /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Button), {
|
|
76
76
|
variant: "secondary",
|
|
77
77
|
onPress: ()=>(0, $7TaMJ$chain)(onClose(), onSecondaryAction()),
|
|
78
78
|
isDisabled: isSecondaryActionDisabled,
|
|
79
|
-
autoFocus: autoFocusButton ===
|
|
79
|
+
autoFocus: autoFocusButton === 'secondary'
|
|
80
80
|
}, secondaryActionLabel), /*#__PURE__*/ (0, $7TaMJ$react).createElement((0, $7TaMJ$Button), {
|
|
81
81
|
variant: confirmVariant,
|
|
82
82
|
onPress: ()=>(0, $7TaMJ$chain)(onClose(), onPrimaryAction()),
|
|
83
83
|
isDisabled: isPrimaryActionDisabled,
|
|
84
|
-
autoFocus: autoFocusButton ===
|
|
84
|
+
autoFocus: autoFocusButton === 'primary'
|
|
85
85
|
}, primaryActionLabel)));
|
|
86
86
|
}
|
|
87
87
|
/**
|
package/dist/Dialog.main.js
CHANGED
|
@@ -43,63 +43,63 @@ $parcel$export(module.exports, "Dialog", () => $a57fc2323bf98a33$export$3ddf2d17
|
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
let $a57fc2323bf98a33$var$sizeMap = {
|
|
46
|
-
S:
|
|
47
|
-
M:
|
|
48
|
-
L:
|
|
49
|
-
fullscreen:
|
|
50
|
-
fullscreenTakeover:
|
|
46
|
+
S: 'small',
|
|
47
|
+
M: 'medium',
|
|
48
|
+
L: 'large',
|
|
49
|
+
fullscreen: 'fullscreen',
|
|
50
|
+
fullscreenTakeover: 'fullscreenTakeover'
|
|
51
51
|
};
|
|
52
52
|
function $a57fc2323bf98a33$var$Dialog(props, ref) {
|
|
53
|
-
props = (0, $1DWg7$reactspectrumutils.useSlotProps)(props,
|
|
54
|
-
let { type: type =
|
|
53
|
+
props = (0, $1DWg7$reactspectrumutils.useSlotProps)(props, 'dialog');
|
|
54
|
+
let { type: type = 'modal', ...contextProps } = (0, $1DWg7$react.useContext)((0, $0eb909ad2388d989$exports.DialogContext)) || {};
|
|
55
55
|
let { children: children, isDismissable: isDismissable = contextProps.isDismissable, onDismiss: onDismiss = contextProps.onClose, size: size, ...otherProps } = props;
|
|
56
|
-
let stringFormatter = (0, $1DWg7$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($7827d180f5c8b41b$exports))),
|
|
56
|
+
let stringFormatter = (0, $1DWg7$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($7827d180f5c8b41b$exports))), '@react-spectrum/dialog');
|
|
57
57
|
let { styleProps: styleProps } = (0, $1DWg7$reactspectrumutils.useStyleProps)(otherProps);
|
|
58
|
-
size = type ===
|
|
58
|
+
size = type === 'popover' ? size || 'S' : size || 'L';
|
|
59
59
|
let domRef = (0, $1DWg7$reactspectrumutils.useDOMRef)(ref);
|
|
60
60
|
let gridRef = (0, $1DWg7$react.useRef)(null);
|
|
61
61
|
let sizeVariant = $a57fc2323bf98a33$var$sizeMap[type] || $a57fc2323bf98a33$var$sizeMap[size];
|
|
62
62
|
let { dialogProps: dialogProps, titleProps: titleProps } = (0, $1DWg7$reactariadialog.useDialog)((0, $1DWg7$reactariautils.mergeProps)(contextProps, props), domRef);
|
|
63
|
-
let hasHeader = (0, $1DWg7$reactspectrumutils.useHasChild)(`.${(0, ($parcel$interopDefault($a74c0984b1adb651$exports)))[
|
|
64
|
-
let hasHeading = (0, $1DWg7$reactspectrumutils.useHasChild)(`.${(0, ($parcel$interopDefault($a74c0984b1adb651$exports)))[
|
|
65
|
-
let hasFooter = (0, $1DWg7$reactspectrumutils.useHasChild)(`.${(0, ($parcel$interopDefault($a74c0984b1adb651$exports)))[
|
|
66
|
-
let hasTypeIcon = (0, $1DWg7$reactspectrumutils.useHasChild)(`.${(0, ($parcel$interopDefault($a74c0984b1adb651$exports)))[
|
|
63
|
+
let hasHeader = (0, $1DWg7$reactspectrumutils.useHasChild)(`.${(0, ($parcel$interopDefault($a74c0984b1adb651$exports)))['spectrum-Dialog-header']}`, (0, $1DWg7$reactspectrumutils.unwrapDOMRef)(gridRef));
|
|
64
|
+
let hasHeading = (0, $1DWg7$reactspectrumutils.useHasChild)(`.${(0, ($parcel$interopDefault($a74c0984b1adb651$exports)))['spectrum-Dialog-heading']}`, (0, $1DWg7$reactspectrumutils.unwrapDOMRef)(gridRef));
|
|
65
|
+
let hasFooter = (0, $1DWg7$reactspectrumutils.useHasChild)(`.${(0, ($parcel$interopDefault($a74c0984b1adb651$exports)))['spectrum-Dialog-footer']}`, (0, $1DWg7$reactspectrumutils.unwrapDOMRef)(gridRef));
|
|
66
|
+
let hasTypeIcon = (0, $1DWg7$reactspectrumutils.useHasChild)(`.${(0, ($parcel$interopDefault($a74c0984b1adb651$exports)))['spectrum-Dialog-typeIcon']}`, (0, $1DWg7$reactspectrumutils.unwrapDOMRef)(gridRef));
|
|
67
67
|
let slots = (0, $1DWg7$react.useMemo)(()=>({
|
|
68
68
|
hero: {
|
|
69
|
-
UNSAFE_className: (0, ($parcel$interopDefault($a74c0984b1adb651$exports)))[
|
|
69
|
+
UNSAFE_className: (0, ($parcel$interopDefault($a74c0984b1adb651$exports)))['spectrum-Dialog-hero']
|
|
70
70
|
},
|
|
71
71
|
heading: {
|
|
72
|
-
UNSAFE_className: (0, $1DWg7$reactspectrumutils.classNames)((0, ($parcel$interopDefault($a74c0984b1adb651$exports))),
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
UNSAFE_className: (0, $1DWg7$reactspectrumutils.classNames)((0, ($parcel$interopDefault($a74c0984b1adb651$exports))), 'spectrum-Dialog-heading', {
|
|
73
|
+
'spectrum-Dialog-heading--noHeader': !hasHeader,
|
|
74
|
+
'spectrum-Dialog-heading--noTypeIcon': !hasTypeIcon
|
|
75
75
|
}),
|
|
76
76
|
level: 2,
|
|
77
77
|
...titleProps
|
|
78
78
|
},
|
|
79
79
|
header: {
|
|
80
|
-
UNSAFE_className: (0, $1DWg7$reactspectrumutils.classNames)((0, ($parcel$interopDefault($a74c0984b1adb651$exports))),
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
UNSAFE_className: (0, $1DWg7$reactspectrumutils.classNames)((0, ($parcel$interopDefault($a74c0984b1adb651$exports))), 'spectrum-Dialog-header', {
|
|
81
|
+
'spectrum-Dialog-header--noHeading': !hasHeading,
|
|
82
|
+
'spectrum-Dialog-header--noTypeIcon': !hasTypeIcon
|
|
83
83
|
})
|
|
84
84
|
},
|
|
85
85
|
typeIcon: {
|
|
86
|
-
UNSAFE_className: (0, ($parcel$interopDefault($a74c0984b1adb651$exports)))[
|
|
86
|
+
UNSAFE_className: (0, ($parcel$interopDefault($a74c0984b1adb651$exports)))['spectrum-Dialog-typeIcon']
|
|
87
87
|
},
|
|
88
88
|
divider: {
|
|
89
|
-
UNSAFE_className: (0, ($parcel$interopDefault($a74c0984b1adb651$exports)))[
|
|
90
|
-
size:
|
|
89
|
+
UNSAFE_className: (0, ($parcel$interopDefault($a74c0984b1adb651$exports)))['spectrum-Dialog-divider'],
|
|
90
|
+
size: 'M'
|
|
91
91
|
},
|
|
92
92
|
content: {
|
|
93
|
-
UNSAFE_className: (0, ($parcel$interopDefault($a74c0984b1adb651$exports)))[
|
|
93
|
+
UNSAFE_className: (0, ($parcel$interopDefault($a74c0984b1adb651$exports)))['spectrum-Dialog-content']
|
|
94
94
|
},
|
|
95
95
|
footer: {
|
|
96
|
-
UNSAFE_className: (0, ($parcel$interopDefault($a74c0984b1adb651$exports)))[
|
|
96
|
+
UNSAFE_className: (0, ($parcel$interopDefault($a74c0984b1adb651$exports)))['spectrum-Dialog-footer']
|
|
97
97
|
},
|
|
98
98
|
buttonGroup: {
|
|
99
|
-
UNSAFE_className: (0, $1DWg7$reactspectrumutils.classNames)((0, ($parcel$interopDefault($a74c0984b1adb651$exports))),
|
|
100
|
-
|
|
99
|
+
UNSAFE_className: (0, $1DWg7$reactspectrumutils.classNames)((0, ($parcel$interopDefault($a74c0984b1adb651$exports))), 'spectrum-Dialog-buttonGroup', {
|
|
100
|
+
'spectrum-Dialog-buttonGroup--noFooter': !hasFooter
|
|
101
101
|
}),
|
|
102
|
-
align:
|
|
102
|
+
align: 'end'
|
|
103
103
|
}
|
|
104
104
|
}), [
|
|
105
105
|
hasFooter,
|
|
@@ -109,20 +109,20 @@ function $a57fc2323bf98a33$var$Dialog(props, ref) {
|
|
|
109
109
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($1DWg7$react))).createElement("section", {
|
|
110
110
|
...styleProps,
|
|
111
111
|
...dialogProps,
|
|
112
|
-
className: (0, $1DWg7$reactspectrumutils.classNames)((0, ($parcel$interopDefault($a74c0984b1adb651$exports))),
|
|
112
|
+
className: (0, $1DWg7$reactspectrumutils.classNames)((0, ($parcel$interopDefault($a74c0984b1adb651$exports))), 'spectrum-Dialog', {
|
|
113
113
|
[`spectrum-Dialog--${sizeVariant}`]: sizeVariant,
|
|
114
|
-
|
|
114
|
+
'spectrum-Dialog--dismissable': isDismissable
|
|
115
115
|
}, styleProps.className),
|
|
116
116
|
ref: domRef
|
|
117
117
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($1DWg7$react))).createElement((0, $1DWg7$reactspectrumlayout.Grid), {
|
|
118
118
|
ref: gridRef,
|
|
119
|
-
UNSAFE_className: (0, ($parcel$interopDefault($a74c0984b1adb651$exports)))[
|
|
119
|
+
UNSAFE_className: (0, ($parcel$interopDefault($a74c0984b1adb651$exports)))['spectrum-Dialog-grid']
|
|
120
120
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($1DWg7$react))).createElement((0, $1DWg7$reactspectrumutils.SlotProvider), {
|
|
121
121
|
slots: slots
|
|
122
122
|
}, children), isDismissable && /*#__PURE__*/ (0, ($parcel$interopDefault($1DWg7$react))).createElement((0, $1DWg7$reactspectrumbutton.ActionButton), {
|
|
123
|
-
UNSAFE_className: (0, ($parcel$interopDefault($a74c0984b1adb651$exports)))[
|
|
123
|
+
UNSAFE_className: (0, ($parcel$interopDefault($a74c0984b1adb651$exports)))['spectrum-Dialog-closeButton'],
|
|
124
124
|
isQuiet: true,
|
|
125
|
-
"aria-label": stringFormatter.format(
|
|
125
|
+
"aria-label": stringFormatter.format('dismiss'),
|
|
126
126
|
onPress: onDismiss
|
|
127
127
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($1DWg7$react))).createElement((0, ($parcel$interopDefault($1DWg7$spectrumiconsuiCrossLarge))), null))));
|
|
128
128
|
}
|
package/dist/Dialog.mjs
CHANGED
|
@@ -37,63 +37,63 @@ function $parcel$interopDefault(a) {
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
let $99cd51dc4eb569f7$var$sizeMap = {
|
|
40
|
-
S:
|
|
41
|
-
M:
|
|
42
|
-
L:
|
|
43
|
-
fullscreen:
|
|
44
|
-
fullscreenTakeover:
|
|
40
|
+
S: 'small',
|
|
41
|
+
M: 'medium',
|
|
42
|
+
L: 'large',
|
|
43
|
+
fullscreen: 'fullscreen',
|
|
44
|
+
fullscreenTakeover: 'fullscreenTakeover'
|
|
45
45
|
};
|
|
46
46
|
function $99cd51dc4eb569f7$var$Dialog(props, ref) {
|
|
47
|
-
props = (0, $3e38X$useSlotProps)(props,
|
|
48
|
-
let { type: type =
|
|
47
|
+
props = (0, $3e38X$useSlotProps)(props, 'dialog');
|
|
48
|
+
let { type: type = 'modal', ...contextProps } = (0, $3e38X$useContext)((0, $97b119e05830ea0d$export$8b93a07348a7730c)) || {};
|
|
49
49
|
let { children: children, isDismissable: isDismissable = contextProps.isDismissable, onDismiss: onDismiss = contextProps.onClose, size: size, ...otherProps } = props;
|
|
50
|
-
let stringFormatter = (0, $3e38X$useLocalizedStringFormatter)((0, ($parcel$interopDefault($3e38X$intlStringsmodulejs))),
|
|
50
|
+
let stringFormatter = (0, $3e38X$useLocalizedStringFormatter)((0, ($parcel$interopDefault($3e38X$intlStringsmodulejs))), '@react-spectrum/dialog');
|
|
51
51
|
let { styleProps: styleProps } = (0, $3e38X$useStyleProps)(otherProps);
|
|
52
|
-
size = type ===
|
|
52
|
+
size = type === 'popover' ? size || 'S' : size || 'L';
|
|
53
53
|
let domRef = (0, $3e38X$useDOMRef)(ref);
|
|
54
54
|
let gridRef = (0, $3e38X$useRef)(null);
|
|
55
55
|
let sizeVariant = $99cd51dc4eb569f7$var$sizeMap[type] || $99cd51dc4eb569f7$var$sizeMap[size];
|
|
56
56
|
let { dialogProps: dialogProps, titleProps: titleProps } = (0, $3e38X$useDialog)((0, $3e38X$mergeProps)(contextProps, props), domRef);
|
|
57
|
-
let hasHeader = (0, $3e38X$useHasChild)(`.${(0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))[
|
|
58
|
-
let hasHeading = (0, $3e38X$useHasChild)(`.${(0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))[
|
|
59
|
-
let hasFooter = (0, $3e38X$useHasChild)(`.${(0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))[
|
|
60
|
-
let hasTypeIcon = (0, $3e38X$useHasChild)(`.${(0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))[
|
|
57
|
+
let hasHeader = (0, $3e38X$useHasChild)(`.${(0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))['spectrum-Dialog-header']}`, (0, $3e38X$unwrapDOMRef)(gridRef));
|
|
58
|
+
let hasHeading = (0, $3e38X$useHasChild)(`.${(0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))['spectrum-Dialog-heading']}`, (0, $3e38X$unwrapDOMRef)(gridRef));
|
|
59
|
+
let hasFooter = (0, $3e38X$useHasChild)(`.${(0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))['spectrum-Dialog-footer']}`, (0, $3e38X$unwrapDOMRef)(gridRef));
|
|
60
|
+
let hasTypeIcon = (0, $3e38X$useHasChild)(`.${(0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))['spectrum-Dialog-typeIcon']}`, (0, $3e38X$unwrapDOMRef)(gridRef));
|
|
61
61
|
let slots = (0, $3e38X$useMemo)(()=>({
|
|
62
62
|
hero: {
|
|
63
|
-
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))[
|
|
63
|
+
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))['spectrum-Dialog-hero']
|
|
64
64
|
},
|
|
65
65
|
heading: {
|
|
66
|
-
UNSAFE_className: (0, $3e38X$classNames)((0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs))),
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
UNSAFE_className: (0, $3e38X$classNames)((0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs))), 'spectrum-Dialog-heading', {
|
|
67
|
+
'spectrum-Dialog-heading--noHeader': !hasHeader,
|
|
68
|
+
'spectrum-Dialog-heading--noTypeIcon': !hasTypeIcon
|
|
69
69
|
}),
|
|
70
70
|
level: 2,
|
|
71
71
|
...titleProps
|
|
72
72
|
},
|
|
73
73
|
header: {
|
|
74
|
-
UNSAFE_className: (0, $3e38X$classNames)((0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs))),
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
UNSAFE_className: (0, $3e38X$classNames)((0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs))), 'spectrum-Dialog-header', {
|
|
75
|
+
'spectrum-Dialog-header--noHeading': !hasHeading,
|
|
76
|
+
'spectrum-Dialog-header--noTypeIcon': !hasTypeIcon
|
|
77
77
|
})
|
|
78
78
|
},
|
|
79
79
|
typeIcon: {
|
|
80
|
-
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))[
|
|
80
|
+
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))['spectrum-Dialog-typeIcon']
|
|
81
81
|
},
|
|
82
82
|
divider: {
|
|
83
|
-
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))[
|
|
84
|
-
size:
|
|
83
|
+
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))['spectrum-Dialog-divider'],
|
|
84
|
+
size: 'M'
|
|
85
85
|
},
|
|
86
86
|
content: {
|
|
87
|
-
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))[
|
|
87
|
+
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))['spectrum-Dialog-content']
|
|
88
88
|
},
|
|
89
89
|
footer: {
|
|
90
|
-
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))[
|
|
90
|
+
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))['spectrum-Dialog-footer']
|
|
91
91
|
},
|
|
92
92
|
buttonGroup: {
|
|
93
|
-
UNSAFE_className: (0, $3e38X$classNames)((0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs))),
|
|
94
|
-
|
|
93
|
+
UNSAFE_className: (0, $3e38X$classNames)((0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs))), 'spectrum-Dialog-buttonGroup', {
|
|
94
|
+
'spectrum-Dialog-buttonGroup--noFooter': !hasFooter
|
|
95
95
|
}),
|
|
96
|
-
align:
|
|
96
|
+
align: 'end'
|
|
97
97
|
}
|
|
98
98
|
}), [
|
|
99
99
|
hasFooter,
|
|
@@ -103,20 +103,20 @@ function $99cd51dc4eb569f7$var$Dialog(props, ref) {
|
|
|
103
103
|
return /*#__PURE__*/ (0, $3e38X$react).createElement("section", {
|
|
104
104
|
...styleProps,
|
|
105
105
|
...dialogProps,
|
|
106
|
-
className: (0, $3e38X$classNames)((0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs))),
|
|
106
|
+
className: (0, $3e38X$classNames)((0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs))), 'spectrum-Dialog', {
|
|
107
107
|
[`spectrum-Dialog--${sizeVariant}`]: sizeVariant,
|
|
108
|
-
|
|
108
|
+
'spectrum-Dialog--dismissable': isDismissable
|
|
109
109
|
}, styleProps.className),
|
|
110
110
|
ref: domRef
|
|
111
111
|
}, /*#__PURE__*/ (0, $3e38X$react).createElement((0, $3e38X$Grid), {
|
|
112
112
|
ref: gridRef,
|
|
113
|
-
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))[
|
|
113
|
+
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))['spectrum-Dialog-grid']
|
|
114
114
|
}, /*#__PURE__*/ (0, $3e38X$react).createElement((0, $3e38X$SlotProvider), {
|
|
115
115
|
slots: slots
|
|
116
116
|
}, children), isDismissable && /*#__PURE__*/ (0, $3e38X$react).createElement((0, $3e38X$ActionButton), {
|
|
117
|
-
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))[
|
|
117
|
+
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))['spectrum-Dialog-closeButton'],
|
|
118
118
|
isQuiet: true,
|
|
119
|
-
"aria-label": stringFormatter.format(
|
|
119
|
+
"aria-label": stringFormatter.format('dismiss'),
|
|
120
120
|
onPress: onDismiss
|
|
121
121
|
}, /*#__PURE__*/ (0, $3e38X$react).createElement((0, $3e38X$spectrumiconsuiCrossLarge), null))));
|
|
122
122
|
}
|
|
@@ -127,4 +127,4 @@ function $99cd51dc4eb569f7$var$Dialog(props, ref) {
|
|
|
127
127
|
|
|
128
128
|
|
|
129
129
|
export {$99cd51dc4eb569f7$export$3ddf2d174ce01153 as Dialog};
|
|
130
|
-
//# sourceMappingURL=Dialog.
|
|
130
|
+
//# sourceMappingURL=Dialog.module.js.map
|
package/dist/Dialog.module.js
CHANGED
|
@@ -37,63 +37,63 @@ function $parcel$interopDefault(a) {
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
let $99cd51dc4eb569f7$var$sizeMap = {
|
|
40
|
-
S:
|
|
41
|
-
M:
|
|
42
|
-
L:
|
|
43
|
-
fullscreen:
|
|
44
|
-
fullscreenTakeover:
|
|
40
|
+
S: 'small',
|
|
41
|
+
M: 'medium',
|
|
42
|
+
L: 'large',
|
|
43
|
+
fullscreen: 'fullscreen',
|
|
44
|
+
fullscreenTakeover: 'fullscreenTakeover'
|
|
45
45
|
};
|
|
46
46
|
function $99cd51dc4eb569f7$var$Dialog(props, ref) {
|
|
47
|
-
props = (0, $3e38X$useSlotProps)(props,
|
|
48
|
-
let { type: type =
|
|
47
|
+
props = (0, $3e38X$useSlotProps)(props, 'dialog');
|
|
48
|
+
let { type: type = 'modal', ...contextProps } = (0, $3e38X$useContext)((0, $97b119e05830ea0d$export$8b93a07348a7730c)) || {};
|
|
49
49
|
let { children: children, isDismissable: isDismissable = contextProps.isDismissable, onDismiss: onDismiss = contextProps.onClose, size: size, ...otherProps } = props;
|
|
50
|
-
let stringFormatter = (0, $3e38X$useLocalizedStringFormatter)((0, ($parcel$interopDefault($3e38X$intlStringsmodulejs))),
|
|
50
|
+
let stringFormatter = (0, $3e38X$useLocalizedStringFormatter)((0, ($parcel$interopDefault($3e38X$intlStringsmodulejs))), '@react-spectrum/dialog');
|
|
51
51
|
let { styleProps: styleProps } = (0, $3e38X$useStyleProps)(otherProps);
|
|
52
|
-
size = type ===
|
|
52
|
+
size = type === 'popover' ? size || 'S' : size || 'L';
|
|
53
53
|
let domRef = (0, $3e38X$useDOMRef)(ref);
|
|
54
54
|
let gridRef = (0, $3e38X$useRef)(null);
|
|
55
55
|
let sizeVariant = $99cd51dc4eb569f7$var$sizeMap[type] || $99cd51dc4eb569f7$var$sizeMap[size];
|
|
56
56
|
let { dialogProps: dialogProps, titleProps: titleProps } = (0, $3e38X$useDialog)((0, $3e38X$mergeProps)(contextProps, props), domRef);
|
|
57
|
-
let hasHeader = (0, $3e38X$useHasChild)(`.${(0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))[
|
|
58
|
-
let hasHeading = (0, $3e38X$useHasChild)(`.${(0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))[
|
|
59
|
-
let hasFooter = (0, $3e38X$useHasChild)(`.${(0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))[
|
|
60
|
-
let hasTypeIcon = (0, $3e38X$useHasChild)(`.${(0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))[
|
|
57
|
+
let hasHeader = (0, $3e38X$useHasChild)(`.${(0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))['spectrum-Dialog-header']}`, (0, $3e38X$unwrapDOMRef)(gridRef));
|
|
58
|
+
let hasHeading = (0, $3e38X$useHasChild)(`.${(0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))['spectrum-Dialog-heading']}`, (0, $3e38X$unwrapDOMRef)(gridRef));
|
|
59
|
+
let hasFooter = (0, $3e38X$useHasChild)(`.${(0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))['spectrum-Dialog-footer']}`, (0, $3e38X$unwrapDOMRef)(gridRef));
|
|
60
|
+
let hasTypeIcon = (0, $3e38X$useHasChild)(`.${(0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))['spectrum-Dialog-typeIcon']}`, (0, $3e38X$unwrapDOMRef)(gridRef));
|
|
61
61
|
let slots = (0, $3e38X$useMemo)(()=>({
|
|
62
62
|
hero: {
|
|
63
|
-
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))[
|
|
63
|
+
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))['spectrum-Dialog-hero']
|
|
64
64
|
},
|
|
65
65
|
heading: {
|
|
66
|
-
UNSAFE_className: (0, $3e38X$classNames)((0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs))),
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
UNSAFE_className: (0, $3e38X$classNames)((0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs))), 'spectrum-Dialog-heading', {
|
|
67
|
+
'spectrum-Dialog-heading--noHeader': !hasHeader,
|
|
68
|
+
'spectrum-Dialog-heading--noTypeIcon': !hasTypeIcon
|
|
69
69
|
}),
|
|
70
70
|
level: 2,
|
|
71
71
|
...titleProps
|
|
72
72
|
},
|
|
73
73
|
header: {
|
|
74
|
-
UNSAFE_className: (0, $3e38X$classNames)((0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs))),
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
UNSAFE_className: (0, $3e38X$classNames)((0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs))), 'spectrum-Dialog-header', {
|
|
75
|
+
'spectrum-Dialog-header--noHeading': !hasHeading,
|
|
76
|
+
'spectrum-Dialog-header--noTypeIcon': !hasTypeIcon
|
|
77
77
|
})
|
|
78
78
|
},
|
|
79
79
|
typeIcon: {
|
|
80
|
-
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))[
|
|
80
|
+
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))['spectrum-Dialog-typeIcon']
|
|
81
81
|
},
|
|
82
82
|
divider: {
|
|
83
|
-
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))[
|
|
84
|
-
size:
|
|
83
|
+
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))['spectrum-Dialog-divider'],
|
|
84
|
+
size: 'M'
|
|
85
85
|
},
|
|
86
86
|
content: {
|
|
87
|
-
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))[
|
|
87
|
+
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))['spectrum-Dialog-content']
|
|
88
88
|
},
|
|
89
89
|
footer: {
|
|
90
|
-
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))[
|
|
90
|
+
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))['spectrum-Dialog-footer']
|
|
91
91
|
},
|
|
92
92
|
buttonGroup: {
|
|
93
|
-
UNSAFE_className: (0, $3e38X$classNames)((0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs))),
|
|
94
|
-
|
|
93
|
+
UNSAFE_className: (0, $3e38X$classNames)((0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs))), 'spectrum-Dialog-buttonGroup', {
|
|
94
|
+
'spectrum-Dialog-buttonGroup--noFooter': !hasFooter
|
|
95
95
|
}),
|
|
96
|
-
align:
|
|
96
|
+
align: 'end'
|
|
97
97
|
}
|
|
98
98
|
}), [
|
|
99
99
|
hasFooter,
|
|
@@ -103,20 +103,20 @@ function $99cd51dc4eb569f7$var$Dialog(props, ref) {
|
|
|
103
103
|
return /*#__PURE__*/ (0, $3e38X$react).createElement("section", {
|
|
104
104
|
...styleProps,
|
|
105
105
|
...dialogProps,
|
|
106
|
-
className: (0, $3e38X$classNames)((0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs))),
|
|
106
|
+
className: (0, $3e38X$classNames)((0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs))), 'spectrum-Dialog', {
|
|
107
107
|
[`spectrum-Dialog--${sizeVariant}`]: sizeVariant,
|
|
108
|
-
|
|
108
|
+
'spectrum-Dialog--dismissable': isDismissable
|
|
109
109
|
}, styleProps.className),
|
|
110
110
|
ref: domRef
|
|
111
111
|
}, /*#__PURE__*/ (0, $3e38X$react).createElement((0, $3e38X$Grid), {
|
|
112
112
|
ref: gridRef,
|
|
113
|
-
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))[
|
|
113
|
+
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))['spectrum-Dialog-grid']
|
|
114
114
|
}, /*#__PURE__*/ (0, $3e38X$react).createElement((0, $3e38X$SlotProvider), {
|
|
115
115
|
slots: slots
|
|
116
116
|
}, children), isDismissable && /*#__PURE__*/ (0, $3e38X$react).createElement((0, $3e38X$ActionButton), {
|
|
117
|
-
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))[
|
|
117
|
+
UNSAFE_className: (0, ($parcel$interopDefault($3e38X$dialog_vars_cssmodulejs)))['spectrum-Dialog-closeButton'],
|
|
118
118
|
isQuiet: true,
|
|
119
|
-
"aria-label": stringFormatter.format(
|
|
119
|
+
"aria-label": stringFormatter.format('dismiss'),
|
|
120
120
|
onPress: onDismiss
|
|
121
121
|
}, /*#__PURE__*/ (0, $3e38X$react).createElement((0, $3e38X$spectrumiconsuiCrossLarge), null))));
|
|
122
122
|
}
|
|
@@ -28,9 +28,9 @@ $parcel$export(module.exports, "DialogContainer", () => $1b7050825e0eb5b6$export
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
function $1b7050825e0eb5b6$export$547754aada6e339f(props) {
|
|
31
|
-
let { children: children, type: type =
|
|
31
|
+
let { children: children, type: type = 'modal', onDismiss: onDismiss, isDismissable: isDismissable, isKeyboardDismissDisabled: isKeyboardDismissDisabled } = props;
|
|
32
32
|
let childArray = (0, ($parcel$interopDefault($k1djg$react))).Children.toArray(children);
|
|
33
|
-
if (childArray.length > 1) throw new Error(
|
|
33
|
+
if (childArray.length > 1) throw new Error('Only a single child can be passed to DialogContainer.');
|
|
34
34
|
let [lastChild, setLastChild] = (0, $k1djg$react.useState)(null);
|
|
35
35
|
// React.Children.toArray mutates the children, and we need them to be stable
|
|
36
36
|
// between renders so that the lastChild comparison works.
|
package/dist/DialogContainer.mjs
CHANGED
|
@@ -18,9 +18,9 @@ import {useOverlayTriggerState as $2W2Rs$useOverlayTriggerState} from "@react-st
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
function $2a9f0ad39ddaa8d9$export$547754aada6e339f(props) {
|
|
21
|
-
let { children: children, type: type =
|
|
21
|
+
let { children: children, type: type = 'modal', onDismiss: onDismiss, isDismissable: isDismissable, isKeyboardDismissDisabled: isKeyboardDismissDisabled } = props;
|
|
22
22
|
let childArray = (0, $2W2Rs$react).Children.toArray(children);
|
|
23
|
-
if (childArray.length > 1) throw new Error(
|
|
23
|
+
if (childArray.length > 1) throw new Error('Only a single child can be passed to DialogContainer.');
|
|
24
24
|
let [lastChild, setLastChild] = (0, $2W2Rs$useState)(null);
|
|
25
25
|
// React.Children.toArray mutates the children, and we need them to be stable
|
|
26
26
|
// between renders so that the lastChild comparison works.
|
|
@@ -51,4 +51,4 @@ function $2a9f0ad39ddaa8d9$export$547754aada6e339f(props) {
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
export {$2a9f0ad39ddaa8d9$export$547754aada6e339f as DialogContainer};
|
|
54
|
-
//# sourceMappingURL=DialogContainer.
|
|
54
|
+
//# sourceMappingURL=DialogContainer.module.js.map
|
|
@@ -18,9 +18,9 @@ import {useOverlayTriggerState as $2W2Rs$useOverlayTriggerState} from "@react-st
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
function $2a9f0ad39ddaa8d9$export$547754aada6e339f(props) {
|
|
21
|
-
let { children: children, type: type =
|
|
21
|
+
let { children: children, type: type = 'modal', onDismiss: onDismiss, isDismissable: isDismissable, isKeyboardDismissDisabled: isKeyboardDismissDisabled } = props;
|
|
22
22
|
let childArray = (0, $2W2Rs$react).Children.toArray(children);
|
|
23
|
-
if (childArray.length > 1) throw new Error(
|
|
23
|
+
if (childArray.length > 1) throw new Error('Only a single child can be passed to DialogContainer.');
|
|
24
24
|
let [lastChild, setLastChild] = (0, $2W2Rs$useState)(null);
|
|
25
25
|
// React.Children.toArray mutates the children, and we need them to be stable
|
|
26
26
|
// between renders so that the lastChild comparison works.
|