Skip to content

Commit

Permalink
respond to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
claireclark1 committed Nov 26, 2024
1 parent ef7a5bd commit e2f9d88
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 20 deletions.
17 changes: 0 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"vite": "^4.4.9"
},
"dependencies": {
"@melt-ui/svelte": "^0.86.2",
"@storybook/addons": "^7.6.17",
"bits-ui": "^0.21.16",
"clsx": "^2.1.1",
Expand Down
7 changes: 5 additions & 2 deletions src/lib/atoms/FormElement.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
export let isRequired = false;
export let description = '';
export let error: string | undefined;
const labelNoSpaces = label.split(' ').join('');
const id = `form-element-${labelNoSpaces}`;
</script>

<div class="flex flex-col gap-f4">
<label class="form-item-label" for="form-element">
<label class="form-item-label" for={id}>
{label}
{#if isRequired}
<span class="text-error">*</span>
Expand All @@ -19,7 +22,7 @@
<span class="form-item-description">{description}</span>
{/if}

<div class="flex items-center gap-f12" id="form-element">
<div class="flex items-center gap-f12" {id}>
<slot />

{#if error}
Expand Down

0 comments on commit e2f9d88

Please sign in to comment.