@webority/ui-react 0.80.2 → 0.80.4

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.
Files changed (29) hide show
  1. package/dist/types/components/AppAutocomplete.d.ts +32 -48
  2. package/dist/types/components/AppCalendar.d.ts +33 -46
  3. package/dist/types/components/AppChart.d.ts +69 -55
  4. package/dist/types/components/AppCheckbox.d.ts +8 -18
  5. package/dist/types/components/AppCountrySelect.d.ts +9 -12
  6. package/dist/types/components/AppDatePicker.d.ts +20 -34
  7. package/dist/types/components/AppDateRangePicker.d.ts +29 -38
  8. package/dist/types/components/AppEmptyState.d.ts +3 -2
  9. package/dist/types/components/AppFileViewer.d.ts +23 -55
  10. package/dist/types/components/AppInput.d.ts +33 -78
  11. package/dist/types/components/AppMentionInput.d.ts +39 -39
  12. package/dist/types/components/AppMultiSelect.d.ts +33 -50
  13. package/dist/types/components/AppNumberInput.d.ts +21 -42
  14. package/dist/types/components/AppOtpInput.d.ts +16 -46
  15. package/dist/types/components/AppPhoneNumberInput.d.ts +17 -1
  16. package/dist/types/components/AppRadio.d.ts +8 -18
  17. package/dist/types/components/AppRichText.d.ts +19 -41
  18. package/dist/types/components/AppSelect.d.ts +12 -12
  19. package/dist/types/components/AppSlider.d.ts +28 -36
  20. package/dist/types/components/AppSortableList.d.ts +16 -30
  21. package/dist/types/components/AppSwitch.d.ts +9 -21
  22. package/dist/types/components/AppTableEmptyState.d.ts +3 -2
  23. package/dist/types/components/AppTagInput.d.ts +20 -26
  24. package/dist/types/components/AppTextarea.d.ts +16 -24
  25. package/dist/types/components/AppTimePicker.d.ts +22 -34
  26. package/dist/types/components/AppTour.d.ts +40 -55
  27. package/dist/types/components/AppTreeView.d.ts +31 -42
  28. package/dist/types/components/AppWizard.d.ts +48 -46
  29. package/package.json +3 -3
@@ -1,50 +1,34 @@
1
1
  import "@webority/ui-elements/elements/autocomplete";
