Skip to content

Commit

Permalink
add optional for attribute to Label component (viamrobotics#522)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrloureed authored May 31, 2024
1 parent 08addf6 commit 3c3f2fc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@viamrobotics/prime-core",
"version": "0.0.119",
"version": "0.0.120",
"publishConfig": {
"access": "public"
},
Expand Down
5 changes: 5 additions & 0 deletions packages/core/src/lib/label.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export let required = false;
/** Whether or not the label should render as disabled */
export let disabled = false;
/** The input the label describes */
let htmlFor: string | undefined = undefined;
export { htmlFor as for };
/** Additional detail text to render after the default slot. */
export let detail = '';
Expand All @@ -48,6 +52,7 @@ export { extraClasses as cx };
},
extraClasses
)}
for={htmlFor}
>
<span
class={cx('flex text-xs', {
Expand Down
14 changes: 14 additions & 0 deletions packages/core/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,20 @@ const onHoverDelayMsInput = (event: Event) => {
name="name"
/>
</Label>

<div>
<Label
for="targetID"
cx="whitespace-nowrap"
>
For attribute example
</Label>
<Input
cx="max-w-[70px]"
id="targetID"
name="name"
/>
</div>
</div>

<!-- Notify -->
Expand Down

0 comments on commit 3c3f2fc

Please sign in to comment.