@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.
- package/LICENSE +21 -0
- package/README.md +21 -2
- package/package.json +70 -3
- package/src/components/acrux-ui/actions/ConfirmPopover.vue +107 -0
- package/src/components/acrux-ui/actions/FormShell.vue +96 -0
- package/src/components/acrux-ui/actions/RemovalButton.vue +65 -0
- package/src/components/acrux-ui/actions/Stepper.vue +116 -0
- package/src/components/acrux-ui/actions/form.ts +36 -0
- package/src/components/acrux-ui/actions/index.ts +70 -0
- package/src/components/acrux-ui/actions/stepper.ts +65 -0
- package/src/components/acrux-ui/actions/utils.ts +138 -0
- package/src/components/acrux-ui/base/CopyBtn.vue +85 -0
- package/src/components/acrux-ui/base/EmptyValue.vue +25 -0
- package/src/components/acrux-ui/base/Icon.vue +44 -0
- package/src/components/acrux-ui/base/IconBtn.vue +51 -0
- package/src/components/acrux-ui/base/Text.vue +85 -0
- package/src/components/acrux-ui/base/VSeparator.vue +21 -0
- package/src/components/acrux-ui/base/async.ts +35 -0
- package/src/components/acrux-ui/base/index.ts +7 -0
- package/src/components/acrux-ui/display/AsyncError.vue +46 -0
- package/src/components/acrux-ui/display/CodeBlock.vue +91 -0
- package/src/components/acrux-ui/display/CopyTag.vue +51 -0
- package/src/components/acrux-ui/display/DataView.ts +47 -0
- package/src/components/acrux-ui/display/DateFormatter.vue +61 -0
- package/src/components/acrux-ui/display/Disclosure.vue +45 -0
- package/src/components/acrux-ui/display/Link.vue +81 -0
- package/src/components/acrux-ui/display/MultiLine.vue +29 -0
- package/src/components/acrux-ui/display/Notice.vue +71 -0
- package/src/components/acrux-ui/display/Pem.vue +165 -0
- package/src/components/acrux-ui/display/QrBtn.vue +117 -0
- package/src/components/acrux-ui/display/QrModal.vue +76 -0
- package/src/components/acrux-ui/display/Route.vue +52 -0
- package/src/components/acrux-ui/display/Token.vue +106 -0
- package/src/components/acrux-ui/display/UUID.vue +46 -0
- package/src/components/acrux-ui/display/index.ts +17 -0
- package/src/components/acrux-ui/display/pem.ts +100 -0
- package/src/components/acrux-ui/display/qr.ts +20 -0
- package/src/components/acrux-ui/fields/EntitySelect.vue +253 -0
- package/src/components/acrux-ui/fields/FieldError.vue +11 -0
- package/src/components/acrux-ui/fields/JsonTextArea.vue +105 -0
- package/src/components/acrux-ui/fields/MultiLineInput.vue +145 -0
- package/src/components/acrux-ui/fields/Select.vue +106 -0
- package/src/components/acrux-ui/fields/fieldAccessibility.ts +38 -0
- package/src/components/acrux-ui/fields/index.ts +4 -0
- package/src/components/acrux-ui/page/BackButton.vue +70 -0
- package/src/components/acrux-ui/page/PageDetail.vue +125 -0
- package/src/components/acrux-ui/page/PageEntry.vue +130 -0
- package/src/components/acrux-ui/page/PageState.vue +108 -0
- package/src/components/acrux-ui/page/index.ts +3 -0
- package/src/components/acrux-ui/page/pageState.ts +18 -0
- package/src/components/ui/alert/Alert.vue +17 -0
- package/src/components/ui/alert/AlertAction.vue +17 -0
- package/src/components/ui/alert/AlertDescription.vue +22 -0
- package/src/components/ui/alert/AlertTitle.vue +22 -0
- package/src/components/ui/alert/index.ts +25 -0
- package/src/components/ui/badge/Badge.vue +29 -0
- package/src/components/ui/badge/index.ts +25 -0
- package/src/components/ui/button/Button.vue +31 -0
- package/src/components/ui/button/index.ts +39 -0
- package/src/components/ui/card/Card.vue +29 -0
- package/src/components/ui/card/CardAction.vue +17 -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 +17 -0
- package/src/components/ui/card/CardHeader.vue +22 -0
- package/src/components/ui/card/CardTitle.vue +14 -0
- package/src/components/ui/card/index.ts +7 -0
- package/src/components/ui/collapsible/Collapsible.vue +15 -0
- package/src/components/ui/collapsible/CollapsibleContent.vue +12 -0
- package/src/components/ui/collapsible/CollapsibleTrigger.vue +12 -0
- package/src/components/ui/collapsible/index.ts +3 -0
- package/src/components/ui/combobox/Combobox.vue +15 -0
- package/src/components/ui/combobox/ComboboxAnchor.vue +19 -0
- package/src/components/ui/combobox/ComboboxEmpty.vue +26 -0
- package/src/components/ui/combobox/ComboboxInput.vue +40 -0
- package/src/components/ui/combobox/ComboboxItem.vue +29 -0
- package/src/components/ui/combobox/ComboboxList.vue +38 -0
- package/src/components/ui/combobox/ComboboxViewport.vue +28 -0
- package/src/components/ui/combobox/index.ts +9 -0
- package/src/components/ui/empty/Empty.vue +22 -0
- package/src/components/ui/empty/EmptyContent.vue +17 -0
- package/src/components/ui/empty/EmptyDescription.vue +22 -0
- package/src/components/ui/empty/EmptyHeader.vue +14 -0
- package/src/components/ui/empty/EmptyMedia.vue +22 -0
- package/src/components/ui/empty/EmptyTitle.vue +14 -0
- package/src/components/ui/empty/index.ts +26 -0
- package/src/components/ui/field/Field.vue +27 -0
- package/src/components/ui/field/FieldContent.vue +17 -0
- package/src/components/ui/field/FieldDescription.vue +24 -0
- package/src/components/ui/field/FieldError.vue +50 -0
- package/src/components/ui/field/FieldGroup.vue +22 -0
- package/src/components/ui/field/FieldLabel.vue +24 -0
- package/src/components/ui/field/FieldLegend.vue +24 -0
- package/src/components/ui/field/FieldSeparator.vue +26 -0
- package/src/components/ui/field/FieldSet.vue +22 -0
- package/src/components/ui/field/FieldTitle.vue +22 -0
- package/src/components/ui/field/index.ts +30 -0
- package/src/components/ui/input/Input.vue +33 -0
- package/src/components/ui/input/index.ts +1 -0
- package/src/components/ui/input-group/InputGroup.vue +23 -0
- package/src/components/ui/input-group/InputGroupAddon.vue +39 -0
- package/src/components/ui/input-group/InputGroupButton.vue +22 -0
- package/src/components/ui/input-group/InputGroupInput.vue +21 -0
- package/src/components/ui/input-group/InputGroupText.vue +21 -0
- package/src/components/ui/input-group/InputGroupTextarea.vue +21 -0
- package/src/components/ui/input-group/index.ts +53 -0
- package/src/components/ui/label/Label.vue +26 -0
- package/src/components/ui/label/index.ts +1 -0
- package/src/components/ui/popover/Popover.vue +15 -0
- package/src/components/ui/popover/PopoverAnchor.vue +12 -0
- package/src/components/ui/popover/PopoverContent.vue +38 -0
- package/src/components/ui/popover/PopoverDescription.vue +14 -0
- package/src/components/ui/popover/PopoverHeader.vue +14 -0
- package/src/components/ui/popover/PopoverTitle.vue +14 -0
- package/src/components/ui/popover/PopoverTrigger.vue +12 -0
- package/src/components/ui/popover/index.ts +7 -0
- package/src/components/ui/select/Select.vue +15 -0
- package/src/components/ui/select/SelectContent.vue +53 -0
- package/src/components/ui/select/SelectGroup.vue +17 -0
- package/src/components/ui/select/SelectItem.vue +40 -0
- package/src/components/ui/select/SelectItemText.vue +12 -0
- package/src/components/ui/select/SelectLabel.vue +14 -0
- package/src/components/ui/select/SelectScrollDownButton.vue +32 -0
- package/src/components/ui/select/SelectScrollUpButton.vue +32 -0
- package/src/components/ui/select/SelectSeparator.vue +19 -0
- package/src/components/ui/select/SelectTrigger.vue +36 -0
- package/src/components/ui/select/SelectValue.vue +12 -0
- package/src/components/ui/select/index.ts +11 -0
- package/src/components/ui/separator/Separator.vue +27 -0
- package/src/components/ui/separator/index.ts +1 -0
- package/src/components/ui/skeleton/Skeleton.vue +14 -0
- package/src/components/ui/skeleton/index.ts +1 -0
- package/src/components/ui/spinner/Spinner.vue +14 -0
- package/src/components/ui/spinner/index.ts +1 -0
- package/src/components/ui/switch/Switch.vue +47 -0
- package/src/components/ui/switch/index.ts +1 -0
- package/src/components/ui/table/Table.vue +24 -0
- package/src/components/ui/table/TableBody.vue +14 -0
- package/src/components/ui/table/TableCaption.vue +14 -0
- package/src/components/ui/table/TableCell.vue +17 -0
- package/src/components/ui/table/TableEmpty.vue +32 -0
- package/src/components/ui/table/TableFooter.vue +14 -0
- package/src/components/ui/table/TableHead.vue +29 -0
- package/src/components/ui/table/TableHeader.vue +14 -0
- package/src/components/ui/table/TableRow.vue +22 -0
- package/src/components/ui/table/index.ts +9 -0
- package/src/components/ui/tags-input/TagsInput.vue +31 -0
- package/src/components/ui/tags-input/TagsInputInput.vue +20 -0
- package/src/components/ui/tags-input/TagsInputItem.vue +28 -0
- package/src/components/ui/tags-input/TagsInputItemDelete.vue +23 -0
- package/src/components/ui/tags-input/TagsInputItemText.vue +17 -0
- package/src/components/ui/tags-input/index.ts +5 -0
- package/src/components/ui/textarea/Textarea.vue +33 -0
- package/src/components/ui/textarea/index.ts +1 -0
- package/src/index.ts +5 -0
- package/src/testing/renderer.ts +99 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { VariantProps } from "class-variance-authority";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
|
|
4
|
+
export const fieldVariants = cva("data-[invalid=true]:text-destructive gap-2 group/field flex w-full", {
|
|
5
|
+
variants: {
|
|
6
|
+
orientation: {
|
|
7
|
+
vertical: "flex-col *:w-full [&>.sr-only]:w-auto",
|
|
8
|
+
horizontal:
|
|
9
|
+
"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
10
|
+
responsive:
|
|
11
|
+
"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
defaultVariants: {
|
|
15
|
+
orientation: "vertical",
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export type FieldVariants = VariantProps<typeof fieldVariants>;
|
|
20
|
+
|
|
21
|
+
export { default as Field } from "./Field.vue";
|
|
22
|
+
export { default as FieldContent } from "./FieldContent.vue";
|
|
23
|
+
export { default as FieldDescription } from "./FieldDescription.vue";
|
|
24
|
+
export { default as FieldError } from "./FieldError.vue";
|
|
25
|
+
export { default as FieldGroup } from "./FieldGroup.vue";
|
|
26
|
+
export { default as FieldLabel } from "./FieldLabel.vue";
|
|
27
|
+
export { default as FieldLegend } from "./FieldLegend.vue";
|
|
28
|
+
export { default as FieldSeparator } from "./FieldSeparator.vue";
|
|
29
|
+
export { default as FieldSet } from "./FieldSet.vue";
|
|
30
|
+
export { default as FieldTitle } from "./FieldTitle.vue";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import { useVModel } from "@vueuse/core";
|
|
4
|
+
import { cn } from "cn";
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{
|
|
7
|
+
defaultValue?: string | number;
|
|
8
|
+
modelValue?: string | number;
|
|
9
|
+
class?: HTMLAttributes["class"];
|
|
10
|
+
}>();
|
|
11
|
+
|
|
12
|
+
const emits = defineEmits<{
|
|
13
|
+
(e: "update:modelValue", payload: string | number): void;
|
|
14
|
+
}>();
|
|
15
|
+
|
|
16
|
+
const modelValue = useVModel(props, "modelValue", emits, {
|
|
17
|
+
passive: true,
|
|
18
|
+
defaultValue: props.defaultValue,
|
|
19
|
+
});
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<input
|
|
24
|
+
v-model="modelValue"
|
|
25
|
+
data-slot="input"
|
|
26
|
+
:class="
|
|
27
|
+
cn(
|
|
28
|
+
'dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-none border bg-transparent px-2.5 py-1 text-xs transition-colors file:h-6 file:text-xs file:font-medium focus-visible:ring-1 aria-invalid:ring-1 md:text-xs w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
|
|
29
|
+
props.class,
|
|
30
|
+
)
|
|
31
|
+
"
|
|
32
|
+
/>
|
|
33
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Input } from "./Input.vue";
|
|
@@ -0,0 +1,23 @@
|
|
|
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="input-group"
|
|
13
|
+
role="group"
|
|
14
|
+
:class="
|
|
15
|
+
cn(
|
|
16
|
+
'border-input dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-disabled:bg-input/50 dark:has-disabled:bg-input/80 h-8 rounded-none border transition-colors in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:ring-1 has-[[data-slot][aria-invalid=true]]:ring-1 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto',
|
|
17
|
+
props.class,
|
|
18
|
+
)
|
|
19
|
+
"
|
|
20
|
+
>
|
|
21
|
+
<slot />
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import type { InputGroupVariants } from ".";
|
|
4
|
+
import { cn } from "cn";
|
|
5
|
+
import { inputGroupAddonVariants } from ".";
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(
|
|
8
|
+
defineProps<{
|
|
9
|
+
align?: InputGroupVariants["align"];
|
|
10
|
+
class?: HTMLAttributes["class"];
|
|
11
|
+
}>(),
|
|
12
|
+
{
|
|
13
|
+
align: "inline-start",
|
|
14
|
+
},
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
function handleInputGroupAddonClick(e: MouseEvent) {
|
|
18
|
+
const currentTarget = e.currentTarget as HTMLElement | null;
|
|
19
|
+
const target = e.target as HTMLElement | null;
|
|
20
|
+
if (target && target.closest("button")) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (currentTarget && currentTarget?.parentElement) {
|
|
24
|
+
currentTarget.parentElement?.querySelector("input")?.focus();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<div
|
|
31
|
+
role="group"
|
|
32
|
+
data-slot="input-group-addon"
|
|
33
|
+
:data-align="props.align"
|
|
34
|
+
:class="cn(inputGroupAddonVariants({ align: props.align }), props.class)"
|
|
35
|
+
@click="handleInputGroupAddonClick"
|
|
36
|
+
>
|
|
37
|
+
<slot />
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { InputGroupButtonProps } from ".";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
import { Button } from "../button";
|
|
5
|
+
import { inputGroupButtonVariants } from ".";
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(defineProps<InputGroupButtonProps>(), {
|
|
8
|
+
size: "xs",
|
|
9
|
+
variant: "ghost",
|
|
10
|
+
});
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<Button
|
|
15
|
+
type="button"
|
|
16
|
+
:data-size="props.size"
|
|
17
|
+
:variant="props.variant"
|
|
18
|
+
:class="cn(inputGroupButtonVariants({ size: props.size }), props.class)"
|
|
19
|
+
>
|
|
20
|
+
<slot />
|
|
21
|
+
</Button>
|
|
22
|
+
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
import { Input } from "../input";
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{
|
|
7
|
+
class?: HTMLAttributes["class"];
|
|
8
|
+
}>();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<Input
|
|
13
|
+
data-slot="input-group-control"
|
|
14
|
+
:class="
|
|
15
|
+
cn(
|
|
16
|
+
'rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent flex-1',
|
|
17
|
+
props.class,
|
|
18
|
+
)
|
|
19
|
+
"
|
|
20
|
+
/>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
<span
|
|
12
|
+
:class="
|
|
13
|
+
cn(
|
|
14
|
+
'text-muted-foreground gap-2 text-xs [&_svg:not([class*=size-])]:size-4 flex items-center [&_svg]:pointer-events-none',
|
|
15
|
+
props.class,
|
|
16
|
+
)
|
|
17
|
+
"
|
|
18
|
+
>
|
|
19
|
+
<slot />
|
|
20
|
+
</span>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
import { Textarea } from "../textarea";
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{
|
|
7
|
+
class?: HTMLAttributes["class"];
|
|
8
|
+
}>();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<Textarea
|
|
13
|
+
data-slot="input-group-control"
|
|
14
|
+
:class="
|
|
15
|
+
cn(
|
|
16
|
+
'rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent flex-1 resize-none',
|
|
17
|
+
props.class,
|
|
18
|
+
)
|
|
19
|
+
"
|
|
20
|
+
/>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { VariantProps } from "class-variance-authority";
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import type { ButtonVariants } from "../button";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
|
|
6
|
+
export { default as InputGroup } from "./InputGroup.vue";
|
|
7
|
+
export { default as InputGroupAddon } from "./InputGroupAddon.vue";
|
|
8
|
+
export { default as InputGroupButton } from "./InputGroupButton.vue";
|
|
9
|
+
export { default as InputGroupInput } from "./InputGroupInput.vue";
|
|
10
|
+
export { default as InputGroupText } from "./InputGroupText.vue";
|
|
11
|
+
export { default as InputGroupTextarea } from "./InputGroupTextarea.vue";
|
|
12
|
+
|
|
13
|
+
export const inputGroupAddonVariants = cva(
|
|
14
|
+
"text-muted-foreground h-auto gap-2 py-1.5 text-xs font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-none [&>svg:not([class*=size-])]:size-4 flex cursor-text items-center justify-center select-none",
|
|
15
|
+
{
|
|
16
|
+
variants: {
|
|
17
|
+
align: {
|
|
18
|
+
"inline-start": "pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem] order-first",
|
|
19
|
+
"inline-end": "pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem] order-last",
|
|
20
|
+
"block-start":
|
|
21
|
+
"px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start",
|
|
22
|
+
"block-end": "px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
align: "inline-start",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
export type InputGroupVariants = VariantProps<typeof inputGroupAddonVariants>;
|
|
32
|
+
|
|
33
|
+
export const inputGroupButtonVariants = cva("gap-2 text-xs flex items-center shadow-none", {
|
|
34
|
+
variants: {
|
|
35
|
+
size: {
|
|
36
|
+
xs: "h-6 gap-1 rounded-none px-1.5 [&>svg:not([class*=size-])]:size-3.5",
|
|
37
|
+
sm: "gap-1",
|
|
38
|
+
"icon-xs": "size-6 rounded-none p-0 has-[>svg]:p-0",
|
|
39
|
+
"icon-sm": "size-7 p-0 has-[>svg]:p-0",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
defaultVariants: {
|
|
43
|
+
size: "xs",
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export type InputGroupButtonVariants = VariantProps<typeof inputGroupButtonVariants>;
|
|
48
|
+
|
|
49
|
+
export interface InputGroupButtonProps {
|
|
50
|
+
variant?: ButtonVariants["variant"];
|
|
51
|
+
size?: InputGroupButtonVariants["size"];
|
|
52
|
+
class?: HTMLAttributes["class"];
|
|
53
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { LabelProps } from "reka-ui";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
5
|
+
import { Label } from "reka-ui";
|
|
6
|
+
import { cn } from "cn";
|
|
7
|
+
|
|
8
|
+
const props = defineProps<LabelProps & { class?: HTMLAttributes["class"] }>();
|
|
9
|
+
|
|
10
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<Label
|
|
15
|
+
data-slot="label"
|
|
16
|
+
v-bind="delegatedProps"
|
|
17
|
+
:class="
|
|
18
|
+
cn(
|
|
19
|
+
'gap-2 text-xs leading-none group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed',
|
|
20
|
+
props.class,
|
|
21
|
+
)
|
|
22
|
+
"
|
|
23
|
+
>
|
|
24
|
+
<slot />
|
|
25
|
+
</Label>
|
|
26
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Label } from "./Label.vue";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PopoverRootEmits, PopoverRootProps } from "reka-ui";
|
|
3
|
+
import { PopoverRoot, useForwardPropsEmits } from "reka-ui";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<PopoverRootProps>();
|
|
6
|
+
const emits = defineEmits<PopoverRootEmits>();
|
|
7
|
+
|
|
8
|
+
const forwarded = useForwardPropsEmits(props, emits);
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<PopoverRoot v-slot="slotProps" data-slot="popover" v-bind="forwarded">
|
|
13
|
+
<slot v-bind="slotProps" />
|
|
14
|
+
</PopoverRoot>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PopoverAnchorProps } from "reka-ui";
|
|
3
|
+
import { PopoverAnchor } from "reka-ui";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<PopoverAnchorProps>();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<PopoverAnchor data-slot="popover-anchor" v-bind="props">
|
|
10
|
+
<slot />
|
|
11
|
+
</PopoverAnchor>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PopoverContentEmits, PopoverContentProps } from "reka-ui";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
5
|
+
import { PopoverContent, PopoverPortal, useForwardPropsEmits } from "reka-ui";
|
|
6
|
+
import { cn } from "cn";
|
|
7
|
+
|
|
8
|
+
defineOptions({
|
|
9
|
+
inheritAttrs: false,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const props = withDefaults(defineProps<PopoverContentProps & { class?: HTMLAttributes["class"] }>(), {
|
|
13
|
+
align: "center",
|
|
14
|
+
sideOffset: 4,
|
|
15
|
+
});
|
|
16
|
+
const emits = defineEmits<PopoverContentEmits>();
|
|
17
|
+
|
|
18
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
19
|
+
|
|
20
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<PopoverPortal>
|
|
25
|
+
<PopoverContent
|
|
26
|
+
data-slot="popover-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 flex flex-col gap-2.5 rounded-none p-2.5 text-xs shadow-md ring-1 duration-100 z-50 w-72 origin-(--reka-popover-content-transform-origin) outline-hidden',
|
|
31
|
+
props.class,
|
|
32
|
+
)
|
|
33
|
+
"
|
|
34
|
+
>
|
|
35
|
+
<slot />
|
|
36
|
+
</PopoverContent>
|
|
37
|
+
</PopoverPortal>
|
|
38
|
+
</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
|
+
<p data-slot="popover-description" :class="cn('text-muted-foreground text-xs/relaxed', props.class)">
|
|
12
|
+
<slot />
|
|
13
|
+
</p>
|
|
14
|
+
</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="popover-header" :class="cn('flex flex-col gap-1 text-xs', props.class)">
|
|
12
|
+
<slot />
|
|
13
|
+
</div>
|
|
14
|
+
</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="popover-title" :class="cn('text-sm font-medium', props.class)">
|
|
12
|
+
<slot />
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PopoverTriggerProps } from "reka-ui";
|
|
3
|
+
import { PopoverTrigger } from "reka-ui";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<PopoverTriggerProps>();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<PopoverTrigger data-slot="popover-trigger" v-bind="props">
|
|
10
|
+
<slot />
|
|
11
|
+
</PopoverTrigger>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as Popover } from "./Popover.vue";
|
|
2
|
+
export { default as PopoverAnchor } from "./PopoverAnchor.vue";
|
|
3
|
+
export { default as PopoverContent } from "./PopoverContent.vue";
|
|
4
|
+
export { default as PopoverDescription } from "./PopoverDescription.vue";
|
|
5
|
+
export { default as PopoverHeader } from "./PopoverHeader.vue";
|
|
6
|
+
export { default as PopoverTitle } from "./PopoverTitle.vue";
|
|
7
|
+
export { default as PopoverTrigger } from "./PopoverTrigger.vue";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectRootEmits, SelectRootProps } from "reka-ui";
|
|
3
|
+
import { SelectRoot, useForwardPropsEmits } from "reka-ui";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<SelectRootProps>();
|
|
6
|
+
const emits = defineEmits<SelectRootEmits>();
|
|
7
|
+
|
|
8
|
+
const forwarded = useForwardPropsEmits(props, emits);
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<SelectRoot v-slot="slotProps" data-slot="select" v-bind="forwarded">
|
|
13
|
+
<slot v-bind="slotProps" />
|
|
14
|
+
</SelectRoot>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectContentEmits, SelectContentProps } from "reka-ui";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
5
|
+
import { SelectContent, SelectPortal, SelectViewport, useForwardPropsEmits } from "reka-ui";
|
|
6
|
+
import { cn } from "cn";
|
|
7
|
+
import { SelectScrollDownButton, SelectScrollUpButton } from ".";
|
|
8
|
+
|
|
9
|
+
defineOptions({
|
|
10
|
+
inheritAttrs: false,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const props = withDefaults(defineProps<SelectContentProps & { class?: HTMLAttributes["class"] }>(), {
|
|
14
|
+
position: "item-aligned",
|
|
15
|
+
align: "center",
|
|
16
|
+
});
|
|
17
|
+
const emits = defineEmits<SelectContentEmits>();
|
|
18
|
+
|
|
19
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
20
|
+
|
|
21
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<SelectPortal>
|
|
26
|
+
<SelectContent
|
|
27
|
+
data-slot="select-content"
|
|
28
|
+
:data-align-trigger="position === 'item-aligned'"
|
|
29
|
+
v-bind="{ ...$attrs, ...forwarded }"
|
|
30
|
+
:class="
|
|
31
|
+
cn(
|
|
32
|
+
'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 min-w-36 rounded-none shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 relative z-50 max-h-(--reka-select-content-available-height) origin-(--reka-select-content-transform-origin) overflow-x-hidden overflow-y-auto data-[align-trigger=true]:animate-none',
|
|
33
|
+
position === 'popper' &&
|
|
34
|
+
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
|
|
35
|
+
props.class,
|
|
36
|
+
)
|
|
37
|
+
"
|
|
38
|
+
>
|
|
39
|
+
<SelectScrollUpButton />
|
|
40
|
+
<SelectViewport
|
|
41
|
+
:data-position="position"
|
|
42
|
+
:class="
|
|
43
|
+
cn(
|
|
44
|
+
'data-[position=popper]:h-[var(--reka-select-trigger-height)] data-[position=popper]:w-full data-[position=popper]:min-w-[var(--reka-select-trigger-width)]',
|
|
45
|
+
)
|
|
46
|
+
"
|
|
47
|
+
>
|
|
48
|
+
<slot />
|
|
49
|
+
</SelectViewport>
|
|
50
|
+
<SelectScrollDownButton />
|
|
51
|
+
</SelectContent>
|
|
52
|
+
</SelectPortal>
|
|
53
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectGroupProps } from "reka-ui";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
5
|
+
import { SelectGroup } from "reka-ui";
|
|
6
|
+
import { cn } from "cn";
|
|
7
|
+
|
|
8
|
+
const props = defineProps<SelectGroupProps & { class?: HTMLAttributes["class"] }>();
|
|
9
|
+
|
|
10
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<SelectGroup data-slot="select-group" v-bind="delegatedProps" :class="cn('scroll-my-1', props.class)">
|
|
15
|
+
<slot />
|
|
16
|
+
</SelectGroup>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { CheckIcon } from "@lucide/vue";
|
|
3
|
+
|
|
4
|
+
import type { SelectItemProps } from "reka-ui";
|
|
5
|
+
import type { HTMLAttributes } from "vue";
|
|
6
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
7
|
+
import { SelectItem, SelectItemIndicator, SelectItemText, useForwardProps } from "reka-ui";
|
|
8
|
+
import { cn } from "cn";
|
|
9
|
+
|
|
10
|
+
const props = defineProps<SelectItemProps & { class?: HTMLAttributes["class"] }>();
|
|
11
|
+
|
|
12
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
13
|
+
|
|
14
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<SelectItem
|
|
19
|
+
data-slot="select-item"
|
|
20
|
+
v-bind="forwardedProps"
|
|
21
|
+
:class="
|
|
22
|
+
cn(
|
|
23
|
+
'focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-none py-2 pr-8 pl-2 text-xs [&_svg:not([class*=size-])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 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',
|
|
24
|
+
props.class,
|
|
25
|
+
)
|
|
26
|
+
"
|
|
27
|
+
>
|
|
28
|
+
<span class="pointer-events-none absolute right-2 flex size-4 items-center justify-center">
|
|
29
|
+
<SelectItemIndicator>
|
|
30
|
+
<slot name="indicator-icon">
|
|
31
|
+
<CheckIcon class="pointer-events-none" />
|
|
32
|
+
</slot>
|
|
33
|
+
</SelectItemIndicator>
|
|
34
|
+
</span>
|
|
35
|
+
|
|
36
|
+
<SelectItemText>
|
|
37
|
+
<slot />
|
|
38
|
+
</SelectItemText>
|
|
39
|
+
</SelectItem>
|
|
40
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectItemTextProps } from "reka-ui";
|
|
3
|
+
import { SelectItemText } from "reka-ui";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<SelectItemTextProps>();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<SelectItemText data-slot="select-item-text" v-bind="props">
|
|
10
|
+
<slot />
|
|
11
|
+
</SelectItemText>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectLabelProps } from "reka-ui";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
import { SelectLabel } from "reka-ui";
|
|
5
|
+
import { cn } from "cn";
|
|
6
|
+
|
|
7
|
+
const props = defineProps<SelectLabelProps & { class?: HTMLAttributes["class"] }>();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<SelectLabel data-slot="select-label" :class="cn('text-muted-foreground px-2 py-2 text-xs', props.class)">
|
|
12
|
+
<slot />
|
|
13
|
+
</SelectLabel>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ChevronDownIcon } from "@lucide/vue";
|
|
3
|
+
|
|
4
|
+
import type { SelectScrollDownButtonProps } from "reka-ui";
|
|
5
|
+
import type { HTMLAttributes } from "vue";
|
|
6
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
7
|
+
import { SelectScrollDownButton, useForwardProps } from "reka-ui";
|
|
8
|
+
import { cn } from "cn";
|
|
9
|
+
|
|
10
|
+
const props = defineProps<SelectScrollDownButtonProps & { class?: HTMLAttributes["class"] }>();
|
|
11
|
+
|
|
12
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
13
|
+
|
|
14
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<SelectScrollDownButton
|
|
19
|
+
data-slot="select-scroll-down-button"
|
|
20
|
+
v-bind="forwardedProps"
|
|
21
|
+
:class="
|
|
22
|
+
cn(
|
|
23
|
+
'bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*=size-])]:size-4',
|
|
24
|
+
props.class,
|
|
25
|
+
)
|
|
26
|
+
"
|
|
27
|
+
>
|
|
28
|
+
<slot>
|
|
29
|
+
<ChevronDownIcon />
|
|
30
|
+
</slot>
|
|
31
|
+
</SelectScrollDownButton>
|
|
32
|
+
</template>
|