@moda/om 21.6.4 → 21.6.5
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/index.cjs.js +9 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +10 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/src/components/Modal/Modal.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/Dialog/Dialog.tsx +26 -14
- package/src/components/Modal/Modal.stories.tsx +4 -1
- package/src/components/Modal/Modal.tsx +4 -2
package/dist/index.cjs.js
CHANGED
|
@@ -7663,10 +7663,13 @@ var Modal = function Modal(_ref) {
|
|
|
7663
7663
|
children = _ref.children,
|
|
7664
7664
|
onClose = _ref.onClose,
|
|
7665
7665
|
shards = _ref.shards,
|
|
7666
|
-
autoFocus = _ref.autoFocus,
|
|
7666
|
+
_ref$autoFocus = _ref.autoFocus,
|
|
7667
|
+
autoFocus = _ref$autoFocus === void 0 ? true : _ref$autoFocus,
|
|
7667
7668
|
rest = _objectWithoutProperties(_ref, _excluded$u);
|
|
7668
7669
|
return /*#__PURE__*/React.createElement("div", _extends$1({
|
|
7669
|
-
className: classNames('Modal', className)
|
|
7670
|
+
className: classNames('Modal', className),
|
|
7671
|
+
role: "dialog",
|
|
7672
|
+
"aria-modal": "true"
|
|
7670
7673
|
}, rest), /*#__PURE__*/React.createElement(FocusOn, {
|
|
7671
7674
|
autoFocus: autoFocus,
|
|
7672
7675
|
shards: shards,
|
|
@@ -7794,12 +7797,15 @@ var Dialog = function Dialog(_ref) {
|
|
|
7794
7797
|
actions = _ref.actions,
|
|
7795
7798
|
contentClassName = _ref.contentClassName,
|
|
7796
7799
|
rest = _objectWithoutProperties(_ref, _excluded$p);
|
|
7800
|
+
var titleId = React.useId();
|
|
7797
7801
|
return /*#__PURE__*/React.createElement(ModalOverlay, _extends$1({
|
|
7798
|
-
contentClassName: classNames('Dialog', contentClassName)
|
|
7802
|
+
contentClassName: classNames('Dialog', contentClassName),
|
|
7803
|
+
"aria-labelledby": title ? titleId : undefined
|
|
7799
7804
|
}, rest), /*#__PURE__*/React.createElement(Stack, {
|
|
7800
7805
|
className: "Dialog__content",
|
|
7801
7806
|
space: 6
|
|
7802
7807
|
}, title && /*#__PURE__*/React.createElement(Text, {
|
|
7808
|
+
id: titleId,
|
|
7803
7809
|
treatment: "h5"
|
|
7804
7810
|
}, title), message && /*#__PURE__*/React.createElement(Text, null, message), actions && /*#__PURE__*/React.createElement(Stack, {
|
|
7805
7811
|
direction: "horizontal",
|