-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
631 additions
and
2 deletions.
There are no files selected for viewing
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,17 @@ | ||
{ | ||
"$schema": "https://shadcn-vue.com/schema.json", | ||
"style": "default", | ||
"typescript": true, | ||
"tsConfigPath": "./tsconfig.json", | ||
"tailwind": { | ||
"config": "tailwind.config.js", | ||
"css": "src/assets/index.css", | ||
"baseColor": "slate", | ||
"cssVariables": true | ||
}, | ||
"framework": "vite", | ||
"aliases": { | ||
"components": "@/components", | ||
"utils": "@/lib/utils" | ||
} | ||
} |
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,78 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
@layer base { | ||
:root { | ||
--background: 0 0% 100%; | ||
--foreground: 222.2 84% 4.9%; | ||
|
||
--muted: 210 40% 96.1%; | ||
--muted-foreground: 215.4 16.3% 46.9%; | ||
|
||
--popover: 0 0% 100%; | ||
--popover-foreground: 222.2 84% 4.9%; | ||
|
||
--card: 0 0% 100%; | ||
--card-foreground: 222.2 84% 4.9%; | ||
|
||
--border: 214.3 31.8% 91.4%; | ||
--input: 214.3 31.8% 91.4%; | ||
|
||
--primary: 222.2 47.4% 11.2%; | ||
--primary-foreground: 210 40% 98%; | ||
|
||
--secondary: 210 40% 96.1%; | ||
--secondary-foreground: 222.2 47.4% 11.2%; | ||
|
||
--accent: 210 40% 96.1%; | ||
--accent-foreground: 222.2 47.4% 11.2%; | ||
|
||
--destructive: 0 84.2% 60.2%; | ||
--destructive-foreground: 210 40% 98%; | ||
|
||
--ring: 222.2 84% 4.9%; | ||
|
||
--radius: 0.5rem; | ||
} | ||
|
||
.dark { | ||
--background: 222.2 84% 4.9%; | ||
--foreground: 210 40% 98%; | ||
|
||
--muted: 217.2 32.6% 17.5%; | ||
--muted-foreground: 215 20.2% 65.1%; | ||
|
||
--popover: 222.2 84% 4.9%; | ||
--popover-foreground: 210 40% 98%; | ||
|
||
--card: 222.2 84% 4.9%; | ||
--card-foreground: 210 40% 98%; | ||
|
||
--border: 217.2 32.6% 17.5%; | ||
--input: 217.2 32.6% 17.5%; | ||
|
||
--primary: 210 40% 98%; | ||
--primary-foreground: 222.2 47.4% 11.2%; | ||
|
||
--secondary: 217.2 32.6% 17.5%; | ||
--secondary-foreground: 210 40% 98%; | ||
|
||
--accent: 217.2 32.6% 17.5%; | ||
--accent-foreground: 210 40% 98%; | ||
|
||
--destructive: 0 62.8% 30.6%; | ||
--destructive-foreground: 210 40% 98%; | ||
|
||
--ring: 212.7 26.8% 83.9%; | ||
} | ||
} | ||
|
||
@layer base { | ||
* { | ||
@apply border-border; | ||
} | ||
body { | ||
@apply bg-background text-foreground; | ||
} | ||
} |
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,14 @@ | ||
<script setup lang="ts"> | ||
import { DropdownMenuRoot, type DropdownMenuRootEmits, type DropdownMenuRootProps, useForwardPropsEmits } from 'radix-vue' | ||
const props = defineProps<DropdownMenuRootProps>() | ||
const emits = defineEmits<DropdownMenuRootEmits>() | ||
const forwarded = useForwardPropsEmits(props, emits) | ||
</script> | ||
|
||
<template> | ||
<DropdownMenuRoot v-bind="forwarded"> | ||
<slot /> | ||
</DropdownMenuRoot> | ||
</template> |
40 changes: 40 additions & 0 deletions
40
src/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue
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,40 @@ | ||
<script setup lang="ts"> | ||
import { type HTMLAttributes, computed } from 'vue' | ||
import { | ||
DropdownMenuCheckboxItem, | ||
type DropdownMenuCheckboxItemEmits, | ||
type DropdownMenuCheckboxItemProps, | ||
DropdownMenuItemIndicator, | ||
useForwardPropsEmits, | ||
} from 'radix-vue' | ||
import { Check } from 'lucide-vue-next' | ||
import { cn } from '@/lib/utils' | ||
const props = defineProps<DropdownMenuCheckboxItemProps & { class?: HTMLAttributes['class'] }>() | ||
const emits = defineEmits<DropdownMenuCheckboxItemEmits>() | ||
const delegatedProps = computed(() => { | ||
const { class: _, ...delegated } = props | ||
return delegated | ||
}) | ||
const forwarded = useForwardPropsEmits(delegatedProps, emits) | ||
</script> | ||
|
||
<template> | ||
<DropdownMenuCheckboxItem | ||
v-bind="forwarded" | ||
:class=" cn( | ||
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', | ||
props.class, | ||
)" | ||
> | ||
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center"> | ||
<DropdownMenuItemIndicator> | ||
<Check class="w-4 h-4" /> | ||
</DropdownMenuItemIndicator> | ||
</span> | ||
<slot /> | ||
</DropdownMenuCheckboxItem> | ||
</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,38 @@ | ||
<script setup lang="ts"> | ||
import { type HTMLAttributes, computed } from 'vue' | ||
import { | ||
DropdownMenuContent, | ||
type DropdownMenuContentEmits, | ||
type DropdownMenuContentProps, | ||
DropdownMenuPortal, | ||
useForwardPropsEmits, | ||
} from 'radix-vue' | ||
import { cn } from '@/lib/utils' | ||
const props = withDefaults( | ||
defineProps<DropdownMenuContentProps & { class?: HTMLAttributes['class'] }>(), | ||
{ | ||
sideOffset: 4, | ||
}, | ||
) | ||
const emits = defineEmits<DropdownMenuContentEmits>() | ||
const delegatedProps = computed(() => { | ||
const { class: _, ...delegated } = props | ||
return delegated | ||
}) | ||
const forwarded = useForwardPropsEmits(delegatedProps, emits) | ||
</script> | ||
|
||
<template> | ||
<DropdownMenuPortal> | ||
<DropdownMenuContent | ||
v-bind="forwarded" | ||
:class="cn('z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', props.class)" | ||
> | ||
<slot /> | ||
</DropdownMenuContent> | ||
</DropdownMenuPortal> | ||
</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,11 @@ | ||
<script setup lang="ts"> | ||
import { DropdownMenuGroup, type DropdownMenuGroupProps } from 'radix-vue' | ||
const props = defineProps<DropdownMenuGroupProps>() | ||
</script> | ||
|
||
<template> | ||
<DropdownMenuGroup v-bind="props"> | ||
<slot /> | ||
</DropdownMenuGroup> | ||
</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,28 @@ | ||
<script setup lang="ts"> | ||
import { type HTMLAttributes, computed } from 'vue' | ||
import { DropdownMenuItem, type DropdownMenuItemProps, useForwardProps } from 'radix-vue' | ||
import { cn } from '@/lib/utils' | ||
const props = defineProps<DropdownMenuItemProps & { class?: HTMLAttributes['class'], inset?: boolean }>() | ||
const delegatedProps = computed(() => { | ||
const { class: _, ...delegated } = props | ||
return delegated | ||
}) | ||
const forwardedProps = useForwardProps(delegatedProps) | ||
</script> | ||
|
||
<template> | ||
<DropdownMenuItem | ||
v-bind="forwardedProps" | ||
:class="cn( | ||
'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', | ||
inset && 'pl-8', | ||
props.class, | ||
)" | ||
> | ||
<slot /> | ||
</DropdownMenuItem> | ||
</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,24 @@ | ||
<script setup lang="ts"> | ||
import { type HTMLAttributes, computed } from 'vue' | ||
import { DropdownMenuLabel, type DropdownMenuLabelProps, useForwardProps } from 'radix-vue' | ||
import { cn } from '@/lib/utils' | ||
const props = defineProps<DropdownMenuLabelProps & { class?: HTMLAttributes['class'], inset?: boolean }>() | ||
const delegatedProps = computed(() => { | ||
const { class: _, ...delegated } = props | ||
return delegated | ||
}) | ||
const forwardedProps = useForwardProps(delegatedProps) | ||
</script> | ||
|
||
<template> | ||
<DropdownMenuLabel | ||
v-bind="forwardedProps" | ||
:class="cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', props.class)" | ||
> | ||
<slot /> | ||
</DropdownMenuLabel> | ||
</template> |
19 changes: 19 additions & 0 deletions
19
src/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue
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,19 @@ | ||
<script setup lang="ts"> | ||
import { | ||
DropdownMenuRadioGroup, | ||
type DropdownMenuRadioGroupEmits, | ||
type DropdownMenuRadioGroupProps, | ||
useForwardPropsEmits, | ||
} from 'radix-vue' | ||
const props = defineProps<DropdownMenuRadioGroupProps>() | ||
const emits = defineEmits<DropdownMenuRadioGroupEmits>() | ||
const forwarded = useForwardPropsEmits(props, emits) | ||
</script> | ||
|
||
<template> | ||
<DropdownMenuRadioGroup v-bind="forwarded"> | ||
<slot /> | ||
</DropdownMenuRadioGroup> | ||
</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,41 @@ | ||
<script setup lang="ts"> | ||
import { type HTMLAttributes, computed } from 'vue' | ||
import { | ||
DropdownMenuItemIndicator, | ||
DropdownMenuRadioItem, | ||
type DropdownMenuRadioItemEmits, | ||
type DropdownMenuRadioItemProps, | ||
useForwardPropsEmits, | ||
} from 'radix-vue' | ||
import { Circle } from 'lucide-vue-next' | ||
import { cn } from '@/lib/utils' | ||
const props = defineProps<DropdownMenuRadioItemProps & { class?: HTMLAttributes['class'] }>() | ||
const emits = defineEmits<DropdownMenuRadioItemEmits>() | ||
const delegatedProps = computed(() => { | ||
const { class: _, ...delegated } = props | ||
return delegated | ||
}) | ||
const forwarded = useForwardPropsEmits(delegatedProps, emits) | ||
</script> | ||
|
||
<template> | ||
<DropdownMenuRadioItem | ||
v-bind="forwarded" | ||
:class="cn( | ||
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', | ||
props.class, | ||
)" | ||
> | ||
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center"> | ||
<DropdownMenuItemIndicator> | ||
<Circle class="h-2 w-2 fill-current" /> | ||
</DropdownMenuItemIndicator> | ||
</span> | ||
<slot /> | ||
</DropdownMenuRadioItem> | ||
</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,22 @@ | ||
<script setup lang="ts"> | ||
import { type HTMLAttributes, computed } from 'vue' | ||
import { | ||
DropdownMenuSeparator, | ||
type DropdownMenuSeparatorProps, | ||
} from 'radix-vue' | ||
import { cn } from '@/lib/utils' | ||
const props = defineProps<DropdownMenuSeparatorProps & { | ||
class?: HTMLAttributes['class'] | ||
}>() | ||
const delegatedProps = computed(() => { | ||
const { class: _, ...delegated } = props | ||
return delegated | ||
}) | ||
</script> | ||
|
||
<template> | ||
<DropdownMenuSeparator v-bind="delegatedProps" :class="cn('-mx-1 my-1 h-px bg-muted', props.class)" /> | ||
</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,14 @@ | ||
<script setup lang="ts"> | ||
import type { HTMLAttributes } from 'vue' | ||
import { cn } from '@/lib/utils' | ||
const props = defineProps<{ | ||
class?: HTMLAttributes['class'] | ||
}>() | ||
</script> | ||
|
||
<template> | ||
<span :class="cn('ml-auto text-xs tracking-widest opacity-60', props.class)"> | ||
<slot /> | ||
</span> | ||
</template> |
Oops, something went wrong.