-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
115 additions
and
26 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,5 @@ | ||
--- | ||
'@eventstore-ui/components': patch | ||
--- | ||
|
||
Improve button styles |
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
8 changes: 8 additions & 0 deletions
8
packages/components/src/components/buttons/demos/buttons-demo.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,8 @@ | ||
:host { | ||
display: grid; | ||
grid-template-columns: auto auto auto; | ||
gap: 20px; | ||
align-items: center; | ||
justify-items: center; | ||
padding: 20px; | ||
} |
78 changes: 78 additions & 0 deletions
78
packages/components/src/components/buttons/demos/buttons.demo.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,78 @@ | ||
import { Component, h, Host, Fragment } from '@stencil/core'; | ||
import type { ButtonVariant } from '../types'; | ||
import { ES_COMPONENTS_ICON_NAMESPACE, type IconDescription } from '../../..'; | ||
|
||
/** Basic button demon. */ | ||
@Component({ | ||
tag: 'es-buttons-demo', | ||
styleUrl: './buttons-demo.css', | ||
shadow: true, | ||
}) | ||
export class LoadingTextDemo { | ||
private variants: ButtonVariant[] = [ | ||
'default', | ||
'filled', | ||
'outline', | ||
'delete', | ||
'cancel', | ||
'minimal', | ||
'link', | ||
]; | ||
|
||
render() { | ||
return ( | ||
<Host> | ||
{this.variants.map((variant) => ( | ||
<> | ||
<es-button variant={variant} onClick={this.handleClick}> | ||
<es-icon icon={this.randomIcon()} slot={'after'} /> | ||
{`${variant} variant`} | ||
</es-button> | ||
<es-button variant={variant} onClick={this.handleClick}> | ||
<es-icon icon={this.randomIcon()} size={22} /> | ||
</es-button> | ||
<es-button | ||
variant={variant} | ||
onClick={this.handleClick} | ||
disabled | ||
> | ||
<es-icon icon={this.randomIcon()} slot={'after'} /> | ||
{`${variant} (disabled)`} | ||
</es-button> | ||
</> | ||
))} | ||
</Host> | ||
); | ||
} | ||
|
||
private handleClick = (...args: unknown[]) => { | ||
// eslint-disable-next-line no-console | ||
console.log(...args); | ||
}; | ||
|
||
private icons = [ | ||
'check', | ||
'chevron', | ||
'chevron-double', | ||
'circle', | ||
'close', | ||
'copy', | ||
'critical', | ||
'degraded', | ||
'dot', | ||
'exclamation-mark', | ||
'info', | ||
'lightbulb', | ||
'more', | ||
'okay', | ||
'sort', | ||
'sorted', | ||
'spinner', | ||
'trash', | ||
]; | ||
|
||
private randomIcon = (): IconDescription => [ | ||
ES_COMPONENTS_ICON_NAMESPACE, | ||
this.icons[Math.floor(Math.random() * (this.icons.length - 2))], | ||
]; | ||
} |
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