Skip to content

Commit

Permalink
feat: Add xsmall size to the 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 74d44b8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Reactist follows [semantic versioning](https://semver.org/) and doesn't introduce breaking changes (API-wise) in minor or patch releases. However, the appearance of a component might change in a minor or patch release so keep an eye on redesigns and make sure your app still looks and feels like you expect it.

# Next

- [Feat] Add `xsmall` size to the `Modal` component

# v25.0.0

- [BREAKING] Upgrade Ariakit from legacy package to the newer @ariakit/react
Expand Down
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 74d44b8

Please sign in to comment.