-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from qianmoQ/feature-dev
Feature dev
- Loading branch information
Showing
54 changed files
with
1,264 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<script setup lang="ts"> | ||
import { type HTMLAttributes, computed } from 'vue' | ||
import type { ComboboxRootEmits, ComboboxRootProps } from 'radix-vue' | ||
import { ComboboxRoot, useForwardPropsEmits } from 'radix-vue' | ||
import { cn } from '@/lib/utils' | ||
const props = withDefaults(defineProps<ComboboxRootProps & { class?: HTMLAttributes['class'] }>(), { | ||
open: true, | ||
modelValue: '', | ||
}) | ||
const emits = defineEmits<ComboboxRootEmits>() | ||
const delegatedProps = computed(() => { | ||
const { class: _, ...delegated } = props | ||
return delegated | ||
}) | ||
const forwarded = useForwardPropsEmits(delegatedProps, emits) | ||
</script> | ||
|
||
<template> | ||
<ComboboxRoot | ||
v-bind="forwarded" | ||
:class="cn('flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground', props.class)" | ||
> | ||
<slot /> | ||
</ComboboxRoot> | ||
</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,21 @@ | ||
<script setup lang="ts"> | ||
import { useForwardPropsEmits } from 'radix-vue' | ||
import type { DialogRootEmits, DialogRootProps } from 'radix-vue' | ||
import Command from './Command.vue' | ||
import { Dialog, DialogContent } from '@/components/ui/dialog' | ||
const props = defineProps<DialogRootProps>() | ||
const emits = defineEmits<DialogRootEmits>() | ||
const forwarded = useForwardPropsEmits(props, emits) | ||
</script> | ||
|
||
<template> | ||
<Dialog v-bind="forwarded"> | ||
<DialogContent class="overflow-hidden p-0 shadow-lg"> | ||
<Command class="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5"> | ||
<slot /> | ||
</Command> | ||
</DialogContent> | ||
</Dialog> | ||
</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 setup lang="ts"> | ||
import { type HTMLAttributes, computed } from 'vue' | ||
import type { ComboboxEmptyProps } from 'radix-vue' | ||
import { ComboboxEmpty } from 'radix-vue' | ||
import { cn } from '@/lib/utils' | ||
const props = defineProps<ComboboxEmptyProps & { class?: HTMLAttributes['class'] }>() | ||
const delegatedProps = computed(() => { | ||
const { class: _, ...delegated } = props | ||
return delegated | ||
}) | ||
</script> | ||
|
||
<template> | ||
<ComboboxEmpty v-bind="delegatedProps" :class="cn('py-6 text-center text-sm', props.class)"> | ||
<slot /> | ||
</ComboboxEmpty> | ||
</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,29 @@ | ||
<script setup lang="ts"> | ||
import { type HTMLAttributes, computed } from 'vue' | ||
import type { ComboboxGroupProps } from 'radix-vue' | ||
import { ComboboxGroup, ComboboxLabel } from 'radix-vue' | ||
import { cn } from '@/lib/utils' | ||
const props = defineProps<ComboboxGroupProps & { | ||
class?: HTMLAttributes['class'] | ||
heading?: string | ||
}>() | ||
const delegatedProps = computed(() => { | ||
const { class: _, ...delegated } = props | ||
return delegated | ||
}) | ||
</script> | ||
|
||
<template> | ||
<ComboboxGroup | ||
v-bind="delegatedProps" | ||
:class="cn('overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground', props.class)" | ||
> | ||
<ComboboxLabel v-if="heading" class="px-2 py-1.5 text-xs font-medium text-muted-foreground"> | ||
{{ heading }} | ||
</ComboboxLabel> | ||
<slot /> | ||
</ComboboxGroup> | ||
</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,33 @@ | ||
<script setup lang="ts"> | ||
import { type HTMLAttributes, computed } from 'vue' | ||
import { MagnifyingGlassIcon } from '@radix-icons/vue' | ||
import { ComboboxInput, type ComboboxInputProps, useForwardProps } from 'radix-vue' | ||
import { cn } from '@/lib/utils' | ||
defineOptions({ | ||
inheritAttrs: false, | ||
}) | ||
const props = defineProps<ComboboxInputProps & { | ||
class?: HTMLAttributes['class'] | ||
}>() | ||
const delegatedProps = computed(() => { | ||
const { class: _, ...delegated } = props | ||
return delegated | ||
}) | ||
const forwardedProps = useForwardProps(delegatedProps) | ||
</script> | ||
|
||
<template> | ||
<div class="flex items-center border-b px-3" cmdk-input-wrapper> | ||
<MagnifyingGlassIcon class="mr-2 h-4 w-4 shrink-0 opacity-50" /> | ||
<ComboboxInput | ||
v-bind="{ ...forwardedProps, ...$attrs }" | ||
auto-focus | ||
:class="cn('flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50', props.class)" | ||
/> | ||
</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,26 @@ | ||
<script setup lang="ts"> | ||
import { type HTMLAttributes, computed } from 'vue' | ||
import type { ComboboxItemEmits, ComboboxItemProps } from 'radix-vue' | ||
import { ComboboxItem, useForwardPropsEmits } from 'radix-vue' | ||
import { cn } from '@/lib/utils' | ||
const props = defineProps<ComboboxItemProps & { class?: HTMLAttributes['class'] }>() | ||
const emits = defineEmits<ComboboxItemEmits>() | ||
const delegatedProps = computed(() => { | ||
const { class: _, ...delegated } = props | ||
return delegated | ||
}) | ||
const forwarded = useForwardPropsEmits(delegatedProps, emits) | ||
</script> | ||
|
||
<template> | ||
<ComboboxItem | ||
v-bind="forwarded" | ||
:class="cn('relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[highlighted]:bg-accent data-[disabled]:pointer-events-none data-[disabled]:opacity-50', props.class)" | ||
> | ||
<slot /> | ||
</ComboboxItem> | ||
</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,27 @@ | ||
<script setup lang="ts"> | ||
import { type HTMLAttributes, computed } from 'vue' | ||
import type { ComboboxContentEmits, ComboboxContentProps } from 'radix-vue' | ||
import { ComboboxContent, useForwardPropsEmits } from 'radix-vue' | ||
import { cn } from '@/lib/utils' | ||
const props = withDefaults(defineProps<ComboboxContentProps & { class?: HTMLAttributes['class'] }>(), { | ||
dismissable: false, | ||
}) | ||
const emits = defineEmits<ComboboxContentEmits>() | ||
const delegatedProps = computed(() => { | ||
const { class: _, ...delegated } = props | ||
return delegated | ||
}) | ||
const forwarded = useForwardPropsEmits(delegatedProps, emits) | ||
</script> | ||
|
||
<template> | ||
<ComboboxContent v-bind="forwarded" :class="cn('max-h-[300px] overflow-y-auto overflow-x-hidden', props.class)"> | ||
<div role="presentation"> | ||
<slot /> | ||
</div> | ||
</ComboboxContent> | ||
</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 setup lang="ts"> | ||
import { type HTMLAttributes, computed } from 'vue' | ||
import type { ComboboxSeparatorProps } from 'radix-vue' | ||
import { ComboboxSeparator } from 'radix-vue' | ||
import { cn } from '@/lib/utils' | ||
const props = defineProps<ComboboxSeparatorProps & { class?: HTMLAttributes['class'] }>() | ||
const delegatedProps = computed(() => { | ||
const { class: _, ...delegated } = props | ||
return delegated | ||
}) | ||
</script> | ||
|
||
<template> | ||
<ComboboxSeparator | ||
v-bind="delegatedProps" | ||
:class="cn('-mx-1 h-px bg-border', props.class)" | ||
> | ||
<slot /> | ||
</ComboboxSeparator> | ||
</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 text-muted-foreground', props.class)"> | ||
<slot /> | ||
</span> | ||
</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,9 @@ | ||
export { default as Command } from './Command.vue' | ||
export { default as CommandDialog } from './CommandDialog.vue' | ||
export { default as CommandEmpty } from './CommandEmpty.vue' | ||
export { default as CommandGroup } from './CommandGroup.vue' | ||
export { default as CommandInput } from './CommandInput.vue' | ||
export { default as CommandItem } from './CommandItem.vue' | ||
export { default as CommandList } from './CommandList.vue' | ||
export { default as CommandSeparator } from './CommandSeparator.vue' | ||
export { default as CommandShortcut } from './CommandShortcut.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,14 @@ | ||
<script setup lang="ts"> | ||
import { DialogRoot, type DialogRootEmits, type DialogRootProps, useForwardPropsEmits } from 'radix-vue' | ||
const props = defineProps<DialogRootProps>() | ||
const emits = defineEmits<DialogRootEmits>() | ||
const forwarded = useForwardPropsEmits(props, emits) | ||
</script> | ||
|
||
<template> | ||
<DialogRoot v-bind="forwarded"> | ||
<slot /> | ||
</DialogRoot> | ||
</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 { DialogClose, type DialogCloseProps } from 'radix-vue' | ||
const props = defineProps<DialogCloseProps>() | ||
</script> | ||
|
||
<template> | ||
<DialogClose v-bind="props"> | ||
<slot /> | ||
</DialogClose> | ||
</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,50 @@ | ||
<script setup lang="ts"> | ||
import { type HTMLAttributes, computed } from 'vue' | ||
import { | ||
DialogClose, | ||
DialogContent, | ||
type DialogContentEmits, | ||
type DialogContentProps, | ||
DialogOverlay, | ||
DialogPortal, | ||
useForwardPropsEmits, | ||
} from 'radix-vue' | ||
import { Cross2Icon } from '@radix-icons/vue' | ||
import { cn } from '@/lib/utils' | ||
const props = defineProps<DialogContentProps & { class?: HTMLAttributes['class'] }>() | ||
const emits = defineEmits<DialogContentEmits>() | ||
const delegatedProps = computed(() => { | ||
const { class: _, ...delegated } = props | ||
return delegated | ||
}) | ||
const forwarded = useForwardPropsEmits(delegatedProps, emits) | ||
</script> | ||
|
||
<template> | ||
<DialogPortal> | ||
<DialogOverlay | ||
class="fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0" | ||
/> | ||
<DialogContent | ||
v-bind="forwarded" | ||
:class=" | ||
cn( | ||
'fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg', | ||
props.class, | ||
)" | ||
> | ||
<slot /> | ||
|
||
<DialogClose | ||
class="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground" | ||
> | ||
<Cross2Icon class="w-4 h-4" /> | ||
<span class="sr-only">Close</span> | ||
</DialogClose> | ||
</DialogContent> | ||
</DialogPortal> | ||
</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 { DialogDescription, type DialogDescriptionProps, useForwardProps } from 'radix-vue' | ||
import { cn } from '@/lib/utils' | ||
const props = defineProps<DialogDescriptionProps & { class?: HTMLAttributes['class'] }>() | ||
const delegatedProps = computed(() => { | ||
const { class: _, ...delegated } = props | ||
return delegated | ||
}) | ||
const forwardedProps = useForwardProps(delegatedProps) | ||
</script> | ||
|
||
<template> | ||
<DialogDescription | ||
v-bind="forwardedProps" | ||
:class="cn('text-sm text-muted-foreground', props.class)" | ||
> | ||
<slot /> | ||
</DialogDescription> | ||
</template> |
Oops, something went wrong.