generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add dialog component * Update card styling in card panels * Update DID modal * update credential modal * update issuance modal * Add readonly styling to textarea * Update radio styling
- Loading branch information
1 parent
08f70a1
commit 3060be4
Showing
12 changed files
with
377 additions
and
279 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,210 @@ | ||
.dialog-component { | ||
|
||
.dialog { | ||
background: var(--grey-5); | ||
border: 1px solid var(--grey-10); | ||
color: var(--color-white); | ||
box-shadow: 0 10px 20px var(--color-black); | ||
max-width: 100%; | ||
height: calc(100% - 2rem); | ||
margin-block: auto; | ||
padding: 0; | ||
border-radius: var(--radius-sm); | ||
overflow: hidden; | ||
width: max-content; | ||
|
||
&::backdrop { | ||
background: rgba(6,6,6,0.9); | ||
} | ||
|
||
&-header { | ||
background: var(--grey-5); | ||
border-bottom: 1px solid var(--grey-10); | ||
padding: 1rem; | ||
position: sticky; | ||
top: 0; | ||
z-index: 1; | ||
margin-block-end: 1rem; | ||
|
||
button { | ||
.icon-container > svg { | ||
width: 24px; | ||
} | ||
} | ||
} | ||
|
||
&-heading { | ||
|
||
h2 { | ||
font-size: 1.5rem; | ||
padding-inline-end: 35%; | ||
letter-spacing: 1px; | ||
} | ||
|
||
p { | ||
font-size: 1rem; | ||
padding-inline-end: 12.5%; | ||
margin-bottom: 2rem; | ||
border-bottom: 1px solid var(--grey-15); | ||
letter-spacing: 0.5px; | ||
padding-bottom: 1rem; | ||
line-height: 1.75; | ||
} | ||
|
||
} | ||
|
||
details { | ||
background: var(--grey-15); | ||
border-radius: var(--radius-sm); | ||
|
||
summary { | ||
padding: 1rem; | ||
display: flex; | ||
justify-content: space-between; | ||
|
||
&:hover { | ||
cursor: pointer; | ||
} | ||
|
||
.icon-container { | ||
transition: 0.15s ease transform; | ||
} | ||
} | ||
|
||
&[open] summary .icon-container { | ||
transform: rotate(-180deg); | ||
} | ||
|
||
.field-container { | ||
border-top: 1px solid var(--grey-20); | ||
border-radius: 0; | ||
margin: 0; | ||
|
||
a { | ||
margin-top: 0.5rem; | ||
font-size: var(--font-xs); | ||
} | ||
} | ||
|
||
textarea::placeholder { | ||
font-style: italic; | ||
} | ||
} | ||
|
||
.field-container { | ||
background: var(--grey-15); | ||
padding: 1rem; | ||
margin-block: 1rem; | ||
border-radius: var(--radius-sm); | ||
} | ||
|
||
&-body { | ||
display: flex; | ||
flex-wrap: wrap; | ||
position: relative; | ||
justify-content: center; | ||
min-height: calc(100% - 4rem); | ||
padding: 2rem; | ||
overflow: scroll; | ||
max-height: 100%; | ||
|
||
.modal-input-note { | ||
font-size: var(--font-xs); | ||
margin-block: 0.125rem 0.25rem; | ||
} | ||
|
||
.dialog-art { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
flex: auto; | ||
margin-inline: 1rem; | ||
height: 580px; | ||
position: sticky; | ||
top: 0; | ||
display: none; | ||
|
||
.dialog-background { | ||
position: absolute; | ||
left: 0; | ||
top: 0; | ||
width: 100%; | ||
height: 100%; | ||
background: linear-gradient(to bottom, #161616, #000000); | ||
border-radius: var(--radius-md); | ||
filter: blur(20px); | ||
z-index: -1; | ||
} | ||
|
||
} | ||
|
||
form { | ||
margin-inline: 2rem; | ||
background: var(--grey-10); | ||
padding: 2rem; | ||
border-radius: var(--radius-sm); | ||
width: 100%; | ||
max-width: 680px; | ||
margin-block-end: 4rem; | ||
|
||
.banner { | ||
padding: 1rem; | ||
margin-block-end: 1rem; | ||
display: flex; | ||
gap: 8px; | ||
|
||
&-danger { | ||
border: 1px solid var(--color-red); | ||
background: var(--red-20); | ||
|
||
.icon-container { | ||
color: var(--color-red); | ||
} | ||
} | ||
|
||
&-success { | ||
border: 1px solid var(--color-green); | ||
background: var(--green-20); | ||
|
||
.icon-container { | ||
color: var(--color-green); | ||
} | ||
} | ||
|
||
&-warn { | ||
border: 1px solid var(--color-orange); | ||
background: var(--orange-20); | ||
|
||
.icon-container { | ||
color: var(--color-orange); | ||
} | ||
} | ||
} | ||
|
||
.button-row { | ||
margin-block: 2rem 1rem; | ||
justify-content: flex-end; | ||
} | ||
} | ||
} | ||
} | ||
|
||
@media screen and (max-width: 997px) { | ||
.dialog { | ||
height: 100%; | ||
max-height: 100%; | ||
margin: 0; | ||
} | ||
|
||
.dialog-body { | ||
padding: 0; | ||
|
||
form { | ||
margin-inline: 0; | ||
background: var(--grey-5); | ||
padding-block-start: 0; | ||
margin-block-start: 0; | ||
} | ||
} | ||
} | ||
} |
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,46 @@ | ||
import Icon, { XCross } from "@/icons/Icon"; | ||
import { Component, createEffect } from "solid-js"; | ||
import "./Dialog.scss"; | ||
|
||
const Dialog: Component<{content, afterCloseModal, handleSubmit, children}> = (props) => { | ||
let dialog; | ||
|
||
const showModal = () => { | ||
dialog.showModal(); | ||
document.body.classList.add('no-scroll'); | ||
dialog.addEventListener('close', () => { | ||
document.body.classList.remove('no-scroll'); | ||
props.afterCloseModal(); | ||
}); | ||
} | ||
|
||
const closeModal = () => { | ||
return dialog.close(); | ||
} | ||
|
||
return ( | ||
<div class="dialog-component"> | ||
<button class={props.content.button.className} disabled={props.content.button.disabled} onclick={showModal}> | ||
{props.content.button.label} | ||
</button> | ||
<dialog class="dialog" ref={dialog}> | ||
<div class="dialog-header"> | ||
<button title="Close dialog" onClick={closeModal}> | ||
<Icon svg={XCross} /> | ||
</button> | ||
</div> | ||
<div class="dialog-body"> | ||
<form onSubmit={props.handleSubmit}> | ||
<div class="dialog-heading"> | ||
<h2>{props.content.heading.h2}</h2> | ||
{props.content.heading.p && <p>{props.content.heading.p}</p>} | ||
</div> | ||
{props.children} | ||
</form> | ||
</div> | ||
</dialog> | ||
</div> | ||
) | ||
} | ||
|
||
export default Dialog; |
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
Oops, something went wrong.