2
- /**
3
- * Searchable autocomplete over the shared `<wui-autocomplete>` element.
4
- *
5
- * Two modes:
6
- * - **static** — pass `options` (`[{ value, label }]`); filtering is client-side.
7
- * - **remote** — pass an async `loadOptions(query) => Promise<options>`; the field
8
- * debounces typing, shows a spinner while your promise is in flight, then lists the
9
- * results. You own the fetch; the component owns the UX. `options` given alongside it
10
- * are the list shown until the first load result arrives, which replaces them.
11
- *
12
- * @param {object} props
13
- * @param {string} [props.value] Selected option value.
14
- * @param {(value: string, meta?: { isCustom: boolean }) => void} [props.onChange] The second
15
- * argument reports whether the commit was a freeform entry (`allowCustom`) rather than a
16
- * listed option — existing callers reading only the first argument are unaffected.
17
- * @param {Array<{ value: string, label: import('react').ReactNode }>} [props.options] Static options,
18
- * or with `loadOptions` the initial list: shown before any load result arrives (and resolving a
19
- * pre-filled value's label), then replaced by the first result; later changes are ignored.
20
- * A label may be a node (`<>CO<sub>2</sub></>`): it renders as static markup in the menu, the
21
- * input shows its text once chosen, and filtering and the option's accessible name use that
22
- * text. Remote results from `loadOptions` take string labels only.
23
- * @param {string} [props.valueLabel] Text shown for `value` when `options` does not contain it, such as a
24
- * selection loaded from the server. Omit it to keep the default: the field shows the value's option
25
- * label, or nothing. Shown only while `value` is missing from the options.
26
- * @param {(query: string, opts?: { signal?: AbortSignal }) => Promise<{value: string, label: string}[]>} [props.loadOptions]
27
- * Remote loader; receives an AbortSignal for the superseded request (optional to use).
28
- * @param {string} [props.placeholder]
29
- * @param {number} [props.minChars] Min chars before a remote search fires (default 1 in remote mode).
30
- * 0 is allowed: opening the field with an empty box calls `loadOptions("")` for the first page.
31
- * @param {number} [props.debounce] Debounce ms for remote search (default 250).
32
- * @param {boolean} [props.disabled]
33
- * @param {'sm'|'lg'} [props.size] Control size around the default.
34
- * @param {boolean} [props.allowCustom] When the typed text matches no option and the user
35
- * commits (Enter, or blur with text), offers it as its own selectable "Add "…"" row and,
36
- * once picked, commits that raw text as the value with `onChange`'s second argument
37
- * reporting `{ isCustom: true }`.
38
- * @param {string} [props.name]
39
- * @param {string} [props.id] DOM id for the control and the label's `for` target.
40
- * @param {import('react').ReactNode} [props.label]
41
- * @param {string} [props.error]
42
- * @param {string} [props.hint]
43
- * @param {boolean} [props.required]
44
- * @param {import('react').ReactNode} [props.help] Help content shown in an info tip beside the label.
45
- * @param {string} [props.helpLabel="More information"] Accessible name for that info tip.
46
- * @param {string} [props.fieldClassName]
47
- * @param {import('react').Ref<HTMLElement>} [ref]
48
- */
49
- declare const AppAutocomplete: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
2
+ declare const AppAutocomplete: import("react").ForwardRefExoticComponent<{
3
+ value?: string;
4
+ onChange?: (value: string, meta?: {
5
+ isCustom: boolean;
6
+ }) => void;
7
+ options?: Array<{
8
+ value: string;
9
+ label: import('react').ReactNode;
10
+ }>;
11
+ valueLabel?: string;
12
+ loadOptions?: (query: string, opts?: {
13
+ signal?: AbortSignal;
14
+ }) => Promise<{
15
+ value: string;
16
+ label: string;
17
+ }[]>;
18
+ placeholder?: string;
19
+ minChars?: number;
20
+ debounce?: number;
21
+ disabled?: boolean;
22
+ size?: 'sm' | 'lg';
23
+ allowCustom?: boolean;
24
+ name?: string;
25
+ id?: string;
26
+ label?: import('react').ReactNode;
27
+ error?: string;
28
+ hint?: string;
29
+ required?: boolean;
30
+ help?: import('react').ReactNode;
31
+ helpLabel?: string;
32
+ fieldClassName?: string;
33
+ } & import("react").RefAttributes<HTMLElement>>;
50
34
  export default AppAutocomplete;
