@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,32 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ChevronUpIcon } from "@lucide/vue";
|
|
3
|
+
|
|
4
|
+
import type { SelectScrollUpButtonProps } from "reka-ui";
|
|
5
|
+
import type { HTMLAttributes } from "vue";
|
|
6
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
7
|
+
import { SelectScrollUpButton, useForwardProps } from "reka-ui";
|
|
8
|
+
import { cn } from "cn";
|
|
9
|
+
|
|
10
|
+
const props = defineProps<SelectScrollUpButtonProps & { class?: HTMLAttributes["class"] }>();
|
|
11
|
+
|
|
12
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
13
|
+
|
|
14
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<SelectScrollUpButton
|
|
19
|
+
data-slot="select-scroll-up-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
|
+
<ChevronUpIcon />
|
|
30
|
+
</slot>
|
|
31
|
+
</SelectScrollUpButton>
|
|
32
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectSeparatorProps } from "reka-ui";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
5
|
+
import { SelectSeparator } from "reka-ui";
|
|
6
|
+
import { cn } from "cn";
|
|
7
|
+
|
|
8
|
+
const props = defineProps<SelectSeparatorProps & { class?: HTMLAttributes["class"] }>();
|
|
9
|
+
|
|
10
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<SelectSeparator
|
|
15
|
+
data-slot="select-separator"
|
|
16
|
+
v-bind="delegatedProps"
|
|
17
|
+
:class="cn('bg-border -mx-1 h-px pointer-events-none', props.class)"
|
|
18
|
+
/>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ChevronDownIcon } from "@lucide/vue";
|
|
3
|
+
|
|
4
|
+
import type { SelectTriggerProps } from "reka-ui";
|
|
5
|
+
import type { HTMLAttributes } from "vue";
|
|
6
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
7
|
+
import { SelectIcon, SelectTrigger, useForwardProps } from "reka-ui";
|
|
8
|
+
import { cn } from "cn";
|
|
9
|
+
|
|
10
|
+
const props = withDefaults(
|
|
11
|
+
defineProps<SelectTriggerProps & { class?: HTMLAttributes["class"]; size?: "sm" | "default" }>(),
|
|
12
|
+
{ size: "default" },
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
const delegatedProps = reactiveOmit(props, "class", "size");
|
|
16
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<SelectTrigger
|
|
21
|
+
data-slot="select-trigger"
|
|
22
|
+
:data-size="size"
|
|
23
|
+
v-bind="forwardedProps"
|
|
24
|
+
:class="
|
|
25
|
+
cn(
|
|
26
|
+
'border-input data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 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 gap-1.5 rounded-none border bg-transparent py-2 pr-2 pl-2.5 text-xs transition-colors select-none focus-visible:ring-1 aria-invalid:ring-1 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-none *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*=size-])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0',
|
|
27
|
+
props.class,
|
|
28
|
+
)
|
|
29
|
+
"
|
|
30
|
+
>
|
|
31
|
+
<slot />
|
|
32
|
+
<SelectIcon as-child>
|
|
33
|
+
<ChevronDownIcon class="text-muted-foreground size-4 pointer-events-none" />
|
|
34
|
+
</SelectIcon>
|
|
35
|
+
</SelectTrigger>
|
|
36
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectValueProps } from "reka-ui";
|
|
3
|
+
import { SelectValue } from "reka-ui";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<SelectValueProps>();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<SelectValue data-slot="select-value" v-bind="props">
|
|
10
|
+
<slot />
|
|
11
|
+
</SelectValue>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { default as Select } from "./Select.vue";
|
|
2
|
+
export { default as SelectContent } from "./SelectContent.vue";
|
|
3
|
+
export { default as SelectGroup } from "./SelectGroup.vue";
|
|
4
|
+
export { default as SelectItem } from "./SelectItem.vue";
|
|
5
|
+
export { default as SelectItemText } from "./SelectItemText.vue";
|
|
6
|
+
export { default as SelectLabel } from "./SelectLabel.vue";
|
|
7
|
+
export { default as SelectScrollDownButton } from "./SelectScrollDownButton.vue";
|
|
8
|
+
export { default as SelectScrollUpButton } from "./SelectScrollUpButton.vue";
|
|
9
|
+
export { default as SelectSeparator } from "./SelectSeparator.vue";
|
|
10
|
+
export { default as SelectTrigger } from "./SelectTrigger.vue";
|
|
11
|
+
export { default as SelectValue } from "./SelectValue.vue";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SeparatorProps } from "reka-ui";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
5
|
+
import { Separator } from "reka-ui";
|
|
6
|
+
import { cn } from "cn";
|
|
7
|
+
|
|
8
|
+
const props = withDefaults(defineProps<SeparatorProps & { class?: HTMLAttributes["class"] }>(), {
|
|
9
|
+
orientation: "horizontal",
|
|
10
|
+
decorative: true,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<Separator
|
|
18
|
+
data-slot="separator"
|
|
19
|
+
v-bind="delegatedProps"
|
|
20
|
+
:class="
|
|
21
|
+
cn(
|
|
22
|
+
'shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch',
|
|
23
|
+
props.class,
|
|
24
|
+
)
|
|
25
|
+
"
|
|
26
|
+
/>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Separator } from "./Separator.vue";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
|
|
5
|
+
interface SkeletonProps {
|
|
6
|
+
class?: HTMLAttributes["class"];
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const props = defineProps<SkeletonProps>();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<div data-slot="skeleton" :class="cn('bg-muted rounded-none animate-pulse', props.class)" />
|
|
14
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Skeleton } from "./Skeleton.vue";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { Loader2Icon } from "@lucide/vue";
|
|
3
|
+
|
|
4
|
+
import type { HTMLAttributes } from "vue";
|
|
5
|
+
import { cn } from "cn";
|
|
6
|
+
|
|
7
|
+
const props = defineProps<{
|
|
8
|
+
class?: HTMLAttributes["class"];
|
|
9
|
+
}>();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<Loader2Icon data-slot="spinner" role="status" aria-label="加载中" :class="cn('size-4 animate-spin', props.class)" />
|
|
14
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Spinner } from "./Spinner.vue";
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SwitchRootEmits, SwitchRootProps } from "reka-ui";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
5
|
+
import { SwitchRoot, SwitchThumb, useForwardPropsEmits } from "reka-ui";
|
|
6
|
+
import { cn } from "cn";
|
|
7
|
+
|
|
8
|
+
const props = withDefaults(
|
|
9
|
+
defineProps<
|
|
10
|
+
SwitchRootProps & {
|
|
11
|
+
class?: HTMLAttributes["class"];
|
|
12
|
+
size?: "sm" | "default";
|
|
13
|
+
}
|
|
14
|
+
>(),
|
|
15
|
+
{
|
|
16
|
+
size: "default",
|
|
17
|
+
},
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const emits = defineEmits<SwitchRootEmits>();
|
|
21
|
+
|
|
22
|
+
const delegatedProps = reactiveOmit(props, "class", "size");
|
|
23
|
+
|
|
24
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<SwitchRoot
|
|
29
|
+
v-slot="slotProps"
|
|
30
|
+
data-slot="switch"
|
|
31
|
+
:data-size="size"
|
|
32
|
+
v-bind="forwarded"
|
|
33
|
+
:class="
|
|
34
|
+
cn(
|
|
35
|
+
'data-checked:bg-primary data-unchecked:bg-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 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-1 aria-invalid:ring-1 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50',
|
|
36
|
+
props.class,
|
|
37
|
+
)
|
|
38
|
+
"
|
|
39
|
+
>
|
|
40
|
+
<SwitchThumb
|
|
41
|
+
data-slot="switch-thumb"
|
|
42
|
+
class="bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground rounded-full group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 pointer-events-none block ring-0 transition-transform"
|
|
43
|
+
>
|
|
44
|
+
<slot name="thumb" v-bind="slotProps" />
|
|
45
|
+
</SwitchThumb>
|
|
46
|
+
</SwitchRoot>
|
|
47
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Switch } from "./Switch.vue";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
|
|
5
|
+
defineOptions({
|
|
6
|
+
inheritAttrs: false,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
const props = defineProps<{
|
|
10
|
+
class?: HTMLAttributes["class"];
|
|
11
|
+
}>();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<div
|
|
16
|
+
v-bind="$attrs"
|
|
17
|
+
data-slot="table-container"
|
|
18
|
+
class="relative w-full overflow-x-auto focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"
|
|
19
|
+
>
|
|
20
|
+
<table data-slot="table" :class="cn('w-full caption-bottom text-xs', props.class)">
|
|
21
|
+
<slot />
|
|
22
|
+
</table>
|
|
23
|
+
</div>
|
|
24
|
+
</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
|
+
<tbody data-slot="table-body" :class="cn('[&_tr:last-child]:border-0', props.class)">
|
|
12
|
+
<slot />
|
|
13
|
+
</tbody>
|
|
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
|
+
<caption data-slot="table-caption" :class="cn('text-muted-foreground mt-4 text-xs', props.class)">
|
|
12
|
+
<slot />
|
|
13
|
+
</caption>
|
|
14
|
+
</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
|
+
<td
|
|
12
|
+
data-slot="table-cell"
|
|
13
|
+
:class="cn('p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0', props.class)"
|
|
14
|
+
>
|
|
15
|
+
<slot />
|
|
16
|
+
</td>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
4
|
+
import { cn } from "cn";
|
|
5
|
+
import TableCell from "./TableCell.vue";
|
|
6
|
+
import TableRow from "./TableRow.vue";
|
|
7
|
+
|
|
8
|
+
const props = withDefaults(
|
|
9
|
+
defineProps<{
|
|
10
|
+
class?: HTMLAttributes["class"];
|
|
11
|
+
colspan?: number;
|
|
12
|
+
}>(),
|
|
13
|
+
{
|
|
14
|
+
colspan: 1,
|
|
15
|
+
},
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<TableRow>
|
|
23
|
+
<TableCell
|
|
24
|
+
:class="cn('p-4 whitespace-nowrap align-middle text-sm text-foreground', props.class)"
|
|
25
|
+
v-bind="delegatedProps"
|
|
26
|
+
>
|
|
27
|
+
<div class="flex items-center justify-center py-10">
|
|
28
|
+
<slot />
|
|
29
|
+
</div>
|
|
30
|
+
</TableCell>
|
|
31
|
+
</TableRow>
|
|
32
|
+
</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
|
+
<tfoot data-slot="table-footer" :class="cn('bg-muted/50 border-t font-medium [&>tr]:last:border-b-0', props.class)">
|
|
12
|
+
<slot />
|
|
13
|
+
</tfoot>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes, ThHTMLAttributes } from "vue";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
|
|
5
|
+
const props = withDefaults(
|
|
6
|
+
defineProps<{
|
|
7
|
+
class?: HTMLAttributes["class"];
|
|
8
|
+
scope?: ThHTMLAttributes["scope"];
|
|
9
|
+
}>(),
|
|
10
|
+
{
|
|
11
|
+
scope: "col",
|
|
12
|
+
},
|
|
13
|
+
);
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<th
|
|
18
|
+
data-slot="table-head"
|
|
19
|
+
:scope="scope"
|
|
20
|
+
:class="
|
|
21
|
+
cn(
|
|
22
|
+
'text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0',
|
|
23
|
+
props.class,
|
|
24
|
+
)
|
|
25
|
+
"
|
|
26
|
+
>
|
|
27
|
+
<slot />
|
|
28
|
+
</th>
|
|
29
|
+
</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
|
+
<thead data-slot="table-header" :class="cn('[&_tr]:border-b', props.class)">
|
|
12
|
+
<slot />
|
|
13
|
+
</thead>
|
|
14
|
+
</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
|
+
<tr
|
|
12
|
+
data-slot="table-row"
|
|
13
|
+
:class="
|
|
14
|
+
cn(
|
|
15
|
+
'hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors has-aria-expanded:bg-muted/50',
|
|
16
|
+
props.class,
|
|
17
|
+
)
|
|
18
|
+
"
|
|
19
|
+
>
|
|
20
|
+
<slot />
|
|
21
|
+
</tr>
|
|
22
|
+
</template>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as Table } from "./Table.vue";
|
|
2
|
+
export { default as TableBody } from "./TableBody.vue";
|
|
3
|
+
export { default as TableCaption } from "./TableCaption.vue";
|
|
4
|
+
export { default as TableCell } from "./TableCell.vue";
|
|
5
|
+
export { default as TableEmpty } from "./TableEmpty.vue";
|
|
6
|
+
export { default as TableFooter } from "./TableFooter.vue";
|
|
7
|
+
export { default as TableHead } from "./TableHead.vue";
|
|
8
|
+
export { default as TableHeader } from "./TableHeader.vue";
|
|
9
|
+
export { default as TableRow } from "./TableRow.vue";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { TagsInputRootEmits, TagsInputRootProps } from "reka-ui";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
5
|
+
import { TagsInputRoot, useForwardPropsEmits } from "reka-ui";
|
|
6
|
+
import { cn } from "cn";
|
|
7
|
+
|
|
8
|
+
const props = defineProps<TagsInputRootProps & { class?: HTMLAttributes["class"] }>();
|
|
9
|
+
const emits = defineEmits<TagsInputRootEmits>();
|
|
10
|
+
|
|
11
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
12
|
+
|
|
13
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<TagsInputRoot
|
|
18
|
+
v-slot="slotProps"
|
|
19
|
+
v-bind="forwarded"
|
|
20
|
+
:class="
|
|
21
|
+
cn(
|
|
22
|
+
'flex flex-wrap gap-2 items-center rounded-none border border-input bg-background px-2 py-2 text-xs shadow-xs transition-[color,box-shadow] outline-none',
|
|
23
|
+
'focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]',
|
|
24
|
+
'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
|
|
25
|
+
props.class,
|
|
26
|
+
)
|
|
27
|
+
"
|
|
28
|
+
>
|
|
29
|
+
<slot v-bind="slotProps" />
|
|
30
|
+
</TagsInputRoot>
|
|
31
|
+
</template>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { TagsInputInputProps } from "reka-ui";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
5
|
+
import { TagsInputInput, useForwardProps } from "reka-ui";
|
|
6
|
+
import { cn } from "cn";
|
|
7
|
+
|
|
8
|
+
const props = defineProps<TagsInputInputProps & { class?: HTMLAttributes["class"] }>();
|
|
9
|
+
|
|
10
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
11
|
+
|
|
12
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<TagsInputInput
|
|
17
|
+
v-bind="forwardedProps"
|
|
18
|
+
:class="cn('text-xs min-h-5 focus:outline-none flex-1 bg-transparent px-1', props.class)"
|
|
19
|
+
/>
|
|
20
|
+
</template>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { TagsInputItemProps } from "reka-ui";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
|
|
5
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
6
|
+
import { TagsInputItem, useForwardProps } from "reka-ui";
|
|
7
|
+
import { cn } from "cn";
|
|
8
|
+
|
|
9
|
+
const props = defineProps<TagsInputItemProps & { class?: HTMLAttributes["class"] }>();
|
|
10
|
+
|
|
11
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
12
|
+
|
|
13
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<TagsInputItem
|
|
18
|
+
v-bind="forwardedProps"
|
|
19
|
+
:class="
|
|
20
|
+
cn(
|
|
21
|
+
'flex h-5 items-center rounded-none bg-secondary data-[state=active]:ring-ring data-[state=active]:ring-2 data-[state=active]:ring-offset-2 ring-offset-background',
|
|
22
|
+
props.class,
|
|
23
|
+
)
|
|
24
|
+
"
|
|
25
|
+
>
|
|
26
|
+
<slot />
|
|
27
|
+
</TagsInputItem>
|
|
28
|
+
</template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { TagsInputItemDeleteProps } from "reka-ui";
|
|
3
|
+
|
|
4
|
+
import type { HTMLAttributes } from "vue";
|
|
5
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
6
|
+
import { XIcon } from "@lucide/vue";
|
|
7
|
+
import { TagsInputItemDelete, useForwardProps } from "reka-ui";
|
|
8
|
+
import { cn } from "cn";
|
|
9
|
+
|
|
10
|
+
const props = defineProps<TagsInputItemDeleteProps & { class?: HTMLAttributes["class"] }>();
|
|
11
|
+
|
|
12
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
13
|
+
|
|
14
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<TagsInputItemDelete type="button" v-bind="forwardedProps" :class="cn('flex bg-transparent mr-1', props.class)">
|
|
19
|
+
<slot>
|
|
20
|
+
<XIcon class="size-4" aria-hidden="true" />
|
|
21
|
+
</slot>
|
|
22
|
+
</TagsInputItemDelete>
|
|
23
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { TagsInputItemTextProps } from "reka-ui";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
5
|
+
import { TagsInputItemText, useForwardProps } from "reka-ui";
|
|
6
|
+
import { cn } from "cn";
|
|
7
|
+
|
|
8
|
+
const props = defineProps<TagsInputItemTextProps & { class?: HTMLAttributes["class"] }>();
|
|
9
|
+
|
|
10
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
11
|
+
|
|
12
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<TagsInputItemText v-bind="forwardedProps" :class="cn('py-0.5 px-2 text-xs bg-transparent', props.class)" />
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as TagsInput } from "./TagsInput.vue";
|
|
2
|
+
export { default as TagsInputInput } from "./TagsInputInput.vue";
|
|
3
|
+
export { default as TagsInputItem } from "./TagsInputItem.vue";
|
|
4
|
+
export { default as TagsInputItemDelete } from "./TagsInputItemDelete.vue";
|
|
5
|
+
export { default as TagsInputItemText } from "./TagsInputItemText.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
|
+
class?: HTMLAttributes["class"];
|
|
8
|
+
defaultValue?: string | number;
|
|
9
|
+
modelValue?: string | number;
|
|
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
|
+
<textarea
|
|
24
|
+
v-model="modelValue"
|
|
25
|
+
data-slot="textarea"
|
|
26
|
+
:class="
|
|
27
|
+
cn(
|
|
28
|
+
'border-input dark:bg-input/30 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 rounded-none border bg-transparent px-2.5 py-2 text-xs transition-colors focus-visible:ring-1 aria-invalid:ring-1 md:text-xs flex field-sizing-content min-h-16 w-full outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',
|
|
29
|
+
props.class,
|
|
30
|
+
)
|
|
31
|
+
"
|
|
32
|
+
/>
|
|
33
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Textarea } from "./Textarea.vue";
|