diff --git a/packages/ui/src/components/ToggleButton.svelte b/packages/ui/src/components/ToggleButton.svelte index 80bae4491f..81917b4c0f 100644 --- a/packages/ui/src/components/ToggleButton.svelte +++ b/packages/ui/src/components/ToggleButton.svelte @@ -16,25 +16,22 @@ import type { Asset, IntlString } from '@hcengineering/platform' import { createEventDispatcher, onMount } from 'svelte' import { registerFocus } from '../focus' - import type { AnySvelteComponent, ButtonKind, ButtonSize } from '../types' + import type { AnySvelteComponent, ButtonSize } from '../types' import Icon from './Icon.svelte' import Label from './Label.svelte' export let value: boolean export let label: IntlString | undefined = undefined export let labelParams: Record = {} - export let kind: ButtonKind = 'secondary' export let size: ButtonSize = 'medium' export let icon: Asset | AnySvelteComponent | undefined = undefined export let justify: 'left' | 'center' = 'center' export let width: string | undefined = undefined - export let resetIconSize: boolean = false - export let highlight: boolean = false export let selected: boolean = false export let focus: boolean = false - export let borderStyle: 'solid' | 'dashed' = 'solid' export let id: string | undefined = undefined export let input: HTMLButtonElement | undefined = undefined + export let backgroundColor: string | undefined = undefined $: iconOnly = label === undefined && $$slots.content === undefined @@ -66,19 +63,23 @@ } const dispatch = createEventDispatcher() + + function getStyle (backgroundColor: string | undefined, width: string | undefined) { + let style = width ? `width: ${width};` : '' + if (backgroundColor) { + style += ` background: ${backgroundColor};` + } + return style + }