@@ -1,47 +1,34 @@
1
- /**
2
- * Shows events on a month, week, day or list view, in India Standard Time, with weeks starting on
3
- * `firstDay` (Monday unless the theme or the prop says otherwise). The calendar is the shared
4
- * `<wui-calendar>` element, the same one the Razor `<app-calendar>` uses, with its calendar engine
5
- * loaded the first time a calendar mounts: a page without a calendar never downloads it.
6
- *
7
- * Give it events as data (`events`), or an address (`eventsUrl`) it calls whenever the visible
8
- * period changes, with `start` and `end` query parameters: IST `YYYY-MM-DD` days, `end` being the
9
- * first day not shown. The address answers with a JSON list of events. An event is
10
- * `{ id, title, start, end, allDay, tone, url }`: `start` and `end` are a `YYYY-MM-DD` day or an ISO
11
- * date-time (an offset or Z is shifted to IST, no offset is already IST); `end` is the first moment
12
- * after the event, so an all-day event on the 4th ends on the 5th; `tone` colours it from the theme
13
- * (neutral, primary, success, warning, danger, info); `url` makes it a link.
14
- *
15
- * Every day can be reached by keyboard: one tab stop among the days, the arrow keys move between
16
- * them, Home and End go to the first and last day of the week, Page Up and Page Down to the
17
- * previous and next month, Enter opens the day. A calendar given no `view` opens as a list when it
18
- * is narrower than a phone.
19
- *
20
- * ```jsx
21
- * <AppCalendar
22
- * label="Team leave"
23
- * eventsUrl="/api/leave"
24
- * onEventClick={(event) => openLeave(event.id)}
25
- * onDateClick={({ date }) => startRequest(date)}
26
- * />
27
- * ```
28
- *
29
- * @param {object} props
30
- * @param {string} [props.label='Calendar'] The name a screen reader hears for the calendar.
31
- * @param {{ id?: string|number, title: string, start: string, end?: string, allDay?: boolean, tone?: 'neutral'|'primary'|'success'|'warning'|'danger'|'info', url?: string }[]} [props.events] The events, instead of `eventsUrl`. Extra keys are kept and come back in `onEventClick`.
32
- * @param {string} [props.eventsUrl] Called with `start` and `end` (IST days) whenever the visible period changes; answers a JSON list of events.
33
- * @param {'month'|'week'|'day'|'list'} [props.view] The view to show. Without it a calendar opens on the month, or on the list when it is narrower than a phone.
34
- * @param {string} [props.date] The IST day (`YYYY-MM-DD`) to show; today when omitted. Changing it moves the calendar.
35
- * @param {string} [props.emptyText] What a list with no events says.
36
- * @param {0|1|2|3|4|5|6} [props.firstDay] First weekday of the calendar, 0 Sunday to 6 Saturday. Unset, it
37
- * follows the theme's `--wui-first-day` token, which is 1 (Monday) unless the product sets it.
38
- * @param {string} [props.errorText] What is said when `eventsUrl` could not be loaded, and when the calendar's code could not.
39
- * @param {(event: object) => (void|false)} [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.
40
- * @param {(detail: { date: string, time: string|null, allDay: boolean }) => void} [props.onDateClick] A day was clicked, or Enter was pressed on it; `time` is set for a click on a time slot.
41
- * @param {(detail: { view: string, date: string, start: string, end: string, title: string }) => void} [props.onRangeChange] The view or the visible period changed.
42
- * @param {string} [props.className] Extra classes on the element.
43
- * @param {import('react').CSSProperties} [props.style] Inline style on the element.
44
- * @param {import('react').Ref<HTMLElement>} [ref] The `<wui-calendar>` element, which has `refetch()`.
45
- */
46
- declare const AppCalendar: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
1
+ declare const AppCalendar: import("react").ForwardRefExoticComponent<{
2
+ label?: string;
3
+ events?: {
4
+ id?: string | number;
5
+ title: string;
6
+ start: string;
7
+ end?: string;
8
+ allDay?: boolean;
9
+ tone?: 'neutral' | 'primary' | 'success' | 'warning' | 'danger' | 'info';
10
+ url?: string;
11
+ }[];
12
+ eventsUrl?: string;
13
+ view?: 'month' | 'week' | 'day' | 'list';
14
+ date?: string;
15
+ emptyText?: string;
16
+ firstDay?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
17
+ errorText?: string;
18
+ onEventClick?: (event: object) => (void | false);
19
+ onDateClick?: (detail: {
20
+ date: string;
21
+ time: string | null;
22
+ allDay: boolean;
23
+ }) => void;
24
+ onRangeChange?: (detail: {
25
+ view: string;
26
+ date: string;
27
+ start: string;
28
+ end: string;
29
+ title: string;
30
+ }) => void;
31
+ className?: string;
32
+ style?: import('react').CSSProperties;
33
+ } & import("react").RefAttributes<HTMLElement>>;
47
34
  export default AppCalendar;
