-
Notifications
You must be signed in to change notification settings - Fork 21
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 #107 from josemarluedke/feat/overlay-close-button
Migrate Modal & Drawer to use CloseButton component from core
- Loading branch information
Showing
14 changed files
with
154 additions
and
117 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 |
---|---|---|
@@ -1,17 +1,28 @@ | ||
import Component from '@glimmer/component'; | ||
import { action } from '@ember/object'; | ||
|
||
interface CloseButtonArgs { | ||
export interface CloseButtonArgs { | ||
/* | ||
* The icon size | ||
* | ||
* @defaultValue `lg` | ||
*/ | ||
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; | ||
|
||
/* | ||
* The function to call when button is clicked | ||
*/ | ||
onClick?: (event: Event) => void; | ||
} | ||
|
||
export default class CloseButton extends Component<CloseButtonArgs> { | ||
@action handleClick(event: Event): void { | ||
this.args.onClick?.(event); | ||
if (typeof this.args.onClick === 'function') { | ||
this.args.onClick(event); | ||
} | ||
} | ||
|
||
get sizeClass(): string { | ||
return `close-button--${this.args.size || 'sm'}`; | ||
return `close-button--${this.args.size || 'md'}`; | ||
} | ||
} |
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
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
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.