@fldr/ui 0.3.7 → 0.3.9
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/README.md +66 -448
- package/THEMING.md +2 -6
- package/ai/component-registry.json +25 -13
- package/ai/component-registry.md +2 -2
- package/dist/.build-complete +1 -1
- package/dist/blocks-source/auth-card/auth-card.test.tsx +20 -14
- package/dist/blocks-source/auth-card/auth-card.tsx +73 -55
- package/dist/blocks-source/file-table/file-table.tsx +197 -150
- package/dist/blocks-source/share-dialog/share-dialog.test.tsx +9 -3
- package/dist/blocks-source/share-dialog/share-dialog.tsx +50 -35
- package/dist/blocks.d.ts +21 -4
- package/dist/blocks.js +246 -195
- package/dist/{button-DzavLWXm.d.ts → button-CS82eT0x.d.ts} +1 -1
- package/dist/chunks/{checkbox-eifiwbw34xwsikvf.js → checkbox-d5epe4dl78bzy4f8.js} +8 -8
- package/dist/chunks/highlighter-kb7huz24pcziin6d.js +57 -0
- package/dist/chunks/{layer-dialog-m8qb0wzfg3k7406a.js → layer-dialog-mnaw06pxom8q771w.js} +3 -2
- package/dist/chunks/{table-ngl1b5yc8mcur662.js → table-bdye068ekayq3u1n.js} +1 -1
- package/dist/chunks/table-f8vl74hdx3bzqqbf.js +448 -0
- package/dist/code/server.js +1 -1
- package/dist/code.js +4 -131
- package/dist/components/banner.d.ts +1 -1
- package/dist/components/button.d.ts +2 -2
- package/dist/components/checkbox.d.ts +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/input-group.d.ts +2 -1
- package/dist/components/input.d.ts +2 -2
- package/dist/components/layer-dialog.js +1 -1
- package/dist/components/link.d.ts +2 -67
- package/dist/components/sidebar.d.ts +2 -1
- package/dist/components/table.d.ts +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/toast.d.ts +1 -1
- package/dist/components/toolbar.d.ts +1 -1
- package/dist/form.d.ts +207 -0
- package/dist/form.js +317 -0
- package/dist/hotkeys.d.ts +135 -0
- package/dist/hotkeys.js +206 -0
- package/dist/index-9LwQy84o.d.ts +1 -0
- package/dist/index-B7iG0qDU.d.ts +1 -0
- package/dist/{index-B6JNUfG9.d.ts → index-BMXHK-3k.d.ts} +2 -2
- package/dist/{index-B6Wo_iiN.d.ts → index-B_ug9XY7.d.ts} +1 -1
- package/dist/{index-RP_rt8vB.d.ts → index-Bh9kuAvN.d.ts} +1 -1
- package/dist/{index-DjSGDESy.d.ts → index-CAUjUp2G.d.ts} +1 -1
- package/dist/{index-NnHba-T1.d.ts → index-DK28YxxP.d.ts} +2 -2
- package/dist/{index-aahL-0Zw.d.ts → index-DOVlARA6.d.ts} +2 -2
- package/dist/index-DTj6M6kA.d.ts +1 -0
- package/dist/index.d.ts +14 -12
- package/dist/index.js +3 -4
- package/dist/{input-group-8gEtPiKw.d.ts → input-group-Swzit45o.d.ts} +1 -1
- package/dist/link-CoVXE5W2.d.ts +68 -0
- package/dist/query.d.ts +156 -0
- package/dist/query.js +204 -0
- package/dist/router.d.ts +95 -0
- package/dist/router.js +146 -0
- package/dist/skeleton.d.ts +3 -0
- package/dist/skeleton.js +4 -0
- package/dist/styles/kumo-binding.css +10 -0
- package/dist/styles/kumo-standalone.css +1 -1
- package/dist/styles/theme-fldr.css +18 -29
- package/dist/table.d.ts +245 -0
- package/dist/table.js +3 -0
- package/dist/theming.d.ts +8 -28
- package/dist/theming.js +6 -17
- package/package.json +41 -1
- package/dist/chunks/highlighter-mouttug0tu8xg1i8.js +0 -1364
- package/dist/index-DL1-uSuH.d.ts +0 -1
- /package/dist/{index-BkTAB4wj.d.ts → sidebar-BkTAB4wj.d.ts} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as BannerVariant, t as Banner } from "../index-
|
|
1
|
+
import { n as BannerVariant, t as Banner } from "../index-DK28YxxP.js";
|
|
2
2
|
export { Banner, BannerVariant };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import "../index-
|
|
1
|
+
import { a as LinkButton, c as buttonVariants, n as ButtonProps, o as LinkButtonProps, s as RefreshButton, t as Button } from "../button-CS82eT0x.js";
|
|
2
|
+
import "../index-9LwQy84o.js";
|
|
3
3
|
export { Button, type ButtonProps, LinkButton, type LinkButtonProps, RefreshButton, buttonVariants };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as CheckboxLegendProps, c as KUMO_CHECKBOX_DEFAULT_VARIANTS, i as CheckboxItemProps, l as KUMO_CHECKBOX_VARIANTS, n as CheckboxChangeEventDetails, o as CheckboxProps, r as CheckboxGroupProps, s as CheckboxVariant, t as Checkbox, u as KumoCheckboxVariant } from "../index-
|
|
1
|
+
import { a as CheckboxLegendProps, c as KUMO_CHECKBOX_DEFAULT_VARIANTS, i as CheckboxItemProps, l as KUMO_CHECKBOX_VARIANTS, n as CheckboxChangeEventDetails, o as CheckboxProps, r as CheckboxGroupProps, s as CheckboxVariant, t as Checkbox, u as KumoCheckboxVariant } from "../index-CAUjUp2G.js";
|
|
2
2
|
export { Checkbox, type CheckboxChangeEventDetails, type CheckboxGroupProps, type CheckboxItemProps, type CheckboxLegendProps, type CheckboxProps, type CheckboxVariant, KUMO_CHECKBOX_DEFAULT_VARIANTS, KUMO_CHECKBOX_VARIANTS, type KumoCheckboxVariant };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { n as KUMO_CHECKBOX_DEFAULT_VARIANTS, r as KUMO_CHECKBOX_VARIANTS, t as Checkbox } from "../chunks/checkbox-
|
|
2
|
+
import { n as KUMO_CHECKBOX_DEFAULT_VARIANTS, r as KUMO_CHECKBOX_VARIANTS, t as Checkbox } from "../chunks/checkbox-d5epe4dl78bzy4f8.js";
|
|
3
3
|
export { Checkbox, KUMO_CHECKBOX_DEFAULT_VARIANTS, KUMO_CHECKBOX_VARIANTS };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { a as InputGroupSuffixProps, c as InputGroupInputProps, i as InputGroupRootProps, n as KUMO_INPUT_GROUP_DEFAULT_VARIANTS, o as InputGroupAddonProps, r as KUMO_INPUT_GROUP_VARIANTS, s as InputGroupButtonProps, t as InputGroup } from "../input-group-
|
|
1
|
+
import { a as InputGroupSuffixProps, c as InputGroupInputProps, i as InputGroupRootProps, n as KUMO_INPUT_GROUP_DEFAULT_VARIANTS, o as InputGroupAddonProps, r as KUMO_INPUT_GROUP_VARIANTS, s as InputGroupButtonProps, t as InputGroup } from "../input-group-Swzit45o.js";
|
|
2
|
+
import "../index-B7iG0qDU.js";
|
|
2
3
|
export { InputGroup, type InputGroupAddonProps, type InputGroupButtonProps, type InputGroupInputProps, type InputGroupRootProps, type InputGroupSuffixProps, KUMO_INPUT_GROUP_DEFAULT_VARIANTS, KUMO_INPUT_GROUP_VARIANTS };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { a as inputVariants, n as InputProps, t as Input } from "../input-BeWEb-jD.js";
|
|
2
|
-
import { n as KUMO_INPUT_GROUP_DEFAULT_VARIANTS, r as KUMO_INPUT_GROUP_VARIANTS, t as InputGroup } from "../input-group-
|
|
3
|
-
import { a as Textarea, i as InputAreaProps, n as KumoInputGroupVariantsProps, r as InputArea, t as KumoInputGroupFocusMode } from "../index-
|
|
2
|
+
import { n as KUMO_INPUT_GROUP_DEFAULT_VARIANTS, r as KUMO_INPUT_GROUP_VARIANTS, t as InputGroup } from "../input-group-Swzit45o.js";
|
|
3
|
+
import { a as Textarea, i as InputAreaProps, n as KumoInputGroupVariantsProps, r as InputArea, t as KumoInputGroupFocusMode } from "../index-B_ug9XY7.js";
|
|
4
4
|
export { Input, InputArea, type InputAreaProps, InputGroup, type InputProps, KUMO_INPUT_GROUP_DEFAULT_VARIANTS, KUMO_INPUT_GROUP_VARIANTS, KumoInputGroupFocusMode, KumoInputGroupVariantsProps, Textarea, inputVariants };
|
|
@@ -1,67 +1,2 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
|
|
3
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
-
//#region src/components/link/link.d.ts
|
|
5
|
-
/** Link variant definitions mapping variant names to their Tailwind classes. */
|
|
6
|
-
export declare const KUMO_LINK_VARIANTS: {
|
|
7
|
-
readonly variant: {
|
|
8
|
-
readonly inline: {
|
|
9
|
-
readonly classes: "text-kumo-link underline underline-offset-[0.15em] decoration-[0.0625em] link-current transition-colors";
|
|
10
|
-
readonly description: "Inline text link that flows with content";
|
|
11
|
-
};
|
|
12
|
-
readonly current: {
|
|
13
|
-
readonly classes: "text-current underline underline-offset-[0.15em] decoration-[0.0625em] link-current transition-colors";
|
|
14
|
-
readonly description: "Link that inherits color from parent text";
|
|
15
|
-
};
|
|
16
|
-
readonly plain: {
|
|
17
|
-
readonly classes: "text-kumo-link hover:text-kumo-link/70 transition-colors";
|
|
18
|
-
readonly description: "Link without underline decoration";
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export declare const KUMO_LINK_DEFAULT_VARIANTS: {
|
|
23
|
-
readonly variant: "inline";
|
|
24
|
-
};
|
|
25
|
-
export type KumoLinkVariant = keyof typeof KUMO_LINK_VARIANTS.variant;
|
|
26
|
-
export interface KumoLinkVariantsProps {
|
|
27
|
-
/**
|
|
28
|
-
* Visual style of the link.
|
|
29
|
-
* - `"inline"` — Inline text link that flows with content
|
|
30
|
-
* - `"current"` — Link that inherits color from parent text
|
|
31
|
-
* - `"plain"` — Link without underline decoration
|
|
32
|
-
* @default "inline"
|
|
33
|
-
*/
|
|
34
|
-
variant?: KumoLinkVariant;
|
|
35
|
-
}
|
|
36
|
-
export declare function linkVariants({ variant }?: KumoLinkVariantsProps): string;
|
|
37
|
-
/**
|
|
38
|
-
* Link component props.
|
|
39
|
-
*
|
|
40
|
-
* Use `href` for the link destination. For framework-specific routing, use the
|
|
41
|
-
* `render` prop or configure a `LinkProvider` at the app root.
|
|
42
|
-
*
|
|
43
|
-
* @example Internal link
|
|
44
|
-
* ```tsx
|
|
45
|
-
* <Link href="/docs">Learn more</Link>
|
|
46
|
-
* ```
|
|
47
|
-
*
|
|
48
|
-
* @example External link
|
|
49
|
-
* ```tsx
|
|
50
|
-
* <Link href="https://cloudflare.com" target="_blank" rel="noopener noreferrer">
|
|
51
|
-
* Visit Cloudflare <Link.ExternalIcon />
|
|
52
|
-
* </Link>
|
|
53
|
-
* ```
|
|
54
|
-
*
|
|
55
|
-
* @example Composition with render prop
|
|
56
|
-
* ```tsx
|
|
57
|
-
* <Link render={<RouterLink to="/dashboard" />}>Dashboard</Link>
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
export type LinkProps = useRender.ComponentProps<"a"> & LinkComponentProps & KumoLinkVariantsProps;
|
|
61
|
-
export declare const Link: import("react").ForwardRefExoticComponent<Omit<LinkProps, "ref"> & import("react").RefAttributes<HTMLAnchorElement>> & {
|
|
62
|
-
ExternalIcon: {
|
|
63
|
-
(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
64
|
-
displayName: string;
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
//#endregion
|
|
1
|
+
import { a as Link, i as KumoLinkVariantsProps, n as KUMO_LINK_VARIANTS, o as LinkProps, r as KumoLinkVariant, s as linkVariants, t as KUMO_LINK_DEFAULT_VARIANTS } from "../link-CoVXE5W2.js";
|
|
2
|
+
export { KUMO_LINK_DEFAULT_VARIANTS, KUMO_LINK_VARIANTS, KumoLinkVariant, KumoLinkVariantsProps, Link, LinkProps, linkVariants };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { A as SidebarProviderProps, B as SidebarSlidingViewProps, C as SidebarMenuItem, D as SidebarMenuSubButtonProps, E as SidebarMenuSubButton, F as SidebarScrollAlign, G as SidebarVariant, H as SidebarSlidingViewsProps, I as SidebarScrollToItemOptions, K as useSidebar, L as SidebarSeparator, M as SidebarResizeHandle, N as SidebarRoot, O as SidebarMenuSubItem, P as SidebarRootProps, R as SidebarSide, S as SidebarMenuChevron, T as SidebarMenuSub, U as SidebarState, V as SidebarSlidingViews, W as SidebarTrigger, _ as SidebarMenu, a as SidebarCollapsible, b as SidebarMenuButtonProps, c as SidebarCollapsibleTrigger, d as SidebarContextValue, f as SidebarFooter, g as SidebarLoading, h as SidebarHeader, i as Sidebar, j as SidebarRail, k as SidebarProvider, l as SidebarCollapsibleTriggerProps, m as SidebarGroupLabel, n as KUMO_SIDEBAR_STYLING, o as SidebarCollapsibleContent, p as SidebarGroup, r as KUMO_SIDEBAR_VARIANTS, s as SidebarCollapsibleProps, t as KUMO_SIDEBAR_DEFAULT_VARIANTS, u as SidebarContent, v as SidebarMenuBadge, w as SidebarMenuItemProps, x as SidebarMenuButtonSize, y as SidebarMenuButton, z as SidebarSlidingView } from "../
|
|
1
|
+
import { A as SidebarProviderProps, B as SidebarSlidingViewProps, C as SidebarMenuItem, D as SidebarMenuSubButtonProps, E as SidebarMenuSubButton, F as SidebarScrollAlign, G as SidebarVariant, H as SidebarSlidingViewsProps, I as SidebarScrollToItemOptions, K as useSidebar, L as SidebarSeparator, M as SidebarResizeHandle, N as SidebarRoot, O as SidebarMenuSubItem, P as SidebarRootProps, R as SidebarSide, S as SidebarMenuChevron, T as SidebarMenuSub, U as SidebarState, V as SidebarSlidingViews, W as SidebarTrigger, _ as SidebarMenu, a as SidebarCollapsible, b as SidebarMenuButtonProps, c as SidebarCollapsibleTrigger, d as SidebarContextValue, f as SidebarFooter, g as SidebarLoading, h as SidebarHeader, i as Sidebar, j as SidebarRail, k as SidebarProvider, l as SidebarCollapsibleTriggerProps, m as SidebarGroupLabel, n as KUMO_SIDEBAR_STYLING, o as SidebarCollapsibleContent, p as SidebarGroup, r as KUMO_SIDEBAR_VARIANTS, s as SidebarCollapsibleProps, t as KUMO_SIDEBAR_DEFAULT_VARIANTS, u as SidebarContent, v as SidebarMenuBadge, w as SidebarMenuItemProps, x as SidebarMenuButtonSize, y as SidebarMenuButton, z as SidebarSlidingView } from "../sidebar-BkTAB4wj.js";
|
|
2
|
+
import "../index-DTj6M6kA.js";
|
|
2
3
|
export { KUMO_SIDEBAR_DEFAULT_VARIANTS, KUMO_SIDEBAR_STYLING, KUMO_SIDEBAR_VARIANTS, Sidebar, SidebarCollapsible, type SidebarCollapsible as SidebarCollapsibleType, SidebarCollapsibleContent, type SidebarCollapsibleProps, SidebarCollapsibleTrigger, type SidebarCollapsibleTriggerProps, SidebarContent, type SidebarContextValue, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarHeader, SidebarLoading, SidebarMenu, SidebarMenuBadge, SidebarMenuButton, type SidebarMenuButtonProps, type SidebarMenuButtonSize, SidebarMenuChevron, SidebarMenuItem, type SidebarMenuItemProps, SidebarMenuSub, SidebarMenuSubButton, type SidebarMenuSubButtonProps, SidebarMenuSubItem, SidebarProvider, type SidebarProviderProps, SidebarRail, SidebarResizeHandle, SidebarRoot, type SidebarRootProps, type SidebarScrollAlign, type SidebarScrollToItemOptions, SidebarSeparator, type SidebarSide, SidebarSlidingView, type SidebarSlidingViewProps, SidebarSlidingViews, type SidebarSlidingViewsProps, type SidebarState, SidebarTrigger, type SidebarVariant, useSidebar };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as Table, i as KumoTableRowVariant, n as KUMO_TABLE_VARIANTS, r as KumoTableLayout, t as KUMO_TABLE_DEFAULT_VARIANTS } from "../index-
|
|
1
|
+
import { a as Table, i as KumoTableRowVariant, n as KUMO_TABLE_VARIANTS, r as KumoTableLayout, t as KUMO_TABLE_DEFAULT_VARIANTS } from "../index-Bh9kuAvN.js";
|
|
2
2
|
export { KUMO_TABLE_DEFAULT_VARIANTS, KUMO_TABLE_VARIANTS, type KumoTableLayout, type KumoTableRowVariant, Table };
|
package/dist/components/table.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { n as KUMO_TABLE_VARIANTS, r as Table, t as KUMO_TABLE_DEFAULT_VARIANTS } from "../chunks/table-
|
|
2
|
+
import { n as KUMO_TABLE_VARIANTS, r as Table, t as KUMO_TABLE_DEFAULT_VARIANTS } from "../chunks/table-bdye068ekayq3u1n.js";
|
|
3
3
|
export { KUMO_TABLE_DEFAULT_VARIANTS, KUMO_TABLE_VARIANTS, Table };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as Toasty, i as ToastProvider, n as KumoToastManagerAddOptions, o as createKumoToastManager, r as KumoToastOptions, s as useKumoToastManager, t as Toast } from "../index-
|
|
1
|
+
import { a as Toasty, i as ToastProvider, n as KumoToastManagerAddOptions, o as createKumoToastManager, r as KumoToastOptions, s as useKumoToastManager, t as Toast } from "../index-BMXHK-3k.js";
|
|
2
2
|
export { type KumoToastManagerAddOptions, type KumoToastOptions, Toast, ToastProvider, Toasty, createKumoToastManager, useKumoToastManager };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ToolbarInputGroupProps, c as ToolbarProps, i as ToolbarButtonProps, l as ToolbarSize, n as KUMO_TOOLBAR_VARIANTS, o as ToolbarInputProps, r as Toolbar, s as ToolbarLinkProps, t as KUMO_TOOLBAR_DEFAULT_VARIANTS } from "../index-
|
|
1
|
+
import { a as ToolbarInputGroupProps, c as ToolbarProps, i as ToolbarButtonProps, l as ToolbarSize, n as KUMO_TOOLBAR_VARIANTS, o as ToolbarInputProps, r as Toolbar, s as ToolbarLinkProps, t as KUMO_TOOLBAR_DEFAULT_VARIANTS } from "../index-DOVlARA6.js";
|
|
2
2
|
export { KUMO_TOOLBAR_DEFAULT_VARIANTS, KUMO_TOOLBAR_VARIANTS, Toolbar, type ToolbarButtonProps, type ToolbarInputGroupProps, type ToolbarInputProps, type ToolbarLinkProps, type ToolbarProps, type ToolbarSize };
|
package/dist/form.d.ts
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { n as ButtonProps } from "./button-CS82eT0x.js";
|
|
2
|
+
import "./index-9LwQy84o.js";
|
|
3
|
+
import { o as CheckboxProps } from "./index-CAUjUp2G.js";
|
|
4
|
+
import { n as InputProps } from "./input-BeWEb-jD.js";
|
|
5
|
+
import { i as InputAreaProps } from "./index-B_ug9XY7.js";
|
|
6
|
+
import { u as RadioGroupProps } from "./index-CU_lnxg7.js";
|
|
7
|
+
import { t as Select } from "./index-DwNMa4LN.js";
|
|
8
|
+
import { l as SwitchProps } from "./index-AMEc1MEg.js";
|
|
9
|
+
import { ComponentProps, ReactNode } from "react";
|
|
10
|
+
//#region src/form/form.d.ts
|
|
11
|
+
export declare const fieldContext: import("react").Context<import("@tanstack/react-form").AnyFieldApi>, formContext: import("react").Context<import("@tanstack/react-form").AnyFormApi>, useFieldContext: <TData>() => import("@tanstack/react-form").FieldApi<any, string, TData, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>, useFormContext: () => import("@tanstack/react-form").ReactFormExtendedApi<Record<string, never>, any, any, any, any, any, any, any, any, any, any, any>;
|
|
12
|
+
/** Returns the first readable message from TanStack Form errors (strings, Standard Schema issues, or nested arrays). */
|
|
13
|
+
export declare function firstErrorMessage(errors: readonly unknown[]): string | undefined;
|
|
14
|
+
type Bound<P, K extends PropertyKey> = Omit<P, K | "name" | "error" | "defaultValue">;
|
|
15
|
+
export type TextFieldProps = Bound<InputProps, "value" | "onChange" | "onBlur">;
|
|
16
|
+
/**
|
|
17
|
+
* Text input bound to the surrounding `form.AppField`. Pass `type` / `autoComplete` through;
|
|
18
|
+
* `className` applies to the input.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <form.AppField name="email">
|
|
23
|
+
* {(field) => <field.TextField label="Email" type="email" autoComplete="email" />}
|
|
24
|
+
* </form.AppField>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function TextField(props: TextFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export type NumberFieldProps = Bound<InputProps, "value" | "onChange" | "onBlur" | "type">;
|
|
29
|
+
/** Number input; an empty input stores `undefined`. */
|
|
30
|
+
export declare function NumberField(props: NumberFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export type TextareaFieldProps = Bound<InputAreaProps, "value" | "onChange" | "onValueChange" | "onBlur">;
|
|
32
|
+
/** Multi-line text input bound to the surrounding field. Give it a `label` (or `description`) so the error can appear without remounting the textarea. */
|
|
33
|
+
export declare function TextareaField(props: TextareaFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export type SelectFieldProps = Bound<ComponentProps<typeof Select<string>>, "value" | "onValueChange" | "multiple">;
|
|
35
|
+
/**
|
|
36
|
+
* Select bound to a string field. Pass `items` (`{ key: "Label" }`) or `Select.Option` children.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```tsx
|
|
40
|
+
* <form.AppField name="role">
|
|
41
|
+
* {(field) => <field.SelectField label="Role" items={{ viewer: "Viewer", editor: "Editor" }} />}
|
|
42
|
+
* </form.AppField>
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare function SelectField({ onOpenChange, ...props }: SelectFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
export type CheckboxFieldProps = Omit<CheckboxProps, "checked" | "onCheckedChange" | "name"> & {
|
|
47
|
+
description?: ReactNode;
|
|
48
|
+
};
|
|
49
|
+
/** Checkbox bound to a boolean field. */
|
|
50
|
+
export declare function CheckboxField({ description, ...props }: CheckboxFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
export type SwitchFieldProps = Omit<SwitchProps, "checked" | "onCheckedChange" | "name"> & {
|
|
52
|
+
description?: ReactNode;
|
|
53
|
+
};
|
|
54
|
+
/** Switch bound to a boolean field. */
|
|
55
|
+
export declare function SwitchField({ description, ...props }: SwitchFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
export interface RadioFieldItem {
|
|
57
|
+
value: string;
|
|
58
|
+
label: ReactNode;
|
|
59
|
+
description?: ReactNode;
|
|
60
|
+
disabled?: boolean;
|
|
61
|
+
}
|
|
62
|
+
export type RadioFieldProps = Omit<RadioGroupProps<string>, "value" | "defaultValue" | "onValueChange" | "error" | "name" | "children"> & {
|
|
63
|
+
/** Options; use `children` (`Radio.Item`) for full control. */
|
|
64
|
+
items?: RadioFieldItem[];
|
|
65
|
+
children?: ReactNode;
|
|
66
|
+
};
|
|
67
|
+
/** Radio group bound to a string field. */
|
|
68
|
+
export declare function RadioField({ items, children, ...props }: RadioFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
69
|
+
export type FormProps = Omit<ComponentProps<"form">, "onSubmit">;
|
|
70
|
+
/**
|
|
71
|
+
* `<form>` that prevents the native submit and calls `form.handleSubmit()`.
|
|
72
|
+
* Render inside `form.AppForm`, or use `form.Form`.
|
|
73
|
+
*/
|
|
74
|
+
export declare function Form({ noValidate, ...props }: FormProps): import("react/jsx-runtime").JSX.Element;
|
|
75
|
+
export type SubmitButtonProps = Pick<ButtonProps, "variant" | "size" | "icon" | "className" | "disabled" | "loading" | "children">;
|
|
76
|
+
/** Submit button; disabled while the form is invalid or submitting, shows a spinner while submitting. */
|
|
77
|
+
export declare function SubmitButton({ variant, disabled, loading, ...props }: SubmitButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
78
|
+
export type ResetButtonProps = SubmitButtonProps;
|
|
79
|
+
/** Resets the form to its default values. */
|
|
80
|
+
export declare function ResetButton({ variant, ...props }: ResetButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
81
|
+
export interface FormErrorBannerProps {
|
|
82
|
+
/** Overrides form-level validation errors, e.g. a server error. */
|
|
83
|
+
error?: ReactNode;
|
|
84
|
+
className?: string;
|
|
85
|
+
}
|
|
86
|
+
/** Shows `error` or the first form-level validation error in an error Banner. */
|
|
87
|
+
export declare function FormErrorBanner({ error, className }: FormErrorBannerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
88
|
+
/**
|
|
89
|
+
* fldr form hook: TanStack Form's `useForm` pre-wired with fldr field and form components.
|
|
90
|
+
* Validators accept functions or any Standard Schema (e.g. zod v4) directly.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```tsx
|
|
94
|
+
* const form = useAppForm({
|
|
95
|
+
* defaultValues: { email: "" },
|
|
96
|
+
* validators: { onChange: z.object({ email: z.email() }) },
|
|
97
|
+
* onSubmit: ({ value }) => save(value),
|
|
98
|
+
* });
|
|
99
|
+
* return (
|
|
100
|
+
* <form.AppForm>
|
|
101
|
+
* <form.Form className="flex flex-col gap-3">
|
|
102
|
+
* <form.AppField name="email">{(f) => <f.TextField label="Email" />}</form.AppField>
|
|
103
|
+
* <form.SubmitButton>Save</form.SubmitButton>
|
|
104
|
+
* </form.Form>
|
|
105
|
+
* </form.AppForm>
|
|
106
|
+
* );
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
export declare const useAppForm: <TFormData, TOnMount extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnChange extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnChangeAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnBlur extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnBlurAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnSubmit extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnSubmitAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnDynamic extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnDynamicAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnServer extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TSubmitMeta>(props: import("@tanstack/react-form").FormOptions<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>) => import("@tanstack/react-form").AppFieldExtendedReactFormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, {
|
|
110
|
+
readonly TextField: typeof TextField;
|
|
111
|
+
readonly NumberField: typeof NumberField;
|
|
112
|
+
readonly TextareaField: typeof TextareaField;
|
|
113
|
+
readonly SelectField: typeof SelectField;
|
|
114
|
+
readonly CheckboxField: typeof CheckboxField;
|
|
115
|
+
readonly SwitchField: typeof SwitchField;
|
|
116
|
+
readonly RadioField: typeof RadioField;
|
|
117
|
+
}, {
|
|
118
|
+
readonly Form: typeof Form;
|
|
119
|
+
readonly SubmitButton: typeof SubmitButton;
|
|
120
|
+
readonly ResetButton: typeof ResetButton;
|
|
121
|
+
readonly FormErrorBanner: typeof FormErrorBanner;
|
|
122
|
+
}>, withForm: <TFormData, TOnMount extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnChange extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnChangeAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnBlur extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnBlurAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnSubmit extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnSubmitAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnDynamic extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnDynamicAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnServer extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TSubmitMeta, TRenderProps extends object = {}>({ render, props }: import("@tanstack/react-form").WithFormProps<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, {
|
|
123
|
+
readonly TextField: typeof TextField;
|
|
124
|
+
readonly NumberField: typeof NumberField;
|
|
125
|
+
readonly TextareaField: typeof TextareaField;
|
|
126
|
+
readonly SelectField: typeof SelectField;
|
|
127
|
+
readonly CheckboxField: typeof CheckboxField;
|
|
128
|
+
readonly SwitchField: typeof SwitchField;
|
|
129
|
+
readonly RadioField: typeof RadioField;
|
|
130
|
+
}, {
|
|
131
|
+
readonly Form: typeof Form;
|
|
132
|
+
readonly SubmitButton: typeof SubmitButton;
|
|
133
|
+
readonly ResetButton: typeof ResetButton;
|
|
134
|
+
readonly FormErrorBanner: typeof FormErrorBanner;
|
|
135
|
+
}, TRenderProps>) => import("react").FunctionComponent<import("react").PropsWithChildren<NoInfer<[unknown] extends [TRenderProps] ? any : TRenderProps> & {
|
|
136
|
+
form: import("@tanstack/react-form").AppFieldExtendedReactFormApi<[unknown] extends [TFormData] ? any : TFormData, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnMount] ? [TOnMount] extends [TOnMount & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnMount : TOnMount, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnChange] ? [TOnChange] extends [TOnChange & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnChange : TOnChange, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnChangeAsync] ? [TOnChangeAsync] extends [TOnChangeAsync & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnChangeAsync : TOnChangeAsync, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnBlur] ? [TOnBlur] extends [TOnBlur & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlur : TOnBlur, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnBlurAsync] ? [TOnBlurAsync] extends [TOnBlurAsync & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlurAsync : TOnBlurAsync, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnSubmit] ? [TOnSubmit] extends [TOnSubmit & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmit : TOnSubmit, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnSubmitAsync] ? [TOnSubmitAsync] extends [TOnSubmitAsync & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmitAsync : TOnSubmitAsync, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnDynamic] ? [TOnDynamic] extends [TOnDynamic & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnDynamic : TOnDynamic, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnDynamicAsync] ? [TOnDynamicAsync] extends [TOnDynamicAsync & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnDynamicAsync : TOnDynamicAsync, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnServer] ? [TOnServer] extends [TOnServer & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnServer : TOnServer, [unknown] extends [TSubmitMeta] ? any : TSubmitMeta, {
|
|
137
|
+
readonly TextField: typeof TextField;
|
|
138
|
+
readonly NumberField: typeof NumberField;
|
|
139
|
+
readonly TextareaField: typeof TextareaField;
|
|
140
|
+
readonly SelectField: typeof SelectField;
|
|
141
|
+
readonly CheckboxField: typeof CheckboxField;
|
|
142
|
+
readonly SwitchField: typeof SwitchField;
|
|
143
|
+
readonly RadioField: typeof RadioField;
|
|
144
|
+
}, {
|
|
145
|
+
readonly Form: typeof Form;
|
|
146
|
+
readonly SubmitButton: typeof SubmitButton;
|
|
147
|
+
readonly ResetButton: typeof ResetButton;
|
|
148
|
+
readonly FormErrorBanner: typeof FormErrorBanner;
|
|
149
|
+
}>;
|
|
150
|
+
}>>, withFieldGroup: <TFieldGroupData, TSubmitMeta, TRenderProps extends object = {}>({ render, props, defaultValues }: import("@tanstack/react-form").WithFieldGroupProps<TFieldGroupData, {
|
|
151
|
+
readonly TextField: typeof TextField;
|
|
152
|
+
readonly NumberField: typeof NumberField;
|
|
153
|
+
readonly TextareaField: typeof TextareaField;
|
|
154
|
+
readonly SelectField: typeof SelectField;
|
|
155
|
+
readonly CheckboxField: typeof CheckboxField;
|
|
156
|
+
readonly SwitchField: typeof SwitchField;
|
|
157
|
+
readonly RadioField: typeof RadioField;
|
|
158
|
+
}, {
|
|
159
|
+
readonly Form: typeof Form;
|
|
160
|
+
readonly SubmitButton: typeof SubmitButton;
|
|
161
|
+
readonly ResetButton: typeof ResetButton;
|
|
162
|
+
readonly FormErrorBanner: typeof FormErrorBanner;
|
|
163
|
+
}, TSubmitMeta, TRenderProps>) => <TFormData, TFields extends import("@tanstack/react-form").DeepKeysOfType<TFormData, TFieldGroupData | null | undefined> | import("@tanstack/react-form").FieldsMap<TFormData, TFieldGroupData>, TOnMount extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnChange extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnChangeAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnBlur extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnBlurAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnSubmit extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnSubmitAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnDynamic extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnDynamicAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnServer extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TFormSubmitMeta>(params: import("react").PropsWithChildren<NoInfer<TRenderProps> & {
|
|
164
|
+
form: import("@tanstack/react-form").AppFieldExtendedReactFormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, unknown extends TSubmitMeta ? TFormSubmitMeta : TSubmitMeta, {
|
|
165
|
+
readonly TextField: typeof TextField;
|
|
166
|
+
readonly NumberField: typeof NumberField;
|
|
167
|
+
readonly TextareaField: typeof TextareaField;
|
|
168
|
+
readonly SelectField: typeof SelectField;
|
|
169
|
+
readonly CheckboxField: typeof CheckboxField;
|
|
170
|
+
readonly SwitchField: typeof SwitchField;
|
|
171
|
+
readonly RadioField: typeof RadioField;
|
|
172
|
+
}, {
|
|
173
|
+
readonly Form: typeof Form;
|
|
174
|
+
readonly SubmitButton: typeof SubmitButton;
|
|
175
|
+
readonly ResetButton: typeof ResetButton;
|
|
176
|
+
readonly FormErrorBanner: typeof FormErrorBanner;
|
|
177
|
+
}> | import("@tanstack/react-form").AppFieldExtendedReactFieldGroupApi<unknown, TFormData, string | import("@tanstack/react-form").FieldsMap<unknown, TFormData>, any, any, any, any, any, any, any, any, any, any, unknown extends TSubmitMeta ? TFormSubmitMeta : TSubmitMeta, {
|
|
178
|
+
readonly TextField: typeof TextField;
|
|
179
|
+
readonly NumberField: typeof NumberField;
|
|
180
|
+
readonly TextareaField: typeof TextareaField;
|
|
181
|
+
readonly SelectField: typeof SelectField;
|
|
182
|
+
readonly CheckboxField: typeof CheckboxField;
|
|
183
|
+
readonly SwitchField: typeof SwitchField;
|
|
184
|
+
readonly RadioField: typeof RadioField;
|
|
185
|
+
}, {
|
|
186
|
+
readonly Form: typeof Form;
|
|
187
|
+
readonly SubmitButton: typeof SubmitButton;
|
|
188
|
+
readonly ResetButton: typeof ResetButton;
|
|
189
|
+
readonly FormErrorBanner: typeof FormErrorBanner;
|
|
190
|
+
}>;
|
|
191
|
+
fields: TFields;
|
|
192
|
+
}>) => ReturnType<import("react").FunctionComponent>;
|
|
193
|
+
/** Field-level validator: fails on empty / whitespace-only strings, `false` or nullish values. */
|
|
194
|
+
export declare function required(message?: string): ({ value }: {
|
|
195
|
+
value: unknown;
|
|
196
|
+
}) => string | undefined;
|
|
197
|
+
/** Field-level validator: fails when a non-empty string is not an email address. Combine with `required` for mandatory fields. */
|
|
198
|
+
export declare function email(message?: string): ({ value }: {
|
|
199
|
+
value: string;
|
|
200
|
+
}) => string | undefined;
|
|
201
|
+
/** Runs validators in order and returns the first error. */
|
|
202
|
+
export declare function compose<T>(...validators: Array<(arg: {
|
|
203
|
+
value: T;
|
|
204
|
+
}) => string | undefined>): (arg: {
|
|
205
|
+
value: T;
|
|
206
|
+
}) => string | undefined;
|
|
207
|
+
//#endregion
|