Skip to content

Commit

Permalink
Merge pull request #100 from perimetre/9.3.2
Browse files Browse the repository at this point in the history
9.3.2
  • Loading branch information
adarleyjrr authored Apr 6, 2023
2 parents 2f5967e + 12d9241 commit 025bf61
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 10 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

## [9.3.2] 2023-04-06

### Changes

- Changed modal `new` variant to use UI as updated designs

### Fixed

- Cleaned up modal classes logic

## [9.3.1] 2023-03-14

### Changes
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@perimetre/ui",
"description": "A component library made by @perimetre",
"version": "9.3.1",
"version": "9.3.2",
"repository": {
"type": "git",
"url": "git+https://github.com/perimetre/ui.git"
Expand Down
8 changes: 7 additions & 1 deletion src/components/Modal/Modal.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ export default {
type: 'boolean'
}
},
variant: { defaultValue: 'Default' },
variant: {
defaultValue: 'default',
control: {
type: 'select',
options: ['default', 'new']
}
},
content: {
defaultValue: 'A modal content',
control: {
Expand Down
9 changes: 7 additions & 2 deletions src/components/Modal/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
/* Apply display */
@apply flex;
}

/* Define a light background that matches with new design for qadense */
&.new {
@apply bg-white bg-opacity-90;
}
}

/* The container inside the background, the modal "card" itself */
Expand All @@ -43,9 +48,9 @@
/* Adds the default border radius */
/* Animate the fadeUp effect */
@apply relative shadow-xl my-0 mx-auto md:mt-14 bg-white max-w-full min-w-screen-90 md:min-w-initial pui-border-radius pui-animate-fadeUp;
/* Define a border radius that matches with new design */
/* Define square border radius that matches with new design for qadense */
&.new {
border-radius: 20px 20px 20px 20px;
@apply rounded-none shadow-2xl;
}
/* Centers modal container */
&.center {
Expand Down
6 changes: 2 additions & 4 deletions src/components/Modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,8 @@ export const Modal: React.FC<PropsWithChildren<ModalProps>> = ({

return (
<ReactPortal selector="#modal-root">
<div className={classnames('pui-modal', { open: isOpen })}>
<div
className={classnames('pui-modal-container', { new: variant === 'new' }, { center: position === 'center' })}
>
<div className={classnames('pui-modal', { open: isOpen, new: variant === 'new' })}>
<div className={classnames('pui-modal-container', { new: variant === 'new', center: position === 'center' })}>
<div className={classnames('pui-modal-header ', { 'absolute z-30': isHeaderAbsolute })}>
<h3 className={classnames(removePadding ? 'p-0' : 'p-4')}>{title}</h3>
{/* Adds a close icon */}
Expand Down

0 comments on commit 025bf61

Please sign in to comment.