@@ -1,56 +1,70 @@
1
- /**
2
- * Draws a line, area, column, horizontal bar, donut, heatmap, calendar heatmap, funnel, gauge,
3
- * waterfall, treemap, sankey, scatter, bubble or small-multiples chart from rows of data. The chart is the
4
- * shared `<wui-chart>` element, the same one the Razor `<app-chart>` uses, with its drawing engine
5
- * loaded the first time a chart mounts: a page without a chart never downloads it.
6
- *
7
- * You describe the chart; you never touch the engine. Every chart comes with a legend that shows
8
- * and hides series, tooltips, arrow-key movement between points (each value read aloud), a real
9
- * data table behind the picture, a screen-reader summary, light and dark colours from the theme,
10
- * resize, and PNG and CSV export through the element (see AppChartCard for the buttons).
11
- *
12
- * Money is rupees, or paise when `format.unit` says so. Dates show in IST. A `percent` value is a
13
- * ratio: 0.125 shows as 12.5%.
14
- *
15
- * ```jsx
16
- * <AppChart
17
- * type="column"
18
- * title="Revenue by month"
19
- * data={[{ month: "Aug", revenue: 4120000 }, { month: "Sep", revenue: 4630000 }]}
20
- * x={{ key: "month" }}
21
- * series={[{ key: "revenue", label: "Revenue", format: { style: "currency" } }]}
22
- * onSelect={(detail) => console.log(detail.x, detail.value)}
23
- * />
24
- * ```
25
- *
26
- * @param {object} props
27
- * @param {'line'|'area'|'column'|'bar'|'donut'|'heatmap'|'calendar'|'funnel'|'gauge'|'waterfall'|'treemap'|'sankey'|'scatter'|'bubble'|'multiples'} props.type `column` is vertical bars, `bar` horizontal. `multiples` draws each series as its own small chart under one shared x axis.
28
- * @param {string} props.title Required. Names the chart for assistive tech and names exported files. An empty string counts as not given.
29
- * @param {string} [props.description] One sentence a screen reader hears before the automatic summary.
30
- * @param {Record<string, string|number|null>[]} props.data One row per x position, slice, cell, stage, flow or point: what a row is depends on the type.
31
- * @param {{ key: string, kind?: 'category'|'time'|'value', format?: object, label?: string }} props.x The column holding the x value. `time` takes epoch ms, an ISO instant or a "YYYY-MM-DD" day; `value` (scatter and bubble) is a number. A calendar is always `time`, a scatter and a bubble always `value`.
32
- * @param {{ key: string, label: string, format?: object }[]} props.series The value columns, in the order they take colours: at most 8. Every type but line, area, column, bar and multiples takes one.
33
- * @param {{ key: string, label?: string }} [props.group] The second dimension: a heatmap's rows, a treemap's parents, a scatter or bubble's colour groups (at most 3). Required for a heatmap and a treemap.
34
- * @param {{ key: string, label?: string }} [props.to] Where each sankey flow ends; `x` is where it starts. Required for a sankey.
35
- * @param {{ key: string, label?: string, format?: object }} [props.size] A bubble's area. Required for a bubble.
36
- * @param {boolean} [props.trend] A scatter or bubble's straight trend line through the visible points.
37
- * @param {boolean} [props.zoom] A zoom slider under a line or area. On by default above 5,000 rows.
38
- * @param {{ upTo: number, label: string }[]} [props.bands] A gauge's named stretches of its scale, each up to a value.
39
- * @param {'none'|'stacked'|'percent'} [props.stack='none'] For area, column and bar.
40
- * @param {{ label?: string, format?: object, min?: number, max?: number }} [props.y] The one value axis. There is no second axis: show another measure as its own chart.
41
- * @param {{ value: number, label: string }} [props.target] A dashed reference line.
42
- * @param {number} [props.height=320] In px, the axis labels included. A value that is not above 0 draws at the default.
43
- * @param {'ready'|'loading'|'empty'|'error'} [props.state='ready'] `loading` after a first draw keeps that picture on screen, dimmed.
44
- * @param {string} [props.emptyText] Replaces the default empty message.
45
- * @param {string} [props.errorText] Replaces the default error message. Say what the person can do.
46
- * @param {'auto'|'svg'|'canvas'} [props.renderer='auto'] `auto` draws SVG, and canvas above 5,000 points.
47
- * @param {'chart'|'table'} [props.view='chart'] `table` shows the data table in the chart's place.
48
- * @param {(detail: { series: string, label: string, x: unknown, value: number|null, row: object, index: number }) => void} [props.onSelect] A mark was clicked, or Enter was pressed on the focused point.
49
- * @param {(detail: { visible: Record<string, boolean> }) => void} [props.onLegendChange] A legend button was pressed.
50
- * @param {(detail: { renderer: string }) => void} [props.onReady] The first picture has finished drawing.
51
- * @param {string} [props.className] Extra classes on the element.
52
- * @param {import('react').CSSProperties} [props.style] Inline style on the element.
53
- * @param {import('react').Ref<HTMLElement>} [ref] The `<wui-chart>` element, which has `toCsv()`, `toPng()`, `exportCsv()` and `exportPng()`.
54
- */
55
- declare const AppChart: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
1
+ declare const AppChart: import("react").ForwardRefExoticComponent<{
2
+ type: 'line' | 'area' | 'column' | 'bar' | 'donut' | 'heatmap' | 'calendar' | 'funnel' | 'gauge' | 'waterfall' | 'treemap' | 'sankey' | 'scatter' | 'bubble' | 'multiples';
3
+ title: string;
4
+ description?: string;
5
+ data: Record<string, string | number | null>[];
6
+ x: {
7
+ key: string;
8
+ kind?: 'category' | 'time' | 'value';
9
+ format?: object;
10
+ label?: string;
11
+ };
12
+ series: {
13
+ key: string;
14
+ label: string;
15
+ format?: object;
16
+ }[];
17
+ group?: {
18
+ key: string;
19
+ label?: string;
20
+ };
21
+ to?: {
22
+ key: string;
23
+ label?: string;
24
+ };
25
+ size?: {
26
+ key: string;
27
+ label?: string;
28
+ format?: object;
29
+ };
30
+ trend?: boolean;
31
+ zoom?: boolean;
32
+ bands?: {
33
+ upTo: number;
34
+ label: string;
35
+ }[];
36
+ stack?: 'none' | 'stacked' | 'percent';
37
+ y?: {
38
+ label?: string;
39
+ format?: object;
40
+ min?: number;
41
+ max?: number;
42
+ };
43
+ target?: {
44
+ value: number;
45
+ label: string;
46
+ };
47
+ height?: number;
48
+ state?: 'ready' | 'loading' | 'empty' | 'error';
49
+ emptyText?: string;
50
+ errorText?: string;
51
+ renderer?: 'auto' | 'svg' | 'canvas';
52
+ view?: 'chart' | 'table';
53
+ onSelect?: (detail: {
54
+ series: string;
55
+ label: string;
56
+ x: unknown;
57
+ value: number | null;
58
+ row: object;
59
+ index: number;
60
+ }) => void;
61
+ onLegendChange?: (detail: {
62
+ visible: Record<string, boolean>;
63
+ }) => void;
64
+ onReady?: (detail: {
65
+ renderer: string;
66
+ }) => void;
67
+ className?: string;
68
+ style?: import('react').CSSProperties;
69
+ } & import("react").RefAttributes<HTMLElement>>;
56
70
  export default AppChart;
