mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
Merge pull request #72 from IBM/refactor-button
feat(button): derive hasIconOnly from icon and slots
This commit is contained in:
commit
fd3698b49a
2 changed files with 2 additions and 2 deletions
|
@ -50,7 +50,7 @@
|
|||
{:else if story === 'inline'}
|
||||
<Button />
|
||||
{:else if story === 'icon-only buttons'}
|
||||
<Button {...iconOnlyProps} hasIconOnly />
|
||||
<Button {...iconOnlyProps} />
|
||||
{:else if story === 'set of buttons'}
|
||||
<div class={cx('--btn-set')}>
|
||||
<Button kind="secondary" {...setProps}>Secondary button</Button>
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
export let type = 'button';
|
||||
export let icon = undefined;
|
||||
export let iconDescription = undefined;
|
||||
export let hasIconOnly = false;
|
||||
export let tooltipPosition = undefined;
|
||||
export let tooltipAlignment = undefined;
|
||||
export let style = undefined;
|
||||
|
@ -19,6 +18,7 @@
|
|||
import { getContext } from 'svelte';
|
||||
import { cx } from '../../lib';
|
||||
|
||||
const hasIconOnly = !!icon && !$$props.$$slots;
|
||||
const ctx = getContext('ComposedModal');
|
||||
|
||||
let buttonRef = undefined;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue