-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c84dd6c
commit f4fc0c0
Showing
10 changed files
with
85 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<Button | ||
{{on "click" this.toggleModal}} | ||
> | ||
Open Modal | ||
</Button> | ||
|
||
<div class="relative h-48 w-3xl"> | ||
<Modal | ||
@isOpen={{this.isOpen}} | ||
@onClose={{this.toggleModal}} | ||
@renderInPlace={{false}} | ||
as |m| | ||
> | ||
<m.Header>Title</m.Header> | ||
<m.Body> | ||
<p>Some contents...</p> | ||
<p>Some contents...</p> | ||
<p>Some contents...</p> | ||
</m.Body> | ||
<m.Footer> | ||
<Button | ||
@appearance="minimal" | ||
class="mr-4" | ||
{{on "click" this.toggleModal}} | ||
> | ||
Cancel | ||
</Button> | ||
<Button | ||
@intent="primary" | ||
disabled={{this.isLoading}} | ||
{{on "click" this.save}} | ||
> | ||
{{if this.isLoading "Loading..." "Save"}} | ||
</Button> | ||
</m.Footer> | ||
</Modal> | ||
</div> |
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,28 @@ | ||
import Component from '@glimmer/component'; | ||
import { tracked } from '@glimmer/tracking'; | ||
import { action } from '@ember/object'; | ||
import { later } from '@ember/runloop'; | ||
|
||
interface DemoModalArgs {} | ||
|
||
export default class DemoModal extends Component<DemoModalArgs> { | ||
@tracked isOpen = false; | ||
@tracked isLoading = false; | ||
|
||
@action toggleModal(): void { | ||
this.isOpen = !this.isOpen; | ||
} | ||
|
||
@action save(): void { | ||
this.isLoading = true; | ||
|
||
later( | ||
this, | ||
() => { | ||
this.isLoading = false; | ||
this.isOpen = false; | ||
}, | ||
1000 | ||
); | ||
} | ||
} |
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,5 @@ | ||
# Overlays Installation | ||
|
||
```sh | ||
ember install @frontile/overlays | ||
``` |
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,3 @@ | ||
# Modal | ||
|
||
<Demo::Overlays::DemoModal /> |
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