@@ -1,19 +1,9 @@
1
- /**
2
- * Shared checkbox on Bootstrap `.form-check` markup (Razor <app-checkbox> matches).
3
- * Theme restyles `.form-check-input` as the one selection glyph; table row-select
4
- * uses the `.wui-check` alias of the same skin.
5
- *
6
- * The label is bound with id/htmlFor rather than react-bootstrap's `label` prop:
7
- * that rendered a <label> with no `for`, so clicking the text did nothing.
8
- *
9
- * @param {object} props
10
- * @param {import('react').ReactNode} [props.label]
11
- * @param {string} [props.id]
12
- * @param {string} [props.name]
13
- * @param {string} [props.error] Error message, rendered below the control. Replaces the hint.
14
- * @param {string} [props.hint] Helper text below the control. Hidden while an error is shown.
15
- * @param {string} [props.className]
16
- * @param {import('react').Ref<HTMLInputElement>} [ref]
17
- */
18
- declare const AppCheckbox: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
1
+ declare const AppCheckbox: import("react").ForwardRefExoticComponent<{
2
+ label?: import('react').ReactNode;
3
+ id?: string;
4
+ name?: string;
5
+ error?: string;
6
+ hint?: string;
7
+ className?: string;
8
+ } & import("react").RefAttributes<HTMLInputElement>>;
19
9
  export default AppCheckbox;
@@ -1,14 +1,11 @@
1
1
  import "@webority/ui-elements/elements/country-select";
2
- /**
3
- * @param {object} props
4
- * @param {string} [props.value] Selected ISO 3166-1 alpha-2 code, e.g. "IN".
5
- * @param {(value: string) => void} [props.onChange] Called with the chosen ISO code.
6
- * @param {string[]} [props.countries] Limit the list to these ISO codes (alphabetical by name).
7
- * Omitted, every country is listed.
8
- * @param {boolean} [props.searchable=true] Show the search box in the menu.
9
- * @param {'sm'|'md'|'lg'} [props.size='md'] Control size, same as AppInput.
10
- * @param {string} [props.className] Class to apply to the control element.
11
- * @param {string} [props.fieldClassName] Class to apply to the wrapper field div.
12
- */
13
- declare const AppCountrySelect: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
2
+ declare const AppCountrySelect: import("react").ForwardRefExoticComponent<{
3
+ value?: string;
4
+ onChange?: (value: string) => void;
5
+ countries?: string[];
6
+ searchable?: boolean;
7
+ size?: 'sm' | 'md' | 'lg';
8
+ className?: string;
9
+ fieldClassName?: string;
10
+ } & import("react").RefAttributes<any>>;
14
11
  export default AppCountrySelect;
