Skip to content

Commit 81b24df

Browse files
authored
refactor(elements): unify class prop type to HTMLAttributes['class'] (#66)
1 parent 8f19b4a commit 81b24df

File tree

8 files changed

+16
-9
lines changed

8 files changed

+16
-9
lines changed

packages/elements/src/artifact/ArtifactAction.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<script setup lang="ts">
22
import type { ButtonVariants } from '@repo/shadcn-vue/components/ui/button'
33
import type { LucideIcon } from 'lucide-vue-next'
4+
import type { HTMLAttributes } from 'vue'
45
import { Button } from '@repo/shadcn-vue/components/ui/button'
56
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@repo/shadcn-vue/components/ui/tooltip'
67
import { cn } from '@repo/shadcn-vue/lib/utils'
78
import { computed } from 'vue'
89
910
interface ArtifactActionProps {
10-
class?: string
11+
class?: HTMLAttributes['class']
1112
tooltip?: string
1213
label?: string
1314
variant?: ButtonVariants['variant']

packages/elements/src/artifact/ArtifactClose.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<script setup lang="ts">
22
import type { ButtonVariants } from '@repo/shadcn-vue/components/ui/button'
3+
import type { HTMLAttributes } from 'vue'
34
import { Button } from '@repo/shadcn-vue/components/ui/button'
45
import { cn } from '@repo/shadcn-vue/lib/utils'
56
import { X } from 'lucide-vue-next'
67
import { computed } from 'vue'
78
89
interface ArtifactCloseProps {
9-
class?: string
10+
class?: HTMLAttributes['class']
1011
variant?: ButtonVariants['variant']
1112
size?: ButtonVariants['size']
1213
}

packages/elements/src/image/Image.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<script setup lang="ts">
22
import type { Experimental_GeneratedImage } from 'ai'
3+
import type { HTMLAttributes } from 'vue'
34
import { cn } from '@repo/shadcn-vue/lib/utils'
45
import { computed, useAttrs } from 'vue'
56
67
interface Props extends Experimental_GeneratedImage {
7-
class?: string
8+
class?: HTMLAttributes['class']
89
alt?: string
910
}
1011

packages/elements/src/loader/Loader.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<script setup lang="ts">
2+
import type { HTMLAttributes } from 'vue'
23
import { cn } from '@repo/shadcn-vue/lib/utils'
34
import LoaderIcon from './LoaderIcon.vue'
45
56
interface Props {
67
size?: number
7-
class?: string
8+
class?: HTMLAttributes['class']
89
}
910
1011
const props = withDefaults(defineProps<Props>(), {

packages/elements/src/message/MessageAvatar.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<script setup lang="ts">
2+
import type { HTMLAttributes } from 'vue'
23
import { Avatar, AvatarFallback, AvatarImage } from '@repo/shadcn-vue/components/ui/avatar'
34
import { computed, useAttrs } from 'vue'
45
56
interface Props {
67
src: string
78
name?: string
8-
class?: string
9+
class?: HTMLAttributes['class']
910
}
1011
1112
const props = defineProps<Props>()

packages/elements/src/plan/PlanTrigger.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<script setup lang="ts">
2+
import type { HTMLAttributes } from 'vue'
23
import { Button } from '@repo/shadcn-vue/components/ui/button'
34
import { CollapsibleTrigger } from '@repo/shadcn-vue/components/ui/collapsible'
45
import { cn } from '@repo/shadcn-vue/lib/utils'
56
import { ChevronsUpDownIcon } from 'lucide-vue-next'
67
78
const props = defineProps<{
8-
class?: string
9+
class?: HTMLAttributes['class']
910
}>()
1011
</script>
1112

packages/elements/src/prompt-input/PromptInputAttachment.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script setup lang="ts">
2+
import type { HTMLAttributes } from 'vue'
23
import type { AttachmentFile } from './types'
34
import { Button } from '@repo/shadcn-vue/components/ui/button'
45
import {
@@ -13,7 +14,7 @@ import { usePromptInput } from './context'
1314
1415
const props = defineProps<{
1516
file: AttachmentFile
16-
class?: string
17+
class?: HTMLAttributes['class']
1718
}>()
1819
1920
const { removeFile } = usePromptInput()

packages/elements/src/shimmer/Shimmer.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<script setup lang="ts">
2-
import type { CSSProperties } from 'vue'
2+
import type { CSSProperties, HTMLAttributes } from 'vue'
33
import { cn } from '@repo/shadcn-vue/lib/utils'
44
import { motion } from 'motion-v'
55
import { computed, useSlots } from 'vue'
66
77
export interface TextShimmerProps {
88
as?: keyof HTMLElementTagNameMap
9-
class?: string
9+
class?: HTMLAttributes['class']
1010
duration?: number
1111
spread?: number
1212
}

0 commit comments

Comments
 (0)