@verikit/react 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 +23 -0
  6. package/dist/client/use-verikit-client.d.ts.map +1 -0
  7. package/dist/client/use-verikit-client.js +22 -0
  8. package/dist/components/button.d.ts +11 -0
  9. package/dist/components/button.d.ts.map +1 -0
  10. package/dist/components/button.js +36 -0
  11. package/dist/components/checkbox.d.ts +5 -0
  12. package/dist/components/checkbox.d.ts.map +1 -0
  13. package/dist/components/checkbox.js +10 -0
  14. package/dist/components/dialog.d.ts +27 -0
  15. package/dist/components/dialog.d.ts.map +1 -0
  16. package/dist/components/dialog.js +40 -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 +8 -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 +7 -0
  23. package/dist/components/select.d.ts +26 -0
  24. package/dist/components/select.d.ts.map +1 -0
  25. package/dist/components/select.js +43 -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 +7 -0
  29. package/dist/fields/field-shell.d.ts +28 -0
  30. package/dist/fields/field-shell.d.ts.map +1 -0
  31. package/dist/fields/field-shell.js +29 -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 +22 -0
  36. package/dist/fields/inputs.d.ts.map +1 -0
  37. package/dist/fields/inputs.js +136 -0
  38. package/dist/fields/registry.d.ts +33 -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 +37 -0
  48. package/dist/form/use-verikit-form.d.ts.map +1 -0
  49. package/dist/form/use-verikit-form.js +66 -0
  50. package/dist/form/use-verikit-schema-tree-form.d.ts +46 -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 +94 -0
  53. package/dist/index.d.ts +10 -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 +143 -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 +38 -0
  72. package/dist/query/use-resource-form.d.ts.map +1 -0
  73. package/dist/query/use-resource-form.js +31 -0
  74. package/dist/query/use-resource-mutations.d.ts +30 -0
  75. package/dist/query/use-resource-mutations.d.ts.map +1 -0
  76. package/dist/query/use-resource-mutations.js +107 -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 +35 -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 +43 -0
  83. package/dist/query/use-resource-table.d.ts +46 -0
  84. package/dist/query/use-resource-table.d.ts.map +1 -0
  85. package/dist/query/use-resource-table.js +81 -0
  86. package/dist/relationships/belongs-to-field.d.ts +29 -0
  87. package/dist/relationships/belongs-to-field.d.ts.map +1 -0
  88. package/dist/relationships/belongs-to-field.js +28 -0
  89. package/dist/relationships/index.d.ts +3 -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 +28 -0
  96. package/dist/resource/resource-form.d.ts.map +1 -0
  97. package/dist/resource/resource-form.js +25 -0
  98. package/dist/resource/resource-table-filters.d.ts +26 -0
  99. package/dist/resource/resource-table-filters.d.ts.map +1 -0
  100. package/dist/resource/resource-table-filters.js +151 -0
  101. package/dist/resource/resource-table.d.ts +45 -0
  102. package/dist/resource/resource-table.d.ts.map +1 -0
  103. package/dist/resource/resource-table.js +179 -0
  104. package/package.json +89 -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,23 @@