@@ -1,36 +1,22 @@
1
1
  import "@webority/ui-elements/elements/datepicker";
2
- /**
3
- * Thin React wrapper over the shared `<wui-datepicker>` element (single
4
- * implementation, so React and Razor render the same control).
5
- *
6
- * Wraps it in the standard `.field` shell — label / required mark / hint /
7
- * error — the same as `<app-date-picker>` and every other field primitive.
8
- * Without that a caller had to hand-roll the label, which is exactly the
9
- * per-screen divergence this library exists to prevent. The shell is omitted
10
- * entirely when there is nothing to render around the control.
11
- *
12
- * @param {object} props
13
- * @param {string} [props.value] ISO date string
14
- * @param {(value: string) => void} [props.onChange]
15
- * @param {string} [props.label]
16
- * @param {boolean} [props.required]
17
- * @param {string} [props.hint]
18
- * @param {string} [props.error]
19
- * @param {string} [props.name]
20
- * @param {string} [props.min]
21
- * @param {string} [props.max]
22
- * @param {string} [props.placeholder="Choose a date"]
23
- * @param {boolean} [props.disabled]
24
- * @param {'sm'|'md'|'lg'} [props.size] Control height tier, matching AppInput.
25
- * @param {0|1|2|3|4|5|6} [props.firstDay] First weekday of the calendar, 0 Sunday to 6 Saturday. Unset, it
26
- * follows the theme's `--wui-first-day` token, which is 1 (Monday) unless the product sets it.
27
- * @param {string} [props.displayFormat="dd-MMM-yyyy"] How the chosen date reads in the field, from the tokens
28
- * yyyy, MMMM, MMM, MM, dd and d (for example `dd/MM/yyyy`). The `onChange` value stays ISO.
29
- * @param {string} [props.id]
30
- * @param {string} [props.ariaLabel]
31
- * @param {string} [props.className] Classes for the `<wui-datepicker>` control itself.
32
- * @param {string} [props.fieldClassName] Classes for the `.field` wrapper (label/hint/error shell).
33
- * @param {import('react').Ref<HTMLElement>} [ref]
34
- */
35
- declare const AppDatePicker: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
2
+ declare const AppDatePicker: import("react").ForwardRefExoticComponent<{
3
+ value?: string;
4
+ onChange?: (value: string) => void;
5
+ label?: string;
6
+ required?: boolean;
7
+ hint?: string;
8
+ error?: string;
9
+ name?: string;
10
+ min?: string;
11
+ max?: string;
12
+ placeholder?: string;
13
+ disabled?: boolean;
14
+ size?: 'sm' | 'md' | 'lg';
15
+ firstDay?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
16
+ displayFormat?: string;
17
+ id?: string;
18
+ ariaLabel?: string;
19
+ className?: string;
20
+ fieldClassName?: string;
21
+ } & import("react").RefAttributes<HTMLElement>>;
36
22
  export default AppDatePicker;
@@ -1,40 +1,31 @@
1
1
  import "@webority/ui-elements/elements/date-range";
