This repository has been archived by the owner on Dec 5, 2023. It is now read-only.
forked from danskernesdigitalebibliotek/dpl-design-system
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce button-box replacing modal-loan__buttons
Since we need the expression in different places besides modals we can generalise it
- Loading branch information
Showing
6 changed files
with
103 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import StickyFooterBoxMobileOnly from "./StickyButtonBoxMobileOnly"; | ||
|
||
export default { | ||
title: "Library / Button Box", | ||
}; | ||
|
||
export const StickyAtBottomMobileOnly = () => ( | ||
<div> | ||
<h2> | ||
Select mobile view and a sticky box should be shown in the bottom of the | ||
viewport... | ||
</h2> | ||
<hr /> | ||
<ul> | ||
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li> | ||
<li>Aliquam tincidunt mauris eu risus.</li> | ||
<li>Vestibulum auctor dapibus neque.</li> | ||
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li> | ||
<li>Aliquam tincidunt mauris eu risus.</li> | ||
<li>Vestibulum auctor dapibus neque.</li> | ||
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li> | ||
<li>Aliquam tincidunt mauris eu risus.</li> | ||
<li>Vestibulum auctor dapibus neque.</li> | ||
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li> | ||
<li>Aliquam tincidunt mauris eu risus.</li> | ||
<li>Vestibulum auctor dapibus neque.</li> | ||
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li> | ||
<li>Aliquam tincidunt mauris eu risus.</li> | ||
<li>Vestibulum auctor dapibus neque.</li> | ||
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li> | ||
<li>Aliquam tincidunt mauris eu risus.</li> | ||
<li>Vestibulum auctor dapibus neque.</li> | ||
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li> | ||
<li>Aliquam tincidunt mauris eu risus.</li> | ||
<li>Vestibulum auctor dapibus neque.</li> | ||
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li> | ||
<li>Aliquam tincidunt mauris eu risus.</li> | ||
<li>Vestibulum auctor dapibus neque.</li> | ||
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li> | ||
<li>Aliquam tincidunt mauris eu risus.</li> | ||
<li>Vestibulum auctor dapibus neque.</li> | ||
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li> | ||
<li>Aliquam tincidunt mauris eu risus.</li> | ||
<li>Vestibulum auctor dapibus neque.</li> | ||
<StickyFooterBoxMobileOnly label="John" /> | ||
</ul> | ||
</div> | ||
); |
23 changes: 23 additions & 0 deletions
23
src/stories/Library/button-box/StickyButtonBoxMobileOnly.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { FC } from "react"; | ||
|
||
export interface StickyButtonBoxMobileOnlyProps { | ||
label: string; | ||
} | ||
|
||
const StickyButtonBoxMobileOnly: FC<StickyButtonBoxMobileOnlyProps> = ({ | ||
label, | ||
}) => { | ||
return ( | ||
<div className="hide-on-desktop button-box button-box--sticky-bottom"> | ||
<button | ||
data-cy="button" | ||
type="button" | ||
className="btn-primary btn-filled btn-small arrow__hover--right-small " | ||
> | ||
{label} | ||
</button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default StickyButtonBoxMobileOnly; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.button-box { | ||
background-color: $c-global-primary; | ||
display: flex; | ||
justify-content: flex-end; | ||
margin-top: 40px; | ||
flex-direction: column; | ||
margin-bottom: 10px; | ||
|
||
@include breakpoint-s { | ||
align-items: center; | ||
flex-direction: row; | ||
} | ||
} | ||
|
||
.button-box--sticky-bottom { | ||
position: fixed; | ||
right: 0; | ||
bottom: 0; | ||
left: 0; | ||
padding: $s-md; | ||
margin-bottom: 0px; | ||
z-index: $z-20; | ||
|
||
@include breakpoint-s { | ||
padding: $s-lg $s-7xl $s-lg 0; | ||
bottom: 100px; | ||
right: 100px; | ||
left: 100px; | ||
} | ||
} |