refactor(web): move cn utility inside shadcn for modularization

This commit is contained in:
Pujit Mehrotra
2024-10-18 10:59:03 -04:00
parent 958f9e57e1
commit adabe92f72
34 changed files with 33 additions and 33 deletions
+1 -1
View File
@@ -12,6 +12,6 @@
"framework": "nuxt",
"aliases": {
"components": "@/components",
"utils": "@/helpers/utils"
"utils": "@/components/shadcn/utils"
}
}
+1 -1
View File
@@ -2,7 +2,7 @@
import type { HTMLAttributes } from 'vue'
import { Primitive, type PrimitiveProps } from 'radix-vue'
import { type ButtonVariants, buttonVariants } from '.'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
interface Props extends PrimitiveProps {
variant?: ButtonVariants['variant']
@@ -8,7 +8,7 @@ import {
useForwardPropsEmits,
} from 'radix-vue'
import { Check } from 'lucide-vue-next'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<DropdownMenuCheckboxItemProps & { class?: HTMLAttributes['class'] }>()
const emits = defineEmits<DropdownMenuCheckboxItemEmits>()
@@ -7,7 +7,7 @@ import {
DropdownMenuPortal,
useForwardPropsEmits,
} from 'radix-vue'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = withDefaults(
defineProps<DropdownMenuContentProps & { class?: HTMLAttributes['class'] }>(),
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue'
import { DropdownMenuItem, type DropdownMenuItemProps, useForwardProps } from 'radix-vue'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<DropdownMenuItemProps & { class?: HTMLAttributes['class'], inset?: boolean }>()
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue'
import { DropdownMenuLabel, type DropdownMenuLabelProps, useForwardProps } from 'radix-vue'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<DropdownMenuLabelProps & { class?: HTMLAttributes['class'], inset?: boolean }>()
@@ -8,7 +8,7 @@ import {
useForwardPropsEmits,
} from 'radix-vue'
import { Circle } from 'lucide-vue-next'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<DropdownMenuRadioItemProps & { class?: HTMLAttributes['class'] }>()
@@ -4,7 +4,7 @@ import {
DropdownMenuSeparator,
type DropdownMenuSeparatorProps,
} from 'radix-vue'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<DropdownMenuSeparatorProps & {
class?: HTMLAttributes['class']
@@ -1,6 +1,6 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<{
class?: HTMLAttributes['class']
@@ -6,7 +6,7 @@ import {
type DropdownMenuSubContentProps,
useForwardPropsEmits,
} from 'radix-vue'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<DropdownMenuSubContentProps & { class?: HTMLAttributes['class'] }>()
const emits = defineEmits<DropdownMenuSubContentEmits>()
@@ -6,7 +6,7 @@ import {
useForwardProps,
} from 'radix-vue'
import { ChevronRight } from 'lucide-vue-next'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<DropdownMenuSubTriggerProps & { class?: HTMLAttributes['class'] }>()
+1 -1
View File
@@ -1,7 +1,7 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { useVModel } from '@vueuse/core'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<{
defaultValue?: string | number
+1 -1
View File
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue'
import { Label, type LabelProps } from 'radix-vue'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<LabelProps & { class?: HTMLAttributes['class'] }>()
@@ -7,7 +7,7 @@ import {
ScrollAreaViewport,
} from 'radix-vue'
import ScrollBar from './ScrollBar.vue'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<ScrollAreaRootProps & { class?: HTMLAttributes['class'] }>()
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue'
import { ScrollAreaScrollbar, type ScrollAreaScrollbarProps, ScrollAreaThumb } from 'radix-vue'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = withDefaults(defineProps<ScrollAreaScrollbarProps & { class?: HTMLAttributes['class'] }>(), {
orientation: 'vertical',
@@ -9,7 +9,7 @@ import {
useForwardPropsEmits,
} from 'radix-vue'
import { SelectScrollDownButton, SelectScrollUpButton } from '.'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
defineOptions({
inheritAttrs: false,
+1 -1
View File
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue'
import { SelectGroup, type SelectGroupProps } from 'radix-vue'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<SelectGroupProps & { class?: HTMLAttributes['class'] }>()
+1 -1
View File
@@ -8,7 +8,7 @@ import {
useForwardProps,
} from 'radix-vue'
import { Check } from 'lucide-vue-next'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<SelectItemProps & { class?: HTMLAttributes['class'] }>()
+1 -1
View File
@@ -1,7 +1,7 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { SelectLabel, type SelectLabelProps } from 'radix-vue'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<SelectLabelProps & { class?: HTMLAttributes['class'] }>()
</script>
@@ -2,7 +2,7 @@
import { type HTMLAttributes, computed } from 'vue'
import { SelectScrollDownButton, type SelectScrollDownButtonProps, useForwardProps } from 'radix-vue'
import { ChevronDown } from 'lucide-vue-next'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<SelectScrollDownButtonProps & { class?: HTMLAttributes['class'] }>()
@@ -2,7 +2,7 @@
import { type HTMLAttributes, computed } from 'vue'
import { SelectScrollUpButton, type SelectScrollUpButtonProps, useForwardProps } from 'radix-vue'
import { ChevronUp } from 'lucide-vue-next'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<SelectScrollUpButtonProps & { class?: HTMLAttributes['class'] }>()
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue'
import { SelectSeparator, type SelectSeparatorProps } from 'radix-vue'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<SelectSeparatorProps & { class?: HTMLAttributes['class'] }>()
@@ -2,7 +2,7 @@
import { type HTMLAttributes, computed } from 'vue'
import { SelectIcon, SelectTrigger, type SelectTriggerProps, useForwardProps } from 'radix-vue'
import { ChevronDown } from 'lucide-vue-next'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<SelectTriggerProps & { class?: HTMLAttributes['class'] }>()
+1 -1
View File
@@ -11,7 +11,7 @@ import {
} from 'radix-vue'
import { X } from 'lucide-vue-next'
import { type SheetVariants, sheetVariants } from '.'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
interface SheetContentProps extends DialogContentProps {
class?: HTMLAttributes['class']
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue'
import { DialogDescription, type DialogDescriptionProps } from 'radix-vue'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<DialogDescriptionProps & { class?: HTMLAttributes['class'] }>()
+1 -1
View File
@@ -1,6 +1,6 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<{ class?: HTMLAttributes['class'] }>()
</script>
+1 -1
View File
@@ -1,6 +1,6 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<{ class?: HTMLAttributes['class'] }>()
</script>
+1 -1
View File
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue'
import { DialogTitle, type DialogTitleProps } from 'radix-vue'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<DialogTitleProps & { class?: HTMLAttributes['class'] }>()
+1 -1
View File
@@ -7,7 +7,7 @@ import {
SwitchThumb,
useForwardPropsEmits,
} from 'radix-vue'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<SwitchRootProps & { class?: HTMLAttributes['class'] }>()
+1 -1
View File
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue'
import { TabsContent, type TabsContentProps } from 'radix-vue'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<TabsContentProps & { class?: HTMLAttributes['class'] }>()
+1 -1
View File
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue'
import { TabsList, type TabsListProps } from 'radix-vue'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<TabsListProps & { class?: HTMLAttributes['class'] }>()
+1 -1
View File
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue'
import { TabsTrigger, type TabsTriggerProps, useForwardProps } from 'radix-vue'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
const props = defineProps<TabsTriggerProps & { class?: HTMLAttributes['class'] }>()
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue'
import { TooltipContent, type TooltipContentEmits, type TooltipContentProps, TooltipPortal, useForwardPropsEmits } from 'radix-vue'
import { cn } from '@/helpers/utils'
import { cn } from '~/components/shadcn/utils'
defineOptions({
inheritAttrs: false,