Skip to content

Commit

Permalink
feat: Add xsmall size to Modal component
Browse files Browse the repository at this point in the history
  • Loading branch information
rfgamaral committed Aug 28, 2024
1 parent 6cb179a commit 825f01e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/modal/modal-stories-components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ function ModalOptionsForm({ title }: { title?: React.ReactNode }) {
</SelectField>

<SelectField label="width" name="width" value={width} onChange={onChange}>
<option value="xsmall">xsmall</option>
<option value="small">small</option>
<option value="medium">medium</option>
<option value="large">large</option>
Expand Down
11 changes: 7 additions & 4 deletions src/modal/modal.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@
width: 580px;
}
.small .container {
width: 450px;
width: 480px;
}
.xsmall .container {
width: 448px;
}

@media (min-width: 992px) {
Expand All @@ -87,16 +90,16 @@
}

@media (max-width: 580px) {
.overlay:not(.small) .container {
.overlay:not(.xsmall):not(.small) .container {
width: 100% !important;
max-height: none;
}
.overlay.expand:not(.small) > [data-focus-lock-disabled] {
.overlay.expand:not(.xsmall):not(.small) > [data-focus-lock-disabled] {
padding-left: 0;
padding-right: 0;
padding-bottom: 0;
}
.overlay.expand:not(.small) .container {
.overlay.expand:not(.xsmall):not(.small) .container {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/modal/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { IconButtonProps, IconButton } from '../button'
import styles from './modal.module.css'
import type { ObfuscatedClassName } from '../utils/common-types'

type ModalWidth = 'small' | 'medium' | 'large' | 'xlarge' | 'full'
type ModalWidth = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'full'
type ModalHeightMode = 'expand' | 'fitContent'

//
Expand Down

0 comments on commit 825f01e

Please sign in to comment.