@personizely/ui 0.0.42
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/LICENSE.md +21 -0
- package/README.md +1 -0
- package/dist/personizely-ui.css +6 -0
- package/dist/personizely-ui.js +26854 -0
- package/dist/personizely-ui.umd.cjs +111 -0
- package/package.json +117 -0
- package/src/assets/index.css +136 -0
- package/src/components/ui/accordion/Accordion.vue +19 -0
- package/src/components/ui/accordion/AccordionContent.vue +24 -0
- package/src/components/ui/accordion/AccordionItem.vue +37 -0
- package/src/components/ui/accordion/AccordionTrigger.vue +39 -0
- package/src/components/ui/accordion/index.ts +2 -0
- package/src/components/ui/alert/Alert.vue +68 -0
- package/src/components/ui/alert/index.ts +22 -0
- package/src/components/ui/alert-dialog/AlertDialog.vue +66 -0
- package/src/components/ui/alert-dialog/AlertDialogContent.vue +44 -0
- package/src/components/ui/alert-dialog/AlertDialogProvider.vue +27 -0
- package/src/components/ui/alert-dialog/AlertDialogTrigger.vue +11 -0
- package/src/components/ui/alert-dialog/index.ts +3 -0
- package/src/components/ui/alert-dialog/useAlertDialog.ts +19 -0
- package/src/components/ui/autocomplete/Autocomplete.vue +170 -0
- package/src/components/ui/autocomplete/AutocompleteContent.vue +27 -0
- package/src/components/ui/autocomplete/AutocompleteEmpty.vue +20 -0
- package/src/components/ui/autocomplete/AutocompleteGroup.vue +29 -0
- package/src/components/ui/autocomplete/AutocompleteItem.vue +26 -0
- package/src/components/ui/autocomplete/AutocompleteRoot.vue +31 -0
- package/src/components/ui/autocomplete/AutocompleteSeparator.vue +23 -0
- package/src/components/ui/autocomplete/index.ts +1 -0
- package/src/components/ui/avatar/Avatar.vue +31 -0
- package/src/components/ui/avatar/AvatarFallback.vue +11 -0
- package/src/components/ui/avatar/AvatarImage.vue +9 -0
- package/src/components/ui/avatar/index.ts +19 -0
- package/src/components/ui/badge/Badge.vue +16 -0
- package/src/components/ui/badge/index.ts +22 -0
- package/src/components/ui/button/Button.vue +123 -0
- package/src/components/ui/button/index.ts +78 -0
- package/src/components/ui/calendar/Calendar.vue +76 -0
- package/src/components/ui/calendar/CalendarCell.vue +24 -0
- package/src/components/ui/calendar/CalendarCellTrigger.vue +38 -0
- package/src/components/ui/calendar/CalendarGrid.vue +24 -0
- package/src/components/ui/calendar/CalendarGridBody.vue +11 -0
- package/src/components/ui/calendar/CalendarGridHead.vue +11 -0
- package/src/components/ui/calendar/CalendarGridRow.vue +21 -0
- package/src/components/ui/calendar/CalendarHeadCell.vue +21 -0
- package/src/components/ui/calendar/CalendarHeader.vue +21 -0
- package/src/components/ui/calendar/CalendarHeading.vue +27 -0
- package/src/components/ui/calendar/CalendarNextButton.vue +32 -0
- package/src/components/ui/calendar/CalendarPrevButton.vue +32 -0
- package/src/components/ui/calendar/index.ts +1 -0
- package/src/components/ui/card/Card.vue +57 -0
- package/src/components/ui/card/CardContent.vue +14 -0
- package/src/components/ui/card/CardDescription.vue +14 -0
- package/src/components/ui/card/CardFooter.vue +14 -0
- package/src/components/ui/card/CardHeader.vue +14 -0
- package/src/components/ui/card/CardTitle.vue +18 -0
- package/src/components/ui/card/CardTray.vue +14 -0
- package/src/components/ui/card/index.ts +1 -0
- package/src/components/ui/checkbox/Checkbox.vue +63 -0
- package/src/components/ui/checkbox/CheckboxBase.vue +39 -0
- package/src/components/ui/checkbox/index.ts +1 -0
- package/src/components/ui/checkbox-group/CheckboxGroup.vue +65 -0
- package/src/components/ui/checkbox-group/index.ts +15 -0
- package/src/components/ui/color-picker/Alpha.vue +63 -0
- package/src/components/ui/color-picker/Angle.vue +145 -0
- package/src/components/ui/color-picker/Checkboard.vue +43 -0
- package/src/components/ui/color-picker/Color.vue +255 -0
- package/src/components/ui/color-picker/ColorPicker.vue +25 -0
- package/src/components/ui/color-picker/Gradient.vue +172 -0
- package/src/components/ui/color-picker/Handle.vue +19 -0
- package/src/components/ui/color-picker/Hue.vue +80 -0
- package/src/components/ui/color-picker/LabelInput.vue +16 -0
- package/src/components/ui/color-picker/Rail.vue +100 -0
- package/src/components/ui/color-picker/Saturation.vue +142 -0
- package/src/components/ui/color-picker/index.ts +4 -0
- package/src/components/ui/combobox/Combobox.vue +202 -0
- package/src/components/ui/combobox/ComboboxContent.vue +27 -0
- package/src/components/ui/combobox/ComboboxEmpty.vue +20 -0
- package/src/components/ui/combobox/ComboboxGroup.vue +29 -0
- package/src/components/ui/combobox/ComboboxInput.vue +52 -0
- package/src/components/ui/combobox/ComboboxItem.vue +26 -0
- package/src/components/ui/combobox/ComboboxRoot.vue +31 -0
- package/src/components/ui/combobox/ComboboxSeparator.vue +23 -0
- package/src/components/ui/combobox/index.ts +1 -0
- package/src/components/ui/date-picker/DatePicker.vue +55 -0
- package/src/components/ui/date-picker/index.ts +1 -0
- package/src/components/ui/date-range-picker/DateRangePicker.vue +137 -0
- package/src/components/ui/date-range-picker/index.ts +1 -0
- package/src/components/ui/dialog/Dialog.vue +78 -0
- package/src/components/ui/dialog/DialogContent.vue +46 -0
- package/src/components/ui/dialog/DialogDescription.vue +24 -0
- package/src/components/ui/dialog/DialogFooter.vue +19 -0
- package/src/components/ui/dialog/DialogHeader.vue +16 -0
- package/src/components/ui/dialog/DialogTitle.vue +29 -0
- package/src/components/ui/dialog/DialogTrigger.vue +11 -0
- package/src/components/ui/dialog/index.ts +1 -0
- package/src/components/ui/drawer/Drawer.vue +88 -0
- package/src/components/ui/drawer/DrawerContent.vue +57 -0
- package/src/components/ui/drawer/DrawerDescription.vue +22 -0
- package/src/components/ui/drawer/DrawerFooter.vue +19 -0
- package/src/components/ui/drawer/DrawerHeader.vue +16 -0
- package/src/components/ui/drawer/DrawerTitle.vue +22 -0
- package/src/components/ui/drawer/DrawerTrigger.vue +11 -0
- package/src/components/ui/drawer/index.ts +21 -0
- package/src/components/ui/dropdown-menu/DropdownCheckboxGroupMenu.vue +87 -0
- package/src/components/ui/dropdown-menu/DropdownMenu.vue +72 -0
- package/src/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +40 -0
- package/src/components/ui/dropdown-menu/DropdownMenuContent.vue +37 -0
- package/src/components/ui/dropdown-menu/DropdownMenuGroup.vue +11 -0
- package/src/components/ui/dropdown-menu/DropdownMenuHelp.vue +14 -0
- package/src/components/ui/dropdown-menu/DropdownMenuItem.vue +28 -0
- package/src/components/ui/dropdown-menu/DropdownMenuLabel.vue +24 -0
- package/src/components/ui/dropdown-menu/DropdownMenuPart.vue +64 -0
- package/src/components/ui/dropdown-menu/DropdownMenuPartItem.vue +76 -0
- package/src/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +19 -0
- package/src/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +41 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSeparator.vue +22 -0
- package/src/components/ui/dropdown-menu/DropdownMenuShortcut.vue +14 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSub.vue +19 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSubContent.vue +30 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +33 -0
- package/src/components/ui/dropdown-menu/DropdownMenuTrigger.vue +13 -0
- package/src/components/ui/dropdown-menu/DropdownRadioGroupMenu.vue +75 -0
- package/src/components/ui/dropdown-menu/index.ts +36 -0
- package/src/components/ui/file-upload-button/FileUploadButton.vue +55 -0
- package/src/components/ui/file-upload-button/index.ts +1 -0
- package/src/components/ui/form/Form.vue +13 -0
- package/src/components/ui/form/FormControl.vue +16 -0
- package/src/components/ui/form/FormDescription.vue +20 -0
- package/src/components/ui/form/FormField.vue +61 -0
- package/src/components/ui/form/FormLabel.vue +23 -0
- package/src/components/ui/form/FormMessage.vue +16 -0
- package/src/components/ui/form/index.ts +2 -0
- package/src/components/ui/form/useFormField.ts +30 -0
- package/src/components/ui/icon/Icon.vue +16 -0
- package/src/components/ui/icon/index.ts +1 -0
- package/src/components/ui/input/Input.vue +51 -0
- package/src/components/ui/input/InputBase.vue +18 -0
- package/src/components/ui/input/index.ts +1 -0
- package/src/components/ui/label/Label.vue +27 -0
- package/src/components/ui/label/index.ts +1 -0
- package/src/components/ui/pagination/Pagination.vue +50 -0
- package/src/components/ui/pagination/PaginationContent.vue +21 -0
- package/src/components/ui/pagination/PaginationEllipsis.vue +24 -0
- package/src/components/ui/pagination/PaginationFirst.vue +32 -0
- package/src/components/ui/pagination/PaginationItem.vue +32 -0
- package/src/components/ui/pagination/PaginationLast.vue +32 -0
- package/src/components/ui/pagination/PaginationNext.vue +32 -0
- package/src/components/ui/pagination/PaginationPrevious.vue +32 -0
- package/src/components/ui/pagination/index.ts +1 -0
- package/src/components/ui/popover/Popover.vue +57 -0
- package/src/components/ui/popover/PopoverTrigger.vue +15 -0
- package/src/components/ui/popover/index.ts +1 -0
- package/src/components/ui/progress/Progress.vue +35 -0
- package/src/components/ui/progress/ProgressIndicator.vue +19 -0
- package/src/components/ui/progress/index.ts +2 -0
- package/src/components/ui/progress-circular/ProgressCircular.vue +85 -0
- package/src/components/ui/progress-circular/index.ts +1 -0
- package/src/components/ui/radio-group/RadioGroup.vue +81 -0
- package/src/components/ui/radio-group/RadioGroupItem.vue +39 -0
- package/src/components/ui/radio-group/index.ts +15 -0
- package/src/components/ui/range-calendar/RangeCalendar.vue +71 -0
- package/src/components/ui/range-calendar/RangeCalendarCell.vue +28 -0
- package/src/components/ui/range-calendar/RangeCalendarCellTrigger.vue +40 -0
- package/src/components/ui/range-calendar/RangeCalendarGrid.vue +24 -0
- package/src/components/ui/range-calendar/RangeCalendarGridBody.vue +11 -0
- package/src/components/ui/range-calendar/RangeCalendarGridHead.vue +11 -0
- package/src/components/ui/range-calendar/RangeCalendarGridRow.vue +21 -0
- package/src/components/ui/range-calendar/RangeCalendarHeadCell.vue +21 -0
- package/src/components/ui/range-calendar/RangeCalendarHeader.vue +21 -0
- package/src/components/ui/range-calendar/RangeCalendarHeading.vue +27 -0
- package/src/components/ui/range-calendar/RangeCalendarNextButton.vue +32 -0
- package/src/components/ui/range-calendar/RangeCalendarPrevButton.vue +32 -0
- package/src/components/ui/range-calendar/index.ts +1 -0
- package/src/components/ui/select/Select.vue +120 -0
- package/src/components/ui/select/SelectContent.vue +45 -0
- package/src/components/ui/select/SelectGroup.vue +19 -0
- package/src/components/ui/select/SelectItem.vue +43 -0
- package/src/components/ui/select/SelectLabel.vue +13 -0
- package/src/components/ui/select/SelectSeparator.vue +17 -0
- package/src/components/ui/select/SelectTrigger.vue +31 -0
- package/src/components/ui/select/SelectValue.vue +11 -0
- package/src/components/ui/select/index.ts +1 -0
- package/src/components/ui/slider/Slider.vue +100 -0
- package/src/components/ui/slider/index.ts +1 -0
- package/src/components/ui/switch/Switch.vue +40 -0
- package/src/components/ui/switch/SwitchBase.vue +36 -0
- package/src/components/ui/switch/index.ts +1 -0
- package/src/components/ui/tabs/Tabs.vue +63 -0
- package/src/components/ui/tabs/TabsContent.vue +26 -0
- package/src/components/ui/tabs/TabsTrigger.vue +27 -0
- package/src/components/ui/tabs/index.ts +28 -0
- package/src/components/ui/textarea/Textarea.vue +13 -0
- package/src/components/ui/textarea/index.ts +1 -0
- package/src/components/ui/toast/Toast.vue +28 -0
- package/src/components/ui/toast/ToastAction.vue +26 -0
- package/src/components/ui/toast/ToastClose.vue +29 -0
- package/src/components/ui/toast/ToastDescription.vue +19 -0
- package/src/components/ui/toast/ToastProvider.vue +11 -0
- package/src/components/ui/toast/ToastTitle.vue +19 -0
- package/src/components/ui/toast/ToastViewport.vue +17 -0
- package/src/components/ui/toast/Toaster.vue +30 -0
- package/src/components/ui/toast/index.ts +34 -0
- package/src/components/ui/toast/useToast.ts +163 -0
- package/src/components/ui/toggle/Toggle.vue +51 -0
- package/src/components/ui/toggle/index.ts +71 -0
- package/src/components/ui/toggle-group/ToggleGroup.vue +58 -0
- package/src/components/ui/toggle-group/ToggleGroupItem.vue +54 -0
- package/src/components/ui/toggle-group/index.ts +1 -0
- package/src/components/ui/tooltip/Tooltip.vue +42 -0
- package/src/components/ui/tooltip/TooltipProvider.vue +11 -0
- package/src/components/ui/tooltip/index.ts +2 -0
- package/src/composables/delegated-props.ts +6 -0
- package/src/composables/emits-as-props.ts +17 -0
- package/src/composables/forward-props-emits.ts +11 -0
- package/src/directives/autofocus.ts +7 -0
- package/src/index.ts +159 -0
- package/src/options-provider.ts +19 -0
- package/src/utils/gradient.ts +158 -0
- package/src/utils/options.ts +40 -0
- package/src/utils/tailwind.ts +14 -0
- package/web-types.json +10560 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ProgressRoot
|
|
3
|
+
v-bind="delegatedProps"
|
|
4
|
+
:class="
|
|
5
|
+
cn(
|
|
6
|
+
'relative h-2 w-full overflow-hidden rounded-full bg-secondary',
|
|
7
|
+
props.class,
|
|
8
|
+
)
|
|
9
|
+
"
|
|
10
|
+
>
|
|
11
|
+
<slot />
|
|
12
|
+
|
|
13
|
+
<ProgressIndicator :model-value="props.modelValue"/>
|
|
14
|
+
</ProgressRoot>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script setup lang="ts">
|
|
18
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
19
|
+
import {
|
|
20
|
+
ProgressRoot,
|
|
21
|
+
type ProgressRootProps
|
|
22
|
+
} from 'reka-ui'
|
|
23
|
+
import ProgressIndicator from './ProgressIndicator.vue'
|
|
24
|
+
import { cn } from '@/utils/tailwind'
|
|
25
|
+
|
|
26
|
+
const props = withDefaults(defineProps<ProgressRootProps & { class?: HTMLAttributes['class'] }>(), {
|
|
27
|
+
modelValue: 0
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
const delegatedProps = computed(() => {
|
|
31
|
+
const { class: _, ...delegated } = props
|
|
32
|
+
|
|
33
|
+
return delegated
|
|
34
|
+
})
|
|
35
|
+
</script>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ProgressIndicator
|
|
3
|
+
:class="cn(
|
|
4
|
+
'h-full w-full flex-1 bg-primary transition-all absolute top-0 left-0',
|
|
5
|
+
props.class,
|
|
6
|
+
)"
|
|
7
|
+
:style="`transform: translateX(-${100 - (props.modelValue ?? 0)}%);`"
|
|
8
|
+
/>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup lang="ts">
|
|
12
|
+
import { ProgressIndicator, type ProgressRootProps } from 'reka-ui'
|
|
13
|
+
import type { HTMLAttributes } from 'vue'
|
|
14
|
+
import { cn } from '@/utils/tailwind'
|
|
15
|
+
|
|
16
|
+
const props = withDefaults(defineProps<ProgressRootProps & { class?: HTMLAttributes['class'] }>(), {
|
|
17
|
+
modelValue: 0
|
|
18
|
+
})
|
|
19
|
+
</script>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="cn('text-muted-foreground', $attrs.class)">
|
|
3
|
+
<svg
|
|
4
|
+
v-if="modelValue !== null"
|
|
5
|
+
role="progressbar"
|
|
6
|
+
viewBox="25 25 50 50"
|
|
7
|
+
:aria-valuemax="100"
|
|
8
|
+
:aria-valuemin="0"
|
|
9
|
+
:aria-valuenow="modelValue"
|
|
10
|
+
class="max-w-full max-h-full"
|
|
11
|
+
>
|
|
12
|
+
<circle
|
|
13
|
+
fill="none"
|
|
14
|
+
stroke-dashoffset="0"
|
|
15
|
+
:cx="size / 2"
|
|
16
|
+
:cy="size / 2"
|
|
17
|
+
:r="radius"
|
|
18
|
+
:stroke-dasharray="strokeDashArray"
|
|
19
|
+
:stroke-width="stroke"
|
|
20
|
+
:style="{ 'stroke-dashoffset': strokeDashOffset }"
|
|
21
|
+
class="stroke-current transition-all"
|
|
22
|
+
/>
|
|
23
|
+
</svg>
|
|
24
|
+
|
|
25
|
+
<svg
|
|
26
|
+
v-else
|
|
27
|
+
class="animate-spin max-w-full max-h-full"
|
|
28
|
+
role="progressbar"
|
|
29
|
+
viewBox="25 25 50 50"
|
|
30
|
+
:aria-valuemax="100"
|
|
31
|
+
:aria-valuemin="0"
|
|
32
|
+
>
|
|
33
|
+
<circle
|
|
34
|
+
:cx="size / 2"
|
|
35
|
+
:cy="size / 2"
|
|
36
|
+
fill="none"
|
|
37
|
+
:r="radius"
|
|
38
|
+
stroke-miterlimit="10"
|
|
39
|
+
stroke-dasharray="89, 200"
|
|
40
|
+
stroke-dashoffset="-35px"
|
|
41
|
+
:stroke-width="stroke"
|
|
42
|
+
class="stroke-current"
|
|
43
|
+
/>
|
|
44
|
+
</svg>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script lang="ts" setup>
|
|
49
|
+
import { computed } from 'vue'
|
|
50
|
+
import { cn } from '@/utils/tailwind'
|
|
51
|
+
|
|
52
|
+
const props = withDefaults(defineProps<{
|
|
53
|
+
modelValue?: number | null
|
|
54
|
+
}>(), {
|
|
55
|
+
modelValue: null
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
const stroke = 4
|
|
59
|
+
const size = 100
|
|
60
|
+
|
|
61
|
+
const moderateProgress = (value: number) => {
|
|
62
|
+
if (value > 100) return 100
|
|
63
|
+
if (value < 0) return 0
|
|
64
|
+
|
|
65
|
+
return value
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const strokeDashArray = computed(() => {
|
|
69
|
+
const circumference = 2 * Math.PI * radius.value
|
|
70
|
+
|
|
71
|
+
// Use first 3 decimal places, rounded as appropriate
|
|
72
|
+
return Math.round(circumference * 1000) / 1000
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
const strokeDashOffset = computed(() => {
|
|
76
|
+
const progress = moderateProgress(props.modelValue!)
|
|
77
|
+
const circumference = 2 * Math.PI * radius.value
|
|
78
|
+
|
|
79
|
+
return ((100 - progress) / 100) * circumference
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
const radius = computed(() => {
|
|
83
|
+
return (size - stroke) / 5
|
|
84
|
+
})
|
|
85
|
+
</script>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ProgressCircular } from './ProgressCircular.vue'
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<RadioGroupRoot
|
|
3
|
+
v-bind="forwarded"
|
|
4
|
+
:class="cn(radioGroupVariants({ orientation }), props.class)"
|
|
5
|
+
>
|
|
6
|
+
<div v-for="(option, index) in preparedOptions" :key="option[keys.id] || index" class="flex items-start space-x-2">
|
|
7
|
+
<RadioGroupItem
|
|
8
|
+
:id="`${name}-${option[keys.id] || option[keys.value]}`"
|
|
9
|
+
:value="option[keys.value]"
|
|
10
|
+
:disabled="option[keys.disabled] || disabled"
|
|
11
|
+
class="peer"
|
|
12
|
+
@focus="$emit('focus', option)"
|
|
13
|
+
@blur="$emit('blur', option)"
|
|
14
|
+
/>
|
|
15
|
+
|
|
16
|
+
<div v-if="option[keys.help] || $slots.help" class="grid gap-1 leading-[1.2] [&>label]:peer-disabled:cursor-not-allowed peer-disabled:opacity-70">
|
|
17
|
+
<Label :for="`${name}-${option[keys.id] || option[keys.value]}`">
|
|
18
|
+
<slot v-bind="option">
|
|
19
|
+
{{ option[keys.label] || option }}
|
|
20
|
+
</slot>
|
|
21
|
+
</Label>
|
|
22
|
+
<p class="text-sm text-muted-foreground">
|
|
23
|
+
<slot name="help" v-bind="{ option }">
|
|
24
|
+
{{ option[keys.help] }}
|
|
25
|
+
</slot>
|
|
26
|
+
</p>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<Label v-else :for="`${name}-${option[keys.id] || option[keys.value]}`">
|
|
30
|
+
<slot v-bind="option">
|
|
31
|
+
{{ option[keys.label] || option }}
|
|
32
|
+
</slot>
|
|
33
|
+
</Label>
|
|
34
|
+
</div>
|
|
35
|
+
</RadioGroupRoot>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script setup lang="ts">
|
|
39
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
40
|
+
import {
|
|
41
|
+
RadioGroupRoot,
|
|
42
|
+
type RadioGroupRootEmits,
|
|
43
|
+
type RadioGroupRootProps,
|
|
44
|
+
useId
|
|
45
|
+
} from 'reka-ui'
|
|
46
|
+
import { cn } from '@/utils/tailwind'
|
|
47
|
+
import { radioGroupVariants } from './'
|
|
48
|
+
import RadioGroupItem from './RadioGroupItem.vue'
|
|
49
|
+
import { Label } from '@/components/ui/label'
|
|
50
|
+
import { type CustomOption, type Keys, type Option, prepareOptions } from '@/utils/options'
|
|
51
|
+
import { useDelegatedProps } from '@/composables/delegated-props'
|
|
52
|
+
import { useEmitAsProps } from '@/composables/emits-as-props'
|
|
53
|
+
import { useForwardPropsEmits } from '@/composables/forward-props-emits'
|
|
54
|
+
|
|
55
|
+
const props = withDefaults(defineProps<RadioGroupRootProps & {
|
|
56
|
+
class?: HTMLAttributes['class']
|
|
57
|
+
keys?: Keys
|
|
58
|
+
options: string[] | Option[] | CustomOption[] | { [key:string]: string },
|
|
59
|
+
}>(), {
|
|
60
|
+
keys: () => ({
|
|
61
|
+
id: 'id',
|
|
62
|
+
label: 'label',
|
|
63
|
+
help: 'help',
|
|
64
|
+
value: 'value',
|
|
65
|
+
disabled: 'disabled'
|
|
66
|
+
}),
|
|
67
|
+
orientation: 'vertical',
|
|
68
|
+
name: () => useId()
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
const emits = defineEmits<RadioGroupRootEmits & {
|
|
72
|
+
blur: [option: Option | CustomOption]
|
|
73
|
+
focus: [option: Option | CustomOption]
|
|
74
|
+
}>()
|
|
75
|
+
|
|
76
|
+
const delegatedProps = useDelegatedProps(props, ['keys', 'options', 'class'])
|
|
77
|
+
const delegatedEmits = useEmitAsProps(emits, ['blur', 'focus'])
|
|
78
|
+
const forwarded = useForwardPropsEmits(delegatedProps, delegatedEmits)
|
|
79
|
+
|
|
80
|
+
const preparedOptions = computed(() => prepareOptions(props.options, props.keys))
|
|
81
|
+
</script>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<RadioGroupItem
|
|
3
|
+
v-bind="forwardedProps"
|
|
4
|
+
:class="
|
|
5
|
+
cn(
|
|
6
|
+
'aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
|
|
7
|
+
props.class,
|
|
8
|
+
)
|
|
9
|
+
"
|
|
10
|
+
>
|
|
11
|
+
<RadioGroupIndicator
|
|
12
|
+
class="flex items-center justify-center"
|
|
13
|
+
>
|
|
14
|
+
<Circle class="h-2.5 w-2.5 fill-current text-current" />
|
|
15
|
+
</RadioGroupIndicator>
|
|
16
|
+
</RadioGroupItem>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
21
|
+
import {
|
|
22
|
+
RadioGroupIndicator,
|
|
23
|
+
RadioGroupItem,
|
|
24
|
+
type RadioGroupItemProps,
|
|
25
|
+
useForwardProps
|
|
26
|
+
} from 'reka-ui'
|
|
27
|
+
import { Circle } from 'lucide-vue-next'
|
|
28
|
+
import { cn } from '@/utils/tailwind'
|
|
29
|
+
|
|
30
|
+
const props = defineProps<RadioGroupItemProps & { class?: HTMLAttributes['class'] }>()
|
|
31
|
+
|
|
32
|
+
const delegatedProps = computed(() => {
|
|
33
|
+
const { class: _, ...delegated } = props
|
|
34
|
+
|
|
35
|
+
return delegated
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
39
|
+
</script>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority'
|
|
2
|
+
|
|
3
|
+
export { default as RadioGroup } from './RadioGroup.vue'
|
|
4
|
+
|
|
5
|
+
export const radioGroupVariants = cva('flex ', {
|
|
6
|
+
variants: {
|
|
7
|
+
orientation: {
|
|
8
|
+
vertical: 'flex-col gap-2',
|
|
9
|
+
horizontal: 'gap-4'
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
defaultVariants: {
|
|
13
|
+
orientation: 'vertical'
|
|
14
|
+
}
|
|
15
|
+
})
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<RangeCalendarRoot
|
|
3
|
+
v-slot="{ grid, weekDays }"
|
|
4
|
+
:class="cn('p-3', props.class)"
|
|
5
|
+
v-bind="forwarded"
|
|
6
|
+
>
|
|
7
|
+
<RangeCalendarHeader>
|
|
8
|
+
<RangeCalendarPrevButton />
|
|
9
|
+
<RangeCalendarHeading />
|
|
10
|
+
<RangeCalendarNextButton />
|
|
11
|
+
</RangeCalendarHeader>
|
|
12
|
+
|
|
13
|
+
<div class="flex flex-col gap-y-4 mt-2 sm:flex-row sm:gap-x-4 sm:gap-y-0">
|
|
14
|
+
<RangeCalendarGrid v-for="month in grid" :key="month.value.toString()">
|
|
15
|
+
<RangeCalendarGridHead>
|
|
16
|
+
<RangeCalendarGridRow>
|
|
17
|
+
<RangeCalendarHeadCell
|
|
18
|
+
v-for="day in weekDays"
|
|
19
|
+
:key="day"
|
|
20
|
+
>
|
|
21
|
+
{{ day }}
|
|
22
|
+
</RangeCalendarHeadCell>
|
|
23
|
+
</RangeCalendarGridRow>
|
|
24
|
+
</RangeCalendarGridHead>
|
|
25
|
+
<RangeCalendarGridBody>
|
|
26
|
+
<RangeCalendarGridRow v-for="(weekDates, index) in month.rows" :key="`weekDate-${index}`" class="mt-2 w-full">
|
|
27
|
+
<RangeCalendarCell
|
|
28
|
+
v-for="weekDate in weekDates"
|
|
29
|
+
:key="weekDate.toString()"
|
|
30
|
+
:date="weekDate"
|
|
31
|
+
>
|
|
32
|
+
<RangeCalendarCellTrigger
|
|
33
|
+
:day="weekDate"
|
|
34
|
+
:month="month.value"
|
|
35
|
+
/>
|
|
36
|
+
</RangeCalendarCell>
|
|
37
|
+
</RangeCalendarGridRow>
|
|
38
|
+
</RangeCalendarGridBody>
|
|
39
|
+
</RangeCalendarGrid>
|
|
40
|
+
</div>
|
|
41
|
+
</RangeCalendarRoot>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<script lang="ts" setup>
|
|
45
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
46
|
+
import { RangeCalendarRoot, type RangeCalendarRootEmits, type RangeCalendarRootProps, useForwardPropsEmits } from 'reka-ui'
|
|
47
|
+
import RangeCalendarCell from './RangeCalendarCell.vue'
|
|
48
|
+
import RangeCalendarCellTrigger from './RangeCalendarCellTrigger.vue'
|
|
49
|
+
import RangeCalendarGrid from './RangeCalendarGrid.vue'
|
|
50
|
+
import RangeCalendarGridBody from './RangeCalendarGridBody.vue'
|
|
51
|
+
import RangeCalendarGridHead from './RangeCalendarGridHead.vue'
|
|
52
|
+
import RangeCalendarGridRow from './RangeCalendarGridRow.vue'
|
|
53
|
+
import RangeCalendarHeadCell from './RangeCalendarHeadCell.vue'
|
|
54
|
+
import RangeCalendarHeader from './RangeCalendarHeader.vue'
|
|
55
|
+
import RangeCalendarHeading from './RangeCalendarHeading.vue'
|
|
56
|
+
import RangeCalendarNextButton from './RangeCalendarNextButton.vue'
|
|
57
|
+
import RangeCalendarPrevButton from './RangeCalendarPrevButton.vue'
|
|
58
|
+
import { cn } from '@/utils/tailwind'
|
|
59
|
+
|
|
60
|
+
const props = defineProps<RangeCalendarRootProps & { class?: HTMLAttributes['class'] }>()
|
|
61
|
+
|
|
62
|
+
const emits = defineEmits<RangeCalendarRootEmits>()
|
|
63
|
+
|
|
64
|
+
const delegatedProps = computed(() => {
|
|
65
|
+
const { class: _, ...delegated } = props
|
|
66
|
+
|
|
67
|
+
return delegated
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
71
|
+
</script>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<RangeCalendarCell
|
|
3
|
+
:class="cn(
|
|
4
|
+
'relative h-7 w-7 p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([data-selected])]:bg-accent first:[&:has([data-selected])]:rounded-l-md last:[&:has([data-selected])]:rounded-r-md [&:has([data-selected][data-outside-month])]:bg-accent/50 [&:has([data-selected][data-selection-end])]:rounded-r-md [&:has([data-selected][data-selection-start])]:rounded-l-md',
|
|
5
|
+
'[&:has([data-highlighted])]:bg-accent first:[&:has([data-highlighted])]:rounded-l-md last:[&:has([data-highlighted])]:rounded-r-md [&:has([data-highlighted][data-outside-month])]:bg-accent/50 [&:has([data-highlighted][data-highlighted-end])]:rounded-r-md [&:has([data-highlighted][data-highlighted-start])]:rounded-l-md',
|
|
6
|
+
props.class
|
|
7
|
+
)"
|
|
8
|
+
v-bind="forwardedProps"
|
|
9
|
+
>
|
|
10
|
+
<slot />
|
|
11
|
+
</RangeCalendarCell>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts" setup>
|
|
15
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
16
|
+
import { RangeCalendarCell, type RangeCalendarCellProps, useForwardProps } from 'reka-ui'
|
|
17
|
+
import { cn } from '@/utils/tailwind'
|
|
18
|
+
|
|
19
|
+
const props = defineProps<RangeCalendarCellProps & { class?: HTMLAttributes['class'] }>()
|
|
20
|
+
|
|
21
|
+
const delegatedProps = computed(() => {
|
|
22
|
+
const { class: _, ...delegated } = props
|
|
23
|
+
|
|
24
|
+
return delegated
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
28
|
+
</script>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<RangeCalendarCellTrigger
|
|
3
|
+
:class="cn(
|
|
4
|
+
buttonVariants({ variant: 'ghost' }),
|
|
5
|
+
'h-7 w-7 p-0 font-normal data-selected:opacity-100',
|
|
6
|
+
'[&[data-today]:not([data-selected])]:bg-accent [&[data-today]:not([data-selected])]:text-accent-foreground',
|
|
7
|
+
// Selection Start
|
|
8
|
+
'data-selection-start:bg-primary data-selection-start:text-primary-foreground data-selection-start:hover:bg-primary data-selection-start:hover:text-primary-foreground data-selection-start:focus:bg-primary data-selection-start:focus:text-primary-foreground',
|
|
9
|
+
// Selection End
|
|
10
|
+
'data-selection-end:bg-primary data-selection-end:text-primary-foreground data-selection-end:hover:bg-primary data-selection-end:hover:text-primary-foreground data-selection-end:focus:bg-primary data-selection-end:focus:text-primary-foreground',
|
|
11
|
+
// Outside months
|
|
12
|
+
'data-outside-month:pointer-events-none data-outside-month:text-muted-foreground data-outside-month:opacity-50 [&[data-outside-month][data-selected]]:bg-accent/50 [&[data-outside-month][data-selected]]:text-muted-foreground [&[data-outside-month][data-selected]]:opacity-30',
|
|
13
|
+
// Disabled
|
|
14
|
+
'data-disabled:text-muted-foreground data-disabled:opacity-50',
|
|
15
|
+
// Unavailable
|
|
16
|
+
'data-unavailable:text-destructive-foreground data-unavailable:line-through',
|
|
17
|
+
props.class,
|
|
18
|
+
)"
|
|
19
|
+
v-bind="forwardedProps"
|
|
20
|
+
>
|
|
21
|
+
<slot />
|
|
22
|
+
</RangeCalendarCellTrigger>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script lang="ts" setup>
|
|
26
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
27
|
+
import { RangeCalendarCellTrigger, type RangeCalendarCellTriggerProps, useForwardProps } from 'reka-ui'
|
|
28
|
+
import { buttonVariants } from '@/components/ui/button'
|
|
29
|
+
import { cn } from '@/utils/tailwind'
|
|
30
|
+
|
|
31
|
+
const props = defineProps<RangeCalendarCellTriggerProps & { class?: HTMLAttributes['class'] }>()
|
|
32
|
+
|
|
33
|
+
const delegatedProps = computed(() => {
|
|
34
|
+
const { class: _, ...delegated } = props
|
|
35
|
+
|
|
36
|
+
return delegated
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
40
|
+
</script>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<RangeCalendarGrid
|
|
3
|
+
:class="cn('w-full border-collapse space-y-1', props.class)"
|
|
4
|
+
v-bind="forwardedProps"
|
|
5
|
+
>
|
|
6
|
+
<slot />
|
|
7
|
+
</RangeCalendarGrid>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script lang="ts" setup>
|
|
11
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
12
|
+
import { RangeCalendarGrid, type RangeCalendarGridProps, useForwardProps } from 'reka-ui'
|
|
13
|
+
import { cn } from '@/utils/tailwind'
|
|
14
|
+
|
|
15
|
+
const props = defineProps<RangeCalendarGridProps & { class?: HTMLAttributes['class'] }>()
|
|
16
|
+
|
|
17
|
+
const delegatedProps = computed(() => {
|
|
18
|
+
const { class: _, ...delegated } = props
|
|
19
|
+
|
|
20
|
+
return delegated
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
24
|
+
</script>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<RangeCalendarGridBody v-bind="props">
|
|
3
|
+
<slot />
|
|
4
|
+
</RangeCalendarGridBody>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { RangeCalendarGridBody, type RangeCalendarGridBodyProps } from 'reka-ui'
|
|
9
|
+
|
|
10
|
+
const props = defineProps<RangeCalendarGridBodyProps>()
|
|
11
|
+
</script>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<RangeCalendarGridHead v-bind="props">
|
|
3
|
+
<slot />
|
|
4
|
+
</RangeCalendarGridHead>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { RangeCalendarGridHead, type RangeCalendarGridHeadProps } from 'reka-ui'
|
|
9
|
+
|
|
10
|
+
const props = defineProps<RangeCalendarGridHeadProps>()
|
|
11
|
+
</script>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<RangeCalendarGridRow :class="cn('flex mt-2 w-full', props.class)" v-bind="forwardedProps">
|
|
3
|
+
<slot />
|
|
4
|
+
</RangeCalendarGridRow>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
9
|
+
import { RangeCalendarGridRow, type RangeCalendarGridRowProps, useForwardProps } from 'reka-ui'
|
|
10
|
+
import { cn } from '@/utils/tailwind'
|
|
11
|
+
|
|
12
|
+
const props = defineProps<RangeCalendarGridRowProps & { class?: HTMLAttributes['class'] }>()
|
|
13
|
+
|
|
14
|
+
const delegatedProps = computed(() => {
|
|
15
|
+
const { class: _, ...delegated } = props
|
|
16
|
+
|
|
17
|
+
return delegated
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
21
|
+
</script>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<RangeCalendarHeadCell :class="cn('w-7 rounded-md text-[0.8rem] font-normal text-muted-foreground', props.class)" v-bind="forwardedProps">
|
|
3
|
+
<slot />
|
|
4
|
+
</RangeCalendarHeadCell>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
9
|
+
import { RangeCalendarHeadCell, type RangeCalendarHeadCellProps, useForwardProps } from 'reka-ui'
|
|
10
|
+
import { cn } from '@/utils/tailwind'
|
|
11
|
+
|
|
12
|
+
const props = defineProps<RangeCalendarHeadCellProps & { class?: HTMLAttributes['class'] }>()
|
|
13
|
+
|
|
14
|
+
const delegatedProps = computed(() => {
|
|
15
|
+
const { class: _, ...delegated } = props
|
|
16
|
+
|
|
17
|
+
return delegated
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
21
|
+
</script>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<RangeCalendarHeader :class="cn('relative flex w-full items-center justify-between', props.class)" v-bind="forwardedProps">
|
|
3
|
+
<slot />
|
|
4
|
+
</RangeCalendarHeader>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
9
|
+
import { RangeCalendarHeader, type RangeCalendarHeaderProps, useForwardProps } from 'reka-ui'
|
|
10
|
+
import { cn } from '@/utils/tailwind'
|
|
11
|
+
|
|
12
|
+
const props = defineProps<RangeCalendarHeaderProps & { class?: HTMLAttributes['class'] }>()
|
|
13
|
+
|
|
14
|
+
const delegatedProps = computed(() => {
|
|
15
|
+
const { class: _, ...delegated } = props
|
|
16
|
+
|
|
17
|
+
return delegated
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
21
|
+
</script>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<RangeCalendarHeading
|
|
3
|
+
v-slot="{ headingValue }"
|
|
4
|
+
:class="cn('text-xs font-medium', props.class)"
|
|
5
|
+
v-bind="forwardedProps"
|
|
6
|
+
>
|
|
7
|
+
<slot>
|
|
8
|
+
{{ headingValue }}
|
|
9
|
+
</slot>
|
|
10
|
+
</RangeCalendarHeading>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script lang="ts" setup>
|
|
14
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
15
|
+
import { RangeCalendarHeading, type RangeCalendarHeadingProps, useForwardProps } from 'reka-ui'
|
|
16
|
+
import { cn } from '@/utils/tailwind'
|
|
17
|
+
|
|
18
|
+
const props = defineProps<RangeCalendarHeadingProps & { class?: HTMLAttributes['class'] }>()
|
|
19
|
+
|
|
20
|
+
const delegatedProps = computed(() => {
|
|
21
|
+
const { class: _, ...delegated } = props
|
|
22
|
+
|
|
23
|
+
return delegated
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
27
|
+
</script>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<RangeCalendarNext
|
|
3
|
+
:class="cn(
|
|
4
|
+
buttonVariants({ variant: 'outline' }),
|
|
5
|
+
'h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100',
|
|
6
|
+
props.class,
|
|
7
|
+
)"
|
|
8
|
+
v-bind="forwardedProps"
|
|
9
|
+
>
|
|
10
|
+
<slot>
|
|
11
|
+
<ChevronRight class="h-4 w-4" />
|
|
12
|
+
</slot>
|
|
13
|
+
</RangeCalendarNext>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script lang="ts" setup>
|
|
17
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
18
|
+
import { RangeCalendarNext, type RangeCalendarNextProps, useForwardProps } from 'reka-ui'
|
|
19
|
+
import { ChevronRight } from 'lucide-vue-next'
|
|
20
|
+
import { cn } from '@/utils/tailwind'
|
|
21
|
+
import { buttonVariants } from '@/components/ui/button'
|
|
22
|
+
|
|
23
|
+
const props = defineProps<RangeCalendarNextProps & { class?: HTMLAttributes['class'] }>()
|
|
24
|
+
|
|
25
|
+
const delegatedProps = computed(() => {
|
|
26
|
+
const { class: _, ...delegated } = props
|
|
27
|
+
|
|
28
|
+
return delegated
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
32
|
+
</script>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<RangeCalendarPrev
|
|
3
|
+
:class="cn(
|
|
4
|
+
buttonVariants({ variant: 'outline' }),
|
|
5
|
+
'h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100',
|
|
6
|
+
props.class,
|
|
7
|
+
)"
|
|
8
|
+
v-bind="forwardedProps"
|
|
9
|
+
>
|
|
10
|
+
<slot>
|
|
11
|
+
<ChevronLeft class="h-4 w-4" />
|
|
12
|
+
</slot>
|
|
13
|
+
</RangeCalendarPrev>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script lang="ts" setup>
|
|
17
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
18
|
+
import { RangeCalendarPrev, type RangeCalendarPrevProps, useForwardProps } from 'reka-ui'
|
|
19
|
+
import { ChevronLeft } from 'lucide-vue-next'
|
|
20
|
+
import { cn } from '@/utils/tailwind'
|
|
21
|
+
import { buttonVariants } from '@/components/ui/button'
|
|
22
|
+
|
|
23
|
+
const props = defineProps<RangeCalendarPrevProps & { class?: HTMLAttributes['class'] }>()
|
|
24
|
+
|
|
25
|
+
const delegatedProps = computed(() => {
|
|
26
|
+
const { class: _, ...delegated } = props
|
|
27
|
+
|
|
28
|
+
return delegated
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
32
|
+
</script>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as RangeCalendar } from './RangeCalendar.vue'
|