@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.
Files changed (103) hide show
  1. package/README.md +142 -2
  2. package/index.ts +61 -0
  3. package/package.json +44 -4
  4. package/src/components/ui/alert/Alert.vue +21 -0
  5. package/src/components/ui/alert/AlertAction.vue +17 -0
  6. package/src/components/ui/alert/AlertDescription.vue +17 -0
  7. package/src/components/ui/alert/AlertTitle.vue +17 -0
  8. package/src/components/ui/alert/index.ts +21 -0
  9. package/src/components/ui/avatar/Avatar.vue +22 -0
  10. package/src/components/ui/avatar/AvatarBadge.vue +23 -0
  11. package/src/components/ui/avatar/AvatarFallback.vue +21 -0
  12. package/src/components/ui/avatar/AvatarGroup.vue +20 -0
  13. package/src/components/ui/avatar/AvatarGroupCount.vue +20 -0
  14. package/src/components/ui/avatar/AvatarImage.vue +16 -0
  15. package/src/components/ui/avatar/index.ts +27 -0
  16. package/src/components/ui/badge/Badge.vue +27 -0
  17. package/src/components/ui/badge/index.ts +24 -0
  18. package/src/components/ui/button/Button.vue +31 -0
  19. package/src/components/ui/button/index.ts +35 -0
  20. package/src/components/ui/card/Card.vue +21 -0
  21. package/src/components/ui/card/CardAction.vue +17 -0
  22. package/src/components/ui/card/CardContent.vue +17 -0
  23. package/src/components/ui/card/CardDescription.vue +17 -0
  24. package/src/components/ui/card/CardFooter.vue +17 -0
  25. package/src/components/ui/card/CardHeader.vue +17 -0
  26. package/src/components/ui/card/CardTitle.vue +17 -0
  27. package/src/components/ui/card/index.ts +7 -0
  28. package/src/components/ui/checkbox/Checkbox.vue +34 -0
  29. package/src/components/ui/checkbox/index.ts +1 -0
  30. package/src/components/ui/dialog/Dialog.vue +19 -0
  31. package/src/components/ui/dialog/DialogClose.vue +15 -0
  32. package/src/components/ui/dialog/DialogContent.vue +53 -0
  33. package/src/components/ui/dialog/DialogDescription.vue +23 -0
  34. package/src/components/ui/dialog/DialogFooter.vue +27 -0
  35. package/src/components/ui/dialog/DialogHeader.vue +17 -0
  36. package/src/components/ui/dialog/DialogOverlay.vue +21 -0
  37. package/src/components/ui/dialog/DialogScrollContent.vue +60 -0
  38. package/src/components/ui/dialog/DialogTitle.vue +23 -0
  39. package/src/components/ui/dialog/DialogTrigger.vue +15 -0
  40. package/src/components/ui/dialog/index.ts +10 -0
  41. package/src/components/ui/dropdown-menu/DropdownMenu.vue +19 -0
  42. package/src/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +43 -0
  43. package/src/components/ui/dropdown-menu/DropdownMenuContent.vue +40 -0
  44. package/src/components/ui/dropdown-menu/DropdownMenuGroup.vue +15 -0
  45. package/src/components/ui/dropdown-menu/DropdownMenuItem.vue +31 -0
  46. package/src/components/ui/dropdown-menu/DropdownMenuLabel.vue +23 -0
  47. package/src/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +21 -0
  48. package/src/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +44 -0
  49. package/src/components/ui/dropdown-menu/DropdownMenuSeparator.vue +23 -0
  50. package/src/components/ui/dropdown-menu/DropdownMenuShortcut.vue +17 -0
  51. package/src/components/ui/dropdown-menu/DropdownMenuSub.vue +18 -0
  52. package/src/components/ui/dropdown-menu/DropdownMenuSubContent.vue +27 -0
  53. package/src/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +32 -0
  54. package/src/components/ui/dropdown-menu/DropdownMenuTrigger.vue +17 -0
  55. package/src/components/ui/dropdown-menu/index.ts +16 -0
  56. package/src/components/ui/input/Input.vue +31 -0
  57. package/src/components/ui/input/index.ts +1 -0
  58. package/src/components/ui/label/Label.vue +26 -0
  59. package/src/components/ui/label/index.ts +1 -0
  60. package/src/components/ui/progress/Progress.vue +38 -0
  61. package/src/components/ui/progress/index.ts +1 -0
  62. package/src/components/ui/select/Select.vue +19 -0
  63. package/src/components/ui/select/SelectContent.vue +58 -0
  64. package/src/components/ui/select/SelectGroup.vue +21 -0
  65. package/src/components/ui/select/SelectItem.vue +45 -0
  66. package/src/components/ui/select/SelectItemText.vue +15 -0
  67. package/src/components/ui/select/SelectLabel.vue +17 -0
  68. package/src/components/ui/select/SelectScrollDownButton.vue +27 -0
  69. package/src/components/ui/select/SelectScrollUpButton.vue +27 -0
  70. package/src/components/ui/select/SelectSeparator.vue +19 -0
  71. package/src/components/ui/select/SelectTrigger.vue +34 -0
  72. package/src/components/ui/select/SelectValue.vue +15 -0
  73. package/src/components/ui/select/index.ts +11 -0
  74. package/src/components/ui/separator/Separator.vue +29 -0
  75. package/src/components/ui/separator/index.ts +1 -0
  76. package/src/components/ui/sonner/Sonner.vue +62 -0
  77. package/src/components/ui/sonner/index.ts +1 -0
  78. package/src/components/ui/switch/Switch.vue +44 -0
  79. package/src/components/ui/switch/index.ts +1 -0
  80. package/src/components/ui/table/Table.vue +16 -0
  81. package/src/components/ui/table/TableBody.vue +17 -0
  82. package/src/components/ui/table/TableCaption.vue +17 -0
  83. package/src/components/ui/table/TableCell.vue +17 -0
  84. package/src/components/ui/table/TableEmpty.vue +34 -0
  85. package/src/components/ui/table/TableFooter.vue +17 -0
  86. package/src/components/ui/table/TableHead.vue +17 -0
  87. package/src/components/ui/table/TableHeader.vue +17 -0
  88. package/src/components/ui/table/TableRow.vue +17 -0
  89. package/src/components/ui/table/index.ts +9 -0
  90. package/src/components/ui/tabs/Tabs.vue +25 -0
  91. package/src/components/ui/tabs/TabsContent.vue +21 -0
  92. package/src/components/ui/tabs/TabsList.vue +29 -0
  93. package/src/components/ui/tabs/TabsTrigger.vue +29 -0
  94. package/src/components/ui/tabs/index.ts +24 -0
  95. package/src/components/ui/textarea/Textarea.vue +28 -0
  96. package/src/components/ui/textarea/index.ts +1 -0
  97. package/src/components/ui/tooltip/Tooltip.vue +19 -0
  98. package/src/components/ui/tooltip/TooltipContent.vue +34 -0
  99. package/src/components/ui/tooltip/TooltipProvider.vue +14 -0
  100. package/src/components/ui/tooltip/TooltipTrigger.vue +15 -0
  101. package/src/components/ui/tooltip/index.ts +4 -0
  102. package/src/lib/utils.ts +1 -0
  103. package/theme.css +223 -0
