@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.
Files changed (221) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +1 -0
  3. package/dist/personizely-ui.css +6 -0
  4. package/dist/personizely-ui.js +26854 -0
  5. package/dist/personizely-ui.umd.cjs +111 -0
  6. package/package.json +117 -0
  7. package/src/assets/index.css +136 -0
  8. package/src/components/ui/accordion/Accordion.vue +19 -0
  9. package/src/components/ui/accordion/AccordionContent.vue +24 -0
  10. package/src/components/ui/accordion/AccordionItem.vue +37 -0
  11. package/src/components/ui/accordion/AccordionTrigger.vue +39 -0
  12. package/src/components/ui/accordion/index.ts +2 -0
  13. package/src/components/ui/alert/Alert.vue +68 -0
  14. package/src/components/ui/alert/index.ts +22 -0
  15. package/src/components/ui/alert-dialog/AlertDialog.vue +66 -0
  16. package/src/components/ui/alert-dialog/AlertDialogContent.vue +44 -0
  17. package/src/components/ui/alert-dialog/AlertDialogProvider.vue +27 -0
  18. package/src/components/ui/alert-dialog/AlertDialogTrigger.vue +11 -0
  19. package/src/components/ui/alert-dialog/index.ts +3 -0
  20. package/src/components/ui/alert-dialog/useAlertDialog.ts +19 -0
  21. package/src/components/ui/autocomplete/Autocomplete.vue +170 -0
  22. package/src/components/ui/autocomplete/AutocompleteContent.vue +27 -0
  23. package/src/components/ui/autocomplete/AutocompleteEmpty.vue +20 -0
  24. package/src/components/ui/autocomplete/AutocompleteGroup.vue +29 -0
  25. package/src/components/ui/autocomplete/AutocompleteItem.vue +26 -0
  26. package/src/components/ui/autocomplete/AutocompleteRoot.vue +31 -0
  27. package/src/components/ui/autocomplete/AutocompleteSeparator.vue +23 -0
  28. package/src/components/ui/autocomplete/index.ts +1 -0
  29. package/src/components/ui/avatar/Avatar.vue +31 -0
  30. package/src/components/ui/avatar/AvatarFallback.vue +11 -0
  31. package/src/components/ui/avatar/AvatarImage.vue +9 -0
  32. package/src/components/ui/avatar/index.ts +19 -0
  33. package/src/components/ui/badge/Badge.vue +16 -0
  34. package/src/components/ui/badge/index.ts +22 -0
  35. package/src/components/ui/button/Button.vue +123 -0
  36. package/src/components/ui/button/index.ts +78 -0
  37. package/src/components/ui/calendar/Calendar.vue +76 -0
  38. package/src/components/ui/calendar/CalendarCell.vue +24 -0
  39. package/src/components/ui/calendar/CalendarCellTrigger.vue +38 -0
  40. package/src/components/ui/calendar/CalendarGrid.vue +24 -0
  41. package/src/components/ui/calendar/CalendarGridBody.vue +11 -0
  42. package/src/components/ui/calendar/CalendarGridHead.vue +11 -0
  43. package/src/components/ui/calendar/CalendarGridRow.vue +21 -0
  44. package/src/components/ui/calendar/CalendarHeadCell.vue +21 -0
  45. package/src/components/ui/calendar/CalendarHeader.vue +21 -0
  46. package/src/components/ui/calendar/CalendarHeading.vue +27 -0
  47. package/src/components/ui/calendar/CalendarNextButton.vue +32 -0
  48. package/src/components/ui/calendar/CalendarPrevButton.vue +32 -0
  49. package/src/components/ui/calendar/index.ts +1 -0
  50. package/src/components/ui/card/Card.vue +57 -0
  51. package/src/components/ui/card/CardContent.vue +14 -0
  52. package/src/components/ui/card/CardDescription.vue +14 -0
  53. package/src/components/ui/card/CardFooter.vue +14 -0
  54. package/src/components/ui/card/CardHeader.vue +14 -0
  55. package/src/components/ui/card/CardTitle.vue +18 -0
  56. package/src/components/ui/card/CardTray.vue +14 -0
  57. package/src/components/ui/card/index.ts +1 -0
  58. package/src/components/ui/checkbox/Checkbox.vue +63 -0
  59. package/src/components/ui/checkbox/CheckboxBase.vue +39 -0
  60. package/src/components/ui/checkbox/index.ts +1 -0
  61. package/src/components/ui/checkbox-group/CheckboxGroup.vue +65 -0
  62. package/src/components/ui/checkbox-group/index.ts +15 -0
  63. package/src/components/ui/color-picker/Alpha.vue +63 -0
  64. package/src/components/ui/color-picker/Angle.vue +145 -0
  65. package/src/components/ui/color-picker/Checkboard.vue +43 -0
  66. package/src/components/ui/color-picker/Color.vue +255 -0
  67. package/src/components/ui/color-picker/ColorPicker.vue +25 -0
  68. package/src/components/ui/color-picker/Gradient.vue +172 -0
  69. package/src/components/ui/color-picker/Handle.vue +19 -0
  70. package/src/components/ui/color-picker/Hue.vue +80 -0
  71. package/src/components/ui/color-picker/LabelInput.vue +16 -0
  72. package/src/components/ui/color-picker/Rail.vue +100 -0
  73. package/src/components/ui/color-picker/Saturation.vue +142 -0
  74. package/src/components/ui/color-picker/index.ts +4 -0
  75. package/src/components/ui/combobox/Combobox.vue +202 -0
  76. package/src/components/ui/combobox/ComboboxContent.vue +27 -0
  77. package/src/components/ui/combobox/ComboboxEmpty.vue +20 -0
  78. package/src/components/ui/combobox/ComboboxGroup.vue +29 -0
  79. package/src/components/ui/combobox/ComboboxInput.vue +52 -0
  80. package/src/components/ui/combobox/ComboboxItem.vue +26 -0
  81. package/src/components/ui/combobox/ComboboxRoot.vue +31 -0
  82. package/src/components/ui/combobox/ComboboxSeparator.vue +23 -0
  83. package/src/components/ui/combobox/index.ts +1 -0
  84. package/src/components/ui/date-picker/DatePicker.vue +55 -0
  85. package/src/components/ui/date-picker/index.ts +1 -0
  86. package/src/components/ui/date-range-picker/DateRangePicker.vue +137 -0
  87. package/src/components/ui/date-range-picker/index.ts +1 -0
  88. package/src/components/ui/dialog/Dialog.vue +78 -0
  89. package/src/components/ui/dialog/DialogContent.vue +46 -0
  90. package/src/components/ui/dialog/DialogDescription.vue +24 -0
  91. package/src/components/ui/dialog/DialogFooter.vue +19 -0
  92. package/src/components/ui/dialog/DialogHeader.vue +16 -0
  93. package/src/components/ui/dialog/DialogTitle.vue +29 -0
  94. package/src/components/ui/dialog/DialogTrigger.vue +11 -0
  95. package/src/components/ui/dialog/index.ts +1 -0
  96. package/src/components/ui/drawer/Drawer.vue +88 -0
  97. package/src/components/ui/drawer/DrawerContent.vue +57 -0
  98. package/src/components/ui/drawer/DrawerDescription.vue +22 -0
  99. package/src/components/ui/drawer/DrawerFooter.vue +19 -0
  100. package/src/components/ui/drawer/DrawerHeader.vue +16 -0
  101. package/src/components/ui/drawer/DrawerTitle.vue +22 -0
  102. package/src/components/ui/drawer/DrawerTrigger.vue +11 -0
  103. package/src/components/ui/drawer/index.ts +21 -0
  104. package/src/components/ui/dropdown-menu/DropdownCheckboxGroupMenu.vue +87 -0
  105. package/src/components/ui/dropdown-menu/DropdownMenu.vue +72 -0
  106. package/src/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +40 -0
  107. package/src/components/ui/dropdown-menu/DropdownMenuContent.vue +37 -0
  108. package/src/components/ui/dropdown-menu/DropdownMenuGroup.vue +11 -0
  109. package/src/components/ui/dropdown-menu/DropdownMenuHelp.vue +14 -0
  110. package/src/components/ui/dropdown-menu/DropdownMenuItem.vue +28 -0
  111. package/src/components/ui/dropdown-menu/DropdownMenuLabel.vue +24 -0
  112. package/src/components/ui/dropdown-menu/DropdownMenuPart.vue +64 -0
  113. package/src/components/ui/dropdown-menu/DropdownMenuPartItem.vue +76 -0
  114. package/src/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +19 -0
  115. package/src/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +41 -0
  116. package/src/components/ui/dropdown-menu/DropdownMenuSeparator.vue +22 -0
  117. package/src/components/ui/dropdown-menu/DropdownMenuShortcut.vue +14 -0
  118. package/src/components/ui/dropdown-menu/DropdownMenuSub.vue +19 -0
  119. package/src/components/ui/dropdown-menu/DropdownMenuSubContent.vue +30 -0
  120. package/src/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +33 -0
  121. package/src/components/ui/dropdown-menu/DropdownMenuTrigger.vue +13 -0
  122. package/src/components/ui/dropdown-menu/DropdownRadioGroupMenu.vue +75 -0
  123. package/src/components/ui/dropdown-menu/index.ts +36 -0
  124. package/src/components/ui/file-upload-button/FileUploadButton.vue +55 -0
  125. package/src/components/ui/file-upload-button/index.ts +1 -0
  126. package/src/components/ui/form/Form.vue +13 -0
  127. package/src/components/ui/form/FormControl.vue +16 -0
  128. package/src/components/ui/form/FormDescription.vue +20 -0
  129. package/src/components/ui/form/FormField.vue +61 -0
  130. package/src/components/ui/form/FormLabel.vue +23 -0
  131. package/src/components/ui/form/FormMessage.vue +16 -0
  132. package/src/components/ui/form/index.ts +2 -0
  133. package/src/components/ui/form/useFormField.ts +30 -0
  134. package/src/components/ui/icon/Icon.vue +16 -0
  135. package/src/components/ui/icon/index.ts +1 -0
  136. package/src/components/ui/input/Input.vue +51 -0
  137. package/src/components/ui/input/InputBase.vue +18 -0
  138. package/src/components/ui/input/index.ts +1 -0
  139. package/src/components/ui/label/Label.vue +27 -0
  140. package/src/components/ui/label/index.ts +1 -0
  141. package/src/components/ui/pagination/Pagination.vue +50 -0
  142. package/src/components/ui/pagination/PaginationContent.vue +21 -0
  143. package/src/components/ui/pagination/PaginationEllipsis.vue +24 -0
  144. package/src/components/ui/pagination/PaginationFirst.vue +32 -0
  145. package/src/components/ui/pagination/PaginationItem.vue +32 -0
  146. package/src/components/ui/pagination/PaginationLast.vue +32 -0
  147. package/src/components/ui/pagination/PaginationNext.vue +32 -0
  148. package/src/components/ui/pagination/PaginationPrevious.vue +32 -0
  149. package/src/components/ui/pagination/index.ts +1 -0
  150. package/src/components/ui/popover/Popover.vue +57 -0
  151. package/src/components/ui/popover/PopoverTrigger.vue +15 -0
  152. package/src/components/ui/popover/index.ts +1 -0
  153. package/src/components/ui/progress/Progress.vue +35 -0
  154. package/src/components/ui/progress/ProgressIndicator.vue +19 -0
  155. package/src/components/ui/progress/index.ts +2 -0
  156. package/src/components/ui/progress-circular/ProgressCircular.vue +85 -0
  157. package/src/components/ui/progress-circular/index.ts +1 -0
  158. package/src/components/ui/radio-group/RadioGroup.vue +81 -0
  159. package/src/components/ui/radio-group/RadioGroupItem.vue +39 -0
  160. package/src/components/ui/radio-group/index.ts +15 -0
  161. package/src/components/ui/range-calendar/RangeCalendar.vue +71 -0
  162. package/src/components/ui/range-calendar/RangeCalendarCell.vue +28 -0
  163. package/src/components/ui/range-calendar/RangeCalendarCellTrigger.vue +40 -0
  164. package/src/components/ui/range-calendar/RangeCalendarGrid.vue +24 -0
  165. package/src/components/ui/range-calendar/RangeCalendarGridBody.vue +11 -0
  166. package/src/components/ui/range-calendar/RangeCalendarGridHead.vue +11 -0
  167. package/src/components/ui/range-calendar/RangeCalendarGridRow.vue +21 -0
  168. package/src/components/ui/range-calendar/RangeCalendarHeadCell.vue +21 -0
  169. package/src/components/ui/range-calendar/RangeCalendarHeader.vue +21 -0
  170. package/src/components/ui/range-calendar/RangeCalendarHeading.vue +27 -0
  171. package/src/components/ui/range-calendar/RangeCalendarNextButton.vue +32 -0
  172. package/src/components/ui/range-calendar/RangeCalendarPrevButton.vue +32 -0
  173. package/src/components/ui/range-calendar/index.ts +1 -0
  174. package/src/components/ui/select/Select.vue +120 -0
  175. package/src/components/ui/select/SelectContent.vue +45 -0
  176. package/src/components/ui/select/SelectGroup.vue +19 -0
  177. package/src/components/ui/select/SelectItem.vue +43 -0
  178. package/src/components/ui/select/SelectLabel.vue +13 -0
  179. package/src/components/ui/select/SelectSeparator.vue +17 -0
  180. package/src/components/ui/select/SelectTrigger.vue +31 -0
  181. package/src/components/ui/select/SelectValue.vue +11 -0
  182. package/src/components/ui/select/index.ts +1 -0
  183. package/src/components/ui/slider/Slider.vue +100 -0
  184. package/src/components/ui/slider/index.ts +1 -0
  185. package/src/components/ui/switch/Switch.vue +40 -0
  186. package/src/components/ui/switch/SwitchBase.vue +36 -0
  187. package/src/components/ui/switch/index.ts +1 -0
  188. package/src/components/ui/tabs/Tabs.vue +63 -0
  189. package/src/components/ui/tabs/TabsContent.vue +26 -0
  190. package/src/components/ui/tabs/TabsTrigger.vue +27 -0
  191. package/src/components/ui/tabs/index.ts +28 -0
  192. package/src/components/ui/textarea/Textarea.vue +13 -0
  193. package/src/components/ui/textarea/index.ts +1 -0
  194. package/src/components/ui/toast/Toast.vue +28 -0
  195. package/src/components/ui/toast/ToastAction.vue +26 -0
  196. package/src/components/ui/toast/ToastClose.vue +29 -0
  197. package/src/components/ui/toast/ToastDescription.vue +19 -0
  198. package/src/components/ui/toast/ToastProvider.vue +11 -0
  199. package/src/components/ui/toast/ToastTitle.vue +19 -0
  200. package/src/components/ui/toast/ToastViewport.vue +17 -0
  201. package/src/components/ui/toast/Toaster.vue +30 -0
  202. package/src/components/ui/toast/index.ts +34 -0
  203. package/src/components/ui/toast/useToast.ts +163 -0
  204. package/src/components/ui/toggle/Toggle.vue +51 -0
  205. package/src/components/ui/toggle/index.ts +71 -0
  206. package/src/components/ui/toggle-group/ToggleGroup.vue +58 -0
  207. package/src/components/ui/toggle-group/ToggleGroupItem.vue +54 -0
  208. package/src/components/ui/toggle-group/index.ts +1 -0
  209. package/src/components/ui/tooltip/Tooltip.vue +42 -0
  210. package/src/components/ui/tooltip/TooltipProvider.vue +11 -0
  211. package/src/components/ui/tooltip/index.ts +2 -0
  212. package/src/composables/delegated-props.ts +6 -0
  213. package/src/composables/emits-as-props.ts +17 -0
  214. package/src/composables/forward-props-emits.ts +11 -0
  215. package/src/directives/autofocus.ts +7 -0
  216. package/src/index.ts +159 -0
  217. package/src/options-provider.ts +19 -0
  218. package/src/utils/gradient.ts +158 -0
  219. package/src/utils/options.ts +40 -0
  220. package/src/utils/tailwind.ts +14 -0
  221. package/web-types.json +10560 -0
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <form :class="cn('flex flex-col gap-4', props.class)">
3
+ <slot />
4
+ </form>
5
+ </template>
6
+ <script setup lang="ts">
7
+ import { cn } from '@/utils/tailwind'
8
+ import type { HTMLAttributes } from 'vue'
9
+
10
+ const props = defineProps<{
11
+ class?: HTMLAttributes['class']
12
+ }>()
13
+ </script>
@@ -0,0 +1,16 @@
1
+ <template>
2
+ <Slot
3
+ :id="formItemId"
4
+ :aria-describedby="!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`"
5
+ :aria-invalid="!!error"
6
+ >
7
+ <slot />
8
+ </Slot>
9
+ </template>
10
+
11
+ <script lang="ts" setup>
12
+ import { Slot } from 'reka-ui'
13
+ import { useFormField } from './useFormField'
14
+
15
+ const { error, formItemId, formDescriptionId, formMessageId } = useFormField()
16
+ </script>
@@ -0,0 +1,20 @@
1
+ <template>
2
+ <p
3
+ :id="formDescriptionId"
4
+ :class="cn('text-sm text-muted-foreground group-[:has([disabled])]:opacity-70 group-[:has([disabled])]:cursor-not-allowed', props.class)"
5
+ >
6
+ <slot />
7
+ </p>
8
+ </template>
9
+
10
+ <script lang="ts" setup>
11
+ import type { HTMLAttributes } from 'vue'
12
+ import { useFormField } from './useFormField'
13
+ import { cn } from '@/utils/tailwind'
14
+
15
+ const props = defineProps<{
16
+ class?: HTMLAttributes['class']
17
+ }>()
18
+
19
+ const { formDescriptionId } = useFormField()
20
+ </script>
@@ -0,0 +1,61 @@
1
+ <template>
2
+ <Field
3
+ v-slot="slotProps"
4
+ :name="name"
5
+ :rules="rules"
6
+ :model-modifiers="modelModifiers"
7
+ :label="errorLabel || label"
8
+ >
9
+ <div :class="cn('flex flex-col gap-2 group', props.class)">
10
+ <FormLabel v-if="$slots.label || label" :class="required ? 'after:content-[\'*\'] after:ms-0.5 after:text-red-500 dark:after:text-red-40' : ''">
11
+ <slot name="label">
12
+ {{ label }}
13
+ </slot>
14
+ </FormLabel>
15
+ <FormControl>
16
+ <slot v-bind="slotProps" />
17
+ </FormControl>
18
+ <FormDescription v-if="($slots.description || description) && !slotProps.errors.length">
19
+ <slot name="description">
20
+ {{ description }}
21
+ </slot>
22
+ </FormDescription>
23
+ <FormMessage />
24
+ </div>
25
+ </Field>
26
+ </template>
27
+
28
+ <script lang="ts">
29
+ import type { HTMLAttributes, InjectionKey } from 'vue'
30
+
31
+ export const FORM_ITEM_INJECTION_KEY
32
+ = Symbol() as InjectionKey<string>
33
+ </script>
34
+
35
+ <script lang="ts" setup>
36
+ import { Field } from 'vee-validate'
37
+ import { provide } from 'vue'
38
+ import { useId } from 'reka-ui'
39
+ import { cn } from '@/utils/tailwind'
40
+ import FormMessage from './FormMessage.vue'
41
+ import FormDescription from './FormDescription.vue'
42
+ import FormControl from './FormControl.vue'
43
+ import FormLabel from './FormLabel.vue'
44
+
45
+ const props = withDefaults(defineProps<{
46
+ class?: HTMLAttributes['class'],
47
+ name: string
48
+ description?: string
49
+ label?: string
50
+ errorLabel?: string
51
+ required?: boolean
52
+ rules?: string
53
+ modelModifiers?: { [key:string]: any }
54
+ }>(), {
55
+ default: () => {},
56
+ required: false
57
+ })
58
+
59
+ const id = useId()
60
+ provide(FORM_ITEM_INJECTION_KEY, id)
61
+ </script>
@@ -0,0 +1,23 @@
1
+ <template>
2
+ <Label
3
+ :class="cn(
4
+ error && 'text-destructive',
5
+ props.class,
6
+ )"
7
+ :for="formItemId"
8
+ >
9
+ <slot />
10
+ </Label>
11
+ </template>
12
+
13
+ <script lang="ts" setup>
14
+ import type { HTMLAttributes } from 'vue'
15
+ import type { LabelProps } from 'reka-ui'
16
+ import { useFormField } from './useFormField'
17
+ import { cn } from '@/utils/tailwind'
18
+ import { Label } from '@/components/ui/label'
19
+
20
+ const props = defineProps<LabelProps & { class?: HTMLAttributes['class'] }>()
21
+
22
+ const { error, formItemId } = useFormField()
23
+ </script>
@@ -0,0 +1,16 @@
1
+ <template>
2
+ <ErrorMessage
3
+ :id="formMessageId"
4
+ as="p"
5
+ :name="toValue(name)"
6
+ class="text-sm text-destructive group-[:has([disabled])]:opacity-70 group-[:has([disabled])]:cursor-not-allowed"
7
+ />
8
+ </template>
9
+
10
+ <script lang="ts" setup>
11
+ import { ErrorMessage } from 'vee-validate'
12
+ import { toValue } from 'vue'
13
+ import { useFormField } from './useFormField'
14
+
15
+ const { name, formMessageId } = useFormField()
16
+ </script>
@@ -0,0 +1,2 @@
1
+ export { default as Form } from './Form.vue'
2
+ export { default as FormField } from './FormField.vue'
@@ -0,0 +1,30 @@
1
+ import { FieldContextKey, useFieldError, useIsFieldDirty, useIsFieldTouched, useIsFieldValid } from 'vee-validate'
2
+ import { inject } from 'vue'
3
+ import { FORM_ITEM_INJECTION_KEY } from './FormField.vue'
4
+
5
+ export function useFormField () {
6
+ const fieldContext = inject(FieldContextKey)
7
+ const fieldItemContext = inject(FORM_ITEM_INJECTION_KEY)
8
+
9
+ const fieldState = {
10
+ valid: useIsFieldValid(),
11
+ isDirty: useIsFieldDirty(),
12
+ isTouched: useIsFieldTouched(),
13
+ error: useFieldError()
14
+ }
15
+
16
+ if (!fieldContext)
17
+ throw new Error('useFormField should be used within <FormField>')
18
+
19
+ const { name } = fieldContext
20
+ const id = fieldItemContext
21
+
22
+ return {
23
+ id,
24
+ name,
25
+ formItemId: `${id}-form-item`,
26
+ formDescriptionId: `${id}-form-item-description`,
27
+ formMessageId: `${id}-form-item-message`,
28
+ ...fieldState
29
+ }
30
+ }
@@ -0,0 +1,16 @@
1
+ <template>
2
+ <Icon :icon="`${iconSet}:${icon}`" :aria-label="ariaLabel" />
3
+ </template>
4
+
5
+ <script setup lang="ts">
6
+ import { Icon } from '@iconify/vue'
7
+
8
+ withDefaults(defineProps<{
9
+ icon: string,
10
+ iconSet?: string,
11
+ ariaLabel?: string | null
12
+ }>(), {
13
+ iconSet: 'lucide',
14
+ ariaLabel: null
15
+ })
16
+ </script>
@@ -0,0 +1 @@
1
+ export { default as Icon } from './Icon.vue'
@@ -0,0 +1,51 @@
1
+ <template>
2
+ <div :class="cn('relative w-full items-center', props.class)">
3
+ <InputBase
4
+ v-bind="$attrs"
5
+ v-model="modelValue"
6
+ v-autofocus="autofocus"
7
+ :class="[
8
+ ((icon && iconPosition === 'left') || $slots.leading) && 'ps-8',
9
+ ((icon && iconPosition === 'right') || $slots.trailing) && 'pe-8'
10
+ ]"
11
+ @change="$emit('change', $event)"
12
+ />
13
+ <span v-if="$slots.leading || (icon && iconPosition === 'left')" class="absolute start-0 inset-y-0 flex items-center justify-center px-2 pointer-events-none">
14
+ <slot name="leading">
15
+ <Icon :icon="icon!" class="size-4 text-muted-foreground" />
16
+ </slot>
17
+ </span>
18
+ <span v-if="$slots.trailing || (icon && iconPosition === 'right')" class="absolute end-0 inset-y-0 flex items-center justify-center px-2 pointer-events-none">
19
+ <slot name="trailing">
20
+ <Icon :icon="icon!" class="size-4 text-muted-foreground" />
21
+ </slot>
22
+ </span>
23
+ </div>
24
+ </template>
25
+
26
+ <script setup lang="ts">
27
+ import { type HTMLAttributes } from 'vue'
28
+ import { cn } from '@/utils/tailwind'
29
+ import vAutofocus from '@/directives/autofocus'
30
+ import { Icon } from '@/components/ui/icon'
31
+ import InputBase from '@/components/ui/input/InputBase.vue'
32
+
33
+ defineOptions({
34
+ inheritAttrs: false
35
+ })
36
+
37
+ const modelValue = defineModel<string | number | null>()
38
+ defineEmits<{
39
+ change: [value: InputEvent]
40
+ }>()
41
+
42
+ const props = withDefaults(defineProps<{
43
+ autofocus?: boolean
44
+ icon?: string
45
+ iconPosition?: string
46
+ class?: HTMLAttributes['class']
47
+ }>(), {
48
+ iconPosition: 'left',
49
+ autofocus: false
50
+ })
51
+ </script>
@@ -0,0 +1,18 @@
1
+ <template>
2
+ <input
3
+ :value="modelValue"
4
+ :class="cn('flex h-8 w-full rounded-md border border-input bg-background px-2 py-1 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50', props.class)"
5
+ @input="modelValue = ($event.target as HTMLInputElement).value"
6
+ >
7
+ </template>
8
+
9
+ <script setup lang="ts">
10
+ import type { HTMLAttributes } from 'vue'
11
+ import { cn } from '@/utils/tailwind'
12
+
13
+ const modelValue = defineModel<string | number | null>()
14
+
15
+ const props = defineProps<{
16
+ class?: HTMLAttributes['class']
17
+ }>()
18
+ </script>
@@ -0,0 +1 @@
1
+ export { default as Input } from './Input.vue'
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <Label
3
+ v-bind="delegatedProps"
4
+ :class="
5
+ cn(
6
+ 'text-sm font-medium leading-[1.2] peer-disabled:cursor-not-allowed peer-disabled:opacity-70 group-[:has([disabled])]:opacity-70 group-[:has([disabled])]:cursor-not-allowed',
7
+ props.class,
8
+ )
9
+ "
10
+ >
11
+ <slot />
12
+ </Label>
13
+ </template>
14
+
15
+ <script setup lang="ts">
16
+ import { type HTMLAttributes, computed } from 'vue'
17
+ import { Label, type LabelProps } from 'reka-ui'
18
+ import { cn } from '@/utils/tailwind'
19
+
20
+ const props = defineProps<LabelProps & { class?: HTMLAttributes['class'] }>()
21
+
22
+ const delegatedProps = computed(() => {
23
+ const { class: _, ...delegated } = props
24
+
25
+ return delegated
26
+ })
27
+ </script>
@@ -0,0 +1 @@
1
+ export { default as Label } from './Label.vue'
@@ -0,0 +1,50 @@
1
+ <template>
2
+ <PaginationRoot
3
+ data-slot="pagination"
4
+ v-bind="forwarded"
5
+ :class="cn('mx-auto flex w-full justify-center', props.class)"
6
+ >
7
+ <PaginationContent v-slot="{ items }">
8
+ <PaginationFirst />
9
+ <PaginationPrevious />
10
+
11
+ <template v-for="(item, index) in items" :key="index">
12
+ <PaginationItem
13
+ v-if="item.type === 'page'"
14
+ :value="item.value"
15
+ :is-active="item.value === page"
16
+ >
17
+ {{ item.value }}
18
+ </PaginationItem>
19
+
20
+ <PaginationEllipsis v-else :key="item.type" :index="index" />
21
+ </template>
22
+
23
+ <PaginationNext />
24
+ <PaginationLast />
25
+ </PaginationContent>
26
+ </PaginationRoot>
27
+ </template>
28
+
29
+ <script setup lang="ts">
30
+ import type { HTMLAttributes } from 'vue'
31
+ import { reactiveOmit } from '@vueuse/core'
32
+ import { PaginationRoot, type PaginationRootEmits, type PaginationRootProps, useForwardPropsEmits } from 'reka-ui'
33
+ import PaginationContent from './PaginationContent.vue'
34
+ import PaginationItem from './PaginationItem.vue'
35
+ import PaginationFirst from './PaginationFirst.vue'
36
+ import PaginationPrevious from './PaginationPrevious.vue'
37
+ import PaginationNext from './PaginationNext.vue'
38
+ import PaginationLast from './PaginationLast.vue'
39
+ import PaginationEllipsis from './PaginationEllipsis.vue'
40
+ import { cn } from '@/utils/tailwind'
41
+
42
+ const props = defineProps<PaginationRootProps & {
43
+ class?: HTMLAttributes['class']
44
+ }>()
45
+
46
+ const emits = defineEmits<PaginationRootEmits>()
47
+
48
+ const delegatedProps = reactiveOmit(props, 'class')
49
+ const forwarded = useForwardPropsEmits(delegatedProps, emits)
50
+ </script>
@@ -0,0 +1,21 @@
1
+ <template>
2
+ <PaginationList
3
+ v-slot="slotProps"
4
+ data-slot="pagination-content"
5
+ v-bind="delegatedProps"
6
+ :class="cn('flex flex-row items-center gap-1', props.class)"
7
+ >
8
+ <slot v-bind="slotProps" />
9
+ </PaginationList>
10
+ </template>
11
+
12
+ <script setup lang="ts">
13
+ import type { HTMLAttributes } from 'vue'
14
+ import { reactiveOmit } from '@vueuse/core'
15
+ import { PaginationList, type PaginationListProps } from 'reka-ui'
16
+ import { cn } from '@/utils/tailwind'
17
+
18
+ const props = defineProps<PaginationListProps & { class?: HTMLAttributes['class'] }>()
19
+
20
+ const delegatedProps = reactiveOmit(props, 'class')
21
+ </script>
@@ -0,0 +1,24 @@
1
+ <template>
2
+ <PaginationEllipsis
3
+ data-slot="pagination-ellipsis"
4
+ v-bind="delegatedProps"
5
+ :class="cn('flex size-9 items-center justify-center', props.class)"
6
+ >
7
+ <slot>
8
+ <Ellipsis class="size-4" />
9
+ <span class="sr-only">More pages</span>
10
+ </slot>
11
+ </PaginationEllipsis>
12
+ </template>
13
+
14
+ <script setup lang="ts">
15
+ import type { HTMLAttributes } from 'vue'
16
+ import { reactiveOmit } from '@vueuse/core'
17
+ import { Ellipsis } from 'lucide-vue-next'
18
+ import { PaginationEllipsis, type PaginationEllipsisProps } from 'reka-ui'
19
+ import { cn } from '@/utils/tailwind'
20
+
21
+ const props = defineProps<PaginationEllipsisProps & { class?: HTMLAttributes['class'] }>()
22
+
23
+ const delegatedProps = reactiveOmit(props, 'class')
24
+ </script>
@@ -0,0 +1,32 @@
1
+ <template>
2
+ <PaginationFirst
3
+ data-slot="pagination-first"
4
+ :class="cn(buttonVariants({ variant: 'ghost', size, icon: true }), props.class)"
5
+ v-bind="forwarded"
6
+ >
7
+ <slot>
8
+ <ChevronsLeftIcon />
9
+ <span class="sr-only">First</span>
10
+ </slot>
11
+ </PaginationFirst>
12
+ </template>
13
+
14
+ <script setup lang="ts">
15
+ import type { PaginationFirstProps } from 'reka-ui'
16
+ import type { HTMLAttributes } from 'vue'
17
+ import { reactiveOmit } from '@vueuse/core'
18
+ import { ChevronsLeftIcon } from 'lucide-vue-next'
19
+ import { PaginationFirst, useForwardProps } from 'reka-ui'
20
+ import { cn } from '@/utils/tailwind'
21
+ import { buttonVariants, type ButtonVariants } from '@/components/ui/button'
22
+
23
+ const props = withDefaults(defineProps<PaginationFirstProps & {
24
+ size?: ButtonVariants['size']
25
+ class?: HTMLAttributes['class']
26
+ }>(), {
27
+ size: 'md'
28
+ })
29
+
30
+ const delegatedProps = reactiveOmit(props, 'class', 'size')
31
+ const forwarded = useForwardProps(delegatedProps)
32
+ </script>
@@ -0,0 +1,32 @@
1
+ <template>
2
+ <PaginationListItem
3
+ data-slot="pagination-item"
4
+ v-bind="delegatedProps"
5
+ :class="cn(
6
+ buttonVariants({
7
+ variant: isActive ? 'outline' : 'ghost',
8
+ size,
9
+ }),
10
+ props.class)"
11
+ >
12
+ <slot />
13
+ </PaginationListItem>
14
+ </template>
15
+
16
+ <script setup lang="ts">
17
+ import type { HTMLAttributes } from 'vue'
18
+ import { reactiveOmit } from '@vueuse/core'
19
+ import { PaginationListItem, type PaginationListItemProps } from 'reka-ui'
20
+ import { cn } from '@/utils/tailwind'
21
+ import { buttonVariants, type ButtonVariants } from '@/components/ui/button'
22
+
23
+ const props = withDefaults(defineProps<PaginationListItemProps & {
24
+ size?: ButtonVariants['size']
25
+ class?: HTMLAttributes['class']
26
+ isActive?: boolean
27
+ }>(), {
28
+ size: 'md'
29
+ })
30
+
31
+ const delegatedProps = reactiveOmit(props, 'class', 'size', 'isActive')
32
+ </script>
@@ -0,0 +1,32 @@
1
+ <template>
2
+ <PaginationLast
3
+ data-slot="pagination-last"
4
+ :class="cn(buttonVariants({ variant: 'ghost', size, icon: true }), props.class)"
5
+ v-bind="forwarded"
6
+ >
7
+ <slot>
8
+ <span class="sr-only">Last</span>
9
+ <ChevronsRightIcon />
10
+ </slot>
11
+ </PaginationLast>
12
+ </template>
13
+
14
+ <script setup lang="ts">
15
+ import type { PaginationLastProps } from 'reka-ui'
16
+ import type { HTMLAttributes } from 'vue'
17
+ import { reactiveOmit } from '@vueuse/core'
18
+ import { ChevronsRightIcon } from 'lucide-vue-next'
19
+ import { PaginationLast, useForwardProps } from 'reka-ui'
20
+ import { cn } from '@/utils/tailwind'
21
+ import { buttonVariants, type ButtonVariants } from '@/components/ui/button'
22
+
23
+ const props = withDefaults(defineProps<PaginationLastProps & {
24
+ size?: ButtonVariants['size']
25
+ class?: HTMLAttributes['class']
26
+ }>(), {
27
+ size: 'sm'
28
+ })
29
+
30
+ const delegatedProps = reactiveOmit(props, 'class', 'size')
31
+ const forwarded = useForwardProps(delegatedProps)
32
+ </script>
@@ -0,0 +1,32 @@
1
+ <template>
2
+ <PaginationNext
3
+ data-slot="pagination-next"
4
+ :class="cn(buttonVariants({ variant: 'ghost', size, icon: true }), props.class)"
5
+ v-bind="forwarded"
6
+ >
7
+ <slot>
8
+ <span class="sr-only">Next</span>
9
+ <ChevronRightIcon />
10
+ </slot>
11
+ </PaginationNext>
12
+ </template>
13
+
14
+ <script setup lang="ts">
15
+ import type { PaginationNextProps } from 'reka-ui'
16
+ import type { HTMLAttributes } from 'vue'
17
+ import { reactiveOmit } from '@vueuse/core'
18
+ import { ChevronRightIcon } from 'lucide-vue-next'
19
+ import { PaginationNext, useForwardProps } from 'reka-ui'
20
+ import { cn } from '@/utils/tailwind'
21
+ import { buttonVariants, type ButtonVariants } from '@/components/ui/button'
22
+
23
+ const props = withDefaults(defineProps<PaginationNextProps & {
24
+ size?: ButtonVariants['size']
25
+ class?: HTMLAttributes['class']
26
+ }>(), {
27
+ size: 'md'
28
+ })
29
+
30
+ const delegatedProps = reactiveOmit(props, 'class', 'size')
31
+ const forwarded = useForwardProps(delegatedProps)
32
+ </script>
@@ -0,0 +1,32 @@
1
+ <template>
2
+ <PaginationPrev
3
+ data-slot="pagination-previous"
4
+ :class="cn(buttonVariants({ variant: 'ghost', size, icon: true }), props.class)"
5
+ v-bind="forwarded"
6
+ >
7
+ <slot>
8
+ <ChevronLeftIcon />
9
+ <span class="sr-only">Previous</span>
10
+ </slot>
11
+ </PaginationPrev>
12
+ </template>
13
+
14
+ <script setup lang="ts">
15
+ import type { PaginationPrevProps } from 'reka-ui'
16
+ import type { HTMLAttributes } from 'vue'
17
+ import { reactiveOmit } from '@vueuse/core'
18
+ import { ChevronLeftIcon } from 'lucide-vue-next'
19
+ import { PaginationPrev, useForwardProps } from 'reka-ui'
20
+ import { cn } from '@/utils/tailwind'
21
+ import { buttonVariants, type ButtonVariants } from '@/components/ui/button'
22
+
23
+ const props = withDefaults(defineProps<PaginationPrevProps & {
24
+ size?: ButtonVariants['size']
25
+ class?: HTMLAttributes['class']
26
+ }>(), {
27
+ size: 'md'
28
+ })
29
+
30
+ const delegatedProps = reactiveOmit(props, 'class', 'size')
31
+ const forwarded = useForwardProps(delegatedProps)
32
+ </script>
@@ -0,0 +1 @@
1
+ export { default as Pagination } from './Pagination.vue'
@@ -0,0 +1,57 @@
1
+ <template>
2
+ <PopoverRoot v-bind="forwarded">
3
+ <PopoverTrigger v-if="$slots.trigger">
4
+ <slot name="trigger" />
5
+ </PopoverTrigger>
6
+
7
+ <PopoverPortal :to="options.portalTo">
8
+ <PopoverContent
9
+ :align="align"
10
+ :align-offset="alignOffset"
11
+ :side="side"
12
+ :side-offset="alignOffset"
13
+ v-bind="$attrs"
14
+ :class="
15
+ cn(
16
+ 'z-50 min-w-48 max-h-[calc(var(--reka-popper-available-height)-4px)] overflow-auto rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[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',
17
+ props.class,
18
+ )
19
+ "
20
+ >
21
+ <div class="text-sm">
22
+ <slot />
23
+ </div>
24
+ </PopoverContent>
25
+ </PopoverPortal>
26
+ </PopoverRoot>
27
+ </template>
28
+
29
+ <script setup lang="ts">
30
+ import {
31
+ PopoverPortal,
32
+ PopoverRoot,
33
+ PopoverContent,
34
+ type PopoverContentProps,
35
+ useForwardPropsEmits
36
+ } from 'reka-ui'
37
+ import type { PopoverRootEmits, PopoverRootProps } from 'reka-ui'
38
+ import { cn } from '@/utils/tailwind'
39
+ import { type HTMLAttributes } from 'vue'
40
+ import PopoverTrigger from './PopoverTrigger.vue'
41
+ import { useDelegatedProps } from '@/composables/delegated-props'
42
+ import { getOptions } from '@/options-provider'
43
+
44
+ const props = withDefaults(defineProps<PopoverRootProps & Pick<PopoverContentProps, 'side' | 'align' | 'alignOffset' | 'sideOffset'> & {
45
+ class?: HTMLAttributes['class']
46
+ }>(), {
47
+ align: 'center',
48
+ alignOffset: 4,
49
+ side: 'bottom',
50
+ sideOffset: 4
51
+ })
52
+ const emits = defineEmits<PopoverRootEmits>()
53
+
54
+ const delegatedProps = useDelegatedProps(props, ['side', 'align', 'alignOffset', 'sideOffset', 'class'])
55
+ const forwarded = useForwardPropsEmits(delegatedProps, emits)
56
+ const options = getOptions()
57
+ </script>
@@ -0,0 +1,15 @@
1
+ <template>
2
+ <PopoverTrigger as-child>
3
+ <slot />
4
+ </PopoverTrigger>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ import {
9
+ PopoverTrigger
10
+ } from 'reka-ui'
11
+ import { provide } from 'vue'
12
+
13
+
14
+ provide('hasDropdown', true)
15
+ </script>
@@ -0,0 +1 @@
1
+ export { default as Popover } from './Popover.vue'