@sviy/ui 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +142 -2
- package/index.ts +61 -0
- package/package.json +44 -4
- package/src/components/ui/alert/Alert.vue +21 -0
- package/src/components/ui/alert/AlertAction.vue +17 -0
- package/src/components/ui/alert/AlertDescription.vue +17 -0
- package/src/components/ui/alert/AlertTitle.vue +17 -0
- package/src/components/ui/alert/index.ts +21 -0
- package/src/components/ui/avatar/Avatar.vue +22 -0
- package/src/components/ui/avatar/AvatarBadge.vue +23 -0
- package/src/components/ui/avatar/AvatarFallback.vue +21 -0
- package/src/components/ui/avatar/AvatarGroup.vue +20 -0
- package/src/components/ui/avatar/AvatarGroupCount.vue +20 -0
- package/src/components/ui/avatar/AvatarImage.vue +16 -0
- package/src/components/ui/avatar/index.ts +27 -0
- package/src/components/ui/badge/Badge.vue +27 -0
- package/src/components/ui/badge/index.ts +24 -0
- package/src/components/ui/button/Button.vue +31 -0
- package/src/components/ui/button/index.ts +35 -0
- package/src/components/ui/card/Card.vue +21 -0
- package/src/components/ui/card/CardAction.vue +17 -0
- package/src/components/ui/card/CardContent.vue +17 -0
- package/src/components/ui/card/CardDescription.vue +17 -0
- package/src/components/ui/card/CardFooter.vue +17 -0
- package/src/components/ui/card/CardHeader.vue +17 -0
- package/src/components/ui/card/CardTitle.vue +17 -0
- package/src/components/ui/card/index.ts +7 -0
- package/src/components/ui/checkbox/Checkbox.vue +34 -0
- package/src/components/ui/checkbox/index.ts +1 -0
- package/src/components/ui/dialog/Dialog.vue +19 -0
- package/src/components/ui/dialog/DialogClose.vue +15 -0
- package/src/components/ui/dialog/DialogContent.vue +53 -0
- package/src/components/ui/dialog/DialogDescription.vue +23 -0
- package/src/components/ui/dialog/DialogFooter.vue +27 -0
- package/src/components/ui/dialog/DialogHeader.vue +17 -0
- package/src/components/ui/dialog/DialogOverlay.vue +21 -0
- package/src/components/ui/dialog/DialogScrollContent.vue +60 -0
- package/src/components/ui/dialog/DialogTitle.vue +23 -0
- package/src/components/ui/dialog/DialogTrigger.vue +15 -0
- package/src/components/ui/dialog/index.ts +10 -0
- package/src/components/ui/dropdown-menu/DropdownMenu.vue +19 -0
- package/src/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +43 -0
- package/src/components/ui/dropdown-menu/DropdownMenuContent.vue +40 -0
- package/src/components/ui/dropdown-menu/DropdownMenuGroup.vue +15 -0
- package/src/components/ui/dropdown-menu/DropdownMenuItem.vue +31 -0
- package/src/components/ui/dropdown-menu/DropdownMenuLabel.vue +23 -0
- package/src/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +21 -0
- package/src/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +44 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSeparator.vue +23 -0
- package/src/components/ui/dropdown-menu/DropdownMenuShortcut.vue +17 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSub.vue +18 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSubContent.vue +27 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +32 -0
- package/src/components/ui/dropdown-menu/DropdownMenuTrigger.vue +17 -0
- package/src/components/ui/dropdown-menu/index.ts +16 -0
- package/src/components/ui/input/Input.vue +31 -0
- package/src/components/ui/input/index.ts +1 -0
- package/src/components/ui/label/Label.vue +26 -0
- package/src/components/ui/label/index.ts +1 -0
- package/src/components/ui/progress/Progress.vue +38 -0
- package/src/components/ui/progress/index.ts +1 -0
- package/src/components/ui/select/Select.vue +19 -0
- package/src/components/ui/select/SelectContent.vue +58 -0
- package/src/components/ui/select/SelectGroup.vue +21 -0
- package/src/components/ui/select/SelectItem.vue +45 -0
- package/src/components/ui/select/SelectItemText.vue +15 -0
- package/src/components/ui/select/SelectLabel.vue +17 -0
- package/src/components/ui/select/SelectScrollDownButton.vue +27 -0
- package/src/components/ui/select/SelectScrollUpButton.vue +27 -0
- package/src/components/ui/select/SelectSeparator.vue +19 -0
- package/src/components/ui/select/SelectTrigger.vue +34 -0
- package/src/components/ui/select/SelectValue.vue +15 -0
- package/src/components/ui/select/index.ts +11 -0
- package/src/components/ui/separator/Separator.vue +29 -0
- package/src/components/ui/separator/index.ts +1 -0
- package/src/components/ui/sonner/Sonner.vue +62 -0
- package/src/components/ui/sonner/index.ts +1 -0
- package/src/components/ui/switch/Switch.vue +44 -0
- package/src/components/ui/switch/index.ts +1 -0
- package/src/components/ui/table/Table.vue +16 -0
- package/src/components/ui/table/TableBody.vue +17 -0
- package/src/components/ui/table/TableCaption.vue +17 -0
- package/src/components/ui/table/TableCell.vue +17 -0
- package/src/components/ui/table/TableEmpty.vue +34 -0
- package/src/components/ui/table/TableFooter.vue +17 -0
- package/src/components/ui/table/TableHead.vue +17 -0
- package/src/components/ui/table/TableHeader.vue +17 -0
- package/src/components/ui/table/TableRow.vue +17 -0
- package/src/components/ui/table/index.ts +9 -0
- package/src/components/ui/tabs/Tabs.vue +25 -0
- package/src/components/ui/tabs/TabsContent.vue +21 -0
- package/src/components/ui/tabs/TabsList.vue +29 -0
- package/src/components/ui/tabs/TabsTrigger.vue +29 -0
- package/src/components/ui/tabs/index.ts +24 -0
- package/src/components/ui/textarea/Textarea.vue +28 -0
- package/src/components/ui/textarea/index.ts +1 -0
- package/src/components/ui/tooltip/Tooltip.vue +19 -0
- package/src/components/ui/tooltip/TooltipContent.vue +34 -0
- package/src/components/ui/tooltip/TooltipProvider.vue +14 -0
- package/src/components/ui/tooltip/TooltipTrigger.vue +15 -0
- package/src/components/ui/tooltip/index.ts +4 -0
- package/src/lib/utils.ts +1 -0
- package/theme.css +223 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuRadioItemEmits, DropdownMenuRadioItemProps } from 'reka-ui'
|
|
3
|
+
|
|
4
|
+
import type { HTMLAttributes } from 'vue'
|
|
5
|
+
import { CheckIcon } from '@lucide/vue'
|
|
6
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
7
|
+
import { cn } from 'cn'
|
|
8
|
+
import {
|
|
9
|
+
DropdownMenuItemIndicator,
|
|
10
|
+
DropdownMenuRadioItem,
|
|
11
|
+
useForwardPropsEmits,
|
|
12
|
+
} from 'reka-ui'
|
|
13
|
+
|
|
14
|
+
const props = defineProps<DropdownMenuRadioItemProps & { class?: HTMLAttributes['class'] }>()
|
|
15
|
+
|
|
16
|
+
const emits = defineEmits<DropdownMenuRadioItemEmits>()
|
|
17
|
+
|
|
18
|
+
const delegatedProps = reactiveOmit(props, 'class')
|
|
19
|
+
|
|
20
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<DropdownMenuRadioItem
|
|
25
|
+
data-slot="dropdown-menu-radio-item"
|
|
26
|
+
v-bind="forwarded"
|
|
27
|
+
:class="cn(
|
|
28
|
+
'focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm data-inset:pl-8 [&_svg:not([class*=size-])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0',
|
|
29
|
+
props.class,
|
|
30
|
+
)"
|
|
31
|
+
>
|
|
32
|
+
<span
|
|
33
|
+
class="absolute right-2 flex items-center justify-center pointer-events-none"
|
|
34
|
+
data-slot="dropdown-menu-radio-item-indicator"
|
|
35
|
+
>
|
|
36
|
+
<DropdownMenuItemIndicator>
|
|
37
|
+
<slot name="indicator-icon">
|
|
38
|
+
<CheckIcon />
|
|
39
|
+
</slot>
|
|
40
|
+
</DropdownMenuItemIndicator>
|
|
41
|
+
</span>
|
|
42
|
+
<slot />
|
|
43
|
+
</DropdownMenuRadioItem>
|
|
44
|
+
</template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuSeparatorProps } from 'reka-ui'
|
|
3
|
+
import type { HTMLAttributes } from 'vue'
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
5
|
+
import { cn } from 'cn'
|
|
6
|
+
import {
|
|
7
|
+
DropdownMenuSeparator,
|
|
8
|
+
} from 'reka-ui'
|
|
9
|
+
|
|
10
|
+
const props = defineProps<DropdownMenuSeparatorProps & {
|
|
11
|
+
class?: HTMLAttributes['class']
|
|
12
|
+
}>()
|
|
13
|
+
|
|
14
|
+
const delegatedProps = reactiveOmit(props, 'class')
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<DropdownMenuSeparator
|
|
19
|
+
data-slot="dropdown-menu-separator"
|
|
20
|
+
v-bind="delegatedProps"
|
|
21
|
+
:class="cn('bg-border -mx-1 my-1 h-px', props.class)"
|
|
22
|
+
/>
|
|
23
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from 'cn'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes['class']
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<span
|
|
12
|
+
data-slot="dropdown-menu-shortcut"
|
|
13
|
+
:class="cn('text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground ml-auto text-xs tracking-widest', props.class)"
|
|
14
|
+
>
|
|
15
|
+
<slot />
|
|
16
|
+
</span>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuSubEmits, DropdownMenuSubProps } from 'reka-ui'
|
|
3
|
+
import {
|
|
4
|
+
DropdownMenuSub,
|
|
5
|
+
useForwardPropsEmits,
|
|
6
|
+
} from 'reka-ui'
|
|
7
|
+
|
|
8
|
+
const props = defineProps<DropdownMenuSubProps>()
|
|
9
|
+
const emits = defineEmits<DropdownMenuSubEmits>()
|
|
10
|
+
|
|
11
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<DropdownMenuSub v-slot="slotProps" data-slot="dropdown-menu-sub" v-bind="forwarded">
|
|
16
|
+
<slot v-bind="slotProps" />
|
|
17
|
+
</DropdownMenuSub>
|
|
18
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuSubContentEmits, DropdownMenuSubContentProps } from 'reka-ui'
|
|
3
|
+
import type { HTMLAttributes } from 'vue'
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
5
|
+
import { cn } from 'cn'
|
|
6
|
+
import {
|
|
7
|
+
DropdownMenuSubContent,
|
|
8
|
+
useForwardPropsEmits,
|
|
9
|
+
} from 'reka-ui'
|
|
10
|
+
|
|
11
|
+
const props = defineProps<DropdownMenuSubContentProps & { class?: HTMLAttributes['class'] }>()
|
|
12
|
+
const emits = defineEmits<DropdownMenuSubContentEmits>()
|
|
13
|
+
|
|
14
|
+
const delegatedProps = reactiveOmit(props, 'class')
|
|
15
|
+
|
|
16
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<DropdownMenuSubContent
|
|
21
|
+
data-slot="dropdown-menu-sub-content"
|
|
22
|
+
v-bind="forwarded"
|
|
23
|
+
:class="cn('data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 bg-popover text-popover-foreground min-w-[96px] rounded-md p-1 shadow-lg ring-1 duration-100 cn-menu-translucent z-50 max-w-(--reka-dropdown-menu-content-available-width) origin-(--reka-dropdown-menu-content-transform-origin) overflow-hidden', props.class)"
|
|
24
|
+
>
|
|
25
|
+
<slot />
|
|
26
|
+
</DropdownMenuSubContent>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuSubTriggerProps } from 'reka-ui'
|
|
3
|
+
|
|
4
|
+
import type { HTMLAttributes } from 'vue'
|
|
5
|
+
import { ChevronRightIcon } from '@lucide/vue'
|
|
6
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
7
|
+
import { cn } from 'cn'
|
|
8
|
+
import {
|
|
9
|
+
DropdownMenuSubTrigger,
|
|
10
|
+
useForwardProps,
|
|
11
|
+
} from 'reka-ui'
|
|
12
|
+
|
|
13
|
+
const props = defineProps<DropdownMenuSubTriggerProps & { class?: HTMLAttributes['class'], inset?: boolean }>()
|
|
14
|
+
|
|
15
|
+
const delegatedProps = reactiveOmit(props, 'class', 'inset')
|
|
16
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<DropdownMenuSubTrigger
|
|
21
|
+
data-slot="dropdown-menu-sub-trigger"
|
|
22
|
+
:data-inset="inset ? '' : undefined"
|
|
23
|
+
v-bind="forwardedProps"
|
|
24
|
+
:class="cn(
|
|
25
|
+
'focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-sm px-2 py-1.5 text-sm data-inset:pl-8 [&_svg:not([class*=size-])]:size-4 flex cursor-default items-center outline-hidden select-none [&_svg]:pointer-events-none [&_svg]:shrink-0',
|
|
26
|
+
props.class,
|
|
27
|
+
)"
|
|
28
|
+
>
|
|
29
|
+
<slot />
|
|
30
|
+
<ChevronRightIcon class="cn-rtl-flip ml-auto" />
|
|
31
|
+
</DropdownMenuSubTrigger>
|
|
32
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuTriggerProps } from 'reka-ui'
|
|
3
|
+
import { DropdownMenuTrigger, useForwardProps } from 'reka-ui'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<DropdownMenuTriggerProps>()
|
|
6
|
+
|
|
7
|
+
const forwardedProps = useForwardProps(props)
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<DropdownMenuTrigger
|
|
12
|
+
data-slot="dropdown-menu-trigger"
|
|
13
|
+
v-bind="forwardedProps"
|
|
14
|
+
>
|
|
15
|
+
<slot />
|
|
16
|
+
</DropdownMenuTrigger>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { default as DropdownMenu } from './DropdownMenu.vue'
|
|
2
|
+
|
|
3
|
+
export { default as DropdownMenuCheckboxItem } from './DropdownMenuCheckboxItem.vue'
|
|
4
|
+
export { default as DropdownMenuContent } from './DropdownMenuContent.vue'
|
|
5
|
+
export { default as DropdownMenuGroup } from './DropdownMenuGroup.vue'
|
|
6
|
+
export { default as DropdownMenuItem } from './DropdownMenuItem.vue'
|
|
7
|
+
export { default as DropdownMenuLabel } from './DropdownMenuLabel.vue'
|
|
8
|
+
export { default as DropdownMenuRadioGroup } from './DropdownMenuRadioGroup.vue'
|
|
9
|
+
export { default as DropdownMenuRadioItem } from './DropdownMenuRadioItem.vue'
|
|
10
|
+
export { default as DropdownMenuSeparator } from './DropdownMenuSeparator.vue'
|
|
11
|
+
export { default as DropdownMenuShortcut } from './DropdownMenuShortcut.vue'
|
|
12
|
+
export { default as DropdownMenuSub } from './DropdownMenuSub.vue'
|
|
13
|
+
export { default as DropdownMenuSubContent } from './DropdownMenuSubContent.vue'
|
|
14
|
+
export { default as DropdownMenuSubTrigger } from './DropdownMenuSubTrigger.vue'
|
|
15
|
+
export { default as DropdownMenuTrigger } from './DropdownMenuTrigger.vue'
|
|
16
|
+
export { DropdownMenuPortal } from 'reka-ui'
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { useVModel } from '@vueuse/core'
|
|
4
|
+
import { cn } from 'cn'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{
|
|
7
|
+
defaultValue?: string | number
|
|
8
|
+
modelValue?: string | number
|
|
9
|
+
class?: HTMLAttributes['class']
|
|
10
|
+
}>()
|
|
11
|
+
|
|
12
|
+
const emits = defineEmits<{
|
|
13
|
+
(e: 'update:modelValue', payload: string | number): void
|
|
14
|
+
}>()
|
|
15
|
+
|
|
16
|
+
const modelValue = useVModel(props, 'modelValue', emits, {
|
|
17
|
+
passive: true,
|
|
18
|
+
defaultValue: props.defaultValue,
|
|
19
|
+
})
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<input
|
|
24
|
+
v-model="modelValue"
|
|
25
|
+
data-slot="input"
|
|
26
|
+
:class="cn(
|
|
27
|
+
'dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-9 rounded-md border bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] file:h-7 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 md:text-sm w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
|
|
28
|
+
props.class,
|
|
29
|
+
)"
|
|
30
|
+
>
|
|
31
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Input } from './Input.vue'
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { LabelProps } from 'reka-ui'
|
|
3
|
+
import type { HTMLAttributes } from 'vue'
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
5
|
+
import { cn } from 'cn'
|
|
6
|
+
import { Label } from 'reka-ui'
|
|
7
|
+
|
|
8
|
+
const props = defineProps<LabelProps & { class?: HTMLAttributes['class'] }>()
|
|
9
|
+
|
|
10
|
+
const delegatedProps = reactiveOmit(props, 'class')
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<Label
|
|
15
|
+
data-slot="label"
|
|
16
|
+
v-bind="delegatedProps"
|
|
17
|
+
:class="
|
|
18
|
+
cn(
|
|
19
|
+
'gap-2 text-sm leading-none font-medium group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed',
|
|
20
|
+
props.class,
|
|
21
|
+
)
|
|
22
|
+
"
|
|
23
|
+
>
|
|
24
|
+
<slot />
|
|
25
|
+
</Label>
|
|
26
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Label } from './Label.vue'
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ProgressRootProps } from 'reka-ui'
|
|
3
|
+
import type { HTMLAttributes } from 'vue'
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
5
|
+
import { cn } from 'cn'
|
|
6
|
+
import {
|
|
7
|
+
ProgressIndicator,
|
|
8
|
+
ProgressRoot,
|
|
9
|
+
} from 'reka-ui'
|
|
10
|
+
|
|
11
|
+
const props = withDefaults(
|
|
12
|
+
defineProps<ProgressRootProps & { class?: HTMLAttributes['class'] }>(),
|
|
13
|
+
{
|
|
14
|
+
modelValue: 0,
|
|
15
|
+
},
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
const delegatedProps = reactiveOmit(props, 'class')
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<ProgressRoot
|
|
23
|
+
data-slot="progress"
|
|
24
|
+
v-bind="delegatedProps"
|
|
25
|
+
:class="
|
|
26
|
+
cn(
|
|
27
|
+
'bg-muted h-1.5 rounded-full relative flex w-full items-center overflow-x-hidden',
|
|
28
|
+
props.class,
|
|
29
|
+
)
|
|
30
|
+
"
|
|
31
|
+
>
|
|
32
|
+
<ProgressIndicator
|
|
33
|
+
data-slot="progress-indicator"
|
|
34
|
+
class="bg-primary size-full flex-1 transition-all"
|
|
35
|
+
:style="`transform: translateX(-${100 - (props.modelValue ?? 0)}%);`"
|
|
36
|
+
/>
|
|
37
|
+
</ProgressRoot>
|
|
38
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Progress } from './Progress.vue'
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectRootEmits, SelectRootProps } from 'reka-ui'
|
|
3
|
+
import { SelectRoot, useForwardPropsEmits } from 'reka-ui'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<SelectRootProps>()
|
|
6
|
+
const emits = defineEmits<SelectRootEmits>()
|
|
7
|
+
|
|
8
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<SelectRoot
|
|
13
|
+
v-slot="slotProps"
|
|
14
|
+
data-slot="select"
|
|
15
|
+
v-bind="forwarded"
|
|
16
|
+
>
|
|
17
|
+
<slot v-bind="slotProps" />
|
|
18
|
+
</SelectRoot>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectContentEmits, SelectContentProps } from 'reka-ui'
|
|
3
|
+
import type { HTMLAttributes } from 'vue'
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
5
|
+
import { cn } from 'cn'
|
|
6
|
+
import {
|
|
7
|
+
SelectContent,
|
|
8
|
+
SelectPortal,
|
|
9
|
+
SelectViewport,
|
|
10
|
+
useForwardPropsEmits,
|
|
11
|
+
} from 'reka-ui'
|
|
12
|
+
import { SelectScrollDownButton, SelectScrollUpButton } from '.'
|
|
13
|
+
|
|
14
|
+
defineOptions({
|
|
15
|
+
inheritAttrs: false,
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
const props = withDefaults(
|
|
19
|
+
defineProps<SelectContentProps & { class?: HTMLAttributes['class'] }>(),
|
|
20
|
+
{
|
|
21
|
+
position: 'item-aligned',
|
|
22
|
+
align: 'center',
|
|
23
|
+
},
|
|
24
|
+
)
|
|
25
|
+
const emits = defineEmits<SelectContentEmits>()
|
|
26
|
+
|
|
27
|
+
const delegatedProps = reactiveOmit(props, 'class')
|
|
28
|
+
|
|
29
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<template>
|
|
33
|
+
<SelectPortal>
|
|
34
|
+
<SelectContent
|
|
35
|
+
data-slot="select-content"
|
|
36
|
+
:data-align-trigger="position === 'item-aligned'"
|
|
37
|
+
v-bind="{ ...$attrs, ...forwarded }"
|
|
38
|
+
:class="cn(
|
|
39
|
+
'bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 min-w-36 rounded-md shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 cn-menu-translucent relative z-50 max-h-(--reka-select-content-available-height) origin-(--reka-select-content-transform-origin) overflow-x-hidden overflow-y-auto data-[align-trigger=true]:animate-none',
|
|
40
|
+
position === 'popper'
|
|
41
|
+
&& 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
|
|
42
|
+
props.class,
|
|
43
|
+
)
|
|
44
|
+
"
|
|
45
|
+
>
|
|
46
|
+
<SelectScrollUpButton />
|
|
47
|
+
<SelectViewport
|
|
48
|
+
:data-position="position"
|
|
49
|
+
:class="cn(
|
|
50
|
+
'data-[position=popper]:h-(--reka-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--reka-select-trigger-width)',
|
|
51
|
+
)"
|
|
52
|
+
>
|
|
53
|
+
<slot />
|
|
54
|
+
</SelectViewport>
|
|
55
|
+
<SelectScrollDownButton />
|
|
56
|
+
</SelectContent>
|
|
57
|
+
</SelectPortal>
|
|
58
|
+
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectGroupProps } from 'reka-ui'
|
|
3
|
+
import type { HTMLAttributes } from 'vue'
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
5
|
+
import { cn } from 'cn'
|
|
6
|
+
import { SelectGroup } from 'reka-ui'
|
|
7
|
+
|
|
8
|
+
const props = defineProps<SelectGroupProps & { class?: HTMLAttributes['class'] }>()
|
|
9
|
+
|
|
10
|
+
const delegatedProps = reactiveOmit(props, 'class')
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<SelectGroup
|
|
15
|
+
data-slot="select-group"
|
|
16
|
+
v-bind="delegatedProps"
|
|
17
|
+
:class="cn('scroll-my-1 p-1', props.class)"
|
|
18
|
+
>
|
|
19
|
+
<slot />
|
|
20
|
+
</SelectGroup>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectItemProps } from 'reka-ui'
|
|
3
|
+
|
|
4
|
+
import type { HTMLAttributes } from 'vue'
|
|
5
|
+
import { CheckIcon } from '@lucide/vue'
|
|
6
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
7
|
+
import { cn } from 'cn'
|
|
8
|
+
import {
|
|
9
|
+
SelectItem,
|
|
10
|
+
SelectItemIndicator,
|
|
11
|
+
SelectItemText,
|
|
12
|
+
useForwardProps,
|
|
13
|
+
} from 'reka-ui'
|
|
14
|
+
|
|
15
|
+
const props = defineProps<SelectItemProps & { class?: HTMLAttributes['class'] }>()
|
|
16
|
+
|
|
17
|
+
const delegatedProps = reactiveOmit(props, 'class')
|
|
18
|
+
|
|
19
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<SelectItem
|
|
24
|
+
data-slot="select-item"
|
|
25
|
+
v-bind="forwardedProps"
|
|
26
|
+
:class="
|
|
27
|
+
cn(
|
|
28
|
+
'focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm [&_svg:not([class*=size-])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0',
|
|
29
|
+
props.class,
|
|
30
|
+
)
|
|
31
|
+
"
|
|
32
|
+
>
|
|
33
|
+
<span class="pointer-events-none absolute right-2 flex size-4 items-center justify-center">
|
|
34
|
+
<SelectItemIndicator>
|
|
35
|
+
<slot name="indicator-icon">
|
|
36
|
+
<CheckIcon class="pointer-events-none" />
|
|
37
|
+
</slot>
|
|
38
|
+
</SelectItemIndicator>
|
|
39
|
+
</span>
|
|
40
|
+
|
|
41
|
+
<SelectItemText>
|
|
42
|
+
<slot />
|
|
43
|
+
</SelectItemText>
|
|
44
|
+
</SelectItem>
|
|
45
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectItemTextProps } from 'reka-ui'
|
|
3
|
+
import { SelectItemText } from 'reka-ui'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<SelectItemTextProps>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<SelectItemText
|
|
10
|
+
data-slot="select-item-text"
|
|
11
|
+
v-bind="props"
|
|
12
|
+
>
|
|
13
|
+
<slot />
|
|
14
|
+
</SelectItemText>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectLabelProps } from 'reka-ui'
|
|
3
|
+
import type { HTMLAttributes } from 'vue'
|
|
4
|
+
import { cn } from 'cn'
|
|
5
|
+
import { SelectLabel } from 'reka-ui'
|
|
6
|
+
|
|
7
|
+
const props = defineProps<SelectLabelProps & { class?: HTMLAttributes['class'] }>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<SelectLabel
|
|
12
|
+
data-slot="select-label"
|
|
13
|
+
:class="cn('text-muted-foreground px-2 py-1.5 text-xs', props.class)"
|
|
14
|
+
>
|
|
15
|
+
<slot />
|
|
16
|
+
</SelectLabel>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectScrollDownButtonProps } from 'reka-ui'
|
|
3
|
+
|
|
4
|
+
import type { HTMLAttributes } from 'vue'
|
|
5
|
+
import { ChevronDownIcon } from '@lucide/vue'
|
|
6
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
7
|
+
import { cn } from 'cn'
|
|
8
|
+
import { SelectScrollDownButton, useForwardProps } from 'reka-ui'
|
|
9
|
+
|
|
10
|
+
const props = defineProps<SelectScrollDownButtonProps & { class?: HTMLAttributes['class'] }>()
|
|
11
|
+
|
|
12
|
+
const delegatedProps = reactiveOmit(props, 'class')
|
|
13
|
+
|
|
14
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<SelectScrollDownButton
|
|
19
|
+
data-slot="select-scroll-down-button"
|
|
20
|
+
v-bind="forwardedProps"
|
|
21
|
+
:class="cn('bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*=size-])]:size-4', props.class)"
|
|
22
|
+
>
|
|
23
|
+
<slot>
|
|
24
|
+
<ChevronDownIcon />
|
|
25
|
+
</slot>
|
|
26
|
+
</SelectScrollDownButton>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectScrollUpButtonProps } from 'reka-ui'
|
|
3
|
+
|
|
4
|
+
import type { HTMLAttributes } from 'vue'
|
|
5
|
+
import { ChevronUpIcon } from '@lucide/vue'
|
|
6
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
7
|
+
import { cn } from 'cn'
|
|
8
|
+
import { SelectScrollUpButton, useForwardProps } from 'reka-ui'
|
|
9
|
+
|
|
10
|
+
const props = defineProps<SelectScrollUpButtonProps & { class?: HTMLAttributes['class'] }>()
|
|
11
|
+
|
|
12
|
+
const delegatedProps = reactiveOmit(props, 'class')
|
|
13
|
+
|
|
14
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<SelectScrollUpButton
|
|
19
|
+
data-slot="select-scroll-up-button"
|
|
20
|
+
v-bind="forwardedProps"
|
|
21
|
+
:class="cn('bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*=size-])]:size-4', props.class)"
|
|
22
|
+
>
|
|
23
|
+
<slot>
|
|
24
|
+
<ChevronUpIcon />
|
|
25
|
+
</slot>
|
|
26
|
+
</SelectScrollUpButton>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectSeparatorProps } from 'reka-ui'
|
|
3
|
+
import type { HTMLAttributes } from 'vue'
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
5
|
+
import { cn } from 'cn'
|
|
6
|
+
import { SelectSeparator } from 'reka-ui'
|
|
7
|
+
|
|
8
|
+
const props = defineProps<SelectSeparatorProps & { class?: HTMLAttributes['class'] }>()
|
|
9
|
+
|
|
10
|
+
const delegatedProps = reactiveOmit(props, 'class')
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<SelectSeparator
|
|
15
|
+
data-slot="select-separator"
|
|
16
|
+
v-bind="delegatedProps"
|
|
17
|
+
:class="cn('bg-border -mx-1 my-1 h-px pointer-events-none', props.class)"
|
|
18
|
+
/>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectTriggerProps } from 'reka-ui'
|
|
3
|
+
|
|
4
|
+
import type { HTMLAttributes } from 'vue'
|
|
5
|
+
import { ChevronDownIcon } from '@lucide/vue'
|
|
6
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
7
|
+
import { cn } from 'cn'
|
|
8
|
+
import { SelectIcon, SelectTrigger, useForwardProps } from 'reka-ui'
|
|
9
|
+
|
|
10
|
+
const props = withDefaults(
|
|
11
|
+
defineProps<SelectTriggerProps & { class?: HTMLAttributes['class'], size?: 'sm' | 'default' }>(),
|
|
12
|
+
{ size: 'default' },
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
const delegatedProps = reactiveOmit(props, 'class', 'size')
|
|
16
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<SelectTrigger
|
|
21
|
+
data-slot="select-trigger"
|
|
22
|
+
:data-size="size"
|
|
23
|
+
v-bind="forwardedProps"
|
|
24
|
+
:class="cn(
|
|
25
|
+
'border-input data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-md border bg-transparent py-2 pr-2 pl-2.5 text-sm shadow-xs transition-[color,box-shadow] focus-visible:ring-3 aria-invalid:ring-3 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*=size-])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0',
|
|
26
|
+
props.class,
|
|
27
|
+
)"
|
|
28
|
+
>
|
|
29
|
+
<slot />
|
|
30
|
+
<SelectIcon as-child>
|
|
31
|
+
<ChevronDownIcon class="text-muted-foreground size-4 pointer-events-none" />
|
|
32
|
+
</SelectIcon>
|
|
33
|
+
</SelectTrigger>
|
|
34
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectValueProps } from 'reka-ui'
|
|
3
|
+
import { SelectValue } from 'reka-ui'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<SelectValueProps>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<SelectValue
|
|
10
|
+
data-slot="select-value"
|
|
11
|
+
v-bind="props"
|
|
12
|
+
>
|
|
13
|
+
<slot />
|
|
14
|
+
</SelectValue>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { default as Select } from './Select.vue'
|
|
2
|
+
export { default as SelectContent } from './SelectContent.vue'
|
|
3
|
+
export { default as SelectGroup } from './SelectGroup.vue'
|
|
4
|
+
export { default as SelectItem } from './SelectItem.vue'
|
|
5
|
+
export { default as SelectItemText } from './SelectItemText.vue'
|
|
6
|
+
export { default as SelectLabel } from './SelectLabel.vue'
|
|
7
|
+
export { default as SelectScrollDownButton } from './SelectScrollDownButton.vue'
|
|
8
|
+
export { default as SelectScrollUpButton } from './SelectScrollUpButton.vue'
|
|
9
|
+
export { default as SelectSeparator } from './SelectSeparator.vue'
|
|
10
|
+
export { default as SelectTrigger } from './SelectTrigger.vue'
|
|
11
|
+
export { default as SelectValue } from './SelectValue.vue'
|