Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdelilahOu committed Oct 28, 2023
1 parent 82ee976 commit 9afd3d9
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/components/ui/UiModalCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { cn } from "@/utils/shadcn";
<div
:class="[
cn(
$attrs.class ??
$attrs.class as string ??
'w-1/2 h-fit z-50 gap-3 rounded-[4px] flex flex-col bg-white p-2 min-w-[350px]'
),
]"
Expand Down
14 changes: 7 additions & 7 deletions src/components/ui/form/FormDescription.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<script lang="ts" setup>
import { useAttrs } from 'vue'
import { useFormField } from './useFormField'
import { cn } from '@/utils/shadcn'
import { useAttrs } from "vue";
import { useFormField } from "./useFormField";
import { cn } from "@/utils/shadcn";
defineOptions({
inheritAttrs: false,
})
});
const { formDescriptionId } = useFormField()
const { class: className, ...rest } = useAttrs()
const { formDescriptionId } = useFormField();
const { class: className, ...rest } = useAttrs();
</script>

<template>
<p
:id="formDescriptionId"
:class="cn('text-sm text-muted-foreground', className ?? '')"
:class="cn('text-sm text-muted-foreground', className as string ?? '')"
v-bind="rest"
>
<slot />
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/form/FormItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const { class: className, ...rest } = useAttrs();
</script>

<template>
<div :class="cn('space-y-2', className ?? '')" v-bind="rest">
<div :class="cn('space-y-2', className as string ?? '')" v-bind="rest">
<slot />
</div>
</template>
18 changes: 9 additions & 9 deletions src/components/ui/form/FormLabel.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<script lang="ts" setup>
import { useAttrs } from 'vue'
import { Label, type LabelProps } from 'radix-vue'
import { useFormField } from './useFormField'
import { cn } from '@/utils/shadcn'
import { useAttrs } from "vue";
import { Label, type LabelProps } from "radix-vue";
import { useFormField } from "./useFormField";
import { cn } from "@/utils/shadcn";
defineOptions({
inheritAttrs: false,
})
const props = defineProps<LabelProps>()
});
const props = defineProps<LabelProps>();
const { error, formItemId } = useFormField()
const { class: className, ...rest } = useAttrs()
const { error, formItemId } = useFormField();
const { class: className, ...rest } = useAttrs();
</script>

<template>
<Label
:class="cn(
'block text-sm tracking-tight font-medium text-foreground text-left',
error && 'text-destructive',
className ?? '',
className as string ?? '',
)"
:for="formItemId"
v-bind="rest"
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/textarea/Textarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const modelValue = useVModel(props, "modelValue", emits, {
:class="
cn(
'min-h-[80px] flex h-10 w-full border p-2 focus-visible:border-2 focus-visible:border-black focus:outline-0 rounded-md border-input bg-background py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 transform transition-color duration-100',
$attrs.class ?? ''
$attrs.class as string ?? ''
)
"
/>
Expand Down

0 comments on commit 9afd3d9

Please sign in to comment.