@verikit/vue 0.23.1

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 (104) hide show
  1. package/LICENSE.md +9 -0
  2. package/dist/client/index.d.ts +3 -0
  3. package/dist/client/index.d.ts.map +1 -0
  4. package/dist/client/index.js +1 -0
  5. package/dist/client/use-verikit-client.d.ts +42 -0
  6. package/dist/client/use-verikit-client.d.ts.map +1 -0
  7. package/dist/client/use-verikit-client.js +39 -0
  8. package/dist/components/button.d.ts +36 -0
  9. package/dist/components/button.d.ts.map +1 -0
  10. package/dist/components/button.js +53 -0
  11. package/dist/components/checkbox.d.ts +45 -0
  12. package/dist/components/checkbox.d.ts.map +1 -0
  13. package/dist/components/checkbox.js +44 -0
  14. package/dist/components/dialog.d.ts +86 -0
  15. package/dist/components/dialog.d.ts.map +1 -0
  16. package/dist/components/dialog.js +157 -0
  17. package/dist/components/input.d.ts +5 -0
  18. package/dist/components/input.d.ts.map +1 -0
  19. package/dist/components/input.js +17 -0
  20. package/dist/components/label.d.ts +5 -0
  21. package/dist/components/label.d.ts.map +1 -0
  22. package/dist/components/label.js +17 -0
  23. package/dist/components/select.d.ts +164 -0
  24. package/dist/components/select.d.ts.map +1 -0
  25. package/dist/components/select.js +219 -0
  26. package/dist/components/textarea.d.ts +5 -0
  27. package/dist/components/textarea.d.ts.map +1 -0
  28. package/dist/components/textarea.js +17 -0
  29. package/dist/fields/field-shell.d.ts +64 -0
  30. package/dist/fields/field-shell.d.ts.map +1 -0
  31. package/dist/fields/field-shell.js +61 -0
  32. package/dist/fields/index.d.ts +7 -0
  33. package/dist/fields/index.d.ts.map +1 -0
  34. package/dist/fields/index.js +3 -0
  35. package/dist/fields/inputs.d.ts +372 -0
  36. package/dist/fields/inputs.d.ts.map +1 -0
  37. package/dist/fields/inputs.js +306 -0
  38. package/dist/fields/registry.d.ts +382 -0
  39. package/dist/fields/registry.d.ts.map +1 -0
  40. package/dist/fields/registry.js +31 -0
  41. package/dist/fields/types.d.ts +36 -0
  42. package/dist/fields/types.d.ts.map +1 -0
  43. package/dist/fields/types.js +1 -0
  44. package/dist/form/index.d.ts +11 -0
  45. package/dist/form/index.d.ts.map +1 -0
  46. package/dist/form/index.js +5 -0
  47. package/dist/form/use-verikit-form.d.ts +40 -0
  48. package/dist/form/use-verikit-form.d.ts.map +1 -0
  49. package/dist/form/use-verikit-form.js +72 -0
  50. package/dist/form/use-verikit-schema-tree-form.d.ts +47 -0
  51. package/dist/form/use-verikit-schema-tree-form.d.ts.map +1 -0
  52. package/dist/form/use-verikit-schema-tree-form.js +96 -0
  53. package/dist/index.d.ts +9 -0
  54. package/dist/index.d.ts.map +1 -0
  55. package/dist/index.js +8 -0
  56. package/dist/layout/index.d.ts +5 -0
  57. package/dist/layout/index.d.ts.map +1 -0
  58. package/dist/layout/index.js +2 -0
  59. package/dist/layout/render-schema-node.d.ts +9 -0
  60. package/dist/layout/render-schema-node.d.ts.map +1 -0
  61. package/dist/layout/render-schema-node.js +265 -0
  62. package/dist/layout/types.d.ts +68 -0
  63. package/dist/layout/types.d.ts.map +1 -0
  64. package/dist/layout/types.js +1 -0
  65. package/dist/lib/utils.d.ts +4 -0
  66. package/dist/lib/utils.d.ts.map +1 -0
  67. package/dist/lib/utils.js +6 -0
  68. package/dist/query/index.d.ts +13 -0
  69. package/dist/query/index.d.ts.map +1 -0
  70. package/dist/query/index.js +6 -0
  71. package/dist/query/use-resource-form.d.ts +39 -0
  72. package/dist/query/use-resource-form.d.ts.map +1 -0
  73. package/dist/query/use-resource-form.js +32 -0
  74. package/dist/query/use-resource-mutations.d.ts +40 -0
  75. package/dist/query/use-resource-mutations.d.ts.map +1 -0
  76. package/dist/query/use-resource-mutations.js +104 -0
  77. package/dist/query/use-resource-queries.d.ts +15 -0
  78. package/dist/query/use-resource-queries.d.ts.map +1 -0
  79. package/dist/query/use-resource-queries.js +35 -0
  80. package/dist/query/use-resource-schema-tree-form.d.ts +36 -0
  81. package/dist/query/use-resource-schema-tree-form.d.ts.map +1 -0
  82. package/dist/query/use-resource-schema-tree-form.js +42 -0
  83. package/dist/query/use-resource-table.d.ts +48 -0
  84. package/dist/query/use-resource-table.d.ts.map +1 -0
  85. package/dist/query/use-resource-table.js +104 -0
  86. package/dist/relationships/belongs-to-field.d.ts +91 -0
  87. package/dist/relationships/belongs-to-field.d.ts.map +1 -0
  88. package/dist/relationships/belongs-to-field.js +107 -0
  89. package/dist/relationships/index.d.ts +2 -0
  90. package/dist/relationships/index.d.ts.map +1 -0
  91. package/dist/relationships/index.js +1 -0
  92. package/dist/resource/index.d.ts +5 -0
  93. package/dist/resource/index.d.ts.map +1 -0
  94. package/dist/resource/index.js +2 -0
  95. package/dist/resource/resource-form.d.ts +122 -0
  96. package/dist/resource/resource-form.d.ts.map +1 -0
  97. package/dist/resource/resource-form.js +83 -0
  98. package/dist/resource/resource-table-filters.d.ts +54 -0
  99. package/dist/resource/resource-table-filters.d.ts.map +1 -0
  100. package/dist/resource/resource-table-filters.js +283 -0
  101. package/dist/resource/resource-table.d.ts +93 -0
  102. package/dist/resource/resource-table.d.ts.map +1 -0
  103. package/dist/resource/resource-table.js +562 -0
  104. package/package.json +86 -0
