feat(button): add isSelected prop for icon-only, ghost buttons

This commit is contained in:
Eric Y Liu 2021-03-05 14:17:29 -08:00
commit 5f3450839a
5 changed files with 36 additions and 0 deletions

View file

@ -17,6 +17,11 @@
*/
export let size = "default";
/**
* Set to `true` to enable the selected state for an icon-only, ghost button
*/
export let isSelected = false;
/**
* Set to `true` for the icon-only variant
* @deprecated inferred using the $$slots API
@ -104,6 +109,7 @@
hasIconOnly &&
tooltipAlignment &&
`bx--tooltip--align-${tooltipAlignment}`,
hasIconOnly && isSelected && kind === "ghost" && "bx--btn--selected",
$$restProps.class,
]
.filter(Boolean)