1
+ import type { VerikitClient } from "@verikit/client";
2
+ import { QueryClient } from "@tanstack/react-query";
3
+ import { type ReactNode } from "react";
4
+ export interface VerikitProviderProps {
5
+ client: VerikitClient;
6
+ /**
7
+ * An application's own `QueryClient`, so `@verikit/react`'s query hooks 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
+ children?: ReactNode;
13
+ }
14
+ /**
15
+ * Provides a `VerikitClient` and TanStack Query `QueryClient` to its subtree.
16
+ *
17
+ * If `queryClient` is omitted, the provider creates one automatically.
18
+ * Apps with an existing `QueryClient` can pass it to share the same cache.
19
+ */
20
+ export declare function VerikitProvider({ client, queryClient, children, }: VerikitProviderProps): import("react").JSX.Element;
21
+ /** Reads the nearest ancestor `VerikitProvider`'s client. */
22
+ export declare function useVerikitClient(): VerikitClient;
23
+ //# 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.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAuB,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAM5E,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,aAAa,CAAC;IACtB;;;;OAIG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,WAAW,EACX,QAAQ,GACT,EAAE,oBAAoB,+BAUtB;AAED,6DAA6D;AAC7D,wBAAgB,gBAAgB,IAAI,aAAa,CAQhD"}
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
3
+ import { createContext, useContext, useState } from "react";
4
+ const VerikitClientContext = createContext(undefined);
5
+ /**
6
+ * Provides a `VerikitClient` and TanStack Query `QueryClient` to its subtree.
7
+ *
8
+ * If `queryClient` is omitted, the provider creates one automatically.
9
+ * Apps with an existing `QueryClient` can pass it to share the same cache.
10
+ */
11
+ export function VerikitProvider({ client, queryClient, children, }) {
12
+ const [ownedQueryClient] = useState(() => new QueryClient());
13
+ return (_jsx(QueryClientProvider, { client: queryClient ?? ownedQueryClient, children: _jsx(VerikitClientContext.Provider, { value: client, children: children }) }));
14
+ }
15
+ /** Reads the nearest ancestor `VerikitProvider`'s client. */
16
+ export function useVerikitClient() {
17
+ const client = useContext(VerikitClientContext);
18
+ if (!client) {
19
+ throw new Error("useVerikitClient must be used within a VerikitProvider.");
20
+ }
21
+ return client;
22
+ }
@@ -0,0 +1,11 @@
1
+ import { Button as ButtonPrimitive } from "@base-ui/react/button";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ /** Button style variants used by the shadcn-compatible Button component. */
4
+ declare const buttonVariants: (props?: ({
5
+ variant?: "default" | "outline" | "link" | "secondary" | "ghost" | "destructive" | null | undefined;
6
+ size?: "default" | "icon" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ /** shadcn-compatible button built on Base UI. */
9
+ declare function Button({ className, variant, size, ...props }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>): import("react").JSX.Element;
10
+ export { Button, buttonVariants };
11
+ //# sourceMappingURL=button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components/button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,4EAA4E;AAC5E,QAAA,MAAM,cAAc;;;8EAmCnB,CAAC;AAEF,iDAAiD;AACjD,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAmB,EACnB,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,KAAK,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,+BAQ7D;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Button as ButtonPrimitive } from "@base-ui/react/button";
3
+ import { cva } from "class-variance-authority";
4
+ import { cn } from "#lib/utils";
5
+ /** Button style variants used by the shadcn-compatible Button component. */
6
+ 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", {
7
+ variants: {
8
+ variant: {
9
+ default: "bg-primary text-primary-foreground hover:bg-primary/80",
10
+ 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",
11
+ 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",
12
+ ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
13
+ 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",
14
+ link: "text-primary underline-offset-4 hover:underline",
15
+ },
16
+ size: {
17
+ default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
18
+ 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",
19
+ 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",
20
+ lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
21
+ icon: "size-8",
22
+ "icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
23
+ "icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
24
+ "icon-lg": "size-9",
25
+ },
26
+ },
27
+ defaultVariants: {
28
+ variant: "default",
29
+ size: "default",
30
+ },
31
+ });
32
+ /** shadcn-compatible button built on Base UI. */
33
+ function Button({ className, variant = "default", size = "default", ...props }) {
34
+ return (_jsx(ButtonPrimitive, { "data-slot": "button", className: cn(buttonVariants({ variant, size, className })), ...props }));
35
+ }
36
+ export { Button, buttonVariants };
@@ -0,0 +1,5 @@
1
+ import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox";
2
+ /** shadcn-compatible checkbox built on Base UI. */
3
+ declare function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props): import("react").JSX.Element;
4
+ export { Checkbox };
5
+ //# sourceMappingURL=checkbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/components/checkbox.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAKxE,mDAAmD;AACnD,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,CAAC,IAAI,CAAC,KAAK,+BAkBtE;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox";
4
+ import { cn } from "#lib/utils";
5
+ import { CheckIcon } from "lucide-react";
6
+ /** shadcn-compatible checkbox built on Base UI. */
7
+ function Checkbox({ className, ...props }) {
8
+ return (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: 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-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary", className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "grid place-content-center text-current transition-none [&>svg]:size-3.5", children: _jsx(CheckIcon, {}) }) }));
9
+ }
10
+ export { Checkbox };
@@ -0,0 +1,27 @@
1
+ import * as React from "react";
2
+ import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
3
+ /** shadcn-compatible dialog root built on Base UI. */
4
+ declare const Dialog: typeof DialogPrimitive.Root;
5
+ /** A button that closes the nearest ancestor dialog. */
6
+ declare const DialogClose: React.ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogCloseProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
7
+ /** Portals the dialog's backdrop and popup to `document.body`. */
8
+ declare function DialogPortal({ ...props }: DialogPrimitive.Portal.Props): React.JSX.Element;
9
+ /** The dimmed overlay shown beneath an open dialog's popup. */
10
+ declare function DialogBackdrop({ className, ...props }: DialogPrimitive.Backdrop.Props): React.JSX.Element;
11
+ /**
12
+ * The dialog's centered content pane, complete with its own portal, backdrop,
13
+ * and close button so a consumer only has to render `Dialog` + `DialogContent`.
14
+ */
15
+ declare function DialogContent({ className, children, showClose, ...props }: DialogPrimitive.Popup.Props & {
16
+ showClose?: boolean;
17
+ }): React.JSX.Element;
18
+ /** Groups a dialog's title/description above its body. */
19
+ declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
20
+ /** Groups a dialog's action buttons below its body. */
21
+ declare function DialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
22
+ /** The dialog's accessible title text. */
23
+ declare function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props): React.JSX.Element;
24
+ /** The dialog's accessible supporting description text. */
25
+ declare function DialogDescription({ className, ...props }: DialogPrimitive.Description.Props): React.JSX.Element;
26
+ export { Dialog, DialogBackdrop, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogTitle, };
27
+ //# sourceMappingURL=dialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/components/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAKlE,sDAAsD;AACtD,QAAA,MAAM,MAAM,6BAAuB,CAAC;AAEpC,wDAAwD;AACxD,QAAA,MAAM,WAAW,yIAAwB,CAAC;AAE1C,kEAAkE;AAClE,iBAAS,YAAY,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,MAAM,CAAC,KAAK,qBAE/D;AAED,+DAA+D;AAC/D,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,QAAQ,CAAC,KAAK,qBAWhC;AAED;;;GAGG;AACH,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,SAAgB,EAChB,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,GAAG;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,qBAyBvD;AAED,0DAA0D;AAC1D,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQzE;AAED,uDAAuD;AACvD,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQzE;AAED,0CAA0C;AAC1C,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,qBAQxE;AAED,2DAA2D;AAC3D,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,WAAW,CAAC,KAAK,qBAQnC;AAED,OAAO,EACL,MAAM,EACN,cAAc,EACd,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,GACZ,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
3
+ import { XIcon } from "lucide-react";
4
+ import { cn } from "#lib/utils";
5
+ /** shadcn-compatible dialog root built on Base UI. */
6
+ const Dialog = DialogPrimitive.Root;
7
+ /** A button that closes the nearest ancestor dialog. */
8
+ const DialogClose = DialogPrimitive.Close;
9
+ /** Portals the dialog's backdrop and popup to `document.body`. */
10
+ function DialogPortal({ ...props }) {
11
+ return _jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
12
+ }
13
+ /** The dimmed overlay shown beneath an open dialog's popup. */
14
+ function DialogBackdrop({ className, ...props }) {
15
+ return (_jsx(DialogPrimitive.Backdrop, { "data-slot": "dialog-backdrop", className: cn("fixed inset-0 z-50 bg-black/50 duration-100 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className), ...props }));
16
+ }
17
+ /**
18
+ * The dialog's centered content pane, complete with its own portal, backdrop,
19
+ * and close button so a consumer only has to render `Dialog` + `DialogContent`.
20
+ */
21
+ function DialogContent({ className, children, showClose = true, ...props }) {
22
+ return (_jsxs(DialogPortal, { children: [_jsx(DialogBackdrop, {}), _jsxs(DialogPrimitive.Popup, { "data-slot": "dialog-content", className: 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-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props, children: [children, showClose ? (_jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", "aria-label": "Close", className: "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", children: _jsx(XIcon, { className: "size-4" }) })) : null] })] }));
23
+ }
24
+ /** Groups a dialog's title/description above its body. */
25
+ function DialogHeader({ className, ...props }) {
26
+ return (_jsx("div", { "data-slot": "dialog-header", className: cn("flex flex-col gap-1.5", className), ...props }));
27
+ }
28
+ /** Groups a dialog's action buttons below its body. */
29
+ function DialogFooter({ className, ...props }) {
30
+ return (_jsx("div", { "data-slot": "dialog-footer", className: cn("flex justify-end gap-2 pt-2", className), ...props }));
31
+ }
32
+ /** The dialog's accessible title text. */
33
+ function DialogTitle({ className, ...props }) {
34
+ return (_jsx(DialogPrimitive.Title, { "data-slot": "dialog-title", className: cn("text-lg font-semibold", className), ...props }));
35
+ }
36
+ /** The dialog's accessible supporting description text. */
37
+ function DialogDescription({ className, ...props }) {
38
+ return (_jsx(DialogPrimitive.Description, { "data-slot": "dialog-description", className: cn("text-sm text-muted-foreground", className), ...props }));
39
+ }
40
+ export { Dialog, DialogBackdrop, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogTitle, };
@@ -0,0 +1,5 @@
1
+ import * as React from "react";
2
+ /** shadcn-compatible input built on Base UI. */
3
+ declare function Input({ className, type, ...props }: React.ComponentProps<"input">): React.JSX.Element;
4
+ export { Input };
5
+ //# sourceMappingURL=input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/components/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,gDAAgD;AAChD,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,qBAY1E;AAED,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Input as InputPrimitive } from "@base-ui/react/input";
3
+ import { cn } from "#lib/utils";
4
+ /** shadcn-compatible input built on Base UI. */
5
+ function Input({ className, type, ...props }) {
6
+ return (_jsx(InputPrimitive, { type: type, "data-slot": "input", className: 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), ...props }));
7
+ }
8
+ export { Input };
@@ -0,0 +1,5 @@
1
+ import * as React from "react";
2
+ /** shadcn-compatible label component. */
3
+ declare function Label({ className, ...props }: React.ComponentProps<"label">): React.JSX.Element;
4
+ export { Label };
5
+ //# sourceMappingURL=label.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../src/components/label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,yCAAyC;AACzC,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,qBAWpE;AAED,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "#lib/utils";
3
+ /** shadcn-compatible label component. */
4
+ function Label({ className, ...props }) {
5
+ return (_jsx("label", { "data-slot": "label", className: 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), ...props }));
6
+ }
7
+ export { Label };
@@ -0,0 +1,26 @@
1
+ import * as React from "react";
2
+ import { Select as SelectPrimitive } from "@base-ui/react/select";
3
+ /** shadcn-compatible select root built on Base UI. */
4
+ declare const Select: typeof SelectPrimitive.Root;
5
+ /** Groups related select items. */
6
+ declare function SelectGroup({ className, ...props }: SelectPrimitive.Group.Props): React.JSX.Element;
7
+ /** Displays the current select value or placeholder. */
8
+ declare function SelectValue({ className, ...props }: SelectPrimitive.Value.Props): React.JSX.Element;
9
+ /** Opens the select popup and displays the current value. */
10
+ declare function SelectTrigger({ className, size, children, ...props }: SelectPrimitive.Trigger.Props & {
11
+ size?: "sm" | "default";
12
+ }): React.JSX.Element;
13
+ /** Renders the select popup content. */
14
+ declare function SelectContent({ className, children, side, sideOffset, align, alignOffset, alignItemWithTrigger, ...props }: SelectPrimitive.Popup.Props & Pick<SelectPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset" | "alignItemWithTrigger">): React.JSX.Element;
15
+ /** Renders a label inside a select group. */
16
+ declare function SelectLabel({ className, ...props }: SelectPrimitive.GroupLabel.Props): React.JSX.Element;
17
+ /** Renders a selectable item. */
18
+ declare function SelectItem({ className, children, ...props }: SelectPrimitive.Item.Props): React.JSX.Element;
19
+ /** Renders a visual separator between select items. */
20
+ declare function SelectSeparator({ className, ...props }: SelectPrimitive.Separator.Props): React.JSX.Element;
21
+ /** Renders the scroll-up affordance for overflowing select content. */
22
+ declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpArrow>): React.JSX.Element;
23
+ /** Renders the scroll-down affordance for overflowing select content. */
24
+ declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownArrow>): React.JSX.Element;
25
+ export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
26
+ //# sourceMappingURL=select.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/components/select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAKlE,sDAAsD;AACtD,QAAA,MAAM,MAAM,6BAAuB,CAAC;AAEpC,mCAAmC;AACnC,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,qBAQxE;AAED,wDAAwD;AACxD,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,qBAQxE;AAED,6DAA6D;AAC7D,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,IAAgB,EAChB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,OAAO,CAAC,KAAK,GAAG;IACjC,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;CACzB,qBAmBA;AAED,wCAAwC;AACxC,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,IAAe,EACf,UAAc,EACd,KAAgB,EAChB,WAAe,EACf,oBAA2B,EAC3B,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,GAC5B,IAAI,CACF,eAAe,CAAC,UAAU,CAAC,KAAK,EAChC,OAAO,GAAG,aAAa,GAAG,MAAM,GAAG,YAAY,GAAG,sBAAsB,CACzE,qBA2BF;AAED,6CAA6C;AAC7C,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,UAAU,CAAC,KAAK,qBAQlC;AAED,iCAAiC;AACjC,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,IAAI,CAAC,KAAK,qBAsB5B;AAED,uDAAuD;AACvD,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,SAAS,CAAC,KAAK,qBAQjC;AAED,uEAAuE;AACvE,iBAAS,oBAAoB,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,aAAa,CAAC,qBAa5D;AAED,yEAAyE;AACzE,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,eAAe,CAAC,qBAa9D;AAED,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,WAAW,GACZ,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Select as SelectPrimitive } from "@base-ui/react/select";
3
+ import { cn } from "#lib/utils";
4
+ import { ChevronDownIcon, CheckIcon, ChevronUpIcon } from "lucide-react";
5
+ /** shadcn-compatible select root built on Base UI. */
6
+ const Select = SelectPrimitive.Root;
7
+ /** Groups related select items. */
8
+ function SelectGroup({ className, ...props }) {
9
+ return (_jsx(SelectPrimitive.Group, { "data-slot": "select-group", className: cn("scroll-my-1 p-1", className), ...props }));
10
+ }
11
+ /** Displays the current select value or placeholder. */
12
+ function SelectValue({ className, ...props }) {
13
+ return (_jsx(SelectPrimitive.Value, { "data-slot": "select-value", className: cn("flex flex-1 text-left", className), ...props }));
14
+ }
15
+ /** Opens the select popup and displays the current value. */
16
+ function SelectTrigger({ className, size = "default", children, ...props }) {
17
+ return (_jsxs(SelectPrimitive.Trigger, { "data-slot": "select-trigger", "data-size": size, className: cn("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none 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 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 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", className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { render: _jsx(ChevronDownIcon, { className: "pointer-events-none size-4 text-muted-foreground" }) })] }));
18
+ }
19
+ /** Renders the select popup content. */
20
+ function SelectContent({ className, children, side = "bottom", sideOffset = 4, align = "center", alignOffset = 0, alignItemWithTrigger = true, ...props }) {
21
+ return (_jsx(SelectPrimitive.Portal, { children: _jsx(SelectPrimitive.Positioner, { side: side, sideOffset: sideOffset, align: align, alignOffset: alignOffset, alignItemWithTrigger: alignItemWithTrigger, className: "isolate z-50", children: _jsxs(SelectPrimitive.Popup, { "data-slot": "select-content", "data-align-trigger": alignItemWithTrigger, className: cn("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props, children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.List, { children: children }), _jsx(SelectScrollDownButton, {})] }) }) }));
22
+ }
23
+ /** Renders a label inside a select group. */
24
+ function SelectLabel({ className, ...props }) {
25
+ return (_jsx(SelectPrimitive.GroupLabel, { "data-slot": "select-label", className: cn("px-1.5 py-1 text-xs text-muted-foreground", className), ...props }));
26
+ }
27
+ /** Renders a selectable item. */
28
+ function SelectItem({ className, children, ...props }) {
29
+ return (_jsxs(SelectPrimitive.Item, { "data-slot": "select-item", className: cn("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className), ...props, children: [_jsx(SelectPrimitive.ItemText, { className: "flex flex-1 shrink-0 gap-2 whitespace-nowrap", children: children }), _jsx(SelectPrimitive.ItemIndicator, { render: _jsx("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center" }), children: _jsx(CheckIcon, { className: "pointer-events-none" }) })] }));
30
+ }
31
+ /** Renders a visual separator between select items. */
32
+ function SelectSeparator({ className, ...props }) {
33
+ return (_jsx(SelectPrimitive.Separator, { "data-slot": "select-separator", className: cn("pointer-events-none -mx-1 my-1 h-px bg-border", className), ...props }));
34
+ }
35
+ /** Renders the scroll-up affordance for overflowing select content. */
36
+ function SelectScrollUpButton({ className, ...props }) {
37
+ return (_jsx(SelectPrimitive.ScrollUpArrow, { "data-slot": "select-scroll-up-button", className: cn("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: _jsx(ChevronUpIcon, {}) }));
38
+ }
39
+ /** Renders the scroll-down affordance for overflowing select content. */
40
+ function SelectScrollDownButton({ className, ...props }) {
41
+ return (_jsx(SelectPrimitive.ScrollDownArrow, { "data-slot": "select-scroll-down-button", className: cn("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: _jsx(ChevronDownIcon, {}) }));
42
+ }
43
+ export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
@@ -0,0 +1,5 @@
1
+ import * as React from "react";
2
+ /** shadcn-compatible textarea component. */
3
+ declare function Textarea({ className, ...props }: React.ComponentProps<"textarea">): React.JSX.Element;
4
+ export { Textarea };
5
+ //# sourceMappingURL=textarea.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../src/components/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,4CAA4C;AAC5C,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,qBAW1E;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "#lib/utils";
3
+ /** shadcn-compatible textarea component. */
4
+ function Textarea({ className, ...props }) {
5
+ return (_jsx("textarea", { "data-slot": "textarea", className: cn("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 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), ...props }));
6
+ }
7
+ export { Textarea };
@@ -0,0 +1,28 @@
1
+ import type { FieldSchema } from "@verikit/core";
2
+ import type { ReactNode } from "react";
3
+ /** Props for the shared field wrapper used by Verikit inputs. */
4
+ export interface FieldShellProps {
5
+ /** Schema metadata for the rendered field. */
6
+ field: FieldSchema;
7
+ /** Id assigned to the concrete input control. */
8
+ id: string;
9
+ /** Error content rendered below the input. */
10
+ error?: ReactNode;
11
+ /** Class name applied to the shell container. */
12
+ className?: string;
13
+ /** Input control rendered inside the shell. */
14
+ children: ReactNode;
15
+ }
16
+ /**
17
+ * Renders a label, description, error message, and field control wrapper.
18
+ */
19
+ export declare function FieldShell({ field, id, error, className, children, }: FieldShellProps): import("react").JSX.Element;
20
+ /** Builds ARIA props that connect a field with its description and error. */
21
+ export declare function fieldAriaProps(field: FieldSchema, id: string, error?: ReactNode): {
22
+ "aria-describedby"?: string;
23
+ "aria-invalid"?: true;
24
+ "aria-required"?: true;
25
+ };
26
+ /** Returns the explicit id or derives a stable id from the field name. */
27
+ export declare function fieldId(field: FieldSchema, id?: string): string;
28
+ //# sourceMappingURL=field-shell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field-shell.d.ts","sourceRoot":"","sources":["../../src/fields/field-shell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,iEAAiE;AACjE,MAAM,WAAW,eAAe;IAC9B,8CAA8C;IAC9C,KAAK,EAAE,WAAW,CAAC;IACnB,iDAAiD;IACjD,EAAE,EAAE,MAAM,CAAC;IACX,8CAA8C;IAC9C,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,EAAE,EACF,KAAK,EACL,SAAS,EACT,QAAQ,GACT,EAAE,eAAe,+BA6BjB;AAED,6EAA6E;AAC7E,wBAAgB,cAAc,CAC5B,KAAK,EAAE,WAAW,EAClB,EAAE,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,SAAS,GAChB;IACD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,IAAI,CAAC;CACxB,CAaA;AAED,0EAA0E;AAC1E,wBAAgB,OAAO,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE/D"}
@@ -0,0 +1,29 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Label } from "#components/label";
3
+ import { cn } from "#lib/utils";
4
+ /**
5
+ * Renders a label, description, error message, and field control wrapper.
6
+ */
7
+ export function FieldShell({ field, id, error, className, children, }) {
8
+ const descriptionId = field.description ? `${id}-description` : undefined;
9
+ const errorId = error ? `${id}-error` : undefined;
10
+ return (_jsxs("div", { className: cn("grid gap-2", className), children: [field.label ? (_jsxs(Label, { htmlFor: id, className: "gap-1", children: [field.label, field.required ? (_jsx("span", { className: "text-destructive", "aria-hidden": "true", children: "*" })) : null] })) : null, children, field.description ? (_jsx("p", { id: descriptionId, className: "text-sm text-muted-foreground", children: field.description })) : null, error ? (_jsx("p", { id: errorId, className: "text-sm text-destructive", children: error })) : null] }));
11
+ }
12
+ /** Builds ARIA props that connect a field with its description and error. */
13
+ export function fieldAriaProps(field, id, error) {
14
+ const describedBy = [
15
+ field.description ? `${id}-description` : undefined,
16
+ error ? `${id}-error` : undefined,
17
+ ]
18
+ .filter(Boolean)
19
+ .join(" ");
20
+ return {
21
+ "aria-describedby": describedBy || undefined,
22
+ "aria-invalid": error ? true : undefined,
23
+ "aria-required": field.required ? true : undefined,
24
+ };
25
+ }
26
+ /** Returns the explicit id or derives a stable id from the field name. */
27
+ export function fieldId(field, id) {
28
+ return id ?? `verikit-field-${field.name}`;
29
+ }
@@ -0,0 +1,7 @@
1
+ export { FieldShell, fieldAriaProps, fieldId } from "./field-shell.js";
2
+ export { defaultFieldRegistry, getFieldComponent, RenderField, } from "./registry.js";
3
+ export { BooleanField, DateField, DateTimeField, EmailField, FileField, ImageField, NumberField, SelectField, TextareaField, TextField, } from "./inputs.js";
4
+ export type { FieldShellProps } from "./field-shell.js";
5
+ export type { RenderFieldProps } from "./registry.js";
6
+ export type { VerikitFieldComponent, VerikitFieldComponentProps, VerikitFieldRegistry, } from "./types.js";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fields/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,WAAW,GACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,YAAY,EACZ,SAAS,EACT,aAAa,EACb,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACX,WAAW,EACX,aAAa,EACb,SAAS,GACV,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,YAAY,EACV,qBAAqB,EACrB,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,YAAY,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { FieldShell, fieldAriaProps, fieldId } from "./field-shell.js";
2
+ export { defaultFieldRegistry, getFieldComponent, RenderField, } from "./registry.js";
3
+ export { BooleanField, DateField, DateTimeField, EmailField, FileField, ImageField, NumberField, SelectField, TextareaField, TextField, } from "./inputs.js";
@@ -0,0 +1,22 @@
1
+ import type { VerikitFieldComponentProps } from "./types.js";
2
+ /** Renders a text input field. */
3
+ export declare function TextField(props: VerikitFieldComponentProps): import("react").JSX.Element;
4
+ /** Renders an email input field. */
5
+ export declare function EmailField(props: VerikitFieldComponentProps): import("react").JSX.Element;
6
+ /** Renders a numeric input field. */
7
+ export declare function NumberField(props: VerikitFieldComponentProps): import("react").JSX.Element;
8
+ /** Renders a date input field. */
9
+ export declare function DateField(props: VerikitFieldComponentProps): import("react").JSX.Element;
10
+ /** Renders a date-time input field. */
11
+ export declare function DateTimeField(props: VerikitFieldComponentProps): import("react").JSX.Element;
12
+ /** Renders a textarea field. */
13
+ export declare function TextareaField({ field, id, name, value, error, disabled, readOnly, className, inputClassName, onBlur, onValueChange, }: VerikitFieldComponentProps): import("react").JSX.Element;
14
+ /** Renders a select field from schema options. */
15
+ export declare function SelectField({ field, id, name, value, error, disabled, readOnly, className, inputClassName, onBlur, onValueChange, }: VerikitFieldComponentProps): import("react").JSX.Element;
16
+ /** Renders a boolean field as a checkbox. */
17
+ export declare function BooleanField({ field, id, name, value, error, disabled, readOnly, className, inputClassName, onValueChange, }: VerikitFieldComponentProps): import("react").JSX.Element;
18
+ /** Renders a file upload field. */
19
+ export declare function FileField(props: VerikitFieldComponentProps): import("react").JSX.Element;
20
+ /** Renders an image upload field. */
21
+ export declare function ImageField(props: VerikitFieldComponentProps): import("react").JSX.Element;
22
+ //# sourceMappingURL=inputs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inputs.d.ts","sourceRoot":"","sources":["../../src/fields/inputs.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AA6E7D,kCAAkC;AAClC,wBAAgB,SAAS,CAAC,KAAK,EAAE,0BAA0B,+BAE1D;AAED,oCAAoC;AACpC,wBAAgB,UAAU,CAAC,KAAK,EAAE,0BAA0B,+BAE3D;AAED,qCAAqC;AACrC,wBAAgB,WAAW,CAAC,KAAK,EAAE,0BAA0B,+BAE5D;AAED,kCAAkC;AAClC,wBAAgB,SAAS,CAAC,KAAK,EAAE,0BAA0B,+BAE1D;AAED,uCAAuC;AACvC,wBAAgB,aAAa,CAAC,KAAK,EAAE,0BAA0B,+BAE9D;AAmDD,gCAAgC;AAChC,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,EAAE,EACF,IAAI,EACJ,KAAK,EACL,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,cAAc,EACd,MAAM,EACN,aAAa,GACd,EAAE,0BAA0B,+BAqB5B;AAED,kDAAkD;AAClD,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,EAAE,EACF,IAAI,EACJ,KAAK,EACL,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,cAAc,EACd,MAAM,EACN,aAAa,GACd,EAAE,0BAA0B,+BAyC5B;AAED,6CAA6C;AAC7C,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,EAAE,EACF,IAAI,EACJ,KAAK,EACL,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,cAAc,EACd,aAAa,GACd,EAAE,0BAA0B,+BAsB5B;AAED,mCAAmC;AACnC,wBAAgB,SAAS,CAAC,KAAK,EAAE,0BAA0B,+BAE1D;AAED,qCAAqC;AACrC,wBAAgB,UAAU,CAAC,KAAK,EAAE,0BAA0B,+BAE3D"}