mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 02:41:05 +00:00
feat: initial commit
This commit is contained in:
parent
bde7dd644f
commit
72dc38ea56
119 changed files with 14925 additions and 1 deletions
24
src/components/Toggle/Toggle.Skeleton.svelte
Normal file
24
src/components/Toggle/Toggle.Skeleton.svelte
Normal file
|
@ -0,0 +1,24 @@
|
|||
<script>
|
||||
let className = undefined;
|
||||
export { className as class };
|
||||
export let id = undefined;
|
||||
export let labelText = undefined;
|
||||
export let props = {};
|
||||
|
||||
import { cx } from '../../lib';
|
||||
|
||||
const _class = cx('--form-item', className);
|
||||
const ariaLabel = labelText ? null : $$props['aria-label'] || 'Toggle is loading';
|
||||
</script>
|
||||
|
||||
<div {...props} class={_class}>
|
||||
<input type="checkbox" class={cx('--toggle --skeleton')} {id} />
|
||||
<label class={cx('--toggle__label', '--skeleton')} aria-label={ariaLabel} for={id}>
|
||||
{#if labelText}
|
||||
<span class={cx('--toggle__label-text')}>{labelText}</span>
|
||||
{/if}
|
||||
<span class={cx('--toggle__text--left')} />
|
||||
<span class={cx('--toggle__appearance')} />
|
||||
<span class={cx('--toggle__text--right')} />
|
||||
</label>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue