@reinvented/design 0.2.0 → 0.2.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/docs/components/alert-dialog.md +32 -0
- package/docs/components/avatar.md +14 -0
- package/docs/components/badge.md +24 -0
- package/docs/components/button.md +69 -0
- package/docs/components/card.md +49 -0
- package/docs/components/dialog.md +46 -0
- package/docs/components/dropdown-menu.md +32 -0
- package/docs/components/index.md +69 -50
- package/docs/components/input.md +34 -0
- package/docs/components/remaining-components.md +253 -0
- package/docs/components/scroll-area.md +17 -0
- package/docs/components/select.md +31 -0
- package/docs/components/separator.md +14 -0
- package/docs/components/sheet.md +32 -0
- package/docs/components/skeleton.md +20 -0
- package/docs/components/table.md +33 -0
- package/docs/components/tabs.md +23 -0
- package/docs/layouts/dashboard.md +70 -0
- package/docs/layouts/detail-page.md +83 -0
- package/docs/layouts/index.md +37 -24
- package/docs/layouts/list-page.md +107 -0
- package/docs/layouts/settings-page.md +79 -0
- package/docs/layouts/step-wizard.md +73 -0
- package/package.json +1 -1
- package/src/components/ui/accordion/Accordion.vue +13 -0
- package/src/components/ui/accordion/AccordionContent.vue +20 -0
- package/src/components/ui/accordion/AccordionItem.vue +15 -0
- package/src/components/ui/accordion/AccordionTrigger.vue +25 -0
- package/src/components/ui/accordion/index.ts +4 -0
- package/src/components/ui/alert/Alert.vue +38 -0
- package/src/components/ui/alert/AlertDescription.vue +12 -0
- package/src/components/ui/alert/AlertTitle.vue +12 -0
- package/src/components/ui/alert/index.ts +3 -0
- package/src/components/ui/alert-dialog/AlertDialog.vue +13 -0
- package/src/components/ui/alert-dialog/AlertDialogAction.vue +21 -0
- package/src/components/ui/alert-dialog/AlertDialogCancel.vue +21 -0
- package/src/components/ui/alert-dialog/AlertDialogContent.vue +39 -0
- package/src/components/ui/alert-dialog/AlertDialogDescription.vue +15 -0
- package/src/components/ui/alert-dialog/AlertDialogFooter.vue +12 -0
- package/src/components/ui/alert-dialog/AlertDialogHeader.vue +12 -0
- package/src/components/ui/alert-dialog/AlertDialogTitle.vue +15 -0
- package/src/components/ui/alert-dialog/AlertDialogTrigger.vue +11 -0
- package/src/components/ui/alert-dialog/index.ts +9 -0
- package/src/components/ui/breadcrumb/Breadcrumb.vue +6 -0
- package/src/components/ui/breadcrumb/BreadcrumbEllipsis.vue +12 -0
- package/src/components/ui/breadcrumb/BreadcrumbItem.vue +6 -0
- package/src/components/ui/breadcrumb/BreadcrumbLink.vue +20 -0
- package/src/components/ui/breadcrumb/BreadcrumbList.vue +6 -0
- package/src/components/ui/breadcrumb/BreadcrumbPage.vue +6 -0
- package/src/components/ui/breadcrumb/BreadcrumbSeparator.vue +11 -0
- package/src/components/ui/breadcrumb/index.ts +7 -0
- package/src/components/ui/button/Button.vue +0 -1
- package/src/components/ui/checkbox/Checkbox.vue +25 -0
- package/src/components/ui/checkbox/index.ts +1 -0
- package/src/components/ui/collapsible/Collapsible.vue +13 -0
- package/src/components/ui/collapsible/index.ts +2 -0
- package/src/components/ui/command/Command.vue +16 -0
- package/src/components/ui/command/CommandEmpty.vue +5 -0
- package/src/components/ui/command/CommandGroup.vue +22 -0
- package/src/components/ui/command/CommandInput.vue +21 -0
- package/src/components/ui/command/CommandItem.vue +22 -0
- package/src/components/ui/command/CommandList.vue +17 -0
- package/src/components/ui/command/CommandSeparator.vue +5 -0
- package/src/components/ui/command/index.ts +7 -0
- package/src/components/ui/context-menu/ContextMenuContent.vue +24 -0
- package/src/components/ui/context-menu/ContextMenuItem.vue +16 -0
- package/src/components/ui/context-menu/ContextMenuLabel.vue +9 -0
- package/src/components/ui/context-menu/ContextMenuSeparator.vue +9 -0
- package/src/components/ui/context-menu/ContextMenuSubContent.vue +14 -0
- package/src/components/ui/context-menu/index.ts +9 -0
- package/src/components/ui/dialog/Dialog.vue +14 -0
- package/src/components/ui/dialog/DialogClose.vue +12 -0
- package/src/components/ui/dialog/DialogContent.vue +48 -0
- package/src/components/ui/dialog/DialogDescription.vue +23 -0
- package/src/components/ui/dialog/DialogFooter.vue +12 -0
- package/src/components/ui/dialog/DialogHeader.vue +12 -0
- package/src/components/ui/dialog/DialogScrollContent.vue +47 -0
- package/src/components/ui/dialog/DialogTitle.vue +23 -0
- package/src/components/ui/dialog/DialogTrigger.vue +12 -0
- package/src/components/ui/dialog/index.ts +9 -0
- package/src/components/ui/dropdown-menu/DropdownMenu.vue +13 -0
- package/src/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +28 -0
- package/src/components/ui/dropdown-menu/DropdownMenuContent.vue +33 -0
- package/src/components/ui/dropdown-menu/DropdownMenuGroup.vue +11 -0
- package/src/components/ui/dropdown-menu/DropdownMenuItem.vue +27 -0
- package/src/components/ui/dropdown-menu/DropdownMenuLabel.vue +23 -0
- package/src/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +13 -0
- package/src/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +27 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSeparator.vue +13 -0
- package/src/components/ui/dropdown-menu/DropdownMenuShortcut.vue +12 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSub.vue +13 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSubContent.vue +27 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +23 -0
- package/src/components/ui/dropdown-menu/DropdownMenuTrigger.vue +11 -0
- package/src/components/ui/dropdown-menu/index.ts +14 -0
- package/src/components/ui/form/FormControl.vue +3 -0
- package/src/components/ui/form/FormDescription.vue +6 -0
- package/src/components/ui/form/FormItem.vue +6 -0
- package/src/components/ui/form/FormLabel.vue +10 -0
- package/src/components/ui/form/FormMessage.vue +10 -0
- package/src/components/ui/form/index.ts +9 -0
- package/src/components/ui/hover-card/HoverCard.vue +13 -0
- package/src/components/ui/hover-card/HoverCardContent.vue +26 -0
- package/src/components/ui/hover-card/HoverCardTrigger.vue +11 -0
- package/src/components/ui/hover-card/index.ts +3 -0
- package/src/components/ui/label/Label.vue +18 -0
- package/src/components/ui/label/index.ts +1 -0
- package/src/components/ui/menubar/MenubarContent.vue +15 -0
- package/src/components/ui/menubar/MenubarItem.vue +13 -0
- package/src/components/ui/menubar/MenubarTrigger.vue +13 -0
- package/src/components/ui/menubar/index.ts +5 -0
- package/src/components/ui/navigation-menu/NavigationMenuContent.vue +14 -0
- package/src/components/ui/navigation-menu/NavigationMenuTrigger.vue +15 -0
- package/src/components/ui/navigation-menu/index.ts +4 -0
- package/src/components/ui/pagination/PaginationContent.vue +13 -0
- package/src/components/ui/pagination/PaginationEllipsis.vue +12 -0
- package/src/components/ui/pagination/PaginationNext.vue +14 -0
- package/src/components/ui/pagination/PaginationPrev.vue +14 -0
- package/src/components/ui/pagination/index.ts +6 -0
- package/src/components/ui/popover/Popover.vue +13 -0
- package/src/components/ui/popover/PopoverContent.vue +27 -0
- package/src/components/ui/popover/PopoverTrigger.vue +11 -0
- package/src/components/ui/popover/index.ts +3 -0
- package/src/components/ui/progress/Progress.vue +21 -0
- package/src/components/ui/progress/index.ts +1 -0
- package/src/components/ui/radio-group/RadioGroup.vue +16 -0
- package/src/components/ui/radio-group/RadioGroupItem.vue +24 -0
- package/src/components/ui/radio-group/index.ts +2 -0
- package/src/components/ui/select/Select.vue +13 -0
- package/src/components/ui/select/SelectContent.vue +40 -0
- package/src/components/ui/select/SelectGroup.vue +15 -0
- package/src/components/ui/select/SelectItem.vue +30 -0
- package/src/components/ui/select/SelectLabel.vue +15 -0
- package/src/components/ui/select/SelectSeparator.vue +13 -0
- package/src/components/ui/select/SelectTrigger.vue +23 -0
- package/src/components/ui/select/SelectValue.vue +11 -0
- package/src/components/ui/select/index.ts +8 -0
- package/src/components/ui/sheet/Sheet.vue +13 -0
- package/src/components/ui/sheet/SheetClose.vue +11 -0
- package/src/components/ui/sheet/SheetContent.vue +65 -0
- package/src/components/ui/sheet/SheetDescription.vue +15 -0
- package/src/components/ui/sheet/SheetFooter.vue +12 -0
- package/src/components/ui/sheet/SheetHeader.vue +12 -0
- package/src/components/ui/sheet/SheetTitle.vue +15 -0
- package/src/components/ui/sheet/SheetTrigger.vue +11 -0
- package/src/components/ui/sheet/index.ts +8 -0
- package/src/components/ui/slider/Slider.vue +26 -0
- package/src/components/ui/slider/index.ts +1 -0
- package/src/components/ui/switch/Switch.vue +24 -0
- package/src/components/ui/switch/index.ts +1 -0
- package/src/components/ui/table/Table.vue +13 -0
- package/src/components/ui/table/TableBody.vue +6 -0
- package/src/components/ui/table/TableCaption.vue +6 -0
- package/src/components/ui/table/TableCell.vue +6 -0
- package/src/components/ui/table/TableFooter.vue +6 -0
- package/src/components/ui/table/TableHead.vue +6 -0
- package/src/components/ui/table/TableHeader.vue +6 -0
- package/src/components/ui/table/TableRow.vue +6 -0
- package/src/components/ui/table/index.ts +8 -0
- package/src/components/ui/tabs/Tabs.vue +13 -0
- package/src/components/ui/tabs/TabsContent.vue +21 -0
- package/src/components/ui/tabs/TabsList.vue +21 -0
- package/src/components/ui/tabs/TabsTrigger.vue +21 -0
- package/src/components/ui/tabs/index.ts +4 -0
- package/src/components/ui/textarea/Textarea.vue +29 -0
- package/src/components/ui/textarea/index.ts +1 -0
- package/src/components/ui/toggle/Toggle.vue +40 -0
- package/src/components/ui/toggle/index.ts +1 -0
- package/src/components/ui/toggle-group/ToggleGroup.vue +16 -0
- package/src/components/ui/toggle-group/ToggleGroupItem.vue +21 -0
- package/src/components/ui/toggle-group/index.ts +2 -0
- package/src/components/ui/tooltip/Tooltip.vue +13 -0
- package/src/components/ui/tooltip/TooltipContent.vue +27 -0
- package/src/components/ui/tooltip/TooltipProvider.vue +12 -0
- package/src/components/ui/tooltip/TooltipTrigger.vue +11 -0
- package/src/components/ui/tooltip/index.ts +4 -0
- package/src/index.ts +46 -192
- package/src/patterns/DetailView.vue +2 -2
- package/src/patterns/EmptyState.vue +2 -2
- package/src/patterns/FormView.vue +2 -2
- package/src/patterns/ListView.vue +2 -2
- package/tsconfig.json +17 -3
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
4
|
+
import {
|
|
5
|
+
DialogClose,
|
|
6
|
+
DialogContent,
|
|
7
|
+
type DialogContentEmits,
|
|
8
|
+
type DialogContentProps,
|
|
9
|
+
DialogOverlay,
|
|
10
|
+
DialogPortal,
|
|
11
|
+
useForwardPropsEmits,
|
|
12
|
+
} from 'radix-vue'
|
|
13
|
+
import { X } from 'lucide-vue-next'
|
|
14
|
+
import { cn } from '../lib/utils'
|
|
15
|
+
|
|
16
|
+
const sheetVariants = cva(
|
|
17
|
+
'fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out',
|
|
18
|
+
{
|
|
19
|
+
variants: {
|
|
20
|
+
side: {
|
|
21
|
+
top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
|
|
22
|
+
bottom: 'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',
|
|
23
|
+
left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',
|
|
24
|
+
right: 'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
side: 'right',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
type SheetVariants = VariantProps<typeof sheetVariants>
|
|
34
|
+
|
|
35
|
+
interface SheetContentProps extends DialogContentProps {
|
|
36
|
+
class?: HTMLAttributes['class']
|
|
37
|
+
side?: SheetVariants['side']
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const props = withDefaults(defineProps<SheetContentProps>(), { side: 'right' })
|
|
41
|
+
const emits = defineEmits<DialogContentEmits>()
|
|
42
|
+
const delegatedProps = computed(() => { const { class: _, side: _s, ...d } = props; return d })
|
|
43
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<template>
|
|
47
|
+
<DialogPortal>
|
|
48
|
+
<DialogOverlay
|
|
49
|
+
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"
|
|
50
|
+
/>
|
|
51
|
+
<DialogContent
|
|
52
|
+
v-bind="forwarded"
|
|
53
|
+
:class="cn(sheetVariants({ side }), props.class)"
|
|
54
|
+
>
|
|
55
|
+
<slot />
|
|
56
|
+
|
|
57
|
+
<DialogClose
|
|
58
|
+
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-secondary"
|
|
59
|
+
>
|
|
60
|
+
<X class="w-4 h-4" />
|
|
61
|
+
<span class="sr-only">Close</span>
|
|
62
|
+
</DialogClose>
|
|
63
|
+
</DialogContent>
|
|
64
|
+
</DialogPortal>
|
|
65
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { DialogDescription, type DialogDescriptionProps, useForwardProps } from 'radix-vue'
|
|
4
|
+
import { cn } from '../lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<DialogDescriptionProps & { class?: HTMLAttributes['class'] }>()
|
|
7
|
+
const delegatedProps = computed(() => { const { class: _, ...d } = props; return d })
|
|
8
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<DialogDescription v-bind="forwardedProps" :class="cn('text-sm text-muted-foreground', props.class)">
|
|
13
|
+
<slot />
|
|
14
|
+
</DialogDescription>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '../lib/utils'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{ class?: HTMLAttributes['class'] }>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<div :class="cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2', props.class)">
|
|
10
|
+
<slot />
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '../lib/utils'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{ class?: HTMLAttributes['class'] }>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<div :class="cn('flex flex-col gap-y-2 text-center sm:text-left', props.class)">
|
|
10
|
+
<slot />
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { DialogTitle, type DialogTitleProps, useForwardProps } from 'radix-vue'
|
|
4
|
+
import { cn } from '../lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<DialogTitleProps & { class?: HTMLAttributes['class'] }>()
|
|
7
|
+
const delegatedProps = computed(() => { const { class: _, ...d } = props; return d })
|
|
8
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<DialogTitle v-bind="forwardedProps" :class="cn('text-lg font-semibold text-foreground', props.class)">
|
|
13
|
+
<slot />
|
|
14
|
+
</DialogTitle>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as Sheet } from './Sheet.vue'
|
|
2
|
+
export { default as SheetClose } from './SheetClose.vue'
|
|
3
|
+
export { default as SheetContent } from './SheetContent.vue'
|
|
4
|
+
export { default as SheetDescription } from './SheetDescription.vue'
|
|
5
|
+
export { default as SheetFooter } from './SheetFooter.vue'
|
|
6
|
+
export { default as SheetHeader } from './SheetHeader.vue'
|
|
7
|
+
export { default as SheetTitle } from './SheetTitle.vue'
|
|
8
|
+
export { default as SheetTrigger } from './SheetTrigger.vue'
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { SliderRange, SliderRoot, type SliderRootEmits, type SliderRootProps, SliderThumb, SliderTrack, useForwardPropsEmits } from 'radix-vue'
|
|
4
|
+
import { cn } from '../lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<SliderRootProps & { class?: HTMLAttributes['class'] }>()
|
|
7
|
+
const emits = defineEmits<SliderRootEmits>()
|
|
8
|
+
const delegatedProps = computed(() => { const { class: _, ...d } = props; return d })
|
|
9
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<SliderRoot
|
|
14
|
+
v-bind="forwarded"
|
|
15
|
+
:class="cn('relative flex w-full touch-none select-none items-center', props.class)"
|
|
16
|
+
>
|
|
17
|
+
<SliderTrack class="relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20">
|
|
18
|
+
<SliderRange class="absolute h-full bg-primary" />
|
|
19
|
+
</SliderTrack>
|
|
20
|
+
<SliderThumb
|
|
21
|
+
v-for="(_, i) in (modelValue || [0])"
|
|
22
|
+
:key="i"
|
|
23
|
+
class="block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"
|
|
24
|
+
/>
|
|
25
|
+
</SliderRoot>
|
|
26
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Slider } from './Slider.vue'
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { SwitchRoot, type SwitchRootEmits, type SwitchRootProps, SwitchThumb, useForwardPropsEmits } from 'radix-vue'
|
|
4
|
+
import { cn } from '../lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<SwitchRootProps & { class?: HTMLAttributes['class'] }>()
|
|
7
|
+
const emits = defineEmits<SwitchRootEmits>()
|
|
8
|
+
const delegatedProps = computed(() => { const { class: _, ...d } = props; return d })
|
|
9
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<SwitchRoot
|
|
14
|
+
v-bind="forwarded"
|
|
15
|
+
:class="cn(
|
|
16
|
+
'peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input',
|
|
17
|
+
props.class,
|
|
18
|
+
)"
|
|
19
|
+
>
|
|
20
|
+
<SwitchThumb
|
|
21
|
+
class="pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
|
|
22
|
+
/>
|
|
23
|
+
</SwitchRoot>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Switch } from './Switch.vue'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '../lib/utils'
|
|
4
|
+
const props = defineProps<{ class?: HTMLAttributes['class'] }>()
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<div class="relative w-full overflow-auto">
|
|
9
|
+
<table :class="cn('w-full caption-bottom text-sm', props.class)">
|
|
10
|
+
<slot />
|
|
11
|
+
</table>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '../lib/utils'
|
|
4
|
+
const props = defineProps<{ class?: HTMLAttributes['class'] }>()
|
|
5
|
+
</script>
|
|
6
|
+
<template><tbody :class="cn('[&_tr:last-child]:border-0', props.class)"><slot /></tbody></template>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '../lib/utils'
|
|
4
|
+
const props = defineProps<{ class?: HTMLAttributes['class'] }>()
|
|
5
|
+
</script>
|
|
6
|
+
<template><caption :class="cn('mt-4 text-sm text-muted-foreground', props.class)"><slot /></caption></template>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '../lib/utils'
|
|
4
|
+
const props = defineProps<{ class?: HTMLAttributes['class'] }>()
|
|
5
|
+
</script>
|
|
6
|
+
<template><td :class="cn('p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-0.5', props.class)"><slot /></td></template>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '../lib/utils'
|
|
4
|
+
const props = defineProps<{ class?: HTMLAttributes['class'] }>()
|
|
5
|
+
</script>
|
|
6
|
+
<template><tfoot :class="cn('border-t bg-muted/50 font-medium [&>tr]:last:border-b-0', props.class)"><slot /></tfoot></template>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '../lib/utils'
|
|
4
|
+
const props = defineProps<{ class?: HTMLAttributes['class'] }>()
|
|
5
|
+
</script>
|
|
6
|
+
<template><th :class="cn('h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-0.5', props.class)"><slot /></th></template>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '../lib/utils'
|
|
4
|
+
const props = defineProps<{ class?: HTMLAttributes['class'] }>()
|
|
5
|
+
</script>
|
|
6
|
+
<template><thead :class="cn('[&_tr]:border-b', props.class)"><slot /></thead></template>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '../lib/utils'
|
|
4
|
+
const props = defineProps<{ class?: HTMLAttributes['class'] }>()
|
|
5
|
+
</script>
|
|
6
|
+
<template><tr :class="cn('border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted', props.class)"><slot /></tr></template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as Table } from './Table.vue'
|
|
2
|
+
export { default as TableBody } from './TableBody.vue'
|
|
3
|
+
export { default as TableCaption } from './TableCaption.vue'
|
|
4
|
+
export { default as TableCell } from './TableCell.vue'
|
|
5
|
+
export { default as TableFooter } from './TableFooter.vue'
|
|
6
|
+
export { default as TableHead } from './TableHead.vue'
|
|
7
|
+
export { default as TableHeader } from './TableHeader.vue'
|
|
8
|
+
export { default as TableRow } from './TableRow.vue'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { TabsRoot, type TabsRootEmits, type TabsRootProps, useForwardPropsEmits } from 'radix-vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<TabsRootProps>()
|
|
5
|
+
const emits = defineEmits<TabsRootEmits>()
|
|
6
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<TabsRoot v-bind="forwarded">
|
|
11
|
+
<slot />
|
|
12
|
+
</TabsRoot>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { TabsContent, type TabsContentProps, useForwardProps } from 'radix-vue'
|
|
4
|
+
import { cn } from '../lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<TabsContentProps & { class?: HTMLAttributes['class'] }>()
|
|
7
|
+
const delegatedProps = computed(() => { const { class: _, ...d } = props; return d })
|
|
8
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<TabsContent
|
|
13
|
+
v-bind="forwardedProps"
|
|
14
|
+
:class="cn(
|
|
15
|
+
'mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
|
|
16
|
+
props.class,
|
|
17
|
+
)"
|
|
18
|
+
>
|
|
19
|
+
<slot />
|
|
20
|
+
</TabsContent>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { TabsList, type TabsListProps, useForwardProps } from 'radix-vue'
|
|
4
|
+
import { cn } from '../lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<TabsListProps & { class?: HTMLAttributes['class'] }>()
|
|
7
|
+
const delegatedProps = computed(() => { const { class: _, ...d } = props; return d })
|
|
8
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<TabsList
|
|
13
|
+
v-bind="forwardedProps"
|
|
14
|
+
:class="cn(
|
|
15
|
+
'inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground',
|
|
16
|
+
props.class,
|
|
17
|
+
)"
|
|
18
|
+
>
|
|
19
|
+
<slot />
|
|
20
|
+
</TabsList>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { TabsTrigger, type TabsTriggerProps, useForwardProps } from 'radix-vue'
|
|
4
|
+
import { cn } from '../lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<TabsTriggerProps & { class?: HTMLAttributes['class'] }>()
|
|
7
|
+
const delegatedProps = computed(() => { const { class: _, ...d } = props; return d })
|
|
8
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<TabsTrigger
|
|
13
|
+
v-bind="forwardedProps"
|
|
14
|
+
:class="cn(
|
|
15
|
+
'inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow',
|
|
16
|
+
props.class,
|
|
17
|
+
)"
|
|
18
|
+
>
|
|
19
|
+
<slot />
|
|
20
|
+
</TabsTrigger>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { cn } from '../lib/utils'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes['class']
|
|
7
|
+
defaultValue?: string
|
|
8
|
+
modelValue?: string
|
|
9
|
+
}>()
|
|
10
|
+
|
|
11
|
+
const emits = defineEmits<{
|
|
12
|
+
'update:modelValue': [value: string]
|
|
13
|
+
}>()
|
|
14
|
+
|
|
15
|
+
const modelValue = computed({
|
|
16
|
+
get: () => props.modelValue,
|
|
17
|
+
set: (val) => emits('update:modelValue', val ?? ''),
|
|
18
|
+
})
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<textarea
|
|
23
|
+
v-model="modelValue"
|
|
24
|
+
:class="cn(
|
|
25
|
+
'flex min-h-20 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50',
|
|
26
|
+
props.class,
|
|
27
|
+
)"
|
|
28
|
+
/>
|
|
29
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Textarea } from './Textarea.vue'
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { Toggle as ToggleRoot, type ToggleEmits, type ToggleProps, useForwardPropsEmits } from 'radix-vue'
|
|
4
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
5
|
+
import { cn } from '../lib/utils'
|
|
6
|
+
|
|
7
|
+
const toggleVariants = cva(
|
|
8
|
+
'inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground',
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: 'bg-transparent',
|
|
13
|
+
outline: 'border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground',
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
default: 'h-9 px-3',
|
|
17
|
+
sm: 'h-8 px-2',
|
|
18
|
+
lg: 'h-10 px-3',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
variant: 'default',
|
|
23
|
+
size: 'default',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
type ToggleVariants = VariantProps<typeof toggleVariants>
|
|
29
|
+
|
|
30
|
+
const props = defineProps<ToggleProps & { class?: HTMLAttributes['class']; variant?: ToggleVariants['variant']; size?: ToggleVariants['size'] }>()
|
|
31
|
+
const emits = defineEmits<ToggleEmits>()
|
|
32
|
+
const delegatedProps = computed(() => { const { class: _, variant: _v, size: _s, ...d } = props; return d })
|
|
33
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<template>
|
|
37
|
+
<ToggleRoot v-bind="forwarded" :class="cn(toggleVariants({ variant, size }), props.class)">
|
|
38
|
+
<slot />
|
|
39
|
+
</ToggleRoot>
|
|
40
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Toggle } from './Toggle.vue'
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { ToggleGroupRoot, type ToggleGroupRootEmits, type ToggleGroupRootProps, useForwardPropsEmits } from 'radix-vue'
|
|
4
|
+
import { cn } from '../lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<ToggleGroupRootProps & { class?: HTMLAttributes['class'] }>()
|
|
7
|
+
const emits = defineEmits<ToggleGroupRootEmits>()
|
|
8
|
+
const delegatedProps = computed(() => { const { class: _, ...d } = props; return d })
|
|
9
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<ToggleGroupRoot v-bind="forwarded" :class="cn('flex items-center justify-center gap-1', props.class)">
|
|
14
|
+
<slot />
|
|
15
|
+
</ToggleGroupRoot>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { ToggleGroupItem, type ToggleGroupItemProps, useForwardProps } from 'radix-vue'
|
|
4
|
+
import { cn } from '../lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<ToggleGroupItemProps & { class?: HTMLAttributes['class'] }>()
|
|
7
|
+
const delegatedProps = computed(() => { const { class: _, ...d } = props; return d })
|
|
8
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<ToggleGroupItem
|
|
13
|
+
v-bind="forwardedProps"
|
|
14
|
+
:class="cn(
|
|
15
|
+
'inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground bg-transparent h-9 px-3',
|
|
16
|
+
props.class,
|
|
17
|
+
)"
|
|
18
|
+
>
|
|
19
|
+
<slot />
|
|
20
|
+
</ToggleGroupItem>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { TooltipRoot, type TooltipRootEmits, type TooltipRootProps, useForwardPropsEmits } from 'radix-vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<TooltipRootProps>()
|
|
5
|
+
const emits = defineEmits<TooltipRootEmits>()
|
|
6
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<TooltipRoot v-bind="forwarded">
|
|
11
|
+
<slot />
|
|
12
|
+
</TooltipRoot>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { TooltipContent, type TooltipContentEmits, type TooltipContentProps, TooltipPortal, useForwardPropsEmits } from 'radix-vue'
|
|
4
|
+
import { cn } from '../lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = withDefaults(
|
|
7
|
+
defineProps<TooltipContentProps & { class?: HTMLAttributes['class'] }>(),
|
|
8
|
+
{ sideOffset: 4 },
|
|
9
|
+
)
|
|
10
|
+
const emits = defineEmits<TooltipContentEmits>()
|
|
11
|
+
const delegatedProps = computed(() => { const { class: _, ...d } = props; return d })
|
|
12
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<TooltipPortal>
|
|
17
|
+
<TooltipContent
|
|
18
|
+
v-bind="forwarded"
|
|
19
|
+
:class="cn(
|
|
20
|
+
'z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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',
|
|
21
|
+
props.class,
|
|
22
|
+
)"
|
|
23
|
+
>
|
|
24
|
+
<slot />
|
|
25
|
+
</TooltipContent>
|
|
26
|
+
</TooltipPortal>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { TooltipProvider, type TooltipProviderProps, useForwardProps } from 'radix-vue'
|
|
3
|
+
|
|
4
|
+
const props = withDefaults(defineProps<TooltipProviderProps>(), { delayDuration: 200 })
|
|
5
|
+
const forwardedProps = useForwardProps(props)
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<TooltipProvider v-bind="forwardedProps">
|
|
10
|
+
<slot />
|
|
11
|
+
</TooltipProvider>
|
|
12
|
+
</template>
|