@@ -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
+ <div
12
+ data-slot="card-action"
13
+ :class="cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', props.class)"
14
+ >
15
+ <slot />
16
+ </div>
17
+ </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
+ <div
12
+ data-slot="card-content"
13
+ :class="cn('px-6 group-data-[size=sm]/card:px-4', props.class)"
14
+ >
15
+ <slot />
16
+ </div>
17
+ </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
+ <div
12
+ data-slot="card-description"
13
+ :class="cn('text-muted-foreground text-sm', props.class)"
14
+ >
15
+ <slot />
16
+ </div>
17
+ </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
+ <div
12
+ data-slot="card-footer"
13
+ :class="cn('rounded-b-xl px-6 group-data-[size=sm]/card:px-4 [.border-t]:pt-6 group-data-[size=sm]/card:[.border-t]:pt-4 flex items-center', props.class)"
14
+ >
15
+ <slot />
16
+ </div>
17
+ </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
+ <div
12
+ data-slot="card-header"
13
+ :class="cn('gap-1 rounded-t-xl px-6 group-data-[size=sm]/card:px-4 [.border-b]:pb-6 group-data-[size=sm]/card:[.border-b]:pb-4 group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]', props.class)"
14
+ >
15
+ <slot />
16
+ </div>
17
+ </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
+ <div
12
+ data-slot="card-title"
13
+ :class="cn('text-base leading-normal font-medium group-data-[size=sm]/card:text-sm cn-font-heading', props.class)"
14
+ >
15
+ <slot />
16
+ </div>
17
+ </template>
@@ -0,0 +1,7 @@
1
+ export { default as Card } from './Card.vue'
2
+ export { default as CardAction } from './CardAction.vue'
3
+ export { default as CardContent } from './CardContent.vue'
4
+ export { default as CardDescription } from './CardDescription.vue'
5
+ export { default as CardFooter } from './CardFooter.vue'
6
+ export { default as CardHeader } from './CardHeader.vue'
7
+ export { default as CardTitle } from './CardTitle.vue'
@@ -0,0 +1,34 @@
1
+ <script setup lang="ts">
2
+ import type { CheckboxRootEmits, CheckboxRootProps } 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 { CheckboxIndicator, CheckboxRoot, useForwardPropsEmits } from 'reka-ui'
9
+
10
+ const props = defineProps<CheckboxRootProps & { class?: HTMLAttributes['class'] }>()
11
+ const emits = defineEmits<CheckboxRootEmits>()
12
+
13
+ const delegatedProps = reactiveOmit(props, 'class')
14
+
15
+ const forwarded = useForwardPropsEmits(delegatedProps, emits)
16
+ </script>
17
+
18
+ <template>
19
+ <CheckboxRoot
20
+ v-slot="slotProps"
21
+ data-slot="checkbox"
22
+ v-bind="forwarded"
23
+ :class="cn('border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 flex size-4 items-center justify-center rounded-[4px] border shadow-xs transition-shadow group-has-disabled/field:opacity-50 focus-visible:ring-3 aria-invalid:ring-3 peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50', props.class)"
24
+ >
25
+ <CheckboxIndicator
26
+ data-slot="checkbox-indicator"
27
+ class="[&>svg]:size-3.5 grid place-content-center text-current transition-none"
28
+ >
29
+ <slot v-bind="slotProps">
30
+ <CheckIcon />
31
+ </slot>
32
+ </CheckboxIndicator>
33
+ </CheckboxRoot>
34
+ </template>
@@ -0,0 +1 @@
1
+ export { default as Checkbox } from './Checkbox.vue'
@@ -0,0 +1,19 @@
1
+ <script setup lang="ts">
2
+ import type { DialogRootEmits, DialogRootProps } from 'reka-ui'
3
+ import { DialogRoot, useForwardPropsEmits } from 'reka-ui'
4
+
5
+ const props = defineProps<DialogRootProps>()
6
+ const emits = defineEmits<DialogRootEmits>()
7
+
8
+ const forwarded = useForwardPropsEmits(props, emits)
9
+ </script>
10
+
11
+ <template>
12
+ <DialogRoot
13
+ v-slot="slotProps"
14
+ data-slot="dialog"
15
+ v-bind="forwarded"
16
+ >
17
+ <slot v-bind="slotProps" />
18
+ </DialogRoot>
19
+ </template>
@@ -0,0 +1,15 @@
1
+ <script setup lang="ts">
2
+ import type { DialogCloseProps } from 'reka-ui'
3
+ import { DialogClose } from 'reka-ui'
4
+
5
+ const props = defineProps<DialogCloseProps>()
6
+ </script>
7
+
8
+ <template>
9
+ <DialogClose
10
+ data-slot="dialog-close"
11
+ v-bind="props"
12
+ >
13
+ <slot />
14
+ </DialogClose>
15
+ </template>
@@ -0,0 +1,53 @@
1
+ <script setup lang="ts">
2
+ import type { DialogContentEmits, DialogContentProps } from 'reka-ui'
3
+
4
+ import type { HTMLAttributes } from 'vue'
5
+ import { XIcon } from '@lucide/vue'
6
+ import { reactiveOmit } from '@vueuse/core'
7
+ import { cn } from 'cn'
8
+ import {
9
+ DialogClose,
10
+ DialogContent,
11
+ DialogPortal,
12
+ useForwardPropsEmits,
13
+ } from 'reka-ui'
14
+ import { Button } from '../button'
15
+ import DialogOverlay from './DialogOverlay.vue'
16
+
17
+ defineOptions({
18
+ inheritAttrs: false,
19
+ })
20
+
21
+ const props = withDefaults(defineProps<DialogContentProps & { class?: HTMLAttributes['class'], showCloseButton?: boolean }>(), {
22
+ showCloseButton: true,
23
+ })
24
+ const emits = defineEmits<DialogContentEmits>()
25
+
26
+ const delegatedProps = reactiveOmit(props, 'class')
27
+
28
+ const forwarded = useForwardPropsEmits(delegatedProps, emits)
29
+ </script>
30
+
31
+ <template>
32
+ <DialogPortal>
33
+ <DialogOverlay />
34
+ <DialogContent
35
+ data-slot="dialog-content"
36
+ v-bind="{ ...$attrs, ...forwarded }"
37
+ :class="cn('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 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-6 rounded-xl p-6 text-sm ring-1 duration-100 sm:max-w-md fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none', props.class)"
38
+ >
39
+ <slot />
40
+
41
+ <DialogClose
42
+ v-if="showCloseButton"
43
+ data-slot="dialog-close"
44
+ as-child
45
+ >
46
+ <Button variant="ghost" class="absolute top-4 right-4" size="icon-sm">
47
+ <XIcon />
48
+ <span class="sr-only">Close</span>
49
+ </Button>
50
+ </DialogClose>
51
+ </DialogContent>
52
+ </DialogPortal>
53
+ </template>
@@ -0,0 +1,23 @@
1
+ <script setup lang="ts">
2
+ import type { DialogDescriptionProps } from 'reka-ui'
3
+ import type { HTMLAttributes } from 'vue'
4
+ import { reactiveOmit } from '@vueuse/core'
5
+ import { cn } from 'cn'
6
+ import { DialogDescription, useForwardProps } from 'reka-ui'
7
+
8
+ const props = defineProps<DialogDescriptionProps & { class?: HTMLAttributes['class'] }>()
9
+
10
+ const delegatedProps = reactiveOmit(props, 'class')
11
+
12
+ const forwardedProps = useForwardProps(delegatedProps)
13
+ </script>
14
+
15
+ <template>
16
+ <DialogDescription
17
+ data-slot="dialog-description"
18
+ v-bind="forwardedProps"
19
+ :class="cn('text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3', props.class)"
20
+ >
21
+ <slot />
22
+ </DialogDescription>
23
+ </template>
@@ -0,0 +1,27 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from 'vue'
3
+ import { cn } from 'cn'
4
+ import { DialogClose } from 'reka-ui'
5
+ import { Button } from '../button'
6
+
7
+ const props = withDefaults(defineProps<{
8
+ class?: HTMLAttributes['class']
9
+ showCloseButton?: boolean
10
+ }>(), {
11
+ showCloseButton: false,
12
+ })
13
+ </script>
14
+
15
+ <template>
16
+ <div
17
+ data-slot="dialog-footer"
18
+ :class="cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', props.class)"
19
+ >
20
+ <slot />
21
+ <DialogClose v-if="showCloseButton" as-child>
22
+ <Button variant="outline">
23
+ Close
24
+ </Button>
25
+ </DialogClose>
26
+ </div>
27
+ </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
+ <div
12
+ data-slot="dialog-header"
13
+ :class="cn('gap-2 flex flex-col', props.class)"
14
+ >
15
+ <slot />
16
+ </div>
17
+ </template>
@@ -0,0 +1,21 @@
1
+ <script setup lang="ts">
2
+ import type { DialogOverlayProps } from 'reka-ui'
3
+ import type { HTMLAttributes } from 'vue'
4
+ import { reactiveOmit } from '@vueuse/core'
5
+ import { cn } from 'cn'
6
+ import { DialogOverlay } from 'reka-ui'
7
+
8
+ const props = defineProps<DialogOverlayProps & { class?: HTMLAttributes['class'] }>()
9
+
10
+ const delegatedProps = reactiveOmit(props, 'class')
11
+ </script>
12
+
13
+ <template>
14
+ <DialogOverlay
15
+ data-slot="dialog-overlay"
16
+ v-bind="delegatedProps"
17
+ :class="cn('data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50', props.class)"
18
+ >
19
+ <slot />
20
+ </DialogOverlay>
21
+ </template>
@@ -0,0 +1,60 @@
1
+ <script setup lang="ts">
2
+ import type { DialogContentEmits, DialogContentProps } from 'reka-ui'
3
+
4
+ import type { HTMLAttributes } from 'vue'
5
+ import { XIcon } from '@lucide/vue'
6
+ import { reactiveOmit } from '@vueuse/core'
7
+ import { cn } from 'cn'
8
+ import {
9
+ DialogClose,
10
+ DialogContent,
11
+ DialogOverlay,
12
+ DialogPortal,
13
+ useForwardPropsEmits,
14
+ } from 'reka-ui'
15
+
16
+ defineOptions({
17
+ inheritAttrs: false,
18
+ })
19
+
20
+ const props = defineProps<DialogContentProps & { class?: HTMLAttributes['class'] }>()
21
+ const emits = defineEmits<DialogContentEmits>()
22
+
23
+ const delegatedProps = reactiveOmit(props, 'class')
24
+
25
+ const forwarded = useForwardPropsEmits(delegatedProps, emits)
26
+ </script>
27
+
28
+ <template>
29
+ <DialogPortal>
30
+ <DialogOverlay
31
+ class="fixed inset-0 z-50 grid place-items-center overflow-y-auto 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"
32
+ >
33
+ <DialogContent
34
+ :class="
35
+ cn(
36
+ 'relative z-50 grid w-full max-w-lg my-8 gap-4 border border-border bg-background p-6 shadow-lg duration-200 sm:rounded-lg md:w-full',
37
+ props.class,
38
+ )
39
+ "
40
+ v-bind="{ ...$attrs, ...forwarded }"
41
+ @pointer-down-outside="(event) => {
42
+ const originalEvent = event.detail.originalEvent;
43
+ const target = originalEvent.target as HTMLElement;
44
+ if (originalEvent.offsetX > target.clientWidth || originalEvent.offsetY > target.clientHeight) {
45
+ event.preventDefault();
46
+ }
47
+ }"
48
+ >
49
+ <slot />
50
+
51
+ <DialogClose
52
+ class="absolute top-4 right-4 p-0.5 transition-colors rounded-md hover:bg-secondary"
53
+ >
54
+ <XIcon class="w-4 h-4" />
55
+ <span class="sr-only">Close</span>
56
+ </DialogClose>
57
+ </DialogContent>
58
+ </DialogOverlay>
59
+ </DialogPortal>
60
+ </template>
@@ -0,0 +1,23 @@
1
+ <script setup lang="ts">
2
+ import type { DialogTitleProps } from 'reka-ui'
3
+ import type { HTMLAttributes } from 'vue'
4
+ import { reactiveOmit } from '@vueuse/core'
5
+ import { cn } from 'cn'
6
+ import { DialogTitle, useForwardProps } from 'reka-ui'
7
+
8
+ const props = defineProps<DialogTitleProps & { class?: HTMLAttributes['class'] }>()
9
+
10
+ const delegatedProps = reactiveOmit(props, 'class')
11
+
12
+ const forwardedProps = useForwardProps(delegatedProps)
13
+ </script>
14
+
15
+ <template>
16
+ <DialogTitle
17
+ data-slot="dialog-title"
18
+ v-bind="forwardedProps"
19
+ :class="cn('leading-none font-medium cn-font-heading', props.class)"
20
+ >
21
+ <slot />
22
+ </DialogTitle>
23
+ </template>
@@ -0,0 +1,15 @@
1
+ <script setup lang="ts">
2
+ import type { DialogTriggerProps } from 'reka-ui'
3
+ import { DialogTrigger } from 'reka-ui'
4
+
5
+ const props = defineProps<DialogTriggerProps>()
6
+ </script>
7
+
8
+ <template>
9
+ <DialogTrigger
10
+ data-slot="dialog-trigger"
11
+ v-bind="props"
12
+ >
13
+ <slot />
14
+ </DialogTrigger>
15
+ </template>
@@ -0,0 +1,10 @@
1
+ export { default as Dialog } from './Dialog.vue'
2
+ export { default as DialogClose } from './DialogClose.vue'
3
+ export { default as DialogContent } from './DialogContent.vue'
4
+ export { default as DialogDescription } from './DialogDescription.vue'
5
+ export { default as DialogFooter } from './DialogFooter.vue'
6
+ export { default as DialogHeader } from './DialogHeader.vue'
7
+ export { default as DialogOverlay } from './DialogOverlay.vue'
8
+ export { default as DialogScrollContent } from './DialogScrollContent.vue'
9
+ export { default as DialogTitle } from './DialogTitle.vue'
10
+ export { default as DialogTrigger } from './DialogTrigger.vue'
@@ -0,0 +1,19 @@
1
+ <script setup lang="ts">
2
+ import type { DropdownMenuRootEmits, DropdownMenuRootProps } from 'reka-ui'
3
+ import { DropdownMenuRoot, useForwardPropsEmits } from 'reka-ui'
4
+
5
+ const props = defineProps<DropdownMenuRootProps>()
6
+ const emits = defineEmits<DropdownMenuRootEmits>()
7
+
8
+ const forwarded = useForwardPropsEmits(props, emits)
9
+ </script>
10
+
11
+ <template>
12
+ <DropdownMenuRoot
13
+ v-slot="slotProps"
14
+ data-slot="dropdown-menu"
15
+ v-bind="forwarded"
16
+ >
17
+ <slot v-bind="slotProps" />
18
+ </DropdownMenuRoot>
19
+ </template>
@@ -0,0 +1,43 @@
1
+ <script setup lang="ts">
2
+ import type { DropdownMenuCheckboxItemEmits, DropdownMenuCheckboxItemProps } 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
+ DropdownMenuCheckboxItem,
10
+ DropdownMenuItemIndicator,
11
+ useForwardPropsEmits,
12
+ } from 'reka-ui'
13
+
14
+ const props = defineProps<DropdownMenuCheckboxItemProps & { class?: HTMLAttributes['class'] }>()
15
+ const emits = defineEmits<DropdownMenuCheckboxItemEmits>()
16
+
17
+ const delegatedProps = reactiveOmit(props, 'class')
18
+
19
+ const forwarded = useForwardPropsEmits(delegatedProps, emits)
20
+ </script>
21
+
22
+ <template>
23
+ <DropdownMenuCheckboxItem
24
+ data-slot="dropdown-menu-checkbox-item"
25
+ v-bind="forwarded"
26
+ :class="cn(
27
+ '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',
28
+ props.class,
29
+ )"
30
+ >
31
+ <span
32
+ class="absolute right-2 flex items-center justify-center pointer-events-none"
33
+ data-slot="dropdown-menu-checkbox-item-indicator"
34
+ >
35
+ <DropdownMenuItemIndicator>
36
+ <slot name="indicator-icon">
37
+ <CheckIcon />
38
+ </slot>
39
+ </DropdownMenuItemIndicator>
40
+ </span>
41
+ <slot />
42
+ </DropdownMenuCheckboxItem>
43
+ </template>
@@ -0,0 +1,40 @@
1
+ <script setup lang="ts">
2
+ import type { DropdownMenuContentEmits, DropdownMenuContentProps } from 'reka-ui'
3
+ import type { HTMLAttributes } from 'vue'
4
+ import { reactiveOmit } from '@vueuse/core'
5
+ import { cn } from 'cn'
6
+ import {
7
+ DropdownMenuContent,
8
+ DropdownMenuPortal,
9
+ useForwardPropsEmits,
10
+ } from 'reka-ui'
11
+
12
+ defineOptions({
13
+ inheritAttrs: false,
14
+ })
15
+
16
+ const props = withDefaults(
17
+ defineProps<DropdownMenuContentProps & { class?: HTMLAttributes['class'] }>(),
18
+ {
19
+ align: 'start',
20
+ sideOffset: 4,
21
+ },
22
+ )
23
+ const emits = defineEmits<DropdownMenuContentEmits>()
24
+
25
+ const delegatedProps = reactiveOmit(props, 'class')
26
+
27
+ const forwarded = useForwardPropsEmits(delegatedProps, emits)
28
+ </script>
29
+
30
+ <template>
31
+ <DropdownMenuPortal>
32
+ <DropdownMenuContent
33
+ data-slot="dropdown-menu-content"
34
+ v-bind="{ ...$attrs, ...forwarded }"
35
+ :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-32 rounded-md p-1 shadow-md ring-1 duration-100 cn-menu-translucent z-50 max-h-(--reka-dropdown-menu-content-available-height) w-(--reka-dropdown-menu-trigger-width) origin-(--reka-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto data-[state=closed]:overflow-hidden', props.class)"
36
+ >
37
+ <slot />
38
+ </DropdownMenuContent>
39
+ </DropdownMenuPortal>
40
+ </template>
@@ -0,0 +1,15 @@
1
+ <script setup lang="ts">
2
+ import type { DropdownMenuGroupProps } from 'reka-ui'
3
+ import { DropdownMenuGroup } from 'reka-ui'
4
+
5
+ const props = defineProps<DropdownMenuGroupProps>()
6
+ </script>
7
+
8
+ <template>
9
+ <DropdownMenuGroup
10
+ data-slot="dropdown-menu-group"
11
+ v-bind="props"
12
+ >
13
+ <slot />
14
+ </DropdownMenuGroup>
15
+ </template>
@@ -0,0 +1,31 @@
1
+ <script setup lang="ts">
2
+ import type { DropdownMenuItemProps } from 'reka-ui'
3
+ import type { HTMLAttributes } from 'vue'
4
+ import { reactiveOmit } from '@vueuse/core'
5
+ import { cn } from 'cn'
6
+ import { DropdownMenuItem, useForwardProps } from 'reka-ui'
7
+
8
+ const props = withDefaults(defineProps<DropdownMenuItemProps & {
9
+ class?: HTMLAttributes['class']
10
+ inset?: boolean
11
+ variant?: 'default' | 'destructive'
12
+ }>(), {
13
+ variant: 'default',
14
+ })
15
+
16
+ const delegatedProps = reactiveOmit(props, 'inset', 'variant', 'class')
17
+
18
+ const forwardedProps = useForwardProps(delegatedProps)
19
+ </script>
20
+
21
+ <template>
22
+ <DropdownMenuItem
23
+ data-slot="dropdown-menu-item"
24
+ :data-inset="inset ? '' : undefined"
25
+ :data-variant="variant"
26
+ v-bind="forwardedProps"
27
+ :class="cn('focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive 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 group/dropdown-menu-item 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', props.class)"
28
+ >
29
+ <slot />
30
+ </DropdownMenuItem>
31
+ </template>
@@ -0,0 +1,23 @@
1
+ <script setup lang="ts">
2
+ import type { DropdownMenuLabelProps } from 'reka-ui'
3
+ import type { HTMLAttributes } from 'vue'
4
+ import { reactiveOmit } from '@vueuse/core'
5
+ import { cn } from 'cn'
6
+ import { DropdownMenuLabel, useForwardProps } from 'reka-ui'
7
+
8
+ const props = defineProps<DropdownMenuLabelProps & { class?: HTMLAttributes['class'], inset?: boolean }>()
9
+
10
+ const delegatedProps = reactiveOmit(props, 'class', 'inset')
11
+ const forwardedProps = useForwardProps(delegatedProps)
12
+ </script>
13
+
14
+ <template>
15
+ <DropdownMenuLabel
16
+ data-slot="dropdown-menu-label"
17
+ :data-inset="inset ? '' : undefined"
18
+ v-bind="forwardedProps"
19
+ :class="cn('text-muted-foreground px-2 py-1.5 text-xs font-medium data-inset:pl-8', props.class)"
20
+ >
21
+ <slot />
22
+ </DropdownMenuLabel>
23
+ </template>
@@ -0,0 +1,21 @@
1
+ <script setup lang="ts">
2
+ import type { DropdownMenuRadioGroupEmits, DropdownMenuRadioGroupProps } from 'reka-ui'
3
+ import {
4
+ DropdownMenuRadioGroup,
5
+ useForwardPropsEmits,
6
+ } from 'reka-ui'
7
+
8
+ const props = defineProps<DropdownMenuRadioGroupProps>()
9
+ const emits = defineEmits<DropdownMenuRadioGroupEmits>()
10
+
11
+ const forwarded = useForwardPropsEmits(props, emits)
12
+ </script>
13
+
14
+ <template>
15
+ <DropdownMenuRadioGroup
16
+ data-slot="dropdown-menu-radio-group"
17
+ v-bind="forwarded"
18
+ >
19
+ <slot />
20
+ </DropdownMenuRadioGroup>
21
+ </template>