feat(file-uploader): add size prop to FileUploaderButton (#1786)

This commit is contained in:
Eric Liu 2023-07-24 06:33:53 -07:00 committed by GitHub
commit 51c281de4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 70 additions and 5 deletions

View file

@ -3830,6 +3830,18 @@
"constant": false,
"reactive": false
},
{
"name": "size",
"kind": "let",
"description": "Specify the size of the file uploader button",
"type": "import(\"../Button/Button.svelte\").ButtonProps[\"size\"]",
"value": "\"small\"",
"isFunction": false,
"isFunctionDeclaration": false,
"isRequired": false,
"constant": false,
"reactive": false
},
{
"name": "buttonLabel",
"kind": "let",
@ -3983,6 +3995,18 @@
"constant": false,
"reactive": false
},
{
"name": "size",
"kind": "let",
"description": "Specify the size of the file uploader button",
"type": "import(\"../Button/Button.svelte\").ButtonProps[\"size\"]",
"value": "\"small\"",
"isFunction": false,
"isFunctionDeclaration": false,
"isRequired": false,
"constant": false,
"reactive": false
},
{
"name": "labelText",
"kind": "let",

View file

@ -13,13 +13,22 @@ By default, the file uploader only accepts one file.
Set `multiple` to `true` for multiple files to be accepted.
<FileUploaderButton labelText="Add files" />
<FileUploaderButton labelText="Add file" />
## Custom button kind
## Multiple files
By default, the `primary` button kind is used.
<FileUploaderButton multiple labelText="Add files" />
<FileUploaderButton kind="secondary" labelText="Add files" />
## Custom button kind, size
By default, the `primary` small button kind is used.
Use the `kind` and `size` props to customize the button.
<FileUploaderButton kind="secondary" size="field" />
<FileUploaderButton kind="tertiary" size="default" />
<FileUploaderButton kind="danger" size="lg" />
<FileUploaderButton kind="danger-tertiary" size="xl" />
## File uploader