@webority/ui-react 0.174.1 → 0.175.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/package.json +8 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef, type
|
|
1
|
+
import { type ComponentPropsWithoutRef, type JSX, type ReactNode, type Ref } from "react";
|
|
2
2
|
export interface AppTextareaProps extends ComponentPropsWithoutRef<"textarea"> {
|
|
3
3
|
/** The label above the field. */
|
|
4
4
|
label?: ReactNode | undefined;
|
|
@@ -67,6 +67,7 @@ export interface AppTextareaProps extends ComponentPropsWithoutRef<"textarea"> {
|
|
|
67
67
|
* @default false
|
|
68
68
|
*/
|
|
69
69
|
controlOnly?: boolean | undefined;
|
|
70
|
+
ref?: Ref<HTMLTextAreaElement> | undefined;
|
|
70
71
|
}
|
|
71
72
|
/**
|
|
72
73
|
* The shared multi-line field: the textarea counterpart to AppInput. Wraps react-bootstrap
|
|
@@ -74,5 +75,5 @@ export interface AppTextareaProps extends ComponentPropsWithoutRef<"textarea"> {
|
|
|
74
75
|
* `.textarea` classes so the look is unchanged. Forwards `ref` for react-hook-form and
|
|
75
76
|
* controlled use alike.
|
|
76
77
|
*/
|
|
77
|
-
declare
|
|
78
|
+
declare function AppTextarea({ ref, ...props }: AppTextareaProps): JSX.Element;
|
|
78
79
|
export default AppTextarea;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactElement, ReactNode, Ref } from "react";
|
|
2
2
|
export interface AppTimePickerProps extends Omit<ComponentPropsWithoutRef<"div">, "onChange" | "defaultValue" | "placeholder" | "id" | "className"> {
|
|
3
3
|
/** The time as 24-hour "HH:mm" text, which is also the wire format. */
|
|
4
4
|
value?: string | undefined;
|
|
@@ -79,6 +79,23 @@ export interface AppTimePickerProps extends Omit<ComponentPropsWithoutRef<"div">
|
|
|
79
79
|
* @default ""
|
|
80
80
|
*/
|
|
81
81
|
fieldClassName?: string | undefined;
|
|
82
|
+
ref?: Ref<HTMLElement> | undefined;
|
|
82
83
|
}
|
|
83
|
-
|
|
84
|
+
/**
|
|
85
|
+
* Thin React wrapper over the shared `<wui-timepicker>` element (single
|
|
86
|
+
* implementation, so React and Razor render the same control).
|
|
87
|
+
*
|
|
88
|
+
* Wraps it in the standard `.field` shell: label / required mark / helper
|
|
89
|
+
* text / error, the same as `AppDatePicker` and every other field primitive.
|
|
90
|
+
* Without that a caller had to hand-roll the label, which is exactly the
|
|
91
|
+
* per-screen divergence this library exists to prevent. The shell is omitted
|
|
92
|
+
* entirely when there is nothing to render around the control.
|
|
93
|
+
*
|
|
94
|
+
* @param props.optional Ends the label with "(optional)". Required wins when both are set.
|
|
95
|
+
* @param props.optionalLabel Default "(optional)". Replaces the built-in English text, for other languages.
|
|
96
|
+
* @param props.readOnly Shows the value but blocks editing. The value still posts.
|
|
97
|
+
* @param props.loading Shows a busy state and blocks input while data loads.
|
|
98
|
+
* @param props.defaultValue The starting value of an uncontrolled field.
|
|
99
|
+
*/
|
|
100
|
+
declare function AppTimePicker(props: AppTimePickerProps): ReactElement;
|
|
84
101
|
export default AppTimePicker;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef } from "react";
|
|
1
|
+
import type { ComponentPropsWithoutRef, JSX, Ref } from "react";
|
|
2
2
|
export type AppTourCloseReason = "finished" | "skipped" | "alreadySeen" | "noTargets" | "next";
|
|
3
3
|
export interface AppTourCloseDetails {
|
|
4
4
|
index: number | null;
|
|
@@ -66,6 +66,32 @@ export interface AppTourProps extends Omit<ComponentPropsWithoutRef<"div">, "chi
|
|
|
66
66
|
endNextHref?: string | undefined;
|
|
67
67
|
/** Extra class names on the tour element. */
|
|
68
68
|
className?: string | undefined;
|
|
69
|
+
ref?: Ref<HTMLElement> | undefined;
|
|
69
70
|
}
|
|
70
|
-
|
|
71
|
+
/**
|
|
72
|
+
* A step-by-step product tour over the shared `<wui-tour>` element: the page is dimmed except
|
|
73
|
+
* around the step's target, and a card holds the step text with Back, Next and Skip. Steps are
|
|
74
|
+
* data, anchored to elements by CSS selector. A step whose target is missing or hidden is
|
|
75
|
+
* dropped.
|
|
76
|
+
*
|
|
77
|
+
* Accessibility: focus moves into the card on open, stays there while the tour runs, and returns
|
|
78
|
+
* to where it was on close; each step is announced; Escape skips the tour; the arrow keys move
|
|
79
|
+
* between steps, except while focus is in a field. On a phone the card sits on the side of the
|
|
80
|
+
* target with room and never covers it. After the last step a closing dialog says the tour is
|
|
81
|
+
* done (`endDialog={false}` leaves it out); Escape there closes the tour as `finished`. With
|
|
82
|
+
* `labels.endNextLabel` and `endNextHref` both set, the dialog also offers a next step: it closes the tour with reason
|
|
83
|
+
* `next` and then follows `endNextHref`.
|
|
84
|
+
*
|
|
85
|
+
* Set `open` to run the tour and set it back to false from `onClose`. Pass a `seenStore` to
|
|
86
|
+
* remember that a person has seen it: it is asked before showing and written when the tour
|
|
87
|
+
* finishes or is skipped, with that outcome. `createLocalSeenStore()` (from
|
|
88
|
+
* `@webority/ui-elements`) keeps that in the browser; a product that keeps it on its server
|
|
89
|
+
* passes its own `{ isSeen, markSeen }`.
|
|
90
|
+
*
|
|
91
|
+
* The element also raises bubbling events a product can listen for on the ref:
|
|
92
|
+
* `wui-tour:start` { total }, `wui-tour:step` { step, index, position, total } and
|
|
93
|
+
* `wui-tour:close` { reason, index, position, total, via }, where `via` is `button` or `escape`
|
|
94
|
+
* on a skip.
|
|
95
|
+
*/
|
|
96
|
+
declare function AppTour({ ref, ...props }: AppTourProps): JSX.Element;
|
|
71
97
|
export default AppTour;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef, type ReactNode } from "react";
|
|
1
|
+
import { type ComponentPropsWithoutRef, type JSX, type ReactNode, type Ref } from "react";
|
|
2
2
|
import { type TransferItem } from "../lib/transferList/transferState.ts";
|
|
3
3
|
export type AppTransferListItem = TransferItem;
|
|
4
4
|
export interface AppTransferListProps extends Omit<ComponentPropsWithoutRef<"div">, "onChange" | "defaultValue"> {
|
|
@@ -120,6 +120,8 @@ export interface AppTransferListProps extends Omit<ComponentPropsWithoutRef<"div
|
|
|
120
120
|
className?: string | undefined;
|
|
121
121
|
/** Names the group when there is no label. */
|
|
122
122
|
ariaLabel?: string | undefined;
|
|
123
|
+
/** Receives the list's root `<div>`. */
|
|
124
|
+
ref?: Ref<HTMLDivElement> | undefined;
|
|
123
125
|
}
|
|
124
126
|
/**
|
|
125
127
|
* Two lists side by side: rows move between Available and Chosen with a button, Enter, or a lifted
|
|
@@ -127,5 +129,5 @@ export interface AppTransferListProps extends Omit<ComponentPropsWithoutRef<"div
|
|
|
127
129
|
* The value is the ordered list of chosen ids.
|
|
128
130
|
* React-only: it has no custom element, so a server-rendered page uses a form control instead.
|
|
129
131
|
*/
|
|
130
|
-
declare
|
|
132
|
+
declare function AppTransferList({ ref, ...props }: AppTransferListProps): JSX.Element;
|
|
131
133
|
export default AppTransferList;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode, Ref } from "react";
|
|
2
2
|
export type AppTreePickerSelection = "single" | "multiple";
|
|
3
3
|
export type AppTreePickerNode = {
|
|
4
4
|
id: string;
|
|
@@ -80,6 +80,7 @@ export interface AppTreePickerProps extends Omit<ComponentPropsWithoutRef<"div">
|
|
|
80
80
|
searchPlaceholder?: string | undefined;
|
|
81
81
|
/** Count line; {n} is the number chosen. */
|
|
82
82
|
selectedText?: string | undefined;
|
|
83
|
+
ref?: Ref<HTMLElement> | undefined;
|
|
83
84
|
}
|
|
84
85
|
/**
|
|
85
86
|
* A form field that picks leaves from a hierarchy: a searchable tree beside a list of what is
|
|
@@ -88,5 +89,5 @@ export interface AppTreePickerProps extends Omit<ComponentPropsWithoutRef<"div">
|
|
|
88
89
|
* value. Multiple selection ticks leaves and parents (a parent ticks every enabled leaf under it);
|
|
89
90
|
* single selection picks one leaf. The Razor `<app-tree-picker>` renders the same element.
|
|
90
91
|
*/
|
|
91
|
-
declare
|
|
92
|
+
declare function AppTreePicker({ ref, ...props }: AppTreePickerProps): React.JSX.Element;
|
|
92
93
|
export default AppTreePicker;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef } from "react";
|
|
1
|
+
import type { ComponentPropsWithoutRef, Ref } from "react";
|
|
2
2
|
import type { AppBadgeProps } from "./AppBadge.tsx";
|
|
3
3
|
export type AppTreeViewSelection = "none" | "single" | "multiple";
|
|
4
4
|
export type AppTreeViewNode = {
|
|
@@ -59,6 +59,8 @@ export interface AppTreeViewProps extends Omit<ComponentPropsWithoutRef<"div">,
|
|
|
59
59
|
* @default ""
|
|
60
60
|
*/
|
|
61
61
|
className?: string | undefined;
|
|
62
|
+
/** Receives the `<wui-tree>` element. */
|
|
63
|
+
ref?: Ref<HTMLElement> | undefined;
|
|
62
64
|
}
|
|
63
65
|
/**
|
|
64
66
|
* Thin React wrapper over the shared `<wui-tree>` element: a hierarchy in the WAI-ARIA tree
|
|
@@ -80,5 +82,5 @@ export interface AppTreeViewProps extends Omit<ComponentPropsWithoutRef<"div">,
|
|
|
80
82
|
* scrolling parent (or the page), so give a long tree a scrolling parent with a fixed height; rows
|
|
81
83
|
* outside the view are not in the DOM.
|
|
82
84
|
*/
|
|
83
|
-
declare
|
|
85
|
+
declare function AppTreeView({ ref, ...props }: AppTreeViewProps): React.JSX.Element;
|
|
84
86
|
export default AppTreeView;
|
|
@@ -7,6 +7,8 @@ export interface WhatsNewEntry {
|
|
|
7
7
|
body?: string | undefined;
|
|
8
8
|
imageSrc?: string | undefined;
|
|
9
9
|
imageAlt?: string | undefined;
|
|
10
|
+
imageWidth?: number | undefined;
|
|
11
|
+
imageHeight?: number | undefined;
|
|
10
12
|
href?: string | undefined;
|
|
11
13
|
linkLabel?: string | undefined;
|
|
12
14
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef, type ReactNode } from "react";
|
|
1
|
+
import { type ComponentPropsWithoutRef, type JSX, type ReactNode, type Ref } from "react";
|
|
2
2
|
export type AppWizardStepStatus = "done" | "active" | "pending" | "error";
|
|
3
3
|
export type AppWizardTone = "primary" | "success" | "warning" | "danger" | "info";
|
|
4
4
|
export type AppWizardIconVariant = "linear" | "outline" | "bold" | "bulk" | "broken" | "twotone";
|
|
@@ -140,6 +140,20 @@ export interface AppWizardProps extends Omit<ComponentPropsWithoutRef<"div">, "c
|
|
|
140
140
|
* @default ""
|
|
141
141
|
*/
|
|
142
142
|
className?: string | undefined;
|
|
143
|
+
/** The `<wui-wizard>` element. */
|
|
144
|
+
ref?: Ref<HTMLElement> | undefined;
|
|
143
145
|
}
|
|
144
|
-
|
|
146
|
+
/**
|
|
147
|
+
* A multi-step flow over the shared `<wui-wizard>` element: a stepper progress
|
|
148
|
+
* header, one visible step panel at a time, and a sticky Back / Skip / Next / Finish
|
|
149
|
+
* footer. Give it `steps` metadata and one panel per step as children (in order).
|
|
150
|
+
*
|
|
151
|
+
* Uncontrolled by default (it owns the current step); pass `active` + `onStepChange`
|
|
152
|
+
* to drive it. `beforeNext` gates advancing and finishing: return `false` (or a rejecting
|
|
153
|
+
* promise) to block Next, or Finish on the last step, e.g. until a form validates. An
|
|
154
|
+
* `optional` step shows the Skip button.
|
|
155
|
+
*
|
|
156
|
+
* @param props The wizard props.
|
|
157
|
+
*/
|
|
158
|
+
declare function AppWizard({ ref, ...props }: AppWizardProps): JSX.Element;
|
|
145
159
|
export default AppWizard;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
|
+
import { type ReactElement, type Ref } from "react";
|
|
2
3
|
export interface AppYearPickerProps extends Omit<React.HTMLAttributes<HTMLElement>, "defaultValue" | "onChange" | "placeholder"> {
|
|
3
4
|
/** The chosen year as YYYY. */
|
|
4
5
|
value?: string | undefined;
|
|
@@ -79,6 +80,7 @@ export interface AppYearPickerProps extends Omit<React.HTMLAttributes<HTMLElemen
|
|
|
79
80
|
* @default ""
|
|
80
81
|
*/
|
|
81
82
|
fieldClassName?: string | undefined;
|
|
83
|
+
ref?: Ref<HTMLElement> | undefined;
|
|
82
84
|
}
|
|
83
85
|
/**
|
|
84
86
|
* Thin React wrapper over the shared `<wui-datepicker mode="year">` element: a year-only
|
|
@@ -88,5 +90,5 @@ export interface AppYearPickerProps extends Omit<React.HTMLAttributes<HTMLElemen
|
|
|
88
90
|
* error, the same as `<app-year-picker>` and every other field primitive.
|
|
89
91
|
* The shell is omitted entirely when there is nothing to render around the control.
|
|
90
92
|
*/
|
|
91
|
-
declare
|
|
93
|
+
declare function AppYearPicker({ ref, ...props }: AppYearPickerProps): ReactElement;
|
|
92
94
|
export default AppYearPicker;
|
|
@@ -6,11 +6,53 @@ export interface ToastPromiseMessages<T> {
|
|
|
6
6
|
success?: string | ((result: T) => string) | undefined;
|
|
7
7
|
error?: string | ((error: unknown) => string) | undefined;
|
|
8
8
|
}
|
|
9
|
+
/** The `toast` function with `toast.promise` attached. */
|
|
10
|
+
export interface ToastFunction {
|
|
11
|
+
(message: ReactNode, variantOrOptions?: string | ToastOptions): void;
|
|
12
|
+
promise<T>(promise: Promise<T>, messages: ToastPromiseMessages<T>, opts?: ToastOptions): Promise<T>;
|
|
13
|
+
}
|
|
9
14
|
/** Clear every toast at once, e.g. on route change or logout. */
|
|
10
15
|
export declare function dismissAll(): void;
|
|
11
|
-
export declare function toast(message: ReactNode, variantOrOptions?: string | ToastOptions): void;
|
|
12
|
-
export declare namespace toast {
|
|
13
|
-
var promise: <T>(promise: Promise<T>, messages: ToastPromiseMessages<T>, opts?: ToastOptions) => Promise<T>;
|
|
14
|
-
}
|
|
15
16
|
/** Failure toast: red danger tone. De-duped by message so the same backend error shows once. */
|
|
16
17
|
export declare function errorToast(message: ReactNode, opts?: ToastOptions): void;
|
|
18
|
+
/**
|
|
19
|
+
* Toast notifications. Raise from anywhere (a component, a thunk, an axios interceptor), then
|
|
20
|
+
* render them by mounting <AppToast/> once near the app root. Built on react-bootstrap's
|
|
21
|
+
* Toast (the peer dependency) + the shared theme, so there is no separate toast library and no
|
|
22
|
+
* extra stylesheet to import.
|
|
23
|
+
*
|
|
24
|
+
* `message` is the toast content: a string, or a React node for a rich body (links, formatting).
|
|
25
|
+
* A node body is never string-deduped.
|
|
26
|
+
*
|
|
27
|
+
* `variantOrOptions` (default "info") is either a variant string OR an options object.
|
|
28
|
+
* Omitting it entirely, or passing an options object with no `variant`, both default to "info";
|
|
29
|
+
* the honest default for an unclassified message. Use `errorToast(msg)` for errors and pass
|
|
30
|
+
* "success" explicitly when the outcome is known good.
|
|
31
|
+
* - variant: "success"|"info"|"warning"|"danger" (default "info")
|
|
32
|
+
* - title: optional bold first line
|
|
33
|
+
* - duration: milliseconds before auto-dismiss (0 = sticky/persistent until dismissed; default 5000)
|
|
34
|
+
* - action: { label, onClick } - renders one action button inside the toast
|
|
35
|
+
* - id: string - same id replaces/refreshes any existing toast instead of stacking
|
|
36
|
+
* - animation: "rise"|"organic"|"jelly"|"spring" - entrance motion; overrides the
|
|
37
|
+
* <AppToast animation> host default (default "rise")
|
|
38
|
+
* - shape: "rounded"|"pill"|"sharp" - corner treatment; overrides the <AppToast shape>
|
|
39
|
+
* host default (default "rounded")
|
|
40
|
+
* - surface: "auto"|"inverse" - "inverse" renders the toast on the OPPOSITE surface of the
|
|
41
|
+
* active mode (a dark card in light mode, a light card in dark mode); overrides the
|
|
42
|
+
* <AppToast surface> host default (default "auto")
|
|
43
|
+
* - progress: number 0-100 - renders a determinate task-progress track + percent in the
|
|
44
|
+
* body (an upload, an export). Pair with duration: 0 and an id, then re-raise with the
|
|
45
|
+
* same id as the work advances - the toast updates in place.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* toast('Saved'); // info, auto-dismiss
|
|
49
|
+
* toast('Saved', 'success'); // success variant, explicit
|
|
50
|
+
* toast('Failed', 'danger'); // danger variant, string shorthand
|
|
51
|
+
* toast('Processing...', { duration: 0 }); // sticky until dismissed
|
|
52
|
+
* toast('Copy complete', { action: { label: 'Undo', onClick: () => undo() } });
|
|
53
|
+
* toast('Uploading...', { id: 'upload', duration: 0 }); // replaces any previous 'upload' toast
|
|
54
|
+
*
|
|
55
|
+
* Prefer semantic variants only; never pass brand hex. Use `errorToast(msg)` for failures
|
|
56
|
+
* (it raises variant "danger"; there is no "error" variant).
|
|
57
|
+
*/
|
|
58
|
+
export declare const toast: ToastFunction;
|
|
@@ -15,10 +15,11 @@ export interface CheckFieldProps {
|
|
|
15
15
|
loading?: boolean | undefined;
|
|
16
16
|
size?: "sm" | "md" | "lg" | undefined;
|
|
17
17
|
controlOnly?: boolean | undefined;
|
|
18
|
+
ref?: React.Ref<HTMLInputElement> | undefined;
|
|
18
19
|
}
|
|
19
20
|
/**
|
|
20
21
|
* Shared render logic for checkbox/radio/switch controls.
|
|
21
22
|
* @internal, not exported from the package barrel
|
|
22
23
|
*/
|
|
23
|
-
declare
|
|
24
|
+
declare function CheckField({ ref, label, id, name, error: ownError, hint, className, rest, inputType, wrapperClass, rootProps, readOnly, loading, size, controlOnly, }: CheckFieldProps): React.JSX.Element;
|
|
24
25
|
export default CheckField;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Context } from "react";
|
|
1
2
|
export interface FormFieldsState {
|
|
2
3
|
/** The message for a field name, or undefined: none, or the person has edited the field since the map arrived. */
|
|
3
4
|
errorOf: (name: string) => string | undefined;
|
|
@@ -5,7 +6,7 @@ export interface FormFieldsState {
|
|
|
5
6
|
claim: (name: string) => () => void;
|
|
6
7
|
}
|
|
7
8
|
/** The enclosing AppForm's field errors, or null outside one. */
|
|
8
|
-
export declare const FormFieldsContext:
|
|
9
|
+
export declare const FormFieldsContext: Context<FormFieldsState | null>;
|
|
9
10
|
/** The form's message for this field, and the claim on its name while mounted. Undefined outside an AppForm or with no name. */
|
|
10
11
|
export declare function useFieldError(name: string | undefined): string | undefined;
|
|
11
12
|
/** One spelling per field path: `items[0].qty` becomes `items.0.qty`. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.175.0",
|
|
4
4
|
"description": "Webority shared React component library: App* primitives on react-bootstrap and the @webority/theme design system.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"./src/elements/*.ts"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@webority/markdown-core": "0.
|
|
45
|
-
"@webority/theme": "0.
|
|
46
|
-
"@webority/ui-elements": "0.
|
|
47
|
-
"@webority/web-core": "0.
|
|
44
|
+
"@webority/markdown-core": "0.175.0",
|
|
45
|
+
"@webority/theme": "0.175.0",
|
|
46
|
+
"@webority/ui-elements": "0.175.0",
|
|
47
|
+
"@webority/web-core": "0.175.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@webority/analytics": "^0.41.0",
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
"@vitejs/plugin-react": "^6.0.1",
|
|
71
71
|
"@vitest/coverage-v8": "5.1.0",
|
|
72
72
|
"@webority/analytics": "0.41.1",
|
|
73
|
-
"@webority/canvas-kit": "0.
|
|
74
|
-
"@webority/biome-config": "0.
|
|
75
|
-
"@webority/tokens": "0.
|
|
73
|
+
"@webority/canvas-kit": "0.175.0",
|
|
74
|
+
"@webority/biome-config": "0.175.0",
|
|
75
|
+
"@webority/tokens": "0.175.0",
|
|
76
76
|
"bootstrap": "5.3.9",
|
|
77
77
|
"jsdom": "30.1.1",
|
|
78
78
|
"react": "^19.3.1",
|