mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
* fix(button): only set disabled attribute if true #755 Fixes #755 * Improve docs (#756) * docs: remove Theme from new components * docs: add styling instructions * docs: add styling instructions * docs: update copy * fix(button): only set disabled attribute if true #755 Fixes #755 * docs(button): use inline notification for note [ci skip]
This commit is contained in:
parent
13bd64e5c9
commit
793ecd8dc2
2 changed files with 16 additions and 3 deletions
|
@ -5,6 +5,7 @@
|
||||||
import TextBold16 from "carbon-icons-svelte/lib/TextBold16";
|
import TextBold16 from "carbon-icons-svelte/lib/TextBold16";
|
||||||
import TextItalic16 from "carbon-icons-svelte/lib/TextItalic16";
|
import TextItalic16 from "carbon-icons-svelte/lib/TextItalic16";
|
||||||
import TextUnderline16 from "carbon-icons-svelte/lib/TextUnderline16";
|
import TextUnderline16 from "carbon-icons-svelte/lib/TextUnderline16";
|
||||||
|
import Login16 from "carbon-icons-svelte/lib/Login16";
|
||||||
import Preview from "../../components/Preview.svelte";
|
import Preview from "../../components/Preview.svelte";
|
||||||
|
|
||||||
let index = 1;
|
let index = 1;
|
||||||
|
@ -36,7 +37,11 @@
|
||||||
|
|
||||||
### Danger tertiary, icon-only button
|
### Danger tertiary, icon-only button
|
||||||
|
|
||||||
**Note:** you must provide an `iconDescription` for the button tooltip.
|
<InlineNotification svx-ignore title="Note:" kind="info" hideCloseButton>
|
||||||
|
<div class="body-short-01">
|
||||||
|
You must provide an `iconDescription` for the button tooltip.
|
||||||
|
</div>
|
||||||
|
</InlineNotification>
|
||||||
|
|
||||||
<Button kind="danger-tertiary"iconDescription="Delete" icon={TrashCan16} />
|
<Button kind="danger-tertiary"iconDescription="Delete" icon={TrashCan16} />
|
||||||
|
|
||||||
|
@ -50,10 +55,18 @@
|
||||||
|
|
||||||
### Icon-only button
|
### Icon-only button
|
||||||
|
|
||||||
**Note:** you must provide an `iconDescription` for the button tooltip.
|
<InlineNotification svx-ignore title="Note:" kind="info" hideCloseButton>
|
||||||
|
<div class="body-short-01">
|
||||||
|
You must provide an `iconDescription` for the button tooltip.
|
||||||
|
</div>
|
||||||
|
</InlineNotification>
|
||||||
|
|
||||||
<Button iconDescription="Tooltip text" icon={Add16} />
|
<Button iconDescription="Tooltip text" icon={Add16} />
|
||||||
|
|
||||||
|
### Icon-only, link button
|
||||||
|
|
||||||
|
<Button iconDescription="Login" icon={Login16} href="#" />
|
||||||
|
|
||||||
### Icon-only button (custom tooltip position)
|
### Icon-only button (custom tooltip position)
|
||||||
|
|
||||||
The tooltip position and alignment can be controlled by `tooltipPosition` and `tooltipAlignment`.
|
The tooltip position and alignment can be controlled by `tooltipPosition` and `tooltipAlignment`.
|
||||||
|
|
|
@ -95,7 +95,7 @@
|
||||||
$: buttonProps = {
|
$: buttonProps = {
|
||||||
type: href && !disabled ? undefined : type,
|
type: href && !disabled ? undefined : type,
|
||||||
tabindex,
|
tabindex,
|
||||||
disabled,
|
disabled: disabled === true ? true : undefined,
|
||||||
href,
|
href,
|
||||||
"aria-pressed": hasIconOnly && kind === "ghost" ? isSelected : undefined,
|
"aria-pressed": hasIconOnly && kind === "ghost" ? isSelected : undefined,
|
||||||
...$$restProps,
|
...$$restProps,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue