-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added setting for specifying shell command, which defaults to /bin/sh Fixes #2
- Loading branch information
Jeroen Nijhuis
committed
Feb 7, 2024
1 parent
3135df3
commit e930091
Showing
17 changed files
with
352 additions
and
35 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<script lang="ts" setup> | ||
import { Slot } from 'radix-vue' | ||
import { useFormField } from './useFormField' | ||
const { error, formItemId, formDescriptionId, formMessageId } = useFormField() | ||
</script> | ||
|
||
<template> | ||
<Slot | ||
:id="formItemId" | ||
:aria-describedby="!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`" | ||
:aria-invalid="!!error" | ||
> | ||
<slot /> | ||
</Slot> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<script lang="ts" setup> | ||
import type { HTMLAttributes } from 'vue' | ||
import { useFormField } from './useFormField' | ||
import { cn } from '@/lib/utils' | ||
const props = defineProps<{ | ||
class?: HTMLAttributes['class'] | ||
}>() | ||
const { formDescriptionId } = useFormField() | ||
</script> | ||
|
||
<template> | ||
<p | ||
:id="formDescriptionId" | ||
:class="cn('text-sm text-muted-foreground', props.class)" | ||
> | ||
<slot /> | ||
</p> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<script lang="ts"> | ||
import type { HTMLAttributes, InjectionKey } from 'vue' | ||
export const FORM_ITEM_INJECTION_KEY | ||
= Symbol() as InjectionKey<string> | ||
</script> | ||
|
||
<script lang="ts" setup> | ||
import { provide } from 'vue' | ||
import { useId } from 'radix-vue' | ||
import { cn } from '@/lib/utils' | ||
const props = defineProps<{ | ||
class?: HTMLAttributes['class'] | ||
}>() | ||
const id = useId() | ||
provide(FORM_ITEM_INJECTION_KEY, id) | ||
</script> | ||
|
||
<template> | ||
<div :class="cn('space-y-2', props.class)"> | ||
<slot /> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<script lang="ts" setup> | ||
import type { HTMLAttributes } from 'vue' | ||
import type { LabelProps } from 'radix-vue' | ||
import { useFormField } from './useFormField' | ||
import { cn } from '@/lib/utils' | ||
import { Label } from '@/components/ui/label' | ||
const props = defineProps<LabelProps & { class?: HTMLAttributes['class'] }>() | ||
const { error, formItemId } = useFormField() | ||
</script> | ||
|
||
<template> | ||
<Label | ||
:class="cn( | ||
error && 'text-destructive', | ||
props.class, | ||
)" | ||
:for="formItemId" | ||
> | ||
<slot /> | ||
</Label> | ||
</template> |
Oops, something went wrong.