@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.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, { useContext, useState, createContext, forwardRef, useRef, useCallback, useEffect, useMemo, Fragment, PureComponent, Children, isValidElement, cloneElement, useReducer } from 'react';
|
|
2
|
+
import React__default, { useContext, useState, createContext, forwardRef, useRef, useCallback, useEffect, useMemo, Fragment, PureComponent, Children, isValidElement, cloneElement, useId, useReducer } from 'react';
|
|
3
3
|
import { Link } from 'react-router-dom';
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
5
5
|
|
|
@@ -7643,10 +7643,13 @@ var Modal = function Modal(_ref) {
|
|
|
7643
7643
|
children = _ref.children,
|
|
7644
7644
|
onClose = _ref.onClose,
|
|
7645
7645
|
shards = _ref.shards,
|
|
7646
|
-
autoFocus = _ref.autoFocus,
|
|
7646
|
+
_ref$autoFocus = _ref.autoFocus,
|
|
7647
|
+
autoFocus = _ref$autoFocus === void 0 ? true : _ref$autoFocus,
|
|
7647
7648
|
rest = _objectWithoutProperties(_ref, _excluded$u);
|
|
7648
7649
|
return /*#__PURE__*/React__default.createElement("div", _extends$1({
|
|
7649
|
-
className: classNames('Modal', className)
|
|
7650
|
+
className: classNames('Modal', className),
|
|
7651
|
+
role: "dialog",
|
|
7652
|
+
"aria-modal": "true"
|
|
7650
7653
|
}, rest), /*#__PURE__*/React__default.createElement(FocusOn, {
|
|
7651
7654
|
autoFocus: autoFocus,
|
|
7652
7655
|
shards: shards,
|
|
@@ -7774,12 +7777,15 @@ var Dialog = function Dialog(_ref) {
|
|
|
7774
7777
|
actions = _ref.actions,
|
|
7775
7778
|
contentClassName = _ref.contentClassName,
|
|
7776
7779
|
rest = _objectWithoutProperties(_ref, _excluded$p);
|
|
7780
|
+
var titleId = useId();
|
|
7777
7781
|
return /*#__PURE__*/React__default.createElement(ModalOverlay, _extends$1({
|
|
7778
|
-
contentClassName: classNames('Dialog', contentClassName)
|
|
7782
|
+
contentClassName: classNames('Dialog', contentClassName),
|
|
7783
|
+
"aria-labelledby": title ? titleId : undefined
|
|
7779
7784
|
}, rest), /*#__PURE__*/React__default.createElement(Stack, {
|
|
7780
7785
|
className: "Dialog__content",
|
|
7781
7786
|
space: 6
|
|
7782
7787
|
}, title && /*#__PURE__*/React__default.createElement(Text, {
|
|
7788
|
+
id: titleId,
|
|
7783
7789
|
treatment: "h5"
|
|
7784
7790
|
}, title), message && /*#__PURE__*/React__default.createElement(Text, null, message), actions && /*#__PURE__*/React__default.createElement(Stack, {
|
|
7785
7791
|
direction: "horizontal",
|