Skip to content

Commit

Permalink
Remove unnecessary button props (#2089)
Browse files Browse the repository at this point in the history
* Remove unused icon prop in Button

* Remove unused round prop in MenuButton

* Remove unnecessary Button story
  • Loading branch information
laurakwhit authored May 6, 2024
1 parent 2b8b941 commit 9442a18
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 37 deletions.
20 changes: 0 additions & 20 deletions src/lib/holocene/button.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@
name: 'Count',
control: { type: 'number', min: 0, max: 99, step: 1 },
},
icon: {
name: 'Icon',
control: 'select',
options: iconNames,
table: {
category: 'Icon',
},
},
leadingIcon: {
name: 'Leading Icon',
control: 'select',
Expand Down Expand Up @@ -143,8 +135,6 @@

<Story name="With Count" args={{ count: 5 }} />

<Story name="With Icon" args={{ icon: 'workflow' }} />

<Story name="With Leading Icon" args={{ leadingIcon: 'workflow' }} />

<Story name="With Trailing Icon" args={{ trailingIcon: 'workflow' }} />
Expand Down Expand Up @@ -262,16 +252,6 @@
}}
/>

<Story
name="With Icon (Dark)"
args={{ icon: 'workflow' }}
parameters={{
themes: {
themeOverride: 'dark',
},
}}
/>

<Story
name="With Leading Icon (Dark)"
args={{ leadingIcon: 'workflow' }}
Expand Down
15 changes: 5 additions & 10 deletions src/lib/holocene/button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
);
type BaseProps = {
icon?: IconName;
disabled?: boolean;
loading?: boolean;
leadingIcon?: IconName;
Expand Down Expand Up @@ -103,7 +102,6 @@
export let trailingIcon: IconName = null;
export let count = 0;
export let id: string = null;
export let icon: IconName = null;
export let href: string = null;
export let target: string = null;
export let active = false;
Expand All @@ -128,14 +126,11 @@
type="button"
target={target ? '_blank' : null}
rel={target ? 'noreferrer' : null}
class={merge(
icon ? 'inline-flex' : 'inline',
buttonStyles({
variant,
size,
borderRadiusModifier,
}),
)}
class={buttonStyles({
variant,
size,
borderRadiusModifier,
})}
on:click={onLinkClick}
tabindex={href ? null : 0}
{...$$restProps}
Expand Down
8 changes: 1 addition & 7 deletions src/lib/holocene/menu/menu-button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
variant?: MenuButtonVariant;
class?: string;
active?: boolean;
round?: boolean;
'data-testid'?: string;
}
Expand All @@ -44,7 +43,6 @@
export let id: string = null;
export let label: string = null;
export let variant: MenuButtonVariant = 'secondary';
export let round = false;
const dispatch = createEventDispatcher<{ click: { open: boolean } }>();
const { open, menuElement } = getContext<MenuContext>(MENU_CONTEXT);
Expand Down Expand Up @@ -105,11 +103,7 @@
{...$$restProps}
>
<slot name="leading" />
<div
class="flex grow items-center"
class:justify-center={round}
class:hidden={!$$slots.default}
>
<div class="flex grow items-center" class:hidden={!$$slots.default}>
<slot />
</div>
{#if hasIndicator}
Expand Down

0 comments on commit 9442a18

Please sign in to comment.