-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8882 from RocketChat/rc-modal
[NEW] New Modal component
- Loading branch information
Showing
11 changed files
with
259 additions
and
26 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
96 changes: 96 additions & 0 deletions
96
packages/rocketchat-theme/client/imports/components/modal.css
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,96 @@ | ||
.rc-modal { | ||
min-width: 400px; | ||
|
||
animation: dropdown-show 0.3s cubic-bezier(0.45, 0.05, 0.55, 0.95); | ||
|
||
background: white; | ||
|
||
box-shadow: 0 0 2px 0 rgba(47, 52, 61, 0.08), 0 0 12px 0 rgba(47, 52, 61, 0.12); | ||
|
||
&-wrapper { | ||
position: fixed; | ||
z-index: 10; | ||
top: 0; | ||
right: 0; | ||
bottom: 0; | ||
left: 0; | ||
|
||
display: flex; | ||
|
||
padding: 10px; | ||
|
||
background: rgba(47, 52, 61, 0.8); | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
&__title { | ||
flex: 1 1 auto; | ||
|
||
font-size: 16px; | ||
} | ||
|
||
&__close { | ||
cursor: pointer; | ||
transform: rotate(45deg); | ||
|
||
font-size: 20px; | ||
|
||
&:hover { | ||
color: var(--color-link-active); | ||
} | ||
} | ||
|
||
&__header { | ||
display: flex; | ||
flex-direction: row; | ||
|
||
margin-bottom: -16px; | ||
padding: 16px; | ||
|
||
font-size: 21px; | ||
justify-content: flex-end; | ||
} | ||
|
||
&__content { | ||
display: flex; | ||
|
||
flex-direction: column; | ||
|
||
padding: 16px; | ||
|
||
animation: dropdown-show 0.1s cubic-bezier(0.45, 0.05, 0.55, 0.95); | ||
|
||
white-space: nowrap; | ||
|
||
background-color: var(--modal-background); | ||
} | ||
|
||
&__footer { | ||
display: flex; | ||
|
||
padding: 16px; | ||
|
||
background: #f7f8fa; | ||
justify-content: space-between; | ||
|
||
& > .rc-button { | ||
margin: 0; | ||
} | ||
} | ||
} | ||
|
||
@media (width <= 400px) { | ||
.rc-modal { | ||
top: initial !important; | ||
bottom: 0; | ||
left: 0 !important; | ||
|
||
width: 100%; | ||
min-width: 100%; | ||
max-width: 100%; | ||
margin: 0 16px; | ||
|
||
animation: dropup-show 0.3s cubic-bezier(0.45, 0.05, 0.55, 0.95); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -104,8 +104,6 @@ | |
} | ||
|
||
.upload-preview { | ||
padding: 1rem; | ||
|
||
& .upload-preview-file { | ||
height: 200px; | ||
|
||
|
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,39 @@ | ||
<template name="rc_modal"> | ||
<div class="rc-modal-wrapper"> | ||
<div class="rc-modal rc-modal--{{modalClass}}" data-modal="modal"> | ||
|
||
|
||
{{# if template}} | ||
{{> Template.dynamic template=template data=data}} | ||
{{else}} | ||
<header class="rc-modal__header"> | ||
<h1 class="rc-modal__title">{{title}}</h1> | ||
<button class="contextual-bar__close js-close"> | ||
{{> icon classes="rc-modal__close" icon="plus"}} | ||
</button> | ||
</header> | ||
|
||
<main class="rc-modal__content"> | ||
{{# if content}} | ||
{{> Template.dynamic template=content data=data}} | ||
{{/if}} | ||
{{# if text}} | ||
{{# if html}} | ||
{{{text}}} | ||
{{else}} | ||
{{text}} | ||
{{/if}} | ||
{{/if}} | ||
</main> | ||
<div class="rc-modal__footer"> | ||
{{# if showCancelButton}} | ||
<input class="rc-button rc-button--nude js-close" type="submit" data-button="cancel" value="{{cancelButtonText}}"> | ||
{{/if}} | ||
<input style="background-color:{{confirmButtonColor}}" class="rc-button rc-button--primary js-confirm" type="submit" data-button="create" value="{{confirmButtonText}}"> | ||
|
||
</div> | ||
{{/if}} | ||
|
||
</div> | ||
</div> | ||
</template> |
Oops, something went wrong.