@hyphen/hyphen-components 6.11.0 → 6.12.0
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/components/Modal/Modal.d.ts +9 -1
- package/dist/hyphen-components.cjs.development.js +6 -2
- package/dist/hyphen-components.cjs.development.js.map +1 -1
- package/dist/hyphen-components.cjs.production.min.js +1 -1
- package/dist/hyphen-components.cjs.production.min.js.map +1 -1
- package/dist/hyphen-components.esm.js +6 -2
- package/dist/hyphen-components.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Modal/Modal.tsx +13 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode, RefObject } from 'react';
|
|
2
|
-
import { CssOverflowValue } from '../../types';
|
|
2
|
+
import { BackgroundColor, CssOverflowValue } from '../../types';
|
|
3
3
|
import { BoxProps } from '../Box/Box';
|
|
4
4
|
import { ModalFooter, ModalHeader, ModalBody } from './components';
|
|
5
5
|
export interface ModalProps {
|
|
@@ -36,6 +36,10 @@ export interface ModalProps {
|
|
|
36
36
|
* At mobile viewport widths, the modal will take up the fullscreen
|
|
37
37
|
*/
|
|
38
38
|
fullScreenMobile?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Background color for the modal content using design tokens
|
|
41
|
+
*/
|
|
42
|
+
background?: BackgroundColor;
|
|
39
43
|
/**
|
|
40
44
|
* By default the first focusable element will receive focus when the dialog
|
|
41
45
|
* opens but you can provide a ref to focus instead.
|
|
@@ -60,6 +64,10 @@ export interface ModalProps {
|
|
|
60
64
|
* The css overflow behavior of the Modal
|
|
61
65
|
*/
|
|
62
66
|
overflow?: CssOverflowValue;
|
|
67
|
+
/**
|
|
68
|
+
* Inline styles for the modal container
|
|
69
|
+
*/
|
|
70
|
+
style?: React.CSSProperties;
|
|
63
71
|
/**
|
|
64
72
|
* Allows spread props
|
|
65
73
|
*/
|
|
@@ -3782,13 +3782,15 @@ var ModalBody = function ModalBody(_ref) {
|
|
|
3782
3782
|
|
|
3783
3783
|
var styles$a = {"modal-close":"Modal-module_modal-close__1YmMa","modal":"Modal-module_modal__yNG-7","modal-content":"Modal-module_modal-content__GMtBm"};
|
|
3784
3784
|
|
|
3785
|
-
var _excluded$5 = ["ariaLabel", "ariaLabelledBy", "allowPinchZoom", "children", "className", "containerRef", "fullScreenMobile", "initialFocusRef", "isOpen", "maxWidth", "onDismiss", "overflow"];
|
|
3785
|
+
var _excluded$5 = ["ariaLabel", "ariaLabelledBy", "allowPinchZoom", "background", "children", "className", "containerRef", "fullScreenMobile", "initialFocusRef", "isOpen", "maxWidth", "onDismiss", "overflow", "style"];
|
|
3786
3786
|
var ModalBaseComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
3787
3787
|
var _classNames;
|
|
3788
3788
|
var ariaLabel = _ref.ariaLabel,
|
|
3789
3789
|
ariaLabelledBy = _ref.ariaLabelledBy,
|
|
3790
3790
|
_ref$allowPinchZoom = _ref.allowPinchZoom,
|
|
3791
3791
|
allowPinchZoom = _ref$allowPinchZoom === void 0 ? false : _ref$allowPinchZoom,
|
|
3792
|
+
_ref$background = _ref.background,
|
|
3793
|
+
background = _ref$background === void 0 ? undefined : _ref$background,
|
|
3792
3794
|
children = _ref.children,
|
|
3793
3795
|
className = _ref.className,
|
|
3794
3796
|
_ref$containerRef = _ref.containerRef,
|
|
@@ -3802,6 +3804,7 @@ var ModalBaseComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3802
3804
|
onDismiss = _ref.onDismiss,
|
|
3803
3805
|
_ref$overflow = _ref.overflow,
|
|
3804
3806
|
overflow = _ref$overflow === void 0 ? 'hidden' : _ref$overflow,
|
|
3807
|
+
style = _ref.style,
|
|
3805
3808
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
3806
3809
|
var activateFocusLock = React.useCallback(function () {
|
|
3807
3810
|
setTimeout(function () {
|
|
@@ -3838,11 +3841,12 @@ var ModalBaseComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3838
3841
|
return parentElement;
|
|
3839
3842
|
} : undefined,
|
|
3840
3843
|
style: {
|
|
3841
|
-
content: _extends({}, maxWidthCss.styles)
|
|
3844
|
+
content: _extends({}, maxWidthCss.styles, style)
|
|
3842
3845
|
}
|
|
3843
3846
|
}, restProps), React.createElement(Box, {
|
|
3844
3847
|
"aria-label": ariaLabel,
|
|
3845
3848
|
"aria-labelledby": ariaLabelledBy,
|
|
3849
|
+
background: background,
|
|
3846
3850
|
height: "100",
|
|
3847
3851
|
padding: {
|
|
3848
3852
|
base: '2xl',
|