@geektr.cloud/acrux-ui 0.0.0-stage → 0.1.0

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 (156) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +21 -2
  3. package/package.json +70 -3
  4. package/src/components/acrux-ui/actions/ConfirmPopover.vue +107 -0
  5. package/src/components/acrux-ui/actions/FormShell.vue +96 -0
  6. package/src/components/acrux-ui/actions/RemovalButton.vue +65 -0
  7. package/src/components/acrux-ui/actions/Stepper.vue +116 -0
  8. package/src/components/acrux-ui/actions/form.ts +36 -0
  9. package/src/components/acrux-ui/actions/index.ts +70 -0
  10. package/src/components/acrux-ui/actions/stepper.ts +65 -0
  11. package/src/components/acrux-ui/actions/utils.ts +138 -0
  12. package/src/components/acrux-ui/base/CopyBtn.vue +85 -0
  13. package/src/components/acrux-ui/base/EmptyValue.vue +25 -0
  14. package/src/components/acrux-ui/base/Icon.vue +44 -0
  15. package/src/components/acrux-ui/base/IconBtn.vue +51 -0
  16. package/src/components/acrux-ui/base/Text.vue +85 -0
  17. package/src/components/acrux-ui/base/VSeparator.vue +21 -0
  18. package/src/components/acrux-ui/base/async.ts +35 -0
  19. package/src/components/acrux-ui/base/index.ts +7 -0
  20. package/src/components/acrux-ui/display/AsyncError.vue +46 -0
  21. package/src/components/acrux-ui/display/CodeBlock.vue +91 -0
  22. package/src/components/acrux-ui/display/CopyTag.vue +51 -0
  23. package/src/components/acrux-ui/display/DataView.ts +47 -0
  24. package/src/components/acrux-ui/display/DateFormatter.vue +61 -0
  25. package/src/components/acrux-ui/display/Disclosure.vue +45 -0
  26. package/src/components/acrux-ui/display/Link.vue +81 -0
  27. package/src/components/acrux-ui/display/MultiLine.vue +29 -0
  28. package/src/components/acrux-ui/display/Notice.vue +71 -0
  29. package/src/components/acrux-ui/display/Pem.vue +165 -0
  30. package/src/components/acrux-ui/display/QrBtn.vue +117 -0
  31. package/src/components/acrux-ui/display/QrModal.vue +76 -0
  32. package/src/components/acrux-ui/display/Route.vue +52 -0
  33. package/src/components/acrux-ui/display/Token.vue +106 -0
  34. package/src/components/acrux-ui/display/UUID.vue +46 -0
  35. package/src/components/acrux-ui/display/index.ts +17 -0
  36. package/src/components/acrux-ui/display/pem.ts +100 -0
  37. package/src/components/acrux-ui/display/qr.ts +20 -0
  38. package/src/components/acrux-ui/fields/EntitySelect.vue +253 -0
  39. package/src/components/acrux-ui/fields/FieldError.vue +11 -0
  40. package/src/components/acrux-ui/fields/JsonTextArea.vue +105 -0
  41. package/src/components/acrux-ui/fields/MultiLineInput.vue +145 -0
  42. package/src/components/acrux-ui/fields/Select.vue +106 -0
  43. package/src/components/acrux-ui/fields/fieldAccessibility.ts +38 -0
  44. package/src/components/acrux-ui/fields/index.ts +4 -0
  45. package/src/components/acrux-ui/page/BackButton.vue +70 -0
  46. package/src/components/acrux-ui/page/PageDetail.vue +125 -0
  47. package/src/components/acrux-ui/page/PageEntry.vue +130 -0
  48. package/src/components/acrux-ui/page/PageState.vue +108 -0
  49. package/src/components/acrux-ui/page/index.ts +3 -0
  50. package/src/components/acrux-ui/page/pageState.ts +18 -0
  51. package/src/components/ui/alert/Alert.vue +17 -0
  52. package/src/components/ui/alert/AlertAction.vue +17 -0
  53. package/src/components/ui/alert/AlertDescription.vue +22 -0
  54. package/src/components/ui/alert/AlertTitle.vue +22 -0
  55. package/src/components/ui/alert/index.ts +25 -0
  56. package/src/components/ui/badge/Badge.vue +29 -0
  57. package/src/components/ui/badge/index.ts +25 -0
  58. package/src/components/ui/button/Button.vue +31 -0
  59. package/src/components/ui/button/index.ts +39 -0
  60. package/src/components/ui/card/Card.vue +29 -0
  61. package/src/components/ui/card/CardAction.vue +17 -0
  62. package/src/components/ui/card/CardContent.vue +14 -0
  63. package/src/components/ui/card/CardDescription.vue +14 -0
  64. package/src/components/ui/card/CardFooter.vue +17 -0
  65. package/src/components/ui/card/CardHeader.vue +22 -0
  66. package/src/components/ui/card/CardTitle.vue +14 -0
  67. package/src/components/ui/card/index.ts +7 -0
  68. package/src/components/ui/collapsible/Collapsible.vue +15 -0
  69. package/src/components/ui/collapsible/CollapsibleContent.vue +12 -0
  70. package/src/components/ui/collapsible/CollapsibleTrigger.vue +12 -0
  71. package/src/components/ui/collapsible/index.ts +3 -0
  72. package/src/components/ui/combobox/Combobox.vue +15 -0
  73. package/src/components/ui/combobox/ComboboxAnchor.vue +19 -0
  74. package/src/components/ui/combobox/ComboboxEmpty.vue +26 -0
  75. package/src/components/ui/combobox/ComboboxInput.vue +40 -0
  76. package/src/components/ui/combobox/ComboboxItem.vue +29 -0
  77. package/src/components/ui/combobox/ComboboxList.vue +38 -0
  78. package/src/components/ui/combobox/ComboboxViewport.vue +28 -0
  79. package/src/components/ui/combobox/index.ts +9 -0
  80. package/src/components/ui/empty/Empty.vue +22 -0
  81. package/src/components/ui/empty/EmptyContent.vue +17 -0
  82. package/src/components/ui/empty/EmptyDescription.vue +22 -0
  83. package/src/components/ui/empty/EmptyHeader.vue +14 -0
  84. package/src/components/ui/empty/EmptyMedia.vue +22 -0
  85. package/src/components/ui/empty/EmptyTitle.vue +14 -0
  86. package/src/components/ui/empty/index.ts +26 -0
  87. package/src/components/ui/field/Field.vue +27 -0
  88. package/src/components/ui/field/FieldContent.vue +17 -0
  89. package/src/components/ui/field/FieldDescription.vue +24 -0
  90. package/src/components/ui/field/FieldError.vue +50 -0
  91. package/src/components/ui/field/FieldGroup.vue +22 -0
  92. package/src/components/ui/field/FieldLabel.vue +24 -0
  93. package/src/components/ui/field/FieldLegend.vue +24 -0
  94. package/src/components/ui/field/FieldSeparator.vue +26 -0
  95. package/src/components/ui/field/FieldSet.vue +22 -0
  96. package/src/components/ui/field/FieldTitle.vue +22 -0
  97. package/src/components/ui/field/index.ts +30 -0
  98. package/src/components/ui/input/Input.vue +33 -0
  99. package/src/components/ui/input/index.ts +1 -0
  100. package/src/components/ui/input-group/InputGroup.vue +23 -0
  101. package/src/components/ui/input-group/InputGroupAddon.vue +39 -0
  102. package/src/components/ui/input-group/InputGroupButton.vue +22 -0
  103. package/src/components/ui/input-group/InputGroupInput.vue +21 -0
  104. package/src/components/ui/input-group/InputGroupText.vue +21 -0
  105. package/src/components/ui/input-group/InputGroupTextarea.vue +21 -0
  106. package/src/components/ui/input-group/index.ts +53 -0
  107. package/src/components/ui/label/Label.vue +26 -0
  108. package/src/components/ui/label/index.ts +1 -0
  109. package/src/components/ui/popover/Popover.vue +15 -0
  110. package/src/components/ui/popover/PopoverAnchor.vue +12 -0
  111. package/src/components/ui/popover/PopoverContent.vue +38 -0
  112. package/src/components/ui/popover/PopoverDescription.vue +14 -0
  113. package/src/components/ui/popover/PopoverHeader.vue +14 -0
  114. package/src/components/ui/popover/PopoverTitle.vue +14 -0
  115. package/src/components/ui/popover/PopoverTrigger.vue +12 -0
  116. package/src/components/ui/popover/index.ts +7 -0
  117. package/src/components/ui/select/Select.vue +15 -0
  118. package/src/components/ui/select/SelectContent.vue +53 -0
  119. package/src/components/ui/select/SelectGroup.vue +17 -0
  120. package/src/components/ui/select/SelectItem.vue +40 -0
  121. package/src/components/ui/select/SelectItemText.vue +12 -0
  122. package/src/components/ui/select/SelectLabel.vue +14 -0
  123. package/src/components/ui/select/SelectScrollDownButton.vue +32 -0
  124. package/src/components/ui/select/SelectScrollUpButton.vue +32 -0
  125. package/src/components/ui/select/SelectSeparator.vue +19 -0
  126. package/src/components/ui/select/SelectTrigger.vue +36 -0
  127. package/src/components/ui/select/SelectValue.vue +12 -0
  128. package/src/components/ui/select/index.ts +11 -0
  129. package/src/components/ui/separator/Separator.vue +27 -0
  130. package/src/components/ui/separator/index.ts +1 -0
  131. package/src/components/ui/skeleton/Skeleton.vue +14 -0
  132. package/src/components/ui/skeleton/index.ts +1 -0
  133. package/src/components/ui/spinner/Spinner.vue +14 -0
  134. package/src/components/ui/spinner/index.ts +1 -0
  135. package/src/components/ui/switch/Switch.vue +47 -0
  136. package/src/components/ui/switch/index.ts +1 -0
  137. package/src/components/ui/table/Table.vue +24 -0
  138. package/src/components/ui/table/TableBody.vue +14 -0
  139. package/src/components/ui/table/TableCaption.vue +14 -0
  140. package/src/components/ui/table/TableCell.vue +17 -0
  141. package/src/components/ui/table/TableEmpty.vue +32 -0
  142. package/src/components/ui/table/TableFooter.vue +14 -0
  143. package/src/components/ui/table/TableHead.vue +29 -0
  144. package/src/components/ui/table/TableHeader.vue +14 -0
  145. package/src/components/ui/table/TableRow.vue +22 -0
  146. package/src/components/ui/table/index.ts +9 -0
  147. package/src/components/ui/tags-input/TagsInput.vue +31 -0
  148. package/src/components/ui/tags-input/TagsInputInput.vue +20 -0
  149. package/src/components/ui/tags-input/TagsInputItem.vue +28 -0
  150. package/src/components/ui/tags-input/TagsInputItemDelete.vue +23 -0
  151. package/src/components/ui/tags-input/TagsInputItemText.vue +17 -0
  152. package/src/components/ui/tags-input/index.ts +5 -0
  153. package/src/components/ui/textarea/Textarea.vue +33 -0
  154. package/src/components/ui/textarea/index.ts +1 -0
  155. package/src/index.ts +5 -0
  156. package/src/testing/renderer.ts +99 -0
