@moda/om 21.6.4 → 21.6.6
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 +10 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +11 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/src/components/Modal/Modal.d.ts +2 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/Checkbox/Checkbox.scss +5 -0
- package/src/components/Checkbox/Checkbox.tsx +1 -3
- 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
|
|
|
@@ -7508,19 +7508,17 @@ var Checkbox = function Checkbox(_ref) {
|
|
|
7508
7508
|
}, [onChange, checked]);
|
|
7509
7509
|
return /*#__PURE__*/React__default.createElement("label", {
|
|
7510
7510
|
htmlFor: id,
|
|
7511
|
-
tabIndex: 0,
|
|
7512
7511
|
className: classNames('Checkbox', className, {
|
|
7513
7512
|
'Checkbox--disabled': disabled
|
|
7514
7513
|
}),
|
|
7515
7514
|
"data-test-id": dataTestId && "".concat(dataTestId, "--label")
|
|
7516
7515
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
7517
|
-
|
|
7516
|
+
"aria-hidden": "true",
|
|
7518
7517
|
className: classNames('Checkbox__indicator', {
|
|
7519
7518
|
'Checkbox__indicator--disabled': disabled
|
|
7520
7519
|
})
|
|
7521
7520
|
}, isChecked && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, checkIcon === 'checkmark' && /*#__PURE__*/React__default.createElement(Checkmark16, CHECKED_ITEM_PROPS), checkIcon === 'circle' && /*#__PURE__*/React__default.createElement(Circle12, CHECKED_ITEM_PROPS))), /*#__PURE__*/React__default.createElement("input", _extends$1({
|
|
7522
7521
|
id: id,
|
|
7523
|
-
tabIndex: -1,
|
|
7524
7522
|
className: "Checkbox__input",
|
|
7525
7523
|
type: "checkbox",
|
|
7526
7524
|
checked: isChecked,
|
|
@@ -7643,10 +7641,13 @@ var Modal = function Modal(_ref) {
|
|
|
7643
7641
|
children = _ref.children,
|
|
7644
7642
|
onClose = _ref.onClose,
|
|
7645
7643
|
shards = _ref.shards,
|
|
7646
|
-
autoFocus = _ref.autoFocus,
|
|
7644
|
+
_ref$autoFocus = _ref.autoFocus,
|
|
7645
|
+
autoFocus = _ref$autoFocus === void 0 ? true : _ref$autoFocus,
|
|
7647
7646
|
rest = _objectWithoutProperties(_ref, _excluded$u);
|
|
7648
7647
|
return /*#__PURE__*/React__default.createElement("div", _extends$1({
|
|
7649
|
-
className: classNames('Modal', className)
|
|
7648
|
+
className: classNames('Modal', className),
|
|
7649
|
+
role: "dialog",
|
|
7650
|
+
"aria-modal": "true"
|
|
7650
7651
|
}, rest), /*#__PURE__*/React__default.createElement(FocusOn, {
|
|
7651
7652
|
autoFocus: autoFocus,
|
|
7652
7653
|
shards: shards,
|
|
@@ -7774,12 +7775,15 @@ var Dialog = function Dialog(_ref) {
|
|
|
7774
7775
|
actions = _ref.actions,
|
|
7775
7776
|
contentClassName = _ref.contentClassName,
|
|
7776
7777
|
rest = _objectWithoutProperties(_ref, _excluded$p);
|
|
7778
|
+
var titleId = useId();
|
|
7777
7779
|
return /*#__PURE__*/React__default.createElement(ModalOverlay, _extends$1({
|
|
7778
|
-
contentClassName: classNames('Dialog', contentClassName)
|
|
7780
|
+
contentClassName: classNames('Dialog', contentClassName),
|
|
7781
|
+
"aria-labelledby": title ? titleId : undefined
|
|
7779
7782
|
}, rest), /*#__PURE__*/React__default.createElement(Stack, {
|
|
7780
7783
|
className: "Dialog__content",
|
|
7781
7784
|
space: 6
|
|
7782
7785
|
}, title && /*#__PURE__*/React__default.createElement(Text, {
|
|
7786
|
+
id: titleId,
|
|
7783
7787
|
treatment: "h5"
|
|
7784
7788
|
}, title), message && /*#__PURE__*/React__default.createElement(Text, null, message), actions && /*#__PURE__*/React__default.createElement(Stack, {
|
|
7785
7789
|
direction: "horizontal",
|