Skip to content

Commit

Permalink
feat(file-uploader-button): support danger-tertiary, danger-ghost
Browse files Browse the repository at this point in the history
… button variants (#1784)
  • Loading branch information
metonym authored Jul 23, 2023
1 parent 50e1577 commit 709322c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/src/pages/components/FileUploader.svx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@ components: ["FileUploaderButton", "FileUploader", "FileUploaderDropContainer",

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" />

## Custom button kind

By default, the `primary` button kind is used.

<FileUploaderButton kind="secondary" labelText="Add files" />

## File uploader

The `FileUploader` wraps `FileUploaderButton` and lists out uploaded files.
Expand Down
2 changes: 2 additions & 0 deletions src/FileUploader/FileUploaderButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
class:bx--btn--tertiary="{kind === 'tertiary'}"
class:bx--btn--ghost="{kind === 'ghost'}"
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="{({ key }) => {
if (key === ' ' || key === 'Enter') {
Expand Down

0 comments on commit 709322c

Please sign in to comment.