2
- /**
3
- * Thin React wrapper over the shared `<wui-date-range>` element — a start/end date range
4
- * field with a two-month popover calendar (single implementation, so React and Razor render
5
- * the same control). Wrapped in the standard `.field` shell — label / required mark / hint /
6
- * error — the same as `<app-date-range-picker>` and every other field primitive.
7
- *
8
- * Controlled through two ISO strings; `onChange` fires with `{ start, end }` when the range
9
- * completes or is cleared.
10
- *
11
- * @param {object} props
12
- * @param {string} [props.start] Range start as an ISO date string (YYYY-MM-DD).
13
- * @param {string} [props.end] Range end as an ISO date string (YYYY-MM-DD).
14
- * @param {(range: { start: string, end: string }) => void} [props.onChange]
15
- * @param {string} [props.label]
16
- * @param {boolean} [props.required]
17
- * @param {string} [props.hint]
18
- * @param {string} [props.error]
19
- * @param {string} [props.startName] Form field name the start date posts under.
20
- * @param {string} [props.endName] Form field name the end date posts under.
21
- * @param {string} [props.min]
22
- * @param {string} [props.max]
23
- * @param {string} [props.placeholder="Start to End"]
24
- * @param {boolean} [props.disabled]
25
- * @param {'sm'|'md'|'lg'} [props.size] Control height tier, matching AppInput.
26
- * @param {0|1|2|3|4|5|6} [props.firstDay] First weekday of the calendar, 0 Sunday to 6 Saturday. Unset, it
27
- * follows the theme's `--wui-first-day` token, which is 1 (Monday) unless the product sets it.
28
- * @param {(('today'|'yesterday'|'last7Days'|'last30Days'|'thisMonth'|'lastMonth'|'thisFinancialYear')|{ label: string, start: string, end: string })[]} [props.presets]
29
- * Quick ranges, listed beside the calendar (above it on a phone); picking one fills the range and
30
- * closes the calendar. An item is a name, resolved against today in IST (`thisFinancialYear` runs
31
- * 1 April to 31 March; `thisMonth` and `lastMonth` span the whole month), or `{ label, start, end }`
32
- * with ISO dates. A preset outside `min`/`max` is disabled.
33
- * @param {string} [props.id]
34
- * @param {string} [props.ariaLabel]
35
- * @param {string} [props.className] Class to apply to the control element.
36
- * @param {string} [props.fieldClassName] Class to apply to the wrapper field div.
37
- * @param {import('react').Ref<HTMLElement>} [ref]
38
- */
39
- declare const AppDateRangePicker: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
2
+ declare const AppDateRangePicker: import("react").ForwardRefExoticComponent<{
3
+ start?: string;
4
+ end?: string;
5
+ onChange?: (range: {
6
+ start: string;
7
+ end: string;
8
+ }) => void;
9
+ label?: string;
10
+ required?: boolean;
11
+ hint?: string;
12
+ error?: string;
13
+ startName?: string;
14
+ endName?: string;
15
+ min?: string;
16
+ max?: string;
17
+ placeholder?: string;
18
+ disabled?: boolean;
19
+ size?: 'sm' | 'md' | 'lg';
20
+ firstDay?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
21
+ presets?: (('today' | 'yesterday' | 'last7Days' | 'last30Days' | 'thisMonth' | 'lastMonth' | 'thisFinancialYear') | {
22
+ label: string;
23
+ start: string;
24
+ end: string;
25
+ })[];
26
+ id?: string;
27
+ ariaLabel?: string;
28
+ className?: string;
29
+ fieldClassName?: string;
30
+ } & import("react").RefAttributes<HTMLElement>>;
40
31
  export default AppDateRangePicker;
@@ -10,7 +10,8 @@
10
10
  * the tighter widget/tile variant (smaller title + text).
11
11
  *
12
12
  * @param {object} props
13
- * @param {string|import('react').ReactNode} props.icon Semantic icon name for the bubble, or a custom node
13
+ * @param {string|import('react').ReactNode} [props.icon] Semantic icon name for the bubble, or a custom node.
14
+ * Needed unless `illustration` is set, which replaces the bubble.
14
15
  * @param {string|import('react').ReactNode} [props.illustration] A named drawing ("no-results" | "no-data" | "empty-inbox" | "no-notifications" | "no-files" | "no-access" | "offline" | "error"), or your own decorative SVG node drawn unboxed at up to 120 px. Replaces the icon bubble when set.
15
16
  * @param {number} [props.iconSize=24]
16
17
  * @param {"md"|"sm"} [props.size="md"]
@@ -21,7 +22,7 @@
21
22
  * @param {import('react').CSSProperties} [props.style]
22
23
  */
23
24
  export default function AppEmptyState({ icon, illustration, iconSize, size, title, text, action, className, style, ...rest }: {
24
- icon: string | import('react').ReactNode;
25
+ icon?: string | import('react').ReactNode;
25
26
  illustration?: string | import('react').ReactNode;
26
27
  iconSize?: number;
27
28
  size?: "md" | "sm";
@@ -1,56 +1,24 @@
1
- /**
2
- * Shows a file inside the page: a toolbar with the file's name and the controls its kind
3
- * needs, and the file below it: a PDF (drawn with pdf.js), an image, a video or an audio file.
4
- * A file it cannot show gets a message and a download link instead.
5
- *
6
- * Wraps the shared `<wui-file-viewer>` element, the same one the Razor `<app-file-viewer>`
7
- * uses. The element lives in its own entry, `@webority/ui-elements/file-viewer`, because
8
- * pdf.js is large: this component loads it when it first mounts, so a page without a viewer
9
- * never downloads it.
10
- *
11
- * The viewer fills the box its parent gives it; the theme gives it a default height.
12
- *
13
- * ```jsx
14
- * const viewer = useRef(null);
15
- * <AppButton onClick={() => viewer.current.seekTo(30)}>Jump to 0:30</AppButton>
16
- * <AppFileViewer ref={viewer} src="/files/briefing.mp4" />
17
- *
18
- * <AppFileViewer
19
- * src="/files/contract.pdf"
20
- * name="Contract.pdf"
21
- * download
22
- * actions={<AppButton size="sm">Approve</AppButton>}
23
- * onError={(detail) => console.warn(detail.message)}
24
- * />
25
- * ```
26
- *
27
- * @param {object} props
28
- * @param {string} props.src The file's URL. Changing it opens the new file.
29
- * @param {string} [props.name] The name shown in the toolbar and used for printing and download. Defaults to the last part of `src`.
30
- * @param {string} [props.type] The file's MIME type. Defaults to a guess from the extension of `name` or `src`.
31
- * @param {object} [props.prefs] The view settings to start from, when your app stores them itself (for example
32
- * against the signed-in person). Read when a file opens. With it, the browser stores nothing; save what
33
- * `onPrefsChange` hands you and pass it back next time.
34
- * @param {(prefs: object) => void} [props.onPrefsChange] Called with all the view settings whenever the reader
35
- * changes one (zoom, two-page view, thumbnails, volume, speed).
36
- * @param {string} [props.viewKey] Remembers the view settings (zoom, two-page view, thumbnails)
37
- * in this browser under this key. Without it they last for the viewer's life.
38
- * @param {boolean} [props.download=false] Shows a download button in the toolbar.
39
- * @param {boolean} [props.print=true] Shows the print button for a PDF or an image. Pass false to hide it.
40
- * @param {string} [props.workerSrc] URL of a hosted pdf.js worker, for a site whose content
41
- * security policy refuses blob: workers. Defaults to the bundled copy.
42
- * @param {string} [props.captions] A WebVTT captions file for a video; adds a captions button to the player.
43
- * @param {string} [props.assetBase] Folder holding pdf.js's cmaps/, standard_fonts/ and wasm/,
44
- * which unusual PDFs need (Asian text, fonts a file does not embed, some scanned images).
45
- * @param {import('react').ReactNode} [props.actions] Your own controls, shown at the end of the toolbar. Hidden in full screen.
46
- * @param {(detail: { kind: string, pages: number }) => void} [props.onLoad] Called once the file shows, with its kind and page count.
47
- * @param {(detail: { message: string }) => void} [props.onError] Called when the file cannot be opened.
48
- * @param {string} [props.className] Extra classes on the element.
49
- * @param {import('react').CSSProperties} [props.style] Inline style; lands on the element with `className`. Set a height here to size the viewer.
50
- * @param {import('react').Ref<HTMLElement>} [ref] The `<wui-file-viewer>` element. For a video or audio file,
51
- * `ref.current.seekTo(seconds)` moves the player to that point, kept within the file's length, and returns
52
- * true; with no video or audio open (another kind of file, or before `onLoad`) it does nothing and returns
53
- * false. Anything but a finite number of seconds throws.
54
- */
55
- declare const AppFileViewer: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
1
+ declare const AppFileViewer: import("react").ForwardRefExoticComponent<{
2
+ src: string;
3
+ name?: string;
4
+ type?: string;
5
+ prefs?: object;
6
+ onPrefsChange?: (prefs: object) => void;
7
+ viewKey?: string;
8
+ download?: boolean;
9
+ print?: boolean;
10
+ workerSrc?: string;
11
+ captions?: string;
12
+ assetBase?: string;
13
+ actions?: import('react').ReactNode;
14
+ onLoad?: (detail: {
15
+ kind: string;
16
+ pages: number;
17
+ }) => void;
18
+ onError?: (detail: {
19
+ message: string;
20
+ }) => void;
21
+ className?: string;
22
+ style?: import('react').CSSProperties;
23
+ } & import("react").RefAttributes<HTMLElement>>;
56
24
  export default AppFileViewer;