@webority/ui-react 0.178.4 → 0.180.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 +143 -143
- package/dist/canvas-kit/manifest.json +2583 -111
- package/dist/canvas-kit/release.json +6 -6
- package/dist/components/AppAccordion.js +1 -1
- package/dist/components/AppAgenda.js +1 -0
- package/dist/components/AppAsyncBlock.js +1 -1
- package/dist/components/AppButton.js +1 -1
- package/dist/components/AppCalendar.js +1 -1
- package/dist/components/AppCalendarViews.js +1 -0
- package/dist/components/AppChangeList.js +1 -0
- package/dist/components/AppChart.js +1 -1
- package/dist/components/AppColorField.js +1 -1
- package/dist/components/AppCommandPalette.js +1 -1
- package/dist/components/AppDashboardCell.js +1 -1
- package/dist/components/AppDashboardGrid.js +1 -1
- package/dist/components/AppDashboardHeader.js +1 -0
- package/dist/components/AppDataTable.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/AppDescriptions.js +1 -1
- package/dist/components/AppDropdown.js +1 -1
- package/dist/components/AppEntryGrid.js +1 -1
- package/dist/components/AppFileViewer.js +1 -1
- package/dist/components/AppForm.js +1 -1
- package/dist/components/AppFormActions.js +1 -1
- package/dist/components/AppFormRow.js +1 -1
- package/dist/components/AppGantt.js +1 -1
- package/dist/components/AppInput.js +1 -1
- package/dist/components/AppKanban.js +1 -1
- package/dist/components/AppKpiTile.js +1 -1
- package/dist/components/AppListCard.js +1 -0
- package/dist/components/AppMentionInput.js +1 -1
- package/dist/components/AppMiniCalendar.js +1 -0
- package/dist/components/AppNavigationMenu.js +1 -1
- package/dist/components/AppNotificationCenter.js +1 -1
- package/dist/components/AppNumberInput.js +1 -1
- package/dist/components/AppOfflineBanner.js +1 -0
- package/dist/components/AppOtpInput.js +1 -1
- package/dist/components/AppPageHeader.js +1 -1
- package/dist/components/AppPhoneNumberInput.js +1 -1
- package/dist/components/AppQueueBundle.js +1 -0
- package/dist/components/AppResultBlock.js +1 -0
- package/dist/components/AppRouteError.js +1 -1
- package/dist/components/AppSearch.js +1 -1
- package/dist/components/AppSegmented.js +1 -1
- package/dist/components/AppSelect.js +1 -1
- package/dist/components/AppSettingRow.js +1 -0
- package/dist/components/AppSettingSection.js +1 -0
- package/dist/components/AppShell.js +1 -1
- package/dist/components/AppStepper.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/AppWizard.js +1 -1
- package/dist/guidance.json +987 -9
- package/dist/lib/formStatusContext.js +1 -0
- package/dist/lib/useStickyLayer.js +1 -0
- package/dist/types/components/AppAccordion.d.ts +5 -3
- package/dist/types/components/AppAgenda.d.ts +69 -0
- package/dist/types/components/AppAsyncBlock.d.ts +5 -0
- package/dist/types/components/AppButton.d.ts +18 -2
- package/dist/types/components/AppCalendar.d.ts +14 -0
- package/dist/types/components/AppCalendarViews.d.ts +69 -0
- package/dist/types/components/AppChangeList.d.ts +30 -0
- package/dist/types/components/AppChart.d.ts +5 -0
- package/dist/types/components/AppColorField.d.ts +2 -0
- package/dist/types/components/AppCommandPalette.d.ts +12 -0
- package/dist/types/components/AppDashboardCell.d.ts +17 -1
- package/dist/types/components/AppDashboardGrid.d.ts +39 -5
- package/dist/types/components/AppDashboardHeader.d.ts +21 -0
- package/dist/types/components/AppDataTable.d.ts +28 -2
- package/dist/types/components/AppDatePicker.d.ts +2 -0
- package/dist/types/components/AppDateRangePicker.d.ts +2 -0
- package/dist/types/components/AppDescriptions.d.ts +2 -0
- package/dist/types/components/AppDropdown.d.ts +2 -2
- package/dist/types/components/AppEntryGrid.d.ts +15 -0
- package/dist/types/components/AppFileViewer.d.ts +7 -0
- package/dist/types/components/AppForm.d.ts +5 -0
- package/dist/types/components/AppFormActions.d.ts +28 -4
- package/dist/types/components/AppFormRow.d.ts +5 -0
- package/dist/types/components/AppGantt.d.ts +10 -2
- package/dist/types/components/AppInput.d.ts +5 -0
- package/dist/types/components/AppKanban.d.ts +4 -0
- package/dist/types/components/AppKpiTile.d.ts +14 -1
- package/dist/types/components/AppListCard.d.ts +32 -0
- package/dist/types/components/AppMentionInput.d.ts +2 -0
- package/dist/types/components/AppMiniCalendar.d.ts +78 -0
- package/dist/types/components/AppNavigationMenu.d.ts +10 -0
- package/dist/types/components/AppNotificationCenter.d.ts +20 -0
- package/dist/types/components/AppNumberInput.d.ts +7 -0
- package/dist/types/components/AppOfflineBanner.d.ts +28 -0
- package/dist/types/components/AppOtpInput.d.ts +2 -0
- package/dist/types/components/AppPhoneNumberInput.d.ts +7 -0
- package/dist/types/components/AppQueueBundle.d.ts +35 -0
- package/dist/types/components/AppResultBlock.d.ts +62 -0
- package/dist/types/components/AppRouteError.d.ts +76 -4
- package/dist/types/components/AppSearch.d.ts +3 -0
- package/dist/types/components/AppSegmented.d.ts +14 -0
- package/dist/types/components/AppSelect.d.ts +2 -0
- package/dist/types/components/AppSettingRow.d.ts +61 -0
- package/dist/types/components/AppSettingSection.d.ts +23 -0
- package/dist/types/components/AppShell.d.ts +10 -62
- package/dist/types/components/AppStepper.d.ts +6 -1
- package/dist/types/components/AppTabs.d.ts +5 -0
- package/dist/types/components/AppTextarea.d.ts +19 -0
- package/dist/types/components/AppTimePicker.d.ts +2 -0
- package/dist/types/components/AppWizard.d.ts +31 -2
- package/dist/types/index.d.ts +17 -2
- package/dist/types/lib/focusField.d.ts +1 -2
- package/dist/types/lib/formStatusContext.d.ts +15 -0
- package/dist/types/lib/useStickyLayer.d.ts +7 -0
- package/dist/ui-react.js +1 -1
- package/package.json +11 -11
|
@@ -32,6 +32,11 @@ export interface AppFormProps extends Omit<ComponentPropsWithRef<"form">, "onSub
|
|
|
32
32
|
* @default "Your changes on this page are not saved. If you leave now, they are lost."
|
|
33
33
|
*/
|
|
34
34
|
unsavedChangesMessage?: string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* top draws a failed submit's field errors under their fields. status also counts the failing fields and links each section to its first one, for AppFormActions to show in its status slot. Form-wide errors stay at the top in both.
|
|
37
|
+
* @default "top"
|
|
38
|
+
*/
|
|
39
|
+
errorSummary?: "top" | "status" | undefined;
|
|
35
40
|
}
|
|
36
41
|
export interface FormSubmitState {
|
|
37
42
|
submitting: boolean;
|
|
@@ -1,16 +1,30 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, ReactElement, ReactNode } from "react";
|
|
2
|
+
type StatusTone = "neutral" | "success" | "warning" | "danger" | "info";
|
|
2
3
|
export interface AppFormActionsProps extends ComponentPropsWithoutRef<"div"> {
|
|
3
4
|
children: ReactNode;
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* False (default) leaves the bar inline; true sticks the actions to the bottom of the viewport with a border and background; surface pins them to the bottom of their own card or panel.
|
|
6
7
|
* @default false
|
|
7
8
|
*/
|
|
8
|
-
sticky?: boolean | undefined;
|
|
9
|
+
sticky?: boolean | "surface" | undefined;
|
|
9
10
|
/**
|
|
10
11
|
* Alignment of the children: end, start or between.
|
|
11
12
|
* @default "end"
|
|
12
13
|
*/
|
|
13
14
|
align?: "end" | "start" | "between" | undefined;
|
|
15
|
+
/** Text, an icon or any content at the start of the bar. Needs align end. Not with saveState. */
|
|
16
|
+
status?: ReactNode | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* The tone of the status.
|
|
19
|
+
* @default "neutral"
|
|
20
|
+
*/
|
|
21
|
+
statusTone?: StatusTone | undefined;
|
|
22
|
+
/** The form's save state as a standard sentence with its tone and icon. Needs align end. Not with status. */
|
|
23
|
+
saveState?: "pristine" | "dirty" | "saving" | "saved" | "invalid" | undefined;
|
|
24
|
+
/** When the form was saved, as an ISO string with its zone (Z or an offset) or epoch milliseconds; write a Date as an ISO string. Shown as HH:mm IST. Needed when saveState is saved. */
|
|
25
|
+
savedAt?: Date | string | number | undefined;
|
|
26
|
+
/** How many fields need attention. Needed when saveState is invalid. */
|
|
27
|
+
invalidCount?: number | undefined;
|
|
14
28
|
/**
|
|
15
29
|
* Extra class names added to the root element.
|
|
16
30
|
* @default ""
|
|
@@ -21,13 +35,23 @@ export interface AppFormActionsProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
21
35
|
* Form action footer: a sticky or inline controls row at a form's end.
|
|
22
36
|
*
|
|
23
37
|
* Typically holds submit/cancel buttons; can be fixed to the viewport bottom
|
|
24
|
-
* with a top border and surface background
|
|
25
|
-
*
|
|
38
|
+
* with a top border and surface background, or pinned to the bottom of its own
|
|
39
|
+
* card or panel (sticky "surface"). Supports alignment: trailing (end, default),
|
|
40
|
+
* leading (start), or space-between for a submit/cancel pair. A status slot at the
|
|
41
|
+
* start carries free text (status) or a standard save state (saveState); inside an
|
|
42
|
+
* AppForm with errorSummary "status" it shows the error count and a link to each
|
|
43
|
+
* section that holds a failing field.
|
|
26
44
|
*
|
|
27
45
|
* @param props
|
|
28
46
|
* @param props.children The action buttons.
|
|
29
47
|
* @param [props.sticky]
|
|
30
48
|
* @param [props.align]
|
|
49
|
+
* @param [props.status]
|
|
50
|
+
* @param [props.statusTone]
|
|
51
|
+
* @param [props.saveState]
|
|
52
|
+
* @param [props.savedAt]
|
|
53
|
+
* @param [props.invalidCount]
|
|
31
54
|
* @param [props.className]
|
|
32
55
|
*/
|
|
33
56
|
export default function AppFormActions(props: AppFormActionsProps): ReactElement;
|
|
57
|
+
export {};
|
|
@@ -12,6 +12,11 @@ export interface AppFormRowProps extends Omit<ComponentPropsWithoutRef<"div">, "
|
|
|
12
12
|
* @default true
|
|
13
13
|
*/
|
|
14
14
|
collapse?: boolean | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Keeps one message line of room under each field, so a help line or an error never moves the row below.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
reserveMessage?: boolean | undefined;
|
|
15
20
|
/**
|
|
16
21
|
* Extra class names added to the root element.
|
|
17
22
|
* @default ""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type GanttLayout, type GanttRow, type GanttState, type GanttZoom } from "@webority/ui-elements/helpers";
|
|
1
|
+
import { type GanttLayout, type GanttRow, type GanttState, type GanttWeeks, type GanttZoom } from "@webority/ui-elements/helpers";
|
|
2
2
|
import type { ComponentPropsWithoutRef, CSSProperties, JSX, Ref } from "react";
|
|
3
|
-
export type { GanttLayout, GanttRow, GanttState, GanttStatus, GanttZoom } from "@webority/ui-elements/helpers";
|
|
3
|
+
export type { GanttBar, GanttHalf, GanttLayout, GanttRow, GanttState, GanttStatus, GanttTone, GanttWeeks, GanttZoom, } from "@webority/ui-elements/helpers";
|
|
4
4
|
export interface AppGanttProps extends Omit<ComponentPropsWithoutRef<"div">, "title" | "onSelect"> {
|
|
5
5
|
/** The tasks, flat: one entry per task. A row with no start is not drawn. A row with a start and no end is a milestone. A repeated key, an end before its start, a progress outside 0 to 100, or a dependsOn that names no row or loops throws, naming the key. */
|
|
6
6
|
rows: GanttRow[];
|
|
@@ -40,6 +40,14 @@ export interface AppGanttProps extends Omit<ComponentPropsWithoutRef<"div">, "ti
|
|
|
40
40
|
loading?: boolean | undefined;
|
|
41
41
|
/** The curated message to show when the plan failed. Wins over loading and state. */
|
|
42
42
|
error?: string | undefined;
|
|
43
|
+
/** Days shaded like weekends, YYYY-MM-DD. Lanes layout and day zoom. */
|
|
44
|
+
holidays?: string[] | undefined;
|
|
45
|
+
/** A window of one or two weeks, drawn by day. Needs zoom week and layout lanes. */
|
|
46
|
+
weeks?: GanttWeeks | undefined;
|
|
47
|
+
/** Names the count row of bars (how many are away each day). Defaults to the built-in copy. */
|
|
48
|
+
countLabel?: string | undefined;
|
|
49
|
+
/** Written in a clash band where two bars of one row overlap. Defaults to the built-in copy. */
|
|
50
|
+
clashLabel?: string | undefined;
|
|
43
51
|
/** The message when there are no tasks. Defaults to the built-in copy. */
|
|
44
52
|
emptyText?: string | undefined;
|
|
45
53
|
/** The message under error when none is given. Defaults to the built-in copy. */
|
|
@@ -43,6 +43,11 @@ export interface AppInputProps extends Omit<React.ComponentPropsWithoutRef<"inpu
|
|
|
43
43
|
valid?: boolean | undefined;
|
|
44
44
|
/** Helper text under the field. An error replaces it while both are set. */
|
|
45
45
|
helperText?: React.ReactNode | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Where the message line under the field sits. Reserve keeps the line even when empty, so an error never moves the form. None draws it only while an error or a hint shows, which closes the gap between stacked fields.
|
|
48
|
+
* @default "reserve"
|
|
49
|
+
*/
|
|
50
|
+
messageRoom?: "reserve" | "none" | undefined;
|
|
46
51
|
/** Text shown in an empty field. */
|
|
47
52
|
placeholder?: string | undefined;
|
|
48
53
|
/** The content of the info-tip beside the label, opened by a button. */
|
|
@@ -4,6 +4,7 @@ type KanbanTone = "neutral" | "primary" | "info" | "success" | "warning" | "dang
|
|
|
4
4
|
type KanbanSummaryFormat = "number" | "currency" | "compact";
|
|
5
5
|
type KanbanUnit = "rupees" | "paise";
|
|
6
6
|
type KanbanHeadLayout = "inline" | "stacked";
|
|
7
|
+
type KanbanCollapsedLayout = "rail" | "strip";
|
|
7
8
|
/** The fields the board reads from a card; a card type may carry more. */
|
|
8
9
|
export interface KanbanCard {
|
|
9
10
|
key?: unknown | undefined;
|
|
@@ -21,6 +22,7 @@ export interface KanbanColumn {
|
|
|
21
22
|
collapsed?: boolean | undefined;
|
|
22
23
|
emptyText?: string | undefined;
|
|
23
24
|
visibleLimit?: number | undefined;
|
|
25
|
+
collapsedLayout?: KanbanCollapsedLayout | undefined;
|
|
24
26
|
}
|
|
25
27
|
export interface KanbanMove<C extends KanbanCard> {
|
|
26
28
|
card: C;
|
|
@@ -41,6 +43,7 @@ export interface AppKanbanProps<C extends KanbanCard = KanbanCard> {
|
|
|
41
43
|
getCardValue?: ((card: C) => number) | undefined;
|
|
42
44
|
cardLabel?: ((card: C) => string) | undefined;
|
|
43
45
|
isCardLocked?: ((card: C) => boolean) | undefined;
|
|
46
|
+
lockedReason?: ((card: C) => string) | undefined;
|
|
44
47
|
onLocked?: ((attempt: {
|
|
45
48
|
card: C;
|
|
46
49
|
key: string;
|
|
@@ -160,6 +163,7 @@ export interface AppKanbanProps<C extends KanbanCard = KanbanCard> {
|
|
|
160
163
|
* @param getCardValue The number a computed summary adds up.
|
|
161
164
|
* @param cardLabel The card's accessible name, used in announcements.
|
|
162
165
|
* @param isCardLocked A locked card cannot be moved.
|
|
166
|
+
* @param lockedReason The reason a locked card shows: a lock on the card with a tooltip, read by screen readers. Shown only when it is given.
|
|
163
167
|
* @param onLocked Someone tried to pick up a card that cannot move (a locked card, or any card on a read-only
|
|
164
168
|
* board); show your own message. Screen readers are told either way.
|
|
165
169
|
* @param accept Refuse a move: false, or a string saying why (shown in the column while the card is carried).
|
|
@@ -7,10 +7,11 @@ type KpiIconTone = "primary" | "success" | "warning" | "danger" | "info" | "neut
|
|
|
7
7
|
type KpiIconVariant = "linear" | "outline" | "bold" | "bulk" | "broken" | "twotone";
|
|
8
8
|
type KpiDirection = "up" | "down" | "flat";
|
|
9
9
|
type KpiDeltaTone = "success" | "danger" | "neutral";
|
|
10
|
+
type KpiLabelPosition = "above" | "below";
|
|
10
11
|
export interface AppKpiTileProps extends Omit<HTMLAttributes<HTMLElement>, "className" | "style"> {
|
|
11
12
|
/** What the number measures. */
|
|
12
13
|
label: ReactNode;
|
|
13
|
-
/** The number itself, already formatted. */
|
|
14
|
+
/** The number itself, already formatted. A null value shows No data. */
|
|
14
15
|
value: ReactNode;
|
|
15
16
|
/** A sub-line under the value, such as Total sent. */
|
|
16
17
|
caption?: ReactNode | undefined;
|
|
@@ -99,6 +100,18 @@ export interface AppKpiTileProps extends Omit<HTMLAttributes<HTMLElement>, "clas
|
|
|
99
100
|
* @default ""
|
|
100
101
|
*/
|
|
101
102
|
sparklineClassName?: string | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* Shows a placeholder in place of the figure while the data loads; the caption, delta and sparkline are hidden.
|
|
105
|
+
* @default false
|
|
106
|
+
*/
|
|
107
|
+
loading?: boolean | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* Puts the label over the figure, or under it.
|
|
110
|
+
* @default "above"
|
|
111
|
+
*/
|
|
112
|
+
labelPosition?: KpiLabelPosition | undefined;
|
|
113
|
+
/** The accessible name of the sparkline, passed as its label. */
|
|
114
|
+
sparklineLabel?: string | undefined;
|
|
102
115
|
}
|
|
103
116
|
/**
|
|
104
117
|
* A single headline number: a dashboard stat, a summary figure above a table.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
export type AppListCardPadding = "none" | "md";
|
|
3
|
+
export interface AppListCardProps extends Omit<React.ComponentPropsWithoutRef<"div">, "title"> {
|
|
4
|
+
/** The list's heading. */
|
|
5
|
+
title?: string | undefined;
|
|
6
|
+
/** A line under the heading. */
|
|
7
|
+
subtitle?: string | undefined;
|
|
8
|
+
/** How many records the list holds, shown beside the heading. Not set shows none. */
|
|
9
|
+
count?: number | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* none: the table runs edge to edge. md: body padding, for a list that is not a table.
|
|
12
|
+
* @default "none"
|
|
13
|
+
*/
|
|
14
|
+
padding?: AppListCardPadding | undefined;
|
|
15
|
+
/** The list's actions, right-aligned in the header. */
|
|
16
|
+
actions?: React.ReactNode;
|
|
17
|
+
/** The filter row between the header and the body. */
|
|
18
|
+
filters?: React.ReactNode;
|
|
19
|
+
/** The list's save state, drawn at the end of the header the way a data table draws a row save state: busy with a spinner, done with a tick, or failed. Not set draws nothing; any other value throws. */
|
|
20
|
+
saveState?: "saving" | "saved" | "error" | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Added to the card's root element.
|
|
23
|
+
* @default ""
|
|
24
|
+
*/
|
|
25
|
+
className?: string | undefined;
|
|
26
|
+
children?: React.ReactNode;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The frame of a list page: a card with the list's title and count, its actions, an optional
|
|
30
|
+
* filter row, and the table running edge to edge below.
|
|
31
|
+
*/
|
|
32
|
+
export default function AppListCard(props: AppListCardProps): React.JSX.Element;
|
|
@@ -60,6 +60,8 @@ export interface AppMentionInputProps extends Omit<React.HTMLAttributes<HTMLElem
|
|
|
60
60
|
* @default "md"
|
|
61
61
|
*/
|
|
62
62
|
size?: "sm" | "md" | "lg" | "xl" | undefined;
|
|
63
|
+
/** Underline keeps only a line under the field. */
|
|
64
|
+
variant?: "underline" | undefined;
|
|
63
65
|
/** The starting value of an uncontrolled field. */
|
|
64
66
|
defaultValue?: string | undefined;
|
|
65
67
|
/** Posts the stored value under this name in a form. */
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
export interface AppMiniCalendarMarker {
|
|
3
|
+
/** The day the marker sits on, as YYYY-MM-DD. */
|
|
4
|
+
date: string;
|
|
5
|
+
/** Default "neutral". A "warning" marker is larger and in the warning tone, for a clash. */
|
|
6
|
+
tone?: "neutral" | "warning" | undefined;
|
|
7
|
+
/** Said in the accessible name of the day. */
|
|
8
|
+
label?: string | undefined;
|
|
9
|
+
}
|
|
10
|
+
export interface AppMiniCalendarProps extends Omit<React.HTMLAttributes<HTMLElement>, "onChange"> {
|
|
11
|
+
/** The month shown, as YYYY-MM. Default: the current month in India Standard Time. */
|
|
12
|
+
month?: string | undefined;
|
|
13
|
+
/** Receives the month the navigator moved to, as YYYY-MM. */
|
|
14
|
+
onMonthChange?: ((month: string) => void) | undefined;
|
|
15
|
+
/** The selected day, as YYYY-MM-DD. */
|
|
16
|
+
value?: string | undefined;
|
|
17
|
+
/** Receives the day a person picked, as YYYY-MM-DD. */
|
|
18
|
+
onChange?: ((value: string) => void) | undefined;
|
|
19
|
+
/** Days that carry a marker: an array of { date, tone: neutral or warning, label }. A warning marker is larger, for a clash. */
|
|
20
|
+
markers?: AppMiniCalendarMarker[] | undefined;
|
|
21
|
+
/** The first day of the range to tint, as YYYY-MM-DD. */
|
|
22
|
+
rangeStart?: string | undefined;
|
|
23
|
+
/** The last day of the range to tint, as YYYY-MM-DD. */
|
|
24
|
+
rangeEnd?: string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* The first day of the week.
|
|
27
|
+
* @default "monday"
|
|
28
|
+
*/
|
|
29
|
+
firstDay?: "monday" | "sunday" | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* The accessible name of the navigator.
|
|
32
|
+
* @default "Calendar"
|
|
33
|
+
*/
|
|
34
|
+
label?: string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Classes for the root element.
|
|
37
|
+
* @default ""
|
|
38
|
+
*/
|
|
39
|
+
className?: string | undefined;
|
|
40
|
+
ref?: React.Ref<HTMLElement> | undefined;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A small month grid that stays open on the page: the side column of an agenda, or a page that
|
|
44
|
+
* shows busy and clash days. It wraps <wui-mini-calendar>, which takes the keyboard (arrow keys move
|
|
45
|
+
* between days, Page Up and Page Down move between months, Home and End go to the week's ends) and
|
|
46
|
+
* reports each pick and each month change; the page sets month and value and answers.
|
|
47
|
+
*
|
|
48
|
+
* A day can carry a marker: a neutral dot, or a larger warning dot for a clash. The marker's label
|
|
49
|
+
* is part of the day's accessible name, so a screen reader announces it with the date.
|
|
50
|
+
*
|
|
51
|
+
* ```jsx
|
|
52
|
+
* <AppMiniCalendar
|
|
53
|
+
* month="2026-11"
|
|
54
|
+
* value="2026-11-27"
|
|
55
|
+
* onChange={setDay}
|
|
56
|
+
* onMonthChange={setMonth}
|
|
57
|
+
* markers={[{ date: "2026-11-27", tone: "warning", label: "Clash: 4 people away" }]}
|
|
58
|
+
* rangeStart="2026-11-23"
|
|
59
|
+
* rangeEnd="2026-11-27"
|
|
60
|
+
* label="Team leave"
|
|
61
|
+
* />
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @param props
|
|
65
|
+
* @param [props.month]
|
|
66
|
+
* @param [props.onMonthChange]
|
|
67
|
+
* @param [props.value]
|
|
68
|
+
* @param [props.onChange]
|
|
69
|
+
* @param [props.markers]
|
|
70
|
+
* @param [props.rangeStart]
|
|
71
|
+
* @param [props.rangeEnd]
|
|
72
|
+
* @param [props.firstDay]
|
|
73
|
+
* @param [props.label]
|
|
74
|
+
* @param [props.className]
|
|
75
|
+
* @param [ref] The root element.
|
|
76
|
+
*/
|
|
77
|
+
declare function AppMiniCalendar({ ref, ...props }: AppMiniCalendarProps): React.JSX.Element;
|
|
78
|
+
export default AppMiniCalendar;
|
|
@@ -28,6 +28,16 @@ export interface AppNavigationMenuProps {
|
|
|
28
28
|
* @default "Main"
|
|
29
29
|
*/
|
|
30
30
|
ariaLabel?: string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* How an entry shows hover and the current page: pills fills the entry, underline draws a line under it, text colours its label.
|
|
33
|
+
* @default "pills"
|
|
34
|
+
*/
|
|
35
|
+
variant?: "pills" | "underline" | "text" | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Drops the entries' side padding so the first label lines up with the content edge. Only with variant underline.
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
40
|
+
flush?: boolean | undefined;
|
|
31
41
|
/** The product's router link, which receives `to` (e.g. Link). */
|
|
32
42
|
linkComponent?: AppLinkComponent | undefined;
|
|
33
43
|
className?: string | undefined;
|
|
@@ -24,6 +24,12 @@ export interface NotificationTab {
|
|
|
24
24
|
key: TabKey;
|
|
25
25
|
label?: string | undefined;
|
|
26
26
|
}
|
|
27
|
+
export interface NotificationCenterError {
|
|
28
|
+
/** The message. Absent: the built-in "Notifications did not load". */
|
|
29
|
+
text?: string | undefined;
|
|
30
|
+
/** Called by "Try again". */
|
|
31
|
+
onRetry: () => void;
|
|
32
|
+
}
|
|
27
33
|
export interface AppNotificationCenterProps {
|
|
28
34
|
/** The notifications, newest first. Read state is the caller's: pass the new items after marking some read. */
|
|
29
35
|
items: NotificationItem[];
|
|
@@ -39,6 +45,20 @@ export interface AppNotificationCenterProps {
|
|
|
39
45
|
* @default "You are all caught up."
|
|
40
46
|
*/
|
|
41
47
|
emptyText?: string | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Shows Loading notifications in place of the list.
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
loading?: boolean | undefined;
|
|
53
|
+
/** Shows the message (text, optional) with a Try again action (onRetry) in place of the list. */
|
|
54
|
+
error?: NotificationCenterError | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* exact writes each day as its date (04-Oct-2026) instead of Today and Yesterday.
|
|
57
|
+
* @default "relative"
|
|
58
|
+
*/
|
|
59
|
+
dayLabels?: "relative" | "exact" | undefined;
|
|
60
|
+
/** A See earlier link at the end of the Unread tab. Needs tabs. */
|
|
61
|
+
earlierHref?: string | undefined;
|
|
42
62
|
/** A View all link under the list. Without it there is no link. */
|
|
43
63
|
viewAllHref?: string | undefined;
|
|
44
64
|
/**
|
|
@@ -72,6 +72,8 @@ export interface AppNumberInputProps extends Omit<ComponentPropsWithoutRef<"inpu
|
|
|
72
72
|
* @default "md"
|
|
73
73
|
*/
|
|
74
74
|
size?: AppNumberInputSize | undefined;
|
|
75
|
+
/** Underline keeps only a line under the field. */
|
|
76
|
+
variant?: "underline" | undefined;
|
|
75
77
|
/** The input's id. Unset, a generated id is used. */
|
|
76
78
|
id?: string | undefined;
|
|
77
79
|
/** The input's name, for forms. */
|
|
@@ -101,6 +103,11 @@ export interface AppNumberInputProps extends Omit<ComponentPropsWithoutRef<"inpu
|
|
|
101
103
|
* @default false
|
|
102
104
|
*/
|
|
103
105
|
loading?: boolean | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* Draws the minus and plus buttons. False keeps only the input, for amounts where stepping by one is never wanted; ArrowUp and ArrowDown still step.
|
|
108
|
+
* @default true
|
|
109
|
+
*/
|
|
110
|
+
steppers?: boolean | undefined;
|
|
104
111
|
/**
|
|
105
112
|
* Draws only the control: no field wrapper, label row or message line. Name it with aria-label, aria-labelledby or a label the page draws, because the component draws none.
|
|
106
113
|
* @default false
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type JSX } from "react";
|
|
2
|
+
export interface AppOfflineBannerProps extends Omit<ComponentPropsWithoutRef<"div">, "children" | "role"> {
|
|
3
|
+
/** Shows the banner while true. Omit it to follow the browser's connection, which also shows the back-online message for a few seconds. */
|
|
4
|
+
offline?: boolean | undefined;
|
|
5
|
+
/** When the content on the page last loaded, as the screen formats it (for example 23:12). Omit it to show the line without a time. */
|
|
6
|
+
loadedAt?: string | undefined;
|
|
7
|
+
/** Runs when Check again is pressed. The button shows only when this is passed. */
|
|
8
|
+
onCheckAgain?: (() => void) | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Extra classes on the banner.
|
|
11
|
+
* @default ""
|
|
12
|
+
*/
|
|
13
|
+
className?: string | undefined;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A fixed strip under the top bar that says the browser is offline and when the content on the
|
|
17
|
+
* page last loaded. The content below keeps its contrast. When the connection returns the strip
|
|
18
|
+
* says so for a few seconds, then goes away. Wraps `<wui-offline-banner>`, which Razor
|
|
19
|
+
* `<app-offline-banner>` renders too.
|
|
20
|
+
*
|
|
21
|
+
* It follows the browser by default. Pass `offline` to drive it from the page instead.
|
|
22
|
+
*
|
|
23
|
+
* ```jsx
|
|
24
|
+
* <AppOfflineBanner loadedAt="23:12" onCheckAgain={() => refetch()} />
|
|
25
|
+
* <AppOfflineBanner offline={queue.isOffline} />
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export default function AppOfflineBanner(props: AppOfflineBannerProps): JSX.Element;
|
|
@@ -71,6 +71,8 @@ export interface AppOtpInputProps extends Omit<React.HTMLAttributes<HTMLElement>
|
|
|
71
71
|
* @default "md"
|
|
72
72
|
*/
|
|
73
73
|
size?: "sm" | "md" | "lg" | undefined;
|
|
74
|
+
/** Underline keeps only a line under the field. */
|
|
75
|
+
variant?: "underline" | undefined;
|
|
74
76
|
/** The content of the info-tip beside the label, opened by a button. */
|
|
75
77
|
help?: React.ReactNode | undefined;
|
|
76
78
|
/**
|
|
@@ -62,6 +62,11 @@ export interface AppPhoneNumberInputProps extends Omit<React.HTMLAttributes<HTML
|
|
|
62
62
|
helperText?: string | undefined;
|
|
63
63
|
/** An error message under the field, which also turns the border red. */
|
|
64
64
|
error?: string | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Shows a green tick on a filled field with no error.
|
|
67
|
+
* @default false
|
|
68
|
+
*/
|
|
69
|
+
valid?: boolean | undefined;
|
|
65
70
|
/**
|
|
66
71
|
* Shows the country flag.
|
|
67
72
|
* @default true
|
|
@@ -77,6 +82,8 @@ export interface AppPhoneNumberInputProps extends Omit<React.HTMLAttributes<HTML
|
|
|
77
82
|
* @default "md"
|
|
78
83
|
*/
|
|
79
84
|
size?: "sm" | "md" | "lg" | "xl" | undefined;
|
|
85
|
+
/** Underline keeps only a line under the field. */
|
|
86
|
+
variant?: "underline" | undefined;
|
|
80
87
|
/**
|
|
81
88
|
* Extra classes on the field wrapper.
|
|
82
89
|
* @default ""
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ReactElement, type ReactNode } from "react";
|
|
2
|
+
export interface QueueBundleRow {
|
|
3
|
+
key: string;
|
|
4
|
+
primary: ReactNode;
|
|
5
|
+
secondary?: ReactNode | undefined;
|
|
6
|
+
trailing?: ReactNode | undefined;
|
|
7
|
+
checked?: boolean | undefined;
|
|
8
|
+
status?: "idle" | "busy" | "done" | "failed" | undefined;
|
|
9
|
+
}
|
|
10
|
+
export interface QueueBundleRunning {
|
|
11
|
+
total: number;
|
|
12
|
+
done: number;
|
|
13
|
+
}
|
|
14
|
+
export interface AppQueueBundleProps extends Omit<ComponentPropsWithoutRef<"section">, "title"> {
|
|
15
|
+
/** The sentence that names the group, such as "8 one-day requests inside the balance". */
|
|
16
|
+
title: ReactNode;
|
|
17
|
+
/** The plain reason the server marked the group safe. */
|
|
18
|
+
reason?: ReactNode | undefined;
|
|
19
|
+
/** The rows in the group. Only rows the server marked safe belong here. */
|
|
20
|
+
rows: readonly QueueBundleRow[];
|
|
21
|
+
onApprove: (keys: string[]) => void;
|
|
22
|
+
/** Shows progress while the approvals run: { total, done }. */
|
|
23
|
+
running?: QueueBundleRunning | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Extra class on the section.
|
|
26
|
+
* @default ""
|
|
27
|
+
*/
|
|
28
|
+
className?: string | undefined;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A group of requests a server has marked safe to approve together: one block
|
|
32
|
+
* with a reason, a list the person can check through, and one approve button.
|
|
33
|
+
* The page never decides what is safe; each row arrives with its own status.
|
|
34
|
+
*/
|
|
35
|
+
export default function AppQueueBundle(props: AppQueueBundleProps): ReactElement;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, JSX, ReactNode } from "react";
|
|
2
|
+
declare const TONES: readonly ["danger", "warning", "info", "secondary"];
|
|
3
|
+
type ResultBlockTone = (typeof TONES)[number];
|
|
4
|
+
export interface AppResultBlockFact {
|
|
5
|
+
/** Stable key for the row; the label alone may repeat. */
|
|
6
|
+
key: string;
|
|
7
|
+
label: ReactNode;
|
|
8
|
+
value: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export interface AppResultBlockProps extends Omit<ComponentPropsWithoutRef<"div">, "title" | "children" | "className"> {
|
|
11
|
+
/**
|
|
12
|
+
* The colour and default icon: danger for a failed region, warning, info or secondary.
|
|
13
|
+
* @default "danger"
|
|
14
|
+
*/
|
|
15
|
+
tone?: ResultBlockTone | undefined;
|
|
16
|
+
/** Overrides the tone's icon: a library icon name or any node. */
|
|
17
|
+
icon?: string | ReactNode | undefined;
|
|
18
|
+
/** The heading: what failed, in a few words. */
|
|
19
|
+
title: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* The title's heading level: 1 when the block is the whole page.
|
|
22
|
+
* @default 2
|
|
23
|
+
*/
|
|
24
|
+
headingLevel?: 1 | 2 | 3 | undefined;
|
|
25
|
+
/** The one sentence that says what happened and what to do. An alert can go here. */
|
|
26
|
+
children?: ReactNode | undefined;
|
|
27
|
+
/** A form field shown under the sentence. */
|
|
28
|
+
field?: ReactNode | undefined;
|
|
29
|
+
/** Usually one or two buttons, such as Try again. */
|
|
30
|
+
actions?: ReactNode | undefined;
|
|
31
|
+
/** A reference code shown with a Copy reference button. */
|
|
32
|
+
reference?: string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Replaces the built-in English text, for other languages.
|
|
35
|
+
* @default "Reference"
|
|
36
|
+
*/
|
|
37
|
+
referenceLabel?: string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Replaces the built-in English text, for other languages.
|
|
40
|
+
* @default "Copy reference"
|
|
41
|
+
*/
|
|
42
|
+
copyLabel?: string | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Replaces the built-in English text, for other languages.
|
|
45
|
+
* @default "Copied"
|
|
46
|
+
*/
|
|
47
|
+
copiedLabel?: string | undefined;
|
|
48
|
+
/** Labelled facts under the sentence, as a list of { key, label, value } rows. */
|
|
49
|
+
facts?: readonly AppResultBlockFact[] | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Extra classes on the block.
|
|
52
|
+
* @default ""
|
|
53
|
+
*/
|
|
54
|
+
className?: string | undefined;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A left-aligned message for a region or page that failed to load: the part that failed
|
|
58
|
+
* is replaced, the rest of the page stays. Unlike AppResult, which centres a large figure
|
|
59
|
+
* for a whole page, this block is compact and takes its place inside a shell region.
|
|
60
|
+
*/
|
|
61
|
+
export default function AppResultBlock(props: AppResultBlockProps): JSX.Element;
|
|
62
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, JSX, ReactNode } from "react";
|
|
2
|
-
export type RouteErrorKind = "error" | "stale-build" | "not-found";
|
|
2
|
+
export type RouteErrorKind = "error" | "stale-build" | "not-found" | "forbidden" | "signed-out" | "maintenance" | "offline";
|
|
3
3
|
export interface AppRouteErrorProps extends Omit<ComponentPropsWithoutRef<"div">, "children" | "className"> {
|
|
4
4
|
/**
|
|
5
|
-
* What went wrong. An error offers Try again and the home page, a stale build offers Reload, and a
|
|
5
|
+
* What went wrong. An error offers Try again and the home page, a stale build offers Reload, a missing page and a forbidden page offer the home page, a signed-out person offers Sign in again, maintenance offers Check again, and offline offers Try again.
|
|
6
6
|
* @default "error"
|
|
7
7
|
*/
|
|
8
8
|
kind?: RouteErrorKind | undefined;
|
|
@@ -11,7 +11,7 @@ export interface AppRouteErrorProps extends Omit<ComponentPropsWithoutRef<"div">
|
|
|
11
11
|
* @default "/"
|
|
12
12
|
*/
|
|
13
13
|
homeHref?: string | undefined;
|
|
14
|
-
/** What "Try again" and "
|
|
14
|
+
/** What "Try again", "Reload", "Sign in again" and "Check again" do. Default: reload the page. */
|
|
15
15
|
onRetry?: (() => void) | undefined;
|
|
16
16
|
/** Shown above the result, usually the product's logo. */
|
|
17
17
|
brand?: ReactNode | undefined;
|
|
@@ -20,6 +20,12 @@ export interface AppRouteErrorProps extends Omit<ComponentPropsWithoutRef<"div">
|
|
|
20
20
|
* @default true
|
|
21
21
|
*/
|
|
22
22
|
fullPage?: boolean | undefined;
|
|
23
|
+
/** A code the person can quote to support, such as useRouteErrorReport's reference. Shown under the actions with a Copy reference button; nothing is shown when it is absent or null. */
|
|
24
|
+
reference?: string | null | undefined;
|
|
25
|
+
/** When the service is back, as an ISO string with its zone (Z or an offset) or epoch milliseconds; write a Date as an ISO string. Shown as HH:mm IST after the maintenance text. Needs kind maintenance. */
|
|
26
|
+
expectedBack?: Date | string | number | undefined;
|
|
27
|
+
/** Where "Request access" leads. Needs kind forbidden. */
|
|
28
|
+
requestAccessHref?: string | undefined;
|
|
23
29
|
/** Extra content below the actions, such as a support link. */
|
|
24
30
|
children?: ReactNode | undefined;
|
|
25
31
|
/**
|
|
@@ -72,12 +78,78 @@ export interface AppRouteErrorProps extends Omit<ComponentPropsWithoutRef<"div">
|
|
|
72
78
|
* @default "Something went wrong on our side. Try again in a moment."
|
|
73
79
|
*/
|
|
74
80
|
errorText?: string | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Replaces the built-in English text, for other languages.
|
|
83
|
+
* @default "You do not have access to this page"
|
|
84
|
+
*/
|
|
85
|
+
forbiddenTitle?: string | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Replaces the built-in English text, for other languages.
|
|
88
|
+
* @default "Ask your administrator for access, or go to the home page."
|
|
89
|
+
*/
|
|
90
|
+
forbiddenText?: string | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* Replaces the built-in English text, for other languages.
|
|
93
|
+
* @default "You are signed out"
|
|
94
|
+
*/
|
|
95
|
+
signedOutTitle?: string | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* Replaces the built-in English text, for other languages.
|
|
98
|
+
* @default "Sign in again to carry on where you were."
|
|
99
|
+
*/
|
|
100
|
+
signedOutText?: string | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* Replaces the built-in English text, for other languages.
|
|
103
|
+
* @default "Sign in again"
|
|
104
|
+
*/
|
|
105
|
+
signInLabel?: string | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* Replaces the built-in English text, for other languages.
|
|
108
|
+
* @default "We are doing some maintenance"
|
|
109
|
+
*/
|
|
110
|
+
maintenanceTitle?: string | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* Replaces the built-in English text, for other languages.
|
|
113
|
+
* @default "This page is back shortly. Check again in a few minutes."
|
|
114
|
+
*/
|
|
115
|
+
maintenanceText?: string | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* Replaces the built-in English text, for other languages.
|
|
118
|
+
* @default "Check again"
|
|
119
|
+
*/
|
|
120
|
+
checkAgainLabel?: string | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* Replaces the built-in English text, for other languages.
|
|
123
|
+
* @default "You are offline"
|
|
124
|
+
*/
|
|
125
|
+
offlineTitle?: string | undefined;
|
|
126
|
+
/**
|
|
127
|
+
* Replaces the built-in English text, for other languages.
|
|
128
|
+
* @default "Check your connection, then try again."
|
|
129
|
+
*/
|
|
130
|
+
offlineText?: string | undefined;
|
|
131
|
+
/**
|
|
132
|
+
* Replaces the built-in English text, for other languages.
|
|
133
|
+
* @default "Reference"
|
|
134
|
+
*/
|
|
135
|
+
referenceLabel?: string | undefined;
|
|
136
|
+
/** Default "Copy reference". */
|
|
137
|
+
/**
|
|
138
|
+
* Replaces the built-in English text, for other languages.
|
|
139
|
+
* @default "Request access"
|
|
140
|
+
*/
|
|
141
|
+
requestAccessLabel?: string | undefined;
|
|
142
|
+
/**
|
|
143
|
+
* Replaces the built-in English text, for other languages.
|
|
144
|
+
* @default "Copy reference"
|
|
145
|
+
*/
|
|
146
|
+
copyReferenceLabel?: string | undefined;
|
|
75
147
|
}
|
|
76
148
|
/**
|
|
77
149
|
* The screen for a page that failed to load: a router `errorElement`, and the fallback of the
|
|
78
150
|
* app's root error boundary, so both paths show the same screen. It knows nothing of the router:
|
|
79
151
|
* the app reads the caught error (`useRouteErrorReport` in `@webority/web-core`) and passes its
|
|
80
|
-
* `kind`. It never shows the error itself, which is for the logs, not the person.
|
|
152
|
+
* `kind` and `reference`. It never shows the error itself, which is for the logs, not the person.
|
|
81
153
|
*
|
|
82
154
|
* The home link is a plain link (a full page load), so the screen also works where no router
|
|
83
155
|
* is mounted, above it in the root error boundary.
|