@webority/ui-react 0.179.0 → 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 +2479 -106
- package/dist/canvas-kit/release.json +6 -6
- 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/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/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/AppAgenda.d.ts +69 -0
- package/dist/types/components/AppAsyncBlock.d.ts +5 -0
- package/dist/types/components/AppButton.d.ts +9 -0
- 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/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/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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext as e}from"react";var t=e(null);export{t as FormStatusContext};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{registerStickyLayer as e}from"@webority/ui-elements/helpers";import{useLayoutEffect as t}from"react";function n(n,r){t(()=>{let t=n.current;if(r&&t)return e(t)},[n,r])}export{n as default};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { ReactElement, ReactNode } from "react";
|
|
3
|
+
export interface AppAgendaItem {
|
|
4
|
+
id: string;
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
/** Muted second line under the title. */
|
|
7
|
+
subtitle?: ReactNode | undefined;
|
|
8
|
+
/** A status or count shown at the end of the row. */
|
|
9
|
+
badge?: ReactNode | undefined;
|
|
10
|
+
/** A person shown as an avatar, by name and optional photo. */
|
|
11
|
+
avatar?: {
|
|
12
|
+
name: string;
|
|
13
|
+
src?: string | undefined;
|
|
14
|
+
} | undefined;
|
|
15
|
+
/** An icon name shown beside the title when there is no avatar. */
|
|
16
|
+
icon?: string | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface AppAgendaGroup {
|
|
19
|
+
/** The day as a sortable key, for example "2026-11-27". Passed to `onShowMore`. */
|
|
20
|
+
date: string;
|
|
21
|
+
/** The day heading, for example "Fri 27 Nov 2026". */
|
|
22
|
+
label: ReactNode;
|
|
23
|
+
/** A count shown beside the heading, for example "Away: 3 of 8". */
|
|
24
|
+
count?: ReactNode | undefined;
|
|
25
|
+
/** An inline warning under the heading, for example "Cover is thin: 4 of 8 away." */
|
|
26
|
+
flag?: ReactNode | undefined;
|
|
27
|
+
items: readonly AppAgendaItem[];
|
|
28
|
+
/** Shows an add action on the day as a button. Pass onAdd or addHref, not both. */
|
|
29
|
+
onAdd?: (() => void) | undefined;
|
|
30
|
+
/** Shows an add action on the day as a link to this address. Pass onAdd or addHref, not both. */
|
|
31
|
+
addHref?: string | undefined;
|
|
32
|
+
/** The visible text of the add action, for example "Add leave on 27-Nov-2026". */
|
|
33
|
+
addLabel?: string | undefined;
|
|
34
|
+
}
|
|
35
|
+
export interface AppAgendaProps extends Omit<React.ComponentPropsWithoutRef<"section">, "children"> {
|
|
36
|
+
/**
|
|
37
|
+
* The days, each { date, label, count, flag, items, onAdd or addHref, addLabel }. An item is { id, title, subtitle, badge, avatar: { name, src }, icon }.
|
|
38
|
+
* @default []
|
|
39
|
+
*/
|
|
40
|
+
groups?: readonly AppAgendaGroup[] | undefined;
|
|
41
|
+
/** Shows this many rows per day; the rest sit behind a Show more toggle. */
|
|
42
|
+
cap?: number | undefined;
|
|
43
|
+
/** The Show more text; {count} is replaced by the hidden row count. */
|
|
44
|
+
showMoreLabel?: string | undefined;
|
|
45
|
+
/** Called with the day's `date` when its hidden rows are shown (the "Show more" toggle opens). */
|
|
46
|
+
onShowMore?: ((date: string) => void) | undefined;
|
|
47
|
+
/** Shown when there are no groups. */
|
|
48
|
+
empty?: ReactNode | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Shows a loading placeholder in place of the days.
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
loading?: boolean | undefined;
|
|
54
|
+
/** A load failure, shown as a danger alert. */
|
|
55
|
+
error?: ReactNode | undefined;
|
|
56
|
+
/** The accessible name of the agenda. */
|
|
57
|
+
label?: string | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Classes for the agenda root.
|
|
60
|
+
* @default ""
|
|
61
|
+
*/
|
|
62
|
+
className?: string | undefined;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* A list of events grouped under day headings: each day shows a count, an
|
|
66
|
+
* optional inline warning, an add action and its rows. A day with more rows
|
|
67
|
+
* than `cap` shows the first `cap` and a "Show more" button for the rest.
|
|
68
|
+
*/
|
|
69
|
+
export default function AppAgenda(props: AppAgendaProps): ReactElement;
|
|
@@ -29,6 +29,11 @@ export interface AppAsyncBlockProps<T> extends Omit<ComponentPropsWithoutRef<"di
|
|
|
29
29
|
* @default "Try again"
|
|
30
30
|
*/
|
|
31
31
|
retryLabel?: string | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* The error title once a Try again has failed. The block shows how many times it failed.
|
|
34
|
+
* @default "That still didn't load"
|
|
35
|
+
*/
|
|
36
|
+
retryFailedTitle?: string | undefined;
|
|
32
37
|
/**
|
|
33
38
|
* Replaces the built-in English text, for other languages.
|
|
34
39
|
* @default "Nothing here yet"
|
|
@@ -47,6 +47,8 @@ export interface AppButtonProps extends Omit<ComponentPropsWithRef<"button">, "c
|
|
|
47
47
|
static?: boolean | undefined;
|
|
48
48
|
/** A collision-aware hover and focus tooltip (through AppTooltip and Popper) that flips to stay on screen. For a labelled button use it sparingly, since the label already says what it does; it is most useful on a terse or icon-led action. */
|
|
49
49
|
tooltip?: string | undefined;
|
|
50
|
+
/** Why the button is disabled, shown as its tooltip on a focusable holder so keyboard and screen reader users reach it. Replaces tooltip while disabled; needs disabled, and a button that is not disabled throws. */
|
|
51
|
+
disabledReason?: string | undefined;
|
|
50
52
|
/**
|
|
51
53
|
* Preferred tooltip side; auto picks the side with the most room.
|
|
52
54
|
* @default "auto"
|
|
@@ -61,6 +63,11 @@ export interface AppButtonProps extends Omit<ComponentPropsWithRef<"button">, "c
|
|
|
61
63
|
* @default false
|
|
62
64
|
*/
|
|
63
65
|
pinRightIcon?: boolean | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Draws a link-variant button inside a line of text, such as a figure in a sentence: no minimum size, padding or border, and the text's own font. Ignored on any other variant.
|
|
68
|
+
* @default false
|
|
69
|
+
*/
|
|
70
|
+
inline?: boolean | undefined;
|
|
64
71
|
/**
|
|
65
72
|
* Corner shape: the default rounded squircle, a fully rounded pill, or sharp square corners.
|
|
66
73
|
* @default "rounded"
|
|
@@ -110,10 +117,12 @@ export interface AppButtonProps extends Omit<ComponentPropsWithRef<"button">, "c
|
|
|
110
117
|
* @param [props.href]
|
|
111
118
|
* @param [props.static]
|
|
112
119
|
* @param [props.tooltip]
|
|
120
|
+
* @param [props.disabledReason] Why the button is disabled; shown as its tooltip while disabled and replaces `tooltip` then. Needs `disabled`; without it the button throws.
|
|
113
121
|
* @param [props.tooltipPlacement]
|
|
114
122
|
* @param [props.shortcut]
|
|
115
123
|
* @param [props.animation]
|
|
116
124
|
* @param [props.pinRightIcon]
|
|
125
|
+
* @param [props.inline] Sets a link-variant button in a line of text; ignored on any other variant.
|
|
117
126
|
* @param [props.shape]
|
|
118
127
|
* @param [props.iconVariant]
|
|
119
128
|
* @param [props.iconBg] Needs rightIcon with pinRightIcon or the roll animation; anything else throws.
|
|
@@ -13,6 +13,11 @@ export interface AppCalendarEvent {
|
|
|
13
13
|
label: string;
|
|
14
14
|
} | undefined;
|
|
15
15
|
}
|
|
16
|
+
export interface AppCalendarMarker {
|
|
17
|
+
date: string;
|
|
18
|
+
tone?: "neutral" | "warning" | undefined;
|
|
19
|
+
label: string;
|
|
20
|
+
}
|
|
16
21
|
export interface AppCalendarProps {
|
|
17
22
|
/**
|
|
18
23
|
* The name a screen reader hears for the calendar.
|
|
@@ -33,6 +38,12 @@ export interface AppCalendarProps {
|
|
|
33
38
|
firstDay?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | undefined;
|
|
34
39
|
/** IANA time zone the calendar shows, for example Asia/Kolkata or America/New_York. Events with an offset or a Z are moved into it; events with no offset are read as already in it. Unset, it is India Standard Time (Asia/Kolkata). */
|
|
35
40
|
timeZone?: string | undefined;
|
|
41
|
+
/** The query parameter (for example `month`) that holds the month shown, as `YYYY-MM`. The calendar opens on the month it names in the current address, and writes the month back, with no new history entry, whenever the visible month changes, so a page reload keeps the month. An absent or invalid value opens on `date`, else today. Unset, the address is never read or written. */
|
|
42
|
+
monthParam?: string | undefined;
|
|
43
|
+
/** The day (`YYYY-MM-DD`, in the time zone of the calendar) drawn as selected, for a page that opens a day list or drawer from a click. Changing it moves the mark. */
|
|
44
|
+
selectedDate?: string | undefined;
|
|
45
|
+
/** Days with a dot. A warning dot shows a clash without hiding the day's events; its label is read by a screen reader. */
|
|
46
|
+
markers?: AppCalendarMarker[] | undefined;
|
|
36
47
|
/** What is said when `eventsUrl` could not be loaded, and when the calendar's code could not. */
|
|
37
48
|
errorText?: string | undefined;
|
|
38
49
|
/** Return `false` to stop the event's own link; any other result is ignored. */
|
|
@@ -97,6 +108,9 @@ export interface AppCalendarProps {
|
|
|
97
108
|
* @param [props.emptyText]
|
|
98
109
|
* @param [props.firstDay]
|
|
99
110
|
* @param [props.timeZone]
|
|
111
|
+
* @param [props.monthParam]
|
|
112
|
+
* @param [props.selectedDate]
|
|
113
|
+
* @param [props.markers]
|
|
100
114
|
* @param [props.errorText]
|
|
101
115
|
* @param [props.onEventClick] An event was clicked, or Enter was pressed on it. Gets the event as it was given. Return `false` to stop an event's own link.
|
|
102
116
|
* @param [props.onDateClick] A day was clicked, or Enter was pressed on it; `time` is set for a click on a time slot.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type CSSProperties, type JSX, type ReactNode, type Ref } from "react";
|
|
2
|
+
declare const VIEW_NAMES: readonly ["agenda", "timeline", "month"];
|
|
3
|
+
declare const STEP_NAMES: readonly ["previous", "next", "today"];
|
|
4
|
+
export type AppCalendarViewName = (typeof VIEW_NAMES)[number];
|
|
5
|
+
type PeriodStep = (typeof STEP_NAMES)[number];
|
|
6
|
+
export interface AppCalendarViewsProps extends Omit<ComponentPropsWithoutRef<"section">, "children"> {
|
|
7
|
+
/**
|
|
8
|
+
* The views the switcher offers, in its order. Agenda is the first and so the default.
|
|
9
|
+
* @default ["agenda","timeline","month"]
|
|
10
|
+
*/
|
|
11
|
+
views?: AppCalendarViewName[] | undefined;
|
|
12
|
+
/** The view shown. Unset, the calendar opens on the `#view=` name in the address, else the first of `views`. */
|
|
13
|
+
view?: AppCalendarViewName | undefined;
|
|
14
|
+
/** Called with the view a person chose. The chosen view is also written to the address as `#view=`. */
|
|
15
|
+
onViewChange?: ((view: AppCalendarViewName) => void) | undefined;
|
|
16
|
+
/** The period shown, such as "November 2026". */
|
|
17
|
+
period?: string | undefined;
|
|
18
|
+
/** Called when Previous, Next or Today is pressed. */
|
|
19
|
+
onPeriodChange?: ((step: PeriodStep) => void) | undefined;
|
|
20
|
+
/** A legend shown beside the switcher. */
|
|
21
|
+
legend?: ReactNode | undefined;
|
|
22
|
+
/** Buttons shown at the end of the header. */
|
|
23
|
+
actions?: ReactNode | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* The name a screen reader hears for the view switcher.
|
|
26
|
+
* @default "Calendar view"
|
|
27
|
+
*/
|
|
28
|
+
label?: string | undefined;
|
|
29
|
+
/** The body of the chosen view. */
|
|
30
|
+
children?: ReactNode | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Extra classes on the root element.
|
|
33
|
+
* @default ""
|
|
34
|
+
*/
|
|
35
|
+
className?: string | undefined;
|
|
36
|
+
/** Inline style on the root element. */
|
|
37
|
+
style?: CSSProperties | undefined;
|
|
38
|
+
ref?: Ref<HTMLElement> | undefined;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The header every calendar shares: the period with Previous, Next and Today, a switcher between
|
|
42
|
+
* the views (Agenda by default, Timeline, Month), an optional legend and actions, and one body
|
|
43
|
+
* slot the page fills with the chosen view. The switcher and the period buttons are the shared
|
|
44
|
+
* <wui-calendar-views> element; Razor <app-calendar-views> renders the same markup. The switcher
|
|
45
|
+
* is keyboard reachable, and the chosen view is kept in the address as `#view=timeline`, so a link opens
|
|
46
|
+
* the same view.
|
|
47
|
+
*
|
|
48
|
+
* ```jsx
|
|
49
|
+
* <AppCalendarViews period="November 2026" view={view} onViewChange={setView} onPeriodChange={move}>
|
|
50
|
+
* {view === "agenda" ? <Agenda /> : <Month />}
|
|
51
|
+
* </AppCalendarViews>
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @param props
|
|
55
|
+
* @param [props.views]
|
|
56
|
+
* @param [props.view]
|
|
57
|
+
* @param [props.onViewChange]
|
|
58
|
+
* @param [props.period]
|
|
59
|
+
* @param [props.onPeriodChange]
|
|
60
|
+
* @param [props.legend]
|
|
61
|
+
* @param [props.actions]
|
|
62
|
+
* @param [props.label]
|
|
63
|
+
* @param [props.children] The body of the chosen view.
|
|
64
|
+
* @param [props.className]
|
|
65
|
+
* @param [props.style]
|
|
66
|
+
* @param [ref] The root element.
|
|
67
|
+
*/
|
|
68
|
+
declare function AppCalendarViews({ ref, ...props }: AppCalendarViewsProps): JSX.Element;
|
|
69
|
+
export default AppCalendarViews;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
export interface AppChangeListItem {
|
|
3
|
+
/** What changes: the setting or field name. */
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
/** A stable React key; a text label needs none. */
|
|
6
|
+
key?: string | undefined;
|
|
7
|
+
/** The value before the change. A change with no value before it leaves the line out. */
|
|
8
|
+
was?: React.ReactNode | undefined;
|
|
9
|
+
/** The value after the change. */
|
|
10
|
+
now?: React.ReactNode | undefined;
|
|
11
|
+
/** One line of context, such as what the change does. */
|
|
12
|
+
note?: React.ReactNode | undefined;
|
|
13
|
+
}
|
|
14
|
+
export interface AppChangeListProps extends Omit<React.ComponentPropsWithoutRef<"ul">, "children"> {
|
|
15
|
+
/**
|
|
16
|
+
* The changes, each with its label, the value it was and the value it becomes.
|
|
17
|
+
* @default []
|
|
18
|
+
*/
|
|
19
|
+
items?: readonly AppChangeListItem[] | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Added to the list's root element.
|
|
22
|
+
* @default ""
|
|
23
|
+
*/
|
|
24
|
+
className?: string | undefined;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The changes a person is about to save, each with the value it was and the value it becomes.
|
|
28
|
+
* Used inside AppConfirmDialog or a settings row's confirm panel, where the person reads it before confirming.
|
|
29
|
+
*/
|
|
30
|
+
export default function AppChangeList(props: AppChangeListProps): React.JSX.Element;
|
|
@@ -108,6 +108,11 @@ export interface AppChartProps extends Omit<ComponentPropsWithoutRef<"div">, "on
|
|
|
108
108
|
* @default false
|
|
109
109
|
*/
|
|
110
110
|
valueLabels?: boolean | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* The last period is not finished: a column or bar draws it lighter, a line or area draws its last segment dashed, and the tooltip says so far. Line, area, column and bar only; ignored on a stacked line or area.
|
|
113
|
+
* @default false
|
|
114
|
+
*/
|
|
115
|
+
incompleteLast?: boolean | undefined;
|
|
111
116
|
/**
|
|
112
117
|
* In px, the axis labels included. A value that is not above 0 draws at the default.
|
|
113
118
|
* @default 320
|
|
@@ -77,6 +77,8 @@ export interface AppColorFieldProps extends Omit<React.ComponentPropsWithoutRef<
|
|
|
77
77
|
* @default ""
|
|
78
78
|
*/
|
|
79
79
|
fieldClassName?: string | undefined;
|
|
80
|
+
/** Underline keeps only a line under the field. */
|
|
81
|
+
variant?: "underline" | undefined;
|
|
80
82
|
}
|
|
81
83
|
/**
|
|
82
84
|
* A colour picker field: the native swatch beside a hex text input, kept in sync.
|
|
@@ -21,6 +21,11 @@ type PaletteGroup = {
|
|
|
21
21
|
label: React.ReactNode;
|
|
22
22
|
items?: PaletteItem[] | undefined;
|
|
23
23
|
};
|
|
24
|
+
type PaletteError = {
|
|
25
|
+
title: React.ReactNode;
|
|
26
|
+
text?: React.ReactNode | undefined;
|
|
27
|
+
onRetry?: (() => void) | undefined;
|
|
28
|
+
};
|
|
24
29
|
export interface AppCommandPaletteProps extends React.HTMLAttributes<HTMLElement> {
|
|
25
30
|
/** Shows the palette while true. */
|
|
26
31
|
open: boolean;
|
|
@@ -81,6 +86,10 @@ export interface AppCommandPaletteProps extends React.HTMLAttributes<HTMLElement
|
|
|
81
86
|
emptyText?: React.ReactNode | undefined;
|
|
82
87
|
/** Content under the list, such as key hints. */
|
|
83
88
|
footer?: React.ReactNode | undefined;
|
|
89
|
+
/** A quiet line drawn above the results, such as a limited-search notice. */
|
|
90
|
+
notice?: React.ReactNode | undefined;
|
|
91
|
+
/** A failed search: the title and text drawn above the results, with a Try again button. The query stays. Try again dispatches wui-command-palette:retry, which onRetry answers. */
|
|
92
|
+
error?: PaletteError | undefined;
|
|
84
93
|
/**
|
|
85
94
|
* Accessible name of the dialog and its input.
|
|
86
95
|
* @default "Search"
|
|
@@ -150,6 +159,9 @@ export interface AppCommandPaletteProps extends React.HTMLAttributes<HTMLElement
|
|
|
150
159
|
* @param [props.loading]
|
|
151
160
|
* @param [props.emptyText]
|
|
152
161
|
* @param [props.footer]
|
|
162
|
+
* @param [props.notice] A quiet line drawn above the results, such as a limited-search notice.
|
|
163
|
+
* @param [props.error] A failed search: a title and optional text drawn above the results, with a Try again
|
|
164
|
+
* button that calls `onRetry`. The query stays.
|
|
153
165
|
* @param [props.ariaLabel]
|
|
154
166
|
* @param [props.resultsLabel] Default "Results".
|
|
155
167
|
* @param [props.highlight]
|
|
@@ -1,13 +1,25 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Context, type ReactElement, type ReactNode } from "react";
|
|
2
2
|
declare const SPANS: readonly ["Quarter", "Third", "Half", "TwoThirds", "Full", "Fifth"];
|
|
3
3
|
export type DashboardSpan = (typeof SPANS)[number];
|
|
4
|
+
/** What an editable AppDashboardGrid gives its cells: each widget's title, span and hidden state. */
|
|
5
|
+
export interface DashboardCellState {
|
|
6
|
+
titles: ReadonlyMap<string, string>;
|
|
7
|
+
spans: ReadonlyMap<string, DashboardSpan>;
|
|
8
|
+
hidden: ReadonlySet<string>;
|
|
9
|
+
}
|
|
10
|
+
export declare const DashboardCellContext: Context<DashboardCellState | null>;
|
|
4
11
|
/**
|
|
5
12
|
* One cell of an `AppDashboardGrid`: it spans Quarter, Third, Half or TwoThirds of the twelve columns, Full (the
|
|
6
13
|
* default), or Fifth: three to a row from 576px and five from 992px; full width under 576px. A card or tile inside
|
|
7
14
|
* fills the cell's height.
|
|
8
15
|
*
|
|
16
|
+
* In an editable grid, `widgetId` names the widget the cell shows, and the grid decides the cell's order, span and
|
|
17
|
+
* whether it is hidden.
|
|
18
|
+
*
|
|
9
19
|
* @param props
|
|
10
20
|
* @param [props.span]
|
|
21
|
+
* @param [props.widgetId] Required in an editable grid: a stable id for the widget.
|
|
22
|
+
* @param [props.widgetTitle] The widget's name in the edit mode menus and announcements; wins over the title the grid's `widgets` give. Without either, the element names the widget by its id.
|
|
11
23
|
* @param props.children The card or tile.
|
|
12
24
|
* @param [props.className]
|
|
13
25
|
*/
|
|
@@ -17,6 +29,10 @@ export interface AppDashboardCellProps {
|
|
|
17
29
|
* @default "Full"
|
|
18
30
|
*/
|
|
19
31
|
span?: DashboardSpan | undefined;
|
|
32
|
+
/** A stable id for the widget this cell shows. Required in an editable AppDashboardGrid, which orders, spans and hides the cell by it. */
|
|
33
|
+
widgetId?: string | undefined;
|
|
34
|
+
/** The widget's name in the edit mode menus and announcements. It wins over the title the grid's widgets give; without either, the widget is named by its id. */
|
|
35
|
+
widgetTitle?: string | undefined;
|
|
20
36
|
children: ReactNode;
|
|
21
37
|
/**
|
|
22
38
|
* Extra classes on the cell.
|
|
@@ -1,11 +1,29 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
2
|
+
import { type DashboardSpan } from "./AppDashboardCell.tsx";
|
|
3
|
+
/** A widget the grid can show: its id, the title a person sees, and the span it takes by default. */
|
|
4
|
+
export interface DashboardWidget {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
span: DashboardSpan;
|
|
8
|
+
}
|
|
9
|
+
/** One widget's place in an editable grid: its id, its span in columns (3, 4, 5, 6, 8 or 12) and whether it is hidden. */
|
|
10
|
+
export interface DashboardLayoutItem {
|
|
11
|
+
id: string;
|
|
12
|
+
span: number;
|
|
13
|
+
hidden: boolean;
|
|
14
|
+
}
|
|
2
15
|
/**
|
|
3
16
|
* The layout of a dashboard: `AppDashboardCell`s that each take a named share of the row (Quarter,
|
|
4
|
-
* Third, Half, TwoThirds, Fifth or Full), and one column under 576px.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
17
|
+
* Third, Half, TwoThirds, Fifth or Full), and one column under 576px.
|
|
18
|
+
*
|
|
19
|
+
* Without `editable` the page says where each card goes. With `editable`, a person hides, shows, moves and
|
|
20
|
+
* resets the cells by mouse and keyboard (arrow keys move a focused cell, and each move is announced). The grid
|
|
21
|
+
* then renders from `layout`: give `layout` and save it in `onLayoutChange`, which gets the whole layout after
|
|
22
|
+
* each change, and answer `onReset` with the product's default layout. Storage stays with the product.
|
|
23
|
+
* Without `layout`, the grid keeps the order its cells came in.
|
|
7
24
|
*
|
|
8
|
-
*
|
|
25
|
+
* Put KPI tiles at Quarter, charts at Half or Full, and a wide table at Full. The date range of a dashboard
|
|
26
|
+
* belongs in one filter row above the grid, not inside each card.
|
|
9
27
|
*
|
|
10
28
|
* ```jsx
|
|
11
29
|
* <AppDashboardGrid>
|
|
@@ -17,6 +35,11 @@ import type { ReactElement, ReactNode } from "react";
|
|
|
17
35
|
* @param props
|
|
18
36
|
* @param [props.children] `AppDashboardCell`s.
|
|
19
37
|
* @param [props.className]
|
|
38
|
+
* @param [props.editable] Lets a person hide, show, move and reset the cells. Needs a `widgetId` on every cell.
|
|
39
|
+
* @param [props.widgets] The widgets the grid can show, with their titles and default spans. Editable grids only.
|
|
40
|
+
* @param [props.layout] The saved layout, in order. Editable grids only.
|
|
41
|
+
* @param [props.onLayoutChange] Gets the whole layout after each change. Editable grids only.
|
|
42
|
+
* @param [props.onReset] Asks the product for its default layout. Editable grids only.
|
|
20
43
|
*/
|
|
21
44
|
export interface AppDashboardGridProps {
|
|
22
45
|
children?: ReactNode | undefined;
|
|
@@ -25,5 +48,16 @@ export interface AppDashboardGridProps {
|
|
|
25
48
|
* @default ""
|
|
26
49
|
*/
|
|
27
50
|
className?: string | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Lets a person hide, show, move and reset the cells by mouse and keyboard. Each cell then needs a widgetId, and widgets, layout, onLayoutChange and onReset apply.
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
editable?: boolean | undefined;
|
|
56
|
+
/** The widgets the grid can show: id, the title a person sees, and the default span. Editable grids only. */
|
|
57
|
+
widgets?: readonly DashboardWidget[] | undefined;
|
|
58
|
+
/** The saved layout, in order: each widget's id, its span in columns (3, 4, 5, 6, 8 or 12) and whether it is hidden. Editable grids only. */
|
|
59
|
+
layout?: readonly DashboardLayoutItem[] | undefined;
|
|
60
|
+
onLayoutChange?: ((layout: DashboardLayoutItem[]) => void) | undefined;
|
|
61
|
+
onReset?: (() => void) | undefined;
|
|
28
62
|
}
|
|
29
63
|
export default function AppDashboardGrid(props: AppDashboardGridProps): ReactElement;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
export interface AppDashboardHeaderProps extends Omit<React.ComponentPropsWithoutRef<"div">, "title" | "className"> {
|
|
3
|
+
/** The greeting, rendered as the header's heading (for example Good morning, Asha). */
|
|
4
|
+
greeting: string;
|
|
5
|
+
/** The day shown after the greeting, read in India Standard Time. */
|
|
6
|
+
date?: Date | undefined;
|
|
7
|
+
/** The moment shown as Updated hh:mm am IST, read in India Standard Time. */
|
|
8
|
+
updatedDateTime?: Date | undefined;
|
|
9
|
+
children?: React.ReactNode | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Extra classes on the header element.
|
|
12
|
+
* @default ""
|
|
13
|
+
*/
|
|
14
|
+
className?: string | undefined;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The top line of a portal dashboard: the greeting, the date and the updated time at the left, and the
|
|
18
|
+
* children (usually the period control) in a slot at the right. Under 576 px the slot wraps onto its own row.
|
|
19
|
+
* Dates are read in India Standard Time. The Razor `<app-dashboard-header>` renders the same markup and classes.
|
|
20
|
+
*/
|
|
21
|
+
export default function AppDashboardHeader(props: AppDashboardHeaderProps): React.JSX.Element;
|
|
@@ -112,8 +112,8 @@ export interface AppDataTableProps<Row> extends Omit<ComponentPropsWithoutRef<"d
|
|
|
112
112
|
/** The heading text of the trailing actions column. */
|
|
113
113
|
rowActionsLabel?: string | undefined;
|
|
114
114
|
/**
|
|
115
|
-
* Where the row actions show: hover fades them in on row hover and focus, and the menu shows on touch; hover-menu keeps the menu visible
|
|
116
|
-
* @default "
|
|
115
|
+
* Where the row actions show: column keeps the icons always visible; hover fades them in on row hover and focus, and the menu shows on touch; hover-menu keeps the menu visible.
|
|
116
|
+
* @default "column"
|
|
117
117
|
*/
|
|
118
118
|
rowActionsMode?: AppDataTableRowActionsMode | undefined;
|
|
119
119
|
/** The footer's state, usually straight from usePagination. The footer shows once total is above the smallest page size and stays in place while loading. */
|
|
@@ -198,6 +198,16 @@ export interface AppDataTableProps<Row> extends Omit<ComponentPropsWithoutRef<"d
|
|
|
198
198
|
* @default false
|
|
199
199
|
*/
|
|
200
200
|
stickyActions?: boolean | undefined;
|
|
201
|
+
/**
|
|
202
|
+
* Pins the column header to the top of the page while it scrolls, directly under the top bar and any sticky page header or tabs above it. A header pinned to the page cannot sit in a sideways scroll box, so the table wrap clips instead of scrolling, and stickyHeader is refused together with stickyFirstColumn, stickyActions, maxHeight or virtual, which need the wrap to scroll. Razor: sticky-header.
|
|
203
|
+
* @default false
|
|
204
|
+
*/
|
|
205
|
+
stickyHeader?: boolean | undefined;
|
|
206
|
+
/**
|
|
207
|
+
* Extra gap in px between the layers above and the pinned header, a whole number from 0. Only with stickyHeader; without it, or negative, it is refused. Razor: sticky-offset.
|
|
208
|
+
* @default 0
|
|
209
|
+
*/
|
|
210
|
+
stickyOffset?: number | undefined;
|
|
201
211
|
/**
|
|
202
212
|
* Gives every labelled button in the row actions column the same width, so the column lines up from row to row. Icon-only actions are not widened.
|
|
203
213
|
* @default false
|
|
@@ -293,6 +303,22 @@ export interface AppDataTableProps<Row> extends Omit<ComponentPropsWithoutRef<"d
|
|
|
293
303
|
* column's value). Razor: `data-wui-save-state="error"`.
|
|
294
304
|
*/
|
|
295
305
|
rowSaveError?: ((row: Row) => string | undefined) | undefined;
|
|
306
|
+
/**
|
|
307
|
+
* True once the row's add or change has landed: the row shows the done label with a tick. Shows its label only
|
|
308
|
+
* with saveLabels. Razor: `data-wui-save-state="saved"` on the <tr>.
|
|
309
|
+
*/
|
|
310
|
+
rowSaved?: ((row: Row) => boolean) | undefined;
|
|
311
|
+
/**
|
|
312
|
+
* Shows a save status word in each row's first cell: busy with a spinner while it saves, done with a tick once saved, failed in danger text. A busy row's actions are hidden.
|
|
313
|
+
* @default false
|
|
314
|
+
*/
|
|
315
|
+
saveLabels?: boolean | undefined;
|
|
316
|
+
/** The word for a saving row. Unset, the built-in text. Needs saveLabels. */
|
|
317
|
+
saveBusyLabel?: string | undefined;
|
|
318
|
+
/** The word for a saved row. Unset, the built-in text. Needs saveLabels. */
|
|
319
|
+
saveDoneLabel?: string | undefined;
|
|
320
|
+
/** The word for a row whose save failed. Unset, the built-in text. Needs saveLabels. */
|
|
321
|
+
saveFailedLabel?: string | undefined;
|
|
296
322
|
}
|
|
297
323
|
/**
|
|
298
324
|
* Shared ledger table (sort headers, skeleton, empty, optional pagination).
|
|
@@ -63,6 +63,8 @@ export interface AppDatePickerProps extends Omit<React.HTMLAttributes<HTMLElemen
|
|
|
63
63
|
helpLabel?: string | undefined;
|
|
64
64
|
/** Control height tier, matching AppInput. */
|
|
65
65
|
size?: "sm" | "md" | "lg" | "xl" | undefined;
|
|
66
|
+
/** Underline keeps only a line under the field. */
|
|
67
|
+
variant?: "underline" | undefined;
|
|
66
68
|
/** First weekday of the calendar, 0 Sunday to 6 Saturday. Unset, it follows the theme's --wui-first-day token, which is 1 (Monday) unless the product sets it. */
|
|
67
69
|
firstDay?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | undefined;
|
|
68
70
|
/**
|
|
@@ -79,6 +79,8 @@ export interface AppDateRangePickerProps extends Omit<React.HTMLAttributes<HTMLE
|
|
|
79
79
|
loading?: boolean | undefined;
|
|
80
80
|
/** Control height tier, matching AppInput. */
|
|
81
81
|
size?: "sm" | "md" | "lg" | "xl" | undefined;
|
|
82
|
+
/** Underline keeps only a line under the field. */
|
|
83
|
+
variant?: "underline" | undefined;
|
|
82
84
|
/** First weekday of the calendar, 0 Sunday to 6 Saturday. Unset, it follows the theme's --wui-first-day token, which is 1 (Monday) unless the product sets it. */
|
|
83
85
|
firstDay?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | undefined;
|
|
84
86
|
/** IANA time zone the quick ranges are resolved in, for example Asia/Kolkata or America/New_York. Unset, it is India Standard Time (Asia/Kolkata). */
|
|
@@ -55,6 +55,8 @@ export interface AppDescriptionsProps extends Omit<React.ComponentPropsWithoutRe
|
|
|
55
55
|
labels?: "top" | "start" | undefined;
|
|
56
56
|
/** Optional heading above the grid. */
|
|
57
57
|
title?: React.ReactNode | undefined;
|
|
58
|
+
/** Drawn at the right of the title row, for example a Change link. Unset, the title row is unchanged. */
|
|
59
|
+
titleAction?: React.ReactNode | undefined;
|
|
58
60
|
/** Router link (e.g. react-router Link) for in-app destinations; it receives `to` instead of `href`. Absolute, `#` and scheme hrefs stay plain anchors. Keeps the library router-agnostic. */
|
|
59
61
|
linkComponent?: AppLinkComponent | undefined;
|
|
60
62
|
/**
|
|
@@ -35,8 +35,8 @@ export interface AppDropdownProps extends Omit<React.ComponentPropsWithoutRef<"d
|
|
|
35
35
|
iconSize?: number | undefined;
|
|
36
36
|
/** Class for the toggle button, replacing the default toggle look. */
|
|
37
37
|
toggleClassName?: string | undefined;
|
|
38
|
-
/** neutral: a custom trigger that keeps the surrounding font and colour, with a muted fill on hover and while open. Needs trigger. */
|
|
39
|
-
toggleVariant?: "neutral" | undefined;
|
|
38
|
+
/** neutral: a custom trigger that keeps the surrounding font and colour, with a muted fill on hover and while open. outline: a custom trigger drawn as a form field, with an input's height, border and radius. Needs trigger. */
|
|
39
|
+
toggleVariant?: "neutral" | "outline" | undefined;
|
|
40
40
|
/** A fixed menu width (15, 20 or 25rem; long rows wrap instead of widening the menu), or fit: no minimum, the menu is as wide as its widest row. Unset, the menu is at least 12rem wide. */
|
|
41
41
|
menuWidth?: "sm" | "md" | "lg" | "fit" | undefined;
|
|
42
42
|
/** Tooltip and accessible name fallback for the toggle. */
|
|
@@ -40,6 +40,21 @@ export interface AppEntryGridProps<Row> {
|
|
|
40
40
|
rowError?: ((row: Row) => ReactNode) | undefined;
|
|
41
41
|
onCommitRow?: ((row: Row, move: "next" | "stay") => void) | undefined;
|
|
42
42
|
onDiscardRow?: ((row: Row) => void) | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Adds a trailing column: a changed or failed line shows Save and Cancel, a saving line shows Save disabled, and a saved or clean line shows nothing. Needs onCommitRow.
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
47
|
+
rowActions?: boolean | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* The visually hidden header of the actions column.
|
|
50
|
+
* @default "Actions"
|
|
51
|
+
*/
|
|
52
|
+
rowActionsLabel?: string | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* The text of the Cancel button in the actions column; its accessible name is discardLabel.
|
|
55
|
+
* @default "Cancel"
|
|
56
|
+
*/
|
|
57
|
+
cancelLabel?: string | undefined;
|
|
43
58
|
onAddRow?: (() => void) | undefined;
|
|
44
59
|
/** The sorted column's key and direction; that column's heading announces it. */
|
|
45
60
|
sort?: AppDataTableSort | null | undefined;
|
|
@@ -21,6 +21,11 @@ export interface AppFileViewerProps extends Omit<ComponentPropsWithoutRef<"div">
|
|
|
21
21
|
* @default false
|
|
22
22
|
*/
|
|
23
23
|
download?: boolean | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Fills the height from the viewer's top edge to the bottom of the window, never under 420 px, and follows a resize or a change above it. A style height still wins.
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
fill?: boolean | undefined;
|
|
24
29
|
/**
|
|
25
30
|
* Shows the print button for a PDF or an image. Pass false to hide it.
|
|
26
31
|
* @default true
|
|
@@ -82,6 +87,8 @@ export interface AppFileViewerProps extends Omit<ComponentPropsWithoutRef<"div">
|
|
|
82
87
|
* changes one (zoom, two-page view, thumbnails, volume, speed).
|
|
83
88
|
* @param [props.viewKey]
|
|
84
89
|
* @param [props.download]
|
|
90
|
+
* @param [props.fill] Fills the height from the viewer's top edge to the bottom of the window, never under 420 px,
|
|
91
|
+
* and follows a resize or a change above it. A `style` height still wins.
|
|
85
92
|
* @param [props.print]
|
|
86
93
|
* @param [props.workerSrc]
|
|
87
94
|
* @param [props.captions]
|
|
@@ -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;
|