mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 10:51:06 +00:00
refactor: use $$restProps API
- add ref prop for applicable components (#196) - add slot to Content Switcher `Switch` component (#183) - remove fillArray, css utilities
This commit is contained in:
parent
4e2959080b
commit
e886d772c7
288 changed files with 4681 additions and 4498 deletions
|
@ -1,42 +1,39 @@
|
|||
<script>
|
||||
let className = undefined;
|
||||
export { className as class };
|
||||
export let iconDescription = '';
|
||||
export let iconDescription = "";
|
||||
export let invalid = false;
|
||||
export let status = 'uploading';
|
||||
export let style = undefined;
|
||||
export let tabindex = '0';
|
||||
export let status = "uploading"; // "uploading" | "edit" | "complete"
|
||||
|
||||
import Close16 from 'carbon-icons-svelte/lib/Close16';
|
||||
import CheckmarkFilled16 from 'carbon-icons-svelte/lib/CheckmarkFilled16';
|
||||
import WarningFilled16 from 'carbon-icons-svelte/lib/WarningFilled16';
|
||||
import { cx } from '../../lib';
|
||||
import Loading from '../Loading';
|
||||
import Close16 from "carbon-icons-svelte/lib/Close16";
|
||||
import CheckmarkFilled16 from "carbon-icons-svelte/lib/CheckmarkFilled16";
|
||||
import WarningFilled16 from "carbon-icons-svelte/lib/WarningFilled16";
|
||||
import { Loading } from "../Loading";
|
||||
</script>
|
||||
|
||||
{#if status === 'uploading'}
|
||||
<Loading small description={iconDescription} withOverlay={false} class={className} {style} />
|
||||
<Loading
|
||||
description={iconDescription}
|
||||
{...$$restProps}
|
||||
small
|
||||
withOverlay={false} />
|
||||
{/if}
|
||||
|
||||
{#if status === 'edit'}
|
||||
{#if invalid}
|
||||
<WarningFilled16 class={cx('--file-invalid')} />
|
||||
<WarningFilled16 class="bx--file-invalid" />
|
||||
{/if}
|
||||
<Close16
|
||||
class={cx('--file-close', className)}
|
||||
aria-label={iconDescription}
|
||||
title={iconDescription}
|
||||
class="bx--file-close"
|
||||
{...$$restProps}
|
||||
on:click
|
||||
on:keydown
|
||||
{tabindex}
|
||||
{style} />
|
||||
on:keydown />
|
||||
{/if}
|
||||
|
||||
{#if status === 'complete'}
|
||||
<CheckmarkFilled16
|
||||
class={cx('--file-complete', className)}
|
||||
aria-label={iconDescription}
|
||||
title={iconDescription}
|
||||
{tabindex}
|
||||
{style} />
|
||||
class="bx--file-complete"
|
||||
{...$$restProps} />
|
||||
{/if}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue