@motech-development/breeze-ui 2.0.34 → 2.1.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/lib/index.d.ts CHANGED
@@ -275,11 +275,13 @@ interface IMasonryProps {
275
275
  }
276
276
  declare const Masonry: FC<IMasonryProps>;
277
277
 
278
+ type TModalSize = 'sm' | 'lg';
278
279
  interface IModalProps {
279
280
  children: ReactNode;
280
281
  isOpen: boolean;
282
+ size?: TModalSize;
281
283
  title: string;
282
- onDismiss(): void;
284
+ onDismiss: () => void;
283
285
  }
284
286
  declare const Modal: FC<IModalProps>;
285
287
 
package/lib/index.esm.js CHANGED
@@ -1954,14 +1954,16 @@ const ModalContent = styled.div`
1954
1954
  pointer-events: auto;
1955
1955
  `;
1956
1956
  const ModalDialog = styled.div`
1957
- box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 5px 8px 0 rgba(0, 0, 0, 0.14),
1957
+ box-shadow:
1958
+ 0 3px 5px -1px rgba(0, 0, 0, 0.2),
1959
+ 0 5px 8px 0 rgba(0, 0, 0, 0.14),
1958
1960
  0 1px 14px 0 rgba(0, 0, 0, 0.12);
1959
1961
  margin: 5rem auto;
1960
- max-width: 500px;
1962
+ max-width: ${({ size })=>size === 'sm' ? '500px' : '90vw'};
1961
1963
  pointer-events: none;
1962
1964
  position: relative;
1963
1965
  `;
1964
- const Modal = ({ children, isOpen, onDismiss, title })=>{
1966
+ const Modal = ({ children, isOpen, onDismiss, size = 'sm', title })=>{
1965
1967
  const output = document.createElement('div');
1966
1968
  const doNotDismiss = (e)=>{
1967
1969
  e.stopPropagation();
@@ -1976,6 +1978,7 @@ const Modal = ({ children, isOpen, onDismiss, title })=>{
1976
1978
  tabIndex: -1,
1977
1979
  onClick: onDismiss,
1978
1980
  children: /*#__PURE__*/ jsx(ModalDialog, {
1981
+ size: size,
1979
1982
  role: "document",
1980
1983
  children: /*#__PURE__*/ jsx(ModalContent, {
1981
1984
  onClick: doNotDismiss,