@webority/ui-react 0.163.0 → 0.165.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +2 -2
- package/dist/canvas-kit/kit.js +212 -212
- package/dist/canvas-kit/manifest.json +1127 -389
- package/dist/canvas-kit/release.json +6 -6
- package/dist/components/AppAccountSwitcher.js +1 -1
- package/dist/components/AppAlert.js +1 -1
- package/dist/components/AppAsyncBlock.js +1 -1
- package/dist/components/AppBreadcrumbs.js +1 -1
- package/dist/components/AppButton.js +1 -1
- package/dist/components/AppCard.js +1 -1
- package/dist/components/AppChartCard.js +1 -1
- package/dist/components/AppChoiceChip.js +1 -1
- package/dist/components/AppCodeBlock.js +1 -1
- package/dist/components/AppColorField.js +1 -1
- package/dist/components/AppCommentThread.js +1 -1
- package/dist/components/AppContextMenu.js +1 -1
- package/dist/components/AppDataTable.js +1 -1
- package/dist/components/AppDatePicker.js +1 -1
- package/dist/components/AppDateRangePicker.js +1 -1
- package/dist/components/AppDescriptions.js +1 -1
- package/dist/components/AppDrawer.js +1 -1
- package/dist/components/AppDropZone.js +1 -1
- package/dist/components/AppDropdown.js +1 -1
- package/dist/components/AppDueDate.js +1 -1
- package/dist/components/AppEntryGrid.js +1 -0
- package/dist/components/AppFileAttachment.js +1 -1
- package/dist/components/AppFilePicker.js +1 -1
- package/dist/components/AppFileViewer.js +1 -1
- package/dist/components/AppFilterBar.js +1 -1
- package/dist/components/AppFloatingButton.js +1 -1
- package/dist/components/AppForm.js +1 -1
- package/dist/components/AppFormulaSteps.js +1 -0
- package/dist/components/AppHoverCard.js +1 -1
- package/dist/components/AppImagePicker.js +1 -1
- package/dist/components/AppInlineEdit.js +1 -1
- package/dist/components/AppInput.js +1 -1
- package/dist/components/AppMarkdown.js +1 -1
- package/dist/components/AppMentionInput.js +1 -1
- package/dist/components/AppMetricStrip.js +1 -1
- package/dist/components/AppModal.js +1 -1
- package/dist/components/AppNotificationCenter.js +1 -1
- package/dist/components/AppNumberInput.js +1 -1
- package/dist/components/AppOtpInput.js +1 -1
- package/dist/components/AppPageHeader.js +1 -1
- package/dist/components/AppPhoneNumberInput.js +1 -1
- package/dist/components/AppPopover.js +1 -1
- package/dist/components/AppRadioGroup.js +1 -1
- package/dist/components/AppRating.js +1 -1
- package/dist/components/AppRichText.js +1 -1
- package/dist/components/AppRowActions.js +1 -0
- package/dist/components/AppScoreScale.js +1 -1
- package/dist/components/AppSearch.js +1 -1
- package/dist/components/AppSectionFeatures.js +1 -1
- package/dist/components/AppSectionLogos.js +1 -1
- package/dist/components/AppSelect.js +1 -1
- package/dist/components/AppShell.js +1 -1
- package/dist/components/AppSlider.js +1 -1
- package/dist/components/AppSparkline.js +1 -1
- package/dist/components/AppTextarea.js +1 -1
- package/dist/components/AppThemeToggle.js +1 -1
- package/dist/components/AppTimePicker.js +1 -1
- package/dist/components/AppToast.js +1 -1
- package/dist/components/AppTooltip.js +1 -1
- package/dist/components/AppWhatsNew.js +1 -1
- package/dist/components/AppWorkspaceSwitcher.js +1 -1
- package/dist/components/warnUnknownProps.js +1 -1
- package/dist/guidance.json +216 -141
- package/dist/hookForm/index.js +1 -0
- package/dist/lib/CheckField.js +1 -1
- package/dist/lib/formFields.js +1 -0
- package/dist/lib/indianGrouping.js +1 -0
- package/dist/lib/unsavedText.js +1 -0
- package/dist/lib/useOverlayRoot.js +1 -0
- package/dist/types/components/AppAccordion.d.ts +1 -1
- package/dist/types/components/AppAlert.d.ts +1 -1
- package/dist/types/components/AppAsyncBlock.d.ts +3 -3
- package/dist/types/components/AppBreadcrumbs.d.ts +6 -0
- package/dist/types/components/AppCard.d.ts +1 -1
- package/dist/types/components/AppChart.d.ts +12 -4
- package/dist/types/components/AppChip.d.ts +2 -2
- package/dist/types/components/AppCodeBlock.d.ts +1 -1
- package/dist/types/components/AppCommandPalette.d.ts +2 -2
- package/dist/types/components/AppDataTable.d.ts +32 -3
- package/dist/types/components/AppDateRangePicker.d.ts +4 -0
- package/dist/types/components/AppDescriptions.d.ts +7 -1
- package/dist/types/components/AppDrawer.d.ts +1 -1
- package/dist/types/components/AppDropdown.d.ts +7 -7
- package/dist/types/components/AppEntryGrid.d.ts +122 -0
- package/dist/types/components/AppFilePicker.d.ts +1 -1
- package/dist/types/components/AppFilterBar.d.ts +12 -1
- package/dist/types/components/AppFloatingDock.d.ts +2 -2
- package/dist/types/components/AppForm.d.ts +18 -0
- package/dist/types/components/AppFormActions.d.ts +1 -1
- package/dist/types/components/AppFormSection.d.ts +1 -1
- package/dist/types/components/AppFormulaSteps.d.ts +64 -0
- package/dist/types/components/AppIcon.d.ts +2 -2
- package/dist/types/components/AppInfoTip.d.ts +1 -1
- package/dist/types/components/AppInlineEdit.d.ts +5 -0
- package/dist/types/components/AppKpiTile.d.ts +1 -1
- package/dist/types/components/AppMeter.d.ts +1 -1
- package/dist/types/components/AppMetricStrip.d.ts +5 -0
- package/dist/types/components/AppModal.d.ts +9 -4
- package/dist/types/components/AppNumberInput.d.ts +7 -0
- package/dist/types/components/AppPageHeader.d.ts +5 -0
- package/dist/types/components/AppPopover.d.ts +3 -3
- package/dist/types/components/AppRequiredMark.d.ts +1 -1
- package/dist/types/components/AppResourceCard.d.ts +1 -1
- package/dist/types/components/AppResult.d.ts +2 -2
- package/dist/types/components/AppRowActions.d.ts +40 -0
- package/dist/types/components/AppScrollbar.d.ts +1 -1
- package/dist/types/components/AppSectionFeatures.d.ts +5 -1
- package/dist/types/components/AppSectionLogos.d.ts +1 -0
- package/dist/types/components/AppShell.d.ts +8 -6
- package/dist/types/components/AppSlider.d.ts +5 -0
- package/dist/types/components/AppSparkline.d.ts +3 -0
- package/dist/types/components/AppSpinner.d.ts +2 -2
- package/dist/types/components/AppSplash.d.ts +2 -2
- package/dist/types/components/AppTabs.d.ts +3 -3
- package/dist/types/components/AppToast.d.ts +6 -1
- package/dist/types/components/AppToolbar.d.ts +5 -5
- package/dist/types/components/AppTooltip.d.ts +5 -5
- package/dist/types/components/AppWorkspaceSwitcher.d.ts +3 -3
- package/dist/types/components/toastStore.d.ts +2 -2
- package/dist/types/components/warnUnknownProps.d.ts +3 -3
- package/dist/types/hookForm/index.d.ts +14 -0
- package/dist/types/index.d.ts +8 -6
- package/dist/types/lib/CheckField.d.ts +1 -1
- package/dist/types/lib/FieldMessage.d.ts +1 -1
- package/dist/types/lib/FileItemRow.d.ts +1 -1
- package/dist/types/lib/fileItem.d.ts +3 -3
- package/dist/types/lib/formFields.d.ts +12 -0
- package/dist/types/lib/indianGrouping.d.ts +2 -0
- package/dist/types/lib/unsavedText.d.ts +5 -0
- package/dist/types/lib/useOverlayRoot.d.ts +2 -0
- package/dist/ui-react.js +1 -1
- package/dist/web-core/dist/errors/extractApiError.js +2 -0
- package/dist/web-core/dist/errors/requestPlatform.js +1 -0
- package/package.json +21 -10
- package/dist/components/AppResizable.js +0 -1
- package/dist/components/AppResizableHandle.js +0 -1
- package/dist/components/AppResizablePanel.js +0 -1
- package/dist/components/AppRollingNumber.js +0 -1
- package/dist/components/AppRowSwitch.js +0 -1
- package/dist/lib/FocusPanel.js +0 -1
- package/dist/lib/pageScrollLock.js +0 -1
- package/dist/types/components/AppResizable.d.ts +0 -37
- package/dist/types/components/AppResizableHandle.d.ts +0 -14
- package/dist/types/components/AppResizablePanel.d.ts +0 -14
- package/dist/types/components/AppRollingNumber.d.ts +0 -30
- package/dist/types/components/AppRowSwitch.d.ts +0 -18
- package/dist/types/lib/FocusPanel.d.ts +0 -11
- package/dist/types/lib/pageScrollLock.d.ts +0 -1
|
@@ -4,7 +4,7 @@ type AppModalTone = "neutral" | "danger" | "success" | "warning";
|
|
|
4
4
|
type AppModalPlacement = "center" | "top";
|
|
5
5
|
type AppModalSizePreset = "sm" | "md" | "lg" | "xl";
|
|
6
6
|
type AppModalSize = AppModalSizePreset | "fullscreen" | number;
|
|
7
|
-
export interface AppModalProps extends Omit<ComponentPropsWithoutRef<"
|
|
7
|
+
export interface AppModalProps extends Omit<ComponentPropsWithoutRef<"dialog">, "title"> {
|
|
8
8
|
/** Whether the dialog is shown. */
|
|
9
9
|
open: boolean;
|
|
10
10
|
/** A small kicker label above the title. */
|
|
@@ -50,6 +50,11 @@ export interface AppModalProps extends Omit<ComponentPropsWithoutRef<"div">, "ti
|
|
|
50
50
|
* @default "center"
|
|
51
51
|
*/
|
|
52
52
|
placement?: AppModalPlacement | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Face of the title. serif draws it in the display typeface at the 3xl size, weight 500.
|
|
55
|
+
* @default "sans"
|
|
56
|
+
*/
|
|
57
|
+
titleFont?: "sans" | "serif" | undefined;
|
|
53
58
|
/**
|
|
54
59
|
* Hides the header, leaving the body and footer.
|
|
55
60
|
* @default false
|
|
@@ -82,12 +87,12 @@ export interface AppModalProps extends Omit<ComponentPropsWithoutRef<"div">, "ti
|
|
|
82
87
|
/** Extra classes on the content card. */
|
|
83
88
|
className?: string | undefined;
|
|
84
89
|
children: ReactNode;
|
|
85
|
-
ref?: Ref<
|
|
90
|
+
ref?: Ref<HTMLDialogElement> | undefined;
|
|
86
91
|
"data-wui"?: string | undefined;
|
|
87
92
|
"data-wui-props"?: string | undefined;
|
|
88
93
|
}
|
|
89
94
|
/**
|
|
90
|
-
* The single dialog primitive
|
|
95
|
+
* The single dialog primitive: a native `<dialog>` inside `<wui-modal>`, with `.wui-modal-*` chrome.
|
|
91
96
|
*/
|
|
92
|
-
export default function AppModal(props: AppModalProps): React.JSX.Element;
|
|
97
|
+
export default function AppModal(props: AppModalProps): React.JSX.Element | null;
|
|
93
98
|
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type ReactNode } from "react";
|
|
2
2
|
declare const SIZES: readonly ["sm", "md", "lg"];
|
|
3
|
+
declare const GROUPINGS: readonly ["none", "indian"];
|
|
3
4
|
export type AppNumberInputSize = (typeof SIZES)[number];
|
|
5
|
+
export type AppNumberInputGrouping = (typeof GROUPINGS)[number];
|
|
4
6
|
export interface AppNumberInputProps extends Omit<ComponentPropsWithoutRef<"input">, "value" | "defaultValue" | "onChange" | "size"> {
|
|
5
7
|
/** The current number; null or unset for an empty field. */
|
|
6
8
|
value?: number | null | undefined;
|
|
@@ -58,6 +60,11 @@ export interface AppNumberInputProps extends Omit<ComponentPropsWithoutRef<"inpu
|
|
|
58
60
|
* @default 0
|
|
59
61
|
*/
|
|
60
62
|
precision?: number | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Digit grouping while the number is shown: indian writes 3,00,000 and posts the plain digits; none writes 300000.
|
|
65
|
+
* @default "none"
|
|
66
|
+
*/
|
|
67
|
+
grouping?: AppNumberInputGrouping | undefined;
|
|
61
68
|
/** A unit suffix shown inside the field after the input, such as kg or %. */
|
|
62
69
|
unit?: string | undefined;
|
|
63
70
|
/**
|
|
@@ -66,6 +66,11 @@ export interface AppPageHeaderProps extends Omit<React.ComponentPropsWithoutRef<
|
|
|
66
66
|
* @default false
|
|
67
67
|
*/
|
|
68
68
|
sticky?: boolean | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Folds the actions that do not fit into a More menu, keeping the solid primary action in the row while it fits (size bar only).
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
73
|
+
foldActions?: boolean | undefined;
|
|
69
74
|
/**
|
|
70
75
|
* Extra classes on the header element.
|
|
71
76
|
* @default ""
|
|
@@ -5,6 +5,7 @@ interface TriggerProps {
|
|
|
5
5
|
ref?: Ref<HTMLElement> | undefined;
|
|
6
6
|
onClick?: ((event: MouseEvent<HTMLElement>) => void) | undefined;
|
|
7
7
|
"aria-expanded"?: boolean | "true" | "false" | undefined;
|
|
8
|
+
"data-wui-popover-trigger"?: string | undefined;
|
|
8
9
|
}
|
|
9
10
|
export interface AppPopoverProps extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
|
|
10
11
|
/** The element the panel opens from. It must be a single element that forwards a ref, such as a plain element, AppButton or AppActionIcon. */
|
|
@@ -51,9 +52,8 @@ export interface AppPopoverProps extends Omit<ComponentPropsWithoutRef<"div">, "
|
|
|
51
52
|
/**
|
|
52
53
|
* A positioned overlay anchored to a trigger: a click-opened floating panel (a notifications
|
|
53
54
|
* list, a filters panel, a rich mini-menu). Distinct from AppModal (centered + backdrop),
|
|
54
|
-
* AppDropdown (a flat action menu), and AppInfoTip (a hover "?" help popover).
|
|
55
|
-
*
|
|
56
|
-
* `<app-popover>` uses Bootstrap's own popover, so both surfaces stay in lockstep.
|
|
55
|
+
* AppDropdown (a flat action menu), and AppInfoTip (a hover "?" help popover). Renders
|
|
56
|
+
* `<wui-popover>`, which Razor `<app-popover>` renders too, so both surfaces share one panel.
|
|
57
57
|
*
|
|
58
58
|
* @param trigger The element the panel opens from.
|
|
59
59
|
* @param children The panel body.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { JSX } from "react";
|
|
2
2
|
/**
|
|
3
3
|
* Required-field asterisk shared by form primitives.
|
|
4
|
-
* Colour comes from `.required` (theme `--wui-danger`)
|
|
4
|
+
* Colour comes from `.required` (theme `--wui-danger`); never inline hex.
|
|
5
5
|
*/
|
|
6
6
|
export type AppRequiredMarkProps = Record<never, never>;
|
|
7
7
|
/** @param props Takes no props: the asterisk is fixed. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, JSX } from "react";
|
|
2
2
|
import { type AppLinkComponent } from "../lib/linkTarget.ts";
|
|
3
3
|
/**
|
|
4
|
-
* A link card to a resource
|
|
4
|
+
* A link card to a resource: a help article, a guide, a downloadable template,
|
|
5
5
|
* an external doc. Icon tile, title, one line of supporting text; the whole card
|
|
6
6
|
* is the link target.
|
|
7
7
|
*
|
|
@@ -28,9 +28,9 @@ export interface AppResultProps extends Omit<ComponentPropsWithoutRef<"div">, "t
|
|
|
28
28
|
className?: string | undefined;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
|
-
* A full-page or section outcome screen
|
|
31
|
+
* A full-page or section outcome screen: the post-checkout success confirmation, the
|
|
32
32
|
* verification-complete screen, or an error state (403/404/500). Distinct from `AppEmptyState`
|
|
33
|
-
* (which is a card/section "nothing here yet")
|
|
33
|
+
* (which is a card/section "nothing here yet"), this is a self-contained result panel
|
|
34
34
|
* with a prominent status, heading, supporting message, and usually one or two actions.
|
|
35
35
|
*
|
|
36
36
|
* The card lays its parts in a column, so a `gap` style on it spaces them.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
import { type AppLinkComponent } from "../lib/linkTarget.ts";
|
|
3
|
+
export interface AppRowAction {
|
|
4
|
+
/** Unique within the row's list. */
|
|
5
|
+
key: string;
|
|
6
|
+
/** The icon button's accessible name and tooltip, and the menu row's text. */
|
|
7
|
+
label: string;
|
|
8
|
+
/** A library icon name. Without it (and without showLabel) the action is a menu row at every width. */
|
|
9
|
+
icon?: string | undefined;
|
|
10
|
+
/** The inline icon's style; the menu row draws the linear glyph. */
|
|
11
|
+
iconVariant?: "linear" | "outline" | "bold" | "bulk" | "broken" | "twotone" | undefined;
|
|
12
|
+
/** A plain link, never routed through linkComponent. An action takes to or href, not both. */
|
|
13
|
+
href?: string | undefined;
|
|
14
|
+
/** An in-app route, drawn through linkComponent when one is given. */
|
|
15
|
+
to?: string | undefined;
|
|
16
|
+
/** Runs on a click; may accompany href or to. An action needs onClick, href or to unless it is disabled. */
|
|
17
|
+
onClick?: ((event: React.MouseEvent<HTMLElement>) => void) | undefined;
|
|
18
|
+
/** danger marks a destructive action. */
|
|
19
|
+
tone?: "danger" | undefined;
|
|
20
|
+
disabled?: boolean | undefined;
|
|
21
|
+
/** Why the action is disabled: joined to the icon button's label as "Edit: locked", and shown on the menu row. Needs disabled. */
|
|
22
|
+
disabledReason?: string | undefined;
|
|
23
|
+
/** Keeps the action in the menu at every width. Not with showLabel. */
|
|
24
|
+
menuOnly?: boolean | undefined;
|
|
25
|
+
/** From sm up, draws the action as a small labelled button instead of an icon button. */
|
|
26
|
+
showLabel?: boolean | undefined;
|
|
27
|
+
}
|
|
28
|
+
/** A list entry; false, null and undefined are skipped, so `canEdit && { ... }` leaves an action out. */
|
|
29
|
+
export type AppRowActionEntry = AppRowAction | false | null | undefined;
|
|
30
|
+
export interface AppRowActionsProps extends Omit<React.ComponentPropsWithoutRef<"div">, "children"> {
|
|
31
|
+
/** The row's actions, in order. A list entry; false, null and undefined are skipped, so `canEdit && { ... }` leaves an action out. Each item needs a unique `key`, and onClick, href or to unless it is disabled; onClick may accompany href or to. */
|
|
32
|
+
items: readonly AppRowActionEntry[];
|
|
33
|
+
/**
|
|
34
|
+
* The menu trigger's accessible name and tooltip.
|
|
35
|
+
* @default "More actions"
|
|
36
|
+
*/
|
|
37
|
+
menuLabel?: string | undefined;
|
|
38
|
+
linkComponent?: AppLinkComponent | undefined;
|
|
39
|
+
}
|
|
40
|
+
export default function AppRowActions(props: AppRowActionsProps): React.JSX.Element;
|
|
@@ -5,7 +5,7 @@ export interface AppScrollbarProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* A scroll container with a thin, themed scrollbar in place of the browser's default chunky one.
|
|
8
|
-
* Pure CSS
|
|
8
|
+
* Pure CSS: native scrolling, keyboard navigation and in-page anchoring are untouched; only the
|
|
9
9
|
* visible track is restyled, via the `.wui-scroll` rules in `@webority/theme`. No JavaScript and
|
|
10
10
|
* no dependency: the thin overlay look comes from native `scrollbar-width` / `::-webkit-scrollbar`.
|
|
11
11
|
*
|
|
@@ -11,7 +11,7 @@ export interface AppSectionFeaturesProps {
|
|
|
11
11
|
/** The section's heading. */
|
|
12
12
|
title: ReactNode;
|
|
13
13
|
/**
|
|
14
|
-
* The points: a title, a description, a library icon name
|
|
14
|
+
* The points: a title, a description, a library icon name or an image, and a second image for the rows layout.
|
|
15
15
|
* @default []
|
|
16
16
|
*/
|
|
17
17
|
items?: {
|
|
@@ -19,6 +19,10 @@ export interface AppSectionFeaturesProps {
|
|
|
19
19
|
title: string;
|
|
20
20
|
description?: ReactNode | undefined;
|
|
21
21
|
icon?: string | undefined;
|
|
22
|
+
imageSrc?: string | undefined;
|
|
23
|
+
imageAlt?: string | undefined;
|
|
24
|
+
imageWidth?: number | undefined;
|
|
25
|
+
imageHeight?: number | undefined;
|
|
22
26
|
media?: ReactNode | undefined;
|
|
23
27
|
}[] | undefined;
|
|
24
28
|
/**
|
|
@@ -61,6 +61,8 @@ export interface UserMenuShape {
|
|
|
61
61
|
roles?: string[] | undefined;
|
|
62
62
|
/** Leave the job title off the topbar trigger; the opened menu still shows it. */
|
|
63
63
|
noTriggerRole?: boolean | undefined;
|
|
64
|
+
/** Draws an always-on outline around the topbar trigger. Defaults to false. */
|
|
65
|
+
outlined?: boolean | undefined;
|
|
64
66
|
/** Profile photo URL. */
|
|
65
67
|
photo?: string | undefined;
|
|
66
68
|
profileHref?: string | undefined;
|
|
@@ -206,6 +208,11 @@ export interface AppShellProps extends Omit<React.ComponentPropsWithoutRef<"div"
|
|
|
206
208
|
* @default "neutral"
|
|
207
209
|
*/
|
|
208
210
|
topbarTone?: "neutral" | "primary" | undefined;
|
|
211
|
+
/**
|
|
212
|
+
* brand paints the sidebar and its parts with the --color-shell-* tokens.
|
|
213
|
+
* @default "default"
|
|
214
|
+
*/
|
|
215
|
+
tone?: "default" | "brand" | undefined;
|
|
209
216
|
/**
|
|
210
217
|
* Accessible name of the sidebar navigation.
|
|
211
218
|
* @default "Main navigation"
|
|
@@ -250,11 +257,6 @@ export interface AppShellProps extends Omit<React.ComponentPropsWithoutRef<"div"
|
|
|
250
257
|
* @default "Open navigation"
|
|
251
258
|
*/
|
|
252
259
|
openNavLabel?: string | undefined;
|
|
253
|
-
/**
|
|
254
|
-
* Replaces the built-in English text, for other languages.
|
|
255
|
-
* @default "Close navigation"
|
|
256
|
-
*/
|
|
257
|
-
closeNavLabel?: string | undefined;
|
|
258
260
|
/**
|
|
259
261
|
* Replaces the built-in English text, for other languages.
|
|
260
262
|
* @default "Expand navigation"
|
|
@@ -369,7 +371,7 @@ export interface AppShellProps extends Omit<React.ComponentPropsWithoutRef<"div"
|
|
|
369
371
|
* a bottom tab bar.
|
|
370
372
|
*
|
|
371
373
|
* Slot-based, not copy-own. What every product shares is the *structure*: the
|
|
372
|
-
* breakpoint the sidebar collapses at, the drawer and its
|
|
374
|
+
* breakpoint the sidebar collapses at, the drawer and its backdrop, the 72px topbar,
|
|
373
375
|
* the icon rail, the tab bar. What differs is only the content, which arrives as props.
|
|
374
376
|
* The Razor `<app-shell>` renders the same markup and classes.
|
|
375
377
|
*
|
|
@@ -55,6 +55,11 @@ interface AppSliderBaseProps {
|
|
|
55
55
|
showValue?: boolean | undefined;
|
|
56
56
|
/** Suffix for the value label, for example %. */
|
|
57
57
|
unit?: string | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Digit grouping of the value label: indian writes 1,50,000; none writes 150000.
|
|
60
|
+
* @default "none"
|
|
61
|
+
*/
|
|
62
|
+
grouping?: "none" | "indian" | undefined;
|
|
58
63
|
/** Element id; a generated id is used when omitted. */
|
|
59
64
|
id?: string | undefined;
|
|
60
65
|
/** Accessible name when no visible label is used. */
|
|
@@ -39,6 +39,8 @@ export interface AppSparklineProps extends Omit<ComponentPropsWithoutRef<"svg">,
|
|
|
39
39
|
* @default "{name} from {from} to {to} across {count} points."
|
|
40
40
|
*/
|
|
41
41
|
rangeText?: string | undefined;
|
|
42
|
+
/** The lowest value of the line's range. Unset: the lowest data value. */
|
|
43
|
+
yMin?: number | undefined;
|
|
42
44
|
}
|
|
43
45
|
/**
|
|
44
46
|
* A small inline trend line: no axes, no tooltip, no chart engine. Drawn as plain SVG, so a
|
|
@@ -59,5 +61,6 @@ export interface AppSparklineProps extends Omit<ComponentPropsWithoutRef<"svg">,
|
|
|
59
61
|
* @param props.namedTrendLabel Default "{label} trend".
|
|
60
62
|
* @param props.oneValueText Default "{name} has one value, {value}.".
|
|
61
63
|
* @param props.rangeText Default "{name} from {from} to {to} across {count} points.".
|
|
64
|
+
* @param props.yMin The lowest value of the line's range. Unset: the lowest data value.
|
|
62
65
|
*/
|
|
63
66
|
export default function AppSparkline(props: AppSparklineProps): JSX.Element | null;
|
|
@@ -17,10 +17,10 @@ export interface AppSpinnerProps extends ComponentPropsWithoutRef<"span"> {
|
|
|
17
17
|
className?: string | undefined;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* A themed loading spinner
|
|
20
|
+
* A themed loading spinner: Bootstrap's `.spinner-border`, tinted by the theme.
|
|
21
21
|
* The React counterpart of `<app-spinner>`.
|
|
22
22
|
*
|
|
23
|
-
* For a whole section that is loading, prefer `AppSkeleton
|
|
23
|
+
* For a whole section that is loading, prefer `AppSkeleton`. A content-shaped
|
|
24
24
|
* placeholder reads better than a spinner above the fold.
|
|
25
25
|
*
|
|
26
26
|
* @param props.size
|
|
@@ -31,8 +31,8 @@ export interface AppSplashProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* The full-viewport boot screen shown while the app resolves its session, before
|
|
34
|
-
* the first route can render
|
|
35
|
-
* `authStatus` is still unresolved.
|
|
34
|
+
* the first route can render (the thing `ApplicationNavigator` returns while
|
|
35
|
+
* `authStatus` is still unresolved).
|
|
36
36
|
*
|
|
37
37
|
* Without it the app flashes the login screen at an already-authenticated user for
|
|
38
38
|
* the length of one session check.
|
|
@@ -79,7 +79,7 @@ export interface AppTabsProps {
|
|
|
79
79
|
* `onChange` and renders the panels. Razor's <app-tabs> renders the same strip markup
|
|
80
80
|
* (plus Bootstrap panels), so both surfaces look and behave alike.
|
|
81
81
|
*
|
|
82
|
-
* The active state is a sliding "ink bar" (`.app-tab-indicator`)
|
|
82
|
+
* The active state is a sliding "ink bar" (`.app-tab-indicator`): one element that is
|
|
83
83
|
* JS-measured against the active tab and slides between tabs with an ease-out (no overshoot).
|
|
84
84
|
* It becomes a moving pill in the `pills` variant and a moving left edge when
|
|
85
85
|
* `orientation="vertical"`, and it snaps (no slide) under `prefers-reduced-motion`.
|
|
@@ -90,11 +90,11 @@ export interface AppTabsProps {
|
|
|
90
90
|
*
|
|
91
91
|
* A tab becomes a real link when it carries `href` or `to`: it renders as an `<a>` (or the
|
|
92
92
|
* given `linkComponent` for a `to`) instead of a `<button>`, so the browser gives right-click
|
|
93
|
-
* "Open in new tab", Ctrl/⌘-click and middle-click for free
|
|
93
|
+
* "Open in new tab", Ctrl/⌘-click and middle-click for free: the standard, accessible way to
|
|
94
94
|
* open a tab on the next screen. `target="_blank"` opens it there on a plain click too (and
|
|
95
95
|
* gets `rel="noopener noreferrer"` unless the tab sets its own `rel`). A plain left-click still
|
|
96
96
|
* calls `onChange`; a modified click (new tab/window) does not, so the current selection is
|
|
97
|
-
* left untouched. Link tabs make `onChange` optional
|
|
97
|
+
* left untouched. Link tabs make `onChange` optional; selection usually follows the route the
|
|
98
98
|
* caller passes as `value`.
|
|
99
99
|
*/
|
|
100
100
|
export default function AppTabs(props: AppTabsProps): React.JSX.Element;
|
|
@@ -34,6 +34,11 @@ export interface AppToastProps extends Omit<ComponentPropsWithoutRef<"div">, "cl
|
|
|
34
34
|
* @default 16
|
|
35
35
|
*/
|
|
36
36
|
offset?: number | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* The close button's accessible name on every toast, for other languages.
|
|
39
|
+
* @default "Close"
|
|
40
|
+
*/
|
|
41
|
+
closeLabel?: string | undefined;
|
|
37
42
|
/**
|
|
38
43
|
* Extra class on the container element.
|
|
39
44
|
* @default ""
|
|
@@ -50,5 +55,5 @@ export interface AppToastProps extends Omit<ComponentPropsWithoutRef<"div">, "cl
|
|
|
50
55
|
* Toast options (from toast()/errorToast()): title, duration (0 = sticky), action {label,onClick},
|
|
51
56
|
* id (replace/refresh), and a string OR React-node message (rich body).
|
|
52
57
|
*/
|
|
53
|
-
export default function AppToast(props: AppToastProps): JSX.Element;
|
|
58
|
+
export default function AppToast(props: AppToastProps): JSX.Element | null;
|
|
54
59
|
export {};
|
|
@@ -44,17 +44,17 @@ export interface AppToolbarProps {
|
|
|
44
44
|
className?: string | undefined;
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
|
-
* A Figma-style toolbar
|
|
47
|
+
* A Figma-style toolbar: a pill strip of icon tools over a work surface. Exactly one
|
|
48
48
|
* tool is active; the active tool expands to reveal its label, the rest stay icon-only.
|
|
49
|
-
* Optional momentary `actions` render after a divider and just fire
|
|
49
|
+
* Optional momentary `actions` render after a divider and just fire; they never stay
|
|
50
50
|
* selected.
|
|
51
51
|
*
|
|
52
|
-
* Not `AppSegmented` (that chooses a form VALUE
|
|
53
|
-
* `AppFloatingDock` (marketing navigation shortcuts): this is action chrome
|
|
52
|
+
* Not `AppSegmented` (that chooses a form VALUE: view mode, period) and not
|
|
53
|
+
* `AppFloatingDock` (marketing navigation shortcuts): this is action chrome, which
|
|
54
54
|
* TOOL is in hand.
|
|
55
55
|
*
|
|
56
56
|
* Built on real `<input type="radio">` elements inside labels, so arrow-key navigation,
|
|
57
|
-
* the single tab stop, and screen-reader announcements come from the browser
|
|
57
|
+
* the single tab stop, and screen-reader announcements come from the browser. The
|
|
58
58
|
* Razor `<app-toolbar>` posts the selected tool inside a plain form with no JavaScript.
|
|
59
59
|
* The expand/collapse is pure CSS and honours `prefers-reduced-motion`.
|
|
60
60
|
*
|
|
@@ -8,10 +8,10 @@ export type AppTooltipTriggerProps = {
|
|
|
8
8
|
export interface AppTooltipProps extends Omit<ComponentPropsWithoutRef<"button">, "children" | "className" | "content"> {
|
|
9
9
|
/** The tooltip text or node. */
|
|
10
10
|
content: ReactNode;
|
|
11
|
-
/** A single trigger element
|
|
11
|
+
/** A single trigger element. It renders as written; hovering or focusing it reveals the tooltip. */
|
|
12
12
|
children: ReactElement<AppTooltipTriggerProps>;
|
|
13
13
|
/**
|
|
14
|
-
* Where the tooltip appears. A named side is preferred but flips if needed to stay in view; `auto`
|
|
14
|
+
* Where the tooltip appears. A named side is preferred but flips if needed to stay in view; `auto` picks the side with the most room outright. The bubble is a native popover in the top layer, so it never clips off-screen.
|
|
15
15
|
* @default "top"
|
|
16
16
|
*/
|
|
17
17
|
placement?: AppTooltipPlacement | undefined;
|
|
@@ -39,8 +39,8 @@ export interface AppTooltipProps extends Omit<ComponentPropsWithoutRef<"button">
|
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* A plain tooltip on any element (hover or keyboard focus to reveal). Distinct from AppInfoTip (a help
|
|
42
|
-
* "?" icon beside a label) and AppPopover (a click-opened panel).
|
|
43
|
-
*
|
|
44
|
-
*
|
|
42
|
+
* "?" icon beside a label) and AppPopover (a click-opened panel). Plain text rides on the trigger as
|
|
43
|
+
* data attributes; any other content or a shortcut is a bubble rendered into the overlay root. The
|
|
44
|
+
* shared tooltip runtime (`wireTooltips`) shows and hides both, the same way the Razor `<app-tooltip>` does.
|
|
45
45
|
*/
|
|
46
46
|
export default function AppTooltip(props: AppTooltipProps): JSX.Element;
|
|
@@ -79,7 +79,7 @@ export interface AppWorkspaceSwitcherProps extends Omit<React.HTMLAttributes<HTM
|
|
|
79
79
|
onToggle?: ((next: boolean, meta: AppWorkspaceSwitcherToggleMeta) => void) | undefined;
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
|
-
* Tenant / workspace switcher
|
|
82
|
+
* Tenant / workspace switcher: a <wui-dropdown> wearing an identity card.
|
|
83
83
|
*
|
|
84
84
|
* Selection is a CALLBACK, never navigation: products own where a workspace switch goes
|
|
85
85
|
* (a route change, a reload, an API call), so `onSelect(tenant)` is all the library does.
|
|
@@ -87,8 +87,8 @@ export interface AppWorkspaceSwitcherProps extends Omit<React.HTMLAttributes<HTM
|
|
|
87
87
|
* an `{ href }` renders through `linkComponent` when one is supplied, otherwise a plain
|
|
88
88
|
* anchor, and the library never imports a router.
|
|
89
89
|
*
|
|
90
|
-
* Tenant logos use `loading="lazy"` so a closed menu
|
|
91
|
-
* logo network fetch on first paint
|
|
90
|
+
* Tenant logos use `loading="lazy"` so a closed menu does not force every
|
|
91
|
+
* logo network fetch on first paint: the browser defers off-screen images.
|
|
92
92
|
*
|
|
93
93
|
* NOTE: the exported component must stay the FIRST destructured function in this file —
|
|
94
94
|
* the parity check reads the first signature it finds as the component's public props.
|
|
@@ -42,7 +42,7 @@ export declare function subscribeToasts(listener: (list: ToastEntry[]) => void):
|
|
|
42
42
|
export declare function pushToast(message: ReactNode, variant: string, opts?: ToastOptions): void;
|
|
43
43
|
/** Hand a toast's dismissal over from the store clock to its rendered CSS countdown. */
|
|
44
44
|
export declare function adoptToast(id: number): void;
|
|
45
|
-
/** Remove a toast
|
|
45
|
+
/** Remove a toast: its countdown ended, the store clock fired, or the user closed it. */
|
|
46
46
|
export declare function dismissToast(id: number): void;
|
|
47
|
-
/** Clear every toast at once
|
|
47
|
+
/** Clear every toast at once (e.g. on route change or logout). No-op when already empty. */
|
|
48
48
|
export declare function dismissAllToasts(): void;
|
|
@@ -8,17 +8,17 @@
|
|
|
8
8
|
* ABSENCE OF A WARNING IS NOT PROOF OF CORRECTNESS.
|
|
9
9
|
*
|
|
10
10
|
* A wrong prop whose name happens to be a real HTML attribute cannot be told apart from a
|
|
11
|
-
* deliberate pass-through, so it stays silent. That is not one prop
|
|
11
|
+
* deliberate pass-through, so it stays silent. That is not one prop: the allowlist below
|
|
12
12
|
* contains `name`, `title`, `type`, `value`, `width`, `height` and more, so `<AppActionIcon
|
|
13
13
|
* name="eye">` (meaning `icon`) and `<AppFoo title="…">` (meaning `label`) both pass
|
|
14
14
|
* unremarked. Silence means "nothing recognisably wrong", never "checked and correct".
|
|
15
15
|
*
|
|
16
16
|
* It also only sees components that MOUNT. A wrong prop inside a modal nobody opened, or a
|
|
17
|
-
* row-action menu on an empty list, produces no warning at all in a dev session
|
|
17
|
+
* row-action menu on an empty list, produces no warning at all in a dev session. A
|
|
18
18
|
* consumer found five such cases only by checking statically against the shipped types.
|
|
19
19
|
*
|
|
20
20
|
* What it does catch reliably is the shape that has actually bitten: a prop name that is
|
|
21
|
-
* neither the component's API nor a valid attribute
|
|
21
|
+
* neither the component's API nor a valid attribute: `body`, `icon`, `iconRight`,
|
|
22
22
|
* `iconSize`, `variant` on a component that takes `tone`, `w`/`h`/`r` for
|
|
23
23
|
* `width`/`height`/`radius`, `invalid` for `error`.
|
|
24
24
|
*/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FieldValues, UseFormReturn } from "react-hook-form";
|
|
2
|
+
import type { AppFormProps, AppFormSubmitContext } from "../components/AppForm.tsx";
|
|
3
|
+
export interface UseHookFormOptions<TValues extends FieldValues> {
|
|
4
|
+
/** Runs with the valid values. Throw or reject to fail: an ApiError's field errors land on their fields, the rest at the top of the form. */
|
|
5
|
+
onSubmit: (values: TValues, context: AppFormSubmitContext) => void | Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export interface HookFormBinding {
|
|
8
|
+
onSubmit: AppFormProps["onSubmit"];
|
|
9
|
+
fieldErrors: Readonly<Record<string, string>>;
|
|
10
|
+
formErrors: readonly string[];
|
|
11
|
+
noValidate: true;
|
|
12
|
+
}
|
|
13
|
+
/** Connects a react-hook-form form to AppForm: `<AppForm {...useHookForm(form, { onSubmit })}>`. */
|
|
14
|
+
export declare function useHookForm<TValues extends FieldValues>(form: UseFormReturn<TValues>, options: UseHookFormOptions<TValues>): HookFormBinding;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { createLocalSeenStore, isImeSafeEnter, mentionedIds, parseMentionValue, postedMasked, themeBootScript, } from "@webority/ui-elements/helpers";
|
|
1
|
+
export { createLocalSeenStore, isImeSafeEnter, mentionedIds, parseMentionValue, postedMasked, themeBootScript, wireTooltips, } from "@webority/ui-elements/helpers";
|
|
2
2
|
export { default as AppAccordion } from "./components/AppAccordion.tsx";
|
|
3
3
|
export { default as AppAccountSwitcher } from "./components/AppAccountSwitcher.tsx";
|
|
4
4
|
export { default as AppActionIcon } from "./components/AppActionIcon.tsx";
|
|
@@ -16,6 +16,7 @@ export { default as AppCalendar } from "./components/AppCalendar.tsx";
|
|
|
16
16
|
export { default as AppCard } from "./components/AppCard.tsx";
|
|
17
17
|
export { default as AppCarousel } from "./components/AppCarousel.tsx";
|
|
18
18
|
export { default as AppCell } from "./components/AppCell.tsx";
|
|
19
|
+
export type { ChartFormat } from "./components/AppChart.tsx";
|
|
19
20
|
export { default as AppChart } from "./components/AppChart.tsx";
|
|
20
21
|
export { default as AppChartCard } from "./components/AppChartCard.tsx";
|
|
21
22
|
export { default as AppCheckbox } from "./components/AppCheckbox.tsx";
|
|
@@ -49,6 +50,8 @@ export type { AppDropZoneMultipleProps, AppDropZoneProps, AppDropZoneSingleProps
|
|
|
49
50
|
export { default as AppDropZone } from "./components/AppDropZone.tsx";
|
|
50
51
|
export { default as AppDueDate } from "./components/AppDueDate.tsx";
|
|
51
52
|
export { default as AppEmptyState } from "./components/AppEmptyState.tsx";
|
|
53
|
+
export type { AppEntryGridColumn, AppEntryGridColumnKind, AppEntryGridProps, AppEntryGridRowStatus, } from "./components/AppEntryGrid.tsx";
|
|
54
|
+
export { default as AppEntryGrid } from "./components/AppEntryGrid.tsx";
|
|
52
55
|
export { default as AppErrorBoundary } from "./components/AppErrorBoundary.tsx";
|
|
53
56
|
export { default as AppErrorSummary } from "./components/AppErrorSummary.tsx";
|
|
54
57
|
export { default as AppFileAttachment } from "./components/AppFileAttachment.tsx";
|
|
@@ -64,6 +67,8 @@ export { default as AppForm, useFormSubmit } from "./components/AppForm.tsx";
|
|
|
64
67
|
export { default as AppFormActions } from "./components/AppFormActions.tsx";
|
|
65
68
|
export { default as AppFormRow } from "./components/AppFormRow.tsx";
|
|
66
69
|
export { default as AppFormSection } from "./components/AppFormSection.tsx";
|
|
70
|
+
export type { AppFormulaSign, AppFormulaStep, AppFormulaStepsProps } from "./components/AppFormulaSteps.tsx";
|
|
71
|
+
export { default as AppFormulaSteps } from "./components/AppFormulaSteps.tsx";
|
|
67
72
|
export { default as AppHoverCard } from "./components/AppHoverCard.tsx";
|
|
68
73
|
export { default as AppIcon, iconNames, registerIcons } from "./components/AppIcon.tsx";
|
|
69
74
|
export { default as AppImagePicker } from "./components/AppImagePicker.tsx";
|
|
@@ -104,15 +109,12 @@ export { default as AppRecordPager } from "./components/AppRecordPager.tsx";
|
|
|
104
109
|
export { default as AppRelativeTime } from "./components/AppRelativeTime.tsx";
|
|
105
110
|
export { default as AppRepeater } from "./components/AppRepeater.tsx";
|
|
106
111
|
export { default as AppRequiredMark } from "./components/AppRequiredMark.tsx";
|
|
107
|
-
export { default as AppResizable } from "./components/AppResizable.tsx";
|
|
108
|
-
export { default as AppResizableHandle } from "./components/AppResizableHandle.tsx";
|
|
109
|
-
export { default as AppResizablePanel } from "./components/AppResizablePanel.tsx";
|
|
110
112
|
export { default as AppResourceCard } from "./components/AppResourceCard.tsx";
|
|
111
113
|
export { default as AppResult } from "./components/AppResult.tsx";
|
|
112
114
|
export { default as AppRichText } from "./components/AppRichText.tsx";
|
|
113
|
-
export { default as AppRollingNumber } from "./components/AppRollingNumber.tsx";
|
|
114
115
|
export { default as AppRouteError } from "./components/AppRouteError.tsx";
|
|
115
|
-
export {
|
|
116
|
+
export type { AppRowAction, AppRowActionEntry, AppRowActionsProps } from "./components/AppRowActions.tsx";
|
|
117
|
+
export { default as AppRowActions } from "./components/AppRowActions.tsx";
|
|
116
118
|
export { default as AppScoreScale } from "./components/AppScoreScale.tsx";
|
|
117
119
|
export { default as AppScrollbar } from "./components/AppScrollbar.tsx";
|
|
118
120
|
export { default as AppSearch } from "./components/AppSearch.tsx";
|
|
@@ -18,7 +18,7 @@ export interface CheckFieldProps {
|
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Shared render logic for checkbox/radio/switch controls.
|
|
21
|
-
* @internal
|
|
21
|
+
* @internal, not exported from the package barrel
|
|
22
22
|
*/
|
|
23
23
|
declare const CheckField: React.ForwardRefExoticComponent<CheckFieldProps & React.RefAttributes<HTMLInputElement>>;
|
|
24
24
|
export default CheckField;
|
|
@@ -10,6 +10,6 @@ export interface FieldMessageProps {
|
|
|
10
10
|
* while the error shows. The line is kept
|
|
11
11
|
* whether or not anything shows (inside a form), so an error never moves the form. A cleared
|
|
12
12
|
* error keeps its text until its fade-out ends, so there is something to fade.
|
|
13
|
-
* @internal
|
|
13
|
+
* @internal, not exported from the package barrel
|
|
14
14
|
*/
|
|
15
15
|
export default function FieldMessage({ error, hint, errorId, hintId }: FieldMessageProps): React.JSX.Element;
|
|
@@ -17,7 +17,7 @@ export interface FileItemRowProps {
|
|
|
17
17
|
readOnly?: boolean | undefined;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* Compact picked-file row
|
|
20
|
+
* Compact picked-file row: image thumbnail or file-type icon + name/size + inline remove.
|
|
21
21
|
* Internal: shared by AppFileAttachment and AppFilePicker so the two fields cannot drift.
|
|
22
22
|
*/
|
|
23
23
|
export default function FileItemRow({ item, isImage, onRemove, linkComponent, noun, removeFileLabel, readOnly, }: FileItemRowProps): React.JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared file-item helpers for the two file fields (AppFileAttachment, AppFilePicker). Both
|
|
3
|
-
* render the same compact picked-file row over the same value shape
|
|
4
|
-
* or an existing `{ url, name }
|
|
3
|
+
* render the same compact picked-file row over the same value shape: a freshly-picked `File`
|
|
4
|
+
* or an existing `{ url, name }`, so the key, name, size and blob-URL rules live once.
|
|
5
5
|
*/
|
|
6
6
|
export interface FileItemValue {
|
|
7
7
|
url?: string | undefined;
|
|
@@ -34,7 +34,7 @@ export declare function uploadProgressOf(item: FileItem): number | null;
|
|
|
34
34
|
export declare function uploadErrorOf(item: FileItem): string | null;
|
|
35
35
|
/**
|
|
36
36
|
* A freshly-picked File has no URL of its own; mint one (for images) and revoke it on
|
|
37
|
-
* change/unmount. An existing attachment already carries `url`. Non-images get no URL
|
|
37
|
+
* change/unmount. An existing attachment already carries `url`. Non-images get no URL; the
|
|
38
38
|
* caller renders a file-type icon instead.
|
|
39
39
|
*/
|
|
40
40
|
export declare function useItemUrl(item: FileItem, isImage: boolean): string | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface FormFieldsState {
|
|
2
|
+
/** The message for a field name, or undefined: none, or the person has edited the field since the map arrived. */
|
|
3
|
+
errorOf: (name: string) => string | undefined;
|
|
4
|
+
/** A mounted field says it is on the form; returns its release. */
|
|
5
|
+
claim: (name: string) => () => void;
|
|
6
|
+
}
|
|
7
|
+
/** The enclosing AppForm's field errors, or null outside one. */
|
|
8
|
+
export declare const FormFieldsContext: import("react").Context<FormFieldsState | null>;
|
|
9
|
+
/** The form's message for this field, and the claim on its name while mounted. Undefined outside an AppForm or with no name. */
|
|
10
|
+
export declare function useFieldError(name: string | undefined): string | undefined;
|
|
11
|
+
/** One spelling per field path: `items[0].qty` becomes `items.0.qty`. */
|
|
12
|
+
export declare function toFieldName(path: string): string;
|