@hexure/ui 1.9.0 → 1.9.2

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.
@@ -16,8 +16,10 @@ export interface ModalProps extends AccessibleProps {
16
16
  secondaryButton?: ButtonProps;
17
17
  /** Defines a button to be displayed on the far left of the bottom button bar */
18
18
  tertiaryButton?: ButtonProps;
19
- /** Overrides the default max width of the modal (90vw) */
19
+ /** Overrides the default max width of the modal (900px) */
20
20
  maxWidth?: string;
21
+ /** Ignore all width/height configuration and display the modal over the entire window with a 40px padding around the edges */
22
+ fullscreen?: boolean;
21
23
  /** It is used to pass child nodes, string values and number as child components. */
22
24
  children: ReactNode;
23
25
  /** It is used to give title. */
package/dist/esm/index.js CHANGED
@@ -3098,7 +3098,7 @@ const Wrapper$b = styled.div `
3098
3098
  const StyledIcon$4 = styled(Icon) `
3099
3099
  width: 16px;
3100
3100
  height: 16px;
3101
- padding: 0px 6px;
3101
+ margin: 0px 6px;
3102
3102
  color: ${props => props.theme.PRIMARY_COLOR.Hex};
3103
3103
  cursor: pointer;
3104
3104
  `;
@@ -3785,8 +3785,10 @@ const Wrapper$7 = styled.div `
3785
3785
  justify-content: center;
3786
3786
  `;
3787
3787
  const Container$1 = styled.dialog `
3788
- max-width: ${props => props.$maxWidth || '90vw'};
3789
- width: auto;
3788
+ width: ${props => (props.$fullscreen ? 'calc(100vw - 80px)' : props.$maxWidth || '900px')};
3789
+ max-width: calc(100vw - 80px);
3790
+ height: ${props => (props.$fullscreen ? 'calc(100vh - 80px)' : 'auto')};
3791
+ max-height: calc(100vh - 80px);
3790
3792
  border-radius: 8px;
3791
3793
  overflow: hidden;
3792
3794
  box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.2);
@@ -3795,10 +3797,11 @@ const Container$1 = styled.dialog `
3795
3797
  position: relative;
3796
3798
  padding: 0px;
3797
3799
  box-sizing: border-box;
3800
+ display: flex;
3801
+ flex-direction: column;
3798
3802
  `;
3799
3803
  const Header$1 = styled.div `
3800
- position: sticky;
3801
- top: 0;
3804
+ flex-shrink: 0;
3802
3805
  padding: 20px;
3803
3806
  border-bottom: 1px solid #e7e6e6;
3804
3807
  display: flex;
@@ -3824,12 +3827,11 @@ const ContentWrapper = styled.div `
3824
3827
  overflow-x: hidden;
3825
3828
  overflow-y: auto;
3826
3829
  background: #ffffff;
3827
- max-height: calc(100vh - 260px);
3830
+ flex: 1;
3828
3831
  box-sizing: border-box;
3829
3832
  `;
3830
3833
  const ButtonBar = styled.div `
3831
- position: sticky;
3832
- bottom: 0;
3834
+ flex-shrink: 0;
3833
3835
  background: #ffffff;
3834
3836
  padding: 20px;
3835
3837
  border-top: 1px solid #e7e6e6;
@@ -3839,7 +3841,7 @@ const ButtonBar = styled.div `
3839
3841
  box-sizing: border-box;
3840
3842
  `;
3841
3843
  const Modal = (_a) => {
3842
- var { children, title, onClose, maxWidth, steps, primaryButton, secondaryButton, tertiaryButton } = _a, accessibleProps = __rest(_a, ["children", "title", "onClose", "maxWidth", "steps", "primaryButton", "secondaryButton", "tertiaryButton"]);
3844
+ var { children, title, onClose, maxWidth, fullscreen, steps, primaryButton, secondaryButton, tertiaryButton } = _a, accessibleProps = __rest(_a, ["children", "title", "onClose", "maxWidth", "fullscreen", "steps", "primaryButton", "secondaryButton", "tertiaryButton"]);
3843
3845
  useEffect(() => {
3844
3846
  document.onkeydown = e => {
3845
3847
  if (e.key === 'Escape') {
@@ -3851,7 +3853,7 @@ const Modal = (_a) => {
3851
3853
  };
3852
3854
  }, []);
3853
3855
  return (React.createElement(Wrapper$7, null,
3854
- React.createElement(Container$1, Object.assign({ "$maxWidth": maxWidth, open: true }, accessibleProps),
3856
+ React.createElement(Container$1, Object.assign({ "$fullscreen": fullscreen, "$maxWidth": maxWidth, open: true }, accessibleProps),
3855
3857
  React.createElement(Header$1, null,
3856
3858
  title ? React.createElement(Heading, { type: 'secondary' }, title) : null,
3857
3859
  React.createElement(Close, { onClick: onClose },