Skip to content

Commit

Permalink
fix(modal): update styles for button skeleton in modal footer
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonjoseph committed Oct 29, 2024
1 parent 6dc14bd commit 3f1c362
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Select from '../Select';
import SelectItem from '../SelectItem';
import TextInput from '../TextInput';
import Button from '../Button';
import ButtonSkeleton from '../Button/Button.Skeleton';
import {
StructuredListWrapper,
StructuredListHead,
Expand Down Expand Up @@ -43,6 +44,30 @@ export default {
},
};

export const Test = () => {
const [open, setOpen] = useState(true);
return (
<>
<Button onClick={() => setOpen(true)}>Launch composed modal</Button>

<ComposedModal
open={open}
onClose={() => setOpen(false)}
modalHeading="Testing Modal"
modalLabel="Test">
<ModalHeader>This modal is loading</ModalHeader>
<ModalBody>
<p>Loading...</p>
</ModalBody>
<ModalFooter>
<Button kind="secondary">Cancel</Button>
<ButtonSkeleton />
</ModalFooter>
</ComposedModal>
</>
);
};

export const Default = () => {
const [open, setOpen] = useState(true);
return (
Expand Down
15 changes: 7 additions & 8 deletions packages/styles/scss/components/modal/_modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,13 @@
inset-block-start: 0;
inset-inline-start: 0;
opacity: 0;
transition:
opacity $duration-moderate-02 motion(exit, expressive),
transition: opacity $duration-moderate-02 motion(exit, expressive),
visibility 0ms linear $duration-moderate-02;
visibility: hidden;

&.is-visible {
opacity: 1;
transition:
opacity $duration-moderate-02 motion(entrance, expressive),
transition: opacity $duration-moderate-02 motion(entrance, expressive),
visibility 0ms linear;
visibility: inherit;

Expand Down Expand Up @@ -297,6 +295,9 @@
margin: 0;
block-size: convert.to-rem(64px);
max-inline-size: none;
}

.#{$prefix}--modal-footer .#{$prefix}--btn:not(.#{$prefix}--skeleton) {
padding-block: calc($spacing-05 - convert.to-rem(2px)) $spacing-07;
}

Expand Down Expand Up @@ -372,17 +373,15 @@

border: 1px solid transparent;
background-color: $layer;
box-shadow:
inset 0 -80px 70px -65px $ai-inner-shadow,
box-shadow: inset 0 -80px 70px -65px $ai-inner-shadow,
0 24px 40px -24px $ai-drop-shadow;
}

.#{$prefix}--modal--slug
.#{$prefix}--modal-container:has(.#{$prefix}--modal-footer) {
@include ai-popover-gradient('default', 64px, 'layer');

box-shadow:
inset 0 -80px 0 -16px $layer,
box-shadow: inset 0 -80px 0 -16px $layer,
inset 0 -160px 70px -65px $ai-inner-shadow,
0 24px 40px -24px $ai-drop-shadow;
}
Expand Down

0 comments on commit 3f1c362

Please sign in to comment.