Refactor folder structure

This commit is contained in:
venashial
2022-06-17 19:58:01 -07:00
parent 8204139df8
commit 137fbb638b
110 changed files with 45 additions and 52 deletions

View File

@@ -0,0 +1,46 @@
<script lang="ts">
import { uniqueId } from '../utils/uniqueId'
export let required = false
export let label: string
export let helper = ''
const id = `field-${uniqueId()}`
</script>
<div class="field">
<label for={id} class="field__label" class:required>
<span class="field__label__title">{@html label}</span>
{#if helper}
<span class="field__label__helper">{helper}</span>
{/if}
</label>
<slot {id} />
</div>
<style lang="postcss">
.field {
display: flex;
flex-direction: column;
gap: 0.5rem;
&__label {
display: flex;
flex-direction: column;
gap: 0;
&__title {
font-weight: var(--font-weight-bold);
:global(i) {
font-weight: var(--font-weight-normal);
}
}
&__helper {
font-size: var(--font-size-sm);
color: var(--color-text-light);
}
}
}
</style>