mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-17 11:11:25 +00:00
refactor(components): remove exported "props"
Closes #17 - Forward events - Adds style prop, removes exported props
This commit is contained in:
parent
94a11920bd
commit
1286b9901d
31 changed files with 120 additions and 105 deletions
|
@ -2,14 +2,14 @@
|
|||
let className = undefined;
|
||||
export { className as class };
|
||||
export let hideLabel = false;
|
||||
export let props = {};
|
||||
export let style = undefined;
|
||||
|
||||
import { cx } from '../../lib';
|
||||
|
||||
const _class = cx('--form-item', className);
|
||||
</script>
|
||||
|
||||
<div {...props} class={_class}>
|
||||
<div on:click on:mouseover on:mouseenter on:mouseleave class={_class} {style}>
|
||||
{#if !hideLabel}
|
||||
<span class={cx('--label', '--skeleton')} />
|
||||
{/if}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
export let helperText = '';
|
||||
export let hideLabel = false;
|
||||
export let light = false;
|
||||
export let props = {};
|
||||
export let style = undefined;
|
||||
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import WarningFilled16 from 'carbon-icons-svelte/lib/WarningFilled16';
|
||||
|
@ -35,7 +35,7 @@
|
|||
);
|
||||
</script>
|
||||
|
||||
<div class={cx('--form-item')}>
|
||||
<div on:mouseover on:mouseenter on:mouseleave class={cx('--form-item')} {style}>
|
||||
{#if labelText && !hideLabel}
|
||||
<label for={id} class={_labelClass}>{labelText}</label>
|
||||
{/if}
|
||||
|
@ -47,7 +47,6 @@
|
|||
<WarningFilled16 class={cx('--text-area__invalid-icon')} />
|
||||
{/if}
|
||||
<textarea
|
||||
{...props}
|
||||
on:click={event => {
|
||||
if (!disabled) {
|
||||
dispatch('click', event);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue