@webority/ui-react 0.174.1 → 0.176.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/dist/canvas-kit/kit.js +96 -96
- package/dist/canvas-kit/manifest.json +133 -1
- package/dist/canvas-kit/release.json +6 -6
- package/dist/components/AppAlert.js +1 -1
- package/dist/components/AppAvatar.js +1 -1
- package/dist/components/AppCalendar.js +1 -1
- package/dist/components/AppChart.js +1 -1
- package/dist/components/AppCheckbox.js +1 -1
- package/dist/components/AppChip.js +1 -1
- package/dist/components/AppChoiceCard.js +1 -1
- package/dist/components/AppCommentThread.js +1 -1
- package/dist/components/AppConfirmDialog.js +1 -1
- package/dist/components/AppConfirmProvider.js +1 -1
- package/dist/components/AppContextMenu.js +1 -1
- package/dist/components/AppDatePicker.js +1 -1
- package/dist/components/AppDateRangePicker.js +1 -1
- package/dist/components/AppDateTimePicker.js +1 -1
- package/dist/components/AppDropdown.js +1 -1
- package/dist/components/AppFileAttachment.js +1 -1
- package/dist/components/AppFilePicker.js +1 -1
- package/dist/components/AppFileViewer.js +1 -1
- package/dist/components/AppForm.js +1 -1
- package/dist/components/AppImagePicker.js +1 -1
- package/dist/components/AppInput.js +1 -1
- package/dist/components/AppLeadPopup.js +1 -1
- package/dist/components/AppLightbox.js +1 -1
- package/dist/components/AppLink.js +1 -1
- package/dist/components/AppMentionInput.js +1 -1
- package/dist/components/AppMonthPicker.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/AppQueryBuilder.js +1 -1
- package/dist/components/AppRadio.js +1 -1
- package/dist/components/AppRichText.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/AppSortableList.js +1 -1
- package/dist/components/AppSwitch.js +1 -1
- package/dist/components/AppTabs.js +1 -1
- package/dist/components/AppTextarea.js +1 -1
- package/dist/components/AppTimePicker.js +1 -1
- package/dist/components/AppTour.js +1 -1
- package/dist/components/AppTransferList.js +1 -1
- package/dist/components/AppTreePicker.js +1 -1
- package/dist/components/AppTreeView.js +1 -1
- package/dist/components/AppWhatsNew.js +1 -1
- package/dist/components/AppWizard.js +1 -1
- package/dist/components/AppWorkspaceSwitcher.js +1 -1
- package/dist/components/AppYearPicker.js +1 -1
- package/dist/components/toast.js +1 -1
- package/dist/guidance.json +1 -1
- package/dist/lib/CheckField.js +1 -1
- package/dist/lib/FileItemRow.js +1 -1
- package/dist/types/components/AppCalendar.d.ts +50 -2
- package/dist/types/components/AppChart.d.ts +3 -2
- package/dist/types/components/AppCheckbox.d.ts +4 -2
- package/dist/types/components/AppChoiceCard.d.ts +4 -0
- package/dist/types/components/AppCompareTable.d.ts +2 -2
- package/dist/types/components/AppConfirmDialog.d.ts +4 -0
- package/dist/types/components/AppContextMenu.d.ts +2 -0
- package/dist/types/components/AppCopyButton.d.ts +1 -1
- package/dist/types/components/AppDatePicker.d.ts +2 -1
- package/dist/types/components/AppDateRangePicker.d.ts +4 -1
- package/dist/types/components/AppDateTimePicker.d.ts +2 -1
- package/dist/types/components/AppDropdown.d.ts +2 -0
- package/dist/types/components/AppFileViewer.d.ts +50 -2
- package/dist/types/components/AppForm.d.ts +2 -2
- package/dist/types/components/AppFormSection.d.ts +2 -2
- package/dist/types/components/AppInput.d.ts +13 -1
- package/dist/types/components/AppLeadPopup.d.ts +2 -1
- package/dist/types/components/AppLightbox.d.ts +2 -0
- package/dist/types/components/AppMentionInput.d.ts +3 -1
- package/dist/types/components/AppMonthPicker.d.ts +2 -1
- package/dist/types/components/AppNumberInput.d.ts +4 -2
- package/dist/types/components/AppOtpInput.d.ts +17 -2
- package/dist/types/components/AppPhoneNumberInput.d.ts +7 -2
- package/dist/types/components/AppQueryBuilder.d.ts +3 -2
- package/dist/types/components/AppRadio.d.ts +11 -2
- package/dist/types/components/AppResult.d.ts +2 -2
- package/dist/types/components/AppRichText.d.ts +3 -2
- package/dist/types/components/AppRouteError.d.ts +2 -2
- package/dist/types/components/AppSelect.d.ts +3 -1
- package/dist/types/components/AppShell.d.ts +16 -0
- package/dist/types/components/AppSlider.d.ts +4 -2
- package/dist/types/components/AppSortableList.d.ts +4 -2
- package/dist/types/components/AppSwitch.d.ts +3 -2
- package/dist/types/components/AppTextarea.d.ts +3 -2
- package/dist/types/components/AppTimePicker.d.ts +19 -2
- package/dist/types/components/AppTour.d.ts +28 -2
- package/dist/types/components/AppTransferList.d.ts +4 -2
- package/dist/types/components/AppTreePicker.d.ts +3 -2
- package/dist/types/components/AppTreeView.d.ts +4 -2
- package/dist/types/components/AppWhatsNew.d.ts +2 -0
- package/dist/types/components/AppWizard.d.ts +16 -2
- package/dist/types/components/AppYearPicker.d.ts +3 -1
- package/dist/types/components/toast.d.ts +46 -4
- package/dist/types/lib/CheckField.d.ts +2 -1
- package/dist/types/lib/formFields.d.ts +2 -1
- package/dist/web-core/dist/errors/extractApiError.js +2 -2
- package/package.json +10 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef, CSSProperties } from "react";
|
|
1
|
+
import type { ComponentPropsWithoutRef, CSSProperties, JSX, Ref } from "react";
|
|
2
2
|
export type ChartType = "line" | "area" | "column" | "bar" | "donut" | "heatmap" | "calendar" | "funnel" | "gauge" | "waterfall" | "treemap" | "sankey" | "scatter" | "bubble" | "multiples";
|
|
3
3
|
export type ChartStack = "none" | "stacked" | "percent";
|
|
4
4
|
/** How a value prints. Every part is optional except `currency` when the style is currency. */
|
|
@@ -159,6 +159,7 @@ export interface AppChartProps extends Omit<ComponentPropsWithoutRef<"div">, "on
|
|
|
159
159
|
className?: string | undefined;
|
|
160
160
|
/** Inline style on the element. */
|
|
161
161
|
style?: CSSProperties | undefined;
|
|
162
|
+
ref?: Ref<HTMLElement> | undefined;
|
|
162
163
|
}
|
|
163
164
|
/**
|
|
164
165
|
* Draws a line, area, column, horizontal bar, donut, heatmap, calendar heatmap, funnel, gauge,
|
|
@@ -185,5 +186,5 @@ export interface AppChartProps extends Omit<ComponentPropsWithoutRef<"div">, "on
|
|
|
185
186
|
* />
|
|
186
187
|
* ```
|
|
187
188
|
*/
|
|
188
|
-
declare
|
|
189
|
+
declare function AppChart({ ref, ...props }: AppChartProps): JSX.Element;
|
|
189
190
|
export default AppChart;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
import type { ChangeEvent, ComponentPropsWithoutRef, ReactNode, Ref } from "react";
|
|
2
3
|
export interface AppCheckboxProps extends Omit<ComponentPropsWithoutRef<"input">, "size"> {
|
|
3
4
|
/** The text beside the box. Clicking it ticks the box. */
|
|
4
5
|
label?: ReactNode | undefined;
|
|
@@ -51,6 +52,7 @@ export interface AppCheckboxProps extends Omit<ComponentPropsWithoutRef<"input">
|
|
|
51
52
|
* @default ""
|
|
52
53
|
*/
|
|
53
54
|
className?: string | undefined;
|
|
55
|
+
ref?: Ref<HTMLInputElement> | undefined;
|
|
54
56
|
}
|
|
55
57
|
/**
|
|
56
58
|
* Shared checkbox on Bootstrap `.form-check` markup (Razor <app-checkbox> matches).
|
|
@@ -60,5 +62,5 @@ export interface AppCheckboxProps extends Omit<ComponentPropsWithoutRef<"input">
|
|
|
60
62
|
* The label is bound with id/htmlFor rather than react-bootstrap's `label` prop:
|
|
61
63
|
* that rendered a <label> with no `for`, so clicking the text did nothing.
|
|
62
64
|
*/
|
|
63
|
-
declare
|
|
65
|
+
declare function AppCheckbox({ ref, ...props }: AppCheckboxProps): React.JSX.Element;
|
|
64
66
|
export default AppCheckbox;
|
|
@@ -25,6 +25,10 @@ export interface AppChoiceCardProps extends Omit<React.ComponentPropsWithoutRef<
|
|
|
25
25
|
* @default ""
|
|
26
26
|
*/
|
|
27
27
|
imageAlt?: string | undefined;
|
|
28
|
+
/** The image's intrinsic width in px. Set it with imageHeight so the card keeps its size while the image loads. */
|
|
29
|
+
imageWidth?: number | undefined;
|
|
30
|
+
/** The image's intrinsic height in px. */
|
|
31
|
+
imageHeight?: number | undefined;
|
|
28
32
|
/** Custom body, overriding title/description. */
|
|
29
33
|
children?: React.ReactNode | undefined;
|
|
30
34
|
/** The card title. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef, type ReactNode } from "react";
|
|
1
|
+
import { type ComponentPropsWithoutRef, type JSX, type ReactNode } from "react";
|
|
2
2
|
type CompareState = "yes" | "no" | "warn" | "partial";
|
|
3
3
|
export interface CompareColumn {
|
|
4
4
|
label: string;
|
|
@@ -94,5 +94,5 @@ export interface AppCompareTableProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
94
94
|
*
|
|
95
95
|
* For tabular DATA (sortable, paginated rows of records) use `AppDataTable`.
|
|
96
96
|
*/
|
|
97
|
-
export default function AppCompareTable(props: AppCompareTableProps):
|
|
97
|
+
export default function AppCompareTable(props: AppCompareTableProps): JSX.Element;
|
|
98
98
|
export {};
|
|
@@ -34,6 +34,10 @@ export interface AppConfirmDialogProps {
|
|
|
34
34
|
tone?: ConfirmTone | undefined;
|
|
35
35
|
/** URL of a custom illustration that replaces the tone artwork. Any source size is fine: the theme boxes it to the same footprint. It is decorative, so the title and message carry the meaning. */
|
|
36
36
|
image?: string | undefined;
|
|
37
|
+
/** Width in px of the custom image, written as the img width. Unset, no width is written. */
|
|
38
|
+
imageWidth?: number | undefined;
|
|
39
|
+
/** Height in px of the custom image, written as the img height. Unset, no height is written. */
|
|
40
|
+
imageHeight?: number | undefined;
|
|
37
41
|
/** Replaces the tone's glyph. A string is an icon name; a node is drawn as given. An image still wins over it. */
|
|
38
42
|
icon?: string | ReactNode | undefined;
|
|
39
43
|
/** Width and height of the illustration in px, for the tone artwork and a custom image alike. Unset, it is 120px with a message and 84px without. */
|
|
@@ -9,6 +9,8 @@ export interface AppContextMenuItem {
|
|
|
9
9
|
label?: string | undefined;
|
|
10
10
|
icon?: string | ReactNode | undefined;
|
|
11
11
|
image?: string | undefined;
|
|
12
|
+
imageWidth?: number | undefined;
|
|
13
|
+
imageHeight?: number | undefined;
|
|
12
14
|
hint?: string | undefined;
|
|
13
15
|
shortcut?: string | undefined;
|
|
14
16
|
checked?: boolean | undefined;
|
|
@@ -2,7 +2,7 @@ import type React from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* A copy-to-clipboard button with feedback. Shows "Copied" confirmation for
|
|
4
4
|
* COPY_FEEDBACK_MS after a successful copy. Uses the shared copyTextToClipboard helper
|
|
5
|
-
* (Clipboard API
|
|
5
|
+
* (the Clipboard API) and never throws on clipboard denial.
|
|
6
6
|
*
|
|
7
7
|
* Supports both button form (label + icon) and icon-only form (actionable icon).
|
|
8
8
|
*
|
|
@@ -85,6 +85,7 @@ export interface AppDatePickerProps extends Omit<React.HTMLAttributes<HTMLElemen
|
|
|
85
85
|
* @default ""
|
|
86
86
|
*/
|
|
87
87
|
fieldClassName?: string | undefined;
|
|
88
|
+
ref?: React.Ref<HTMLElement> | undefined;
|
|
88
89
|
}
|
|
89
90
|
/**
|
|
90
91
|
* Thin React wrapper over the shared `<wui-datepicker>` element (single
|
|
@@ -96,5 +97,5 @@ export interface AppDatePickerProps extends Omit<React.HTMLAttributes<HTMLElemen
|
|
|
96
97
|
* per-screen divergence this library exists to prevent. The shell is omitted
|
|
97
98
|
* entirely when there is nothing to render around the control.
|
|
98
99
|
*/
|
|
99
|
-
declare
|
|
100
|
+
declare function AppDatePicker({ ref, ...props }: AppDatePickerProps): React.ReactElement;
|
|
100
101
|
export default AppDatePicker;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
|
+
import { type Ref } from "react";
|
|
2
3
|
type DateRangePresetName = "today" | "yesterday" | "last7Days" | "last30Days" | "thisMonth" | "lastMonth" | "thisFinancialYear";
|
|
3
4
|
export interface DateRangeValue {
|
|
4
5
|
start: string;
|
|
@@ -100,6 +101,8 @@ export interface AppDateRangePickerProps extends Omit<React.HTMLAttributes<HTMLE
|
|
|
100
101
|
* @default ""
|
|
101
102
|
*/
|
|
102
103
|
fieldClassName?: string | undefined;
|
|
104
|
+
/** Receives the `<wui-date-range>` element. */
|
|
105
|
+
ref?: Ref<HTMLElement> | undefined;
|
|
103
106
|
}
|
|
104
107
|
/**
|
|
105
108
|
* Thin React wrapper over the shared `<wui-date-range>` element: a start/end date range
|
|
@@ -110,5 +113,5 @@ export interface AppDateRangePickerProps extends Omit<React.HTMLAttributes<HTMLE
|
|
|
110
113
|
* Controlled through two ISO strings; `onChange` fires with `{ start, end }` when the range
|
|
111
114
|
* completes or is cleared.
|
|
112
115
|
*/
|
|
113
|
-
declare
|
|
116
|
+
declare function AppDateRangePicker({ ref, ...props }: AppDateRangePickerProps): React.ReactElement;
|
|
114
117
|
export default AppDateRangePicker;
|
|
@@ -64,6 +64,7 @@ export interface AppDateTimePickerProps extends Omit<React.HTMLAttributes<HTMLEl
|
|
|
64
64
|
* @default ""
|
|
65
65
|
*/
|
|
66
66
|
fieldClassName?: string | undefined;
|
|
67
|
+
ref?: React.Ref<HTMLElement> | undefined;
|
|
67
68
|
}
|
|
68
69
|
/**
|
|
69
70
|
* Thin React wrapper over the shared `<wui-date-time>` element (single implementation, so React
|
|
@@ -71,5 +72,5 @@ export interface AppDateTimePickerProps extends Omit<React.HTMLAttributes<HTMLEl
|
|
|
71
72
|
* Each part is read and entered in `zone` (IST by default), so a value stored in UTC shows the
|
|
72
73
|
* date and time a person expects. Wraps it in the standard `.field` shell with a zone note under it.
|
|
73
74
|
*/
|
|
74
|
-
declare
|
|
75
|
+
declare function AppDateTimePicker({ ref, ...props }: AppDateTimePickerProps): React.ReactElement;
|
|
75
76
|
export default AppDateTimePicker;
|
|
@@ -6,6 +6,8 @@ export interface AppDropdownItem {
|
|
|
6
6
|
description?: string | undefined;
|
|
7
7
|
icon?: string | React.ReactNode | undefined;
|
|
8
8
|
image?: string | undefined;
|
|
9
|
+
imageWidth?: number | undefined;
|
|
10
|
+
imageHeight?: number | undefined;
|
|
9
11
|
to?: string | undefined;
|
|
10
12
|
href?: string | undefined;
|
|
11
13
|
/** Where an href or to opens. Needs href or to. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef, type CSSProperties, type ReactNode } from "react";
|
|
1
|
+
import { type ComponentPropsWithoutRef, type CSSProperties, type JSX, type ReactNode, type Ref } from "react";
|
|
2
2
|
export interface AppFileViewerElement extends HTMLElement {
|
|
3
3
|
prefs: Record<string, unknown>;
|
|
4
4
|
readonly actionsContainer: HTMLElement | null;
|
|
@@ -47,6 +47,54 @@ export interface AppFileViewerProps extends Omit<ComponentPropsWithoutRef<"div">
|
|
|
47
47
|
*/
|
|
48
48
|
className?: string | undefined;
|
|
49
49
|
style?: CSSProperties | undefined;
|
|
50
|
+
ref?: Ref<AppFileViewerElement> | undefined;
|
|
50
51
|
}
|
|
51
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Shows a file inside the page: a toolbar with the file's name and the controls its kind
|
|
54
|
+
* needs, and the file below it: a PDF (drawn with pdf.js), an image, a video or an audio file.
|
|
55
|
+
* A file it cannot show gets a message and a download link instead.
|
|
56
|
+
*
|
|
57
|
+
* Wraps the shared `<wui-file-viewer>` element, the same one the Razor `<app-file-viewer>`
|
|
58
|
+
* uses. The element's code loads when the viewer mounts, and pdf.js loads only when a PDF opens.
|
|
59
|
+
*
|
|
60
|
+
* The viewer fills the box its parent gives it; the theme gives it a default height.
|
|
61
|
+
*
|
|
62
|
+
* ```jsx
|
|
63
|
+
* const viewer = useRef(null);
|
|
64
|
+
* <AppButton onClick={() => viewer.current.seekTo(30)}>Jump to 0:30</AppButton>
|
|
65
|
+
* <AppFileViewer ref={viewer} src="/files/briefing.mp4" />
|
|
66
|
+
*
|
|
67
|
+
* <AppFileViewer
|
|
68
|
+
* src="/files/contract.pdf"
|
|
69
|
+
* name="Contract.pdf"
|
|
70
|
+
* download
|
|
71
|
+
* actions={<AppButton size="sm">Approve</AppButton>}
|
|
72
|
+
* onError={(detail) => console.warn(detail.message)}
|
|
73
|
+
* />
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @param props
|
|
77
|
+
* @param [props.src]
|
|
78
|
+
* @param [props.name]
|
|
79
|
+
* @param [props.type]
|
|
80
|
+
* @param [props.prefs]
|
|
81
|
+
* @param [props.onPrefsChange] Called with all the view settings whenever the reader
|
|
82
|
+
* changes one (zoom, two-page view, thumbnails, volume, speed).
|
|
83
|
+
* @param [props.viewKey]
|
|
84
|
+
* @param [props.download]
|
|
85
|
+
* @param [props.print]
|
|
86
|
+
* @param [props.workerSrc]
|
|
87
|
+
* @param [props.captions]
|
|
88
|
+
* @param [props.assetBase]
|
|
89
|
+
* @param [props.actions]
|
|
90
|
+
* @param [props.onLoad] Called once the file shows, with its kind and page count.
|
|
91
|
+
* @param [props.onError] Called when the file cannot be opened.
|
|
92
|
+
* @param [props.className]
|
|
93
|
+
* @param [props.style] Inline style; lands on the element with `className`. Set a height here to size the viewer; a height here also lifts the 420 px minimum.
|
|
94
|
+
* @param [ref] The `<wui-file-viewer>` element. For a video or audio file,
|
|
95
|
+
* `ref.current.seekTo(seconds)` moves the player to that point, kept within the file's length, and returns
|
|
96
|
+
* true; with no video or audio open (another kind of file, or before `onLoad`) it does nothing and returns
|
|
97
|
+
* false. Anything but a finite number of seconds throws.
|
|
98
|
+
*/
|
|
99
|
+
declare function AppFileViewer({ ref, ...props }: AppFileViewerProps): JSX.Element;
|
|
52
100
|
export default AppFileViewer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UnsavedChangesGuard } from "@webority/web-core/router";
|
|
2
|
-
import { type ComponentPropsWithRef, type JSX, type ReactNode, type SubmitEvent } from "react";
|
|
2
|
+
import { type ComponentPropsWithRef, type Context, type JSX, type ReactNode, type SubmitEvent } from "react";
|
|
3
3
|
export interface AppFormSubmitContext {
|
|
4
4
|
/** One key per send; a new one is made only after onSubmit returns true or "answered". */
|
|
5
5
|
idempotencyKey: string;
|
|
@@ -38,6 +38,6 @@ export interface FormSubmitState {
|
|
|
38
38
|
idempotencyKey: string;
|
|
39
39
|
}
|
|
40
40
|
/** The enclosing AppForm's state, or null outside one. Internal: AppButton reads it; not exported from the package. */
|
|
41
|
-
export declare const FormSubmitContext:
|
|
41
|
+
export declare const FormSubmitContext: Context<FormSubmitState | null>;
|
|
42
42
|
export declare function useFormSubmit(): FormSubmitState;
|
|
43
43
|
export default function AppForm(props: AppFormProps): JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
1
|
+
import type { ComponentPropsWithoutRef, JSX, ReactNode } from "react";
|
|
2
2
|
export interface AppFormSectionProps extends Omit<ComponentPropsWithoutRef<"section">, "children" | "className" | "title"> {
|
|
3
3
|
/** The form fields. */
|
|
4
4
|
children: ReactNode;
|
|
@@ -52,4 +52,4 @@ export interface AppFormSectionProps extends Omit<ComponentPropsWithoutRef<"sect
|
|
|
52
52
|
* heading is outside so it stacks above the first field without wrapping it.
|
|
53
53
|
* Consecutive sections are set apart by space and a light rule.
|
|
54
54
|
*/
|
|
55
|
-
export default function AppFormSection(props: AppFormSectionProps):
|
|
55
|
+
export default function AppFormSection(props: AppFormSectionProps): JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type * as React from "react";
|
|
2
|
+
import { type Ref } from "react";
|
|
2
3
|
export interface AppInputPasswordPolicy {
|
|
3
4
|
/** The minimum number of characters. */
|
|
4
5
|
minLength?: number | undefined;
|
|
@@ -191,6 +192,17 @@ export interface AppInputProps extends Omit<React.ComponentPropsWithoutRef<"inpu
|
|
|
191
192
|
/** Called on each input, with the field as displayed. */
|
|
192
193
|
onInput?: ((e: React.InputEvent<HTMLInputElement>) => void) | undefined;
|
|
193
194
|
onClick?: ((e: React.MouseEvent<HTMLInputElement>) => void) | undefined;
|
|
195
|
+
ref?: Ref<HTMLInputElement> | undefined;
|
|
194
196
|
}
|
|
195
|
-
|
|
197
|
+
/**
|
|
198
|
+
* The shared text field, wrapping react-bootstrap Form.Group / Form.Label / Form.Control.
|
|
199
|
+
* Visual chrome is Bootstrap `.form-control` (theme `$input-*` + one post-CSS skin);
|
|
200
|
+
* `.input` is an alias on the same element for size/shell hooks (`.wui-input-sm`,
|
|
201
|
+
* `.input-icon`, …), not a second look. Shells: unit, password reveal, leading icon,
|
|
202
|
+
* trailing action.
|
|
203
|
+
*
|
|
204
|
+
* Forwards `ref` to the underlying control, so react-hook-form's spread `{...register("name")}`
|
|
205
|
+
* works unchanged, as does a controlled `value`/`onChange` pair.
|
|
206
|
+
*/
|
|
207
|
+
declare function AppInput({ ref, ...props }: AppInputProps): React.JSX.Element;
|
|
196
208
|
export default AppInput;
|
|
@@ -127,6 +127,7 @@ export interface AppLeadPopupProps {
|
|
|
127
127
|
*/
|
|
128
128
|
className?: string | undefined;
|
|
129
129
|
style?: CSSProperties | undefined;
|
|
130
|
+
ref?: React.Ref<AppLeadPopupElement> | undefined;
|
|
130
131
|
}
|
|
131
132
|
/**
|
|
132
133
|
* The centre lead box: a modal form that asks a visitor for their details, posted through the
|
|
@@ -163,5 +164,5 @@ export interface AppLeadPopupProps {
|
|
|
163
164
|
* @param onClosed
|
|
164
165
|
* @param style Inline style; lands on the element with `className`.
|
|
165
166
|
*/
|
|
166
|
-
declare
|
|
167
|
+
declare function AppLeadPopup({ ref, ...props }: AppLeadPopupProps): React.JSX.Element;
|
|
167
168
|
export default AppLeadPopup;
|
|
@@ -2,6 +2,8 @@ import type * as React from "react";
|
|
|
2
2
|
export interface AppLightboxItem {
|
|
3
3
|
src: string;
|
|
4
4
|
thumb?: string | undefined;
|
|
5
|
+
thumbWidth?: number | undefined;
|
|
6
|
+
thumbHeight?: number | undefined;
|
|
5
7
|
alt?: string | undefined;
|
|
6
8
|
caption?: string | undefined;
|
|
7
9
|
name?: string | undefined;
|
|
@@ -94,6 +94,7 @@ export interface AppMentionInputProps extends Omit<React.HTMLAttributes<HTMLElem
|
|
|
94
94
|
* @default ""
|
|
95
95
|
*/
|
|
96
96
|
fieldClassName?: string | undefined;
|
|
97
|
+
ref?: React.Ref<HTMLElement> | undefined;
|
|
97
98
|
}
|
|
98
99
|
/**
|
|
99
100
|
* A text box where "@" opens a list of people to mention. Up and Down choose, Enter or Tab
|
|
@@ -107,5 +108,6 @@ export interface AppMentionInputProps extends Omit<React.HTMLAttributes<HTMLElem
|
|
|
107
108
|
*
|
|
108
109
|
* Wraps the shared `<wui-mention-input>` element; Razor `<app-mention-input>` renders the same box.
|
|
109
110
|
*/
|
|
110
|
-
|
|
111
|
+
/** The `<wui-mention-input>` element. */
|
|
112
|
+
declare function AppMentionInput({ ref, ...props }: AppMentionInputProps): React.JSX.Element;
|
|
111
113
|
export default AppMentionInput;
|
|
@@ -84,6 +84,7 @@ export interface AppMonthPickerProps extends Omit<React.HTMLAttributes<HTMLEleme
|
|
|
84
84
|
* @default ""
|
|
85
85
|
*/
|
|
86
86
|
fieldClassName?: string | undefined;
|
|
87
|
+
ref?: React.Ref<HTMLElement> | undefined;
|
|
87
88
|
}
|
|
88
89
|
/**
|
|
89
90
|
* Thin React wrapper over the shared `<wui-datepicker mode="month">` element: a month-only
|
|
@@ -93,5 +94,5 @@ export interface AppMonthPickerProps extends Omit<React.HTMLAttributes<HTMLEleme
|
|
|
93
94
|
* error, the same as `<app-month-picker>` and every other field primitive.
|
|
94
95
|
* The shell is omitted entirely when there is nothing to render around the control.
|
|
95
96
|
*/
|
|
96
|
-
declare
|
|
97
|
+
declare function AppMonthPicker({ ref, ...props }: AppMonthPickerProps): React.ReactElement;
|
|
97
98
|
export default AppMonthPicker;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef, type ReactNode } from "react";
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ReactElement, type ReactNode, type Ref } from "react";
|
|
2
2
|
declare const SIZES: readonly ["sm", "md", "lg", "xl"];
|
|
3
3
|
declare const GROUPINGS: readonly ["none", "indian"];
|
|
4
4
|
export type AppNumberInputSize = (typeof SIZES)[number];
|
|
@@ -108,6 +108,8 @@ export interface AppNumberInputProps extends Omit<ComponentPropsWithoutRef<"inpu
|
|
|
108
108
|
controlOnly?: boolean | undefined;
|
|
109
109
|
/** The starting value of an uncontrolled field. */
|
|
110
110
|
defaultValue?: number | null | undefined;
|
|
111
|
+
/** The input element, for focus and for reading its value. */
|
|
112
|
+
ref?: Ref<HTMLInputElement> | undefined;
|
|
111
113
|
[attribute: `data-${string}`]: unknown;
|
|
112
114
|
}
|
|
113
115
|
/**
|
|
@@ -129,5 +131,5 @@ export interface AppNumberInputProps extends Omit<ComponentPropsWithoutRef<"inpu
|
|
|
129
131
|
* - Rounding to the specified precision
|
|
130
132
|
* - Buttons disabled at min/max or when the control is disabled
|
|
131
133
|
*/
|
|
132
|
-
declare
|
|
134
|
+
declare function AppNumberInput({ ref, ...props }: AppNumberInputProps): ReactElement;
|
|
133
135
|
export default AppNumberInput;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as React from "react";
|
|
2
|
-
import { type
|
|
2
|
+
import { type Ref } from "react";
|
|
3
3
|
export interface AppOtpInputProps extends Omit<React.HTMLAttributes<HTMLElement>, "onChange" | "defaultValue" | "id" | "className"> {
|
|
4
4
|
/** The code entered so far. The field is controlled, so pair it with onChange. */
|
|
5
5
|
value?: string | undefined;
|
|
@@ -94,6 +94,21 @@ export interface AppOtpInputProps extends Omit<React.HTMLAttributes<HTMLElement>
|
|
|
94
94
|
* @default ""
|
|
95
95
|
*/
|
|
96
96
|
fieldClassName?: string | undefined;
|
|
97
|
+
ref?: Ref<HTMLElement> | undefined;
|
|
97
98
|
}
|
|
98
|
-
|
|
99
|
+
/**
|
|
100
|
+
* Code entry: MFA, email/phone verification, backup codes. Thin React wrapper over the
|
|
101
|
+
* shared `<wui-otp>` element, in the standard `.field` shell.
|
|
102
|
+
*
|
|
103
|
+
* It is ONE input with the segment boxes drawn underneath, not N inputs. That is what makes
|
|
104
|
+
* OS autofill work (iOS/Android hand an SMS code to the focused field, whole; six inputs
|
|
105
|
+
* get all six digits in box one or just the first, depending on version) and what makes a
|
|
106
|
+
* screen reader announce one labelled field instead of six unlabelled boxes. Paste is not a
|
|
107
|
+
* special case for the same reason.
|
|
108
|
+
*
|
|
109
|
+
* Scope is the INPUT, not the screen: resend timers, "didn't get a code" copy, masked
|
|
110
|
+
* destination text, lockout after N attempts and where to go on success are all product
|
|
111
|
+
* decisions and stay in the product.
|
|
112
|
+
*/
|
|
113
|
+
declare function AppOtpInput({ ref, ...props }: AppOtpInputProps): React.JSX.Element;
|
|
99
114
|
export default AppOtpInput;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as React from "react";
|
|
2
|
-
import { type
|
|
2
|
+
import { type Ref } from "react";
|
|
3
3
|
export interface AppPhoneNumberInputProps extends Omit<React.HTMLAttributes<HTMLElement>, "onChange" | "defaultValue" | "id" | "className"> {
|
|
4
4
|
/** The phone number as entered. */
|
|
5
5
|
value?: string | undefined;
|
|
@@ -84,6 +84,11 @@ export interface AppPhoneNumberInputProps extends Omit<React.HTMLAttributes<HTML
|
|
|
84
84
|
fieldClassName?: string | undefined;
|
|
85
85
|
/** Extra classes on the phone control itself, not on the field wrapper. */
|
|
86
86
|
className?: string | undefined;
|
|
87
|
+
/** Receives the `<wui-phone>` element. */
|
|
88
|
+
ref?: Ref<HTMLElement> | undefined;
|
|
87
89
|
}
|
|
88
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Thin React wrapper over the shared <wui-phone> element (single implementation). Same App* API.
|
|
92
|
+
*/
|
|
93
|
+
declare function AppPhoneNumberInput({ ref, ...props }: AppPhoneNumberInputProps): React.JSX.Element;
|
|
89
94
|
export default AppPhoneNumberInput;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type QueryBuilderText } from "@webority/ui-elements/text";
|
|
2
|
-
import { type ComponentPropsWithoutRef } from "react";
|
|
2
|
+
import { type ComponentPropsWithoutRef, type JSX, type Ref } from "react";
|
|
3
3
|
import { type QueryField, type QueryGroup } from "../lib/queryBuilder/queryTypes.ts";
|
|
4
4
|
export type AppQueryBuilderField = QueryField;
|
|
5
5
|
export interface AppQueryBuilderProps extends Partial<QueryBuilderText>, Omit<ComponentPropsWithoutRef<"div">, "defaultValue" | "onChange"> {
|
|
@@ -28,10 +28,11 @@ export interface AppQueryBuilderProps extends Partial<QueryBuilderText>, Omit<Co
|
|
|
28
28
|
* @default ""
|
|
29
29
|
*/
|
|
30
30
|
className?: string | undefined;
|
|
31
|
+
ref?: Ref<HTMLDivElement> | undefined;
|
|
31
32
|
}
|
|
32
33
|
/**
|
|
33
34
|
* Builds a rule of conditions and nested match-all or match-any groups in a panel. Nothing is reported until the
|
|
34
35
|
* person applies it.
|
|
35
36
|
*/
|
|
36
|
-
declare
|
|
37
|
+
declare function AppQueryBuilder({ ref, ...props }: AppQueryBuilderProps): JSX.Element;
|
|
37
38
|
export default AppQueryBuilder;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactElement, ReactNode, Ref } from "react";
|
|
2
2
|
export interface AppRadioProps extends Omit<ComponentPropsWithoutRef<"input">, "size"> {
|
|
3
3
|
/** The visible label beside the radio. */
|
|
4
4
|
label?: ReactNode | undefined;
|
|
@@ -50,6 +50,15 @@ export interface AppRadioProps extends Omit<ComponentPropsWithoutRef<"input">, "
|
|
|
50
50
|
* @default false
|
|
51
51
|
*/
|
|
52
52
|
controlOnly?: boolean | undefined;
|
|
53
|
+
ref?: Ref<HTMLInputElement> | undefined;
|
|
53
54
|
}
|
|
54
|
-
|
|
55
|
+
/**
|
|
56
|
+
* Shared radio on the Bootstrap `.form-check` markup, the same structure the
|
|
57
|
+
* Razor <app-radio> emits, so both surfaces render identically.
|
|
58
|
+
*
|
|
59
|
+
* The label is bound to the input with id/htmlFor rather than react-bootstrap's
|
|
60
|
+
* `label` prop: that rendered a <label> with no `for`, so clicking the text did
|
|
61
|
+
* nothing and screen readers never announced the name.
|
|
62
|
+
*/
|
|
63
|
+
declare function AppRadio({ ref, ...props }: AppRadioProps): ReactElement;
|
|
55
64
|
export default AppRadio;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
1
|
+
import type { ComponentPropsWithoutRef, JSX, ReactNode } from "react";
|
|
2
2
|
type ResultStatus = "success" | "error" | "warning" | "info" | "403" | "404" | "500";
|
|
3
3
|
export interface AppResultProps extends Omit<ComponentPropsWithoutRef<"div">, "title" | "children" | "className"> {
|
|
4
4
|
/**
|
|
@@ -35,5 +35,5 @@ export interface AppResultProps extends Omit<ComponentPropsWithoutRef<"div">, "t
|
|
|
35
35
|
*
|
|
36
36
|
* The card lays its parts in a column, so a `gap` style on it spaces them.
|
|
37
37
|
*/
|
|
38
|
-
export default function AppResult(props: AppResultProps):
|
|
38
|
+
export default function AppResult(props: AppResultProps): JSX.Element;
|
|
39
39
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type HTMLAttributes, type ReactNode } from "react";
|
|
1
|
+
import { type HTMLAttributes, type JSX, type ReactNode, type Ref } from "react";
|
|
2
2
|
export interface AppRichTextProps extends Omit<HTMLAttributes<HTMLElement>, "defaultValue" | "onChange" | "className" | "placeholder"> {
|
|
3
3
|
/** The content, in `format`. */
|
|
4
4
|
value?: string | undefined;
|
|
@@ -59,6 +59,7 @@ export interface AppRichTextProps extends Omit<HTMLAttributes<HTMLElement>, "def
|
|
|
59
59
|
* @default "More information"
|
|
60
60
|
*/
|
|
61
61
|
helpLabel?: string | undefined;
|
|
62
|
+
ref?: Ref<HTMLElement> | undefined;
|
|
62
63
|
}
|
|
63
64
|
/**
|
|
64
65
|
* A formatted-text field: a toolbar (bold, italic, inline code, link, headings, lists, quote, code
|
|
@@ -82,5 +83,5 @@ export interface AppRichTextProps extends Omit<HTMLAttributes<HTMLElement>, "def
|
|
|
82
83
|
*
|
|
83
84
|
* The ref is the `<wui-rich-text>` element.
|
|
84
85
|
*/
|
|
85
|
-
declare
|
|
86
|
+
declare function AppRichText({ ref, ...props }: AppRichTextProps): JSX.Element;
|
|
86
87
|
export default AppRichText;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
1
|
+
import type { ComponentPropsWithoutRef, JSX, ReactNode } from "react";
|
|
2
2
|
export type RouteErrorKind = "error" | "stale-build" | "not-found";
|
|
3
3
|
export interface AppRouteErrorProps extends Omit<ComponentPropsWithoutRef<"div">, "children" | "className"> {
|
|
4
4
|
/**
|
|
@@ -82,4 +82,4 @@ export interface AppRouteErrorProps extends Omit<ComponentPropsWithoutRef<"div">
|
|
|
82
82
|
* The home link is a plain link (a full page load), so the screen also works where no router
|
|
83
83
|
* is mounted, above it in the root error boundary.
|
|
84
84
|
*/
|
|
85
|
-
export default function AppRouteError(props: AppRouteErrorProps):
|
|
85
|
+
export default function AppRouteError(props: AppRouteErrorProps): JSX.Element;
|
|
@@ -262,6 +262,8 @@ interface AppSelectBaseProps {
|
|
|
262
262
|
autoFocus?: boolean | undefined;
|
|
263
263
|
/** The id of the form the control belongs to. */
|
|
264
264
|
form?: string | undefined;
|
|
265
|
+
/** Receives the `<wui-select>` element. */
|
|
266
|
+
ref?: React.Ref<WuiSelectElement> | undefined;
|
|
265
267
|
}
|
|
266
268
|
export interface AppSelectSingleProps extends AppSelectBaseProps {
|
|
267
269
|
/**
|
|
@@ -306,5 +308,5 @@ export type AppSelectProps = AppSelectSingleProps | AppSelectMultipleProps;
|
|
|
306
308
|
* modes only. A floating label, `prefix` and `suffix` are drawn in single, search and country
|
|
307
309
|
* only; in multiple and tag they are ignored with a dev warning.
|
|
308
310
|
*/
|
|
309
|
-
declare
|
|
311
|
+
declare function AppSelect({ ref, ...props }: AppSelectProps): React.JSX.Element;
|
|
310
312
|
export default AppSelect;
|
|
@@ -156,6 +156,22 @@ export interface AppShellProps extends Omit<React.ComponentPropsWithoutRef<"div"
|
|
|
156
156
|
markLight?: string | undefined;
|
|
157
157
|
/** Dark-mode twin of markLight. */
|
|
158
158
|
markDark?: string | undefined;
|
|
159
|
+
/** Pixel width of the full logo on the open sidebar, set on its img. Give the size with the file to reserve its space before it loads. Unset, the image keeps its own size. */
|
|
160
|
+
logoLightWidth?: number | undefined;
|
|
161
|
+
/** Pixel height of the full logo on the open sidebar, set on its img. Unset, the image keeps its own size. */
|
|
162
|
+
logoLightHeight?: number | undefined;
|
|
163
|
+
/** Pixel width of the dark-mode logo, set on its img. Unset, the image keeps its own size. */
|
|
164
|
+
logoDarkWidth?: number | undefined;
|
|
165
|
+
/** Pixel height of the dark-mode logo, set on its img. Unset, the image keeps its own size. */
|
|
166
|
+
logoDarkHeight?: number | undefined;
|
|
167
|
+
/** Pixel width of the square mark on the collapsed rail, set on its img. Unset, the image keeps its own size. */
|
|
168
|
+
markLightWidth?: number | undefined;
|
|
169
|
+
/** Pixel height of the square mark on the collapsed rail, set on its img. Unset, the image keeps its own size. */
|
|
170
|
+
markLightHeight?: number | undefined;
|
|
171
|
+
/** Pixel width of the dark-mode mark, set on its img. Unset, the image keeps its own size. */
|
|
172
|
+
markDarkWidth?: number | undefined;
|
|
173
|
+
/** Pixel height of the dark-mode mark, set on its img. Unset, the image keeps its own size. */
|
|
174
|
+
markDarkHeight?: number | undefined;
|
|
159
175
|
/** The brand name, read by screen readers from the logo, or from the mark when there is no logo. */
|
|
160
176
|
brandName?: string | undefined;
|
|
161
177
|
/** Makes the logo row a link to this address, through linkComponent when one is passed. The link wraps the logo, mark and brand, so brand must hold no link of its own. Needs brandLabel or brandName. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CSSProperties, type ReactNode } from "react";
|
|
1
|
+
import { type CSSProperties, type JSX, type ReactNode, type Ref } from "react";
|
|
2
2
|
interface AppSliderBaseProps {
|
|
3
3
|
/**
|
|
4
4
|
* Lowest value the slider can take.
|
|
@@ -87,6 +87,8 @@ interface AppSliderBaseProps {
|
|
|
87
87
|
* @default "(optional)"
|
|
88
88
|
*/
|
|
89
89
|
optionalLabel?: string | undefined;
|
|
90
|
+
/** Receives the `<wui-slider>` element. */
|
|
91
|
+
ref?: Ref<HTMLElement> | undefined;
|
|
90
92
|
}
|
|
91
93
|
/** Single-thumb mode (the default): `value` and `onChange` take a number. */
|
|
92
94
|
export interface AppSliderSingleProps extends AppSliderBaseProps {
|
|
@@ -133,5 +135,5 @@ export type AppSliderProps = AppSliderSingleProps | AppSliderRangeProps;
|
|
|
133
135
|
* Wraps it in the standard `.field` shell: label / required mark / helper text / error.
|
|
134
136
|
* The shell is omitted entirely when there is nothing to render around the control.
|
|
135
137
|
*/
|
|
136
|
-
declare
|
|
138
|
+
declare function AppSlider(props: AppSliderProps): JSX.Element;
|
|
137
139
|
export default AppSlider;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
1
|
+
import { type JSX, type ReactNode, type Ref } from "react";
|
|
2
2
|
export interface AppSortableItem {
|
|
3
3
|
id: string;
|
|
4
4
|
label: string;
|
|
@@ -64,6 +64,8 @@ export interface AppSortableListProps {
|
|
|
64
64
|
* @default "Reorder {name}"
|
|
65
65
|
*/
|
|
66
66
|
reorderLabel?: string | undefined;
|
|
67
|
+
/** Receives the `<wui-sortable>` element. */
|
|
68
|
+
ref?: Ref<HTMLElement> | undefined;
|
|
67
69
|
}
|
|
68
70
|
/**
|
|
69
71
|
* A list whose items the person reorders: drag with a mouse or a finger (the list scrolls when
|
|
@@ -75,5 +77,5 @@ export interface AppSortableListProps {
|
|
|
75
77
|
* Lists that share a `group` accept each other's items by pointer drag. Each list then reports
|
|
76
78
|
* its own new order, so the parent moves the item from one `items` array to the other.
|
|
77
79
|
*/
|
|
78
|
-
declare
|
|
80
|
+
declare function AppSortableList({ ref, ...props }: AppSortableListProps): JSX.Element;
|
|
79
81
|
export default AppSortableList;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ComponentPropsWithoutRef, JSX, ReactNode, Ref } from "react";
|
|
2
2
|
export interface AppSwitchProps extends Omit<ComponentPropsWithoutRef<"input">, "size"> {
|
|
3
3
|
/** The text shown beside the switch. It is a real label tied to the input. */
|
|
4
4
|
label?: ReactNode | undefined;
|
|
@@ -38,6 +38,7 @@ export interface AppSwitchProps extends Omit<ComponentPropsWithoutRef<"input">,
|
|
|
38
38
|
* @default ""
|
|
39
39
|
*/
|
|
40
40
|
className?: string | undefined;
|
|
41
|
+
ref?: Ref<HTMLInputElement> | undefined;
|
|
41
42
|
}
|
|
42
43
|
/**
|
|
43
44
|
* Shared toggle switch: `.form-check .form-switch`, matching the Razor
|
|
@@ -45,5 +46,5 @@ export interface AppSwitchProps extends Omit<ComponentPropsWithoutRef<"input">,
|
|
|
45
46
|
*
|
|
46
47
|
* `label` renders a real, associated <label>.
|
|
47
48
|
*/
|
|
48
|
-
declare
|
|
49
|
+
declare function AppSwitch({ ref, ...props }: AppSwitchProps): JSX.Element;
|
|
49
50
|
export default AppSwitch;
|