feat(file-uploader-button): support danger-tertiary, danger-ghost button variants (#1784)

This commit is contained in:
Eric Liu 2023-07-23 14:34:08 -07:00 committed by GitHub
commit 709322c281
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -11,10 +11,16 @@ components: ["FileUploaderButton", "FileUploader", "FileUploaderDropContainer",
By default, the file uploader only accepts one file. By default, the file uploader only accepts one file.
Set `multiple` to `true` for multiple files to be uploaded. Set `multiple` to `true` for multiple files to be accepted.
<FileUploaderButton labelText="Add files" /> <FileUploaderButton labelText="Add files" />
## Custom button kind
By default, the `primary` button kind is used.
<FileUploaderButton kind="secondary" labelText="Add files" />
## File uploader ## File uploader
The `FileUploader` wraps `FileUploaderButton` and lists out uploaded files. The `FileUploader` wraps `FileUploaderButton` and lists out uploaded files.

View file

@ -74,6 +74,8 @@
class:bx--btn--tertiary="{kind === 'tertiary'}" class:bx--btn--tertiary="{kind === 'tertiary'}"
class:bx--btn--ghost="{kind === 'ghost'}" class:bx--btn--ghost="{kind === 'ghost'}"
class:bx--btn--danger="{kind === 'danger'}" class:bx--btn--danger="{kind === 'danger'}"
class:bx--btn--danger-tertiary="{kind === 'danger-tertiary'}"
class:bx--btn--danger-ghost="{kind === 'danger-ghost'}"
on:keydown on:keydown
on:keydown="{({ key }) => { on:keydown="{({ key }) => {
if (key === ' ' || key === 'Enter') { if (key === ' ' || key === 'Enter') {