@@ -0,0 +1,12 @@
1
+ <script setup lang="ts">
2
+ import type { CollapsibleContentProps } from "reka-ui";
3
+ import { CollapsibleContent } from "reka-ui";
4
+
5
+ const props = defineProps<CollapsibleContentProps>();
6
+ </script>
7
+
8
+ <template>
9
+ <CollapsibleContent data-slot="collapsible-content" v-bind="props">
10
+ <slot />
11
+ </CollapsibleContent>
12
+ </template>
@@ -0,0 +1,12 @@
1
+ <script setup lang="ts">
2
+ import type { CollapsibleTriggerProps } from "reka-ui";
3
+ import { CollapsibleTrigger } from "reka-ui";
4
+
5
+ const props = defineProps<CollapsibleTriggerProps>();
6
+ </script>
7
+
8
+ <template>
9
+ <CollapsibleTrigger data-slot="collapsible-trigger" v-bind="props">
10
+ <slot />
11
+ </CollapsibleTrigger>
12
+ </template>
@@ -0,0 +1,3 @@
1
+ export { default as Collapsible } from "./Collapsible.vue";
2
+ export { default as CollapsibleContent } from "./CollapsibleContent.vue";
3
+ export { default as CollapsibleTrigger } from "./CollapsibleTrigger.vue";
@@ -0,0 +1,15 @@
1
+ <script setup lang="ts">
2
+ import type { ComboboxRootEmits, ComboboxRootProps } from "reka-ui";
3
+ import { ComboboxRoot, useForwardPropsEmits } from "reka-ui";
4
+
5
+ const props = defineProps<ComboboxRootProps>();
6
+ const emits = defineEmits<ComboboxRootEmits>();
7
+
8
+ const forwarded = useForwardPropsEmits(props, emits);
9
+ </script>
10
+
11
+ <template>
12
+ <ComboboxRoot v-slot="slotProps" data-slot="combobox" v-bind="forwarded">
13
+ <slot v-bind="slotProps" />
14
+ </ComboboxRoot>
15
+ </template>
@@ -0,0 +1,19 @@
1
+ <script setup lang="ts">
2
+ import type { ComboboxAnchorProps } from "reka-ui";
3
+ import type { HTMLAttributes } from "vue";
4
+ import { reactiveOmit } from "@vueuse/core";
5
+ import { ComboboxAnchor, useForwardProps } from "reka-ui";
6
+ import { cn } from "cn";
7
+
8
+ const props = defineProps<ComboboxAnchorProps & { class?: HTMLAttributes["class"] }>();
9
+
10
+ const delegatedProps = reactiveOmit(props, "class");
11
+
12
+ const forwarded = useForwardProps(delegatedProps);
13
+ </script>
14
+
15
+ <template>
16
+ <ComboboxAnchor data-slot="combobox-anchor" v-bind="forwarded" :class="cn('', props.class)">
17
+ <slot />
18
+ </ComboboxAnchor>
19
+ </template>
@@ -0,0 +1,26 @@
1
+ <script setup lang="ts">
2
+ import type { ComboboxEmptyProps } from "reka-ui";
3
+ import type { HTMLAttributes } from "vue";
4
+ import { reactiveOmit } from "@vueuse/core";
5
+ import { ComboboxEmpty } from "reka-ui";
6
+ import { cn } from "cn";
7
+
8
+ const props = defineProps<ComboboxEmptyProps & { class?: HTMLAttributes["class"] }>();
9
+
10
+ const delegatedProps = reactiveOmit(props, "class");
11
+ </script>
12
+
13
+ <template>
14
+ <ComboboxEmpty
15
+ data-slot="combobox-empty"
16
+ v-bind="delegatedProps"
17
+ :class="
18
+ cn(
19
+ 'text-muted-foreground hidden w-full justify-center py-2 text-center text-xs group-data-empty/combobox-content:flex',
20
+ props.class,
21
+ )
22
+ "
23
+ >
24
+ <slot />
25
+ </ComboboxEmpty>
26
+ </template>
@@ -0,0 +1,40 @@
1
+ <script setup lang="ts">
2
+ import type { ComboboxInputEmits, ComboboxInputProps } from "reka-ui";
3
+
4
+ import type { HTMLAttributes } from "vue";
5
+ import { SearchIcon } from "@lucide/vue";
6
+ import { reactiveOmit } from "@vueuse/core";
7
+ import { ComboboxInput, useForwardPropsEmits } from "reka-ui";
8
+ import { cn } from "cn";
9
+ import { InputGroup, InputGroupAddon } from "../input-group";
10
+
11
+ defineOptions({
12
+ inheritAttrs: false,
13
+ });
14
+
15
+ const props = defineProps<
16
+ ComboboxInputProps & {
17
+ inputGroupClass?: HTMLAttributes["class"];
18
+ class?: HTMLAttributes["class"];
19
+ }
20
+ >();
21
+
22
+ const emits = defineEmits<ComboboxInputEmits>();
23
+
24
+ const delegatedProps = reactiveOmit(props, "class");
25
+
26
+ const forwarded = useForwardPropsEmits(delegatedProps, emits);
27
+ </script>
28
+
29
+ <template>
30
+ <InputGroup :class="props.inputGroupClass">
31
+ <InputGroupAddon>
32
+ <SearchIcon class="size-4 shrink-0 opacity-50" aria-hidden="true" />
33
+ </InputGroupAddon>
34
+ <ComboboxInput
35
+ data-slot="combobox-input"
36
+ :class="cn('flex-1 outline-hidden disabled:cursor-not-allowed disabled:opacity-50', props.class)"
37
+ v-bind="{ ...$attrs, ...forwarded }"
38
+ />
39
+ </InputGroup>
40
+ </template>
@@ -0,0 +1,29 @@
1
+ <script setup lang="ts">
2
+ import type { ComboboxItemEmits, ComboboxItemProps } from "reka-ui";
3
+ import type { HTMLAttributes } from "vue";
4
+ import { reactiveOmit } from "@vueuse/core";
5
+ import { ComboboxItem, useForwardPropsEmits } from "reka-ui";
6
+ import { cn } from "cn";
7
+
8
+ const props = defineProps<ComboboxItemProps & { class?: HTMLAttributes["class"] }>();
9
+ const emits = defineEmits<ComboboxItemEmits>();
10
+
11
+ const delegatedProps = reactiveOmit(props, "class");
12
+
13
+ const forwarded = useForwardPropsEmits(delegatedProps, emits);
14
+ </script>
15
+
16
+ <template>
17
+ <ComboboxItem
18
+ data-slot="combobox-item"
19
+ v-bind="forwarded"
20
+ :class="
21
+ cn(
22
+ 'data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground gap-2 rounded-none py-2 pr-8 pl-2 text-xs [&_svg:not([class*=size-])]:size-4 relative flex w-full cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0',
23
+ props.class,
24
+ )
25
+ "
26
+ >
27
+ <slot />
28
+ </ComboboxItem>
29
+ </template>
@@ -0,0 +1,38 @@
1
+ <script setup lang="ts">
2
+ import type { ComboboxContentEmits, ComboboxContentProps } from "reka-ui";
3
+ import type { HTMLAttributes } from "vue";
4
+ import { reactiveOmit } from "@vueuse/core";
5
+ import { ComboboxContent, ComboboxPortal, useForwardPropsEmits } from "reka-ui";
6
+ import { cn } from "cn";
7
+
8
+ defineOptions({
9
+ inheritAttrs: false,
10
+ });
11
+
12
+ const props = withDefaults(defineProps<ComboboxContentProps & { class?: HTMLAttributes["class"] }>(), {
13
+ position: "popper",
14
+ align: "center",
15
+ sideOffset: 4,
16
+ });
17
+ const emits = defineEmits<ComboboxContentEmits>();
18
+
19
+ const delegatedProps = reactiveOmit(props, "class");
20
+ const forwarded = useForwardPropsEmits(delegatedProps, emits);
21
+ </script>
22
+
23
+ <template>
24
+ <ComboboxPortal>
25
+ <ComboboxContent
26
+ data-slot="combobox-content"
27
+ v-bind="{ ...$attrs, ...forwarded }"
28
+ :class="
29
+ cn(
30
+ 'bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:border-input/30 max-h-72 min-w-36 overflow-hidden rounded-none shadow-md ring-1 duration-100 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:shadow-none data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 cn-menu-translucent group/combobox-content z-50 w-[var(--reka-combobox-trigger-width)]',
31
+ props.class,
32
+ )
33
+ "
34
+ >
35
+ <slot />
36
+ </ComboboxContent>
37
+ </ComboboxPortal>
38
+ </template>
@@ -0,0 +1,28 @@
1
+ <script setup lang="ts">
2
+ import type { ComboboxViewportProps } from "reka-ui";
3
+ import type { HTMLAttributes } from "vue";
4
+ import { reactiveOmit } from "@vueuse/core";
5
+ import { ComboboxViewport, useForwardProps } from "reka-ui";
6
+ import { cn } from "cn";
7
+
8
+ const props = defineProps<ComboboxViewportProps & { class?: HTMLAttributes["class"] }>();
9
+
10
+ const delegatedProps = reactiveOmit(props, "class");
11
+
12
+ const forwarded = useForwardProps(delegatedProps);
13
+ </script>
14
+
15
+ <template>
16
+ <ComboboxViewport
17
+ data-slot="combobox-viewport"
18
+ v-bind="forwarded"
19
+ :class="
20
+ cn(
21
+ 'no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto data-empty:p-0',
22
+ props.class,
23
+ )
24
+ "
25
+ >
26
+ <slot />
27
+ </ComboboxViewport>
28
+ </template>
@@ -0,0 +1,9 @@
1
+ export { default as Combobox } from "./Combobox.vue";
2
+ export { default as ComboboxAnchor } from "./ComboboxAnchor.vue";
3
+ export { default as ComboboxEmpty } from "./ComboboxEmpty.vue";
4
+ export { default as ComboboxInput } from "./ComboboxInput.vue";
5
+ export { default as ComboboxItem } from "./ComboboxItem.vue";
6
+ export { default as ComboboxList } from "./ComboboxList.vue";
7
+ export { default as ComboboxViewport } from "./ComboboxViewport.vue";
8
+
9
+ export { ComboboxCancel } from "reka-ui";
@@ -0,0 +1,22 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { cn } from "cn";
4
+
5
+ const props = defineProps<{
6
+ class?: HTMLAttributes["class"];
7
+ }>();
8
+ </script>
9
+
10
+ <template>
11
+ <div
12
+ data-slot="empty"
13
+ :class="
14
+ cn(
15
+ 'gap-4 rounded-none border-dashed p-6 flex w-full min-w-0 flex-1 flex-col items-center justify-center text-center text-balance',
16
+ props.class,
17
+ )
18
+ "
19
+ >
20
+ <slot />
21
+ </div>
22
+ </template>
@@ -0,0 +1,17 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { cn } from "cn";
4
+
5
+ const props = defineProps<{
6
+ class?: HTMLAttributes["class"];
7
+ }>();
8
+ </script>
9
+
10
+ <template>
11
+ <div
12
+ data-slot="empty-content"
13
+ :class="cn('gap-2.5 text-xs flex w-full max-w-sm min-w-0 flex-col items-center text-balance', props.class)"
14
+ >
15
+ <slot />
16
+ </div>
17
+ </template>
@@ -0,0 +1,22 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { cn } from "cn";
4
+
5
+ defineProps<{
6
+ class?: HTMLAttributes["class"];
7
+ }>();
8
+ </script>
9
+
10
+ <template>
11
+ <p
12
+ data-slot="empty-description"
13
+ :class="
14
+ cn(
15
+ 'text-xs/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',
16
+ $attrs.class ?? '',
17
+ )
18
+ "
19
+ >
20
+ <slot />
21
+ </p>
22
+ </template>
@@ -0,0 +1,14 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { cn } from "cn";
4
+
5
+ const props = defineProps<{
6
+ class?: HTMLAttributes["class"];
7
+ }>();
8
+ </script>
9
+
10
+ <template>
11
+ <div data-slot="empty-header" :class="cn('gap-2 flex max-w-sm flex-col items-center', props.class)">
12
+ <slot />
13
+ </div>
14
+ </template>
@@ -0,0 +1,22 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import type { EmptyMediaVariants } from ".";
4
+ import { cn } from "cn";
5
+ import { emptyMediaVariants } from ".";
6
+
7
+ const props = withDefaults(
8
+ defineProps<{
9
+ class?: HTMLAttributes["class"];
10
+ variant?: EmptyMediaVariants["variant"];
11
+ }>(),
12
+ {
13
+ variant: "default",
14
+ },
15
+ );
16
+ </script>
17
+
18
+ <template>
19
+ <div data-slot="empty-icon" :data-variant="variant" :class="cn(emptyMediaVariants({ variant }), props.class)">
20
+ <slot />
21
+ </div>
22
+ </template>
@@ -0,0 +1,14 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { cn } from "cn";
4
+
5
+ const props = defineProps<{
6
+ class?: HTMLAttributes["class"];
7
+ }>();
8
+ </script>
9
+
10
+ <template>
11
+ <div data-slot="empty-title" :class="cn('text-sm font-medium', props.class)">
12
+ <slot />
13
+ </div>
14
+ </template>
@@ -0,0 +1,26 @@
1
+ import type { VariantProps } from "class-variance-authority";
2
+ import { cva } from "class-variance-authority";
3
+
4
+ export { default as Empty } from "./Empty.vue";
5
+ export { default as EmptyContent } from "./EmptyContent.vue";
6
+ export { default as EmptyDescription } from "./EmptyDescription.vue";
7
+ export { default as EmptyHeader } from "./EmptyHeader.vue";
8
+ export { default as EmptyMedia } from "./EmptyMedia.vue";
9
+ export { default as EmptyTitle } from "./EmptyTitle.vue";
10
+
11
+ export const emptyMediaVariants = cva(
12
+ "mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
13
+ {
14
+ variants: {
15
+ variant: {
16
+ default: "bg-transparent",
17
+ icon: "bg-muted text-foreground flex size-8 shrink-0 items-center justify-center rounded-none [&_svg:not([class*=size-])]:size-4",
18
+ },
19
+ },
20
+ defaultVariants: {
21
+ variant: "default",
22
+ },
23
+ },
24
+ );
25
+
26
+ export type EmptyMediaVariants = VariantProps<typeof emptyMediaVariants>;
@@ -0,0 +1,27 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import type { FieldVariants } from ".";
4
+ import { cn } from "cn";
5
+ import { fieldVariants } from ".";
6
+
7
+ const props = withDefaults(
8
+ defineProps<{
9
+ class?: HTMLAttributes["class"];
10
+ orientation?: FieldVariants["orientation"];
11
+ }>(),
12
+ {
13
+ orientation: "vertical",
14
+ },
15
+ );
16
+ </script>
17
+
18
+ <template>
19
+ <div
20
+ role="group"
21
+ data-slot="field"
22
+ :data-orientation="orientation"
23
+ :class="cn(fieldVariants({ orientation }), props.class)"
24
+ >
25
+ <slot />
26
+ </div>
27
+ </template>
@@ -0,0 +1,17 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { cn } from "cn";
4
+
5
+ const props = defineProps<{
6
+ class?: HTMLAttributes["class"];
7
+ }>();
8
+ </script>
9
+
10
+ <template>
11
+ <div
12
+ data-slot="field-content"
13
+ :class="cn('gap-0.5 group/field-content flex flex-1 flex-col leading-snug', props.class)"
14
+ >
15
+ <slot />
16
+ </div>
17
+ </template>
@@ -0,0 +1,24 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { cn } from "cn";
4
+
5
+ const props = defineProps<{
6
+ class?: HTMLAttributes["class"];
7
+ }>();
8
+ </script>
9
+
10
+ <template>
11
+ <p
12
+ data-slot="field-description"
13
+ :class="
14
+ cn(
15
+ 'text-muted-foreground text-left text-xs/relaxed [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-data-horizontal/field:text-balance',
16
+ 'last:mt-0 nth-last-2:-mt-1',
17
+ '[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',
18
+ props.class,
19
+ )
20
+ "
21
+ >
22
+ <slot />
23
+ </p>
24
+ </template>
@@ -0,0 +1,50 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { computed } from "vue";
4
+ import { cn } from "cn";
5
+
6
+ const props = defineProps<{
7
+ class?: HTMLAttributes["class"];
8
+ errors?: Array<string | { message: string | undefined } | undefined>;
9
+ }>();
10
+
11
+ const content = computed(() => {
12
+ if (!props.errors || props.errors.length === 0) return null;
13
+
14
+ const uniqueErrors = [
15
+ ...new Map(
16
+ props.errors.filter(Boolean).map((error) => {
17
+ const message = typeof error === "string" ? error : error?.message;
18
+ return [message, error];
19
+ }),
20
+ ).values(),
21
+ ];
22
+
23
+ if (uniqueErrors.length === 1 && uniqueErrors[0]) {
24
+ return typeof uniqueErrors[0] === "string" ? uniqueErrors[0] : uniqueErrors[0].message;
25
+ }
26
+
27
+ return uniqueErrors.map((error) => (typeof error === "string" ? error : error?.message));
28
+ });
29
+ </script>
30
+
31
+ <template>
32
+ <div
33
+ v-if="$slots.default || content"
34
+ role="alert"
35
+ data-slot="field-error"
36
+ :class="cn('text-destructive text-xs font-normal', props.class)"
37
+ >
38
+ <slot v-if="$slots.default" />
39
+
40
+ <template v-else-if="typeof content === 'string'">
41
+ {{ content }}
42
+ </template>
43
+
44
+ <ul v-else-if="Array.isArray(content)" class="ml-4 flex list-disc flex-col gap-1">
45
+ <li v-for="(error, index) in content" :key="index">
46
+ {{ error }}
47
+ </li>
48
+ </ul>
49
+ </div>
50
+ </template>
@@ -0,0 +1,22 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { cn } from "cn";
4
+
5
+ const props = defineProps<{
6
+ class?: HTMLAttributes["class"];
7
+ }>();
8
+ </script>
9
+
10
+ <template>
11
+ <div
12
+ data-slot="field-group"
13
+ :class="
14
+ cn(
15
+ 'gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4 group/field-group @container/field-group flex w-full flex-col',
16
+ props.class,
17
+ )
18
+ "
19
+ >
20
+ <slot />
21
+ </div>
22
+ </template>
@@ -0,0 +1,24 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { cn } from "cn";
4
+ import { Label } from "../label";
5
+
6
+ const props = defineProps<{
7
+ class?: HTMLAttributes["class"];
8
+ }>();
9
+ </script>
10
+
11
+ <template>
12
+ <Label
13
+ data-slot="field-label"
14
+ :class="
15
+ cn(
16
+ 'has-data-checked:bg-primary/5 has-data-checked:border-primary/30 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10 gap-2 group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-none has-[>[data-slot=field]]:border *:data-[slot=field]:p-2 group/field-label peer/field-label flex w-fit leading-snug',
17
+ 'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col',
18
+ props.class,
19
+ )
20
+ "
21
+ >
22
+ <slot />
23
+ </Label>
24
+ </template>
@@ -0,0 +1,24 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { cn } from "cn";
4
+
5
+ const props = withDefaults(
6
+ defineProps<{
7
+ class?: HTMLAttributes["class"];
8
+ variant?: "legend" | "label";
9
+ }>(),
10
+ {
11
+ variant: "legend",
12
+ },
13
+ );
14
+ </script>
15
+
16
+ <template>
17
+ <legend
18
+ data-slot="field-legend"
19
+ :data-variant="variant"
20
+ :class="cn('mb-2.5 font-medium data-[variant=label]:text-xs data-[variant=legend]:text-sm', props.class)"
21
+ >
22
+ <slot />
23
+ </legend>
24
+ </template>
@@ -0,0 +1,26 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { cn } from "cn";
4
+ import { Separator } from "../separator";
5
+
6
+ const props = defineProps<{
7
+ class?: HTMLAttributes["class"];
8
+ }>();
9
+ </script>
10
+
11
+ <template>
12
+ <div
13
+ data-slot="field-separator"
14
+ :data-content="!!$slots.default"
15
+ :class="cn('-my-2 h-5 text-xs group-data-[variant=outline]/field-group:-mb-2 relative', props.class)"
16
+ >
17
+ <Separator class="absolute inset-0 top-1/2" />
18
+ <span
19
+ v-if="$slots.default"
20
+ class="text-muted-foreground px-2 relative mx-auto block w-fit bg-background"
21
+ data-slot="field-separator-content"
22
+ >
23
+ <slot />
24
+ </span>
25
+ </div>
26
+ </template>
@@ -0,0 +1,22 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { cn } from "cn";
4
+
5
+ const props = defineProps<{
6
+ class?: HTMLAttributes["class"];
7
+ }>();
8
+ </script>
9
+
10
+ <template>
11
+ <fieldset
12
+ data-slot="field-set"
13
+ :class="
14
+ cn(
15
+ 'gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 flex flex-col',
16
+ props.class,
17
+ )
18
+ "
19
+ >
20
+ <slot />
21
+ </fieldset>
22
+ </template>
@@ -0,0 +1,22 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { cn } from "cn";
4
+
5
+ const props = defineProps<{
6
+ class?: HTMLAttributes["class"];
7
+ }>();
8
+ </script>
9
+
10
+ <template>
11
+ <div
12
+ data-slot="field-label"
13
+ :class="
14
+ cn(
15
+ 'gap-2 text-xs/relaxed group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug',
16
+ props.class,
17
+ )
18
+ "
19
+ >
20
+ <slot />
21
+ </div>
22
+ </template>