From bb369db16548661ca6f5e2ab10c001db4d0e5c49 Mon Sep 17 00:00:00 2001 From: Eric Y Liu Date: Sun, 2 May 2021 15:43:29 -0700 Subject: [PATCH] feat(button): support xl size --- COMPONENT_INDEX.md | 2 +- docs/src/COMPONENT_API.json | 2 +- docs/src/pages/components/Button.svx | 8 ++++++++ src/Button/Button.svelte | 3 ++- types/Button/Button.d.ts | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index 6a1bfd45..95962243 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -350,7 +350,7 @@ None. | ref | let | Yes | null | HTMLAnchorElement | HTMLButtonElement | null | Obtain a reference to the HTML element | | hasIconOnly | let | Yes | boolean | false | Set to `true` for the icon-only variant | | kind | let | No | "primary" | "secondary" | "tertiary" | "ghost" | "danger" | "danger-tertiary" | "danger-ghost" | "primary" | Specify the kind of button | -| size | let | No | "default" | "field" | "small" | "default" | Specify the size of button | +| size | let | No | "default" | "field" | "small" | "xl" | "default" | Specify the size of button | | isSelected | let | No | boolean | false | Set to `true` to enable the selected state for an icon-only, ghost button | | icon | let | No | typeof import("carbon-icons-svelte").CarbonIcon | -- | Specify the icon from `carbon-icons-svelte` to render | | iconDescription | let | No | string | -- | Specify the ARIA label for the button icon | diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index cfbd284f..daded28f 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -362,7 +362,7 @@ "name": "size", "kind": "let", "description": "Specify the size of button", - "type": "\"default\" | \"field\" | \"small\"", + "type": "\"default\" | \"field\" | \"small\" | \"xl\"", "value": "\"default\"", "isFunction": false, "constant": false, diff --git a/docs/src/pages/components/Button.svx b/docs/src/pages/components/Button.svx index d464c41c..cced1fae 100644 --- a/docs/src/pages/components/Button.svx +++ b/docs/src/pages/components/Button.svx @@ -94,6 +94,14 @@ If an `href` value is specified, the component will render an [anchor element](h +### Extra-large button + + + + + + + ### Disabled button diff --git a/src/Button/Button.svelte b/src/Button/Button.svelte index b254e073..8b9f5907 100644 --- a/src/Button/Button.svelte +++ b/src/Button/Button.svelte @@ -13,7 +13,7 @@ /** * Specify the size of button - * @type {"default" | "field" | "small"} + * @type {"default" | "field" | "small" | "xl"} */ export let size = "default"; @@ -100,6 +100,7 @@ "bx--btn", size === "field" && "bx--btn--field", size === "small" && "bx--btn--sm", + size === "xl" && "bx--btn--xl", kind && `bx--btn--${kind}`, disabled && "bx--btn--disabled", hasIconOnly && "bx--btn--icon-only", diff --git a/types/Button/Button.d.ts b/types/Button/Button.d.ts index 97d62ed0..67b9f1f3 100644 --- a/types/Button/Button.d.ts +++ b/types/Button/Button.d.ts @@ -24,7 +24,7 @@ export interface ButtonProps * Specify the size of button * @default "default" */ - size?: "default" | "field" | "small"; + size?: "default" | "field" | "small" | "xl"; /** * Set to `true` to enable the selected state for an icon-only, ghost button