package/LICENSE.md ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Chidi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,3 @@
1
+ export { useVerikitClient, VerikitProvider } from "./use-verikit-client.js";
2
+ export type { VerikitProviderProps } from "./use-verikit-client.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC5E,YAAY,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1 @@
1
+ export { useVerikitClient, VerikitProvider } from "./use-verikit-client.js";
@@ -0,0 +1,42 @@
1
+ import type { VerikitClient } from "@verikit/client";
2
+ import { QueryClient } from "@tanstack/vue-query";
3
+ import { type PropType } from "vue";
4
+ export interface VerikitProviderProps {
5
+ client: VerikitClient;
6
+ /**
7
+ * An application's own `QueryClient`, so `@verikit/vue`'s query composables share its
8
+ * cache instead of a second, isolated one. Omit it to let `VerikitProvider` create
9
+ * and own a `QueryClient` for its subtree.
10
+ */
11
+ queryClient?: QueryClient;
12
+ }
13
+ /**
14
+ * Provides a `VerikitClient` and TanStack Query `QueryClient` to its subtree.
15
+ *
16
+ * If `queryClient` is omitted, the provider creates one automatically.
17
+ * Apps with an existing `QueryClient` can pass it to share the same cache.
18
+ */
19
+ export declare const VerikitProvider: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
20
+ client: {
21
+ type: PropType<VerikitClient>;
22
+ required: true;
23
+ };
24
+ queryClient: {
25
+ type: PropType<QueryClient>;
26
+ required: false;
27
+ };
28
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
29
+ [key: string]: any;
30
+ }>[] | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
31
+ client: {
32
+ type: PropType<VerikitClient>;
33
+ required: true;
34
+ };
35
+ queryClient: {
36
+ type: PropType<QueryClient>;
37
+ required: false;
38
+ };
39
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
40
+ /** Reads the nearest ancestor `VerikitProvider`'s client. */
41
+ export declare function useVerikitClient(): VerikitClient;
42
+ //# sourceMappingURL=use-verikit-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-verikit-client.d.ts","sourceRoot":"","sources":["../../src/client/use-verikit-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAoB,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAOL,KAAK,QAAQ,EAEd,MAAM,KAAK,CAAC;AAIb,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,aAAa,CAAC;IACtB;;;;OAIG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe;;cAIN,QAAQ,CAAC,aAAa,CAAC;;;;cAIvB,QAAQ,CAAC,WAAW,CAAC;;;;;;;cAJrB,QAAQ,CAAC,aAAa,CAAC;;;;cAIvB,QAAQ,CAAC,WAAW,CAAC;;;iGAgBzC,CAAC;AAEH,6DAA6D;AAC7D,wBAAgB,gBAAgB,IAAI,aAAa,CAQhD"}
@@ -0,0 +1,39 @@
1
+ import { QueryClient, VUE_QUERY_CLIENT } from "@tanstack/vue-query";
2
+ import { defineComponent, inject, onMounted, onUnmounted, provide, } from "vue";
3
+ const VERIKIT_CLIENT_KEY = Symbol("VerikitClient");
4
+ /**
5
+ * Provides a `VerikitClient` and TanStack Query `QueryClient` to its subtree.
6
+ *
7
+ * If `queryClient` is omitted, the provider creates one automatically.
8
+ * Apps with an existing `QueryClient` can pass it to share the same cache.
9
+ */
10
+ export const VerikitProvider = defineComponent({
11
+ name: "VerikitProvider",
12
+ props: {
13
+ client: {
14
+ type: Object,
15
+ required: true,
16
+ },
17
+ queryClient: {
18
+ type: Object,
19
+ required: false,
20
+ },
21
+ },
22
+ setup(props, { slots }) {
23
+ const ownedQueryClient = new QueryClient();
24
+ const activeQueryClient = props.queryClient ?? ownedQueryClient;
25
+ provide(VERIKIT_CLIENT_KEY, props.client);
26
+ provide(VUE_QUERY_CLIENT, activeQueryClient);
27
+ onMounted(() => activeQueryClient.mount());
28
+ onUnmounted(() => activeQueryClient.unmount());
29
+ return () => slots.default?.();
30
+ },
31
+ });
32
+ /** Reads the nearest ancestor `VerikitProvider`'s client. */
33
+ export function useVerikitClient() {
34
+ const client = inject(VERIKIT_CLIENT_KEY);
35
+ if (!client) {
36
+ throw new Error("useVerikitClient must be used within a VerikitProvider.");
37
+ }
38
+ return client;
39
+ }
@@ -0,0 +1,36 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import { type PropType } from "vue";
3
+ /** Button style variants used by the shadcn-compatible Button component. */
4
+ export declare const buttonVariants: (props?: ({
5
+ variant?: "default" | "link" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
6
+ size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ type ButtonVariant = NonNullable<VariantProps<typeof buttonVariants>["variant"]>;
9
+ type ButtonSize = NonNullable<VariantProps<typeof buttonVariants>["size"]>;
10
+ /** shadcn-compatible button built on a native `<button>`. */
11
+ export declare const Button: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
12
+ variant: {
13
+ type: PropType<ButtonVariant>;
14
+ default: string;
15
+ };
16
+ size: {
17
+ type: PropType<ButtonSize>;
18
+ default: string;
19
+ };
20
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
21
+ [key: string]: any;
22
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
23
+ variant: {
24
+ type: PropType<ButtonVariant>;
25
+ default: string;
26
+ };
27
+ size: {
28
+ type: PropType<ButtonSize>;
29
+ default: string;
30
+ };
31
+ }>> & Readonly<{}>, {
32
+ size: ButtonSize;
33
+ variant: ButtonVariant;
34
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
35
+ export {};
36
+ //# sourceMappingURL=button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components/button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAsB,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAC;AAGxD,4EAA4E;AAC5E,eAAO,MAAM,cAAc;;;8EAmC1B,CAAC;AAEF,KAAK,aAAa,GAAG,WAAW,CAC9B,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC,SAAS,CAAC,CAC/C,CAAC;AACF,KAAK,UAAU,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAE3E,6DAA6D;AAC7D,eAAO,MAAM,MAAM;;cAIY,QAAQ,CAAC,aAAa,CAAC;;;;cAC1B,QAAQ,CAAC,UAAU,CAAC;;;;;;;cADjB,QAAQ,CAAC,aAAa,CAAC;;;;cAC1B,QAAQ,CAAC,UAAU,CAAC;;;;;;4EAsB9C,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { cva } from "class-variance-authority";
2
+ import { defineComponent, h } from "vue";
3
+ import { cn } from "#lib/utils";
4
+ /** Button style variants used by the shadcn-compatible Button component. */
5
+ export const buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
6
+ variants: {
7
+ variant: {
8
+ default: "bg-primary text-primary-foreground hover:bg-primary/80",
9
+ outline: "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
10
+ secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
11
+ ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
12
+ destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
13
+ link: "text-primary underline-offset-4 hover:underline",
14
+ },
15
+ size: {
16
+ default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
17
+ xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
18
+ sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
19
+ lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
20
+ icon: "size-8",
21
+ "icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
22
+ "icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
23
+ "icon-lg": "size-9",
24
+ },
25
+ },
26
+ defaultVariants: {
27
+ variant: "default",
28
+ size: "default",
29
+ },
30
+ });
31
+ /** shadcn-compatible button built on a native `<button>`. */
32
+ export const Button = defineComponent({
33
+ name: "Button",
34
+ inheritAttrs: false,
35
+ props: {
36
+ variant: { type: String, default: "default" },
37
+ size: { type: String, default: "default" },
38
+ },
39
+ setup(props, { slots, attrs }) {
40
+ return () => {
41
+ const { class: className, ...rest } = attrs;
42
+ return h("button", {
43
+ "data-slot": "button",
44
+ class: cn(buttonVariants({
45
+ variant: props.variant,
46
+ size: props.size,
47
+ className: className,
48
+ })),
49
+ ...rest,
50
+ }, slots.default?.());
51
+ };
52
+ },
53
+ });
@@ -0,0 +1,45 @@
1
+ import { type PropType } from "vue";
2
+ /** shadcn-compatible checkbox built on Reka UI. */
3
+ export declare const Checkbox: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ checked: {
5
+ type: PropType<boolean | undefined>;
6
+ default: undefined;
7
+ };
8
+ indeterminate: {
9
+ type: BooleanConstructor;
10
+ default: boolean;
11
+ };
12
+ disabled: {
13
+ type: BooleanConstructor;
14
+ default: boolean;
15
+ };
16
+ onCheckedChange: {
17
+ type: PropType<(checked: boolean) => void>;
18
+ default: undefined;
19
+ };
20
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
21
+ [key: string]: any;
22
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
23
+ checked: {
24
+ type: PropType<boolean | undefined>;
25
+ default: undefined;
26
+ };
27
+ indeterminate: {
28
+ type: BooleanConstructor;
29
+ default: boolean;
30
+ };
31
+ disabled: {
32
+ type: BooleanConstructor;
33
+ default: boolean;
34
+ };
35
+ onCheckedChange: {
36
+ type: PropType<(checked: boolean) => void>;
37
+ default: undefined;
38
+ };
39
+ }>> & Readonly<{}>, {
40
+ checked: boolean | undefined;
41
+ indeterminate: boolean;
42
+ disabled: boolean;
43
+ onCheckedChange: (checked: boolean) => void;
44
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
45
+ //# sourceMappingURL=checkbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/components/checkbox.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAC;AAGxD,mDAAmD;AACnD,eAAO,MAAM,QAAQ;;cAKE,QAAQ,CAAC,OAAO,GAAG,SAAS,CAAC;;;;;;;;;;;;cAM5B,QAAQ,CAAC,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;;;;;;;cANrC,QAAQ,CAAC,OAAO,GAAG,SAAS,CAAC;;;;;;;;;;;;cAM5B,QAAQ,CAAC,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;;;;;;;+BAAjB,OAAO,KAAK,IAAI;4EAyCzD,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { CheckIcon } from "lucide-vue-next";
2
+ import { CheckboxIndicator, CheckboxRoot } from "reka-ui";
3
+ import { defineComponent, h } from "vue";
4
+ import { cn } from "#lib/utils";
5
+ /** shadcn-compatible checkbox built on Reka UI. */
6
+ export const Checkbox = defineComponent({
7
+ name: "Checkbox",
8
+ inheritAttrs: false,
9
+ props: {
10
+ checked: {
11
+ type: Boolean,
12
+ default: undefined,
13
+ },
14
+ indeterminate: { type: Boolean, default: false },
15
+ disabled: { type: Boolean, default: false },
16
+ onCheckedChange: {
17
+ type: Function,
18
+ default: undefined,
19
+ },
20
+ },
21
+ setup(props, { attrs }) {
22
+ return () => {
23
+ const { class: className, ...rest } = attrs;
24
+ const modelValue = props.indeterminate
25
+ ? "indeterminate"
26
+ : (props.checked ?? false);
27
+ return h(CheckboxRoot, {
28
+ "data-slot": "checkbox",
29
+ modelValue,
30
+ disabled: props.disabled,
31
+ class: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-lg border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary", className),
32
+ "onUpdate:modelValue": (value) => {
33
+ props.onCheckedChange?.(value === true);
34
+ },
35
+ ...rest,
36
+ }, {
37
+ default: () => h(CheckboxIndicator, {
38
+ "data-slot": "checkbox-indicator",
39
+ class: "grid place-content-center text-current transition-none [&>svg]:size-3.5",
40
+ }, { default: () => h(CheckIcon) }),
41
+ });
42
+ };
43
+ },
44
+ });
@@ -0,0 +1,86 @@
1
+ import { type PropType } from "vue";
2
+ /** shadcn-compatible dialog root built on Reka UI. */
3
+ export declare const Dialog: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ open: {
5
+ type: PropType<boolean | undefined>;
6
+ default: undefined;
7
+ };
8
+ onOpenChange: {
9
+ type: PropType<(open: boolean) => void>;
10
+ default: undefined;
11
+ };
12
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
13
+ [key: string]: any;
14
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
15
+ open: {
16
+ type: PropType<boolean | undefined>;
17
+ default: undefined;
18
+ };
19
+ onOpenChange: {
20
+ type: PropType<(open: boolean) => void>;
21
+ default: undefined;
22
+ };
23
+ }>> & Readonly<{}>, {
24
+ open: boolean | undefined;
25
+ onOpenChange: (open: boolean) => void;
26
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
27
+ /** A button that closes the nearest ancestor dialog. */
28
+ export declare const DialogClose: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
29
+ asChild: {
30
+ type: BooleanConstructor;
31
+ default: boolean;
32
+ };
33
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
34
+ [key: string]: any;
35
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
36
+ asChild: {
37
+ type: BooleanConstructor;
38
+ default: boolean;
39
+ };
40
+ }>> & Readonly<{}>, {
41
+ asChild: boolean;
42
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
43
+ /** Portals the dialog's backdrop and popup to `document.body`. */
44
+ export declare const DialogPortal: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
45
+ [key: string]: any;
46
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
47
+ /** The dimmed overlay shown beneath an open dialog's popup. */
48
+ export declare const DialogBackdrop: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
49
+ [key: string]: any;
50
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
51
+ /**
52
+ * The dialog's centered content pane, complete with its own portal, backdrop,
53
+ * and close button so a consumer only has to render `Dialog` + `DialogContent`.
54
+ */
55
+ export declare const DialogContent: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
56
+ showClose: {
57
+ type: BooleanConstructor;
58
+ default: boolean;
59
+ };
60
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
61
+ [key: string]: any;
62
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
63
+ showClose: {
64
+ type: BooleanConstructor;
65
+ default: boolean;
66
+ };
67
+ }>> & Readonly<{}>, {
68
+ showClose: boolean;
69
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
70
+ /** Groups a dialog's title/description above its body. */
71
+ export declare const DialogHeader: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
72
+ [key: string]: any;
73
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
74
+ /** Groups a dialog's action buttons below its body. */
75
+ export declare const DialogFooter: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
76
+ [key: string]: any;
77
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
78
+ /** The dialog's accessible title text. */
79
+ export declare const DialogTitle: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
80
+ [key: string]: any;
81
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
82
+ /** The dialog's accessible supporting description text. */
83
+ export declare const DialogDescription: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
84
+ [key: string]: any;
85
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
86
+ //# sourceMappingURL=dialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/components/dialog.ts"],"names":[],"mappings":"AAUA,OAAO,EAAsB,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAC;AAGxD,sDAAsD;AACtD,eAAO,MAAM,MAAM;;cAKI,QAAQ,CAAC,OAAO,GAAG,SAAS,CAAC;;;;cAI5B,QAAQ,CAAC,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;;;;;;;cAJlC,QAAQ,CAAC,OAAO,GAAG,SAAS,CAAC;;;;cAI5B,QAAQ,CAAC,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;;;;;yBAAjB,OAAO,KAAK,IAAI;4EAgBtD,CAAC;AAEH,wDAAwD;AACxD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;4EAUtB,CAAC;AAEH,kEAAkE;AAClE,eAAO,MAAM,YAAY;;2OAMvB,CAAC;AAEH,+DAA+D;AAC/D,eAAO,MAAM,cAAc;;2OAgBzB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;4EAgDxB,CAAC;AAEH,0DAA0D;AAC1D,eAAO,MAAM,YAAY;;2OAiBvB,CAAC;AAEH,uDAAuD;AACvD,eAAO,MAAM,YAAY;;2OAiBvB,CAAC;AAEH,0CAA0C;AAC1C,eAAO,MAAM,WAAW;;2OAiBtB,CAAC;AAEH,2DAA2D;AAC3D,eAAO,MAAM,iBAAiB;;2OAiB5B,CAAC"}
@@ -0,0 +1,157 @@
1
+ import { XIcon } from "lucide-vue-next";
2
+ import { DialogClose as RekaDialogClose, DialogContent as RekaDialogContent, DialogDescription as RekaDialogDescription, DialogOverlay, DialogPortal as RekaDialogPortal, DialogRoot, DialogTitle as RekaDialogTitle, } from "reka-ui";
3
+ import { defineComponent, h } from "vue";
4
+ import { cn } from "#lib/utils";
5
+ /** shadcn-compatible dialog root built on Reka UI. */
6
+ export const Dialog = defineComponent({
7
+ name: "Dialog",
8
+ inheritAttrs: false,
9
+ props: {
10
+ open: {
11
+ type: Boolean,
12
+ default: undefined,
13
+ },
14
+ onOpenChange: {
15
+ type: Function,
16
+ default: undefined,
17
+ },
18
+ },
19
+ setup(props, { slots, attrs }) {
20
+ return () => h(DialogRoot, {
21
+ open: props.open,
22
+ "onUpdate:open": (open) => props.onOpenChange?.(open),
23
+ ...attrs,
24
+ }, slots);
25
+ },
26
+ });
27
+ /** A button that closes the nearest ancestor dialog. */
28
+ export const DialogClose = defineComponent({
29
+ name: "DialogClose",
30
+ inheritAttrs: false,
31
+ props: {
32
+ asChild: { type: Boolean, default: false },
33
+ },
34
+ setup(props, { slots, attrs }) {
35
+ return () => h(RekaDialogClose, { asChild: props.asChild, ...attrs }, slots);
36
+ },
37
+ });
38
+ /** Portals the dialog's backdrop and popup to `document.body`. */
39
+ export const DialogPortal = defineComponent({
40
+ name: "DialogPortal",
41
+ inheritAttrs: false,
42
+ setup(_props, { slots, attrs }) {
43
+ return () => h(RekaDialogPortal, attrs, slots);
44
+ },
45
+ });
46
+ /** The dimmed overlay shown beneath an open dialog's popup. */
47
+ export const DialogBackdrop = defineComponent({
48
+ name: "DialogBackdrop",
49
+ inheritAttrs: false,
50
+ setup(_props, { attrs }) {
51
+ return () => {
52
+ const { class: className, ...rest } = attrs;
53
+ return h(DialogOverlay, {
54
+ "data-slot": "dialog-backdrop",
55
+ class: cn("fixed inset-0 z-50 bg-black/50 duration-100 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0", className),
56
+ ...rest,
57
+ });
58
+ };
59
+ },
60
+ });
61
+ /**
62
+ * The dialog's centered content pane, complete with its own portal, backdrop,
63
+ * and close button so a consumer only has to render `Dialog` + `DialogContent`.
64
+ */
65
+ export const DialogContent = defineComponent({
66
+ name: "DialogContent",
67
+ inheritAttrs: false,
68
+ props: {
69
+ showClose: { type: Boolean, default: true },
70
+ },
71
+ setup(props, { slots, attrs }) {
72
+ return () => {
73
+ const { class: className, ...rest } = attrs;
74
+ return h(DialogPortal, {}, {
75
+ default: () => [
76
+ h(DialogBackdrop),
77
+ h(RekaDialogContent, {
78
+ "data-slot": "dialog-content",
79
+ class: cn("fixed top-1/2 left-1/2 z-50 grid w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border border-border bg-background p-6 shadow-lg duration-100 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", className),
80
+ ...rest,
81
+ }, {
82
+ default: () => [
83
+ slots.default?.(),
84
+ props.showClose
85
+ ? h(RekaDialogClose, {
86
+ "data-slot": "dialog-close",
87
+ "aria-label": "Close",
88
+ class: "absolute top-4 right-4 rounded-md opacity-70 outline-none transition-opacity hover:opacity-100 focus-visible:ring-3 focus-visible:ring-ring/50",
89
+ }, { default: () => h(XIcon, { class: "size-4" }) })
90
+ : null,
91
+ ],
92
+ }),
93
+ ],
94
+ });
95
+ };
96
+ },
97
+ });
98
+ /** Groups a dialog's title/description above its body. */
99
+ export const DialogHeader = defineComponent({
100
+ name: "DialogHeader",
101
+ inheritAttrs: false,
102
+ setup(_props, { slots, attrs }) {
103
+ return () => {
104
+ const { class: className, ...rest } = attrs;
105
+ return h("div", {
106
+ "data-slot": "dialog-header",
107
+ class: cn("flex flex-col gap-1.5", className),
108
+ ...rest,
109
+ }, slots.default?.());
110
+ };
111
+ },
112
+ });
113
+ /** Groups a dialog's action buttons below its body. */
114
+ export const DialogFooter = defineComponent({
115
+ name: "DialogFooter",
116
+ inheritAttrs: false,
117
+ setup(_props, { slots, attrs }) {
118
+ return () => {
119
+ const { class: className, ...rest } = attrs;
120
+ return h("div", {
121
+ "data-slot": "dialog-footer",
122
+ class: cn("flex justify-end gap-2 pt-2", className),
123
+ ...rest,
124
+ }, slots.default?.());
125
+ };
126
+ },
127
+ });
128
+ /** The dialog's accessible title text. */
129
+ export const DialogTitle = defineComponent({
130
+ name: "DialogTitle",
131
+ inheritAttrs: false,
132
+ setup(_props, { slots, attrs }) {
133
+ return () => {
134
+ const { class: className, ...rest } = attrs;
135
+ return h(RekaDialogTitle, {
136
+ "data-slot": "dialog-title",
137
+ class: cn("text-lg font-semibold", className),
138
+ ...rest,
139
+ }, slots);
140
+ };
141
+ },
142
+ });
143
+ /** The dialog's accessible supporting description text. */
144
+ export const DialogDescription = defineComponent({
145
+ name: "DialogDescription",
146
+ inheritAttrs: false,
147
+ setup(_props, { slots, attrs }) {
148
+ return () => {
149
+ const { class: className, ...rest } = attrs;
150
+ return h(RekaDialogDescription, {
151
+ "data-slot": "dialog-description",
152
+ class: cn("text-sm text-muted-foreground", className),
153
+ ...rest,
154
+ }, slots);
155
+ };
156
+ },
157
+ });
@@ -0,0 +1,5 @@
1
+ /** shadcn-compatible input built on a native `<input>`. */
2
+ export declare const Input: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
3
+ [key: string]: any;
4
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
5
+ //# sourceMappingURL=input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/components/input.ts"],"names":[],"mappings":"AAGA,2DAA2D;AAC3D,eAAO,MAAM,KAAK;;2OAgBhB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { defineComponent, h } from "vue";
2
+ import { cn } from "#lib/utils";
3
+ /** shadcn-compatible input built on a native `<input>`. */
4
+ export const Input = defineComponent({
5
+ name: "Input",
6
+ inheritAttrs: false,
7
+ setup(_props, { attrs }) {
8
+ return () => {
9
+ const { class: className, ...rest } = attrs;
10
+ return h("input", {
11
+ "data-slot": "input",
12
+ class: cn("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className),
13
+ ...rest,
14
+ });
15
+ };
16
+ },
17
+ });
@@ -0,0 +1,5 @@
1
+ /** shadcn-compatible label component. */
2
+ export declare const Label: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
3
+ [key: string]: any;
4
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
5
+ //# sourceMappingURL=label.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../src/components/label.ts"],"names":[],"mappings":"AAGA,yCAAyC;AACzC,eAAO,MAAM,KAAK;;2OAoBhB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { defineComponent, h } from "vue";
2
+ import { cn } from "#lib/utils";
3
+ /** shadcn-compatible label component. */
4
+ export const Label = defineComponent({
5
+ name: "Label",
6
+ inheritAttrs: false,
7
+ setup(_props, { slots, attrs }) {
8
+ return () => {
9
+ const { class: className, ...rest } = attrs;
10
+ return h("label", {
11
+ "data-slot": "label",
12
+ class: cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className),
13
+ ...rest,
14
+ }, slots.default?.());
15
+ };
16
+ },
17
+ });